diff --git a/dist/mlk-power-flow-card.js b/dist/mlk-power-flow-card.js index 78ed836..9899123 100644 --- a/dist/mlk-power-flow-card.js +++ b/dist/mlk-power-flow-card.js @@ -43,4 +43,4 @@ const st=t=>(e,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(t,e) * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ -function ut(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 ht;const yt=((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)})(ht||(ht=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 ft,mt,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"}(ft||(ft={})),function(t){t.Energy="energy",t.Power="power",t.AutoSelf="auto&self",t.No="no"}(mt||(mt={})),function(t){t.none="none",t.inner="Minimal inner view"}(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_bat:"Priority Bat",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"},bt={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"},At={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",show_battery_banks:"Show Battery Banks",battery_banks:"Battery Banks",battery_bank_1_energy:"Bank 1 Max Energy",battery_bank_2_energy:"Bank 2 Max Energy",battery_bank_3_energy:"Bank 3 Max Energy",battery_bank_4_energy:"Bank 4 Max Energy",battery_banks_view_mode:"Battery Banks View mode",cat_title:{title:"Title Options",general:"General Options",adv_viewbox:"Adv. ViewBox Options",optional_ent:"Optional Entities",inverter:"Inverter Options",inv:"Inverter Entities",inv_prog:"Programs Entities",solar:"Solar Options",solar_production:"Solar Production",solar_production_ent:"Solar Production Entites",max_power:"PV Max Power",mppt_options:"PVs options",pv_1_ent:"PV1 Entities",pv_2_ent:"PV2 Entities",pv_3_ent:"PV3 Entities",pv_4_ent:"PV4 Entities",pv_5_ent:"PV5 Entities",battery:"Battery Options",battery_ent:"Battery Entities",battery_bank:"Battery Banks Options",battery_bank_1_ent:"Battery Bank 1 Entities",battery_bank_2_ent:"Battery Bank 2 Entities",battery_bank_3_ent:"Battery Bank 3 Entities",battery_bank_4_ent:"Battery Bank 4 Entities",load:"Load Options",load_ent:"Load Entities",additional_load:"Additional Load Options",additional_loads_1:"Additional Load 1-8 Options",additional_loads_2:"Additional Load 9-13 Options",additional_loads_3:"Additional Load 14-18 Options",additional_loads_4:"Additional Load 19-23 Options",ess_ld_1:"Additional Load 1-8 Entities",ess_ld_2:"Additional Load 9-13 Entities",ess_ld_3:"Additional Load 14-18 Entities",ess_ld_4:"Additional Load 19-23 Entities",aux_load:"Aux Load Options",aux_load_ent:"Aux Load Entities",grid:"Grid Options",gri_ent:"Grid Entities",ness_load:"Non-Essential Load Options",ness_load_ent:"Non-Essential Load Entities"}},wt={common:vt,errors:bt,config:At};const xt={hass:null},Et={en:Object.freeze({__proto__:null,common:vt,config:At,default:wt,errors:bt})};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,dev_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:ft.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,battery_banks_view_mode:pt.none},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 _t=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],kt=[0,1,2,3],Mt=[!0,!1],Ct=[!0,!1],Nt=[0,1,2],Bt=["off","0","off-grid","off grid","offgrid"],Tt=["on","1","on-grid","on grid","ongrid"],zt="mlk-content-card-editor";var Ot,Rt,Gt,Dt,jt,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"}(Ot||(Ot={})),function(t){t.WATT="W",t.KILO_WATT="kW",t.MEGA_WATT="MW",t.BTU_PER_HOUR="BTU/h"}(Rt||(Rt={})),function(t){t.GIGA_JOULE="GJ",t.KILO_WATT_HOUR="kWh",t.MEGA_JOULE="MJ",t.MEGA_WATT_HOUR="MWh",t.WATT_HOUR="Wh"}(Gt||(Gt={})),function(t){t.MILLIAMPERE="mA",t.AMPERE="A"}(Dt||(Dt={})),function(t){t.MILLIVOLT="mV",t.VOLT="V"}(jt||(jt={})),function(t){t.HERTZ="Hz"}(St||(St={}));const It={[Gt.WATT_HOUR]:[{threshold:1e6,divisor:1e6,targetUnit:Gt.MEGA_WATT_HOUR},{threshold:1e3,divisor:1e3,targetUnit:Gt.KILO_WATT_HOUR,decimal:1}],[Gt.KILO_WATT_HOUR]:[{threshold:1e3,divisor:1e3,targetUnit:Gt.MEGA_WATT_HOUR,decimal:2}],[Gt.MEGA_WATT_HOUR]:[],[Gt.GIGA_JOULE]:[{threshold:1e3,divisor:1e3,targetUnit:Gt.MEGA_JOULE}],[Gt.MEGA_JOULE]:[],[Rt.WATT]:[{threshold:1e6,divisor:1e6,targetUnit:Rt.MEGA_WATT},{threshold:1e3,divisor:1e3,targetUnit:Rt.KILO_WATT}],[Rt.KILO_WATT]:[{threshold:1e3,divisor:1e3,targetUnit:Rt.MEGA_WATT}],[Rt.MEGA_WATT]:[],[Rt.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 Ut={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*)$/,y={};y["[object Float32Array]"]=y["[object Float64Array]"]=y["[object Int8Array]"]=y["[object Int16Array]"]=y["[object Int32Array]"]=y["[object Uint8Array]"]=y["[object Uint8ClampedArray]"]=y["[object Uint16Array]"]=y["[object Uint32Array]"]=!0,y[o]=y["[object Array]"]=y["[object ArrayBuffer]"]=y["[object Boolean]"]=y["[object DataView]"]=y["[object Date]"]=y["[object Error]"]=y[i]=y["[object Map]"]=y["[object Number]"]=y[c]=y["[object RegExp]"]=y["[object Set]"]=y["[object String]"]=y["[object WeakMap]"]=!1;var f="object"==typeof Ht&&Ht&&Ht.Object===Object&&Ht,m="object"==typeof self&&self&&self.Object===Object&&self,p=f||m||Function("return this")(),v=e&&!e.nodeType&&e,b=v&&t&&!t.nodeType&&t,A=b&&b.exports===v,w=A&&f.process,x=function(){try{var t=b&&b.require&&b.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),E=x&&x.isTypedArray;var L,P=Array.prototype,_=Function.prototype,k=Object.prototype,M=p["__core-js_shared__"],C=_.toString,N=k.hasOwnProperty,B=(L=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"",T=k.toString,z=C.call(Object),O=RegExp("^"+C.call(N).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R=A?p.Buffer:void 0,G=p.Symbol,D=p.Uint8Array;R&&R.allocUnsafe;var j,S,I=(j=Object.getPrototypeOf,S=Object,function(t){return j(S(t))}),H=Object.create,V=k.propertyIsEnumerable,U=P.splice,Q=G?G.toStringTag:void 0,W=function(){try{var t=mt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=R?R.isBuffer:void 0,Z=Math.max,X=Date.now,F=mt(p,"Map"),J=mt(Object,"create"),K=function(){function t(){}return function(e){if(!Mt(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=ft(this,t).delete(t);return this.size-=e?1:0,e},tt.prototype.get=function(t){return ft(this,t).get(t)},tt.prototype.has=function(t){return ft(this,t).has(t)},tt.prototype.set=function(t,e){var n=ft(this,t),a=n.size;return n.set(t,e),this.size+=n.size==a?0:1,this},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:Q&&Q in Object(t)?function(t){var e=N.call(t,Q),n=t[Q];try{t[Q]=void 0;var a=!0}catch(t){}var o=T.call(t);a&&(e?t[Q]=n:delete t[Q]);return o}(t):function(t){return T.call(t)}(t)}function ct(t){return Ct(t)&<(t)==o}function dt(t){return!(!Mt(t)||function(t){return!!B&&B in t}(t))&&(_t(t)?O:g).test(function(t){if(null!=t){try{return C.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function ut(t){if(!Mt(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&&N.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),Mt(r))!function(t,e,n,a,o,r,i){var s=bt(t,n),l=bt(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),y=!h&&Pt(l),f=!h&&!y&&Nt(l);u=l,h||y||f?Et(s)?u=s:Ct(m=s)&&Lt(m)?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)}}(yt);function wt(t,e){return t===e||t!=t&&e!=e}var xt=ct(function(){return arguments}())?ct:function(t){return Ct(t)&&N.call(t,"callee")&&!V.call(t,"callee")},Et=Array.isArray;function Lt(t){return null!=t&&kt(t.length)&&!_t(t)}var Pt=Y||function(){return!1};function _t(t){if(!Mt(t))return!1;var e=lt(t);return e==i||e==s||e==r||e==d}function kt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Mt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ct(t){return null!=t&&"object"==typeof t}var Nt=E?function(t){return function(e){return t(e)}}(E):function(t){return Ct(t)&&kt(t.length)&&!!y[lt(t)]};function Bt(t){return Lt(t)?nt(t):ut(t)}var Tt,zt=(Tt=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=Tt.length>3&&"function"==typeof o?(a--,o):void 0,r&&function(t,e,n){if(!Mt(n))return!1;var a=typeof e;return!!("number"==a?Lt(n)&&pt(e,n.length):"string"==a&&e in n)&&wt(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,a=!0){n=isNaN(n)?2:n;const o=Number(t);if(isNaN(o))return Number(0).toFixed(n);const r=It[e];if(!r)return a?"".concat(this.toNum(o,n)," ").concat(e):"".concat(this.toNum(o,n));if(e===Rt.WATT&&Math.abs(o)<1e3)return a?"".concat(Math.round(o)," ").concat(e):"".concat(Math.round(o));if(e===Rt.KILO_WATT&&Math.abs(o)<1)return a?"".concat(Math.round(1e3*o)," W"):"".concat(Math.round(1e3*o));if(e===Rt.MEGA_WATT&&Math.abs(o)<1)return a?"".concat((1e3*o).toFixed(n)," kW"):"".concat((1e3*o).toFixed(n));for(const t of r)if(Math.abs(o)>=t.threshold){const e=(o/t.divisor).toFixed(t.decimal||n);return a?"".concat(e," ").concat(t.targetUnit):"".concat(e)}return a?"".concat(o.toFixed(n)," ").concat(e):"".concat(o.toFixed(n))}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 U(Qt||(Qt=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=>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 U(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 U(Yt||(Yt=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(Hn.convertValue(t.loadPowerL1,t.decimalPlaces)||0):"".concat(t.loadPowerL1||0," ").concat(Rt.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(Rt.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(Rt.WATT))}static generateShapeAndName(t,e){const n=400+(this.LOAD_X-400)/2-101.3;return U(Zt||(Zt=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 U(Xt||(Xt=gt(["\n\t\t\t","\n\t\t"])),e.entities?.essential_power&&"none"!==e.entities.essential_power?U(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=>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(Rt.WATT)):U(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(Hn.convertValue(t.essentialPower,t.decimalPlaces)||0):"".concat(t.essentialPower||0," ").concat(Rt.WATT)))}static generateIcon(t,e){return U(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)}}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 Un{static getIconWithCondition(t,e,n,a,o,r=30){return U(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 U($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 U(te||(te=gt(["\n\t\t","\n\t\t"])),t?U(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()||f.isValidSwitch()?"":"none",t,e,s,l,a,i?"".concat(i):"",!c.isValid()&&f.isValidSwitch()?U(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=>Hn.handlePopup(t,f.entity_id)),t,e,d,u,a,Lt("common."+(f?.toOnOff()||"off"))):U(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=>Hn.handlePopup(t,c.entity_id)),t,e,d,u,c.isValid()?"":"none",a,c?.toPowerString(m,p)),(t=>Hn.handlePopup(t,g.entity_id)),t,e,h,y,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=Un.getIconLink(i.entity_id,Un.getIcon(c+u[0],d,e,"essload".concat(t,"_small-icon")));return U(ie||(ie=gt(["\n\t\t\t\t",""])),Un.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=Un.getIconLink(i.entity_id,Un.getIcon(c+u[0],d,e,"nes-load".concat(t,"_small-icon")));return U(se||(se=gt(["\n\t\t\t\t",""])),Un.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=Un.getIconLink(i.entity_id,Un.getIcon(c+u[0],d,e,"aux-load".concat(t,"_small-icon")));return U(le||(le=gt(["\n\t\t\t\t",""])),Un.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()?U(ce||(ce=gt(['\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 U(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=>Hn.handlePopup(t,e.entity_id)),t,n,a,e.isValid()?"":"none",o,e.toStr(1)||0,Dt.AMPERE)}static generatePhaseVoltage(t,e,n,a,o){return U(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=>Hn.handlePopup(t,e.entity_id)),t,n,a,e.isValid()?"":"none",o,e.toStr(1)||0,jt.VOLT)}static generatePhasePower(t,e,n,a,o,r,i){return U(ge||(ge=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=>Hn.handlePopup(t,e.entity_id)),t,n,a,e.isValid()?"":"none",r,o?"".concat(Hn.convertValue(e,i)||0):"".concat(e||0," ").concat(Rt.WATT))}}class Qn{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?U(he||(he=gt([""]))):U(ye||(ye=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=Un.getIconWithCondition(t.additionalLoad<=3,a,n?113:95,t.iconEssentialLoad1,"essload1-icon",36),l=Un.getIconLink(t.stateEssentialLoad1Toggle.entity_id,s);return U(fe||(fe=gt(["",""])),t.additionalLoad>=4?U(me||(me=gt(["\n\t\t\t",""])),Un.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)):U(pe||(pe=gt(["","\n\t\t\t"])),t.additionalLoad>=1?U(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):"",(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=Un.getIcon(n,250,t.iconEssentialLoad2,"essload2-icon",36),s=Un.getIconLink(t.stateEssentialLoad2Toggle.entity_id,i);return U(be||(be=gt(["",""])),t.additionalLoad>=4?U(Ae||(Ae=gt(["\n\t\t\t",""])),Un.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)):U(we||(we=gt(["",""])),3===t.additionalLoad?U(xe||(xe=gt(["\n\t\t\t\t\t",""])),Un.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)):U(Ee||(Ee=gt(["",""])),2===t.additionalLoad?U(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):"",(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()):U(Pe||(Pe=gt([""]))))))}static generateLoad3(t,e){return U(_e||(_e=gt(["",""])),3===t.additionalLoad?U(ke||(ke=gt(["\n\t\t\t\t",""])),Un.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)):U(Me||(Me=gt(["",""])),t.additionalLoad>=4?U(Ce||(Ce=gt(["\n\t\t\t\t\t",""])),Un.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)):U(Ne||(Ne=gt([""])))))}static generateLoad4(t,e){return U(Be||(Be=gt(["",""])),t.additionalLoad>=4?U(Te||(Te=gt(["\n\t\t\t\t",""])),Un.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)):U(ze||(ze=gt([""]))))}static generateLoad5(t,e){return U(Oe||(Oe=gt(["",""])),t.additionalLoad>=5?U(Re||(Re=gt(["\n\t\t\t\t",""])),Un.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)):U(Ge||(Ge=gt([""]))))}static generateLoad6(t,e){return U(De||(De=gt(["",""])),t.additionalLoad>=6?U(je||(je=gt(["\n\t\t\t\t",""])),Un.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)):U(Se||(Se=gt([""]))))}static generateLoad7(t,e){return U(Ie||(Ie=gt(["",""])),t.additionalLoad>=7&&!e.load.show_aux?U(He||(He=gt(["\n\t\t\t\t",""])),Un.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)):U(Ve||(Ve=gt([""]))))}static generateLoad8(t,e){return U(Ue||(Ue=gt(["",""])),t.additionalLoad>=8&&!e.load.show_aux?U(Qe||(Qe=gt(["\n\t\t\t\t",""])),Un.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)):U(We||(We=gt([""]))))}static generateLoad9(t,e){return U(Ye||(Ye=gt(["",""])),t.additionalLoad>=9&&(!e.load.show_aux||e.load.aux_loads<3)?U(Ze||(Ze=gt(["\n\t\t\t\t",""])),Un.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)):U(Xe||(Xe=gt([""]))))}static generateLoad10(t,e){return U(Fe||(Fe=gt(["",""])),t.additionalLoad>=10?U(Je||(Je=gt(["\n\t\t\t\t",""])),Un.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)):U(Ke||(Ke=gt([""]))))}static generateLoad11(t,e){return U(qe||(qe=gt(["",""])),t.additionalLoad>=11?U($e||($e=gt(["\n\t\t\t",""])),Un.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)):U(tn||(tn=gt([""]))))}static generateLoad12(t,e){return U(en||(en=gt(["",""])),t.additionalLoad>=12?U(nn||(nn=gt(["\n\t\t\t",""])),Un.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)):U(an||(an=gt([""]))))}static generateLoad13(t,e){return U(on||(on=gt(["",""])),t.additionalLoad>=13?U(rn||(rn=gt(["\n\t\t\t",""])),Un.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)):U(sn||(sn=gt([""]))))}static generateLoad14(t,e){return U(ln||(ln=gt(["",""])),t.additionalLoad>=14&&(!e.load.show_aux||e.load.aux_loads<4)?U(cn||(cn=gt(["\n\t\t\t\t",""])),Un.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)):U(dn||(dn=gt([""]))))}static generateLoad15(t,e){return U(un||(un=gt(["",""])),t.additionalLoad>=15?U(gn||(gn=gt(["\n\t\t\t\t",""])),Un.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)):U(hn||(hn=gt([""]))))}static generateLoad16(t,e){return U(yn||(yn=gt(["",""])),t.additionalLoad>=16?U(fn||(fn=gt(["\n\t\t\t",""])),Un.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)):U(mn||(mn=gt([""]))))}static generateLoad17(t,e){return U(pn||(pn=gt(["",""])),t.additionalLoad>=17?U(vn||(vn=gt(["\n\t\t\t",""])),Un.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)):U(bn||(bn=gt([""]))))}static generateLoad18(t,e){return U(An||(An=gt(["",""])),t.additionalLoad>=18?U(wn||(wn=gt(["\n\t\t\t",""])),Un.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)):U(xn||(xn=gt([""]))))}static generateLoad19(t,e){return U(En||(En=gt(["",""])),t.additionalLoad>=19&&(!e.load.show_aux||e.load.aux_loads<5)?U(Ln||(Ln=gt(["\n\t\t\t\t",""])),Un.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)):U(Pn||(Pn=gt([""]))))}static generateLoad20(t,e){return U(_n||(_n=gt(["",""])),t.additionalLoad>=20?U(kn||(kn=gt(["\n\t\t\t\t",""])),Un.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)):U(Mn||(Mn=gt([""]))))}static generateLoad21(t,e){return U(Cn||(Cn=gt(["",""])),t.additionalLoad>=21?U(Nn||(Nn=gt(["\n\t\t\t",""])),Un.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)):U(Bn||(Bn=gt([""]))))}static generateLoad22(t,e){return U(Tn||(Tn=gt(["",""])),t.additionalLoad>=22?U(zn||(zn=gt(["\n\t\t\t",""])),Un.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)):U(On||(On=gt([""]))))}static generateLoad23(t,e){return U(Rn||(Rn=gt(["",""])),t.additionalLoad>=23?U(Gn||(Gn=gt(["\n\t\t\t",""])),Un.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)):U(Dn||(Dn=gt([""]))))}}Qn.mainX=Vn.LOAD_X;class Wn{static getTexts(t){const e=this.mainX,n=this.mainX+46;return U(jn||(jn=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===mt.No?"none":"",t.enableAutarky===mt.Energy?"st4 st8 left-align":"st12",t.inverterColour,t.autarkyEnergy,n,this.mainY,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.Energy?"st4 st8 left-align":"st12",t.inverterColour,t.ratioEnergy,e,this.mainY,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.Power?"st4 st8 left-align":"st12",t.inverterColour,t.autarkyPower,n,this.mainY,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.Power?"st4 st8 left-align":"st12",t.inverterColour,t.ratioPower,e,this.mainY,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.AutoSelf?"st4 st8 left-align":"st12",t.inverterColour,t.autarkyAuto,n,this.mainY,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.AutoSelf?"st4 st8 left-align":"st12",t.inverterColour,t.autarkySelf,e,this.mainY+13,t.enableAutarky===mt.No?"none":"",t.inverterColour,t.enableAutarky===mt.AutoSelf?Lt("common.autarkyAuto"):Lt("common.autarky"),n,this.mainY+13,t.enableAutarky===mt.No?"none":"",t.inverterColour,t.enableAutarky===mt.AutoSelf?Lt("common.autarkySelf"):Lt("common.ratio"))}}Wn.mainX=150,Wn.mainY=267;class Yn{static getStyle(t){return V(Sn||(Sn=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.dynamicColourEssentialLoad19,t.dynamicColourEssentialLoad20,t.dynamicColourEssentialLoad21,t.dynamicColourEssentialLoad22,t.dynamicColourEssentialLoad23,t.auxDynamicColourLoad1,t.auxDynamicColourLoad2,t.dynamicColourNonEssentialLoad,t.dynamicColourNonEssentialLoad1,t.dynamicColourNonEssentialLoad2,t.dynamicColourNonEssentialLoad3,t.customGridIconColour,t.inverterColour)}}const Zn="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,ya,fa,ma,pa,va,ba,Aa,wa,xa,Ea,La,Pa,_a,ka,Ma,Ca,Na,Ba,Ta,za,Oa,Ra,Ga,Da,ja,Sa,Ia,Ha,Va,Ua,Qa,Wa,Ya,Za,Xa,Fa,Ja,Ka,qa,$a,to,eo,no,ao,oo,ro,io,so,lo,co,uo,go,ho,yo,fo,mo,po,vo,bo,Ao,wo,xo,Eo,Lo,Po,_o,ko,Mo,Co,No,Bo,To,zo,Oo,Ro,Go,Do,jo,So,Io,Ho,Vo,Uo,Qo,Wo,Yo,Zo,Xo,Fo,Jo,Ko,qo,$o,tr,er,nr,ar,or,rr,ir,sr,lr,cr,dr,ur,gr,hr,yr,fr,mr,pr,vr,br,Ar,wr,xr,Er,Lr,Pr,_r,kr,Mr,Cr,Nr,Br,Tr,zr,Or,Rr,Gr,Dr,jr,Sr,Ir,Hr,Vr,Ur;class Qr{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 U(da||(da=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()?U(ua||(ua=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=>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(Rt.WATT)):U(ga||(ga=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?Hn.convertValue(t.totalPV,t.decimalPlaces)||0:"".concat(Hn.toNum(t.totalPV||0,0)," ").concat(Rt.WATT)))}static generateSolarHeader(t,e){let n,a=U(ha||(ha=gt([""]))),o=U(ya||(ya=gt([""]))),r=U(fa||(fa=gt([""]))),i=U(ma||(ma=gt([""]))),s=U(pa||(pa=gt([""]))),l=U(va||(va=gt([""]))),c=this.countGenerationElements(t);if(0==c)return U(ba||(ba=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=U(Aa||(Aa=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t'])),n.x,t.solarColour,ca),u=U(wa||(wa=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=>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),t.stateEnvironmentTemp.getUOM());return U(xa||(xa=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,U(Ea||(Ea=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=>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 U(La||(La=gt(["",""])),e.show_solar?U(Pa||(Pa=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)):U(_a||(_a=gt([""]))))}static generateMppt2(t,e){const n=this.getPositions(2,e.solar.mppts);return U(ka||(ka=gt(["",""])),e.show_solar&&e.solar.mppts>=2?U(Ma||(Ma=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)):U(Ca||(Ca=gt([""]))))}static generateMppt3(t,e){const n=this.getPositions(3,e.solar.mppts);return U(Na||(Na=gt(["",""])),e.show_solar&&e.solar.mppts>=3?U(Ba||(Ba=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)):U(Ta||(Ta=gt([""]))))}static generateMppt4(t,e){const n=this.getPositions(4,e.solar.mppts);return U(za||(za=gt(["",""])),e.show_solar&&e.solar.mppts>=4?U(Oa||(Oa=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)):U(Ra||(Ra=gt([""]))))}static generateMppt5(t,e){const n=this.getPositions(5,e.solar.mppts);return U(Ga||(Ga=gt(["",""])),e.show_solar&&e.solar.mppts>=5?U(Da||(Da=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)):U(ja||(ja=gt([""]))))}static generatePower(t,e,n,a){return U(Sa||(Sa=gt(['\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)+" "+Rt.WATT)}static generateFrame(t,e,n,a){return U(Ia||(Ia=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 U(Ha||(Ha=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 U(Va||(Va=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 U(Ua||(Ua=gt(['\n \n ',"%\n "])),t[2],n?"st3 st8 right-align":"st12",n?"":"none",this.solarColour,e)}static generateEnergy(t,e,n){return U(Qa||(Qa=gt(['\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 U(Wa||(Wa=gt(['\n \n ',"","\n \n "])),(t=>Hn.handlePopup(t,e.entity_id)),t[3],e.isValid()?"":"none",this.solarColour,e.toNum(1),jt.VOLT)}static generateAmperage(t,e){return U(Ya||(Ya=gt(['\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),Dt.AMPERE)}static generateSolarSellIcon(t,e){return U(Za||(Za=gt(['\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)}}Qr._solarColour="orange",Qr._decimalPlacesEnergy=2,Qr._decimalPlaces=2,Qr.pvLineMap={pv1:"#pv1-line",pv2:"#pv2-line",pv3:"#pv3-line",pv4:"#pv4-line",pv5:"#pv5-line"};class Wr{static generateShapes(t){return U(Xa||(Xa=gt(['\n\t\t\t\n\t\t'])),t.batteryColour)}static generatePower(t,e){return U(Fa||(Fa=gt(['\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(Rt.WATT))}static generateVoltage(t,e){return U(Ja||(Ja=gt(['\n\t\t\t\t\n \n '," ","\n \n \n\t\t"])),(e=>Hn.handlePopup(e,t.stateBatteryVoltage.entity_id)),e.battery.show_battery_banks?"202":"281",t.stateBatteryVoltage.isValid()?"":"none",t.batteryColour,e.battery.show_battery_banks?"right-align":"left-align",t.stateBatteryVoltage.toStr(t.decimalPlaces),jt.VOLT)}static generateCurrent(t,e){return U(Ka||(Ka=gt(['\n\t\t\t\t\n \n '," ","\n \n \n\t\t"])),(e=>Hn.handlePopup(e,t.stateBatteryCurrent.entity_id)),e.battery.show_battery_banks?"202":"281",t.stateBatteryCurrent.isValid()?"":"none",t.batteryColour,e.battery.show_battery_banks?"right-align":"left-align",t.stateBatteryCurrent.toStr(t.decimalPlaces,!1,e.battery.show_absolute),Dt.AMPERE)}static generateTemp(t){return U(qa||(qa=gt(['\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),t.stateBatteryTemp.getUOM())}static generateDuration(t){return U($a||($a=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",0===t.batteryEnergy||t.isFloating||0===t.batteryPower?"transparent":"".concat(t.batteryColour),t.batteryDuration,0===t.batteryEnergy||t.batteryPower<=0||t.isFloating?"transparent":"".concat(t.batteryColour),Lt("common.runtime_to"),t.batteryCapacity,t.formattedResultTime,0===t.batteryEnergy||t.batteryPower>=0||t.isFloating?"transparent":"".concat(t.batteryColour),Lt("common.to"),t.batteryCapacity,t.formattedResultTime,0!==t.batteryEnergy&&t.isFloating?"".concat(t.batteryColour):"transparent",Lt("common.battery_floating"))}static generateDailyCharge(t,e){return U(to||(to=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?"transparent":"".concat(t.batteryColour),Lt("common.daily_charge"),(t=>Hn.handlePopup(t,e.entities.day_battery_charge_70)),!0===t.batteryShowDaily&&t.stateDayBatteryCharge.isValid()?"":"none",t.batteryColour,t.stateDayBatteryCharge?.toPowerString(!0,t.decimalPlacesEnergy))}static generateDailyDischarge(t,e){return U(eo||(eo=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?"transparent":"".concat(t.batteryColour),Lt("common.daily_discharge"),(t=>Hn.handlePopup(t,e.entities.day_battery_discharge_71)),!0===t.batteryShowDaily&&t.stateDayBatteryDischarge.isValid()?"":"none",t.batteryColour,t.stateDayBatteryDischarge?.toPowerString(!0,t.decimalPlacesEnergy))}static generateFlowLines(t,e){return U(no||(no=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.battery.dynamic_colour?t.flowBatColour:t.batteryColour,t.batLineWidth,Math.min(2+t.batLineWidth+Math.max(t.minLineWidth-2,0),8),t.batteryPower<=0?"transparent":"".concat(t.batteryColour),t.durationCur.battery,Math.min(2+t.batLineWidth+Math.max(t.minLineWidth-2,0),8),t.batteryPower>=0?"transparent":"".concat(e.battery.dynamic_colour?t.flowBatColour:t.batteryColour),t.durationCur.battery)}static generateSOC(t,e){return U(ao||(ao=gt(['\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(1)?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 U(oo||(oo=gt(['\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 t.stateBatteryRemainingStorage?.isValid()?U(ro||(ro=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"])),(e=>Hn.handlePopup(e,t.stateBatteryRemainingStorage.entity_id)),e.battery.show_battery_banks?"202":"270",e.battery.show_battery_banks?"325":"338",e.battery.show_battery_banks?"right-align":"left-align",e.battery.show_remaining_energy?"":"none",t.batteryColour,t.stateBatteryRemainingStorage.toStr(2,!1,!0),t.stateBatteryRemainingStorage.getUOM()):U(io||(io=gt(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t\t","\n\t\t\t"])),e.battery.show_remaining_energy?"":"none",t.batteryColour,Hn.toNum(t.batteryEnergy*(t.stateBatterySoc.toNum(2)/100)/1e3,2),Gt.KILO_WATT_HOUR)}static generateShutdownSOC(t,e){return U(so||(so=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?"st12":"st14 left-align",!t.inverterProg.show&&e.battery?.shutdown_soc_offgrid?"":"none",t.batteryShutdown,t.batteryColour,e.battery.hide_soc?"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 U(lo||(lo=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.battery.dynamic_colour?"url(#bLg)":t.batteryColour,e.battery.linear_gradient?t.battery0:t.batteryIcon,t.stopColour,e.battery.animate?"y2":"none",e.battery.linear_gradient?"url(#sLg)":t.batteryColour,e.battery.linear_gradient?"":"none",t.batteryCharge)}}class Yr{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 U(co||(co=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 U(uo||(uo=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"])),Un.generatePhasePower("L1",t.stateGridPowerL1,this._col1X,241,e.grid.auto_scale,this.gridColour,this.decimalPlaces),Un.generatePhasePower("L2",t.stateGridPowerL2,this._col1X,254,e.grid.auto_scale,this.gridColour,this.decimalPlaces),Un.generatePhasePower("L3",t.stateGridPowerL3,this._col1X,267,e.grid.auto_scale,this.gridColour,this.decimalPlaces),Un.generatePhaseVoltage("L1",t.stateGridVoltageL1,this._col1X,195,this.gridColour),Un.generatePhaseVoltage("L2",t.stateGridVoltageL2,this._col1X,182,this.gridColour),Un.generatePhaseVoltage("L3",t.stateGridVoltageL3,this._col1X,169,this.gridColour),Un.generatePhaseAmperage("L1",t.stateGridCurrentL1,this._col2X,195,this.gridColour),Un.generatePhaseAmperage("L2",t.stateGridCurrentL2,this._col2X,182,this.gridColour),Un.generatePhaseAmperage("L3",t.stateGridCurrentL3,this._col2X,169,this.gridColour))}static generateFrequency(t){return U(go||(go=gt(["",""])),Un.generateFrequency(t.stateGridFrequency,t.gridColour,"grid_frequency",this._col1X,208,"right-align"))}static generateEnergyCost(t,e){return U(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\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 U(yo||(yo=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 U(fo||(fo=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=>Hn.handlePopup(t,e.entities.grid_connected_status_194)),Bt.includes(t.gridStatus.toLowerCase())?"st12":"",t.gridColour,t.totalGridPower<0||e.grid.import_icon?"none":"",la,Tt.includes(t.gridStatus.toLowerCase())?"st12":"",t.gridOffColour,e.grid.disconnected_icon?"none":"",sa,Bt.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 U(mo||(mo=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=>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 U(po||(po=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=>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 U(vo||(vo=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=>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 U(bo||(bo=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=>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 U(Ao||(Ao=gt(["\n\t\t\t","\t\t\n\t\t"])),e.inverter.three_phase?e.entities?.grid_ct_power_total?U(wo||(wo=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=>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(Rt.WATT):"".concat(t.totalGridPower||0," ").concat(Rt.WATT))):U(xo||(xo=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(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(Rt.WATT):"".concat(t.totalGridPower||0," ").concat(Rt.WATT))):U(Eo||(Eo=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=>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(Rt.WATT):"".concat(t.totalGridPower||0," ").concat(Rt.WATT))))}}Yr._col1X=103,Yr._col2X=107,Yr._col3X=137,Yr._gridColour="gray";class Zr{static generateInverterImage(t,e){return U(Lo||(Lo=gt(["\n\t\t\t",""])),t.genericInverterImage?U(Po||(Po=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,Kn):U(_o||(_o=gt([''])),e))}static generateTimerInfo(t,e){return U(ko||(ko=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=>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 U(Mo||(Mo=gt(["",""])),Un.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]),U(Co||(Co=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"])),Un.generatePhaseVoltage("L1",t.stateInverterVoltageL1,301.7,n[0],t.inverterColour),Un.generatePhaseVoltage("L2",t.stateInverterVoltageL2,301.7,n[1],t.inverterColour),Un.generatePhaseVoltage("L3",t.stateInverterVoltageL3,301.7,n[2],t.inverterColour),Un.generatePhaseAmperage("L1",t.stateInverterCurrentL1,305.7,n[0],t.inverterColour),Un.generatePhaseAmperage("L2",t.stateInverterCurrentL2,305.7,n[1],t.inverterColour),Un.generatePhaseAmperage("L3",t.stateInverterCurrentL3,305.7,n[2],t.inverterColour))}static generatePriorityLoad(t,e){return U(No||(No=gt(["",""])),"on"===t.priorityLoad?U(Bo||(Bo=gt(['\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")):U(To||(To=gt(['\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_bat")))}static generateInverterProgram(t){return U(zo||(zo=gt(['\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?Un.getIcon(178,218,e.inverter.ac_icon,"small_ac_dc_icon",16):U(Oo||(Oo=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?Un.getIcon(178,230,e.inverter.dc_icon,"small_ac_dc_icon",16):U(Ro||(Ro=gt(['\n\t\t\t\n DC:\n '])),t.inverterColour,e.entities?.dc_transformer_temp_90&&t.stateDCTransformerTemp.isValid()?"":"none");return U(Go||(Go=gt(['\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=U(Do||(Do=gt([''])));return t<2?(e=U(jo||(jo=gt(["",''])),e),e):(e=t<=30?U(So||(So=gt(["",''])),e,t):U(Io||(Io=gt(["",''])),e),e=t<=40?U(Ho||(Ho=gt(["",''])),e,t):U(Vo||(Vo=gt(["",''])),e),e=t<=60?U(Uo||(Uo=gt(["",''])),e,t):U(Qo||(Qo=gt(["",''])),e),e=t<=90?U(Wo||(Wo=gt(["",''])),e,t):U(Yo||(Yo=gt(["",''])),e),t<=100?(e=U(Zo||(Zo=gt(["",''])),e,t),U(Fo||(Fo=gt(["",''])),e,t)):(e=U(Xo||(Xo=gt(["",''])),e),e))}static generateInverterLoad(t,e){let n,a=ft.Sunsynk;if(!t.stateInverterLoadPercentage.isValid())return"";if(Object.values(ft).includes(e.inverter.model)&&(a=e.inverter.model),e.inverter.modern)return U(Jo||(Jo=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 ft.Azzurro:n=[213.5,179.5,51,67,3];break;case ft.Fronius:n=[213.5,179.5,51,73,10];break;case ft.Huawei:case ft.SolarEdge:n=[213.5,179.5,51,73,5];break;default:n=[213.5,179.5,51,73,2]}return U(Ko||(Ko=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=ft.Sunsynk;if(Object.values(ft).includes(e.inverter.model)&&(a=e.inverter.model),e.inverter.modern)return U(qo||(qo=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=>Hn.handlePopup(t,e.entities.inverter_status_59)),e.entities.inverter_status_59&&t.inverterStateMsg?"":"none",t.inverterStateMsg);switch(a){case ft.Azzurro:n=[235,222,7,6,239,240];break;case ft.Deye:n=[233.5,205.5,12,6,239,225];break;case ft.Fronius:n=[222,230,11,9,239,246];break;case ft.Goodwe:case ft.GoodweGridMode:n=[222,236,31,3,239,225];break;case ft.Growatt:n=[250,224,11,6,239,247];break;case ft.EasunSMW8_SA:case ft.MPPSolar:n=[233,242,11,5,239,234];break;case ft.PowMr:n=[233,190,12,5,239,230];break;case ft.Sunsynk:n=[234,208,10,6,239,225];break;case ft.SolarEdge:n=[234,206,22,5,2,239,225];break;case ft.Sofar:n=[233,230,12,4,239,245];break;case ft.Solis:n=[249,198,8,17,239,232];break;case ft.Victron:n=[218,217,18,7.5,239,231];break;default:return U($o||($o=gt(['\n\t\t\t\t\t\n\t\t\t\t'])),t.inverterStateColour)}return U(tr||(tr=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=>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 Xr{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 U(er||(er=gt(["",""])),t.nonessentialLoads>=1?U(nr||(nr=gt(["\n\t\t\t\t",""])),Un.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])):U(ar||(ar=gt([""]))))}static generateLoad2(t,e){const n=this.getPositions(2,e.grid.additional_loads);return U(or||(or=gt(["",""])),t.nonessentialLoads>=2?U(rr||(rr=gt(["\n\t\t\t\t",""])),Un.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])):U(ir||(ir=gt([""]))))}static generateLoad3(t,e){const n=this.getPositions(3,e.grid.additional_loads);return U(sr||(sr=gt(["",""])),t.nonessentialLoads>=3?U(lr||(lr=gt(["\n\t\t\t\t",""])),Un.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])):U(cr||(cr=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,e){const n=Un.getIconWithCondition(t.nonessentialLoads>=1,e.battery.show_battery_banks?53:68,290,t.nonessentialIcon,"nes-load-icon",32);return U(dr||(dr=gt(["",""])),n)}static generateLines(t,e){return U(ur||(ur=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;default:return 135}})(),a="M ".concat(n," 328 L 135 328 Q 140 328 140 323 L 140 320");return U(gr||(gr=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 U(hr||(hr=gt(['\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),e.battery.show_battery_banks?"90":"105",t.dynamicColourNonEssentialLoad,0===t.nonessentialLoads?"none":"",e.battery.show_battery_banks?"93":"108",t.dynamicColourNonEssentialLoad,e.grid.nonessential_name)}static generateTotalPower(t,e){return U(yr||(yr=gt(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t"])),e.battery.show_battery_banks?"125":"140",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(Rt.WATT))}}class Fr{static generateShapes(t,e){const n=400+(Vn.LOAD_X-400)/2-101.3;return U(fr||(fr=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+(Vn.LOAD_X-400)/2-101.3;return U(mr||(mr=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,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 U(pr||(pr=gt(["",""])),e.load.aux_loads>=1?U(vr||(vr=gt(["\n\t\t\t\t",""])),Un.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)):U(br||(br=gt([""]))))}static generateLoad2(t,e){return U(Ar||(Ar=gt(["",""])),e.load.aux_loads>=2?U(wr||(wr=gt(["\n\t\t\t\t",""])),Un.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)):U(xr||(xr=gt([""]))))}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(Rt.WATT);return U(Er||(Er=gt(["\n\t\t\t","\n\t\t"])),t.stateAuxPower.isValid()?U(Lr||(Lr=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=>Hn.handlePopup(t,e.stateAuxPower.entity_id)),n,!0!==t.largeFont?"st14":"st4",t.auxDynamicColour,a):U(Pr||(Pr=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 U(_r||(_r=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=>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"))}}Fr.mainX=Vn.LOAD_X;class Jr{static getBatteryBanksDetails(t,e){if(e.battery.battery_banks_view_mode!=pt.inner)return U(kr||(kr=gt([""])));const n=e.battery.battery_banks;let a=[281,312,343,374],o=10,r=28;return n<=2&&(o=35,r=40,a=[281,324,0,0]),3==n&&(o=35,r=30,a=[281,314,347,0]),U(Mr||(Mr=gt(["\n\t\t\t","\n\t\t\t","\n\t\t\t","\n\t\t\t","\n\t\t\t","\n\t\t"])),this.generateTitle(n,t.batteryColour),this.getBatteryBankDetails(1,n,e,t.stateBatteryBank1Power,t.stateBatteryBank1Voltage,t.stateBatteryBank1Current,t.stateBatteryBank1Delta,t.stateBatteryBank1RemainingStorage,t.stateBatteryBank1Soc,e.battery.battery_bank_1_energy,t.dynamicBatteryBatteryBank1Colour,t.decimalPlaces,a[0],o,r),this.getBatteryBankDetails(2,n,e,t.stateBatteryBank2Power,t.stateBatteryBank2Voltage,t.stateBatteryBank2Current,t.stateBatteryBank2Delta,t.stateBatteryBank2RemainingStorage,t.stateBatteryBank2Soc,e.battery.battery_bank_2_energy,t.dynamicBatteryBatteryBank2Colour,t.decimalPlaces,a[1],o,r),this.getBatteryBankDetails(3,n,e,t.stateBatteryBank3Power,t.stateBatteryBank3Voltage,t.stateBatteryBank3Current,t.stateBatteryBank3Delta,t.stateBatteryBank3RemainingStorage,t.stateBatteryBank3Soc,e.battery.battery_bank_3_energy,t.dynamicBatteryBatteryBank3Colour,t.decimalPlaces,a[2],o,r),this.getBatteryBankDetails(4,n,e,t.stateBatteryBank4Power,t.stateBatteryBank4Voltage,t.stateBatteryBank4Current,t.stateBatteryBank4Delta,t.stateBatteryBank4RemainingStorage,t.stateBatteryBank4Soc,e.battery.battery_bank_4_energy,t.dynamicBatteryBatteryBank4Colour,t.decimalPlaces,a[3],o,r))}static getBatteryBankDetails(t,e,n,a,o,r,i,s,l,c,d,u,g,h,y){if(t<=e){const e=g+y/2+h,f=n.battery.auto_scale?n.battery.show_absolute?Hn.convertValueNew(Math.abs(a.toNum(u)),a.getUOM(),u,!1):Hn.convertValueNew(a.toNum(u),a.getUOM(),u,!1)||"0":a.toStr(n.decimal_places,n.battery?.invert_power,n.battery.show_absolute),m=s?.isValid()?s.toStr(2):Hn.toNum(c*(l.toNum(2)/100)/1e3,2).toFixed(2);return U(Cr||(Cr=gt(['\n\t\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\t','\n\t\t\t\t\t','\n\t\t\t\t\t','\n\t\t\t\t\t','\n\t\t\t\t\t',"\n\t\t\t"])),g+h,y,d,e,d,t,f,e,d,t,o.toStr(2),e,d,t,r.toStr(2,!1,n.battery.show_absolute),e,d,t,i.toStr(3),e,d,t,m,e,d,t,l.toStr(2))}return U(Nr||(Nr=gt([""])))}static generateTitle(t,e){return t<=3?U(Br||(Br=gt(['\n\t\t\t\t\n\t\t\t\tPower:\n\t\t\t\tVoltage:\n\t\t\t\tCurrent:\n\t\t\t\tDelta:\n\t\t\t\tStorage:\n\t\t\t\tSOC:\n\t\t\t'])),e,e,e,e,e,e,e):t>3?U(Tr||(Tr=gt(['\n\t\t\t\t\t\n\t\t\t\t\tP:\n\t\t\t\t\tV:\n\t\t\t\t\tA:\n\t\t\t\t\tΔ:\n\t\t\t\t\tS:\n\t\t\t\t\t%:\n\t\t\t\t'])),e,e,e,e,e,e,e):void 0}}class Kr{static generateLoadTimes(t,e){return U(zr||(zr=gt(['\n\t\t\t\n\t\t\t\t\tData: '," Config: ","\n\t\t\t\t"])),t.refreshTime,e.refresh_time)}}class qr{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 Ei(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.11.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 Li=class extends rt{constructor(){super(...arguments),this.GREY_COLOUR="grey",this.durationPrev={},this.durationCur={}}static get styles(){return yt}static async getConfigElement(){return await Promise.resolve().then((function(){return Oi})),document.createElement(zt)}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.getNowTime(),n=this.getEntity("entities.day_battery_discharge_71"),a=this.getEntity("entities.day_battery_charge_70"),o=this.getEntity("entities.day_load_energy_84"),r=this.getEntity("entities.day_grid_import_76"),i=this.getEntity("entities.day_grid_export_77"),s=this.getEntity("entities.day_aux_energy"),l=this.getEntity("entities.load_frequency_192"),c=this.getEntity("entities.inverter_status_59",{state:""}),d=this.getEntity("entities.inverter_power_175"),u=this.getEntity("entities.priority_load_243",{state:t.entities.priority_load_243?.toString()??"false"}),g=this.getEntity("entities.use_timer_248",{state:t.entities.use_timer_248?.toString()??"false"}),h=this.getEntity("entities.dc_transformer_temp_90",{state:""}),y=this.getEntity("entities.radiator_temp_91",{state:""}),f=this.getEntity("entities.inverter_voltage_154"),m=this.getEntity("entities.inverter_voltage_L2",{state:""}),p=this.getEntity("entities.inverter_voltage_L3",{state:""}),v=this.getEntity("entities.inverter_current_164"),b=this.getEntity("entities.inverter_current_L2",{state:""}),A=this.getEntity("entities.inverter_current_L3",{state:""}),w=this.getEntity("entities.environment_temp",{state:""}),x=this.getEntity("entities.inverter_load_percentage"),E=this.getEntity("entities.battery_voltage_183"),L=this.getEntity("entities.battery_soc_184"),P=this.getEntity("entities.battery_power_190"),_=this.getEntity("entities.battery_current_191"),k=this.getEntity("entities.battery_temp_182",{state:""}),M=this.getEntity("entities.battery_status",{state:""}),C=this.getEntity("entities.battery_current_direction",{state:""}),N=this.getEntity("entities.battery_rated_capacity",{state:""}),B=this.getEntity("battery.shutdown_soc",{state:t.battery.shutdown_soc?.toString()??""}),T=this.getEntity("battery.shutdown_soc_offgrid",{state:t.battery.shutdown_soc_offgrid?.toString()??""}),z=this.getEntity("entities.battery_soh",{state:""}),O=this.getEntity("entities.battery_remaining_storage",{state:""}),R=this.getEntity("entities.battery_bank_1_power"),G=this.getEntity("entities.battery_bank_2_power"),D=this.getEntity("entities.battery_bank_3_power"),j=this.getEntity("entities.battery_bank_4_power"),S=this.getEntity("entities.battery_bank_1_voltage"),I=this.getEntity("entities.battery_bank_2_voltage"),H=this.getEntity("entities.battery_bank_3_voltage"),Q=this.getEntity("entities.battery_bank_4_voltage"),W=this.getEntity("entities.battery_bank_1_current"),Y=this.getEntity("entities.battery_bank_2_current"),Z=this.getEntity("entities.battery_bank_3_current"),X=this.getEntity("entities.battery_bank_4_current"),F=this.getEntity("entities.battery_bank_1_delta"),J=this.getEntity("entities.battery_bank_2_delta"),K=this.getEntity("entities.battery_bank_3_delta"),q=this.getEntity("entities.battery_bank_4_delta"),$=this.getEntity("entities.battery_bank_1_remaining_storage"),tt=this.getEntity("entities.battery_bank_2_remaining_storage"),et=this.getEntity("entities.battery_bank_3_remaining_storage"),nt=this.getEntity("entities.battery_bank_4_remaining_storage"),at=this.getEntity("entities.battery_bank_1_soc"),ot=this.getEntity("entities.battery_bank_2_soc"),rt=this.getEntity("entities.battery_bank_3_soc"),it=this.getEntity("entities.battery_bank_4_soc"),st=this.getEntity("entities.essential_power"),lt=this.getEntity("entities.aux_power_166"),ct=this.getEntity("entities.nonessential_power"),dt=this.getEntity("entities.non_essential_load1"),ut=this.getEntity("entities.non_essential_load2"),ht=this.getEntity("entities.non_essential_load3"),yt=this.getEntity("entities.non_essential_load1_extra"),mt=this.getEntity("entities.non_essential_load2_extra"),pt=this.getEntity("entities.non_essential_load3_extra"),vt=this.getEntity("entities.non_essential_load1_toggle"),bt=this.getEntity("entities.non_essential_load2_toggle"),At=this.getEntity("entities.non_essential_load3_toggle"),wt=this.getEntity("entities.essential_load1"),Et=this.getEntity("entities.essential_load2"),Pt=this.getEntity("entities.essential_load3"),zt=this.getEntity("entities.essential_load4"),Ot=this.getEntity("entities.essential_load5"),Rt=this.getEntity("entities.essential_load6"),Gt=this.getEntity("entities.essential_load7"),Dt=this.getEntity("entities.essential_load8"),jt=this.getEntity("entities.essential_load9"),St=this.getEntity("entities.essential_load10"),It=this.getEntity("entities.essential_load11"),Ht=this.getEntity("entities.essential_load12"),Vt=this.getEntity("entities.essential_load13"),Ut=this.getEntity("entities.essential_load14"),Qt=this.getEntity("entities.essential_load15"),Wt=this.getEntity("entities.essential_load16"),Yt=this.getEntity("entities.essential_load17"),Zt=this.getEntity("entities.essential_load18"),Xt=this.getEntity("entities.essential_load19"),Ft=this.getEntity("entities.essential_load20"),Jt=this.getEntity("entities.essential_load21"),Kt=this.getEntity("entities.essential_load22"),qt=this.getEntity("entities.essential_load23"),$t=this.getEntity("entities.essential_load1_extra"),te=this.getEntity("entities.essential_load2_extra"),ee=this.getEntity("entities.essential_load3_extra"),ne=this.getEntity("entities.essential_load4_extra"),ae=this.getEntity("entities.essential_load5_extra"),oe=this.getEntity("entities.essential_load6_extra"),re=this.getEntity("entities.essential_load7_extra"),ie=this.getEntity("entities.essential_load8_extra"),se=this.getEntity("entities.essential_load9_extra"),le=this.getEntity("entities.essential_load10_extra"),ce=this.getEntity("entities.essential_load11_extra"),de=this.getEntity("entities.essential_load12_extra"),ue=this.getEntity("entities.essential_load13_extra"),ge=this.getEntity("entities.essential_load14_extra"),he=this.getEntity("entities.essential_load15_extra"),ye=this.getEntity("entities.essential_load16_extra"),fe=this.getEntity("entities.essential_load17_extra"),me=this.getEntity("entities.essential_load18_extra"),pe=this.getEntity("entities.essential_load19_extra"),ve=this.getEntity("entities.essential_load20_extra"),be=this.getEntity("entities.essential_load21_extra"),Ae=this.getEntity("entities.essential_load22_extra"),we=this.getEntity("entities.essential_load23_extra"),xe=this.getEntity("entities.essential_load1_toggle"),Ee=this.getEntity("entities.essential_load2_toggle"),Le=this.getEntity("entities.essential_load3_toggle"),Pe=this.getEntity("entities.essential_load4_toggle"),_e=this.getEntity("entities.essential_load5_toggle"),ke=this.getEntity("entities.essential_load6_toggle"),Me=this.getEntity("entities.essential_load7_toggle"),Ce=this.getEntity("entities.essential_load8_toggle"),Ne=this.getEntity("entities.essential_load9_toggle"),Be=this.getEntity("entities.essential_load10_toggle"),Te=this.getEntity("entities.essential_load11_toggle"),ze=this.getEntity("entities.essential_load12_toggle"),Oe=this.getEntity("entities.essential_load13_toggle"),Re=this.getEntity("entities.essential_load14_toggle"),Ge=this.getEntity("entities.essential_load15_toggle"),De=this.getEntity("entities.essential_load16_toggle"),je=this.getEntity("entities.essential_load17_toggle"),Se=this.getEntity("entities.essential_load18_toggle"),Ie=this.getEntity("entities.essential_load19_toggle"),He=this.getEntity("entities.essential_load20_toggle"),Ve=this.getEntity("entities.essential_load21_toggle"),Ue=this.getEntity("entities.essential_load22_toggle"),Qe=this.getEntity("entities.essential_load23_toggle"),We=this.getEntity("entities.load_power_L1"),Ye=this.getEntity("entities.load_power_L2"),Ze=this.getEntity("entities.load_power_L3"),Xe=this.getEntity("entities.aux_load1"),Fe=this.getEntity("entities.aux_load2"),Je=this.getEntity("entities.aux_load1_extra"),Ke=this.getEntity("entities.aux_load2_extra"),qe=this.getEntity("entities.aux_load1_toggle"),$e=this.getEntity("entities.aux_load2_toggle"),tn=this.getEntity("entities.grid_frequency"),en=this.getEntity("entities.grid_ct_power_172"),nn=this.getEntity("entities.grid_ct_power_L2"),an=this.getEntity("entities.grid_ct_power_L3"),on=this.getEntity("entities.grid_voltage_L1"),rn=this.getEntity("entities.grid_voltage_L2"),sn=this.getEntity("entities.grid_voltage_L3"),ln=this.getEntity("entities.grid_current_L1"),cn=this.getEntity("entities.grid_current_L2"),dn=this.getEntity("entities.grid_current_L3"),un=this.getEntity("entities.grid_ct_power_total"),gn=this.getEntity("entities.grid_connected_status_194",{state:"on"}),hn=this.getEntity("entities.grid_power_169"),yn=this.getEntity("entities.energy_cost_buy",{state:"",attributes:{unit_of_measurement:""}}),fn=this.getEntity("entities.energy_cost_sell",{state:"",attributes:{unit_of_measurement:""}}),mn=this.getEntity("entities.grid_voltage",null),pn=this.getEntity("entities.prepaid_units"),vn=this.getEntity("entities.max_sell_power"),bn=this.getEntity("entities.pv1_voltage_109"),An=this.getEntity("entities.pv1_current_110"),wn=this.getEntity("entities.pv2_voltage_111"),xn=this.getEntity("entities.pv2_current_112"),En=this.getEntity("entities.pv3_voltage_113"),Ln=this.getEntity("entities.pv3_current_114"),Pn=this.getEntity("entities.pv4_voltage_115"),_n=this.getEntity("entities.pv4_current_116"),kn=this.getEntity("entities.pv5_voltage"),Mn=this.getEntity("entities.pv5_current"),Cn=this.getEntity("entities.pv1_power_186"),Nn=this.getEntity("entities.pv2_power_187"),Bn=this.getEntity("entities.pv3_power_188"),Tn=this.getEntity("entities.pv4_power_189"),zn=this.getEntity("entities.pv5_power"),On=this.getEntity("entities.pv1_production"),Rn=this.getEntity("entities.pv2_production"),Gn=this.getEntity("entities.pv3_production"),Dn=this.getEntity("entities.pv4_production"),jn=this.getEntity("entities.pv5_production"),Sn=this.getEntity("entities.solar_sell_247",{state:"undefined"}),In=this.getEntity("entities.pv_total"),Un=this.getEntity("entities.day_pv_energy_108"),Kn=this.getEntity("entities.monthly_pv_generation"),qn=this.getEntity("entities.yearly_pv_generation"),$n=this.getEntity("entities.total_pv_generation"),ta=this.getEntity("entities.remaining_solar"),ea=this.getEntity("entities.tomorrow_solar"),{invert_aux:na}=t.load,aa=lt?.isValid()?lt.toPower(na):(Xe?.toPower(na)||0)+(Fe?.toPower(na)||0),{invert_grid:oa}=t.grid,ra=en.toPower(oa),ia=nn.toPower(oa),sa=an.toPower(oa),la=t.entities?.grid_ct_power_total?un.toPower(oa):ra+ia+sa,ca=t.inverter.three_phase?la:ra,da=mn.isNaN()?null:mn.toNum(0),ua=C.isNaN()?null:C.toNum(0),ga=t.inverter?.modern,ha=t.decimal_places,ya=t.decimal_places_energy,fa=this.colourConvert(t.load?.colour),ma=this.calculateEssentialLoadColour(wt,xe,t.load?.off_threshold)||fa,pa=this.calculateEssentialLoadColour(Et,Ee,t.load?.off_threshold)||fa,va=this.calculateEssentialLoadColour(Pt,Le,t.load?.off_threshold)||fa,ba=this.calculateEssentialLoadColour(zt,Pe,t.load?.off_threshold)||fa,Aa=this.calculateEssentialLoadColour(Ot,_e,t.load?.off_threshold)||fa,wa=this.calculateEssentialLoadColour(Rt,ke,t.load?.off_threshold)||fa,xa=this.calculateEssentialLoadColour(Gt,Me,t.load?.off_threshold)||fa,Ea=this.calculateEssentialLoadColour(Dt,Ce,t.load?.off_threshold)||fa,La=this.calculateEssentialLoadColour(jt,Ne,t.load?.off_threshold)||fa,Pa=this.calculateEssentialLoadColour(St,Be,t.load?.off_threshold)||fa,_a=this.calculateEssentialLoadColour(It,Te,t.load?.off_threshold)||fa,ka=this.calculateEssentialLoadColour(Ht,ze,t.load?.off_threshold)||fa,Ma=this.calculateEssentialLoadColour(Vt,Oe,t.load?.off_threshold)||fa,Ca=this.calculateEssentialLoadColour(Ut,Re,t.load?.off_threshold)||fa,Na=this.calculateEssentialLoadColour(Qt,Ge,t.load?.off_threshold)||fa,Ba=this.calculateEssentialLoadColour(Wt,De,t.load?.off_threshold)||fa,Ta=this.calculateEssentialLoadColour(Yt,je,t.load?.off_threshold)||fa,za=this.calculateEssentialLoadColour(Zt,Se,t.load?.off_threshold)||fa,Oa=this.calculateEssentialLoadColour(Xt,Ie,t.load?.off_threshold)||fa,Ra=this.calculateEssentialLoadColour(Ft,He,t.load?.off_threshold)||fa,Ga=this.calculateEssentialLoadColour(Jt,Ve,t.load?.off_threshold)||fa,Da=this.calculateEssentialLoadColour(Kt,Ue,t.load?.off_threshold)||fa,ja=this.calculateEssentialLoadColour(qt,Qe,t.load?.off_threshold)||fa;t.title_colour=this.colourConvert(t.title_colour);const Sa=t.load?.show_daily,Ia=t.grid?.show_nonessential;let Ha=t.entities?.grid_connected_status_194?gn.state:"on";Tt.includes(Ha.toLowerCase())||Bt.includes(Ha.toLowerCase())||(Ha="on");const Va=t.entities?.battery_voltage_183?E.toNum(1):0,Ua=t.entities?.inverter_power_175?d.toPower():0,Qa=t.entities?.grid_power_169?hn.toPower():la,{invert_load:Wa}=t.load,Ya=t.entities?.load_power_L1?We.toPower(Wa):"",Za=t.entities?.load_power_L2?Ye.toPower(Wa):"",Xa=t.entities?.load_power_L3?Ze.toPower(Wa):"",Fa=this.colourConvert(t.grid?.colour),Ja=this.colourConvert(t.grid?.export_colour||Fa),Ka=this.colourConvert(t.grid?.no_grid_colour||Fa);let qa;switch(!0){case ca<0:qa=Ja;break;case ca>=0&&ca<=Hn.toNum(t.grid?.off_threshold,0):qa=Ka;break;default:qa=Fa}const $a=Math.abs(dt.toPower(!1)+ut.toPower(!1)+ht.toPower(!1))>Hn.toNum(t.grid?.off_threshold,0)?dt.toPower(!1)+ut.toPower(!1)+ht.toPower(!1)>0?Fa:Ja:this.GREY_COLOUR,to=this.getDynamicColorWithToggle(dt,vt,t.grid?.off_threshold,Fa,Ja),eo=this.getDynamicColorWithToggle(ut,bt,t.grid?.off_threshold,Fa,Ja),no=this.getDynamicColorWithToggle(ht,At,t.grid?.off_threshold,Fa,Ja),ao=this.colourConvert(t.grid?.grid_off_colour||qa),oo=this.colourConvert(t.load?.aux_colour),ro=this.colourConvert(t.load?.aux_off_colour||this.GREY_COLOUR),io=this.calculateAuxLoadColour(Xe,qe,t.load?.off_threshold)||oo,so=this.calculateAuxLoadColour(Fe,$e,t.load?.off_threshold)||oo;let lo=ro;lo=io!=ro?io:lo,lo=so!=ro?so:lo,lo=lt.isValid()&&Math.abs(lt.toPower())>Hn.toNum(t.load?.off_threshold,0)?oo:lo;let co=t.grid?.additional_loads;kt.includes(co)||(co=0);const uo=t.grid?.show_daily_buy,go=t.grid?.show_daily_sell,ho=this.colourConvert(t.battery?.colour),yo=this.colourConvert(t.battery?.charge_colour||ho),fo=t.battery?.show_daily;let mo=t.load?.show_aux;Ct.includes(mo)||(mo=!1);const po=t.load?.show_daily_aux;let vo=t.load?.additional_loads;_t.includes(vo)||(vo=0);let bo=t.load?.aux_loads;Nt.includes(bo)||(bo=0);const Ao=t.load?.aux_type,wo=this.getEntity("load.load1_icon",{state:t.load?.load1_icon?.toString()??""}).state,xo=this.getEntity("load.load2_icon",{state:t.load?.load2_icon?.toString()??""}).state,Eo=this.getEntity("load.load3_icon",{state:t.load?.load3_icon?.toString()??""}).state,Lo=this.getEntity("load.load4_icon",{state:t.load?.load4_icon?.toString()??""}).state,Po=this.getEntity("load.load5_icon",{state:t.load?.load5_icon?.toString()??""}).state,_o=this.getEntity("load.load6_icon",{state:t.load?.load6_icon?.toString()??""}).state,ko=this.getEntity("load.load7_icon",{state:t.load?.load7_icon?.toString()??""}).state,Mo=this.getEntity("load.load8_icon",{state:t.load?.load8_icon?.toString()??""}).state,Co=this.getEntity("load.load9_icon",{state:t.load?.load9_icon?.toString()??""}).state,No=this.getEntity("load.load10_icon",{state:t.load?.load10_icon?.toString()??""}).state,Bo=this.getEntity("load.load11_icon",{state:t.load?.load11_icon?.toString()??""}).state,To=this.getEntity("load.load12_icon",{state:t.load?.load12_icon?.toString()??""}).state,zo=this.getEntity("load.load13_icon",{state:t.load?.load13_icon?.toString()??""}).state,Oo=this.getEntity("load.load14_icon",{state:t.load?.load14_icon?.toString()??""}).state,Ro=this.getEntity("load.load15_icon",{state:t.load?.load15_icon?.toString()??""}).state,Go=this.getEntity("load.load16_icon",{state:t.load?.load16_icon?.toString()??""}).state,Do=this.getEntity("load.load17_icon",{state:t.load?.load17_icon?.toString()??""}).state,jo=this.getEntity("load.load18_icon",{state:t.load?.load18_icon?.toString()??""}).state,So=this.getEntity("load.load19_icon",{state:t.load?.load19_icon?.toString()??""}).state,Io=this.getEntity("load.load20_icon",{state:t.load?.load20_icon?.toString()??""}).state,Ho=this.getEntity("load.load21_icon",{state:t.load?.load21_icon?.toString()??""}).state,Vo=this.getEntity("load.load22_icon",{state:t.load?.load22_icon?.toString()??""}).state,Uo=this.getEntity("load.load23_icon",{state:t.load?.load23_icon?.toString()??""}).state,Qo=this.getEntity("load.aux_load1_icon",{state:t.load?.aux_load1_icon?.toString()??""}).state,Wo=this.getEntity("load.aux_load2_icon",{state:t.load?.aux_load2_icon?.toString()??""}).state,Yo=this.getEntity("grid.nonessential_icon",{state:t.grid?.nonessential_icon?.toString()??""}).state,Zo=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,Fo=this.getEntity("grid.load3_icon",{state:t.grid?.load3_icon?.toString()??""}).state,Jo=this.getEntity("grid.import_icon",{state:t.grid?.import_icon?.toString()??""}).state,Ko=this.getEntity("grid.disconnected_icon",{state:t.grid?.disconnected_icon?.toString()??""}).state,qo=this.getEntity("grid.export_icon",{state:t.grid?.export_icon?.toString()??""}).state,$o=t.large_font,tr=t.panel_mode,er=this.colourConvert(t.inverter?.colour),nr=t.inverter?.autarky,ar=!!t.entities.use_timer_248&&g.state,or=!!t.entities.priority_load_243&&u.state;let rr=P.toPower(t.battery?.invert_power);const ir=this.getEntity("card_height",{state:t.card_height?.toString()??""}).state,sr=this.getEntity("card_width",{state:t.card_width?.toString()??""}).state,lr=0===t.grid?.energy_cost_decimals?0:t.grid?.energy_cost_decimals||2,cr=ca>=0?yn.toNum(lr):fn.toNum(lr);let dr=ft.Sunsynk;Object.values(ft).includes(t.inverter.model)&&(dr=t.inverter.model);let ur="";const gr=wi.getInstance(dr);ga||(ur=gr.image);const hr=Cn.toPower(),yr=Nn.toPower(),fr=Bn.toPower(),mr=Tn.toPower(),pr=zn.toPower(),vr=hr+yr+fr+mr+pr,br=t.entities?.pv_total?In.toNum():vr,Ar=t.solar.dynamic_colour?Hn.toNum(br,0)>Hn.toNum(t.solar?.off_threshold,0)?this.colourConvert(t.solar?.colour):this.GREY_COLOUR:this.colourConvert(t.solar?.colour);let wr,xr,Er=t.inverter?.three_phase;Mt.includes(Er)||(Er=!1);const{essential_power:Lr,nonessential_power:Pr}=t.entities;xr=t.entities?.grid_power_169?!1===Er?"none"!==Pr&&Pr?ct.toPower():ra-Qa:"none"!==Pr&&Pr?ct.toPower():ra+ia+sa-Qa:dt.toPower()+ut.toPower()+ht.toPower(),wr="none"!==Lr&&Lr?st.toPower(Wa):!0===Er&&t.entities.load_power_L1&&t.entities.load_power_L2&&t.entities.load_power_L3?Number(Ya)+Number(Za)+Number(Xa):t.entities.inverter_power_175?Ua+Qa-aa:br+rr+Qa-aa;const _r={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??""})},kr={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??""})},Mr={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??""})},Cr={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??""})},Nr={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??""})},Br={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??""})},Tr=T.toNum(),zr=B.toNum(),qr={capacity:zr,entityID:""};switch(!0){case"off"===g.state:case!ar: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:qr.show=!1;break;default:qr.show=!0;const Bs=new Date,Ts=[];[_r,kr,Mr,Cr,Nr,Br].forEach(((t,e)=>{const[n,a]=t.time.state.split(":").map((t=>parseInt(t,10)));Ts[e]=new Date(Bs.getTime()),Ts[e].setHours(n),Ts[e].setMinutes(a)}));const[zs,Os,Rs,Gs,Ds,js]=Ts;function Ss(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?qr.charge="none":qr.charge="both",qr.capacity=parseInt(t.capacity.state),qr.entityID=e}Bs>=js||Bs=zs&&Bs=Os&&Bs=Rs&&Bs=Gs&&Bs=Ds&&Bs50?"on":"off"),null!=ua&&dr==ft.Solis&&0===ua&&(rr=-rr);let $r=0;if(t.show_battery)if(!0==!qr.show)rr>0?$r="on"!==Ha&&"1"!==Ha&&"on-grid"!==Ha.toLowerCase()||qr.show?"off"!==Ha&&"0"!==Ha&&"off-grid"!==Ha.toLowerCase()||!T.notEmpty()||qr.show?zr:Tr:zr:rr<0&&($r=100);else $r=gr.getBatteryCapacity(rr,Ha,zr,qr,L);let ti=0,ei="",ni="";let ai=this.getEntity("battery.energy",{state:t.battery.energy?.toString()??""}).toPower(!1);if(Va&&N.notEmpty()&&(ai=Hn.toNum(Va*N.toNum(0),0)),t.show_battery||0!==ai){0===rr?ti=(L.toNum()-zr)/100*ai*60*60:rr>0?ti=(L.toNum()-$r)/100*ai/rr*60*60:rr<0&&(ti=($r-L.toNum(0))/100*ai/rr*60*60*-1);const Is=new Date,Hs=1e3*ti,Vs=new Date(Is.getTime()+Hs),Us=Vs.getHours(),Qs=Vs.getMinutes().toString().padStart(2,"0"),Ws=Us.toString().padStart(2,"0");ei="".concat(Ws,":").concat(Qs);const Ys=Math.floor(ti/86400),Zs=Math.floor(ti%86400/3600),Xs=Math.floor(ti%3600/60);if(Ys>0&&(ni+="".concat(Ys).concat(Lt("common.days")," ")),Zs>0){const Fs=Ys>0&&Zs<10?"0".concat(Zs):"".concat(Zs);ni+="".concat(Fs).concat(Lt("common.hrs")," ")}ni+="".concat(Xs).concat(Lt("common.min"))}const oi=this.isFloating(_,L),ri=this.batteryColour(rr,oi,yo,ho),ii=this.batteryColour(R.toPower(t.battery?.invert_power),this.isFloating(W,at),yo,ho),si=this.batteryColour(G.toPower(t.battery?.invert_power),this.isFloating(Y,ot),yo,ho),li=this.batteryColour(D.toPower(t.battery?.invert_power),this.isFloating(Z,rt),yo,ho),ci=this.batteryColour(j.toPower(t.battery?.invert_power),this.isFloating(X,it),yo,ho);let di="",ui="",gi=c.state,hi=!1;dr==ft.Solis&&(gi=c.isNaN()?c.toString():c.toNum(0).toString());const yi=gr.statusGroups;if(yi)for(const Js of Object.keys(yi)){const Ks=yi[Js],{states:qs,color:$s,message:tl}=Ks;if(qs.includes(gi.toLowerCase())){di=$s,ui=tl,hi=!0;break}}hi||("none"!==t.entities?.inverter_status_59&&t.entities?.inverter_status_59?(di="transparent",ui="Status"):(di="transparent",ui=""));let fi="transparent",mi="";if([ft.GoodweGridMode,ft.Goodwe,ft.Huawei].includes(dr)){const el=gr.batteryStatusGroups;if(el)for(const nl of Object.keys(el)){const al=el[nl],{states:ol,color:rl,message:il}=al;if(ol.includes(M.state.toLowerCase())){fi=rl,mi=il,hi=!0;break}}hi||("none"!==t.entities?.battery_status&&t.entities?.battery_status?(fi="transparent",mi="Status"):(fi="transparent",mi=""))}const pi=Un.toNum()+n.toNum(),vi=o.toNum()+a.toNum(),bi=0!=vi?Math.max(Math.min(Math.round(100*pi/vi),100),0):0,Ai=0!=pi?Math.max(Math.min(Math.round(100*vi/pi),100),0):0,Ei=br+Hn.toNum("".concat(rr>0?rr:0))+Hn.toNum("".concat(aa<0?-1*aa:0)),Li=wr+Math.max(xr,0)+Hn.toNum("".concat(aa>0?aa:0))+Hn.toNum("".concat(rr<0?-1*rr:0)),Pi=0!=Li?Math.max(Math.min(Math.round(100*Ei/Li),100),0):0,_i=0!=Ei?Math.max(Math.min(Math.round(100*Li/Ei),100),0):0,ki=(Hn.toNum(t.max_line_width)<1?1:t.max_line_width)-1,Mi=Hn.toNum(t.min_line_width)||1,Ci=Un.toNum()+n.toNum()+r.toNum(),Ni=0!=pi?Math.max(Math.min(Math.round(1e3*vi/pi)/10,100),0):0,Bi=0!=Ci?Math.max(Math.min(Math.round(1e3*pi/Ci)/10,100),0):0,Ti=this.getEntity("battery.max_power",{state:t.battery.max_power?.toString()??""}),zi=this.getEntity("solar.max_power",{state:t.solar.max_power?.toString()??""}),Oi=this.getEntity("load.max_power",{state:t.load.max_power?.toString()??""}),Ri=this.getEntity("grid.max_power",{state:t.grid.max_power?.toString()??""}),Gi=t.solar.max_power?this.dynamicLineWidth(hr,zi.toNum()||hr,ki,Mi):Mi,Di=t.solar.max_power?this.dynamicLineWidth(yr,zi.toNum()||yr,ki,Mi):Mi,ji=t.solar.max_power?this.dynamicLineWidth(fr,zi.toNum()||fr,ki,Mi):Mi,Si=t.solar.max_power?this.dynamicLineWidth(mr,zi.toNum()||mr,ki,Mi):Mi,Ii=t.solar.max_power?this.dynamicLineWidth(pr,zi.toNum()||pr,ki,Mi):Mi,Hi=t.battery.max_power?this.dynamicLineWidth(Math.abs(rr),Ti.toNum(0)||Math.abs(rr),ki,Mi):Mi,Vi=t.load.max_power?this.dynamicLineWidth(Math.abs(wr),Oi.toNum()||Math.abs(wr),ki,Mi):Mi,Ui=t.load.max_power?this.dynamicLineWidth(Math.abs(aa),Oi.toNum()||Math.abs(aa),ki,Mi):Mi,Qi=t.grid.max_power?this.dynamicLineWidth(Math.abs(ca),Ri.toNum()||Math.abs(ca),ki,Mi):Mi,Wi=t.grid.max_power?this.dynamicLineWidth(Math.abs(Qa),Ri.toNum()||Math.abs(Qa),ki,Mi):Mi,Yi=t.grid.max_power?this.dynamicLineWidth(Math.abs(xr),Ri.toNum()||Math.abs(xr),ki,Mi):Mi,Zi=t.solar.max_power?this.dynamicLineWidth(br,zi.toNum()||br,ki,Mi):Mi;if(t&&t.solar&&t.solar.animation_speed){const sl=t.solar.animation_speed-(t.solar.animation_speed-1)*(br/(zi.toNum()||br));this.changeAnimationSpeed("solar",sl)}if(t&&t.solar&&t.solar.animation_speed){const ll=t.solar.animation_speed-(t.solar.animation_speed-1)*(hr/(zi.toNum()||hr));this.changeAnimationSpeed("pv1",ll)}if(t&&t.solar&&t.solar.animation_speed){const cl=t.solar.animation_speed-(t.solar.animation_speed-1)*(yr/(zi.toNum()||yr));this.changeAnimationSpeed("pv2",cl)}if(t&&t.solar&&t.solar.animation_speed){const dl=t.solar.animation_speed-(t.solar.animation_speed-1)*(fr/(zi.toNum()||fr));this.changeAnimationSpeed("pv3",dl)}if(t&&t.solar&&t.solar.animation_speed){const ul=t.solar.animation_speed-(t.solar.animation_speed-1)*(mr/(zi.toNum()||mr));this.changeAnimationSpeed("pv4",ul)}if(t&&t.solar&&t.solar.animation_speed){const gl=t.solar.animation_speed-(t.solar.animation_speed-1)*(pr/(zi.toNum()||pr));this.changeAnimationSpeed("pv5",gl)}if(t&&t.battery&&t.battery.animation_speed){const hl=t.battery.animation_speed-(t.battery.animation_speed-1)*(Math.abs(rr)/(Ti.toNum(0)||Math.abs(rr)));this.changeAnimationSpeed("battery",hl)}if(t&&t.load&&t.load.animation_speed){const yl=t.load.animation_speed-(t.load.animation_speed-1)*(Math.abs(wr)/(Oi.toNum()||Math.abs(wr)));this.changeAnimationSpeed("load",yl),this.changeAnimationSpeed("load1",yl)}if(t&&t.load&&t.load.animation_speed){const fl=t.load.animation_speed-(t.load.animation_speed-1)*(Math.abs(aa)/(Oi.toNum()||Math.abs(aa)));this.changeAnimationSpeed("aux",fl),this.changeAnimationSpeed("aux1",fl)}if(t&&t.grid&&t.grid.animation_speed){const ml=t.grid.animation_speed-(t.grid.animation_speed-1)*(Math.abs(ca)/(Ri.toNum()||Math.abs(ca)));this.changeAnimationSpeed("grid1",ml),this.changeAnimationSpeed("grid",ml),this.changeAnimationSpeed("grid2",ml)}if(t&&t.grid&&t.grid.animation_speed){const pl=t.grid.animation_speed-(t.grid.animation_speed-1)*(Math.abs(xr)/(Ri.toNum()||Math.abs(xr)));this.changeAnimationSpeed("ne",pl)}const Xi=0===br?0:"off"!==or&&or||rr>0?br/(Er?wr+Math.max(aa,0):wr)*100:(br-Math.abs(rr))/(Er?wr+Math.max(aa,0):wr)*100,Fi=rr<=0?0:Math.abs(rr)/(Er?wr+Math.max(aa,0):wr)*100,Ji=Xi+Fi,Ki=0===Ji?0:Xi/Ji*100,qi=0===Ji?0:Fi/Ji*100;let $i,ts,es=0;Ji>=100||0==ca?($i=Hn.toNum(Ki,0),ts=Hn.toNum(qi,0)):($i=Hn.toNum(Math.min(Xi,100),0),ts=Hn.toNum(Math.min(Fi,100),0),es=100-($i+ts));const ns=0===br||rr>=0?0:"off"!==or&&or?(br-wr)/Math.abs(rr)*100:br/Math.abs(rr)*100,as=rr>=0||ca<=0?0:"on"===or?br-wr>=Math.abs(rr)?0:(ca-Math.max(wr-br,0))/Math.abs(rr)*100:br>=Math.abs(rr)?0:(Math.abs(rr)-br)/Math.abs(rr)*100,os=ns+as,rs=0===os?0:ns/os*100,is=0===os?0:as/os*100;let ss,ls,cs,ds,us,gs,hs;switch(os>=100||0==ca?(ss=Hn.toNum(rs,0),ls=Hn.toNum(is,0)):(ss=Hn.toNum(Math.min(ns,100),0),ls=Hn.toNum(Math.min(as,100),0)),!0){case ss>=Hn.toNum(t.battery?.path_threshold,0):cs=Ar;break;case ls>=Hn.toNum(t.battery?.path_threshold,0):cs=qa;break;default:cs=ri}switch(!0){case $i>=Hn.toNum(t.load?.path_threshold,0):ds=Ar;break;case ts>=Hn.toNum(t.load?.path_threshold,0):ds=ri;break;case es>=Hn.toNum(t.load?.path_threshold,0):ds=qa;break;default:ds=fa}switch(!0){case $i>=Hn.toNum(t.load?.path_threshold,0):us=Ar;break;case ts>=Hn.toNum(t.load?.path_threshold,0):us=ri;break;case es>=Hn.toNum(t.load?.path_threshold,0):case ls>=Hn.toNum(t.battery?.path_threshold,0):us=qa;break;default:us=er}switch(!0){case Xi>=100&&Fi<=5&&ca-xr<50&&t.load.dynamic_icon:gs=Jn,hs=1;break;case Fi>=100&&Xi<=5&&ca-xr<50&&t.load.dynamic_icon:gs=Xn,hs=0;break;case Xi<5&&Fi<5&&es>0&&t.load.dynamic_icon:gs=Fn,hs=0;break;default:gs=Zn,hs=0}const{batteryIcon:ys,batteryCharge:fs,stopColour:ms,battery0:ps}=xi.convert(L),vs=this.getEntity("solar.pv1_max_power",{state:t.solar.pv1_max_power?.toString()??""}),bs=this.getEntity("solar.pv2_max_power",{state:t.solar.pv2_max_power?.toString()??""}),As=this.getEntity("solar.pv3_max_power",{state:t.solar.pv3_max_power?.toString()??""}),ws=this.getEntity("solar.pv4_max_power",{state:t.solar.pv4_max_power?.toString()??""}),xs=this.getEntity("solar.pv5_max_power",{state:t.solar.pv5_max_power?.toString()??""}),Es=t.solar.max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Hn.toNum(Math.min(br/zi.toNum()*100,200),0):100,Ls=t.solar.pv1_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Hn.toNum(Math.min(hr/vs.toNum()*100,200),0):100,Ps=t.solar.pv2_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Hn.toNum(Math.min(yr/bs.toNum()*100,200),0):100,_s=t.solar.pv3_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Hn.toNum(Math.min(fr/As.toNum()*100,200),0):100,ks=t.solar.pv4_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Hn.toNum(Math.min(mr/ws.toNum()*100,200),0):100,Ms=t.solar.pv5_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Hn.toNum(Math.min(pr/xs.toNum()*100,200),0):100;let Cs,Ns;switch(!0){case ca<0&&Tt.includes(Ha.toLowerCase()):Cs=qo,Ns=qa;break;case ca>=0&&Tt.includes(Ha.toLowerCase()):Cs=Jo,Ns=qa;break;case 0===ca&&Bt.includes(Ha.toLowerCase()):Cs=Ko,Ns=ao;break;default:Cs=Jo,Ns=qa}return((t,e,n)=>{Qr.solarColour=n.solarColour,Qr.decimalPlacesEnergy=n.decimalPlacesEnergy,Qr.decimalPlaces=n.decimalPlaces,Yr.gridColour=n.gridColour,Yr.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(Or||(Or=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\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\t\t\t\t\t\t","\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"])),Yn.getStyle(n),t.title?V(Rr||(Rr=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.dev_mode?U(Gr||(Gr=gt(["\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t"])),Kr.generateLoadTimes(n,t)):"",t.show_grid?U(Dr||(Dr=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 "])),Yr.generateShapeAndName(n,t),Yr.generateDailyImport(n,t),Yr.generateDailyExport(n,t),Yr.generateFlowLines(n),Yr.generateIcon(n,t),Yr.generateEnergyCost(n,t),Yr.generatePhases(n,t),Yr.generatePrepaidUnits(n,t),Yr.generateLimit(n,t),Yr.generateTotalGridPower(n,t),Yr.generateFrequency(n)):"",t.show_grid&&t.grid.show_nonessential?U(jr||(jr=gt(["\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t "])),Xr.generateShapeAndName(n,t),Xr.generateLoad1(n,t),Xr.generateLoad2(n,t),Xr.generateLoad3(n,t),Xr.generateLines(n,t),Xr.generateFlowLine(n,t),Xr.generateTotalPower(n,t),Xr.generateIcon(n,t)):"",t.show_solar?U(Sr||(Sr=gt(["\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t "])),Qr.generateSolarHeader(n,t),Qr.generateMppt1(n,t),Qr.generateMppt2(n,t),Qr.generateMppt3(n,t),Qr.generateMppt4(n,t),Qr.generateMppt5(n,t),Qr.generateSolarPower(n,t),Qr.generateSolarSellIcon(n,t)):"",Wn.getTexts(n),t.show_battery?U(Ir||(Ir=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 "])),Wr.generateShapes(n),Wr.generatePower(n,t),Wr.generateDuration(n),Wr.generateDailyCharge(n,t),Wr.generateDailyDischarge(n,t),Wr.generateSOC(n,t),Wr.generateSOH(n),Wr.generateCapacity(n,t),Wr.generateShutdownSOC(n,t),Wr.generateFlowLines(n,t),Wr.generateBatteryGradient(n,t),Wr.generateVoltage(n,t),Wr.generateCurrent(n,t),Wr.generateTemp(n)):"",t.show_battery&&t.battery.show_battery_banks?U(Hr||(Hr=gt(["\n\t\t\t\t\t\t\t\t","\n "])),Jr.getBatteryBanksDetails(n,t)):"",n.additionalLoad>0?U(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 ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t "])),Qn.generateLines(n,t),Qn.generateLoad1(n,t),Qn.generateLoad2(n,t),Qn.generateLoad3(n,t),Qn.generateLoad4(n,t),Qn.generateLoad5(n,t),Qn.generateLoad6(n,t),Qn.generateLoad7(n,t),Qn.generateLoad8(n,t),Qn.generateLoad9(n,t),Qn.generateLoad10(n,t),Qn.generateLoad11(n,t),Qn.generateLoad12(n,t),Qn.generateLoad13(n,t),Qn.generateLoad14(n,t),Qn.generateLoad15(n,t),Qn.generateLoad16(n,t),Qn.generateLoad17(n,t),Qn.generateLoad18(n,t),Qn.generateLoad19(n,t),Qn.generateLoad20(n,t),Qn.generateLoad21(n,t),Qn.generateLoad22(n,t),Qn.generateLoad23(n,t)):"",n.showAux?U(Ur||(Ur=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"])),Fr.generateShapes(n,t),Fr.generateLines(n),Fr.generateLoad1(n,t),Fr.generateLoad2(n,t),Fr.generateTotalLoad(n,t),Fr.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),Zr.generateTimerInfo(n,t),Zr.generatePriorityLoad(n,t),Zr.generateInverterImage(n,e),Zr.generateInverterState(n,t),Zr.generateInverterLoad(n,t),Zr.generateInverterProgram(n),Zr.generatePhases(n,t),Zr.generateFrequency(n),Zr.generateTemperatures(n,t))})(t,ur,{config:t,refreshTime:e,panelMode:tr,compactMode:!0,cardHeight:ir,cardWidth:sr,loadColour:fa,batteryColour:ri,gridColour:qa,gridImportColour:Fa,gridExportColour:Ja,isFloating:oi,inverterColour:er,solarColour:Ar,auxOffColour:ro,batteryEnergy:ai,largeFont:$o,batteryPower:rr,stateBatteryPower:P,batteryDuration:ni,batteryCapacity:$r,additionalLoad:vo,essIconSize:hs,essIcon:gs,stateUseTimer:g,batteryStateMsg:mi,stateBatterySoc:L,inverterProg:qr,batteryPercentage:ts,stateBatteryBank1Power:R,stateBatteryBank2Power:G,stateBatteryBank3Power:D,stateBatteryBank4Power:j,stateBatteryBank1Voltage:S,stateBatteryBank2Voltage:I,stateBatteryBank3Voltage:H,stateBatteryBank4Voltage:Q,stateBatteryBank1Current:W,stateBatteryBank2Current:Y,stateBatteryBank3Current:Z,stateBatteryBank4Current:X,stateBatteryBank1Delta:F,stateBatteryBank2Delta:J,stateBatteryBank3Delta:K,stateBatteryBank4Delta:q,stateBatteryBank1RemainingStorage:$,stateBatteryBank2RemainingStorage:tt,stateBatteryBank3RemainingStorage:et,stateBatteryBank4RemainingStorage:nt,stateBatteryBank1Soc:at,stateBatteryBank2Soc:ot,stateBatteryBank3Soc:rt,stateBatteryBank4Soc:it,dynamicBatteryBatteryBank1Colour:ii,dynamicBatteryBatteryBank2Colour:si,dynamicBatteryBatteryBank3Colour:li,dynamicBatteryBatteryBank4Colour:ci,pvPercentage:$i,loadShowDaily:Sa,stateEnergyCostSell:fn,stateEnergyCostBuy:yn,loadPowerL1:Ya,loadPowerL2:Za,loadPowerL3:Xa,durationCur:this.durationCur,stateGridPowerL1:en,stateGridPowerL2:nn,stateGridPowerL3:an,stateGridVoltageL1:on,stateGridVoltageL2:rn,stateGridVoltageL3:sn,stateGridCurrentL1:ln,stateGridCurrentL2:cn,stateGridCurrentL3:dn,decimalPlaces:ha,decimalPlacesEnergy:ya,stateEssentialLoad1:wt,stateEssentialLoad2:Et,stateEssentialLoad3:Pt,stateEssentialLoad4:zt,stateEssentialLoad5:Ot,stateEssentialLoad6:Rt,stateEssentialLoad7:Gt,stateEssentialLoad8:Dt,stateEssentialLoad9:jt,stateEssentialLoad10:St,stateEssentialLoad11:It,stateEssentialLoad12:Ht,stateEssentialLoad13:Vt,stateEssentialLoad14:Ut,stateEssentialLoad15:Qt,stateEssentialLoad16:Wt,stateEssentialLoad17:Yt,stateEssentialLoad18:Zt,stateEssentialLoad19:Xt,stateEssentialLoad20:Ft,stateEssentialLoad21:Jt,stateEssentialLoad22:Kt,stateEssentialLoad23:qt,stateEssentialLoad1Extra:$t,stateEssentialLoad2Extra:te,stateEssentialLoad3Extra:ee,stateEssentialLoad4Extra:ne,stateEssentialLoad5Extra:ae,stateEssentialLoad6Extra:oe,stateEssentialLoad7Extra:re,stateEssentialLoad8Extra:ie,stateEssentialLoad9Extra:se,stateEssentialLoad10Extra:le,stateEssentialLoad11Extra:ce,stateEssentialLoad12Extra:de,stateEssentialLoad13Extra:ue,stateEssentialLoad14Extra:ge,stateEssentialLoad15Extra:he,stateEssentialLoad16Extra:ye,stateEssentialLoad17Extra:fe,stateEssentialLoad18Extra:me,stateEssentialLoad19Extra:pe,stateEssentialLoad20Extra:ve,stateEssentialLoad21Extra:be,stateEssentialLoad22Extra:Ae,stateEssentialLoad23Extra:we,stateEssentialLoad1Toggle:xe,stateEssentialLoad2Toggle:Ee,stateEssentialLoad3Toggle:Le,stateEssentialLoad4Toggle:Pe,stateEssentialLoad5Toggle:_e,stateEssentialLoad6Toggle:ke,stateEssentialLoad7Toggle:Me,stateEssentialLoad8Toggle:Ce,stateEssentialLoad9Toggle:Ne,stateEssentialLoad10Toggle:Be,stateEssentialLoad11Toggle:Te,stateEssentialLoad12Toggle:ze,stateEssentialLoad13Toggle:Oe,stateEssentialLoad14Toggle:Re,stateEssentialLoad15Toggle:Ge,stateEssentialLoad16Toggle:De,stateEssentialLoad17Toggle:je,stateEssentialLoad18Toggle:Se,stateEssentialLoad19Toggle:Ie,stateEssentialLoad20Toggle:He,stateEssentialLoad21Toggle:Ve,stateEssentialLoad22Toggle:Ue,stateEssentialLoad23Toggle:Qe,stateNonessentialLoad1:dt,stateNonessentialLoad2:ut,stateNonessentialLoad3:ht,stateNonEssentialLoad1Extra:yt,stateNonEssentialLoad2Extra:mt,stateNonEssentialLoad3Extra:pt,stateNonEssentialLoad1Toggle:vt,stateNonEssentialLoad2Toggle:bt,stateNonEssentialLoad3Toggle:At,gridShowDailyBuy:uo,gridShowDailySell:go,batteryShowDaily:fo,inverterModel:dr,batteryShutdown:zr,enableAutarky:nr,autarkyPower:Pi,ratioPower:_i,ratioEnergy:Ai,autarkyEnergy:bi,autarkyAuto:Ni,autarkySelf:Bi,shutdownOffGrid:Tr,statePV1Current:An,statePV2Current:xn,statePV3Current:Ln,statePV4Current:_n,statePV5Current:Mn,energyCost:cr,stateInverterCurrentL1:v,stateInverterCurrentL2:b,stateInverterCurrentL3:A,stateRadiatorTemp:y,stateInverterVoltageL1:f,stateInverterVoltageL2:m,stateInverterVoltageL3:p,stateBatteryVoltage:E,stateBatteryCurrent:_,batLineWidth:Hi,totalGridPower:ca,solarLineWidth:Zi,totalPV:br,loadLineWidth:Vi,pvPercentageBat:ss,gridPercentageBat:ls,genericInverterImage:ga,battery0:ps,essentialPower:wr,pv1LineWidth:Gi,pv2LineWidth:Di,pv3LineWidth:ji,pv4LineWidth:Si,pv5LineWidth:Ii,gridLineWidth:Qi,stateEnvironmentTemp:w,statePV1Voltage:bn,statePV2Voltage:wn,statePV3Voltage:En,statePV4Voltage:Pn,statePV5Voltage:kn,batteryStateColour:fi,inverterStateColour:di,stateBatteryTemp:k,statePrepaidUnits:pn,stateDCTransformerTemp:h,stateInverterLoadPercentage:x,iconEssentialLoad1:wo,iconEssentialLoad2:xo,iconEssentialLoad3:Eo,iconEssentialLoad4:Lo,iconEssentialLoad5:Po,iconEssentialLoad6:_o,iconEssentialLoad7:ko,iconEssentialLoad8:Mo,iconEssentialLoad9:Co,iconEssentialLoad10:No,iconEssentialLoad11:Bo,iconEssentialLoad12:To,iconEssentialLoad13:zo,iconEssentialLoad14:Oo,iconEssentialLoad15:Ro,iconEssentialLoad16:Go,iconEssentialLoad17:Do,iconEssentialLoad18:jo,iconEssentialLoad19:So,iconEssentialLoad20:Io,iconEssentialLoad21:Ho,iconEssentialLoad22:Vo,iconEssentialLoad23:Uo,enableTimer:ar,stateSolarSell:Sn,priorityLoad:or,inverterImg:ur,stateDailyPVEnergy:Un,stateMonthlyPVEnergy:Kn,stateYearlyPVEnergy:qn,stateTotalSolarGeneration:$n,stateRemainingSolar:ta,stateTomorrowSolar:ea,statePV2Power:Nn,statePV3Power:Bn,statePV4Power:Tn,statePV5Power:zn,statePV1Energy:On,statePV2Energy:Rn,statePV3Energy:Gn,statePV4Energy:Dn,statePV5Energy:jn,stateDayLoadEnergy:o,stateDayBatteryDischarge:n,stateDayGridImport:r,stateDayBatteryCharge:a,stateDayGridExport:i,statePVTotal:In,statePV1Power:Cn,minLineWidth:Mi,stopColour:ms,gridStatus:Ha,batteryCharge:fs,gridOffColour:ao,batteryIcon:ys,formattedResultTime:ei,showAux:mo,nonessentialIcon:Yo,showNonessential:Ia,nonessentialLoads:co,iconNonessentialLoad1:Zo,iconNonessentialLoad2:Xo,iconNonessentialLoad3:Fo,inverterStateMsg:ui,auxType:Ao,showDailyAux:po,nonessentialPower:xr,nonessLineWidth:Yi,grid169LineWidth:Wi,auxLineWidth:Ui,iconAuxLoad1:Qo,iconAuxLoad2:Wo,stateDayAuxEnergy:s,additionalAuxLoad:bo,auxPower:aa,stateAuxPower:lt,stateAuxLoad1:Xe,stateAuxLoad2:Fe,stateAuxLoad1Extra:Je,stateAuxLoad2Extra:Ke,stateAuxLoad1Toggle:qe,stateAuxLoad2Toggle:$e,autoScaledInverterPower:Ua,autoScaledGridPower:Qa,auxDynamicColour:lo,auxDynamicColourLoad1:io,auxDynamicColourLoad2:so,stateMaxSellPower:vn,totalPVEfficiency:Es,PV1Efficiency:Ls,PV2Efficiency:Ps,PV3Efficiency:_s,PV4Efficiency:ks,PV5Efficiency:Ms,gridPercentage:es,flowColour:ds,flowBatColour:cs,flowInvColour:us,dynamicColourEssentialLoad1:ma,dynamicColourEssentialLoad2:pa,dynamicColourEssentialLoad3:va,dynamicColourEssentialLoad4:ba,dynamicColourEssentialLoad5:Aa,dynamicColourEssentialLoad6:wa,dynamicColourEssentialLoad7:xa,dynamicColourEssentialLoad8:Ea,dynamicColourEssentialLoad9:La,dynamicColourEssentialLoad10:Pa,dynamicColourEssentialLoad11:_a,dynamicColourEssentialLoad12:ka,dynamicColourEssentialLoad13:Ma,dynamicColourEssentialLoad14:Ca,dynamicColourEssentialLoad15:Na,dynamicColourEssentialLoad16:Ba,dynamicColourEssentialLoad17:Ta,dynamicColourEssentialLoad18:za,dynamicColourEssentialLoad19:Oa,dynamicColourEssentialLoad20:Ra,dynamicColourEssentialLoad21:Ga,dynamicColourEssentialLoad22:Da,dynamicColourEssentialLoad23:ja,dynamicColourNonEssentialLoad:$a,dynamicColourNonEssentialLoad1:to,dynamicColourNonEssentialLoad2:eo,dynamicColourNonEssentialLoad3:no,stateBatteryRemainingStorage:O,stateBatterySOH:z,customGridIcon:Cs,customGridIconColour:Ns,stateLoadFrequency:l,stateGridFrequency:tn})}getNowTime(){const t=new Date,e=t.getHours().toString().padStart(2,"0"),n=t.getMinutes().toString().padStart(2,"0"),a=t.getSeconds().toString().padStart(2,"0");return"".concat(e,":").concat(n,":").concat(a)}batteryColour(t,e,n,a){return t<0&&!e?n:a}isFloating(t,e){return-2<=t.toNum(0)&&t.toNum(0)<=2&&e.toNum(0)>=99}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 Ei(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=this.getNowTime(),a={type:t.type,refresh_time:n};this._config=In({},Pt,t,a)}};var Pi,_i;t([dt()],Li.prototype,"hass",void 0),t([dt()],Li.prototype,"_config",void 0),t([ut("#grid-flow")],Li.prototype,"gridFlow",void 0),t([ut("#grid1-flow")],Li.prototype,"grid1Flow",void 0),t([ut("#solar-flow")],Li.prototype,"solarFlow",void 0),t([ut("#pv1-flow")],Li.prototype,"pv1Flow",void 0),t([ut("#pv2-flow")],Li.prototype,"pv2Flow",void 0),t([ut("#pv3-flow")],Li.prototype,"pv3Flow",void 0),t([ut("#pv4-flow")],Li.prototype,"pv4Flow",void 0),t([ut("#pv5-flow")],Li.prototype,"pv5Flow",void 0),t([ut("#battery-flow")],Li.prototype,"batteryFlow",void 0),t([ut("#load-flow")],Li.prototype,"loadFlow",void 0),t([ut("#aux-flow")],Li.prototype,"auxFlow",void 0),t([ut("#ne-flow")],Li.prototype,"neFlow",void 0),t([ut("#ne1-flow")],Li.prototype,"ne1Flow",void 0),Li=t([st("mlk-power-flow-card")],Li),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"}(Pi||(Pi={})),function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(_i||(_i={}));var ki,Mi,Ci={exports:{}};ki=Ci,Mi=Ci.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]],y="[object Arguments]",f="[object Array]",m="[object Boolean]",p="[object Date]",v="[object Error]",b="[object Function]",A="[object GeneratorFunction]",w="[object Map]",x="[object Number]",E="[object Object]",L="[object Promise]",P="[object RegExp]",_="[object Set]",k="[object String]",M="[object Symbol]",C="[object WeakMap]",N="[object ArrayBuffer]",B="[object DataView]",T="[object Float32Array]",z="[object Float64Array]",O="[object Int8Array]",R="[object Int16Array]",G="[object Int32Array]",D="[object Uint8Array]",j="[object Uint8ClampedArray]",S="[object Uint16Array]",I="[object Uint32Array]",H=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,U=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Q=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,Y=RegExp(Q.source),Z=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,yt=/^\[object .+?Constructor\]$/,ft=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,pt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,bt=/['\n\r\u2028\u2029\\]/g,At="\\ud800-\\udfff",wt="\\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",_t="\\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",kt="['’]",Mt="["+At+"]",Ct="["+_t+"]",Nt="["+wt+"]",Bt="\\d+",Tt="["+xt+"]",zt="["+Et+"]",Ot="[^"+At+_t+Bt+xt+Et+Lt+"]",Rt="\\ud83c[\\udffb-\\udfff]",Gt="[^"+At+"]",Dt="(?:\\ud83c[\\udde6-\\uddff]){2}",jt="[\\ud800-\\udbff][\\udc00-\\udfff]",St="["+Lt+"]",It="\\u200d",Vt="(?:"+zt+"|"+Ot+")",Ut="(?:"+St+"|"+Ot+")",Qt="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Yt="(?:"+Nt+"|"+Rt+")?",Zt="["+Pt+"]?",Xt=Zt+Yt+"(?:"+It+"(?:"+[Gt,Dt,jt].join("|")+")"+Zt+Yt+")*",Ft="(?:"+[Tt,Dt,jt].join("|")+")"+Xt,Jt="(?:"+[Gt+Nt+"?",Nt,Dt,jt,Mt].join("|")+")",Kt=RegExp(kt,"g"),qt=RegExp(Nt,"g"),$t=RegExp(Rt+"(?="+Rt+")|"+Jt+Xt,"g"),te=RegExp([St+"?"+zt+"+"+Qt+"(?="+[Ct,St,"$"].join("|")+")",Ut+"+"+Wt+"(?="+[Ct,St+Vt,"$"].join("|")+")",St+"?"+Vt+"+"+Qt,St+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Bt,Ft].join("|"),"g"),ee=RegExp("["+It+At+wt+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[T]=re[z]=re[O]=re[R]=re[G]=re[D]=re[j]=re[S]=re[I]=!0,re[y]=re[f]=re[N]=re[m]=re[B]=re[p]=re[v]=re[b]=re[w]=re[x]=re[E]=re[P]=re[_]=re[k]=re[C]=!1;var ie={};ie[y]=ie[f]=ie[N]=ie[B]=ie[m]=ie[p]=ie[T]=ie[z]=ie[O]=ie[R]=ie[G]=ie[w]=ie[x]=ie[E]=ie[P]=ie[_]=ie[k]=ie[M]=ie[D]=ie[j]=ie[S]=ie[I]=!0,ie[v]=ie[b]=ie[C]=!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=Mi&&!Mi.nodeType&&Mi,ye=he&&ki&&!ki.nodeType&&ki,fe=ye&&ye.exports===he,me=fe&&de.process,pe=function(){try{var t=ye&&ye.require&&ye.require("util").types;return t||me&&me.binding&&me.binding("util")}catch(t){}}(),ve=pe&&pe.isArrayBuffer,be=pe&&pe.isDate,Ae=pe&&pe.isMap,we=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 Be(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",""":'"',"'":"'"}),fn=function at(At){var wt,xt=(At=null==At?ge:fn.defaults(ge.Object(),At,fn.pick(ge,ae))).Array,Et=At.Date,Lt=At.Error,Pt=At.Function,_t=At.Math,kt=At.Object,Mt=At.RegExp,Ct=At.String,Nt=At.TypeError,Bt=xt.prototype,Tt=Pt.prototype,zt=kt.prototype,Ot=At["__core-js_shared__"],Rt=Tt.toString,Gt=zt.hasOwnProperty,Dt=0,jt=(wt=/[^.]+$/.exec(Ot&&Ot.keys&&Ot.keys.IE_PROTO||""))?"Symbol(src)_1."+wt:"",St=zt.toString,It=Rt.call(kt),Ht=ge._,Vt=Mt("^"+Rt.call(Gt).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ut=fe?At.Buffer:t,Qt=At.Symbol,Wt=At.Uint8Array,Yt=Ut?Ut.allocUnsafe:t,Zt=sn(kt.getPrototypeOf,kt),Xt=kt.create,Ft=zt.propertyIsEnumerable,Jt=Bt.splice,$t=Qt?Qt.isConcatSpreadable:t,ee=Qt?Qt.iterator:t,se=Qt?Qt.toStringTag:t,de=function(){try{var t=hr(kt,"defineProperty");return t({},"",{}),t}catch(t){}}(),ue=At.clearTimeout!==ge.clearTimeout&&At.clearTimeout,he=Et&&Et.now!==ge.Date.now&&Et.now,ye=At.setTimeout!==ge.setTimeout&&At.setTimeout,me=_t.ceil,pe=_t.floor,De=kt.getOwnPropertySymbols,We=Ut?Ut.isBuffer:t,mn=At.isFinite,pn=Bt.join,vn=sn(kt.keys,kt),bn=_t.max,An=_t.min,wn=Et.now,xn=At.parseInt,En=_t.random,Ln=Bt.reverse,Pn=hr(At,"DataView"),_n=hr(At,"Map"),kn=hr(At,"Promise"),Mn=hr(At,"Set"),Cn=hr(At,"WeakMap"),Nn=hr(kt,"create"),Bn=Cn&&new Cn,Tn={},zn=Sr(Pn),On=Sr(_n),Rn=Sr(kn),Gn=Sr(Mn),Dn=Sr(Cn),jn=Qt?Qt.prototype:t,Sn=jn?jn.valueOf:t,In=jn?jn.toString:t;function Hn(t){if(ns(t)&&!Wi(t)&&!(t instanceof Wn)){if(t instanceof Qn)return t;if(Gt.call(t,"__wrapped__"))return Ir(t)}return new Qn(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 Un(){}function Qn(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 Yn(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]&&Gt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!l)return Bo(e,s)}else{var g=mr(e),h=g==b||g==A;if(Fi(e))return Po(e,l);if(g==E||g==y||h&&!r){if(s=c||h?{}:vr(e),!l)return c?function(t,e){return To(t,fr(t),e)}(e,function(t,e){return t&&To(e,zs(e),t)}(s,e)):function(t,e){return To(t,yr(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 N:return _o(t);case m:case p:return new o(+t);case B:return function(t,e){var n=e?_o(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case T:case z:case O:case R:case G:case D:case j:case S:case I:return ko(t,n);case w:return new o;case x:case k: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 _:return new o;case M:return a=t,Sn?kt(Sn.call(a)):{}}}(e,g,l)}}i||(i=new Jn);var f=i.get(e);if(f)return f;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?zs:Ts)(e);return _e(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=kt(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 Nt(e);return Tr((function(){n.apply(t,o)}),a)}function ga(t,e,n,a){var o=-1,r=Ne,i=!0,s=t.length,l=[],c=e.length;if(!s)return l;n&&(e=Te(e,Je(n))),a?(r=Be,i=!1):e.length>=200&&(r=qe,i=!1,e=new Fn(e));t:for(;++o-1},Zn.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 Yn,map:new(_n||Zn),string:new Yn}},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 Zn,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 Zn){var a=n.__data__;if(!_n||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=Ro(wa),ya=Ro(xa,!0);function fa(t,e){var n=!0;return ha(t,(function(t,a,o){return n=!!e(t,a,o)})),n}function ma(e,n,a){for(var o=-1,r=e.length;++o0&&n(s)?e>1?va(s,e-1,n,a,o):ze(o,s):a||(o[o.length]=s)}return o}var ba=Go(),Aa=Go(!0);function wa(t,e){return t&&ba(t,e,Ts)}function xa(t,e){return t&&Aa(t,e,Ts)}function Ea(t,e){return Ce(e,(function(e){return qi(t[e])}))}function La(e,n){for(var a=0,o=(n=wo(n,e)).length;null!=e&&ae}function Ma(t,e){return null!=t&&Gt.call(t,e)}function Ca(t,e){return null!=t&&e in kt(t)}function Na(e,n,a){for(var o=a?Be:Ne,r=e[0].length,i=e.length,s=i,l=xt(i),c=1/0,d=[];s--;){var u=e[s];s&&n&&(u=Te(u,Je(n))),c=An(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 Ya(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;Ar(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 zr(Mr(t,e,ol),t+"")}function qa(t){return qn(Hs(t))}function $a(t,e){var n=Hs(t);return Gr(n,la(e,0,n.length))}function to(e,n,a,o){if(!es(e))return e;for(var r=-1,i=(n=wo(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=Yt?Yt(n):new t.constructor(n);return t.copy(a),a}function _o(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function ko(t,e){var n=e?_o(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Mo(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&&wr(a[0],a[1],s)&&(i=r<3?t:i,r=1),n=kt(n);++o-1?r[i?n[s]:s]:t}}function Ho(n){return or((function(a){var o=a.length,r=o,i=Qn.prototype.thru;for(n&&a.reverse();r--;){var s=a[r];if("function"!=typeof s)throw new Nt(e);if(i&&!l&&"wrapper"==lr(s))var l=new Qn([],!0)}for(r=l?r:o;++r1&&b.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,y=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 _e(h,(function(n){var a="_."+n[0];e&n[1]&&!Ne(t,a)&&t.push(a)})),t.sort()}(function(t){var e=t.match(rt);return e?e[1].split(it):[]}(a),n)))}function Rr(e){var n=0,a=0;return function(){var o=wn(),r=16-(o-a);if(a=o,r>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(t,arguments)}}function Gr(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 yi(t,e){return e(t)}var fi=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&&Ar(a)?((o=o.slice(a,+a+(n?1:0))).__actions__.push({func:yi,args:[r],thisArg:t}),new Qn(o,this.__chain__).thru((function(e){return n&&!e.length&&e.push(t),e}))):this.thru(r)})),mi=zo((function(t,e,n){Gt.call(t,n)?++t[n]:ia(t,n,1)})),pi=Io(Qr),vi=Io(Wr);function bi(t,e){return(Wi(t)?_e:ha)(t,dr(e,3))}function Ai(t,e){return(Wi(t)?ke:ya)(t,dr(e,3))}var wi=zo((function(t,e,n){Gt.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=Zi(t)?xt(t.length):[];return ha(t,(function(t){r[++a]=o?Le(e,t,n):Ba(t,e,n)})),r})),Ei=zo((function(t,e,n){ia(t,n,e)}));function Li(t,e){return(Wi(t)?Te:Ia)(t,dr(e,3))}var Pi=zo((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),_i=Ka((function(t,e){if(null==t)return[];var n=e.length;return n>1&&wr(t,e[0],e[1])?e=[]:n>2&&wr(e[0],e[1],e[2])&&(e=[e[0]]),Wa(t,va(e,1),[])})),ki=he||function(){return ge.Date.now()};function Mi(e,n,a){return n=a?t:n,n=e&&null==n?e.length:n,$o(e,s,t,t,t,t,n)}function Ci(n,a){var o;if("function"!=typeof a)throw new Nt(e);return n=fs(n),function(){return--n>0&&(o=a.apply(this,arguments)),n<=1&&(a=t),o}}var Ni=Ka((function(t,e,n){var a=1;if(n.length){var o=ln(n,cr(Ni));a|=r}return $o(t,a,e,n,o)})),Bi=Ka((function(t,e,n){var a=3;if(n.length){var o=ln(n,cr(Bi));a|=r}return $o(e,a,t,n,o)}));function Ti(n,a,o){var r,i,s,l,c,d,u=0,g=!1,h=!1,y=!0;if("function"!=typeof n)throw new Nt(e);function f(e){var a=r,o=i;return r=i=t,u=e,l=n.apply(o,a)}function m(e){var n=e-d;return d===t||n>=a||n<0||h&&e-u>=s}function p(){var t=ki();if(m(t))return v(t);c=Tr(p,function(t){var e=a-(t-d);return h?An(e,s-(t-u)):e}(t))}function v(e){return c=t,y&&r?f(e):(r=i=t,l)}function b(){var e=ki(),n=m(e);if(r=arguments,i=this,d=e,n){if(c===t)return function(t){return u=t,c=Tr(p,a),g?f(t):l}(d);if(h)return Lo(c),c=Tr(p,a),f(d)}return c===t&&(c=Tr(p,a)),l}return a=ps(a)||0,es(o)&&(g=!!o.leading,s=(h="maxWait"in o)?bn(ps(o.maxWait)||0,a):s,y="trailing"in o?!!o.trailing:y),b.cancel=function(){c!==t&&Lo(c),u=0,r=d=i=c=t},b.flush=function(){return c===t?l:v(ki())},b}var zi=Ka((function(t,e){return ua(t,1,e)})),Oi=Ka((function(t,e,n){return ua(t,ps(e)||0,n)}));function Ri(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new Nt(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(Ri.Cache||Xn),a}function Gi(t){if("function"!=typeof t)throw new Nt(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)}}Ri.Cache=Xn;var Di=xo((function(t,e){var n=(e=1==e.length&&Wi(e[0])?Te(e[0],Je(dr())):Te(va(e,1),Je(dr()))).length;return Ka((function(a){for(var o=-1,r=An(a.length,n);++o=e})),Qi=Ta(function(){return arguments}())?Ta:function(t){return ns(t)&&Gt.call(t,"callee")&&!Ft.call(t,"callee")},Wi=xt.isArray,Yi=ve?Je(ve):function(t){return ns(t)&&_a(t)==N};function Zi(t){return null!=t&&ts(t.length)&&!qi(t)}function Xi(t){return ns(t)&&Zi(t)}var Fi=We||pl,Ji=be?Je(be):function(t){return ns(t)&&_a(t)==p};function Ki(t){if(!ns(t))return!1;var e=_a(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=_a(t);return e==b||e==A||"[object AsyncFunction]"==e||"[object Proxy]"==e}function $i(t){return"number"==typeof t&&t==fs(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=Ae?Je(Ae):function(t){return ns(t)&&mr(t)==w};function os(t){return"number"==typeof t||ns(t)&&_a(t)==x}function rs(t){if(!ns(t)||_a(t)!=E)return!1;var e=Zt(t);if(null===e)return!0;var n=Gt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Rt.call(n)==It}var is=we?Je(we):function(t){return ns(t)&&_a(t)==P},ss=xe?Je(xe):function(t){return ns(t)&&mr(t)==_};function ls(t){return"string"==typeof t||!Wi(t)&&ns(t)&&_a(t)==k}function cs(t){return"symbol"==typeof t||ns(t)&&_a(t)==M}var ds=Ee?Je(Ee):function(t){return ns(t)&&ts(t.length)&&!!re[_a(t)]},us=Xo(Sa),gs=Xo((function(t,e){return t<=e}));function hs(t){if(!t)return[];if(Zi(t))return ls(t)?gn(t):Bo(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=mr(t);return(e==w?rn:e==_?cn:Hs)(t)}function ys(t){return t?(t=ps(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function fs(t){var e=ys(t),n=e%1;return e==e?n?e-n:e:0}function ms(t){return t?la(fs(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||ft.test(t)?ce(t.slice(2),n?2:8):gt.test(t)?u:+t}function vs(t){return To(t,zs(t))}function bs(t){return null==t?"":uo(t)}var As=Oo((function(t,e){if(Pr(e)||Zi(e))To(e,Ts(e),t);else for(var n in e)Gt.call(e,n)&&na(t,n,e[n])})),ws=Oo((function(t,e){To(e,zs(e),t)})),xs=Oo((function(t,e,n,a){To(e,zs(e),t,a)})),Es=Oo((function(t,e,n,a){To(e,Ts(e),t,a)})),Ls=or(sa),Ps=Ka((function(e,n){e=kt(e);var a=-1,o=n.length,r=o>2?n[2]:t;for(r&&wr(n[0],n[1],r)&&(o=1);++a1),e})),To(t,ir(t),n),a&&(n=ca(n,7,nr));for(var o=e.length;o--;)ho(n,e[o]);return n})),Ds=or((function(t,e){return null==t?{}:function(t,e){return Ya(t,e,(function(e,n){return Ms(t,n)}))}(t,e)}));function js(t,e){if(null==t)return{};var n=Te(ir(t),(function(t){return[t]}));return e=dr(e),Ya(t,n,(function(t,n){return e(t,n[0])}))}var Ss=qo(Ts),Is=qo(zs);function Hs(t){return null==t?[]:Ke(t,Ts(t))}var Vs=jo((function(t,e,n){return e=e.toLowerCase(),t+(n?Us(e):e)}));function Us(t){return Ks(bs(t).toLowerCase())}function Qs(t){return(t=bs(t))&&t.replace(pt,en).replace(qt,"")}var Ws=jo((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ys=jo((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Zs=Do("toLowerCase"),Xs=jo((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Fs=jo((function(t,e,n){return t+(n?" ":"")+Ks(e)})),Js=jo((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ks=Do("toUpperCase");function qs(e,n,a){return e=bs(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 _e(e,(function(e){e=jr(e),ia(t,e,Ni(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 Ga("function"==typeof t?t:ca(t,1))}var il=Ka((function(t,e){return function(n){return Ba(n,t,e)}})),sl=Ka((function(t,e){return function(n){return Ba(t,n,e)}}));function ll(t,e,n){var a=Ts(e),o=Ea(e,a);null!=n||es(e)&&(o.length||!a.length)||(n=e,e=t,t=this,o=Ea(e,Ts(e)));var r=!(es(n)&&"chain"in n&&!n.chain),i=qi(t);return _e(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__=Bo(this.__actions__)).push({func:a,args:arguments,thisArg:t}),n.__chain__=e,n}return a.apply(t,ze([this.value()],arguments))})})),t}function cl(){}var dl=Wo(Te),ul=Wo(Me),gl=Wo(Ge);function hl(t){return xr(t)?Qe(jr(t)):function(t){return function(e){return La(e,t)}}(t)}var yl=Zo(),fl=Zo(!0);function ml(){return[]}function pl(){return!1}var vl,bl=Qo((function(t,e){return t+e}),0),Al=Jo("ceil"),wl=Qo((function(t,e){return t/e}),1),xl=Jo("floor"),El=Qo((function(t,e){return t*e}),1),Ll=Jo("round"),Pl=Qo((function(t,e){return t-e}),0);return Hn.after=function(t,n){if("function"!=typeof n)throw new Nt(e);return t=fs(t),function(){if(--t<1)return n.apply(this,arguments)}},Hn.ary=Mi,Hn.assign=As,Hn.assignIn=ws,Hn.assignInWith=xs,Hn.assignWith=Es,Hn.at=Ls,Hn.before=Ci,Hn.bind=Ni,Hn.bindAll=tl,Hn.bindKey=Bi,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?wr(e,n,a):n===t)?1:bn(fs(n),0);var o=null==e?0:e.length;if(!o||n<1)return[];for(var r=0,i=0,s=xt(me(o/n));rr?0:r+a),(o=o===t||o>r?r:fs(o))<0&&(o+=r),o=a>o?0:ms(o);a>>0)?(e=bs(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 Nt(e);return n=null==n?0:bn(fs(n),0),Ka((function(e){var a=e[n],o=Eo(e,0,n);return a&&ze(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:fs(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:fs(n)))<0?0:n,o):[]},Hn.takeRightWhile=function(t,e){return t&&t.length?fo(t,dr(e,3),!1,!0):[]},Hn.takeWhile=function(t,e){return t&&t.length?fo(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 Nt(e);return es(a)&&(o="leading"in a?!!a.leading:o,r="trailing"in a?!!a.trailing:r),Ti(t,n,{leading:o,maxWait:n,trailing:r})},Hn.thru=yi,Hn.toArray=hs,Hn.toPairs=Ss,Hn.toPairsIn=Is,Hn.toPath=function(t){return Wi(t)?Te(t,jr):cs(t)?[t]:Bo(Dr(bs(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(Zt(t)):{}}return(o?_e:wa)(t,(function(t,a,o){return e(n,t,a,o)})),n},Hn.unary=function(t){return Mi(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:yo(t,e,Ao(n))},Hn.updateWith=function(e,n,a,o){return o="function"==typeof o?o:t,null==e?e:yo(e,n,Ao(a),o)},Hn.values=Hs,Hn.valuesIn=function(t){return null==t?[]:Ke(t,zs(t))},Hn.without=si,Hn.words=qs,Hn.wrap=function(t,e){return ji(Ao(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=ws,Hn.extendWith=xs,ll(Hn,Hn),Hn.add=bl,Hn.attempt=$s,Hn.camelCase=Vs,Hn.capitalize=Us,Hn.ceil=Al,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,Ts(e))},Hn.deburr=Qs,Hn.defaultTo=function(t,e){return null==t||t!=t?e:t},Hn.divide=wl,Hn.endsWith=function(e,n,a){e=bs(e),n=uo(n);var o=e.length,r=a=a===t?o:la(fs(a),0,o);return(a-=n.length)>=0&&e.slice(a,r)==n},Hn.eq=Hi,Hn.escape=function(t){return(t=bs(t))&&Z.test(t)?t.replace(W,nn):t},Hn.escapeRegExp=function(t){return(t=bs(t))&&et.test(t)?t.replace(tt,"\\$&"):t},Hn.every=function(e,n,a){var o=Wi(e)?Me:fa;return a&&wr(e,n,a)&&(n=t),o(e,dr(n,3))},Hn.find=pi,Hn.findIndex=Qr,Hn.findKey=function(t,e){return je(t,dr(e,3),wa)},Hn.findLast=vi,Hn.findLastIndex=Wr,Hn.findLastKey=function(t,e){return je(t,dr(e,3),xa)},Hn.floor=xl,Hn.forEach=bi,Hn.forEachRight=Ai,Hn.forIn=function(t,e){return null==t?t:ba(t,dr(e,3),zs)},Hn.forInRight=function(t,e){return null==t?t:Aa(t,dr(e,3),zs)},Hn.forOwn=function(t,e){return t&&wa(t,dr(e,3))},Hn.forOwnRight=function(t,e){return t&&xa(t,dr(e,3))},Hn.get=ks,Hn.gt=Vi,Hn.gte=Ui,Hn.has=function(t,e){return null!=t&&pr(t,e,Ma)},Hn.hasIn=Ms,Hn.head=Zr,Hn.identity=ol,Hn.includes=function(t,e,n,a){t=Zi(t)?t:Hs(t),n=n&&!a?fs(n):0;var o=t.length;return n<0&&(n=bn(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:fs(n);return o<0&&(o=bn(a+o,0)),Ie(t,e,o)},Hn.inRange=function(e,n,a){return n=ys(n),a===t?(a=n,n=0):a=ys(a),function(t,e,n){return t>=An(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)&&mr(t)==C},Hn.isWeakSet=function(t){return ns(t)&&"[object WeakSet]"==_a(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=fs(a))<0?bn(o+r,0):An(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=Ys,Hn.lowerFirst=Zs,Hn.lt=us,Hn.lte=gs,Hn.max=function(e){return e&&e.length?ma(e,ol,ka):t},Hn.maxBy=function(e,n){return e&&e.length?ma(e,dr(n,2),ka):t},Hn.mean=function(t){return Ue(t,ol)},Hn.meanBy=function(t,e){return Ue(t,dr(e,2))},Hn.min=function(e){return e&&e.length?ma(e,ol,Sa):t},Hn.minBy=function(e,n){return e&&e.length?ma(e,dr(n,2),Sa):t},Hn.stubArray=ml,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?Qa(e,fs(n)):t},Hn.noConflict=function(){return ge._===this&&(ge._=Ht),this},Hn.noop=cl,Hn.now=ki,Hn.pad=function(t,e,n){t=bs(t);var a=(e=fs(e))?un(t):0;if(!e||a>=e)return t;var o=(e-a)/2;return Yo(pe(o),n)+t+Yo(me(o),n)},Hn.padEnd=function(t,e,n){t=bs(t);var a=(e=fs(e))?un(t):0;return e&&an){var o=e;e=n,n=o}if(a||e%1||n%1){var r=En();return An(e+r*(n-e+le("1e-"+((r+"").length-1))),n)}return Fa(e,n)},Hn.reduce=function(t,e,n){var a=Wi(t)?Oe:Ye,o=arguments.length<3;return a(t,dr(e,4),n,o,ha)},Hn.reduceRight=function(t,e,n){var a=Wi(t)?Re:Ye,o=arguments.length<3;return a(t,dr(e,4),n,o,ya)},Hn.repeat=function(e,n,a){return n=(a?wr(e,n,a):n===t)?1:fs(n),Ja(bs(e),n)},Hn.replace=function(){var t=arguments,e=bs(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Hn.result=function(e,n,a){var o=-1,r=(n=wo(n,e)).length;for(r||(r=1,e=t);++od)return[];var n=g,a=An(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=Mt(r.source,bs(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=bs(t))&&Y.test(t)?t.replace(Q,yn):t},Hn.uniqueId=function(t){var e=++Dt;return bs(t)+e},Hn.upperCase=Js,Hn.upperFirst=Ks,Hn.each=bi,Hn.eachRight=Ai,Hn.first=Zr,ll(Hn,(vl={},wa(Hn,(function(t,e){Gt.call(Hn.prototype,e)||(vl[e]=t)})),vl),{chain:!1}),Hn.VERSION="4.17.21",_e(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Hn[t].placeholder=Hn})),_e(["drop","take"],(function(e,n){Wn.prototype[e]=function(a){a=a===t?1:bn(fs(a),0);var o=this.__filtered__&&!n?new Wn(this):this.clone();return o.__filtered__?o.__takeCount__=An(a,o.__takeCount__):o.__views__.push({size:An(a,g),type:e+(o.__dir__<0?"Right":"")}),o},Wn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),_e(["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}})),_e(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Wn.prototype[t]=function(){return this[n](1).value()[0]}})),_e(["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 Ba(n,t,e)}))})),Wn.prototype.reject=function(t){return this.filter(Gi(dr(t)))},Wn.prototype.slice=function(e,n){e=fs(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=fs(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)},wa(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,ze([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,y=i&&!g,f=l&&!h;if(!i&&d){n=f?n:new Wn(this);var m=e.apply(n,s);return m.__actions__.push({func:yi,args:[u],thisArg:t}),new Qn(m,g)}return y&&f?e.apply(this,s):(m=this.thru(u),y?o?m.value()[0]:m.value():m)})})),_e(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Bt[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)}))}})),wa(Wn.prototype,(function(t,e){var n=Hn[e];if(n){var a=n.name+"";Gt.call(Tn,a)||(Tn[a]=[]),Tn[a].push({name:e,func:n})}})),Tn[Vo(t,2).name]=[{name:"wrapper",func:t}],Wn.prototype.clone=function(){var t=new Wn(this.__wrapped__);return t.__actions__=Bo(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Bo(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Bo(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 Un;){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:yi,args:[ei],thisArg:t}),new Qn(n,this.__chain__)}return this.thru(ei)},Hn.prototype.toJSON=Hn.prototype.valueOf=Hn.prototype.value=function(){return mo(this.__wrapped__,this.__actions__)},Hn.prototype.first=Hn.prototype.head,ee&&(Hn.prototype[ee]=function(){return this}),Hn}();ye?((ye.exports=fn)._=fn,he._=fn):ge._=fn}.call(Ht);var Ni,Bi,Ti=Ci.exports;let zi=class extends rt{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(Bi||(Bi=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(ft).map((t=>({label:Ti.capitalize(t),value:t})))}}},{name:"modern",selector:{boolean:{}}},{name:"autarky",selector:{select:{options:Object.values(mt).map((t=>({label:Ti.capitalize(t),value:t})))}}},{name:"colour",selector:{color_rgb:{}}},{name:"ac_icon",selector:{icon:{}}},{name:"dc_icon",selector:{icon:{}}}]},{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:Ot.VOLTAGE}}},{name:"inverter_voltage_L2",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"inverter_voltage_L3",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"load_frequency_192",selector:{entity:{device_class:Ot.FREQUENCY}}},{name:"inverter_current_164",selector:{entity:{device_class:Ot.CURRENT}}},{name:"inverter_current_L2",selector:{entity:{device_class:Ot.CURRENT}}},{name:"inverter_current_L3",selector:{entity:{device_class:Ot.CURRENT}}},{name:"inverter_power_175",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_power_169",selector:{entity:{device_class:Ot.POWER}}},{name:"dc_transformer_temp_90",selector:{entity:{device_class:Ot.TEMPERATURE}}},{name:"radiator_temp_91",selector:{entity:{device_class:Ot.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("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("solar_production_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"pv_total",selector:{entity:{device_class:Ot.POWER}}},{name:"day_pv_energy_108",selector:{entity:{device_class:Ot.ENERGY}}},{name:"monthly_pv_generation",selector:{entity:{device_class:Ot.ENERGY}}},{name:"yearly_pv_generation",selector:{entity:{device_class:Ot.ENERGY}}},{name:"total_pv_generation",selector:{entity:{device_class:Ot.ENERGY}}},{name:"remaining_solar",selector:{entity:{device_class:Ot.ENERGY}}},{name:"tomorrow_solar",selector:{entity:{device_class:Ot.ENERGY}}}]}]},{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("pv_1_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"pv1_power_186",selector:{entity:{device_class:Ot.POWER}}},{name:"pv1_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv1_voltage_109",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv1_current_110",selector:{entity:{device_class:Ot.CURRENT}}}]}]},{type:"expandable",title:this._title("pv_2_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"pv2_power_187",selector:{entity:{device_class:Ot.POWER}}},{name:"pv2_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv2_voltage_111",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv2_current_112",selector:{entity:{device_class:Ot.CURRENT}}}]}]},{type:"expandable",title:this._title("pv_3_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"pv3_power_188",selector:{entity:{device_class:Ot.POWER}}},{name:"pv3_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv3_voltage_113",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv3_current_114",selector:{entity:{device_class:Ot.CURRENT}}}]}]},{type:"expandable",title:this._title("pv_4_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"pv4_power_189",selector:{entity:{device_class:Ot.POWER}}},{name:"pv4_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv4_voltage_115",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv4_current_116",selector:{entity:{device_class:Ot.CURRENT}}}]}]},{type:"expandable",title:this._title("pv_5_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"pv5_power",selector:{entity:{device_class:Ot.POWER}}},{name:"pv5_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv5_voltage",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv5_current",selector:{entity:{device_class:Ot.CURRENT}}}]}]},{type:"expandable",title:this._title("optional_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"solar_sell_247",selector:{entity:{}}},{name:"environment_temp",selector:{entity:{device_class:Ot.TEMPERATURE}}}]}]}]},{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("battery_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"battery_power_190",selector:{entity:{device_class:Ot.POWER}}},{name:"battery_soc_184",selector:{entity:{device_class:Ot.BATTERY}}},{name:"battery_current_191",selector:{entity:{device_class:Ot.CURRENT}}},{name:"battery_voltage_183",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_temp_182",selector:{entity:{device_class:Ot.TEMPERATURE}}},{name:"day_battery_charge_70",selector:{entity:{device_class:Ot.ENERGY}}},{name:"day_battery_discharge_71",selector:{entity:{device_class:Ot.ENERGY}}},{name:"battery_remaining_storage",selector:{entity:{device_class:Ot.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("optional_ent"),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("battery_bank"),schema:[{name:"battery",type:"grid",schema:[{name:"show_battery_banks",selector:{boolean:{}}},{name:"battery_banks_view_mode",selector:{select:{options:Object.values(pt).map((t=>({label:Ti.capitalize(t),value:t})))}}},{name:"battery_banks",selector:{number:{mode:"box",min:0,max:4}}},{name:"battery_bank_1_energy",selector:{number:{min:0}}},{name:"battery_bank_2_energy",selector:{number:{min:0}}},{name:"battery_bank_3_energy",selector:{number:{min:0}}},{name:"battery_bank_4_energy",selector:{number:{min:0}}}]}]},{type:"expandable",title:this._title("battery_bank_1_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"battery_bank_1_power",selector:{entity:{device_class:Ot.POWER}}},{name:"battery_bank_1_voltage",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_bank_1_current",selector:{entity:{device_class:Ot.CURRENT}}},{name:"battery_bank_1_delta",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_bank_1_remaining_storage",selector:{entity:{device_class:[Ot.ENERGY,Ot.ENERGY_STORAGE]}}},{name:"battery_bank_1_soc",selector:{entity:{device_class:Ot.BATTERY}}}]}]},{type:"expandable",title:this._title("battery_bank_2_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"battery_bank_2_power",selector:{entity:{device_class:Ot.POWER}}},{name:"battery_bank_2_voltage",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_bank_2_current",selector:{entity:{device_class:Ot.CURRENT}}},{name:"battery_bank_2_delta",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_bank_2_remaining_storage",selector:{entity:{device_class:[Ot.ENERGY,Ot.ENERGY_STORAGE]}}},{name:"battery_bank_2_soc",selector:{entity:{device_class:Ot.BATTERY}}}]}]},{type:"expandable",title:this._title("battery_bank_3_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"battery_bank_3_power",selector:{entity:{device_class:Ot.POWER}}},{name:"battery_bank_3_voltage",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_bank_3_current",selector:{entity:{device_class:Ot.CURRENT}}},{name:"battery_bank_3_delta",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_bank_3_remaining_storage",selector:{entity:{device_class:[Ot.ENERGY,Ot.ENERGY_STORAGE]}}},{name:"battery_bank_3_soc",selector:{entity:{device_class:Ot.BATTERY}}}]}]},{type:"expandable",title:this._title("battery_bank_4_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"battery_bank_4_power",selector:{entity:{device_class:Ot.POWER}}},{name:"battery_bank_4_voltage",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_bank_4_current",selector:{entity:{device_class:Ot.CURRENT}}},{name:"battery_bank_4_delta",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_bank_4_remaining_storage",selector:{entity:{device_class:[Ot.ENERGY,Ot.ENERGY_STORAGE]}}},{name:"battery_bank_4_soc",selector:{entity:{device_class:Ot.BATTERY}}}]}]}]},{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("load_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"day_load_energy_84",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_power",selector:{entity:{device_class:Ot.POWER}}},{name:"load_power_L1",selector:{entity:{device_class:Ot.POWER}}},{name:"load_power_L2",selector:{entity:{device_class:Ot.POWER}}},{name:"load_power_L3",selector:{entity:{device_class:Ot.POWER}}}]}]},{type:"expandable",title:this._title("additional_loads_1"),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:{}}}]}]},{type:"expandable",title:this._title("ess_ld_1"),schema:[{name:"entities",type:"grid",schema:[{name:"essential_load1",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load1_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load1_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load2",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load2_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load2_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load3",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load3_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load3_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load4",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load4_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load4_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load5",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load5_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load5_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load6",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load6_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load6_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load7",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load7_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load7_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load8",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load8_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load8_toggle",selector:{entity:{domain:["input_boolean","switch"]}}}]}]},{type:"expandable",title:this._title("additional_loads_2"),schema:[{name:"load",type:"grid",schema:[{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:{}}}]}]},{type:"expandable",title:this._title("ess_ld_2"),schema:[{name:"entities",type:"grid",schema:[{name:"essential_load9",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load9_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load9_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load10",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load10_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load10_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load11",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load11_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load11_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load12",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load12_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load12_toggle",selector:{entity:{domain:["input_boolean","switch"]}}}]}]},{type:"expandable",title:this._title("additional_loads_3"),schema:[{name:"load",type:"grid",schema:[{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("ess_ld_3"),schema:[{name:"entities",type:"grid",schema:[{name:"essential_load13",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load13_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load13_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load14",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load14_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load14_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load15",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load15_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load15_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load16",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load16_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load16_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load17",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load17_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load17_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load18",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load18_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load18_toggle",selector:{entity:{domain:["input_boolean","switch"]}}}]}]},{type:"expandable",title:this._title("additional_loads_4"),schema:[{name:"load",type:"grid",schema:[{name:"load19_name",selector:{text:{}}},{name:"load19_icon",selector:{icon:{}}},{name:"load20_name",selector:{text:{}}},{name:"load20_icon",selector:{icon:{}}},{name:"load21_name",selector:{text:{}}},{name:"load21_icon",selector:{icon:{}}},{name:"load22_name",selector:{text:{}}},{name:"load22_icon",selector:{icon:{}}},{name:"load23_name",selector:{text:{}}},{name:"load23_icon",selector:{icon:{}}}]}]},{type:"expandable",title:this._title("ess_ld_4"),schema:[{name:"entities",type:"grid",schema:[{name:"essential_load19",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load19_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load19_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load20",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load20_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load20_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load21",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load21_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load21_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load22",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load22_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load22_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load23",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load23_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load23_toggle",selector:{entity:{domain:["input_boolean","switch"]}}}]}]},{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("aux_load_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"day_aux_energy",selector:{entity:{device_class:Ot.ENERGY}}},{name:"aux_power_166",selector:{entity:{device_class:Ot.POWER}}},{name:"aux_load1",selector:{entity:{device_class:Ot.POWER}}},{name:"aux_load1_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"aux_load1_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"aux_load2",selector:{entity:{device_class:Ot.POWER}}},{name:"aux_load2_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"aux_load2_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"aux_load3",selector:{entity:{device_class:Ot.POWER}}},{name:"aux_load3_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"aux_load3_toggle",selector:{entity:{domain:["input_boolean","switch"]}}}]}]}]},{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:{}}}]},{type:"expandable",title:this._title("ness_load"),schema:[{name:"grid",type:"grid",schema:[{name:"show_nonessential",selector:{boolean:{}}},{name:"additional_loads",selector:{number:{mode:"box",min:0,max:3}}},{name:"nonessential_name",selector:{text:{}}},{name:"nonessential_icon",selector:{icon:{}}},{name:"load1_name",selector:{text:{}}},{name:"load1_icon",selector:{icon:{}}},{name:"load2_name",selector:{text:{}}},{name:"load2_icon",selector:{icon:{}}},{name:"load3_name",selector:{text:{}}},{name:"load3_icon",selector:{icon:{}}}]}]},{type:"expandable",title:this._title("ness_load_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"nonessential_power",selector:{entity:{device_class:Ot.POWER}}},{name:"non_essential_load1",selector:{entity:{device_class:Ot.POWER}}},{name:"non_essential_load1_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"non_essential_load1_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"non_essential_load2",selector:{entity:{device_class:Ot.POWER}}},{name:"non_essential_load2_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"non_essential_load2_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"non_essential_load3",selector:{entity:{device_class:Ot.POWER}}},{name:"non_essential_load3_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"non_essential_load3_toggle",selector:{entity:{domain:["input_boolean","switch"]}}}]}]},{type:"expandable",title:this._title("gri_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"day_grid_import_76",selector:{entity:{device_class:Ot.ENERGY}}},{name:"day_grid_export_77",selector:{entity:{device_class:Ot.ENERGY}}},{name:"grid_frequency",selector:{entity:{device_class:Ot.FREQUENCY}}},{name:"grid_ct_power_172",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_ct_power_L2",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_ct_power_L3",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_voltage_L1",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"grid_voltage_L2",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"grid_voltage_L3",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"grid_current_L1",selector:{entity:{device_class:Ot.CURRENT}}},{name:"grid_current_L2",selector:{entity:{device_class:Ot.CURRENT}}},{name:"grid_current_L3",selector:{entity:{device_class:Ot.CURRENT}}},{name:"grid_ct_power_total",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_voltage",selector:{entity:{device_class:Ot.VOLTAGE}}},{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:Ot.POWER}}}]}]}]}],this._valueChanged.bind(this)):V(Ni||(Ni=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([dt()],zi.prototype,"hass",void 0),t([dt()],zi.prototype,"_config",void 0),t([dt()],zi.prototype,"lovelace",void 0),zi=t([st(zt)],zi);var Oi=Object.freeze({__proto__:null,get ConfigurationCardEditor(){return zi}});export{Li as PowerFlowCard}; +function ut(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 ht;const yt=((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)})(ht||(ht=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 ft,mt,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"}(ft||(ft={})),function(t){t.Energy="energy",t.Power="power",t.AutoSelf="auto&self",t.No="no"}(mt||(mt={})),function(t){t.none="none",t.inner="Minimal inner view"}(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_bat:"Priority Bat",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"},bt={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"},At={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",show_battery_banks:"Show Battery Banks",battery_banks:"Battery Banks",battery_bank_1_energy:"Bank 1 Max Energy",battery_bank_2_energy:"Bank 2 Max Energy",battery_bank_3_energy:"Bank 3 Max Energy",battery_bank_4_energy:"Bank 4 Max Energy",battery_banks_view_mode:"Battery Banks View mode",cat_title:{title:"Title Options",general:"General Options",adv_viewbox:"Adv. ViewBox Options",optional_ent:"Optional Entities",inverter:"Inverter Options",inv:"Inverter Entities",inv_prog:"Programs Entities",solar:"Solar Options",solar_production:"Production Names",solar_production_ent:"Production Entities",max_power:"PV Max Power",mppt_options:"PVs options",pv_1_ent:"PV1 Entities",pv_2_ent:"PV2 Entities",pv_3_ent:"PV3 Entities",pv_4_ent:"PV4 Entities",pv_5_ent:"PV5 Entities",battery:"Battery Options",battery_ent:"Battery Entities",battery_bank:"Battery Banks Options",battery_bank_1_ent:"Battery Bank 1 Entities",battery_bank_2_ent:"Battery Bank 2 Entities",battery_bank_3_ent:"Battery Bank 3 Entities",battery_bank_4_ent:"Battery Bank 4 Entities",load:"Load Options",load_ent:"Load Entities",additional_loads_1:"Additional Load 1-8 Options",additional_loads_2:"Additional Load 9-13 Options",additional_loads_3:"Additional Load 14-18 Options",additional_loads_4:"Additional Load 19-23 Options",ess_ld_1:"Additional Load 1-8 Entities",ess_ld_2:"Additional Load 9-13 Entities",ess_ld_3:"Additional Load 14-18 Entities",ess_ld_4:"Additional Load 19-23 Entities",aux_load:"Aux Load Options",aux_load_ent:"Aux Load Entities",grid:"Grid Options",gri_ent:"Grid Entities",ness_load:"Non-Essential Load Options",ness_load_ent:"Non-Essential Load Entities"}},wt={common:vt,errors:bt,config:At};const xt={hass:null},Et={en:Object.freeze({__proto__:null,common:vt,config:At,default:wt,errors:bt})};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,dev_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:ft.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,battery_banks_view_mode:pt.none},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 _t=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23],kt=[0,1,2,3],Mt=[!0,!1],Ct=[!0,!1],Nt=[0,1,2],Bt=["off","0","off-grid","off grid","offgrid"],Tt=["on","1","on-grid","on grid","ongrid"],zt="mlk-content-card-editor";var Ot,Rt,Gt,Dt,jt,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"}(Ot||(Ot={})),function(t){t.WATT="W",t.KILO_WATT="kW",t.MEGA_WATT="MW",t.BTU_PER_HOUR="BTU/h"}(Rt||(Rt={})),function(t){t.GIGA_JOULE="GJ",t.KILO_WATT_HOUR="kWh",t.MEGA_JOULE="MJ",t.MEGA_WATT_HOUR="MWh",t.WATT_HOUR="Wh"}(Gt||(Gt={})),function(t){t.MILLIAMPERE="mA",t.AMPERE="A"}(Dt||(Dt={})),function(t){t.MILLIVOLT="mV",t.VOLT="V"}(jt||(jt={})),function(t){t.HERTZ="Hz"}(St||(St={}));const It={[Gt.WATT_HOUR]:[{threshold:1e6,divisor:1e6,targetUnit:Gt.MEGA_WATT_HOUR},{threshold:1e3,divisor:1e3,targetUnit:Gt.KILO_WATT_HOUR,decimal:1}],[Gt.KILO_WATT_HOUR]:[{threshold:1e3,divisor:1e3,targetUnit:Gt.MEGA_WATT_HOUR,decimal:2}],[Gt.MEGA_WATT_HOUR]:[],[Gt.GIGA_JOULE]:[{threshold:1e3,divisor:1e3,targetUnit:Gt.MEGA_JOULE}],[Gt.MEGA_JOULE]:[],[Rt.WATT]:[{threshold:1e6,divisor:1e6,targetUnit:Rt.MEGA_WATT},{threshold:1e3,divisor:1e3,targetUnit:Rt.KILO_WATT}],[Rt.KILO_WATT]:[{threshold:1e3,divisor:1e3,targetUnit:Rt.MEGA_WATT}],[Rt.MEGA_WATT]:[],[Rt.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 Ut={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*)$/,y={};y["[object Float32Array]"]=y["[object Float64Array]"]=y["[object Int8Array]"]=y["[object Int16Array]"]=y["[object Int32Array]"]=y["[object Uint8Array]"]=y["[object Uint8ClampedArray]"]=y["[object Uint16Array]"]=y["[object Uint32Array]"]=!0,y[o]=y["[object Array]"]=y["[object ArrayBuffer]"]=y["[object Boolean]"]=y["[object DataView]"]=y["[object Date]"]=y["[object Error]"]=y[i]=y["[object Map]"]=y["[object Number]"]=y[c]=y["[object RegExp]"]=y["[object Set]"]=y["[object String]"]=y["[object WeakMap]"]=!1;var f="object"==typeof Ht&&Ht&&Ht.Object===Object&&Ht,m="object"==typeof self&&self&&self.Object===Object&&self,p=f||m||Function("return this")(),v=e&&!e.nodeType&&e,b=v&&t&&!t.nodeType&&t,A=b&&b.exports===v,w=A&&f.process,x=function(){try{var t=b&&b.require&&b.require("util").types;return t||w&&w.binding&&w.binding("util")}catch(t){}}(),E=x&&x.isTypedArray;var L,P=Array.prototype,_=Function.prototype,k=Object.prototype,M=p["__core-js_shared__"],C=_.toString,N=k.hasOwnProperty,B=(L=/[^.]+$/.exec(M&&M.keys&&M.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"",T=k.toString,z=C.call(Object),O=RegExp("^"+C.call(N).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R=A?p.Buffer:void 0,G=p.Symbol,D=p.Uint8Array;R&&R.allocUnsafe;var j,S,I=(j=Object.getPrototypeOf,S=Object,function(t){return j(S(t))}),H=Object.create,V=k.propertyIsEnumerable,U=P.splice,Q=G?G.toStringTag:void 0,W=function(){try{var t=mt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=R?R.isBuffer:void 0,Z=Math.max,X=Date.now,F=mt(p,"Map"),J=mt(Object,"create"),K=function(){function t(){}return function(e){if(!Mt(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=ft(this,t).delete(t);return this.size-=e?1:0,e},tt.prototype.get=function(t){return ft(this,t).get(t)},tt.prototype.has=function(t){return ft(this,t).has(t)},tt.prototype.set=function(t,e){var n=ft(this,t),a=n.size;return n.set(t,e),this.size+=n.size==a?0:1,this},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:Q&&Q in Object(t)?function(t){var e=N.call(t,Q),n=t[Q];try{t[Q]=void 0;var a=!0}catch(t){}var o=T.call(t);a&&(e?t[Q]=n:delete t[Q]);return o}(t):function(t){return T.call(t)}(t)}function ct(t){return Ct(t)&<(t)==o}function dt(t){return!(!Mt(t)||function(t){return!!B&&B in t}(t))&&(_t(t)?O:g).test(function(t){if(null!=t){try{return C.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function ut(t){if(!Mt(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&&N.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),Mt(r))!function(t,e,n,a,o,r,i){var s=bt(t,n),l=bt(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),y=!h&&Pt(l),f=!h&&!y&&Nt(l);u=l,h||y||f?Et(s)?u=s:Ct(m=s)&&Lt(m)?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)}}(yt);function wt(t,e){return t===e||t!=t&&e!=e}var xt=ct(function(){return arguments}())?ct:function(t){return Ct(t)&&N.call(t,"callee")&&!V.call(t,"callee")},Et=Array.isArray;function Lt(t){return null!=t&&kt(t.length)&&!_t(t)}var Pt=Y||function(){return!1};function _t(t){if(!Mt(t))return!1;var e=lt(t);return e==i||e==s||e==r||e==d}function kt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Mt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ct(t){return null!=t&&"object"==typeof t}var Nt=E?function(t){return function(e){return t(e)}}(E):function(t){return Ct(t)&&kt(t.length)&&!!y[lt(t)]};function Bt(t){return Lt(t)?nt(t):ut(t)}var Tt,zt=(Tt=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=Tt.length>3&&"function"==typeof o?(a--,o):void 0,r&&function(t,e,n){if(!Mt(n))return!1;var a=typeof e;return!!("number"==a?Lt(n)&&pt(e,n.length):"string"==a&&e in n)&&wt(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,a=!0){n=isNaN(n)?2:n;const o=Number(t);if(isNaN(o))return Number(0).toFixed(n);const r=It[e];if(!r)return a?"".concat(this.toNum(o,n)," ").concat(e):"".concat(this.toNum(o,n));if(e===Rt.WATT&&Math.abs(o)<1e3)return a?"".concat(Math.round(o)," ").concat(e):"".concat(Math.round(o));if(e===Rt.KILO_WATT&&Math.abs(o)<1)return a?"".concat(Math.round(1e3*o)," W"):"".concat(Math.round(1e3*o));if(e===Rt.MEGA_WATT&&Math.abs(o)<1)return a?"".concat((1e3*o).toFixed(n)," kW"):"".concat((1e3*o).toFixed(n));for(const t of r)if(Math.abs(o)>=t.threshold){const e=(o/t.divisor).toFixed(t.decimal||n);return a?"".concat(e," ").concat(t.targetUnit):"".concat(e)}return a?"".concat(o.toFixed(n)," ").concat(e):"".concat(o.toFixed(n))}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 U(Qt||(Qt=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=>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 U(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 U(Yt||(Yt=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(Hn.convertValue(t.loadPowerL1,t.decimalPlaces)||0):"".concat(t.loadPowerL1||0," ").concat(Rt.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(Rt.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(Rt.WATT))}static generateShapeAndName(t,e){const n=400+(this.LOAD_X-400)/2-101.3;return U(Zt||(Zt=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 U(Xt||(Xt=gt(["\n\t\t\t","\n\t\t"])),e.entities?.essential_power&&"none"!==e.entities.essential_power?U(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=>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(Rt.WATT)):U(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(Hn.convertValue(t.essentialPower,t.decimalPlaces)||0):"".concat(t.essentialPower||0," ").concat(Rt.WATT)))}static generateIcon(t,e){return U(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)}}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 Un{static getIconWithCondition(t,e,n,a,o,r=30){return U(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 U($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 U(te||(te=gt(["\n\t\t","\n\t\t"])),t?U(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()||f.isValidSwitch()?"":"none",t,e,s,l,a,i?"".concat(i):"",!c.isValid()&&f.isValidSwitch()?U(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=>Hn.handlePopup(t,f.entity_id)),t,e,d,u,a,Lt("common."+(f?.toOnOff()||"off"))):U(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=>Hn.handlePopup(t,c.entity_id)),t,e,d,u,c.isValid()?"":"none",a,c?.toPowerString(m,p)),(t=>Hn.handlePopup(t,g.entity_id)),t,e,h,y,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=Un.getIconLink(i.entity_id,Un.getIcon(c+u[0],d,e,"essload".concat(t,"_small-icon")));return U(ie||(ie=gt(["\n\t\t\t\t",""])),Un.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=Un.getIconLink(i.entity_id,Un.getIcon(c+u[0],d,e,"nes-load".concat(t,"_small-icon")));return U(se||(se=gt(["\n\t\t\t\t",""])),Un.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=Un.getIconLink(i.entity_id,Un.getIcon(c+u[0],d,e,"aux-load".concat(t,"_small-icon")));return U(le||(le=gt(["\n\t\t\t\t",""])),Un.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()?U(ce||(ce=gt(['\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 U(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=>Hn.handlePopup(t,e.entity_id)),t,n,a,e.isValid()?"":"none",o,e.toStr(1)||0,Dt.AMPERE)}static generatePhaseVoltage(t,e,n,a,o){return U(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=>Hn.handlePopup(t,e.entity_id)),t,n,a,e.isValid()?"":"none",o,e.toStr(1)||0,jt.VOLT)}static generatePhasePower(t,e,n,a,o,r,i){return U(ge||(ge=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=>Hn.handlePopup(t,e.entity_id)),t,n,a,e.isValid()?"":"none",r,o?"".concat(Hn.convertValue(e,i)||0):"".concat(e||0," ").concat(Rt.WATT))}}class Qn{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?U(he||(he=gt([""]))):U(ye||(ye=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=Un.getIconWithCondition(t.additionalLoad<=3,a,n?113:95,t.iconEssentialLoad1,"essload1-icon",36),l=Un.getIconLink(t.stateEssentialLoad1Toggle.entity_id,s);return U(fe||(fe=gt(["",""])),t.additionalLoad>=4?U(me||(me=gt(["\n\t\t\t",""])),Un.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)):U(pe||(pe=gt(["","\n\t\t\t"])),t.additionalLoad>=1?U(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):"",(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=Un.getIcon(n,250,t.iconEssentialLoad2,"essload2-icon",36),s=Un.getIconLink(t.stateEssentialLoad2Toggle.entity_id,i);return U(be||(be=gt(["",""])),t.additionalLoad>=4?U(Ae||(Ae=gt(["\n\t\t\t",""])),Un.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)):U(we||(we=gt(["",""])),3===t.additionalLoad?U(xe||(xe=gt(["\n\t\t\t\t\t",""])),Un.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)):U(Ee||(Ee=gt(["",""])),2===t.additionalLoad?U(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):"",(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()):U(Pe||(Pe=gt([""]))))))}static generateLoad3(t,e){return U(_e||(_e=gt(["",""])),3===t.additionalLoad?U(ke||(ke=gt(["\n\t\t\t\t",""])),Un.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)):U(Me||(Me=gt(["",""])),t.additionalLoad>=4?U(Ce||(Ce=gt(["\n\t\t\t\t\t",""])),Un.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)):U(Ne||(Ne=gt([""])))))}static generateLoad4(t,e){return U(Be||(Be=gt(["",""])),t.additionalLoad>=4?U(Te||(Te=gt(["\n\t\t\t\t",""])),Un.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)):U(ze||(ze=gt([""]))))}static generateLoad5(t,e){return U(Oe||(Oe=gt(["",""])),t.additionalLoad>=5?U(Re||(Re=gt(["\n\t\t\t\t",""])),Un.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)):U(Ge||(Ge=gt([""]))))}static generateLoad6(t,e){return U(De||(De=gt(["",""])),t.additionalLoad>=6?U(je||(je=gt(["\n\t\t\t\t",""])),Un.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)):U(Se||(Se=gt([""]))))}static generateLoad7(t,e){return U(Ie||(Ie=gt(["",""])),t.additionalLoad>=7&&!e.load.show_aux?U(He||(He=gt(["\n\t\t\t\t",""])),Un.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)):U(Ve||(Ve=gt([""]))))}static generateLoad8(t,e){return U(Ue||(Ue=gt(["",""])),t.additionalLoad>=8&&!e.load.show_aux?U(Qe||(Qe=gt(["\n\t\t\t\t",""])),Un.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)):U(We||(We=gt([""]))))}static generateLoad9(t,e){return U(Ye||(Ye=gt(["",""])),t.additionalLoad>=9&&(!e.load.show_aux||e.load.aux_loads<3)?U(Ze||(Ze=gt(["\n\t\t\t\t",""])),Un.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)):U(Xe||(Xe=gt([""]))))}static generateLoad10(t,e){return U(Fe||(Fe=gt(["",""])),t.additionalLoad>=10?U(Je||(Je=gt(["\n\t\t\t\t",""])),Un.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)):U(Ke||(Ke=gt([""]))))}static generateLoad11(t,e){return U(qe||(qe=gt(["",""])),t.additionalLoad>=11?U($e||($e=gt(["\n\t\t\t",""])),Un.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)):U(tn||(tn=gt([""]))))}static generateLoad12(t,e){return U(en||(en=gt(["",""])),t.additionalLoad>=12?U(nn||(nn=gt(["\n\t\t\t",""])),Un.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)):U(an||(an=gt([""]))))}static generateLoad13(t,e){return U(on||(on=gt(["",""])),t.additionalLoad>=13?U(rn||(rn=gt(["\n\t\t\t",""])),Un.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)):U(sn||(sn=gt([""]))))}static generateLoad14(t,e){return U(ln||(ln=gt(["",""])),t.additionalLoad>=14&&(!e.load.show_aux||e.load.aux_loads<4)?U(cn||(cn=gt(["\n\t\t\t\t",""])),Un.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)):U(dn||(dn=gt([""]))))}static generateLoad15(t,e){return U(un||(un=gt(["",""])),t.additionalLoad>=15?U(gn||(gn=gt(["\n\t\t\t\t",""])),Un.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)):U(hn||(hn=gt([""]))))}static generateLoad16(t,e){return U(yn||(yn=gt(["",""])),t.additionalLoad>=16?U(fn||(fn=gt(["\n\t\t\t",""])),Un.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)):U(mn||(mn=gt([""]))))}static generateLoad17(t,e){return U(pn||(pn=gt(["",""])),t.additionalLoad>=17?U(vn||(vn=gt(["\n\t\t\t",""])),Un.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)):U(bn||(bn=gt([""]))))}static generateLoad18(t,e){return U(An||(An=gt(["",""])),t.additionalLoad>=18?U(wn||(wn=gt(["\n\t\t\t",""])),Un.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)):U(xn||(xn=gt([""]))))}static generateLoad19(t,e){return U(En||(En=gt(["",""])),t.additionalLoad>=19&&(!e.load.show_aux||e.load.aux_loads<5)?U(Ln||(Ln=gt(["\n\t\t\t\t",""])),Un.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)):U(Pn||(Pn=gt([""]))))}static generateLoad20(t,e){return U(_n||(_n=gt(["",""])),t.additionalLoad>=20?U(kn||(kn=gt(["\n\t\t\t\t",""])),Un.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)):U(Mn||(Mn=gt([""]))))}static generateLoad21(t,e){return U(Cn||(Cn=gt(["",""])),t.additionalLoad>=21?U(Nn||(Nn=gt(["\n\t\t\t",""])),Un.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)):U(Bn||(Bn=gt([""]))))}static generateLoad22(t,e){return U(Tn||(Tn=gt(["",""])),t.additionalLoad>=22?U(zn||(zn=gt(["\n\t\t\t",""])),Un.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)):U(On||(On=gt([""]))))}static generateLoad23(t,e){return U(Rn||(Rn=gt(["",""])),t.additionalLoad>=23?U(Gn||(Gn=gt(["\n\t\t\t",""])),Un.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)):U(Dn||(Dn=gt([""]))))}}Qn.mainX=Vn.LOAD_X;class Wn{static getTexts(t){const e=this.mainX,n=this.mainX+46;return U(jn||(jn=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===mt.No?"none":"",t.enableAutarky===mt.Energy?"st4 st8 left-align":"st12",t.inverterColour,t.autarkyEnergy,n,this.mainY,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.Energy?"st4 st8 left-align":"st12",t.inverterColour,t.ratioEnergy,e,this.mainY,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.Power?"st4 st8 left-align":"st12",t.inverterColour,t.autarkyPower,n,this.mainY,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.Power?"st4 st8 left-align":"st12",t.inverterColour,t.ratioPower,e,this.mainY,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.AutoSelf?"st4 st8 left-align":"st12",t.inverterColour,t.autarkyAuto,n,this.mainY,t.enableAutarky===mt.No?"none":"",t.enableAutarky===mt.AutoSelf?"st4 st8 left-align":"st12",t.inverterColour,t.autarkySelf,e,this.mainY+13,t.enableAutarky===mt.No?"none":"",t.inverterColour,t.enableAutarky===mt.AutoSelf?Lt("common.autarkyAuto"):Lt("common.autarky"),n,this.mainY+13,t.enableAutarky===mt.No?"none":"",t.inverterColour,t.enableAutarky===mt.AutoSelf?Lt("common.autarkySelf"):Lt("common.ratio"))}}Wn.mainX=150,Wn.mainY=267;class Yn{static getStyle(t){return V(Sn||(Sn=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.dynamicColourEssentialLoad19,t.dynamicColourEssentialLoad20,t.dynamicColourEssentialLoad21,t.dynamicColourEssentialLoad22,t.dynamicColourEssentialLoad23,t.auxDynamicColourLoad1,t.auxDynamicColourLoad2,t.dynamicColourNonEssentialLoad,t.dynamicColourNonEssentialLoad1,t.dynamicColourNonEssentialLoad2,t.dynamicColourNonEssentialLoad3,t.customGridIconColour,t.inverterColour)}}const Zn="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,ya,fa,ma,pa,va,ba,Aa,wa,xa,Ea,La,Pa,_a,ka,Ma,Ca,Na,Ba,Ta,za,Oa,Ra,Ga,Da,ja,Sa,Ia,Ha,Va,Ua,Qa,Wa,Ya,Za,Xa,Fa,Ja,Ka,qa,$a,to,eo,no,ao,oo,ro,io,so,lo,co,uo,go,ho,yo,fo,mo,po,vo,bo,Ao,wo,xo,Eo,Lo,Po,_o,ko,Mo,Co,No,Bo,To,zo,Oo,Ro,Go,Do,jo,So,Io,Ho,Vo,Uo,Qo,Wo,Yo,Zo,Xo,Fo,Jo,Ko,qo,$o,tr,er,nr,ar,or,rr,ir,sr,lr,cr,dr,ur,gr,hr,yr,fr,mr,pr,vr,br,Ar,wr,xr,Er,Lr,Pr,_r,kr,Mr,Cr,Nr,Br,Tr,zr,Or,Rr,Gr,Dr,jr,Sr,Ir,Hr,Vr,Ur;class Qr{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 U(da||(da=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()?U(ua||(ua=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=>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(Rt.WATT)):U(ga||(ga=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?Hn.convertValue(t.totalPV,t.decimalPlaces)||0:"".concat(Hn.toNum(t.totalPV||0,0)," ").concat(Rt.WATT)))}static generateSolarHeader(t,e){let n,a=U(ha||(ha=gt([""]))),o=U(ya||(ya=gt([""]))),r=U(fa||(fa=gt([""]))),i=U(ma||(ma=gt([""]))),s=U(pa||(pa=gt([""]))),l=U(va||(va=gt([""]))),c=this.countGenerationElements(t);if(0==c)return U(ba||(ba=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=U(Aa||(Aa=gt(['\n\t\t\t\n\t\t\t\t\n\t\t\t'])),n.x,t.solarColour,ca),u=U(wa||(wa=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=>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),t.stateEnvironmentTemp.getUOM());return U(xa||(xa=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,U(Ea||(Ea=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=>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 U(La||(La=gt(["",""])),e.show_solar?U(Pa||(Pa=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)):U(_a||(_a=gt([""]))))}static generateMppt2(t,e){const n=this.getPositions(2,e.solar.mppts);return U(ka||(ka=gt(["",""])),e.show_solar&&e.solar.mppts>=2?U(Ma||(Ma=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)):U(Ca||(Ca=gt([""]))))}static generateMppt3(t,e){const n=this.getPositions(3,e.solar.mppts);return U(Na||(Na=gt(["",""])),e.show_solar&&e.solar.mppts>=3?U(Ba||(Ba=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)):U(Ta||(Ta=gt([""]))))}static generateMppt4(t,e){const n=this.getPositions(4,e.solar.mppts);return U(za||(za=gt(["",""])),e.show_solar&&e.solar.mppts>=4?U(Oa||(Oa=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)):U(Ra||(Ra=gt([""]))))}static generateMppt5(t,e){const n=this.getPositions(5,e.solar.mppts);return U(Ga||(Ga=gt(["",""])),e.show_solar&&e.solar.mppts>=5?U(Da||(Da=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)):U(ja||(ja=gt([""]))))}static generatePower(t,e,n,a){return U(Sa||(Sa=gt(['\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)+" "+Rt.WATT)}static generateFrame(t,e,n,a){return U(Ia||(Ia=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 U(Ha||(Ha=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 U(Va||(Va=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 U(Ua||(Ua=gt(['\n \n ',"%\n "])),t[2],n?"st3 st8 right-align":"st12",n?"":"none",this.solarColour,e)}static generateEnergy(t,e,n){return U(Qa||(Qa=gt(['\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 U(Wa||(Wa=gt(['\n \n ',"","\n \n "])),(t=>Hn.handlePopup(t,e.entity_id)),t[3],e.isValid()?"":"none",this.solarColour,e.toNum(1),jt.VOLT)}static generateAmperage(t,e){return U(Ya||(Ya=gt(['\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),Dt.AMPERE)}static generateSolarSellIcon(t,e){return U(Za||(Za=gt(['\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)}}Qr._solarColour="orange",Qr._decimalPlacesEnergy=2,Qr._decimalPlaces=2,Qr.pvLineMap={pv1:"#pv1-line",pv2:"#pv2-line",pv3:"#pv3-line",pv4:"#pv4-line",pv5:"#pv5-line"};class Wr{static generateShapes(t){return U(Xa||(Xa=gt(['\n\t\t\t\n\t\t'])),t.batteryColour)}static generatePower(t,e){return U(Fa||(Fa=gt(['\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(Rt.WATT))}static generateVoltage(t,e){return U(Ja||(Ja=gt(['\n\t\t\t\t\n \n '," ","\n \n \n\t\t"])),(e=>Hn.handlePopup(e,t.stateBatteryVoltage.entity_id)),e.battery.show_battery_banks?"202":"281",t.stateBatteryVoltage.isValid()?"":"none",t.batteryColour,e.battery.show_battery_banks?"right-align":"left-align",t.stateBatteryVoltage.toStr(t.decimalPlaces),jt.VOLT)}static generateCurrent(t,e){return U(Ka||(Ka=gt(['\n\t\t\t\t\n \n '," ","\n \n \n\t\t"])),(e=>Hn.handlePopup(e,t.stateBatteryCurrent.entity_id)),e.battery.show_battery_banks?"202":"281",t.stateBatteryCurrent.isValid()?"":"none",t.batteryColour,e.battery.show_battery_banks?"right-align":"left-align",t.stateBatteryCurrent.toStr(t.decimalPlaces,!1,e.battery.show_absolute),Dt.AMPERE)}static generateTemp(t){return U(qa||(qa=gt(['\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),t.stateBatteryTemp.getUOM())}static generateDuration(t){return U($a||($a=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",0===t.batteryEnergy||t.isFloating||0===t.batteryPower?"transparent":"".concat(t.batteryColour),t.batteryDuration,0===t.batteryEnergy||t.batteryPower<=0||t.isFloating?"transparent":"".concat(t.batteryColour),Lt("common.runtime_to"),t.batteryCapacity,t.formattedResultTime,0===t.batteryEnergy||t.batteryPower>=0||t.isFloating?"transparent":"".concat(t.batteryColour),Lt("common.to"),t.batteryCapacity,t.formattedResultTime,0!==t.batteryEnergy&&t.isFloating?"".concat(t.batteryColour):"transparent",Lt("common.battery_floating"))}static generateDailyCharge(t,e){return U(to||(to=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?"transparent":"".concat(t.batteryColour),Lt("common.daily_charge"),(t=>Hn.handlePopup(t,e.entities.day_battery_charge_70)),!0===t.batteryShowDaily&&t.stateDayBatteryCharge.isValid()?"":"none",t.batteryColour,t.stateDayBatteryCharge?.toPowerString(!0,t.decimalPlacesEnergy))}static generateDailyDischarge(t,e){return U(eo||(eo=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?"transparent":"".concat(t.batteryColour),Lt("common.daily_discharge"),(t=>Hn.handlePopup(t,e.entities.day_battery_discharge_71)),!0===t.batteryShowDaily&&t.stateDayBatteryDischarge.isValid()?"":"none",t.batteryColour,t.stateDayBatteryDischarge?.toPowerString(!0,t.decimalPlacesEnergy))}static generateFlowLines(t,e){return U(no||(no=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.battery.dynamic_colour?t.flowBatColour:t.batteryColour,t.batLineWidth,Math.min(2+t.batLineWidth+Math.max(t.minLineWidth-2,0),8),t.batteryPower<=0?"transparent":"".concat(t.batteryColour),t.durationCur.battery,Math.min(2+t.batLineWidth+Math.max(t.minLineWidth-2,0),8),t.batteryPower>=0?"transparent":"".concat(e.battery.dynamic_colour?t.flowBatColour:t.batteryColour),t.durationCur.battery)}static generateSOC(t,e){return U(ao||(ao=gt(['\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(1)?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 U(oo||(oo=gt(['\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 t.stateBatteryRemainingStorage?.isValid()?U(ro||(ro=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"])),(e=>Hn.handlePopup(e,t.stateBatteryRemainingStorage.entity_id)),e.battery.show_battery_banks?"202":"270",e.battery.show_battery_banks?"325":"338",e.battery.show_battery_banks?"right-align":"left-align",e.battery.show_remaining_energy?"":"none",t.batteryColour,t.stateBatteryRemainingStorage.toStr(2,!1,!0),t.stateBatteryRemainingStorage.getUOM()):U(io||(io=gt(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t\t","\n\t\t\t"])),e.battery.show_remaining_energy?"":"none",t.batteryColour,Hn.toNum(t.batteryEnergy*(t.stateBatterySoc.toNum(2)/100)/1e3,2),Gt.KILO_WATT_HOUR)}static generateShutdownSOC(t,e){return U(so||(so=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?"st12":"st14 left-align",!t.inverterProg.show&&e.battery?.shutdown_soc_offgrid?"":"none",t.batteryShutdown,t.batteryColour,e.battery.hide_soc?"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 U(lo||(lo=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.battery.dynamic_colour?"url(#bLg)":t.batteryColour,e.battery.linear_gradient?t.battery0:t.batteryIcon,t.stopColour,e.battery.animate?"y2":"none",e.battery.linear_gradient?"url(#sLg)":t.batteryColour,e.battery.linear_gradient?"":"none",t.batteryCharge)}}class Yr{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 U(co||(co=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 U(uo||(uo=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"])),Un.generatePhasePower("L1",t.stateGridPowerL1,this._col1X,241,e.grid.auto_scale,this.gridColour,this.decimalPlaces),Un.generatePhasePower("L2",t.stateGridPowerL2,this._col1X,254,e.grid.auto_scale,this.gridColour,this.decimalPlaces),Un.generatePhasePower("L3",t.stateGridPowerL3,this._col1X,267,e.grid.auto_scale,this.gridColour,this.decimalPlaces),Un.generatePhaseVoltage("L1",t.stateGridVoltageL1,this._col1X,195,this.gridColour),Un.generatePhaseVoltage("L2",t.stateGridVoltageL2,this._col1X,182,this.gridColour),Un.generatePhaseVoltage("L3",t.stateGridVoltageL3,this._col1X,169,this.gridColour),Un.generatePhaseAmperage("L1",t.stateGridCurrentL1,this._col2X,195,this.gridColour),Un.generatePhaseAmperage("L2",t.stateGridCurrentL2,this._col2X,182,this.gridColour),Un.generatePhaseAmperage("L3",t.stateGridCurrentL3,this._col2X,169,this.gridColour))}static generateFrequency(t){return U(go||(go=gt(["",""])),Un.generateFrequency(t.stateGridFrequency,t.gridColour,"grid_frequency",this._col1X,208,"right-align"))}static generateEnergyCost(t,e){return U(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\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 U(yo||(yo=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 U(fo||(fo=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=>Hn.handlePopup(t,e.entities.grid_connected_status_194)),Bt.includes(t.gridStatus.toLowerCase())?"st12":"",t.gridColour,t.totalGridPower<0||e.grid.import_icon?"none":"",la,Tt.includes(t.gridStatus.toLowerCase())?"st12":"",t.gridOffColour,e.grid.disconnected_icon?"none":"",sa,Bt.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 U(mo||(mo=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=>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 U(po||(po=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=>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 U(vo||(vo=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=>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 U(bo||(bo=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=>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 U(Ao||(Ao=gt(["\n\t\t\t","\t\t\n\t\t"])),e.inverter.three_phase?e.entities?.grid_ct_power_total?U(wo||(wo=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=>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(Rt.WATT):"".concat(t.totalGridPower||0," ").concat(Rt.WATT))):U(xo||(xo=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(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(Rt.WATT):"".concat(t.totalGridPower||0," ").concat(Rt.WATT))):U(Eo||(Eo=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=>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(Rt.WATT):"".concat(t.totalGridPower||0," ").concat(Rt.WATT))))}}Yr._col1X=103,Yr._col2X=107,Yr._col3X=137,Yr._gridColour="gray";class Zr{static generateInverterImage(t,e){return U(Lo||(Lo=gt(["\n\t\t\t",""])),t.genericInverterImage?U(Po||(Po=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,Kn):U(_o||(_o=gt([''])),e))}static generateTimerInfo(t,e){return U(ko||(ko=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=>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 U(Mo||(Mo=gt(["",""])),Un.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]),U(Co||(Co=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"])),Un.generatePhaseVoltage("L1",t.stateInverterVoltageL1,301.7,n[0],t.inverterColour),Un.generatePhaseVoltage("L2",t.stateInverterVoltageL2,301.7,n[1],t.inverterColour),Un.generatePhaseVoltage("L3",t.stateInverterVoltageL3,301.7,n[2],t.inverterColour),Un.generatePhaseAmperage("L1",t.stateInverterCurrentL1,305.7,n[0],t.inverterColour),Un.generatePhaseAmperage("L2",t.stateInverterCurrentL2,305.7,n[1],t.inverterColour),Un.generatePhaseAmperage("L3",t.stateInverterCurrentL3,305.7,n[2],t.inverterColour))}static generatePriorityLoad(t,e){return U(No||(No=gt(["",""])),"on"===t.priorityLoad?U(Bo||(Bo=gt(['\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")):U(To||(To=gt(['\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_bat")))}static generateInverterProgram(t){return U(zo||(zo=gt(['\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?Un.getIcon(178,218,e.inverter.ac_icon,"small_ac_dc_icon",16):U(Oo||(Oo=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?Un.getIcon(178,230,e.inverter.dc_icon,"small_ac_dc_icon",16):U(Ro||(Ro=gt(['\n\t\t\t\n DC:\n '])),t.inverterColour,e.entities?.dc_transformer_temp_90&&t.stateDCTransformerTemp.isValid()?"":"none");return U(Go||(Go=gt(['\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=U(Do||(Do=gt([''])));return t<2?(e=U(jo||(jo=gt(["",''])),e),e):(e=t<=30?U(So||(So=gt(["",''])),e,t):U(Io||(Io=gt(["",''])),e),e=t<=40?U(Ho||(Ho=gt(["",''])),e,t):U(Vo||(Vo=gt(["",''])),e),e=t<=60?U(Uo||(Uo=gt(["",''])),e,t):U(Qo||(Qo=gt(["",''])),e),e=t<=90?U(Wo||(Wo=gt(["",''])),e,t):U(Yo||(Yo=gt(["",''])),e),t<=100?(e=U(Zo||(Zo=gt(["",''])),e,t),U(Fo||(Fo=gt(["",''])),e,t)):(e=U(Xo||(Xo=gt(["",''])),e),e))}static generateInverterLoad(t,e){let n,a=ft.Sunsynk;if(!t.stateInverterLoadPercentage.isValid())return"";if(Object.values(ft).includes(e.inverter.model)&&(a=e.inverter.model),e.inverter.modern)return U(Jo||(Jo=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 ft.Azzurro:n=[213.5,179.5,51,67,3];break;case ft.Fronius:n=[213.5,179.5,51,73,10];break;case ft.Huawei:case ft.SolarEdge:n=[213.5,179.5,51,73,5];break;default:n=[213.5,179.5,51,73,2]}return U(Ko||(Ko=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=ft.Sunsynk;if(Object.values(ft).includes(e.inverter.model)&&(a=e.inverter.model),e.inverter.modern)return U(qo||(qo=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=>Hn.handlePopup(t,e.entities.inverter_status_59)),e.entities.inverter_status_59&&t.inverterStateMsg?"":"none",t.inverterStateMsg);switch(a){case ft.Azzurro:n=[235,222,7,6,239,240];break;case ft.Deye:n=[233.5,205.5,12,6,239,225];break;case ft.Fronius:n=[222,230,11,9,239,246];break;case ft.Goodwe:case ft.GoodweGridMode:n=[222,236,31,3,239,225];break;case ft.Growatt:n=[250,224,11,6,239,247];break;case ft.EasunSMW8_SA:case ft.MPPSolar:n=[233,242,11,5,239,234];break;case ft.PowMr:n=[233,190,12,5,239,230];break;case ft.Sunsynk:n=[234,208,10,6,239,225];break;case ft.SolarEdge:n=[234,206,22,5,2,239,225];break;case ft.Sofar:n=[233,230,12,4,239,245];break;case ft.Solis:n=[249,198,8,17,239,232];break;case ft.Victron:n=[218,217,18,7.5,239,231];break;default:return U($o||($o=gt(['\n\t\t\t\t\t\n\t\t\t\t'])),t.inverterStateColour)}return U(tr||(tr=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=>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 Xr{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 U(er||(er=gt(["",""])),t.nonessentialLoads>=1?U(nr||(nr=gt(["\n\t\t\t\t",""])),Un.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])):U(ar||(ar=gt([""]))))}static generateLoad2(t,e){const n=this.getPositions(2,e.grid.additional_loads);return U(or||(or=gt(["",""])),t.nonessentialLoads>=2?U(rr||(rr=gt(["\n\t\t\t\t",""])),Un.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])):U(ir||(ir=gt([""]))))}static generateLoad3(t,e){const n=this.getPositions(3,e.grid.additional_loads);return U(sr||(sr=gt(["",""])),t.nonessentialLoads>=3?U(lr||(lr=gt(["\n\t\t\t\t",""])),Un.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])):U(cr||(cr=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,e){const n=Un.getIconWithCondition(t.nonessentialLoads>=1,e.battery.show_battery_banks?53:68,290,t.nonessentialIcon,"nes-load-icon",32);return U(dr||(dr=gt(["",""])),n)}static generateLines(t,e){return U(ur||(ur=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;default:return 135}})(),a="M ".concat(n," 328 L 135 328 Q 140 328 140 323 L 140 320");return U(gr||(gr=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 U(hr||(hr=gt(['\n\t\t\t\n\t\t\t\n\t\t\t\t',"\n\t\t\t\n\t\t"])),e.battery.show_battery_banks?"90":"105",t.dynamicColourNonEssentialLoad,0===t.nonessentialLoads?"none":"",e.battery.show_battery_banks?"93":"108",t.dynamicColourNonEssentialLoad,e.grid.nonessential_name)}static generateTotalPower(t,e){return U(yr||(yr=gt(['\n\t\t\t\n\t\t\t\t',"\n\t\t\t"])),e.battery.show_battery_banks?"125":"140",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(Rt.WATT))}}class Fr{static generateShapes(t,e){const n=400+(Vn.LOAD_X-400)/2-101.3;return U(fr||(fr=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+(Vn.LOAD_X-400)/2-101.3;return U(mr||(mr=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,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 U(pr||(pr=gt(["",""])),e.load.aux_loads>=1?U(vr||(vr=gt(["\n\t\t\t\t",""])),Un.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)):U(br||(br=gt([""]))))}static generateLoad2(t,e){return U(Ar||(Ar=gt(["",""])),e.load.aux_loads>=2?U(wr||(wr=gt(["\n\t\t\t\t",""])),Un.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)):U(xr||(xr=gt([""]))))}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(Rt.WATT);return U(Er||(Er=gt(["\n\t\t\t","\n\t\t"])),t.stateAuxPower.isValid()?U(Lr||(Lr=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=>Hn.handlePopup(t,e.stateAuxPower.entity_id)),n,!0!==t.largeFont?"st14":"st4",t.auxDynamicColour,a):U(Pr||(Pr=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 U(_r||(_r=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=>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"))}}Fr.mainX=Vn.LOAD_X;class Jr{static getBatteryBanksDetails(t,e){if(e.battery.battery_banks_view_mode!=pt.inner)return U(kr||(kr=gt([""])));const n=e.battery.battery_banks;let a=[281,312,343,374],o=10,r=28;return n<=2&&(o=35,r=40,a=[281,324,0,0]),3==n&&(o=35,r=30,a=[281,314,347,0]),U(Mr||(Mr=gt(["\n\t\t\t","\n\t\t\t","\n\t\t\t","\n\t\t\t","\n\t\t\t","\n\t\t"])),this.generateTitle(n,t.batteryColour),this.getBatteryBankDetails(1,n,e,t.stateBatteryBank1Power,t.stateBatteryBank1Voltage,t.stateBatteryBank1Current,t.stateBatteryBank1Delta,t.stateBatteryBank1RemainingStorage,t.stateBatteryBank1Soc,e.battery.battery_bank_1_energy,t.dynamicBatteryBatteryBank1Colour,t.decimalPlaces,a[0],o,r),this.getBatteryBankDetails(2,n,e,t.stateBatteryBank2Power,t.stateBatteryBank2Voltage,t.stateBatteryBank2Current,t.stateBatteryBank2Delta,t.stateBatteryBank2RemainingStorage,t.stateBatteryBank2Soc,e.battery.battery_bank_2_energy,t.dynamicBatteryBatteryBank2Colour,t.decimalPlaces,a[1],o,r),this.getBatteryBankDetails(3,n,e,t.stateBatteryBank3Power,t.stateBatteryBank3Voltage,t.stateBatteryBank3Current,t.stateBatteryBank3Delta,t.stateBatteryBank3RemainingStorage,t.stateBatteryBank3Soc,e.battery.battery_bank_3_energy,t.dynamicBatteryBatteryBank3Colour,t.decimalPlaces,a[2],o,r),this.getBatteryBankDetails(4,n,e,t.stateBatteryBank4Power,t.stateBatteryBank4Voltage,t.stateBatteryBank4Current,t.stateBatteryBank4Delta,t.stateBatteryBank4RemainingStorage,t.stateBatteryBank4Soc,e.battery.battery_bank_4_energy,t.dynamicBatteryBatteryBank4Colour,t.decimalPlaces,a[3],o,r))}static getBatteryBankDetails(t,e,n,a,o,r,i,s,l,c,d,u,g,h,y){if(t<=e){const e=g+y/2+h,f=n.battery.auto_scale?n.battery.show_absolute?Hn.convertValueNew(Math.abs(a.toNum(u)),a.getUOM(),u,!1):Hn.convertValueNew(a.toNum(u),a.getUOM(),u,!1)||"0":a.toStr(n.decimal_places,n.battery?.invert_power,n.battery.show_absolute),m=s?.isValid()?s.toStr(2):Hn.toNum(c*(l.toNum(2)/100)/1e3,2).toFixed(2);return U(Cr||(Cr=gt(['\n\t\t\t\t\t\n\t\t\t\t\t','\n\t\t\t\t\t','\n\t\t\t\t\t','\n\t\t\t\t\t','\n\t\t\t\t\t','\n\t\t\t\t\t',"\n\t\t\t"])),g+h,y,d,e,d,t,f,e,d,t,o.toStr(2),e,d,t,r.toStr(2,!1,n.battery.show_absolute),e,d,t,i.toStr(3),e,d,t,m,e,d,t,l.toStr(2))}return U(Nr||(Nr=gt([""])))}static generateTitle(t,e){return t<=3?U(Br||(Br=gt(['\n\t\t\t\t\n\t\t\t\tPower:\n\t\t\t\tVoltage:\n\t\t\t\tCurrent:\n\t\t\t\tDelta:\n\t\t\t\tStorage:\n\t\t\t\tSOC:\n\t\t\t'])),e,e,e,e,e,e,e):t>3?U(Tr||(Tr=gt(['\n\t\t\t\t\t\n\t\t\t\t\tP:\n\t\t\t\t\tV:\n\t\t\t\t\tA:\n\t\t\t\t\tΔ:\n\t\t\t\t\tS:\n\t\t\t\t\t%:\n\t\t\t\t'])),e,e,e,e,e,e,e):void 0}}class Kr{static generateLoadTimes(t,e){return U(zr||(zr=gt(['\n\t\t\t\n\t\t\t\t\tData: '," Config: ","\n\t\t\t\t"])),t.refreshTime,e.refresh_time)}}class qr{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 Ei(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.12.0"," "),"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 Li=class extends rt{constructor(){super(...arguments),this.GREY_COLOUR="grey",this.durationPrev={},this.durationCur={}}static get styles(){return yt}static async getConfigElement(){return await Promise.resolve().then((function(){return Oi})),document.createElement(zt)}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.getNowTime(),n=this.getEntity("entities.day_battery_discharge_71"),a=this.getEntity("entities.day_battery_charge_70"),o=this.getEntity("entities.day_load_energy_84"),r=this.getEntity("entities.day_grid_import_76"),i=this.getEntity("entities.day_grid_export_77"),s=this.getEntity("entities.day_aux_energy"),l=this.getEntity("entities.load_frequency_192"),c=this.getEntity("entities.inverter_status_59",{state:""}),d=this.getEntity("entities.inverter_power_175"),u=this.getEntity("entities.priority_load_243",{state:t.entities.priority_load_243?.toString()??"false"}),g=this.getEntity("entities.use_timer_248",{state:t.entities.use_timer_248?.toString()??"false"}),h=this.getEntity("entities.dc_transformer_temp_90",{state:""}),y=this.getEntity("entities.radiator_temp_91",{state:""}),f=this.getEntity("entities.inverter_voltage_154"),m=this.getEntity("entities.inverter_voltage_L2",{state:""}),p=this.getEntity("entities.inverter_voltage_L3",{state:""}),v=this.getEntity("entities.inverter_current_164"),b=this.getEntity("entities.inverter_current_L2",{state:""}),A=this.getEntity("entities.inverter_current_L3",{state:""}),w=this.getEntity("entities.environment_temp",{state:""}),x=this.getEntity("entities.inverter_load_percentage"),E=this.getEntity("entities.battery_voltage_183"),L=this.getEntity("entities.battery_soc_184"),P=this.getEntity("entities.battery_power_190"),_=this.getEntity("entities.battery_current_191"),k=this.getEntity("entities.battery_temp_182",{state:""}),M=this.getEntity("entities.battery_status",{state:""}),C=this.getEntity("entities.battery_current_direction",{state:""}),N=this.getEntity("entities.battery_rated_capacity",{state:""}),B=this.getEntity("battery.shutdown_soc",{state:t.battery.shutdown_soc?.toString()??""}),T=this.getEntity("battery.shutdown_soc_offgrid",{state:t.battery.shutdown_soc_offgrid?.toString()??""}),z=this.getEntity("entities.battery_soh",{state:""}),O=this.getEntity("entities.battery_remaining_storage",{state:""}),R=this.getEntity("entities.battery_bank_1_power"),G=this.getEntity("entities.battery_bank_2_power"),D=this.getEntity("entities.battery_bank_3_power"),j=this.getEntity("entities.battery_bank_4_power"),S=this.getEntity("entities.battery_bank_1_voltage"),I=this.getEntity("entities.battery_bank_2_voltage"),H=this.getEntity("entities.battery_bank_3_voltage"),Q=this.getEntity("entities.battery_bank_4_voltage"),W=this.getEntity("entities.battery_bank_1_current"),Y=this.getEntity("entities.battery_bank_2_current"),Z=this.getEntity("entities.battery_bank_3_current"),X=this.getEntity("entities.battery_bank_4_current"),F=this.getEntity("entities.battery_bank_1_delta"),J=this.getEntity("entities.battery_bank_2_delta"),K=this.getEntity("entities.battery_bank_3_delta"),q=this.getEntity("entities.battery_bank_4_delta"),$=this.getEntity("entities.battery_bank_1_remaining_storage"),tt=this.getEntity("entities.battery_bank_2_remaining_storage"),et=this.getEntity("entities.battery_bank_3_remaining_storage"),nt=this.getEntity("entities.battery_bank_4_remaining_storage"),at=this.getEntity("entities.battery_bank_1_soc"),ot=this.getEntity("entities.battery_bank_2_soc"),rt=this.getEntity("entities.battery_bank_3_soc"),it=this.getEntity("entities.battery_bank_4_soc"),st=this.getEntity("entities.essential_power"),lt=this.getEntity("entities.aux_power_166"),ct=this.getEntity("entities.nonessential_power"),dt=this.getEntity("entities.non_essential_load1"),ut=this.getEntity("entities.non_essential_load2"),ht=this.getEntity("entities.non_essential_load3"),yt=this.getEntity("entities.non_essential_load1_extra"),mt=this.getEntity("entities.non_essential_load2_extra"),pt=this.getEntity("entities.non_essential_load3_extra"),vt=this.getEntity("entities.non_essential_load1_toggle"),bt=this.getEntity("entities.non_essential_load2_toggle"),At=this.getEntity("entities.non_essential_load3_toggle"),wt=this.getEntity("entities.essential_load1"),Et=this.getEntity("entities.essential_load2"),Pt=this.getEntity("entities.essential_load3"),zt=this.getEntity("entities.essential_load4"),Ot=this.getEntity("entities.essential_load5"),Rt=this.getEntity("entities.essential_load6"),Gt=this.getEntity("entities.essential_load7"),Dt=this.getEntity("entities.essential_load8"),jt=this.getEntity("entities.essential_load9"),St=this.getEntity("entities.essential_load10"),It=this.getEntity("entities.essential_load11"),Ht=this.getEntity("entities.essential_load12"),Vt=this.getEntity("entities.essential_load13"),Ut=this.getEntity("entities.essential_load14"),Qt=this.getEntity("entities.essential_load15"),Wt=this.getEntity("entities.essential_load16"),Yt=this.getEntity("entities.essential_load17"),Zt=this.getEntity("entities.essential_load18"),Xt=this.getEntity("entities.essential_load19"),Ft=this.getEntity("entities.essential_load20"),Jt=this.getEntity("entities.essential_load21"),Kt=this.getEntity("entities.essential_load22"),qt=this.getEntity("entities.essential_load23"),$t=this.getEntity("entities.essential_load1_extra"),te=this.getEntity("entities.essential_load2_extra"),ee=this.getEntity("entities.essential_load3_extra"),ne=this.getEntity("entities.essential_load4_extra"),ae=this.getEntity("entities.essential_load5_extra"),oe=this.getEntity("entities.essential_load6_extra"),re=this.getEntity("entities.essential_load7_extra"),ie=this.getEntity("entities.essential_load8_extra"),se=this.getEntity("entities.essential_load9_extra"),le=this.getEntity("entities.essential_load10_extra"),ce=this.getEntity("entities.essential_load11_extra"),de=this.getEntity("entities.essential_load12_extra"),ue=this.getEntity("entities.essential_load13_extra"),ge=this.getEntity("entities.essential_load14_extra"),he=this.getEntity("entities.essential_load15_extra"),ye=this.getEntity("entities.essential_load16_extra"),fe=this.getEntity("entities.essential_load17_extra"),me=this.getEntity("entities.essential_load18_extra"),pe=this.getEntity("entities.essential_load19_extra"),ve=this.getEntity("entities.essential_load20_extra"),be=this.getEntity("entities.essential_load21_extra"),Ae=this.getEntity("entities.essential_load22_extra"),we=this.getEntity("entities.essential_load23_extra"),xe=this.getEntity("entities.essential_load1_toggle"),Ee=this.getEntity("entities.essential_load2_toggle"),Le=this.getEntity("entities.essential_load3_toggle"),Pe=this.getEntity("entities.essential_load4_toggle"),_e=this.getEntity("entities.essential_load5_toggle"),ke=this.getEntity("entities.essential_load6_toggle"),Me=this.getEntity("entities.essential_load7_toggle"),Ce=this.getEntity("entities.essential_load8_toggle"),Ne=this.getEntity("entities.essential_load9_toggle"),Be=this.getEntity("entities.essential_load10_toggle"),Te=this.getEntity("entities.essential_load11_toggle"),ze=this.getEntity("entities.essential_load12_toggle"),Oe=this.getEntity("entities.essential_load13_toggle"),Re=this.getEntity("entities.essential_load14_toggle"),Ge=this.getEntity("entities.essential_load15_toggle"),De=this.getEntity("entities.essential_load16_toggle"),je=this.getEntity("entities.essential_load17_toggle"),Se=this.getEntity("entities.essential_load18_toggle"),Ie=this.getEntity("entities.essential_load19_toggle"),He=this.getEntity("entities.essential_load20_toggle"),Ve=this.getEntity("entities.essential_load21_toggle"),Ue=this.getEntity("entities.essential_load22_toggle"),Qe=this.getEntity("entities.essential_load23_toggle"),We=this.getEntity("entities.load_power_L1"),Ye=this.getEntity("entities.load_power_L2"),Ze=this.getEntity("entities.load_power_L3"),Xe=this.getEntity("entities.aux_load1"),Fe=this.getEntity("entities.aux_load2"),Je=this.getEntity("entities.aux_load1_extra"),Ke=this.getEntity("entities.aux_load2_extra"),qe=this.getEntity("entities.aux_load1_toggle"),$e=this.getEntity("entities.aux_load2_toggle"),tn=this.getEntity("entities.grid_frequency"),en=this.getEntity("entities.grid_ct_power_172"),nn=this.getEntity("entities.grid_ct_power_L2"),an=this.getEntity("entities.grid_ct_power_L3"),on=this.getEntity("entities.grid_voltage_L1"),rn=this.getEntity("entities.grid_voltage_L2"),sn=this.getEntity("entities.grid_voltage_L3"),ln=this.getEntity("entities.grid_current_L1"),cn=this.getEntity("entities.grid_current_L2"),dn=this.getEntity("entities.grid_current_L3"),un=this.getEntity("entities.grid_ct_power_total"),gn=this.getEntity("entities.grid_connected_status_194",{state:"on"}),hn=this.getEntity("entities.grid_power_169"),yn=this.getEntity("entities.energy_cost_buy",{state:"",attributes:{unit_of_measurement:""}}),fn=this.getEntity("entities.energy_cost_sell",{state:"",attributes:{unit_of_measurement:""}}),mn=this.getEntity("entities.grid_voltage",null),pn=this.getEntity("entities.prepaid_units"),vn=this.getEntity("entities.max_sell_power"),bn=this.getEntity("entities.pv1_voltage_109"),An=this.getEntity("entities.pv1_current_110"),wn=this.getEntity("entities.pv2_voltage_111"),xn=this.getEntity("entities.pv2_current_112"),En=this.getEntity("entities.pv3_voltage_113"),Ln=this.getEntity("entities.pv3_current_114"),Pn=this.getEntity("entities.pv4_voltage_115"),_n=this.getEntity("entities.pv4_current_116"),kn=this.getEntity("entities.pv5_voltage"),Mn=this.getEntity("entities.pv5_current"),Cn=this.getEntity("entities.pv1_power_186"),Nn=this.getEntity("entities.pv2_power_187"),Bn=this.getEntity("entities.pv3_power_188"),Tn=this.getEntity("entities.pv4_power_189"),zn=this.getEntity("entities.pv5_power"),On=this.getEntity("entities.pv1_production"),Rn=this.getEntity("entities.pv2_production"),Gn=this.getEntity("entities.pv3_production"),Dn=this.getEntity("entities.pv4_production"),jn=this.getEntity("entities.pv5_production"),Sn=this.getEntity("entities.solar_sell_247",{state:"undefined"}),In=this.getEntity("entities.pv_total"),Un=this.getEntity("entities.day_pv_energy_108"),Kn=this.getEntity("entities.monthly_pv_generation"),qn=this.getEntity("entities.yearly_pv_generation"),$n=this.getEntity("entities.total_pv_generation"),ta=this.getEntity("entities.remaining_solar"),ea=this.getEntity("entities.tomorrow_solar"),{invert_aux:na}=t.load,aa=lt?.isValid()?lt.toPower(na):(Xe?.toPower(na)||0)+(Fe?.toPower(na)||0),{invert_grid:oa}=t.grid,ra=en.toPower(oa),ia=nn.toPower(oa),sa=an.toPower(oa),la=t.entities?.grid_ct_power_total?un.toPower(oa):ra+ia+sa,ca=t.inverter.three_phase?la:ra,da=mn.isNaN()?null:mn.toNum(0),ua=C.isNaN()?null:C.toNum(0),ga=t.inverter?.modern,ha=t.decimal_places,ya=t.decimal_places_energy,fa=this.colourConvert(t.load?.colour),ma=this.calculateEssentialLoadColour(wt,xe,t.load?.off_threshold)||fa,pa=this.calculateEssentialLoadColour(Et,Ee,t.load?.off_threshold)||fa,va=this.calculateEssentialLoadColour(Pt,Le,t.load?.off_threshold)||fa,ba=this.calculateEssentialLoadColour(zt,Pe,t.load?.off_threshold)||fa,Aa=this.calculateEssentialLoadColour(Ot,_e,t.load?.off_threshold)||fa,wa=this.calculateEssentialLoadColour(Rt,ke,t.load?.off_threshold)||fa,xa=this.calculateEssentialLoadColour(Gt,Me,t.load?.off_threshold)||fa,Ea=this.calculateEssentialLoadColour(Dt,Ce,t.load?.off_threshold)||fa,La=this.calculateEssentialLoadColour(jt,Ne,t.load?.off_threshold)||fa,Pa=this.calculateEssentialLoadColour(St,Be,t.load?.off_threshold)||fa,_a=this.calculateEssentialLoadColour(It,Te,t.load?.off_threshold)||fa,ka=this.calculateEssentialLoadColour(Ht,ze,t.load?.off_threshold)||fa,Ma=this.calculateEssentialLoadColour(Vt,Oe,t.load?.off_threshold)||fa,Ca=this.calculateEssentialLoadColour(Ut,Re,t.load?.off_threshold)||fa,Na=this.calculateEssentialLoadColour(Qt,Ge,t.load?.off_threshold)||fa,Ba=this.calculateEssentialLoadColour(Wt,De,t.load?.off_threshold)||fa,Ta=this.calculateEssentialLoadColour(Yt,je,t.load?.off_threshold)||fa,za=this.calculateEssentialLoadColour(Zt,Se,t.load?.off_threshold)||fa,Oa=this.calculateEssentialLoadColour(Xt,Ie,t.load?.off_threshold)||fa,Ra=this.calculateEssentialLoadColour(Ft,He,t.load?.off_threshold)||fa,Ga=this.calculateEssentialLoadColour(Jt,Ve,t.load?.off_threshold)||fa,Da=this.calculateEssentialLoadColour(Kt,Ue,t.load?.off_threshold)||fa,ja=this.calculateEssentialLoadColour(qt,Qe,t.load?.off_threshold)||fa;t.title_colour=this.colourConvert(t.title_colour);const Sa=t.load?.show_daily,Ia=t.grid?.show_nonessential;let Ha=t.entities?.grid_connected_status_194?gn.state:"on";Tt.includes(Ha.toLowerCase())||Bt.includes(Ha.toLowerCase())||(Ha="on");const Va=t.entities?.battery_voltage_183?E.toNum(1):0,Ua=t.entities?.inverter_power_175?d.toPower():0,Qa=t.entities?.grid_power_169?hn.toPower():la,{invert_load:Wa}=t.load,Ya=t.entities?.load_power_L1?We.toPower(Wa):"",Za=t.entities?.load_power_L2?Ye.toPower(Wa):"",Xa=t.entities?.load_power_L3?Ze.toPower(Wa):"",Fa=this.colourConvert(t.grid?.colour),Ja=this.colourConvert(t.grid?.export_colour||Fa),Ka=this.colourConvert(t.grid?.no_grid_colour||Fa);let qa;switch(!0){case ca<0:qa=Ja;break;case ca>=0&&ca<=Hn.toNum(t.grid?.off_threshold,0):qa=Ka;break;default:qa=Fa}const $a=Math.abs(dt.toPower(!1)+ut.toPower(!1)+ht.toPower(!1))>Hn.toNum(t.grid?.off_threshold,0)?dt.toPower(!1)+ut.toPower(!1)+ht.toPower(!1)>0?Fa:Ja:this.GREY_COLOUR,to=this.getDynamicColorWithToggle(dt,vt,t.grid?.off_threshold,Fa,Ja),eo=this.getDynamicColorWithToggle(ut,bt,t.grid?.off_threshold,Fa,Ja),no=this.getDynamicColorWithToggle(ht,At,t.grid?.off_threshold,Fa,Ja),ao=this.colourConvert(t.grid?.grid_off_colour||qa),oo=this.colourConvert(t.load?.aux_colour),ro=this.colourConvert(t.load?.aux_off_colour||this.GREY_COLOUR),io=this.calculateAuxLoadColour(Xe,qe,t.load?.off_threshold)||oo,so=this.calculateAuxLoadColour(Fe,$e,t.load?.off_threshold)||oo;let lo=ro;lo=io!=ro?io:lo,lo=so!=ro?so:lo,lo=lt.isValid()&&Math.abs(lt.toPower())>Hn.toNum(t.load?.off_threshold,0)?oo:lo;let co=t.grid?.additional_loads;kt.includes(co)||(co=0);const uo=t.grid?.show_daily_buy,go=t.grid?.show_daily_sell,ho=this.colourConvert(t.battery?.colour),yo=this.colourConvert(t.battery?.charge_colour||ho),fo=t.battery?.show_daily;let mo=t.load?.show_aux;Ct.includes(mo)||(mo=!1);const po=t.load?.show_daily_aux;let vo=t.load?.additional_loads;_t.includes(vo)||(vo=0);let bo=t.load?.aux_loads;Nt.includes(bo)||(bo=0);const Ao=t.load?.aux_type,wo=this.getEntity("load.load1_icon",{state:t.load?.load1_icon?.toString()??""}).state,xo=this.getEntity("load.load2_icon",{state:t.load?.load2_icon?.toString()??""}).state,Eo=this.getEntity("load.load3_icon",{state:t.load?.load3_icon?.toString()??""}).state,Lo=this.getEntity("load.load4_icon",{state:t.load?.load4_icon?.toString()??""}).state,Po=this.getEntity("load.load5_icon",{state:t.load?.load5_icon?.toString()??""}).state,_o=this.getEntity("load.load6_icon",{state:t.load?.load6_icon?.toString()??""}).state,ko=this.getEntity("load.load7_icon",{state:t.load?.load7_icon?.toString()??""}).state,Mo=this.getEntity("load.load8_icon",{state:t.load?.load8_icon?.toString()??""}).state,Co=this.getEntity("load.load9_icon",{state:t.load?.load9_icon?.toString()??""}).state,No=this.getEntity("load.load10_icon",{state:t.load?.load10_icon?.toString()??""}).state,Bo=this.getEntity("load.load11_icon",{state:t.load?.load11_icon?.toString()??""}).state,To=this.getEntity("load.load12_icon",{state:t.load?.load12_icon?.toString()??""}).state,zo=this.getEntity("load.load13_icon",{state:t.load?.load13_icon?.toString()??""}).state,Oo=this.getEntity("load.load14_icon",{state:t.load?.load14_icon?.toString()??""}).state,Ro=this.getEntity("load.load15_icon",{state:t.load?.load15_icon?.toString()??""}).state,Go=this.getEntity("load.load16_icon",{state:t.load?.load16_icon?.toString()??""}).state,Do=this.getEntity("load.load17_icon",{state:t.load?.load17_icon?.toString()??""}).state,jo=this.getEntity("load.load18_icon",{state:t.load?.load18_icon?.toString()??""}).state,So=this.getEntity("load.load19_icon",{state:t.load?.load19_icon?.toString()??""}).state,Io=this.getEntity("load.load20_icon",{state:t.load?.load20_icon?.toString()??""}).state,Ho=this.getEntity("load.load21_icon",{state:t.load?.load21_icon?.toString()??""}).state,Vo=this.getEntity("load.load22_icon",{state:t.load?.load22_icon?.toString()??""}).state,Uo=this.getEntity("load.load23_icon",{state:t.load?.load23_icon?.toString()??""}).state,Qo=this.getEntity("load.aux_load1_icon",{state:t.load?.aux_load1_icon?.toString()??""}).state,Wo=this.getEntity("load.aux_load2_icon",{state:t.load?.aux_load2_icon?.toString()??""}).state,Yo=this.getEntity("grid.nonessential_icon",{state:t.grid?.nonessential_icon?.toString()??""}).state,Zo=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,Fo=this.getEntity("grid.load3_icon",{state:t.grid?.load3_icon?.toString()??""}).state,Jo=this.getEntity("grid.import_icon",{state:t.grid?.import_icon?.toString()??""}).state,Ko=this.getEntity("grid.disconnected_icon",{state:t.grid?.disconnected_icon?.toString()??""}).state,qo=this.getEntity("grid.export_icon",{state:t.grid?.export_icon?.toString()??""}).state,$o=t.large_font,tr=t.panel_mode,er=this.colourConvert(t.inverter?.colour),nr=t.inverter?.autarky,ar=!!t.entities.use_timer_248&&g.state,or=!!t.entities.priority_load_243&&u.state;let rr=P.toPower(t.battery?.invert_power);const ir=this.getEntity("card_height",{state:t.card_height?.toString()??""}).state,sr=this.getEntity("card_width",{state:t.card_width?.toString()??""}).state,lr=0===t.grid?.energy_cost_decimals?0:t.grid?.energy_cost_decimals||2,cr=ca>=0?yn.toNum(lr):fn.toNum(lr);let dr=ft.Sunsynk;Object.values(ft).includes(t.inverter.model)&&(dr=t.inverter.model);let ur="";const gr=wi.getInstance(dr);ga||(ur=gr.image);const hr=Cn.toPower(),yr=Nn.toPower(),fr=Bn.toPower(),mr=Tn.toPower(),pr=zn.toPower(),vr=hr+yr+fr+mr+pr,br=t.entities?.pv_total?In.toNum():vr,Ar=t.solar.dynamic_colour?Hn.toNum(br,0)>Hn.toNum(t.solar?.off_threshold,0)?this.colourConvert(t.solar?.colour):this.GREY_COLOUR:this.colourConvert(t.solar?.colour);let wr,xr,Er=t.inverter?.three_phase;Mt.includes(Er)||(Er=!1);const{essential_power:Lr,nonessential_power:Pr}=t.entities;xr=t.entities?.grid_power_169?!1===Er?"none"!==Pr&&Pr?ct.toPower():ra-Qa:"none"!==Pr&&Pr?ct.toPower():ra+ia+sa-Qa:dt.toPower()+ut.toPower()+ht.toPower(),wr="none"!==Lr&&Lr?st.toPower(Wa):!0===Er&&t.entities.load_power_L1&&t.entities.load_power_L2&&t.entities.load_power_L3?Number(Ya)+Number(Za)+Number(Xa):t.entities.inverter_power_175?Ua+Qa-aa:br+rr+Qa-aa;const _r={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??""})},kr={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??""})},Mr={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??""})},Cr={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??""})},Nr={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??""})},Br={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??""})},Tr=T.toNum(),zr=B.toNum(),qr={capacity:zr,entityID:""};switch(!0){case"off"===g.state:case!ar: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:qr.show=!1;break;default:qr.show=!0;const Bs=new Date,Ts=[];[_r,kr,Mr,Cr,Nr,Br].forEach(((t,e)=>{const[n,a]=t.time.state.split(":").map((t=>parseInt(t,10)));Ts[e]=new Date(Bs.getTime()),Ts[e].setHours(n),Ts[e].setMinutes(a)}));const[zs,Os,Rs,Gs,Ds,js]=Ts;function Ss(t,e){"No Grid or Gen"===t.charge.state||"0"===t.charge.state||"off"===t.charge.state?qr.charge="none":qr.charge="both",qr.capacity=parseInt(t.capacity.state),qr.entityID=e}Bs>=js||Bs=zs&&Bs=Os&&Bs=Rs&&Bs=Gs&&Bs=Ds&&Bs50?"on":"off"),null!=ua&&dr==ft.Solis&&0===ua&&(rr=-rr);let $r=0;if(t.show_battery)if(!0==!qr.show)rr>0?$r="on"!==Ha&&"1"!==Ha&&"on-grid"!==Ha.toLowerCase()||qr.show?"off"!==Ha&&"0"!==Ha&&"off-grid"!==Ha.toLowerCase()||!T.notEmpty()||qr.show?zr:Tr:zr:rr<0&&($r=100);else $r=gr.getBatteryCapacity(rr,Ha,zr,qr,L);let ti=0,ei="",ni="";let ai=this.getEntity("battery.energy",{state:t.battery.energy?.toString()??""}).toPower(!1);if(Va&&N.notEmpty()&&(ai=Hn.toNum(Va*N.toNum(0),0)),t.show_battery||0!==ai){0===rr?ti=(L.toNum()-zr)/100*ai*60*60:rr>0?ti=(L.toNum()-$r)/100*ai/rr*60*60:rr<0&&(ti=($r-L.toNum(0))/100*ai/rr*60*60*-1);const Is=new Date,Hs=1e3*ti,Vs=new Date(Is.getTime()+Hs),Us=Vs.getHours(),Qs=Vs.getMinutes().toString().padStart(2,"0"),Ws=Us.toString().padStart(2,"0");ei="".concat(Ws,":").concat(Qs);const Ys=Math.floor(ti/86400),Zs=Math.floor(ti%86400/3600),Xs=Math.floor(ti%3600/60);if(Ys>0&&(ni+="".concat(Ys).concat(Lt("common.days")," ")),Zs>0){const Fs=Ys>0&&Zs<10?"0".concat(Zs):"".concat(Zs);ni+="".concat(Fs).concat(Lt("common.hrs")," ")}ni+="".concat(Xs).concat(Lt("common.min"))}const oi=this.isFloating(_,L),ri=this.batteryColour(rr,oi,yo,ho),ii=this.batteryColour(R.toPower(t.battery?.invert_power),this.isFloating(W,at),yo,ho),si=this.batteryColour(G.toPower(t.battery?.invert_power),this.isFloating(Y,ot),yo,ho),li=this.batteryColour(D.toPower(t.battery?.invert_power),this.isFloating(Z,rt),yo,ho),ci=this.batteryColour(j.toPower(t.battery?.invert_power),this.isFloating(X,it),yo,ho);let di="",ui="",gi=c.state,hi=!1;dr==ft.Solis&&(gi=c.isNaN()?c.toString():c.toNum(0).toString());const yi=gr.statusGroups;if(yi)for(const Js of Object.keys(yi)){const Ks=yi[Js],{states:qs,color:$s,message:tl}=Ks;if(qs.includes(gi.toLowerCase())){di=$s,ui=tl,hi=!0;break}}hi||("none"!==t.entities?.inverter_status_59&&t.entities?.inverter_status_59?(di="transparent",ui="Status"):(di="transparent",ui=""));let fi="transparent",mi="";if([ft.GoodweGridMode,ft.Goodwe,ft.Huawei].includes(dr)){const el=gr.batteryStatusGroups;if(el)for(const nl of Object.keys(el)){const al=el[nl],{states:ol,color:rl,message:il}=al;if(ol.includes(M.state.toLowerCase())){fi=rl,mi=il,hi=!0;break}}hi||("none"!==t.entities?.battery_status&&t.entities?.battery_status?(fi="transparent",mi="Status"):(fi="transparent",mi=""))}const pi=Un.toNum()+n.toNum(),vi=o.toNum()+a.toNum(),bi=0!=vi?Math.max(Math.min(Math.round(100*pi/vi),100),0):0,Ai=0!=pi?Math.max(Math.min(Math.round(100*vi/pi),100),0):0,Ei=br+Hn.toNum("".concat(rr>0?rr:0))+Hn.toNum("".concat(aa<0?-1*aa:0)),Li=wr+Math.max(xr,0)+Hn.toNum("".concat(aa>0?aa:0))+Hn.toNum("".concat(rr<0?-1*rr:0)),Pi=0!=Li?Math.max(Math.min(Math.round(100*Ei/Li),100),0):0,_i=0!=Ei?Math.max(Math.min(Math.round(100*Li/Ei),100),0):0,ki=(Hn.toNum(t.max_line_width)<1?1:t.max_line_width)-1,Mi=Hn.toNum(t.min_line_width)||1,Ci=Un.toNum()+n.toNum()+r.toNum(),Ni=0!=pi?Math.max(Math.min(Math.round(1e3*vi/pi)/10,100),0):0,Bi=0!=Ci?Math.max(Math.min(Math.round(1e3*pi/Ci)/10,100),0):0,Ti=this.getEntity("battery.max_power",{state:t.battery.max_power?.toString()??""}),zi=this.getEntity("solar.max_power",{state:t.solar.max_power?.toString()??""}),Oi=this.getEntity("load.max_power",{state:t.load.max_power?.toString()??""}),Ri=this.getEntity("grid.max_power",{state:t.grid.max_power?.toString()??""}),Gi=t.solar.max_power?this.dynamicLineWidth(hr,zi.toNum()||hr,ki,Mi):Mi,Di=t.solar.max_power?this.dynamicLineWidth(yr,zi.toNum()||yr,ki,Mi):Mi,ji=t.solar.max_power?this.dynamicLineWidth(fr,zi.toNum()||fr,ki,Mi):Mi,Si=t.solar.max_power?this.dynamicLineWidth(mr,zi.toNum()||mr,ki,Mi):Mi,Ii=t.solar.max_power?this.dynamicLineWidth(pr,zi.toNum()||pr,ki,Mi):Mi,Hi=t.battery.max_power?this.dynamicLineWidth(Math.abs(rr),Ti.toNum(0)||Math.abs(rr),ki,Mi):Mi,Vi=t.load.max_power?this.dynamicLineWidth(Math.abs(wr),Oi.toNum()||Math.abs(wr),ki,Mi):Mi,Ui=t.load.max_power?this.dynamicLineWidth(Math.abs(aa),Oi.toNum()||Math.abs(aa),ki,Mi):Mi,Qi=t.grid.max_power?this.dynamicLineWidth(Math.abs(ca),Ri.toNum()||Math.abs(ca),ki,Mi):Mi,Wi=t.grid.max_power?this.dynamicLineWidth(Math.abs(Qa),Ri.toNum()||Math.abs(Qa),ki,Mi):Mi,Yi=t.grid.max_power?this.dynamicLineWidth(Math.abs(xr),Ri.toNum()||Math.abs(xr),ki,Mi):Mi,Zi=t.solar.max_power?this.dynamicLineWidth(br,zi.toNum()||br,ki,Mi):Mi;if(t&&t.solar&&t.solar.animation_speed){const sl=t.solar.animation_speed-(t.solar.animation_speed-1)*(br/(zi.toNum()||br));this.changeAnimationSpeed("solar",sl)}if(t&&t.solar&&t.solar.animation_speed){const ll=t.solar.animation_speed-(t.solar.animation_speed-1)*(hr/(zi.toNum()||hr));this.changeAnimationSpeed("pv1",ll)}if(t&&t.solar&&t.solar.animation_speed){const cl=t.solar.animation_speed-(t.solar.animation_speed-1)*(yr/(zi.toNum()||yr));this.changeAnimationSpeed("pv2",cl)}if(t&&t.solar&&t.solar.animation_speed){const dl=t.solar.animation_speed-(t.solar.animation_speed-1)*(fr/(zi.toNum()||fr));this.changeAnimationSpeed("pv3",dl)}if(t&&t.solar&&t.solar.animation_speed){const ul=t.solar.animation_speed-(t.solar.animation_speed-1)*(mr/(zi.toNum()||mr));this.changeAnimationSpeed("pv4",ul)}if(t&&t.solar&&t.solar.animation_speed){const gl=t.solar.animation_speed-(t.solar.animation_speed-1)*(pr/(zi.toNum()||pr));this.changeAnimationSpeed("pv5",gl)}if(t&&t.battery&&t.battery.animation_speed){const hl=t.battery.animation_speed-(t.battery.animation_speed-1)*(Math.abs(rr)/(Ti.toNum(0)||Math.abs(rr)));this.changeAnimationSpeed("battery",hl)}if(t&&t.load&&t.load.animation_speed){const yl=t.load.animation_speed-(t.load.animation_speed-1)*(Math.abs(wr)/(Oi.toNum()||Math.abs(wr)));this.changeAnimationSpeed("load",yl),this.changeAnimationSpeed("load1",yl)}if(t&&t.load&&t.load.animation_speed){const fl=t.load.animation_speed-(t.load.animation_speed-1)*(Math.abs(aa)/(Oi.toNum()||Math.abs(aa)));this.changeAnimationSpeed("aux",fl),this.changeAnimationSpeed("aux1",fl)}if(t&&t.grid&&t.grid.animation_speed){const ml=t.grid.animation_speed-(t.grid.animation_speed-1)*(Math.abs(ca)/(Ri.toNum()||Math.abs(ca)));this.changeAnimationSpeed("grid1",ml),this.changeAnimationSpeed("grid",ml),this.changeAnimationSpeed("grid2",ml)}if(t&&t.grid&&t.grid.animation_speed){const pl=t.grid.animation_speed-(t.grid.animation_speed-1)*(Math.abs(xr)/(Ri.toNum()||Math.abs(xr)));this.changeAnimationSpeed("ne",pl)}const Xi=0===br?0:"off"!==or&&or||rr>0?br/(Er?wr+Math.max(aa,0):wr)*100:(br-Math.abs(rr))/(Er?wr+Math.max(aa,0):wr)*100,Fi=rr<=0?0:Math.abs(rr)/(Er?wr+Math.max(aa,0):wr)*100,Ji=Xi+Fi,Ki=0===Ji?0:Xi/Ji*100,qi=0===Ji?0:Fi/Ji*100;let $i,ts,es=0;Ji>=100||0==ca?($i=Hn.toNum(Ki,0),ts=Hn.toNum(qi,0)):($i=Hn.toNum(Math.min(Xi,100),0),ts=Hn.toNum(Math.min(Fi,100),0),es=100-($i+ts));const ns=0===br||rr>=0?0:"off"!==or&&or?(br-wr)/Math.abs(rr)*100:br/Math.abs(rr)*100,as=rr>=0||ca<=0?0:"on"===or?br-wr>=Math.abs(rr)?0:(ca-Math.max(wr-br,0))/Math.abs(rr)*100:br>=Math.abs(rr)?0:(Math.abs(rr)-br)/Math.abs(rr)*100,os=ns+as,rs=0===os?0:ns/os*100,is=0===os?0:as/os*100;let ss,ls,cs,ds,us,gs,hs;switch(os>=100||0==ca?(ss=Hn.toNum(rs,0),ls=Hn.toNum(is,0)):(ss=Hn.toNum(Math.min(ns,100),0),ls=Hn.toNum(Math.min(as,100),0)),!0){case ss>=Hn.toNum(t.battery?.path_threshold,0):cs=Ar;break;case ls>=Hn.toNum(t.battery?.path_threshold,0):cs=qa;break;default:cs=ri}switch(!0){case $i>=Hn.toNum(t.load?.path_threshold,0):ds=Ar;break;case ts>=Hn.toNum(t.load?.path_threshold,0):ds=ri;break;case es>=Hn.toNum(t.load?.path_threshold,0):ds=qa;break;default:ds=fa}switch(!0){case $i>=Hn.toNum(t.load?.path_threshold,0):us=Ar;break;case ts>=Hn.toNum(t.load?.path_threshold,0):us=ri;break;case es>=Hn.toNum(t.load?.path_threshold,0):case ls>=Hn.toNum(t.battery?.path_threshold,0):us=qa;break;default:us=er}switch(!0){case Xi>=100&&Fi<=5&&ca-xr<50&&t.load.dynamic_icon:gs=Jn,hs=1;break;case Fi>=100&&Xi<=5&&ca-xr<50&&t.load.dynamic_icon:gs=Xn,hs=0;break;case Xi<5&&Fi<5&&es>0&&t.load.dynamic_icon:gs=Fn,hs=0;break;default:gs=Zn,hs=0}const{batteryIcon:ys,batteryCharge:fs,stopColour:ms,battery0:ps}=xi.convert(L),vs=this.getEntity("solar.pv1_max_power",{state:t.solar.pv1_max_power?.toString()??""}),bs=this.getEntity("solar.pv2_max_power",{state:t.solar.pv2_max_power?.toString()??""}),As=this.getEntity("solar.pv3_max_power",{state:t.solar.pv3_max_power?.toString()??""}),ws=this.getEntity("solar.pv4_max_power",{state:t.solar.pv4_max_power?.toString()??""}),xs=this.getEntity("solar.pv5_max_power",{state:t.solar.pv5_max_power?.toString()??""}),Es=t.solar.max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Hn.toNum(Math.min(br/zi.toNum()*100,200),0):100,Ls=t.solar.pv1_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Hn.toNum(Math.min(hr/vs.toNum()*100,200),0):100,Ps=t.solar.pv2_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Hn.toNum(Math.min(yr/bs.toNum()*100,200),0):100,_s=t.solar.pv3_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Hn.toNum(Math.min(fr/As.toNum()*100,200),0):100,ks=t.solar.pv4_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Hn.toNum(Math.min(mr/ws.toNum()*100,200),0):100,Ms=t.solar.pv5_max_power&&(t.solar.show_mppt_efficiency||t.solar.visualize_efficiency)?Hn.toNum(Math.min(pr/xs.toNum()*100,200),0):100;let Cs,Ns;switch(!0){case ca<0&&Tt.includes(Ha.toLowerCase()):Cs=qo,Ns=qa;break;case ca>=0&&Tt.includes(Ha.toLowerCase()):Cs=Jo,Ns=qa;break;case 0===ca&&Bt.includes(Ha.toLowerCase()):Cs=Ko,Ns=ao;break;default:Cs=Jo,Ns=qa}return((t,e,n)=>{Qr.solarColour=n.solarColour,Qr.decimalPlacesEnergy=n.decimalPlacesEnergy,Qr.decimalPlaces=n.decimalPlaces,Yr.gridColour=n.gridColour,Yr.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(Or||(Or=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\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\t\t\t\t\t\t","\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"])),Yn.getStyle(n),t.title?V(Rr||(Rr=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.dev_mode?U(Gr||(Gr=gt(["\n\t\t\t\t\t\t\t\t","\n\t\t\t\t\t\t\t"])),Kr.generateLoadTimes(n,t)):"",t.show_grid?U(Dr||(Dr=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 "])),Yr.generateShapeAndName(n,t),Yr.generateDailyImport(n,t),Yr.generateDailyExport(n,t),Yr.generateFlowLines(n),Yr.generateIcon(n,t),Yr.generateEnergyCost(n,t),Yr.generatePhases(n,t),Yr.generatePrepaidUnits(n,t),Yr.generateLimit(n,t),Yr.generateTotalGridPower(n,t),Yr.generateFrequency(n)):"",t.show_grid&&t.grid.show_nonessential?U(jr||(jr=gt(["\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t "])),Xr.generateShapeAndName(n,t),Xr.generateLoad1(n,t),Xr.generateLoad2(n,t),Xr.generateLoad3(n,t),Xr.generateLines(n,t),Xr.generateFlowLine(n,t),Xr.generateTotalPower(n,t),Xr.generateIcon(n,t)):"",t.show_solar?U(Sr||(Sr=gt(["\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t ","\n\t "])),Qr.generateSolarHeader(n,t),Qr.generateMppt1(n,t),Qr.generateMppt2(n,t),Qr.generateMppt3(n,t),Qr.generateMppt4(n,t),Qr.generateMppt5(n,t),Qr.generateSolarPower(n,t),Qr.generateSolarSellIcon(n,t)):"",Wn.getTexts(n),t.show_battery?U(Ir||(Ir=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 "])),Wr.generateShapes(n),Wr.generatePower(n,t),Wr.generateDuration(n),Wr.generateDailyCharge(n,t),Wr.generateDailyDischarge(n,t),Wr.generateSOC(n,t),Wr.generateSOH(n),Wr.generateCapacity(n,t),Wr.generateShutdownSOC(n,t),Wr.generateFlowLines(n,t),Wr.generateBatteryGradient(n,t),Wr.generateVoltage(n,t),Wr.generateCurrent(n,t),Wr.generateTemp(n)):"",t.show_battery&&t.battery.show_battery_banks?U(Hr||(Hr=gt(["\n\t\t\t\t\t\t\t\t","\n "])),Jr.getBatteryBanksDetails(n,t)):"",n.additionalLoad>0?U(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 ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t ","\n\t\t\t "])),Qn.generateLines(n,t),Qn.generateLoad1(n,t),Qn.generateLoad2(n,t),Qn.generateLoad3(n,t),Qn.generateLoad4(n,t),Qn.generateLoad5(n,t),Qn.generateLoad6(n,t),Qn.generateLoad7(n,t),Qn.generateLoad8(n,t),Qn.generateLoad9(n,t),Qn.generateLoad10(n,t),Qn.generateLoad11(n,t),Qn.generateLoad12(n,t),Qn.generateLoad13(n,t),Qn.generateLoad14(n,t),Qn.generateLoad15(n,t),Qn.generateLoad16(n,t),Qn.generateLoad17(n,t),Qn.generateLoad18(n,t),Qn.generateLoad19(n,t),Qn.generateLoad20(n,t),Qn.generateLoad21(n,t),Qn.generateLoad22(n,t),Qn.generateLoad23(n,t)):"",n.showAux?U(Ur||(Ur=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"])),Fr.generateShapes(n,t),Fr.generateLines(n),Fr.generateLoad1(n,t),Fr.generateLoad2(n,t),Fr.generateTotalLoad(n,t),Fr.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),Zr.generateTimerInfo(n,t),Zr.generatePriorityLoad(n,t),Zr.generateInverterImage(n,e),Zr.generateInverterState(n,t),Zr.generateInverterLoad(n,t),Zr.generateInverterProgram(n),Zr.generatePhases(n,t),Zr.generateFrequency(n),Zr.generateTemperatures(n,t))})(t,ur,{config:t,refreshTime:e,panelMode:tr,compactMode:!0,cardHeight:ir,cardWidth:sr,loadColour:fa,batteryColour:ri,gridColour:qa,gridImportColour:Fa,gridExportColour:Ja,isFloating:oi,inverterColour:er,solarColour:Ar,auxOffColour:ro,batteryEnergy:ai,largeFont:$o,batteryPower:rr,stateBatteryPower:P,batteryDuration:ni,batteryCapacity:$r,additionalLoad:vo,essIconSize:hs,essIcon:gs,stateUseTimer:g,batteryStateMsg:mi,stateBatterySoc:L,inverterProg:qr,batteryPercentage:ts,stateBatteryBank1Power:R,stateBatteryBank2Power:G,stateBatteryBank3Power:D,stateBatteryBank4Power:j,stateBatteryBank1Voltage:S,stateBatteryBank2Voltage:I,stateBatteryBank3Voltage:H,stateBatteryBank4Voltage:Q,stateBatteryBank1Current:W,stateBatteryBank2Current:Y,stateBatteryBank3Current:Z,stateBatteryBank4Current:X,stateBatteryBank1Delta:F,stateBatteryBank2Delta:J,stateBatteryBank3Delta:K,stateBatteryBank4Delta:q,stateBatteryBank1RemainingStorage:$,stateBatteryBank2RemainingStorage:tt,stateBatteryBank3RemainingStorage:et,stateBatteryBank4RemainingStorage:nt,stateBatteryBank1Soc:at,stateBatteryBank2Soc:ot,stateBatteryBank3Soc:rt,stateBatteryBank4Soc:it,dynamicBatteryBatteryBank1Colour:ii,dynamicBatteryBatteryBank2Colour:si,dynamicBatteryBatteryBank3Colour:li,dynamicBatteryBatteryBank4Colour:ci,pvPercentage:$i,loadShowDaily:Sa,stateEnergyCostSell:fn,stateEnergyCostBuy:yn,loadPowerL1:Ya,loadPowerL2:Za,loadPowerL3:Xa,durationCur:this.durationCur,stateGridPowerL1:en,stateGridPowerL2:nn,stateGridPowerL3:an,stateGridVoltageL1:on,stateGridVoltageL2:rn,stateGridVoltageL3:sn,stateGridCurrentL1:ln,stateGridCurrentL2:cn,stateGridCurrentL3:dn,decimalPlaces:ha,decimalPlacesEnergy:ya,stateEssentialLoad1:wt,stateEssentialLoad2:Et,stateEssentialLoad3:Pt,stateEssentialLoad4:zt,stateEssentialLoad5:Ot,stateEssentialLoad6:Rt,stateEssentialLoad7:Gt,stateEssentialLoad8:Dt,stateEssentialLoad9:jt,stateEssentialLoad10:St,stateEssentialLoad11:It,stateEssentialLoad12:Ht,stateEssentialLoad13:Vt,stateEssentialLoad14:Ut,stateEssentialLoad15:Qt,stateEssentialLoad16:Wt,stateEssentialLoad17:Yt,stateEssentialLoad18:Zt,stateEssentialLoad19:Xt,stateEssentialLoad20:Ft,stateEssentialLoad21:Jt,stateEssentialLoad22:Kt,stateEssentialLoad23:qt,stateEssentialLoad1Extra:$t,stateEssentialLoad2Extra:te,stateEssentialLoad3Extra:ee,stateEssentialLoad4Extra:ne,stateEssentialLoad5Extra:ae,stateEssentialLoad6Extra:oe,stateEssentialLoad7Extra:re,stateEssentialLoad8Extra:ie,stateEssentialLoad9Extra:se,stateEssentialLoad10Extra:le,stateEssentialLoad11Extra:ce,stateEssentialLoad12Extra:de,stateEssentialLoad13Extra:ue,stateEssentialLoad14Extra:ge,stateEssentialLoad15Extra:he,stateEssentialLoad16Extra:ye,stateEssentialLoad17Extra:fe,stateEssentialLoad18Extra:me,stateEssentialLoad19Extra:pe,stateEssentialLoad20Extra:ve,stateEssentialLoad21Extra:be,stateEssentialLoad22Extra:Ae,stateEssentialLoad23Extra:we,stateEssentialLoad1Toggle:xe,stateEssentialLoad2Toggle:Ee,stateEssentialLoad3Toggle:Le,stateEssentialLoad4Toggle:Pe,stateEssentialLoad5Toggle:_e,stateEssentialLoad6Toggle:ke,stateEssentialLoad7Toggle:Me,stateEssentialLoad8Toggle:Ce,stateEssentialLoad9Toggle:Ne,stateEssentialLoad10Toggle:Be,stateEssentialLoad11Toggle:Te,stateEssentialLoad12Toggle:ze,stateEssentialLoad13Toggle:Oe,stateEssentialLoad14Toggle:Re,stateEssentialLoad15Toggle:Ge,stateEssentialLoad16Toggle:De,stateEssentialLoad17Toggle:je,stateEssentialLoad18Toggle:Se,stateEssentialLoad19Toggle:Ie,stateEssentialLoad20Toggle:He,stateEssentialLoad21Toggle:Ve,stateEssentialLoad22Toggle:Ue,stateEssentialLoad23Toggle:Qe,stateNonessentialLoad1:dt,stateNonessentialLoad2:ut,stateNonessentialLoad3:ht,stateNonEssentialLoad1Extra:yt,stateNonEssentialLoad2Extra:mt,stateNonEssentialLoad3Extra:pt,stateNonEssentialLoad1Toggle:vt,stateNonEssentialLoad2Toggle:bt,stateNonEssentialLoad3Toggle:At,gridShowDailyBuy:uo,gridShowDailySell:go,batteryShowDaily:fo,inverterModel:dr,batteryShutdown:zr,enableAutarky:nr,autarkyPower:Pi,ratioPower:_i,ratioEnergy:Ai,autarkyEnergy:bi,autarkyAuto:Ni,autarkySelf:Bi,shutdownOffGrid:Tr,statePV1Current:An,statePV2Current:xn,statePV3Current:Ln,statePV4Current:_n,statePV5Current:Mn,energyCost:cr,stateInverterCurrentL1:v,stateInverterCurrentL2:b,stateInverterCurrentL3:A,stateRadiatorTemp:y,stateInverterVoltageL1:f,stateInverterVoltageL2:m,stateInverterVoltageL3:p,stateBatteryVoltage:E,stateBatteryCurrent:_,batLineWidth:Hi,totalGridPower:ca,solarLineWidth:Zi,totalPV:br,loadLineWidth:Vi,pvPercentageBat:ss,gridPercentageBat:ls,genericInverterImage:ga,battery0:ps,essentialPower:wr,pv1LineWidth:Gi,pv2LineWidth:Di,pv3LineWidth:ji,pv4LineWidth:Si,pv5LineWidth:Ii,gridLineWidth:Qi,stateEnvironmentTemp:w,statePV1Voltage:bn,statePV2Voltage:wn,statePV3Voltage:En,statePV4Voltage:Pn,statePV5Voltage:kn,batteryStateColour:fi,inverterStateColour:di,stateBatteryTemp:k,statePrepaidUnits:pn,stateDCTransformerTemp:h,stateInverterLoadPercentage:x,iconEssentialLoad1:wo,iconEssentialLoad2:xo,iconEssentialLoad3:Eo,iconEssentialLoad4:Lo,iconEssentialLoad5:Po,iconEssentialLoad6:_o,iconEssentialLoad7:ko,iconEssentialLoad8:Mo,iconEssentialLoad9:Co,iconEssentialLoad10:No,iconEssentialLoad11:Bo,iconEssentialLoad12:To,iconEssentialLoad13:zo,iconEssentialLoad14:Oo,iconEssentialLoad15:Ro,iconEssentialLoad16:Go,iconEssentialLoad17:Do,iconEssentialLoad18:jo,iconEssentialLoad19:So,iconEssentialLoad20:Io,iconEssentialLoad21:Ho,iconEssentialLoad22:Vo,iconEssentialLoad23:Uo,enableTimer:ar,stateSolarSell:Sn,priorityLoad:or,inverterImg:ur,stateDailyPVEnergy:Un,stateMonthlyPVEnergy:Kn,stateYearlyPVEnergy:qn,stateTotalSolarGeneration:$n,stateRemainingSolar:ta,stateTomorrowSolar:ea,statePV2Power:Nn,statePV3Power:Bn,statePV4Power:Tn,statePV5Power:zn,statePV1Energy:On,statePV2Energy:Rn,statePV3Energy:Gn,statePV4Energy:Dn,statePV5Energy:jn,stateDayLoadEnergy:o,stateDayBatteryDischarge:n,stateDayGridImport:r,stateDayBatteryCharge:a,stateDayGridExport:i,statePVTotal:In,statePV1Power:Cn,minLineWidth:Mi,stopColour:ms,gridStatus:Ha,batteryCharge:fs,gridOffColour:ao,batteryIcon:ys,formattedResultTime:ei,showAux:mo,nonessentialIcon:Yo,showNonessential:Ia,nonessentialLoads:co,iconNonessentialLoad1:Zo,iconNonessentialLoad2:Xo,iconNonessentialLoad3:Fo,inverterStateMsg:ui,auxType:Ao,showDailyAux:po,nonessentialPower:xr,nonessLineWidth:Yi,grid169LineWidth:Wi,auxLineWidth:Ui,iconAuxLoad1:Qo,iconAuxLoad2:Wo,stateDayAuxEnergy:s,additionalAuxLoad:bo,auxPower:aa,stateAuxPower:lt,stateAuxLoad1:Xe,stateAuxLoad2:Fe,stateAuxLoad1Extra:Je,stateAuxLoad2Extra:Ke,stateAuxLoad1Toggle:qe,stateAuxLoad2Toggle:$e,autoScaledInverterPower:Ua,autoScaledGridPower:Qa,auxDynamicColour:lo,auxDynamicColourLoad1:io,auxDynamicColourLoad2:so,stateMaxSellPower:vn,totalPVEfficiency:Es,PV1Efficiency:Ls,PV2Efficiency:Ps,PV3Efficiency:_s,PV4Efficiency:ks,PV5Efficiency:Ms,gridPercentage:es,flowColour:ds,flowBatColour:cs,flowInvColour:us,dynamicColourEssentialLoad1:ma,dynamicColourEssentialLoad2:pa,dynamicColourEssentialLoad3:va,dynamicColourEssentialLoad4:ba,dynamicColourEssentialLoad5:Aa,dynamicColourEssentialLoad6:wa,dynamicColourEssentialLoad7:xa,dynamicColourEssentialLoad8:Ea,dynamicColourEssentialLoad9:La,dynamicColourEssentialLoad10:Pa,dynamicColourEssentialLoad11:_a,dynamicColourEssentialLoad12:ka,dynamicColourEssentialLoad13:Ma,dynamicColourEssentialLoad14:Ca,dynamicColourEssentialLoad15:Na,dynamicColourEssentialLoad16:Ba,dynamicColourEssentialLoad17:Ta,dynamicColourEssentialLoad18:za,dynamicColourEssentialLoad19:Oa,dynamicColourEssentialLoad20:Ra,dynamicColourEssentialLoad21:Ga,dynamicColourEssentialLoad22:Da,dynamicColourEssentialLoad23:ja,dynamicColourNonEssentialLoad:$a,dynamicColourNonEssentialLoad1:to,dynamicColourNonEssentialLoad2:eo,dynamicColourNonEssentialLoad3:no,stateBatteryRemainingStorage:O,stateBatterySOH:z,customGridIcon:Cs,customGridIconColour:Ns,stateLoadFrequency:l,stateGridFrequency:tn})}getNowTime(){const t=new Date,e=t.getHours().toString().padStart(2,"0"),n=t.getMinutes().toString().padStart(2,"0"),a=t.getSeconds().toString().padStart(2,"0");return"".concat(e,":").concat(n,":").concat(a)}batteryColour(t,e,n,a){return t<0&&!e?n:a}isFloating(t,e){return-2<=t.toNum(0)&&t.toNum(0)<=2&&e.toNum(0)>=99}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 Ei(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=this.getNowTime(),a={type:t.type,refresh_time:n};this._config=In({},Pt,t,a)}};var Pi,_i;t([dt()],Li.prototype,"hass",void 0),t([dt()],Li.prototype,"_config",void 0),t([ut("#grid-flow")],Li.prototype,"gridFlow",void 0),t([ut("#grid1-flow")],Li.prototype,"grid1Flow",void 0),t([ut("#solar-flow")],Li.prototype,"solarFlow",void 0),t([ut("#pv1-flow")],Li.prototype,"pv1Flow",void 0),t([ut("#pv2-flow")],Li.prototype,"pv2Flow",void 0),t([ut("#pv3-flow")],Li.prototype,"pv3Flow",void 0),t([ut("#pv4-flow")],Li.prototype,"pv4Flow",void 0),t([ut("#pv5-flow")],Li.prototype,"pv5Flow",void 0),t([ut("#battery-flow")],Li.prototype,"batteryFlow",void 0),t([ut("#load-flow")],Li.prototype,"loadFlow",void 0),t([ut("#aux-flow")],Li.prototype,"auxFlow",void 0),t([ut("#ne-flow")],Li.prototype,"neFlow",void 0),t([ut("#ne1-flow")],Li.prototype,"ne1Flow",void 0),Li=t([st("mlk-power-flow-card")],Li),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"}(Pi||(Pi={})),function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(_i||(_i={}));var ki,Mi,Ci={exports:{}};ki=Ci,Mi=Ci.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]],y="[object Arguments]",f="[object Array]",m="[object Boolean]",p="[object Date]",v="[object Error]",b="[object Function]",A="[object GeneratorFunction]",w="[object Map]",x="[object Number]",E="[object Object]",L="[object Promise]",P="[object RegExp]",_="[object Set]",k="[object String]",M="[object Symbol]",C="[object WeakMap]",N="[object ArrayBuffer]",B="[object DataView]",T="[object Float32Array]",z="[object Float64Array]",O="[object Int8Array]",R="[object Int16Array]",G="[object Int32Array]",D="[object Uint8Array]",j="[object Uint8ClampedArray]",S="[object Uint16Array]",I="[object Uint32Array]",H=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,U=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Q=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,Y=RegExp(Q.source),Z=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,yt=/^\[object .+?Constructor\]$/,ft=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,pt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,bt=/['\n\r\u2028\u2029\\]/g,At="\\ud800-\\udfff",wt="\\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",_t="\\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",kt="['’]",Mt="["+At+"]",Ct="["+_t+"]",Nt="["+wt+"]",Bt="\\d+",Tt="["+xt+"]",zt="["+Et+"]",Ot="[^"+At+_t+Bt+xt+Et+Lt+"]",Rt="\\ud83c[\\udffb-\\udfff]",Gt="[^"+At+"]",Dt="(?:\\ud83c[\\udde6-\\uddff]){2}",jt="[\\ud800-\\udbff][\\udc00-\\udfff]",St="["+Lt+"]",It="\\u200d",Vt="(?:"+zt+"|"+Ot+")",Ut="(?:"+St+"|"+Ot+")",Qt="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Yt="(?:"+Nt+"|"+Rt+")?",Zt="["+Pt+"]?",Xt=Zt+Yt+"(?:"+It+"(?:"+[Gt,Dt,jt].join("|")+")"+Zt+Yt+")*",Ft="(?:"+[Tt,Dt,jt].join("|")+")"+Xt,Jt="(?:"+[Gt+Nt+"?",Nt,Dt,jt,Mt].join("|")+")",Kt=RegExp(kt,"g"),qt=RegExp(Nt,"g"),$t=RegExp(Rt+"(?="+Rt+")|"+Jt+Xt,"g"),te=RegExp([St+"?"+zt+"+"+Qt+"(?="+[Ct,St,"$"].join("|")+")",Ut+"+"+Wt+"(?="+[Ct,St+Vt,"$"].join("|")+")",St+"?"+Vt+"+"+Qt,St+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Bt,Ft].join("|"),"g"),ee=RegExp("["+It+At+wt+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[T]=re[z]=re[O]=re[R]=re[G]=re[D]=re[j]=re[S]=re[I]=!0,re[y]=re[f]=re[N]=re[m]=re[B]=re[p]=re[v]=re[b]=re[w]=re[x]=re[E]=re[P]=re[_]=re[k]=re[C]=!1;var ie={};ie[y]=ie[f]=ie[N]=ie[B]=ie[m]=ie[p]=ie[T]=ie[z]=ie[O]=ie[R]=ie[G]=ie[w]=ie[x]=ie[E]=ie[P]=ie[_]=ie[k]=ie[M]=ie[D]=ie[j]=ie[S]=ie[I]=!0,ie[v]=ie[b]=ie[C]=!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=Mi&&!Mi.nodeType&&Mi,ye=he&&ki&&!ki.nodeType&&ki,fe=ye&&ye.exports===he,me=fe&&de.process,pe=function(){try{var t=ye&&ye.require&&ye.require("util").types;return t||me&&me.binding&&me.binding("util")}catch(t){}}(),ve=pe&&pe.isArrayBuffer,be=pe&&pe.isDate,Ae=pe&&pe.isMap,we=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 Be(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",""":'"',"'":"'"}),fn=function at(At){var wt,xt=(At=null==At?ge:fn.defaults(ge.Object(),At,fn.pick(ge,ae))).Array,Et=At.Date,Lt=At.Error,Pt=At.Function,_t=At.Math,kt=At.Object,Mt=At.RegExp,Ct=At.String,Nt=At.TypeError,Bt=xt.prototype,Tt=Pt.prototype,zt=kt.prototype,Ot=At["__core-js_shared__"],Rt=Tt.toString,Gt=zt.hasOwnProperty,Dt=0,jt=(wt=/[^.]+$/.exec(Ot&&Ot.keys&&Ot.keys.IE_PROTO||""))?"Symbol(src)_1."+wt:"",St=zt.toString,It=Rt.call(kt),Ht=ge._,Vt=Mt("^"+Rt.call(Gt).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ut=fe?At.Buffer:t,Qt=At.Symbol,Wt=At.Uint8Array,Yt=Ut?Ut.allocUnsafe:t,Zt=sn(kt.getPrototypeOf,kt),Xt=kt.create,Ft=zt.propertyIsEnumerable,Jt=Bt.splice,$t=Qt?Qt.isConcatSpreadable:t,ee=Qt?Qt.iterator:t,se=Qt?Qt.toStringTag:t,de=function(){try{var t=hr(kt,"defineProperty");return t({},"",{}),t}catch(t){}}(),ue=At.clearTimeout!==ge.clearTimeout&&At.clearTimeout,he=Et&&Et.now!==ge.Date.now&&Et.now,ye=At.setTimeout!==ge.setTimeout&&At.setTimeout,me=_t.ceil,pe=_t.floor,De=kt.getOwnPropertySymbols,We=Ut?Ut.isBuffer:t,mn=At.isFinite,pn=Bt.join,vn=sn(kt.keys,kt),bn=_t.max,An=_t.min,wn=Et.now,xn=At.parseInt,En=_t.random,Ln=Bt.reverse,Pn=hr(At,"DataView"),_n=hr(At,"Map"),kn=hr(At,"Promise"),Mn=hr(At,"Set"),Cn=hr(At,"WeakMap"),Nn=hr(kt,"create"),Bn=Cn&&new Cn,Tn={},zn=Sr(Pn),On=Sr(_n),Rn=Sr(kn),Gn=Sr(Mn),Dn=Sr(Cn),jn=Qt?Qt.prototype:t,Sn=jn?jn.valueOf:t,In=jn?jn.toString:t;function Hn(t){if(ns(t)&&!Wi(t)&&!(t instanceof Wn)){if(t instanceof Qn)return t;if(Gt.call(t,"__wrapped__"))return Ir(t)}return new Qn(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 Un(){}function Qn(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 Yn(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]&&Gt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!l)return Bo(e,s)}else{var g=mr(e),h=g==b||g==A;if(Fi(e))return Po(e,l);if(g==E||g==y||h&&!r){if(s=c||h?{}:vr(e),!l)return c?function(t,e){return To(t,fr(t),e)}(e,function(t,e){return t&&To(e,zs(e),t)}(s,e)):function(t,e){return To(t,yr(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 N:return _o(t);case m:case p:return new o(+t);case B:return function(t,e){var n=e?_o(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case T:case z:case O:case R:case G:case D:case j:case S:case I:return ko(t,n);case w:return new o;case x:case k: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 _:return new o;case M:return a=t,Sn?kt(Sn.call(a)):{}}}(e,g,l)}}i||(i=new Jn);var f=i.get(e);if(f)return f;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?zs:Ts)(e);return _e(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=kt(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 Nt(e);return Tr((function(){n.apply(t,o)}),a)}function ga(t,e,n,a){var o=-1,r=Ne,i=!0,s=t.length,l=[],c=e.length;if(!s)return l;n&&(e=Te(e,Je(n))),a?(r=Be,i=!1):e.length>=200&&(r=qe,i=!1,e=new Fn(e));t:for(;++o-1},Zn.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 Yn,map:new(_n||Zn),string:new Yn}},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 Zn,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 Zn){var a=n.__data__;if(!_n||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=Ro(wa),ya=Ro(xa,!0);function fa(t,e){var n=!0;return ha(t,(function(t,a,o){return n=!!e(t,a,o)})),n}function ma(e,n,a){for(var o=-1,r=e.length;++o0&&n(s)?e>1?va(s,e-1,n,a,o):ze(o,s):a||(o[o.length]=s)}return o}var ba=Go(),Aa=Go(!0);function wa(t,e){return t&&ba(t,e,Ts)}function xa(t,e){return t&&Aa(t,e,Ts)}function Ea(t,e){return Ce(e,(function(e){return qi(t[e])}))}function La(e,n){for(var a=0,o=(n=wo(n,e)).length;null!=e&&ae}function Ma(t,e){return null!=t&&Gt.call(t,e)}function Ca(t,e){return null!=t&&e in kt(t)}function Na(e,n,a){for(var o=a?Be:Ne,r=e[0].length,i=e.length,s=i,l=xt(i),c=1/0,d=[];s--;){var u=e[s];s&&n&&(u=Te(u,Je(n))),c=An(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 Ya(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;Ar(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 zr(Mr(t,e,ol),t+"")}function qa(t){return qn(Hs(t))}function $a(t,e){var n=Hs(t);return Gr(n,la(e,0,n.length))}function to(e,n,a,o){if(!es(e))return e;for(var r=-1,i=(n=wo(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=Yt?Yt(n):new t.constructor(n);return t.copy(a),a}function _o(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function ko(t,e){var n=e?_o(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Mo(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&&wr(a[0],a[1],s)&&(i=r<3?t:i,r=1),n=kt(n);++o-1?r[i?n[s]:s]:t}}function Ho(n){return or((function(a){var o=a.length,r=o,i=Qn.prototype.thru;for(n&&a.reverse();r--;){var s=a[r];if("function"!=typeof s)throw new Nt(e);if(i&&!l&&"wrapper"==lr(s))var l=new Qn([],!0)}for(r=l?r:o;++r1&&b.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,y=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 _e(h,(function(n){var a="_."+n[0];e&n[1]&&!Ne(t,a)&&t.push(a)})),t.sort()}(function(t){var e=t.match(rt);return e?e[1].split(it):[]}(a),n)))}function Rr(e){var n=0,a=0;return function(){var o=wn(),r=16-(o-a);if(a=o,r>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(t,arguments)}}function Gr(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 yi(t,e){return e(t)}var fi=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&&Ar(a)?((o=o.slice(a,+a+(n?1:0))).__actions__.push({func:yi,args:[r],thisArg:t}),new Qn(o,this.__chain__).thru((function(e){return n&&!e.length&&e.push(t),e}))):this.thru(r)})),mi=zo((function(t,e,n){Gt.call(t,n)?++t[n]:ia(t,n,1)})),pi=Io(Qr),vi=Io(Wr);function bi(t,e){return(Wi(t)?_e:ha)(t,dr(e,3))}function Ai(t,e){return(Wi(t)?ke:ya)(t,dr(e,3))}var wi=zo((function(t,e,n){Gt.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=Zi(t)?xt(t.length):[];return ha(t,(function(t){r[++a]=o?Le(e,t,n):Ba(t,e,n)})),r})),Ei=zo((function(t,e,n){ia(t,n,e)}));function Li(t,e){return(Wi(t)?Te:Ia)(t,dr(e,3))}var Pi=zo((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),_i=Ka((function(t,e){if(null==t)return[];var n=e.length;return n>1&&wr(t,e[0],e[1])?e=[]:n>2&&wr(e[0],e[1],e[2])&&(e=[e[0]]),Wa(t,va(e,1),[])})),ki=he||function(){return ge.Date.now()};function Mi(e,n,a){return n=a?t:n,n=e&&null==n?e.length:n,$o(e,s,t,t,t,t,n)}function Ci(n,a){var o;if("function"!=typeof a)throw new Nt(e);return n=fs(n),function(){return--n>0&&(o=a.apply(this,arguments)),n<=1&&(a=t),o}}var Ni=Ka((function(t,e,n){var a=1;if(n.length){var o=ln(n,cr(Ni));a|=r}return $o(t,a,e,n,o)})),Bi=Ka((function(t,e,n){var a=3;if(n.length){var o=ln(n,cr(Bi));a|=r}return $o(e,a,t,n,o)}));function Ti(n,a,o){var r,i,s,l,c,d,u=0,g=!1,h=!1,y=!0;if("function"!=typeof n)throw new Nt(e);function f(e){var a=r,o=i;return r=i=t,u=e,l=n.apply(o,a)}function m(e){var n=e-d;return d===t||n>=a||n<0||h&&e-u>=s}function p(){var t=ki();if(m(t))return v(t);c=Tr(p,function(t){var e=a-(t-d);return h?An(e,s-(t-u)):e}(t))}function v(e){return c=t,y&&r?f(e):(r=i=t,l)}function b(){var e=ki(),n=m(e);if(r=arguments,i=this,d=e,n){if(c===t)return function(t){return u=t,c=Tr(p,a),g?f(t):l}(d);if(h)return Lo(c),c=Tr(p,a),f(d)}return c===t&&(c=Tr(p,a)),l}return a=ps(a)||0,es(o)&&(g=!!o.leading,s=(h="maxWait"in o)?bn(ps(o.maxWait)||0,a):s,y="trailing"in o?!!o.trailing:y),b.cancel=function(){c!==t&&Lo(c),u=0,r=d=i=c=t},b.flush=function(){return c===t?l:v(ki())},b}var zi=Ka((function(t,e){return ua(t,1,e)})),Oi=Ka((function(t,e,n){return ua(t,ps(e)||0,n)}));function Ri(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new Nt(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(Ri.Cache||Xn),a}function Gi(t){if("function"!=typeof t)throw new Nt(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)}}Ri.Cache=Xn;var Di=xo((function(t,e){var n=(e=1==e.length&&Wi(e[0])?Te(e[0],Je(dr())):Te(va(e,1),Je(dr()))).length;return Ka((function(a){for(var o=-1,r=An(a.length,n);++o=e})),Qi=Ta(function(){return arguments}())?Ta:function(t){return ns(t)&&Gt.call(t,"callee")&&!Ft.call(t,"callee")},Wi=xt.isArray,Yi=ve?Je(ve):function(t){return ns(t)&&_a(t)==N};function Zi(t){return null!=t&&ts(t.length)&&!qi(t)}function Xi(t){return ns(t)&&Zi(t)}var Fi=We||pl,Ji=be?Je(be):function(t){return ns(t)&&_a(t)==p};function Ki(t){if(!ns(t))return!1;var e=_a(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=_a(t);return e==b||e==A||"[object AsyncFunction]"==e||"[object Proxy]"==e}function $i(t){return"number"==typeof t&&t==fs(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=Ae?Je(Ae):function(t){return ns(t)&&mr(t)==w};function os(t){return"number"==typeof t||ns(t)&&_a(t)==x}function rs(t){if(!ns(t)||_a(t)!=E)return!1;var e=Zt(t);if(null===e)return!0;var n=Gt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Rt.call(n)==It}var is=we?Je(we):function(t){return ns(t)&&_a(t)==P},ss=xe?Je(xe):function(t){return ns(t)&&mr(t)==_};function ls(t){return"string"==typeof t||!Wi(t)&&ns(t)&&_a(t)==k}function cs(t){return"symbol"==typeof t||ns(t)&&_a(t)==M}var ds=Ee?Je(Ee):function(t){return ns(t)&&ts(t.length)&&!!re[_a(t)]},us=Xo(Sa),gs=Xo((function(t,e){return t<=e}));function hs(t){if(!t)return[];if(Zi(t))return ls(t)?gn(t):Bo(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=mr(t);return(e==w?rn:e==_?cn:Hs)(t)}function ys(t){return t?(t=ps(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function fs(t){var e=ys(t),n=e%1;return e==e?n?e-n:e:0}function ms(t){return t?la(fs(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||ft.test(t)?ce(t.slice(2),n?2:8):gt.test(t)?u:+t}function vs(t){return To(t,zs(t))}function bs(t){return null==t?"":uo(t)}var As=Oo((function(t,e){if(Pr(e)||Zi(e))To(e,Ts(e),t);else for(var n in e)Gt.call(e,n)&&na(t,n,e[n])})),ws=Oo((function(t,e){To(e,zs(e),t)})),xs=Oo((function(t,e,n,a){To(e,zs(e),t,a)})),Es=Oo((function(t,e,n,a){To(e,Ts(e),t,a)})),Ls=or(sa),Ps=Ka((function(e,n){e=kt(e);var a=-1,o=n.length,r=o>2?n[2]:t;for(r&&wr(n[0],n[1],r)&&(o=1);++a1),e})),To(t,ir(t),n),a&&(n=ca(n,7,nr));for(var o=e.length;o--;)ho(n,e[o]);return n})),Ds=or((function(t,e){return null==t?{}:function(t,e){return Ya(t,e,(function(e,n){return Ms(t,n)}))}(t,e)}));function js(t,e){if(null==t)return{};var n=Te(ir(t),(function(t){return[t]}));return e=dr(e),Ya(t,n,(function(t,n){return e(t,n[0])}))}var Ss=qo(Ts),Is=qo(zs);function Hs(t){return null==t?[]:Ke(t,Ts(t))}var Vs=jo((function(t,e,n){return e=e.toLowerCase(),t+(n?Us(e):e)}));function Us(t){return Ks(bs(t).toLowerCase())}function Qs(t){return(t=bs(t))&&t.replace(pt,en).replace(qt,"")}var Ws=jo((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ys=jo((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Zs=Do("toLowerCase"),Xs=jo((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Fs=jo((function(t,e,n){return t+(n?" ":"")+Ks(e)})),Js=jo((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ks=Do("toUpperCase");function qs(e,n,a){return e=bs(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 _e(e,(function(e){e=jr(e),ia(t,e,Ni(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 Ga("function"==typeof t?t:ca(t,1))}var il=Ka((function(t,e){return function(n){return Ba(n,t,e)}})),sl=Ka((function(t,e){return function(n){return Ba(t,n,e)}}));function ll(t,e,n){var a=Ts(e),o=Ea(e,a);null!=n||es(e)&&(o.length||!a.length)||(n=e,e=t,t=this,o=Ea(e,Ts(e)));var r=!(es(n)&&"chain"in n&&!n.chain),i=qi(t);return _e(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__=Bo(this.__actions__)).push({func:a,args:arguments,thisArg:t}),n.__chain__=e,n}return a.apply(t,ze([this.value()],arguments))})})),t}function cl(){}var dl=Wo(Te),ul=Wo(Me),gl=Wo(Ge);function hl(t){return xr(t)?Qe(jr(t)):function(t){return function(e){return La(e,t)}}(t)}var yl=Zo(),fl=Zo(!0);function ml(){return[]}function pl(){return!1}var vl,bl=Qo((function(t,e){return t+e}),0),Al=Jo("ceil"),wl=Qo((function(t,e){return t/e}),1),xl=Jo("floor"),El=Qo((function(t,e){return t*e}),1),Ll=Jo("round"),Pl=Qo((function(t,e){return t-e}),0);return Hn.after=function(t,n){if("function"!=typeof n)throw new Nt(e);return t=fs(t),function(){if(--t<1)return n.apply(this,arguments)}},Hn.ary=Mi,Hn.assign=As,Hn.assignIn=ws,Hn.assignInWith=xs,Hn.assignWith=Es,Hn.at=Ls,Hn.before=Ci,Hn.bind=Ni,Hn.bindAll=tl,Hn.bindKey=Bi,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?wr(e,n,a):n===t)?1:bn(fs(n),0);var o=null==e?0:e.length;if(!o||n<1)return[];for(var r=0,i=0,s=xt(me(o/n));rr?0:r+a),(o=o===t||o>r?r:fs(o))<0&&(o+=r),o=a>o?0:ms(o);a>>0)?(e=bs(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 Nt(e);return n=null==n?0:bn(fs(n),0),Ka((function(e){var a=e[n],o=Eo(e,0,n);return a&&ze(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:fs(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:fs(n)))<0?0:n,o):[]},Hn.takeRightWhile=function(t,e){return t&&t.length?fo(t,dr(e,3),!1,!0):[]},Hn.takeWhile=function(t,e){return t&&t.length?fo(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 Nt(e);return es(a)&&(o="leading"in a?!!a.leading:o,r="trailing"in a?!!a.trailing:r),Ti(t,n,{leading:o,maxWait:n,trailing:r})},Hn.thru=yi,Hn.toArray=hs,Hn.toPairs=Ss,Hn.toPairsIn=Is,Hn.toPath=function(t){return Wi(t)?Te(t,jr):cs(t)?[t]:Bo(Dr(bs(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(Zt(t)):{}}return(o?_e:wa)(t,(function(t,a,o){return e(n,t,a,o)})),n},Hn.unary=function(t){return Mi(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:yo(t,e,Ao(n))},Hn.updateWith=function(e,n,a,o){return o="function"==typeof o?o:t,null==e?e:yo(e,n,Ao(a),o)},Hn.values=Hs,Hn.valuesIn=function(t){return null==t?[]:Ke(t,zs(t))},Hn.without=si,Hn.words=qs,Hn.wrap=function(t,e){return ji(Ao(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=ws,Hn.extendWith=xs,ll(Hn,Hn),Hn.add=bl,Hn.attempt=$s,Hn.camelCase=Vs,Hn.capitalize=Us,Hn.ceil=Al,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,Ts(e))},Hn.deburr=Qs,Hn.defaultTo=function(t,e){return null==t||t!=t?e:t},Hn.divide=wl,Hn.endsWith=function(e,n,a){e=bs(e),n=uo(n);var o=e.length,r=a=a===t?o:la(fs(a),0,o);return(a-=n.length)>=0&&e.slice(a,r)==n},Hn.eq=Hi,Hn.escape=function(t){return(t=bs(t))&&Z.test(t)?t.replace(W,nn):t},Hn.escapeRegExp=function(t){return(t=bs(t))&&et.test(t)?t.replace(tt,"\\$&"):t},Hn.every=function(e,n,a){var o=Wi(e)?Me:fa;return a&&wr(e,n,a)&&(n=t),o(e,dr(n,3))},Hn.find=pi,Hn.findIndex=Qr,Hn.findKey=function(t,e){return je(t,dr(e,3),wa)},Hn.findLast=vi,Hn.findLastIndex=Wr,Hn.findLastKey=function(t,e){return je(t,dr(e,3),xa)},Hn.floor=xl,Hn.forEach=bi,Hn.forEachRight=Ai,Hn.forIn=function(t,e){return null==t?t:ba(t,dr(e,3),zs)},Hn.forInRight=function(t,e){return null==t?t:Aa(t,dr(e,3),zs)},Hn.forOwn=function(t,e){return t&&wa(t,dr(e,3))},Hn.forOwnRight=function(t,e){return t&&xa(t,dr(e,3))},Hn.get=ks,Hn.gt=Vi,Hn.gte=Ui,Hn.has=function(t,e){return null!=t&&pr(t,e,Ma)},Hn.hasIn=Ms,Hn.head=Zr,Hn.identity=ol,Hn.includes=function(t,e,n,a){t=Zi(t)?t:Hs(t),n=n&&!a?fs(n):0;var o=t.length;return n<0&&(n=bn(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:fs(n);return o<0&&(o=bn(a+o,0)),Ie(t,e,o)},Hn.inRange=function(e,n,a){return n=ys(n),a===t?(a=n,n=0):a=ys(a),function(t,e,n){return t>=An(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)&&mr(t)==C},Hn.isWeakSet=function(t){return ns(t)&&"[object WeakSet]"==_a(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=fs(a))<0?bn(o+r,0):An(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=Ys,Hn.lowerFirst=Zs,Hn.lt=us,Hn.lte=gs,Hn.max=function(e){return e&&e.length?ma(e,ol,ka):t},Hn.maxBy=function(e,n){return e&&e.length?ma(e,dr(n,2),ka):t},Hn.mean=function(t){return Ue(t,ol)},Hn.meanBy=function(t,e){return Ue(t,dr(e,2))},Hn.min=function(e){return e&&e.length?ma(e,ol,Sa):t},Hn.minBy=function(e,n){return e&&e.length?ma(e,dr(n,2),Sa):t},Hn.stubArray=ml,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?Qa(e,fs(n)):t},Hn.noConflict=function(){return ge._===this&&(ge._=Ht),this},Hn.noop=cl,Hn.now=ki,Hn.pad=function(t,e,n){t=bs(t);var a=(e=fs(e))?un(t):0;if(!e||a>=e)return t;var o=(e-a)/2;return Yo(pe(o),n)+t+Yo(me(o),n)},Hn.padEnd=function(t,e,n){t=bs(t);var a=(e=fs(e))?un(t):0;return e&&an){var o=e;e=n,n=o}if(a||e%1||n%1){var r=En();return An(e+r*(n-e+le("1e-"+((r+"").length-1))),n)}return Fa(e,n)},Hn.reduce=function(t,e,n){var a=Wi(t)?Oe:Ye,o=arguments.length<3;return a(t,dr(e,4),n,o,ha)},Hn.reduceRight=function(t,e,n){var a=Wi(t)?Re:Ye,o=arguments.length<3;return a(t,dr(e,4),n,o,ya)},Hn.repeat=function(e,n,a){return n=(a?wr(e,n,a):n===t)?1:fs(n),Ja(bs(e),n)},Hn.replace=function(){var t=arguments,e=bs(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Hn.result=function(e,n,a){var o=-1,r=(n=wo(n,e)).length;for(r||(r=1,e=t);++od)return[];var n=g,a=An(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=Mt(r.source,bs(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=bs(t))&&Y.test(t)?t.replace(Q,yn):t},Hn.uniqueId=function(t){var e=++Dt;return bs(t)+e},Hn.upperCase=Js,Hn.upperFirst=Ks,Hn.each=bi,Hn.eachRight=Ai,Hn.first=Zr,ll(Hn,(vl={},wa(Hn,(function(t,e){Gt.call(Hn.prototype,e)||(vl[e]=t)})),vl),{chain:!1}),Hn.VERSION="4.17.21",_e(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Hn[t].placeholder=Hn})),_e(["drop","take"],(function(e,n){Wn.prototype[e]=function(a){a=a===t?1:bn(fs(a),0);var o=this.__filtered__&&!n?new Wn(this):this.clone();return o.__filtered__?o.__takeCount__=An(a,o.__takeCount__):o.__views__.push({size:An(a,g),type:e+(o.__dir__<0?"Right":"")}),o},Wn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),_e(["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}})),_e(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Wn.prototype[t]=function(){return this[n](1).value()[0]}})),_e(["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 Ba(n,t,e)}))})),Wn.prototype.reject=function(t){return this.filter(Gi(dr(t)))},Wn.prototype.slice=function(e,n){e=fs(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=fs(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)},wa(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,ze([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,y=i&&!g,f=l&&!h;if(!i&&d){n=f?n:new Wn(this);var m=e.apply(n,s);return m.__actions__.push({func:yi,args:[u],thisArg:t}),new Qn(m,g)}return y&&f?e.apply(this,s):(m=this.thru(u),y?o?m.value()[0]:m.value():m)})})),_e(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Bt[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)}))}})),wa(Wn.prototype,(function(t,e){var n=Hn[e];if(n){var a=n.name+"";Gt.call(Tn,a)||(Tn[a]=[]),Tn[a].push({name:e,func:n})}})),Tn[Vo(t,2).name]=[{name:"wrapper",func:t}],Wn.prototype.clone=function(){var t=new Wn(this.__wrapped__);return t.__actions__=Bo(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Bo(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Bo(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 Un;){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:yi,args:[ei],thisArg:t}),new Qn(n,this.__chain__)}return this.thru(ei)},Hn.prototype.toJSON=Hn.prototype.valueOf=Hn.prototype.value=function(){return mo(this.__wrapped__,this.__actions__)},Hn.prototype.first=Hn.prototype.head,ee&&(Hn.prototype[ee]=function(){return this}),Hn}();ye?((ye.exports=fn)._=fn,he._=fn):ge._=fn}.call(Ht);var Ni,Bi,Ti=Ci.exports;let zi=class extends rt{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(Bi||(Bi=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(ft).map((t=>({label:Ti.capitalize(t),value:t})))}}},{name:"modern",selector:{boolean:{}}},{name:"autarky",selector:{select:{options:Object.values(mt).map((t=>({label:Ti.capitalize(t),value:t})))}}},{name:"colour",selector:{color_rgb:{}}},{name:"ac_icon",selector:{icon:{}}},{name:"dc_icon",selector:{icon:{}}}]},{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:Ot.VOLTAGE}}},{name:"inverter_voltage_L2",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"inverter_voltage_L3",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"load_frequency_192",selector:{entity:{device_class:Ot.FREQUENCY}}},{name:"inverter_current_164",selector:{entity:{device_class:Ot.CURRENT}}},{name:"inverter_current_L2",selector:{entity:{device_class:Ot.CURRENT}}},{name:"inverter_current_L3",selector:{entity:{device_class:Ot.CURRENT}}},{name:"inverter_power_175",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_power_169",selector:{entity:{device_class:Ot.POWER}}},{name:"dc_transformer_temp_90",selector:{entity:{device_class:Ot.TEMPERATURE}}},{name:"radiator_temp_91",selector:{entity:{device_class:Ot.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("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("solar_production_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"pv_total",selector:{entity:{device_class:Ot.POWER}}},{name:"day_pv_energy_108",selector:{entity:{device_class:Ot.ENERGY}}},{name:"monthly_pv_generation",selector:{entity:{device_class:Ot.ENERGY}}},{name:"yearly_pv_generation",selector:{entity:{device_class:Ot.ENERGY}}},{name:"total_pv_generation",selector:{entity:{device_class:Ot.ENERGY}}},{name:"remaining_solar",selector:{entity:{device_class:Ot.ENERGY}}},{name:"tomorrow_solar",selector:{entity:{device_class:Ot.ENERGY}}}]}]},{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("pv_1_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"pv1_power_186",selector:{entity:{device_class:Ot.POWER}}},{name:"pv1_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv1_voltage_109",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv1_current_110",selector:{entity:{device_class:Ot.CURRENT}}}]}]},{type:"expandable",title:this._title("pv_2_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"pv2_power_187",selector:{entity:{device_class:Ot.POWER}}},{name:"pv2_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv2_voltage_111",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv2_current_112",selector:{entity:{device_class:Ot.CURRENT}}}]}]},{type:"expandable",title:this._title("pv_3_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"pv3_power_188",selector:{entity:{device_class:Ot.POWER}}},{name:"pv3_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv3_voltage_113",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv3_current_114",selector:{entity:{device_class:Ot.CURRENT}}}]}]},{type:"expandable",title:this._title("pv_4_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"pv4_power_189",selector:{entity:{device_class:Ot.POWER}}},{name:"pv4_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv4_voltage_115",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv4_current_116",selector:{entity:{device_class:Ot.CURRENT}}}]}]},{type:"expandable",title:this._title("pv_5_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"pv5_power",selector:{entity:{device_class:Ot.POWER}}},{name:"pv5_production",selector:{entity:{device_class:Ot.ENERGY}}},{name:"pv5_voltage",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"pv5_current",selector:{entity:{device_class:Ot.CURRENT}}}]}]},{type:"expandable",title:this._title("optional_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"solar_sell_247",selector:{entity:{}}},{name:"environment_temp",selector:{entity:{device_class:Ot.TEMPERATURE}}}]}]}]},{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("battery_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"battery_power_190",selector:{entity:{device_class:Ot.POWER}}},{name:"battery_soc_184",selector:{entity:{device_class:Ot.BATTERY}}},{name:"battery_current_191",selector:{entity:{device_class:Ot.CURRENT}}},{name:"battery_voltage_183",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_temp_182",selector:{entity:{device_class:Ot.TEMPERATURE}}},{name:"day_battery_charge_70",selector:{entity:{device_class:Ot.ENERGY}}},{name:"day_battery_discharge_71",selector:{entity:{device_class:Ot.ENERGY}}},{name:"battery_remaining_storage",selector:{entity:{device_class:Ot.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("optional_ent"),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("battery_bank"),schema:[{name:"battery",type:"grid",schema:[{name:"show_battery_banks",selector:{boolean:{}}},{name:"battery_banks_view_mode",selector:{select:{options:Object.values(pt).map((t=>({label:Ti.capitalize(t),value:t})))}}},{name:"battery_banks",selector:{number:{mode:"box",min:0,max:4}}},{name:"battery_bank_1_energy",selector:{number:{min:0}}},{name:"battery_bank_2_energy",selector:{number:{min:0}}},{name:"battery_bank_3_energy",selector:{number:{min:0}}},{name:"battery_bank_4_energy",selector:{number:{min:0}}}]}]},{type:"expandable",title:this._title("battery_bank_1_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"battery_bank_1_power",selector:{entity:{device_class:Ot.POWER}}},{name:"battery_bank_1_voltage",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_bank_1_current",selector:{entity:{device_class:Ot.CURRENT}}},{name:"battery_bank_1_delta",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_bank_1_remaining_storage",selector:{entity:{device_class:[Ot.ENERGY,Ot.ENERGY_STORAGE]}}},{name:"battery_bank_1_soc",selector:{entity:{device_class:Ot.BATTERY}}}]}]},{type:"expandable",title:this._title("battery_bank_2_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"battery_bank_2_power",selector:{entity:{device_class:Ot.POWER}}},{name:"battery_bank_2_voltage",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_bank_2_current",selector:{entity:{device_class:Ot.CURRENT}}},{name:"battery_bank_2_delta",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_bank_2_remaining_storage",selector:{entity:{device_class:[Ot.ENERGY,Ot.ENERGY_STORAGE]}}},{name:"battery_bank_2_soc",selector:{entity:{device_class:Ot.BATTERY}}}]}]},{type:"expandable",title:this._title("battery_bank_3_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"battery_bank_3_power",selector:{entity:{device_class:Ot.POWER}}},{name:"battery_bank_3_voltage",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_bank_3_current",selector:{entity:{device_class:Ot.CURRENT}}},{name:"battery_bank_3_delta",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_bank_3_remaining_storage",selector:{entity:{device_class:[Ot.ENERGY,Ot.ENERGY_STORAGE]}}},{name:"battery_bank_3_soc",selector:{entity:{device_class:Ot.BATTERY}}}]}]},{type:"expandable",title:this._title("battery_bank_4_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"battery_bank_4_power",selector:{entity:{device_class:Ot.POWER}}},{name:"battery_bank_4_voltage",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_bank_4_current",selector:{entity:{device_class:Ot.CURRENT}}},{name:"battery_bank_4_delta",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"battery_bank_4_remaining_storage",selector:{entity:{device_class:[Ot.ENERGY,Ot.ENERGY_STORAGE]}}},{name:"battery_bank_4_soc",selector:{entity:{device_class:Ot.BATTERY}}}]}]}]},{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("load_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"day_load_energy_84",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_power",selector:{entity:{device_class:Ot.POWER}}},{name:"load_power_L1",selector:{entity:{device_class:Ot.POWER}}},{name:"load_power_L2",selector:{entity:{device_class:Ot.POWER}}},{name:"load_power_L3",selector:{entity:{device_class:Ot.POWER}}}]}]},{type:"expandable",title:this._title("additional_loads_1"),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:{}}}]}]},{type:"expandable",title:this._title("ess_ld_1"),schema:[{name:"entities",type:"grid",schema:[{name:"essential_load1",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load1_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load1_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load2",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load2_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load2_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load3",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load3_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load3_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load4",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load4_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load4_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load5",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load5_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load5_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load6",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load6_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load6_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load7",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load7_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load7_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load8",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load8_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load8_toggle",selector:{entity:{domain:["input_boolean","switch"]}}}]}]},{type:"expandable",title:this._title("additional_loads_2"),schema:[{name:"load",type:"grid",schema:[{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:{}}}]}]},{type:"expandable",title:this._title("ess_ld_2"),schema:[{name:"entities",type:"grid",schema:[{name:"essential_load9",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load9_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load9_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load10",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load10_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load10_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load11",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load11_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load11_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load12",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load12_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load12_toggle",selector:{entity:{domain:["input_boolean","switch"]}}}]}]},{type:"expandable",title:this._title("additional_loads_3"),schema:[{name:"load",type:"grid",schema:[{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("ess_ld_3"),schema:[{name:"entities",type:"grid",schema:[{name:"essential_load13",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load13_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load13_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load14",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load14_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load14_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load15",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load15_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load15_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load16",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load16_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load16_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load17",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load17_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load17_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load18",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load18_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load18_toggle",selector:{entity:{domain:["input_boolean","switch"]}}}]}]},{type:"expandable",title:this._title("additional_loads_4"),schema:[{name:"load",type:"grid",schema:[{name:"load19_name",selector:{text:{}}},{name:"load19_icon",selector:{icon:{}}},{name:"load20_name",selector:{text:{}}},{name:"load20_icon",selector:{icon:{}}},{name:"load21_name",selector:{text:{}}},{name:"load21_icon",selector:{icon:{}}},{name:"load22_name",selector:{text:{}}},{name:"load22_icon",selector:{icon:{}}},{name:"load23_name",selector:{text:{}}},{name:"load23_icon",selector:{icon:{}}}]}]},{type:"expandable",title:this._title("ess_ld_4"),schema:[{name:"entities",type:"grid",schema:[{name:"essential_load19",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load19_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load19_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load20",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load20_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load20_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load21",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load21_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load21_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load22",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load22_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load22_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"essential_load23",selector:{entity:{device_class:Ot.POWER}}},{name:"essential_load23_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"essential_load23_toggle",selector:{entity:{domain:["input_boolean","switch"]}}}]}]},{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("aux_load_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"day_aux_energy",selector:{entity:{device_class:Ot.ENERGY}}},{name:"aux_power_166",selector:{entity:{device_class:Ot.POWER}}},{name:"aux_load1",selector:{entity:{device_class:Ot.POWER}}},{name:"aux_load1_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"aux_load1_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"aux_load2",selector:{entity:{device_class:Ot.POWER}}},{name:"aux_load2_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"aux_load2_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"aux_load3",selector:{entity:{device_class:Ot.POWER}}},{name:"aux_load3_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"aux_load3_toggle",selector:{entity:{domain:["input_boolean","switch"]}}}]}]}]},{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:{}}}]},{type:"expandable",title:this._title("gri_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"day_grid_import_76",selector:{entity:{device_class:Ot.ENERGY}}},{name:"day_grid_export_77",selector:{entity:{device_class:Ot.ENERGY}}},{name:"grid_frequency",selector:{entity:{device_class:Ot.FREQUENCY}}},{name:"grid_ct_power_172",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_ct_power_L2",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_ct_power_L3",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_voltage_L1",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"grid_voltage_L2",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"grid_voltage_L3",selector:{entity:{device_class:Ot.VOLTAGE}}},{name:"grid_current_L1",selector:{entity:{device_class:Ot.CURRENT}}},{name:"grid_current_L2",selector:{entity:{device_class:Ot.CURRENT}}},{name:"grid_current_L3",selector:{entity:{device_class:Ot.CURRENT}}},{name:"grid_ct_power_total",selector:{entity:{device_class:Ot.POWER}}},{name:"grid_voltage",selector:{entity:{device_class:Ot.VOLTAGE}}},{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:Ot.POWER}}}]}]},{type:"expandable",title:this._title("ness_load"),schema:[{name:"grid",type:"grid",schema:[{name:"show_nonessential",selector:{boolean:{}}},{name:"additional_loads",selector:{number:{mode:"box",min:0,max:3}}},{name:"nonessential_name",selector:{text:{}}},{name:"nonessential_icon",selector:{icon:{}}},{name:"load1_name",selector:{text:{}}},{name:"load1_icon",selector:{icon:{}}},{name:"load2_name",selector:{text:{}}},{name:"load2_icon",selector:{icon:{}}},{name:"load3_name",selector:{text:{}}},{name:"load3_icon",selector:{icon:{}}}]}]},{type:"expandable",title:this._title("ness_load_ent"),schema:[{name:"entities",type:"grid",schema:[{name:"nonessential_power",selector:{entity:{device_class:Ot.POWER}}},{name:"non_essential_load1",selector:{entity:{device_class:Ot.POWER}}},{name:"non_essential_load1_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"non_essential_load1_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"non_essential_load2",selector:{entity:{device_class:Ot.POWER}}},{name:"non_essential_load2_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"non_essential_load2_toggle",selector:{entity:{domain:["input_boolean","switch"]}}},{name:"non_essential_load3",selector:{entity:{device_class:Ot.POWER}}},{name:"non_essential_load3_extra",selector:{entity:{device_class:Ot.ENERGY}}},{name:"non_essential_load3_toggle",selector:{entity:{domain:["input_boolean","switch"]}}}]}]}]}],this._valueChanged.bind(this)):V(Ni||(Ni=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([dt()],zi.prototype,"hass",void 0),t([dt()],zi.prototype,"_config",void 0),t([dt()],zi.prototype,"lovelace",void 0),zi=t([st(zt)],zi);var Oi=Object.freeze({__proto__:null,get ConfigurationCardEditor(){return zi}});export{Li as PowerFlowCard}; diff --git a/docs/configuration.md b/docs/configuration.md index 58b31ca..a5c722b 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -56,34 +56,86 @@ The card can be configured through the following attributes: ## Inverter -| Attribute | Requirement | Default | Description | -|--------------|-------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| three_phase: | Optional | `false` | If set to `true` additional 3 phase sensors will be displayed. Requires entity attributes to be defined i.e. `inverter_current_L2`, `inverter_current_L3`, `inverter_voltage_L2`, `inverter_voltage_L3` , `grid_ct_power_L2`, `grid_ct_power_L3`, `load_power_L1`, `load_power_L2`, `load_power_L3` | -| auto_scale: | Optional | `true` | If set to `true` the card will use the entities `unit_of_measurement` attribute to perform the correct scaling (i,e, power values greater than 999W will be displayed as kW e.g. 1.23kW) and display the correct unit. The number of decimal places can be changed using the `decimal_places` card attribute apart from the daily energy values which are set using the `decimal_places_energy` attribute | -| model: | Optional | `sunsynk` | Selects which inverter image and status codes to use. Options are `lux`, `solis`, `goodwe`, `goodwe_gridmode`, `foxess`, `solax`, `sunsynk`, `victron`, `fronius`, `solaredge`, `growatt`, `sofar`, `ces-battery-box`, `deye`, `azzurro`, `powmr`, `mppsolar`, `smasolar`, `huawei`, , `Easun SMW8kW SA`. | -| modern: | Optional | `true` | Display the inverter using the modern image. Set to `false` to display an image of the inverter based on the `model` attribute below. | -| autarky: | Optional | `power` | Display autarky and ratio as a percentage using either realtime power or daily energy values. Set to `no` to hide (`energy/power/Auto$Self/no`). Check [Autarky](#autarky) for details | -| colour: | Optional | `grey` | Sets the colour of the inverter and data. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -| ac_icon: | Optional | | Set the AC temperature icon. If not present "AC" will be displayed | -| dc_icon: | Optional | | Set the DC temperature icon. If not present "DC" will be displayed | +| Attribute | Requirement | Default | Description | +|--------------------|--------------------------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| three_phase: | Optional | `false` | If set to `true` additional 3 phase sensors will be displayed. Requires entity attributes to be defined i.e. `inverter_current_L2`, `inverter_current_L3`, `inverter_voltage_L2`, `inverter_voltage_L3` , `grid_ct_power_L2`, `grid_ct_power_L3`, `load_power_L1`, `load_power_L2`, `load_power_L3` | +| auto_scale: | Optional | `true` | If set to `true` the card will use the entities `unit_of_measurement` attribute to perform the correct scaling (i,e, power values greater than 999W will be displayed as kW e.g. 1.23kW) and display the correct unit. The number of decimal places can be changed using the `decimal_places` card attribute apart from the daily energy values which are set using the `decimal_places_energy` attribute | +| model: | Optional | `sunsynk` | Selects which inverter image and status codes to use. Options are `lux`, `solis`, `goodwe`, `goodwe_gridmode`, `foxess`, `solax`, `sunsynk`, `victron`, `fronius`, `solaredge`, `growatt`, `sofar`, `ces-battery-box`, `deye`, `azzurro`, `powmr`, `mppsolar`, `smasolar`, `huawei`, , `Easun SMW8kW SA`. | +| modern: | Optional | `true` | Display the inverter using the modern image. Set to `false` to display an image of the inverter based on the `model` attribute below. | +| autarky: | Optional | `power` | Display autarky and ratio as a percentage using either realtime power or daily energy values. Set to `no` to hide (`energy/power/Auto$Self/no`). Check [Autarky](#autarky) for details | +| colour: | Optional | `grey` | Sets the colour of the inverter and data. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | +| ac_icon: | Optional | | Set the AC temperature icon. If not present "AC" will be displayed | +| dc_icon: | Optional | | Set the DC temperature icon. If not present "DC" will be displayed | +| Inverter Entities: | [Sub-menu](#inverter-entities) | | Shows sub-menu with Inverter Entities | +| Programs Entities: | [Sub-menu](#programs-entities) | | Shows sub-menu with Programs Entities | + +### Inverter Entities + +| Attribute | Requirement | Default | Description | +|---------------------------|-------------|---------------------------------------------|----------------------------------------------------------------------------------------------------------------------------| +| inverter_status_59: | Optional | `sensor.sunsynk_overall_state` | Expects a sensor that contains inverter status represented as a string or number. See [Inverter status](#inverter-status) | +| inverter_voltage_154: | Optional | `sensor.sunsynk_inverter_voltage` | Inverter L1 voltage (V) | +| inverter_voltage_L2: | Optional | | Inverter L2 voltage (V) | +| inverter_voltage_L3: | Optional | | Inverter L3 voltage (V) | +| load_frequency_192: | Optional | `sensor.sunsynk_load_frequency` | Load frequency (Hz) | +| inverter_current_164: | Optional | `sensor.sunsynk_inverter_current` | Inverter L1 current (A) | +| inverter_current_L2: | Optional | | Inverter L2 current (A) | +| inverter_current_L3: | Optional | | Inverter L3 current (A) | +| inverter_power_175: | Optional | `sensor.sunsynk_inverter_power` | Inverter power (W). | +| grid_power_169: | Optional | | Inverters grid power | +| dc_transformer_temp_90: | Optional | `sensor.sunsynk_dc_transformer_temperature` | Inverter DC temperature (℃) | +| radiator_temp_91: | Optional | `sensor.sunsynk_radiator_temperature` | Inverter AC temperature (℃) | +| inverter_load_percentage: | Optional | | Inverter Load in Percents (0-100 range). If enabled visualize load on Inverter image | +| use_timer_248: | Optional | `switch.sunsynk_toggle_system_timer` | Displays "Use timer" status as an icon next to the inverter. Set to `no` to hide | +| priority_load_243: | Optional | `switch.sunsynk_toggle_priority_load` | Shows if energy pattern is set to priority load or priority battery as an icon next to the inverter. Set to `no` to hide | + +#### Programs Entities + +| Attribute | Requirement | Default | Description | +|-----------------|-------------|------------------------------------------------|--------------------------------------------------------------| +| prog1_time: | Optional | `sensor.sunsynk_time_slot_1` | Program 1 start time (`HH:MM`) | +| prog1_capacity: | Optional | `number.sunsynk_system_mode_soc_time1` | Program 1 capacity (SOC) setting | +| prog1_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time1` | Program 1 charge options (`on/off`, `1/0`, `No Grid or Gen`) | +| prog2_time: | Optional | `sensor.sunsynk_time_slot_2` | Program 2 start time (`HH:MM`) | +| prog2_capacity: | Optional | `number.sunsynk_system_mode_soc_time2` | Program 2 capacity (SOC) setting | +| prog2_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time2` | Program 2 charge options (`on/off`, `1/0`, `No Grid or Gen`) | +| prog3_time: | Optional | `sensor.sunsynk_time_slot_3` | Program 3 start time (`HH:MM`) | +| prog3_capacity: | Optional | `number.sunsynk_system_mode_soc_time3` | Program 3 capacity (SOC) setting | +| prog3_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time3` | Program 3 charge options (`on/off`, `1/0`, `No Grid or Gen`) | +| prog4_time: | Optional | `sensor.sunsynk_time_slot_4` | Program 4 start time (`HH:MM`) | +| prog4_capacity: | Optional | `number.sunsynk_system_mode_soc_time4` | Program 4 capacity (SOC) setting | +| prog4_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time4` | Program 4 charge options (`on/off`, `1/0`, `No Grid or Gen`) | +| prog5_time: | Optional | `sensor.sunsynk_time_slot_5` | Program 5 start time (`HH:MM`) | +| prog5_capacity: | Optional | `number.sunsynk_system_mode_soc_time5` | Program 5 capacity (SOC) setting | +| prog5_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time5` | Program 5 charge options (`on/off`, `1/0`, `No Grid or Gen`) | +| prog6_time: | Optional | `sensor.sunsynk_time_slot_6` | Program 6 start time (`HH:MM`) | +| prog6_capacity: | Optional | `number.sunsynk_system_mode_soc_time6` | Program 6 capacity (SOC) setting | +| prog6_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time6` | Program 6 charge options (`on/off`, `1/0`, `No Grid or Gen`) | ## Solar These attributes are only needed if `show_solar` is set to `true` -| Attribute | Requirement | Default | Description | -|-----------------------|----------------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| mppts: | **Required** | `2` | Specify the number of MPPT's in use `1`, `2`, `3`, `4` or `5` | -| auto_scale: | Optional | `true` | If set to `true` the card will use the entities `unit_of_measurement` attribute to perform the correct scaling (i,e, power values greater than 999W will be displayed as kW e.g. 1.23kW) and display the correct unit. The number of decimal places can be changed using the `decimal_places` card attribute apart from the daily energy values which are set using the `decimal_places_energy` attribute | -| colour: | Optional | `orange` | Sets the colour of all the solar card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -| dynamic_colour: | Optional | `true` | The solar elements on the card will be greyed out if total solar power < 10W. | -| animation_speed: | Optional | `9` | Set slowest animation speed in seconds, depending on Power produced | -| off_threshold: | Optional | `10` | When total PV power falls belows this threshold colour will change to grey. Requires `dynamic_colour` to be enabled | -| Solar production | [Sub-menu](#solar-production) | | Shows sub-menu with custom solar production names. | -| PV Max Power | [Sub-menu](#solar-pv-max-power) | | Shows sub-menu with Max Power values required to calculate and visualize efficiency | -| MPPTs Options | [Sub-menu](#solar-mppts-options) | | Shows sub-menu with MPPTs Options to set | - -### Solar: production +| Attribute | Requirement | Default | Description | +|---------------------|----------------------------------------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| mppts: | **Required** | `2` | Specify the number of MPPT's in use `1`, `2`, `3`, `4` or `5` | +| auto_scale: | Optional | `true` | If set to `true` the card will use the entities `unit_of_measurement` attribute to perform the correct scaling (i,e, power values greater than 999W will be displayed as kW e.g. 1.23kW) and display the correct unit. The number of decimal places can be changed using the `decimal_places` card attribute apart from the daily energy values which are set using the `decimal_places_energy` attribute | +| colour: | Optional | `orange` | Sets the colour of all the solar card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | +| dynamic_colour: | Optional | `true` | The solar elements on the card will be greyed out if total solar power < 10W. | +| animation_speed: | Optional | `9` | Set slowest animation speed in seconds, depending on Power produced | +| off_threshold: | Optional | `10` | When total PV power falls belows this threshold colour will change to grey. Requires `dynamic_colour` to be enabled | +| Production Names | [Sub-menu](#solar-production-options) | | Shows sub-menu with solar production names. | +| Production Entities | [Sub-menu](#solar-production-entities) | | Shows sub-menu with solar production entites. | +| PV Max Power | [Sub-menu](#solar-pv-max-power) | | Shows sub-menu with Max Power values required to calculate and visualize efficiency | +| MPPTs Options | [Sub-menu](#solar-mppts-options) | | Shows sub-menu with MPPTs Options to set | +| PV1 Entities | [Sub-menu](#solar-pv1-entities) | | Shows sub-menu with PV1 Entities | +| PV2 Entities | [Sub-menu](#solar-pv2-entities) | | Shows sub-menu with PV2 Entities | +| PV3 Entities | [Sub-menu](#solar-pv3-entities) | | Shows sub-menu with PV3 Entities | +| PV4 Entities | [Sub-menu](#solar-pv4-entities) | | Shows sub-menu with PV4 Entities | +| PV5 Entities | [Sub-menu](#solar-pv5-entities) | | Shows sub-menu with PV5 Entities | +| Optional Entities | [Sub-menu](#solar-optional-entities) | | Shows sub-menu with Other Solar Entities | + +### Solar: production options | Attribute | Requirement | Default | Description | |------------------------------|-------------|---------|-----------------------------------------------------------------------| @@ -94,6 +146,18 @@ These attributes are only needed if `show_solar` is set to `true` | remaining_solar_name: | Optional | | Set the name for remaining_solar entity (default: LEFT SOLAR) | | tomorrow_solar_name: | Optional | | Set the name for tomorrow_solar entity (default: TOMORROW) | +### Solar" production entities + +| Attribute | Requirement | Default | Description | +|------------------------|-------------|--------------------------------|-----------------------------------------------------------------------------------------------------------------------------| +| pv_total: | Optional | | Provide a sensor for total pv power. If omitted the card uses internal logic to calculate this based on the pv1-5 power (W) | +| day_pv_energy_108: | Optional | `sensor.sunsynk_day_pv_energy` | Daily solar generation (kWh) | +| monthly_pv_generation: | Optional | | Monthly solar generation (kWh) | +| yearly_pv_generation: | Optional | | Yearly solar generation (kWh) | +| total_pv_generation: | Optional | | Total Solar generation | +| remaining_solar: | Optional | | The remaining solar forecast for the day (kWh). | +| tomorrow_solar: | Optional | | Solar forecast for tomorrow (kWh). | + ### Solar: PV Max Power | Attribute | Requirement | Default | Description | @@ -119,52 +183,210 @@ These attributes are only needed if `show_solar` is set to `true` | show_mppt_production: | Optional | `true` | Show each MPPT energy production | | show_mppt_efficiency: | Optional | `false` | Show % of each MPPT efficiency | +### Solar: PV1 Entities + +| Attribute | Requirement | Default | Description | +|------------------|-------------|------------------------------|--------------------------------| +| pv1_power_186: | Optional | `sensor.sunsynk_pv1_power` | PV string 1 power (W) | +| pv1_production: | Optional | | PV string 1 daily energy (kWh) | +| pv1_voltage_109: | Optional | `sensor.sunsynk_pv1_voltage` | PV string 1 voltage (V) | +| pv1_current_110: | Optional | `sensor.sunsynk_pv1_current` | PV string 1 current (A) | + +### Solar: PV2 Entities + +| Attribute | Requirement | Default | Description | +|------------------|-------------|------------------------------|--------------------------------| +| pv2_power_187: | Optional | `sensor.sunsynk_pv2_power` | PV string 2 power (W) | +| pv2_production: | Optional | | PV string 2 daily energy (kWh) | +| pv2_voltage_111: | Optional | `sensor.sunsynk_pv2_voltage` | PV string 2 voltage (V) | +| pv2_current_112: | Optional | `sensor.sunsynk_pv2_current` | PV string 2 current (A) | + +### Solar: PV3 Entities + +| Attribute | Requirement | Default | Description | +|------------------|-------------|---------|--------------------------------| +| pv3_power_188: | Optional | | PV string 3 power (W) | +| pv3_production: | Optional | | PV string 3 daily energy (kWh) | +| pv3_voltage_113: | Optional | | PV string 3 voltage (V) | +| pv3_current_114: | Optional | | PV string 3 current (A) | + +### Solar: PV4 Entities + +| Attribute | Requirement | Default | Description | +|------------------|-------------|---------|--------------------------------| +| pv4_power_189: | Optional | | PV string 4 power (W) | +| pv4_production: | Optional | | PV string 4 daily energy (kWh) | +| pv4_voltage_115: | Optional | | PV string 4 voltage (V) | +| pv4_current_116: | Optional | | PV string 4 current (A) | + +### Solar: PV5 Entities + +| Attribute | Requirement | Default | Description | +|------------------|-------------|---------|--------------------------------| +| pv5_power_189: | Optional | | PV string 5 power (W) | +| pv5_production: | Optional | | PV string 5 daily energy (kWh) | +| pv5_voltage_115: | Optional | | PV string 5 voltage (V) | +| pv5_current_116: | Optional | | PV string 5 current (A) | + +### Solar: Optional entities + +| Attribute | Requirement | Default | Description | +|-------------------|-------------|---------|--------------------------------------------------------------------------------------------------------------------------------| +| solar_sell_247: | Optional | | Displays icons to indicate if sell solar is active or not. The switch can be toggled by clicking on the icon (`on/off`, `1/0`) | +| environment_temp: | Optional | | Display outside temperature or other environment temperature below the sun icon | + ## Battery To display battery power and current as absolute values set `show_absolute: true`. This is set to false by default and will return your sensor value. The animated dot will change direction depending on the charging or discharging state. The `invert_power` attribute can be used to reverse direction if needed by your sensor. -| Attribute | Requirement | Default | Description | -|------------------------|--------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| energy: | **Required** | `0` | Total battery energy in Wh (e.g. 3 x 5.32kWh = 15960). If set to `0` the remaining battery runtime will be hidden. Numeric value or sensor i.e. `sensor.sunsynk_battery_energy` | -| shutdown_soc: | **Required** | `20` | The battery shutdown percentage used to calculate remaining runtime. Numeric value or sensor i.e. `sensor.sunsynk_battery_capacity_shutdown` | -| shutdown_soc_offgrid: | Optional | | The offgrid battery shutdown percentage used to calculate remaining runtime. Numeric value or sensor i.e. `sensor.offgrid_battery_capacity_shutdown` | -| show_daily: | Optional | `false` | Toggles the daily total | -| auto_scale: | Optional | `true` | If set to `true` the card will use the entities `unit_of_measurement` attribute to perform the correct scaling (i,e, power values greater than 999W will be displayed as kW e.g. 1.23kW) and display the correct unit. The number of decimal places can be changed using the `decimal_places` card attribute apart from the daily energy values which are set using the `decimal_places_energy` attribute | -| invert_power: | Optional | `false` | Set to `true` if your sensor provides a positive number for battery charge and negative number for battery discharge | -| show_absolute: | Optional | `false` | set to `true` to display power and current as absolute values | -| colour: | Optional | `pink` | Sets the colour of all the battery card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -| charge_colour: | Optional | | Sets the colour of all the battery card objects when charging. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -| dynamic_colour: | Optional | `true` | The battery icon colour will change based on the % contribution of the power source (grid, solar) supplying the battery. Set to `false` to disable. If `priority_load_243: on` solar will prioritise the essential load. If `false` or omitted solar will prioritise the battery. | -| linear_gradient: | Optional | `true` | The blocks inside the battery icon that represent SOC will be coloured using a linear gradient that ranges from red to green | -| animate: | Optional | `true` | Animates the linear gradient inside the battery icon | -| animation_speed: | Optional | `6` | Set slowest animation speed in seconds, depending on power draw | -| hide_soc: | Optional | `false` | If set to `true` the current program capacity (soc), or for Goodwe inverters the shutdown soc and offgrid shutdown soc that is shown to the left of the current battery SOC will be hidden. | -| show_remaining_energy: | Optional | `true` | Set to `true` to display the remaining battery energy in kWh based on the current SOC. Only visible on the `lite` and `full` cards | -| max_power: | Optional | `4500` | Maximum power draw to calculate animation speed. Numeric value or sensor i.e. `number.battery_maximum_discharging_power` | -| path_threshold: | Optional | `100` | Specify threshold to apply dynamic colour to the battery path element. The colour of the path will change to the source colour if the percentage supply by a single source equals or exceeds this value | +| Attribute | Requirement | Default | Description | +|-------------------------|--------------------------------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| energy: | **Required** | `0` | Total battery energy in Wh (e.g. 3 x 5.32kWh = 15960). If set to `0` the remaining battery runtime will be hidden. Numeric value or sensor i.e. `sensor.sunsynk_battery_energy` | +| shutdown_soc: | **Required** | `20` | The battery shutdown percentage used to calculate remaining runtime. Numeric value or sensor i.e. `sensor.sunsynk_battery_capacity_shutdown` | +| shutdown_soc_offgrid: | Optional | | The offgrid battery shutdown percentage used to calculate remaining runtime. Numeric value or sensor i.e. `sensor.offgrid_battery_capacity_shutdown` | +| show_daily: | Optional | `false` | Toggles the daily total | +| auto_scale: | Optional | `true` | If set to `true` the card will use the entities `unit_of_measurement` attribute to perform the correct scaling (i,e, power values greater than 999W will be displayed as kW e.g. 1.23kW) and display the correct unit. The number of decimal places can be changed using the `decimal_places` card attribute apart from the daily energy values which are set using the `decimal_places_energy` attribute | +| invert_power: | Optional | `false` | Set to `true` if your sensor provides a positive number for battery charge and negative number for battery discharge | +| show_absolute: | Optional | `false` | set to `true` to display power and current as absolute values | +| colour: | Optional | `pink` | Sets the colour of all the battery card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | +| charge_colour: | Optional | | Sets the colour of all the battery card objects when charging. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | +| dynamic_colour: | Optional | `true` | The battery icon colour will change based on the % contribution of the power source (grid, solar) supplying the battery. Set to `false` to disable. If `priority_load_243: on` solar will prioritise the essential load. If `false` or omitted solar will prioritise the battery. | +| linear_gradient: | Optional | `true` | The blocks inside the battery icon that represent SOC will be coloured using a linear gradient that ranges from red to green | +| animate: | Optional | `true` | Animates the linear gradient inside the battery icon | +| animation_speed: | Optional | `6` | Set slowest animation speed in seconds, depending on power draw | +| hide_soc: | Optional | `false` | If set to `true` the current program capacity (soc), or for Goodwe inverters the shutdown soc and offgrid shutdown soc that is shown to the left of the current battery SOC will be hidden. | +| show_remaining_energy: | Optional | `true` | Set to `true` to display the remaining battery energy in kWh based on the current SOC. Only visible on the `lite` and `full` cards | +| max_power: | Optional | `4500` | Maximum power draw to calculate animation speed. Numeric value or sensor i.e. `number.battery_maximum_discharging_power` | +| path_threshold: | Optional | `100` | Specify threshold to apply dynamic colour to the battery path element. The colour of the path will change to the source colour if the percentage supply by a single source equals or exceeds this value | +| Battery Entities | [Sub-menu](#battery-entities) | | Shows sub-menu with Battery Entities | +| Battery Banks Options | [Sub-menu](#battery-banks-options) | | Shows sub-menu with Battery Bank Options | +| Battery Bank 1 Entities | [Sub-menu](#battery-bank-1-entities) | | Shows sub-menu with Battery Bank 1 Entities | +| Battery Bank 2 Entities | [Sub-menu](#battery-bank-2-entities) | | Shows sub-menu with Battery Bank 2 Entities | +| Battery Bank 3 Entities | [Sub-menu](#battery-bank-3-entities) | | Shows sub-menu with Battery Bank 3 Entities | +| Battery Bank 4 Entities | [Sub-menu](#battery-bank-4-entities) | | Shows sub-menu with Battery Bank 4 Entities | + +### Battery: Entities + +| Attribute | Requirement | Default | Description | +|----------------------------|--------------|------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| battery_power_190: | **Required** | `sensor.sunsynk_battery_power` | Battery power (W). Requires a negative number for battery charging and a positive number for battery discharging. Set the `invert_power:` battery attribute to `yes` if your sensor reports this the other way around | +| battery_soc_184: | **Required** | `sensor.sunsynk_battery_soc` | Battery state of charge (%) | +| battery_current_191: | **Required** | `sensor.sunsynk_battery_current` | Battery current (A) | +| battery_voltage_183: | Optional | `sensor.sunsynk_battery_voltage` | Battery voltage (V) | +| battery_temp_182: | Optional | `sensor.sunsynk_battery_temperature` | Battery temperature (°). Note do not define this sensor if you want to display battery SOH. See below. | +| day_battery_discharge_71: | Optional | `sensor.sunsynk_day_battery_discharge` | Daily battery usage (kWh) | +| day_battery_charge_70: | Optional | `sensor.sunsynk_day_battery_charge` | Daily battery charge (kWh) | +| battery_remaining_storage | Optional | | Battery remaining capacity. If set it is displayed instead of calculated value | +| battery_rated_capacity: | Optional | | Battery rated capacity (Ah). If provided this sensor will be used to calculate battery energy. The`energy` attribute under the battery card configuration will be ignored. | +| battery_soh: | Optional | | Battery State of Health (SOH) (%). You can chose to display either battery temperature or battery SOH but not both. They are displayed in the same place on the card. If `battery_temp_182:` is defined it will take priority and this sensor will not be displayed. | +| battery_status: | Optional | `sensor.battery_mode_code` | Used only when inverter model is set to `goodwe`, `goodwe_gridmode` or `huawei`. Battery status `0, 1, 2, 3, 4` | +| battery_current_direction: | Optional | `sensor.solis_battery_current_direction` | Used only when inverter model is set to `solis` (`0`, `1`) | + +### Battery Banks Options + +| Attribute | Requirement | Default | Description | +|--------------------------|-------------|---------|------------------------------------------------------------------------| +| show_battery_banks: | Optional | | Toggle display battery banks details | +| battery_banks_view_mode: | Optional | | Choose battery bank view mode: none, inner | +| battery_banks: | Optional | | Specify the number of Battery Banks's in use `0`, `1`, `2`, `3` or `4` | +| battery_bank_1_energy: | Optional | | Specify Battery Bank 1 Max Available Energy | +| battery_bank_2_energy: | Optional | | Specify Battery Bank 2 Max Available Energy | +| battery_bank_3_energy: | Optional | | Specify Battery Bank 3 Max Available Energy | +| battery_bank_4_energy: | Optional | | Specify Battery Bank 4 Max Available Energy | + +### Battery Bank 1 Entities + +| Attribute | Requirement | Default | Description | +|-----------------------------------|-------------|---------|------------------------------------------| +| battery_bank_1_power: | Optional | | Specify Battery Bank 1 Power | +| battery_bank_1_voltage: | Optional | | Specify Battery Bank 1 Voltage | +| battery_bank_1_current: | Optional | | Specify Battery Bank 1 Current | +| battery_bank_1_delta: | Optional | | Specify Battery Bank 1 Delta | +| battery_bank_1_remaining_storage: | Optional | | Specify Battery Bank 1 Remaining Storage | +| battery_bank_1_soc: | Optional | | Specify Battery Bank 1 SOC | + +### Battery Bank 2 Entities + +| Attribute | Requirement | Default | Description | +|-----------------------------------|-------------|---------|------------------------------------------| +| battery_bank_2_power: | Optional | | Specify Battery Bank 2 Power | +| battery_bank_2_voltage: | Optional | | Specify Battery Bank 2 Voltage | +| battery_bank_2_current: | Optional | | Specify Battery Bank 2 Current | +| battery_bank_2_delta: | Optional | | Specify Battery Bank 2 Delta | +| battery_bank_2_remaining_storage: | Optional | | Specify Battery Bank 2 Remaining Storage | +| battery_bank_2_soc: | Optional | | Specify Battery Bank 2 SOC | + +### Battery Bank 3 Entities + +| Attribute | Requirement | Default | Description | +|-----------------------------------|-------------|---------|------------------------------------------| +| battery_bank_3_power: | Optional | | Specify Battery Bank 3 Power | +| battery_bank_3_voltage: | Optional | | Specify Battery Bank 3 Voltage | +| battery_bank_3_current: | Optional | | Specify Battery Bank 3 Current | +| battery_bank_3_delta: | Optional | | Specify Battery Bank 3 Delta | +| battery_bank_3_remaining_storage: | Optional | | Specify Battery Bank 3 Remaining Storage | +| battery_bank_3_soc: | Optional | | Specify Battery Bank 3 SOC | + +### Battery Bank 4 Entities + +| Attribute | Requirement | Default | Description | +|-----------------------------------|-------------|---------|------------------------------------------| +| battery_bank_4_power: | Optional | | Specify Battery Bank 4 Power | +| battery_bank_4_voltage: | Optional | | Specify Battery Bank 4 Voltage | +| battery_bank_4_current: | Optional | | Specify Battery Bank 4 Current | +| battery_bank_4_delta: | Optional | | Specify Battery Bank 4 Delta | +| battery_bank_4_remaining_storage: | Optional | | Specify Battery Bank 4 Remaining Storage | +| battery_bank_4_soc: | Optional | | Specify Battery Bank 4 SOC | ## Load -| Attribute | Requirement | Default | Description | -|-------------------|------------------------------------|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| show_daily: | Optional | `false` | Toggles the daily total. | -| auto_scale: | Optional | `true` | If set to `true` the card will use the entities `unit_of_measurement` attribute to perform the correct scaling (i,e, power values greater than 999W will be displayed as kW e.g. 1.23kW) and display the correct unit. The number of decimal places can be changed using the `decimal_places` card attribute apart from the daily energy values which are set using the `decimal_places_energy` attribute | -| colour: | Optional | `'#5fb6ad'` | Sets the colour of all the load card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | -| dynamic_colour: | Optional | `true` | The essential icon colour will change based on the % contribution of the power source (battery, grid, solar) supplying the load. Set to `false` to disable | -| dynamic_icon: | Optional | `true` | The essential icon will change when there is 100% contribution from a single power source (battery, grid, solar). Set to `false` to disable | -| invert_load: | Optional | `false` | Set to `true` if your sensor provides a negative number when the load is drawing power | -| essential_name: | Optional | `Essential` | Set the display name for the essential load | -| additional_loads: | Optional | `0` | Display additional loads on the essential side (`0-8`). | -| animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on Power draw | -| max_power: | Optional | `8000` | Maximum power draw to calculate animation speed. Numeric value or sensor | -| off_threshold: | Optional | `0` | When power falls below this value the load will be considered off and colour will change to grey. Requires `dynamic_colour` to be enabled. Can also be set to `-1` to disable. | -| path_threshold: | Optional | `100` | Specify threshold to apply dynamic colour to the load path element. The colour of the path will change to the source colour if the percentage supply by a single source equals or exceeds this value | -| additional_load | [Sub-menu](#load-additional-load) | | Shows sub-menu with Additional Load details | -| aux | [Sub-menu](#load-aux) | | Shows sub-menu with Auxiliary Load details | - -### Load: Additional Load +| Attribute | Requirement | Default | Description | +|--------------------------------|--------------------------------------------|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| show_daily: | Optional | `false` | Toggles the daily total. | +| auto_scale: | Optional | `true` | If set to `true` the card will use the entities `unit_of_measurement` attribute to perform the correct scaling (i,e, power values greater than 999W will be displayed as kW e.g. 1.23kW) and display the correct unit. The number of decimal places can be changed using the `decimal_places` card attribute apart from the daily energy values which are set using the `decimal_places_energy` attribute | +| colour: | Optional | `'#5fb6ad'` | Sets the colour of all the load card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc) | +| dynamic_colour: | Optional | `true` | The essential icon colour will change based on the % contribution of the power source (battery, grid, solar) supplying the load. Set to `false` to disable | +| dynamic_icon: | Optional | `true` | The essential icon will change when there is 100% contribution from a single power source (battery, grid, solar). Set to `false` to disable | +| invert_load: | Optional | `false` | Set to `true` if your sensor provides a negative number when the load is drawing power | +| essential_name: | Optional | `Essential` | Set the display name for the essential load | +| additional_loads: | Optional | `0` | Display additional loads on the essential side (`0-8`). | +| animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on Power draw | +| max_power: | Optional | `8000` | Maximum power draw to calculate animation speed. Numeric value or sensor | +| off_threshold: | Optional | `0` | When power falls below this value the load will be considered off and colour will change to grey. Requires `dynamic_colour` to be enabled. Can also be set to `-1` to disable. | +| path_threshold: | Optional | `100` | Specify threshold to apply dynamic colour to the load path element. The colour of the path will change to the source colour if the percentage supply by a single source equals or exceeds this value | +| Load Entities | [Sub-menu](#load-entities) | | Shows sub-menu with Load Entities | +| Additional Load 1-8 Options | [Sub-menu](#load-additional-load-options) | | Shows sub-menu with Additional Load 1-8 options | +| Additional Load 1-8 Entities | [Sub-menu](#load-additional-load-entities) | | Shows sub-menu with Essential Load 1-8 Entities | +| Additional Load 9-13 Options | [Sub-menu](#load-additional-load-options) | | Shows sub-menu with Additional Load 9-13 options | +| Additional Load 9-13 Entities | [Sub-menu](#load-additional-load-entities) | | Shows sub-menu with Essential Load 9-13 Entities | +| Additional Load 14-18 Options | [Sub-menu](#load-additional-load-options) | | Shows sub-menu with Additional Load 14-18 options | +| Additional Load 14-18 Entities | [Sub-menu](#load-additional-load-entities) | | Shows sub-menu with Essential Load 14-18 Entities | +| Additional Load 19-23 Options | [Sub-menu](#load-additional-load-options) | | Shows sub-menu with Additional Load 19-23 options | +| Additional Load 19-23 Entities | [Sub-menu](#load-additional-load-entities) | | Shows sub-menu with Essential Load 19-23 Entities | +| aux | [Sub-menu](#load-aux) | | Shows sub-menu with Auxiliary Load details | + + +### Load Entities + +| Attribute | Requirement | Default | Description | +|-------------------------|-------------------------------------------|----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------| +| day_load_energy_84: | Optional | `sensor.sunsynk_day_load_energy` | Daily load (kWh) | +| day_aux_energy: | Optional | | Sensor that provides the daily AUX energy (kWh) | +| essential_power: | Optional | `none` | Sensor that provides Essential Load power (W). Check [Essential Power Calculation](#essential-power-calculation) if entity not provided or `none` | +| load_power_L1: | Optional | | Load L1 Power (W) | +| load_power_L2: | Optional | | Load L2 Power (W) | +| load_power_L3: | Optional | | Load L3 Power (W) | +| aux_power_166: | Optional | `sensor.sunsynk_aux_power` | Auxiliary power (W) | +| aux_load1: | Optional | | Sensor that contains the power of your AUX load 1 (W) | +| aux_load1_extra: | Optional | | Sensor that contains additional information you want displayed for your aux load 1 e.g. Daily kWh, Temperature etc. | +| aux_load1_toggle: | Optional | | Sensor that contains link to entity that will show up wheaux load 1 icon clicked | +| aux_load2: | Optional | | Sensor that contains the power of your AUX load 2 (W) | +| aux_load2_extra: | Optional | | Sensor that contains additional information you want displayed for your aux load 2 e.g. Daily kWh, Temperature etc | +| aux_load2_toggle: | Optional | | Sensor that contains link to entity that will show up when aux load 2 icon clicked | + +### Load: Additional Load Options | Attribute | Requirement | Default | Description | |--------------|-------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------| @@ -176,6 +398,22 @@ The `invert_power` attribute can be used to reverse direction if needed by your | load23_name: | Optional | | Set the display name for the essential load 23 | | load23_icon: | Optional | none | Set the essential load 23 image using preset or any mdi icon. Check [icon](#icons) for details.
Notice: Item 7,8,9,14,29 are visible only when show_aux is `false`. | + +#### Load: Additional load entities + +| Attribute | Requirement | Default | Description | +|--------------------------|-------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| essential_load1: | Optional | | Sensor that contains the power of your essential load 1 (W). Can also be used to display any sensor data i.e. temp, energy etc if `auto_scale: false`. If not present toggle state will be used instead. | +| essential_load1_extra: | Optional | | Sensor that contains additional information you want displayed for your essential load 1 e.g. Daily kWh, Temperature etc | +| essential_load1_toggle: | Optional | | Sensor that contains link to entity that will show up when essential load 1 icon clicked | +| essential_load2: | Optional | | Sensor that contains the power of your essential load 2 (W). Can also be used to display any sensor data i.e. temp, energy etc if `auto_scale: false`. If not present toggle state will be used instead. | +| essential_load2_extra: | Optional | | Sensor that contains additional information you want displayed for your essential load 2 e.g. Daily kWh, Temperature etc | +| essential_load2_toggle: | Optional | | Sensor that contains link to entity that will show up when essential load 2 icon clicked | +| ... | | | | +| essential_load23: | Optional | | Sensor that contains the power of your essential load 23 (W). Can also be used to display any sensor data i.e. temp, energy etc if `auto_scale: false`. If not present toggle state will be used instead. | +| essential_load23_extra: | Optional | | Sensor that contains additional information you want displayed for your essential load 23 e.g. Daily kWh, Temperature etc | +| essential_load23_toggle: | Optional | | Sensor that contains link to entity that will show up when essential load 23 icon clicked | + ### Load: aux | Attribute | Requirement | Default | Description | @@ -198,186 +436,44 @@ The `invert_power` attribute can be used to reverse direction if needed by your ## Grid -| Attribute | Requirement | Default | Description | -|------------------------|-------------|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| grid_name: | Optional | | Set the display name for the grid | -| max_power: | Optional | `8000` | Maximum power draw to calculate animation speed. Numeric value or sensor | -| show_daily_buy: | Optional | `false` | Toggles the daily buy total | -| label_daily_grid_buy: | Optional | | Set custom text for the "DAILY GRID BUY" label that is displayed. | -| show_daily_sell: | Optional | `false` | Toggles the daily sell total | -| label_daily_grid_sell: | Optional | | Set custom test for the "DAILY GRID SELL" label that is displayed. | -| auto_scale: | Optional | `true` | If set to `true` the card will use the entities `unit_of_measurement` attribute to perform the correct scaling (i,e, power values greater than 999W will be displayed as kW e.g. 1.23kW) and display the correct unit. The number of decimal places can be changed using the `decimal_places` card attribute apart from the daily energy values which are set using the `decimal_places_energy` attribute | -| invert_grid: | Optional | `false` | Set to `true` if your sensor provides a negative number for grid import and positive number for grid export | -| show_absolute: | Optional | `false` | set to `true` to display power as absolute | -| colour: | Optional | `'#5490c2'` | Sets the colour of all the grid card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc). | -| no_grid_colour: | Optional | | Sets the colour of all the grid card objects when there is no grid power. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc). If not set will use the `colour:` value defined above total | -| export_colour: | Optional | | Sets the colour of all the grid card objects when exporting (selling) energy. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc). If not set will use the `colour:` value defined above. | -| grid_off_colour: | Optional | | Sets the colour of the grid icon when the grid is disconnected. | | -| energy_cost_decimals: | Optional | `2` | Sets the number of decimal places to display the buy and sell energy costs | -| animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on power draw | -| off_threshold: | Optional | `0` | When power falls below this value the load will be considered off and colour will change to grey. Requires `dynamic_colour` to be enabled. Can also be set to `-1` to disable. | -| import_icon: | Optional | | Set the grid connected/import image using any mdi icon e.g. `mdi:transmission-tower-import`. You can also provide a sensor that returns the mdi icon. If defined overrides the card default icon. | -| export_icon: | Optional | | Set the grid export image using any mdi icon e.g. `mdi:transmission-tower-export`. You can also provide a sensor that returns the mdi icon. If defined overrides the card default icon. | -| disconnected_icon: | Optional | | Set the grid disconnected image using any mdi icon e.g. `mdi:transmission-tower-off`. You can also provide a sensor that returns the mdi icon. If defined overrides the card default icon. | -| show_nonessential: | Optional | `true` | Toggles the display of non-essential | -| additional_loads: | Optional | `0` | Toggle the display of additional loads on the non-essential side (`0/1/2/3`) The third load will only be displayed if the inverter timer schedules are not used due to limited space. Set the battery attribute `hide_soc: true` to display | -| nonessential_icon: | Optional | `default` | Change the non-essential image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are:
`default` `oven`, `boiler`

`pump`, `aircon`
| -| nonessential_name: | Optional | `Non Essential` | Set the display name for the non-essential load | -| load1_name: | Optional | | Set the display name for the non-essential load 1 | -| load1_icon: | Optional | `default` | Change the non-essential load 1 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` You can also provide a sensor that returns the mdi icon. | -| load2_name: | Optional | | Set the display name for the non-essential load 2 | -| load2_icon: | Optional | `default` | Change the non-essential load 2 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` You can also provide a sensor that returns the mdi icon. | -| load3_name: | Optional | | Set the display name for the non-essential load 3 | -| load3_icon: | Optional | none | Change the non-essential load 3 image using any mdi icon e.g. `mdi:ev-station`. You can also provide a sensor that returns the mdi icon. | - -## Entities - -Entity attributes below have been appended with the modbus register # e.g. `pv2_power_187` to indicate which Sunsynk -register should be read when configuring your sensors. Replace the default sensors with your own specific sensor names. -It is important that your sensors read the expected modbus register value. If you have missing sensors for any attribute -set it to none i.e. `day_pv_energy_108: none`. This will hide the sensor data from the card. To display a placeholder -with a default value of 0 set it to `zero` or any other value i.e. `solarday_108: zero`. - -See the [WIKI](https://github.com/molikk/mlk-power-flow-card/wiki/Sensor-Mappings) for more information on sensor -mappings if using other integration methods. - -| Sub-menu | Default | Description | -|-------------------|--------------------------------------------------------------|--------------------------| -| Solar Entities | See [Solar Entities](#solar-entities) attributes below | List of solar entities | -| Battery Entities | See [Battery Entities](#battery-entities) attributes below | List of battery entities | -| Inverter Entities | See [Inverter Entities](#inverter-entities) attributes below | List of battery entities | -| Load Entities | See [Load Entities](#load-entities) attributes below | List of load entities | -| Grid Entities | See [Grid Entities](#grid-entities) attributes below | List of grid entities | - -### Solar entities - -| Attribute | Requirement | Default | Description | -|------------------------|-------------|--------------------------------|--------------------------------------------------------------------------------------------------------------------------------| -| pv_total: | Optional | | Provide a sensor for total pv power. If omitted the card uses internal logic to calculate this based on the pv1-5 power (W) | -| day_pv_energy_108: | Optional | `sensor.sunsynk_day_pv_energy` | Daily solar generation (kWh) | -| monthly_pv_generation: | Optional | | Monthly solar generation (kWh) | -| yearly_pv_generation: | Optional | | Yearly solar generation (kWh) | -| total_pv_generation: | Optional | | Total Solar generation | -| remaining_solar: | Optional | | The remaining solar forecast for the day (kWh). | -| tomorrow_solar: | Optional | | Solar forecast for tomorrow (kWh). | -| pv1_power_186: | Optional | `sensor.sunsynk_pv1_power` | PV string 1 power (W) | -| pv1_production: | Optional | | PV string 1 daily energy (kWh) | -| pv1_voltage_109: | Optional | `sensor.sunsynk_pv1_voltage` | PV string 1 voltage (V) | -| pv1_current_110: | Optional | `sensor.sunsynk_pv1_current` | PV string 1 current (A) | -| pv2_power_187: | Optional | `sensor.sunsynk_pv2_power` | PV string 2 power (W) | -| pv2_production: | Optional | | PV string 2 daily energy (kWh) | -| pv2_voltage_111: | Optional | `sensor.sunsynk_pv2_voltage` | PV string 2 voltage (V) | -| pv2_current_112: | Optional | `sensor.sunsynk_pv2_current` | PV string 2 current (A) | -| pv3_power_188: | Optional | | PV string 3 power (W) | -| pv3_production: | Optional | | PV string 3 daily energy (kWh) | -| pv3_voltage_113: | Optional | | PV string 3 voltage (V) | -| pv3_current_114: | Optional | | PV string 3 current (A) | -| pv4_power_189: | Optional | | PV string 4 power (W) | -| pv4_production: | Optional | | PV string 4 daily energy (kWh) | -| pv4_voltage_115: | Optional | | PV string 4 voltage (V) | -| pv4_current_116: | Optional | | PV string 4 current (A) | -| pv5_power_189: | Optional | | PV string 5 power (W) | -| pv5_production: | Optional | | PV string 5 daily energy (kWh) | -| pv5_voltage_115: | Optional | | PV string 5 voltage (V) | -| pv5_current_116: | Optional | | PV string 5 current (A) | -| solar_sell_247: | Optional | | Displays icons to indicate if sell solar is active or not. The switch can be toggled by clicking on the icon (`on/off`, `1/0`) | -| environment_temp: | Optional | | Display outside temperature or other environment temperature below the sun icon | - -### Battery Entities -| Attribute | Requirement | Default | Description | -|-----------------------------|--------------|------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| battery_power_190: | **Required** | `sensor.sunsynk_battery_power` | Battery power (W). Requires a negative number for battery charging and a positive number for battery discharging. Set the `invert_power:` battery attribute to `yes` if your sensor reports this the other way around | -| battery_soc_184: | **Required** | `sensor.sunsynk_battery_soc` | Battery state of charge (%) | -| battery_current_191: | **Required** | `sensor.sunsynk_battery_current` | Battery current (A) | -| battery_voltage_183: | Optional | `sensor.sunsynk_battery_voltage` | Battery voltage (V) | -| battery_temp_182: | Optional | `sensor.sunsynk_battery_temperature` | Battery temperature (°). Note do not define this sensor if you want to display battery SOH. See below. | -| day_battery_discharge_71: | Optional | `sensor.sunsynk_day_battery_discharge` | Daily battery usage (kWh) | -| day_battery_charge_70: | Optional | `sensor.sunsynk_day_battery_charge` | Daily battery charge (kWh) | -| battery_remaining_storage | Optional | | Battery remaining capacity. If set it is displayed instead of calculated value | -| battery_rated_capacity: | Optional | | Battery rated capacity (Ah). If provided this sensor will be used to calculate battery energy. The`energy` attribute under the battery card configuration will be ignored. | -| battery_soh: | Optional | | Battery State of Health (SOH) (%). You can chose to display either battery temperature or battery SOH but not both. They are displayed in the same place on the card. If `battery_temp_182:` is defined it will take priority and this sensor will not be displayed. | -| battery_status: | Optional | `sensor.battery_mode_code` | Used only when inverter model is set to `goodwe`, `goodwe_gridmode` or `huawei`. Battery status `0, 1, 2, 3, 4` | -| battery_current_direction: | Optional | `sensor.solis_battery_current_direction` | Used only when inverter model is set to `solis` (`0`, `1`) | - -### Inverter Entities - -| Attribute | Requirement | Default | Description | -|---------------------------|-----------------------------------------|---------------------------------------------|----------------------------------------------------------------------------------------------------------------------------| -| inverter_status_59: | Optional | `sensor.sunsynk_overall_state` | Expects a sensor that contains inverter status represented as a string or number. See [Inverter status](#inverter-status) | -| inverter_voltage_154: | Optional | `sensor.sunsynk_inverter_voltage` | Inverter L1 voltage (V) | -| inverter_voltage_L2: | Optional | | Inverter L2 voltage (V) | -| inverter_voltage_L3: | Optional | | Inverter L3 voltage (V) | -| load_frequency_192: | Optional | `sensor.sunsynk_load_frequency` | Load frequency (Hz) | -| inverter_current_164: | Optional | `sensor.sunsynk_inverter_current` | Inverter L1 current (A) | -| inverter_current_L2: | Optional | | Inverter L2 current (A) | -| inverter_current_L3: | Optional | | Inverter L3 current (A) | -| inverter_power_175: | Optional | `sensor.sunsynk_inverter_power` | Inverter power (W). | -| grid_power_169: | Optional | | Inverters grid power | -| dc_transformer_temp_90: | Optional | `sensor.sunsynk_dc_transformer_temperature` | Inverter DC temperature (℃) | -| radiator_temp_91: | Optional | `sensor.sunsynk_radiator_temperature` | Inverter AC temperature (℃) | -| inverter_load_percentage: | Optional | | Inverter Load in Percents (0-100 range). If enabled visualize load on Inverter image | -| use_timer_248: | Optional | `switch.sunsynk_toggle_system_timer` | Displays "Use timer" status as an icon next to the inverter. Set to `no` to hide | -| priority_load_243: | Optional | `switch.sunsynk_toggle_priority_load` | Shows if energy pattern is set to priority load or priority battery as an icon next to the inverter. Set to `no` to hide | -| Programs Entities: | [Sub-menu](#inverter-programs-entities) | | Shows sub-menu with Programs Entities | - -#### Inverter: Programs Entities - -| Attribute | Requirement | Default | Description | -|-------------------------|-------------|------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| prog1_time: | Optional | `sensor.sunsynk_time_slot_1` | Program 1 start time (`HH:MM`) | -| prog1_capacity: | Optional | `number.sunsynk_system_mode_soc_time1` | Program 1 capacity (SOC) setting | -| prog1_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time1` | Program 1 charge options (`on/off`, `1/0`, `No Grid or Gen`) | -| prog2_time: | Optional | `sensor.sunsynk_time_slot_2` | Program 2 start time (`HH:MM`) | -| prog2_capacity: | Optional | `number.sunsynk_system_mode_soc_time2` | Program 2 capacity (SOC) setting | -| prog2_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time2` | Program 2 charge options (`on/off`, `1/0`, `No Grid or Gen`) | -| prog3_time: | Optional | `sensor.sunsynk_time_slot_3` | Program 3 start time (`HH:MM`) | -| prog3_capacity: | Optional | `number.sunsynk_system_mode_soc_time3` | Program 3 capacity (SOC) setting | -| prog3_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time3` | Program 3 charge options (`on/off`, `1/0`, `No Grid or Gen`) | -| prog4_time: | Optional | `sensor.sunsynk_time_slot_4` | Program 4 start time (`HH:MM`) | -| prog4_capacity: | Optional | `number.sunsynk_system_mode_soc_time4` | Program 4 capacity (SOC) setting | -| prog4_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time4` | Program 4 charge options (`on/off`, `1/0`, `No Grid or Gen`) | -| prog5_time: | Optional | `sensor.sunsynk_time_slot_5` | Program 5 start time (`HH:MM`) | -| prog5_capacity: | Optional | `number.sunsynk_system_mode_soc_time5` | Program 5 capacity (SOC) setting | -| prog5_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time5` | Program 5 charge options (`on/off`, `1/0`, `No Grid or Gen`) | -| prog6_time: | Optional | `sensor.sunsynk_time_slot_6` | Program 6 start time (`HH:MM`) | -| prog6_capacity: | Optional | `number.sunsynk_system_mode_soc_time6` | Program 6 capacity (SOC) setting | -| prog6_charge: | Optional | `switch.sunsynk_system_mode_grid_charge_time6` | Program 6 charge options (`on/off`, `1/0`, `No Grid or Gen`) | - -### Load Entities - -| Attribute | Requirement | Default | Description | -|--------------------------|--------------------------------------------|----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| day_load_energy_84: | Optional | `sensor.sunsynk_day_load_energy` | Daily load (kWh) | -| day_aux_energy: | Optional | | Sensor that provides the daily AUX energy (kWh) | -| essential_power: | Optional | `none` | Sensor that provides Essential Load power (W). Check [Essential Power Calculation](#essential-power-calculation) if entity not provided or `none` | -| load_power_L1: | Optional | | Load L1 Power (W) | -| load_power_L2: | Optional | | Load L2 Power (W) | -| load_power_L3: | Optional | | Load L3 Power (W) | -| aux_power_166: | Optional | `sensor.sunsynk_aux_power` | Auxiliary power (W) | -| aux_load1: | Optional | | Sensor that contains the power of your AUX load 1 (W) | -| aux_load1_extra: | Optional | | Sensor that contains additional information you want displayed for your aux load 1 e.g. Daily kWh, Temperature etc. | -| aux_load1_toggle: | Optional | | Sensor that contains link to entity that will show up wheaux load 1 icon clicked | -| aux_load2: | Optional | | Sensor that contains the power of your AUX load 2 (W) | -| aux_load2_extra: | Optional | | Sensor that contains additional information you want displayed for your aux load 2 e.g. Daily kWh, Temperature etc | -| aux_load2_toggle: | Optional | | Sensor that contains link to entity that will show up when aux load 2 icon clicked | -| Essential Load Entities | [Sub-menu](#load-essential-load-entities) | | Shows sub-menu with Essential Load Entities | - -#### Load: essential load entities -| Attribute | Requirement | Default | Description | -|--------------------------|-------------|----------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| essential_load1: | Optional | | Sensor that contains the power of your essential load 1 (W). Can also be used to display any sensor data i.e. temp, energy etc if `auto_scale: false`. If not present toggle state will be used instead. | -| essential_load1_extra: | Optional | | Sensor that contains additional information you want displayed for your essential load 1 e.g. Daily kWh, Temperature etc | -| essential_load1_toggle: | Optional | | Sensor that contains link to entity that will show up when essential load 1 icon clicked | -| essential_load2: | Optional | | Sensor that contains the power of your essential load 2 (W). Can also be used to display any sensor data i.e. temp, energy etc if `auto_scale: false`. If not present toggle state will be used instead. | -| essential_load2_extra: | Optional | | Sensor that contains additional information you want displayed for your essential load 2 e.g. Daily kWh, Temperature etc | -| essential_load2_toggle: | Optional | | Sensor that contains link to entity that will show up when essential load 2 icon clicked | -| ... | | | | -| essential_load23: | Optional | | Sensor that contains the power of your essential load 23 (W). Can also be used to display any sensor data i.e. temp, energy etc if `auto_scale: false`. If not present toggle state will be used instead. | -| essential_load23_extra: | Optional | | Sensor that contains additional information you want displayed for your essential load 23 e.g. Daily kWh, Temperature etc | -| essential_load23_toggle: | Optional | | Sensor that contains link to entity that will show up when essential load 23 icon clicked | +| Attribute | Requirement | Default | Description | +|-----------------------------|-----------------------------------------------|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| grid_name: | Optional | | Set the display name for the grid | +| max_power: | Optional | `8000` | Maximum power draw to calculate animation speed. Numeric value or sensor | +| show_daily_buy: | Optional | `false` | Toggles the daily buy total | +| label_daily_grid_buy: | Optional | | Set custom text for the "DAILY GRID BUY" label that is displayed. | +| show_daily_sell: | Optional | `false` | Toggles the daily sell total | +| label_daily_grid_sell: | Optional | | Set custom test for the "DAILY GRID SELL" label that is displayed. | +| auto_scale: | Optional | `true` | If set to `true` the card will use the entities `unit_of_measurement` attribute to perform the correct scaling (i,e, power values greater than 999W will be displayed as kW e.g. 1.23kW) and display the correct unit. The number of decimal places can be changed using the `decimal_places` card attribute apart from the daily energy values which are set using the `decimal_places_energy` attribute | +| invert_grid: | Optional | `false` | Set to `true` if your sensor provides a negative number for grid import and positive number for grid export | +| show_absolute: | Optional | `false` | set to `true` to display power as absolute | +| colour: | Optional | `'#5490c2'` | Sets the colour of all the grid card objects. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc). | +| no_grid_colour: | Optional | | Sets the colour of all the grid card objects when there is no grid power. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc). If not set will use the `colour:` value defined above total | +| export_colour: | Optional | | Sets the colour of all the grid card objects when exporting (selling) energy. Hex codes (`'#66ff00'` etc) or names (`red`, `green`, `blue` etc). If not set will use the `colour:` value defined above. | +| grid_off_colour: | Optional | | Sets the colour of the grid icon when the grid is disconnected. | | +| energy_cost_decimals: | Optional | `2` | Sets the number of decimal places to display the buy and sell energy costs | +| animation_speed: | Optional | `8` | Set slowest animation speed in seconds, depending on power draw | +| off_threshold: | Optional | `0` | When power falls below this value the load will be considered off and colour will change to grey. Requires `dynamic_colour` to be enabled. Can also be set to `-1` to disable. | +| import_icon: | Optional | | Set the grid connected/import image using any mdi icon e.g. `mdi:transmission-tower-import`. You can also provide a sensor that returns the mdi icon. If defined overrides the card default icon. | +| export_icon: | Optional | | Set the grid export image using any mdi icon e.g. `mdi:transmission-tower-export`. You can also provide a sensor that returns the mdi icon. If defined overrides the card default icon. | +| disconnected_icon: | Optional | | Set the grid disconnected image using any mdi icon e.g. `mdi:transmission-tower-off`. You can also provide a sensor that returns the mdi icon. If defined overrides the card default icon. | +| show_nonessential: | Optional | `true` | Toggles the display of non-essential | +| additional_loads: | Optional | `0` | Toggle the display of additional loads on the non-essential side (`0/1/2/3`) The third load will only be displayed if the inverter timer schedules are not used due to limited space. Set the battery attribute `hide_soc: true` to display | +| nonessential_icon: | Optional | `default` | Change the non-essential image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are:
`default` `oven`, `boiler`

`pump`, `aircon`
| +| nonessential_name: | Optional | `Non Essential` | Set the display name for the non-essential load | +| load1_name: | Optional | | Set the display name for the non-essential load 1 | +| load1_icon: | Optional | `default` | Change the non-essential load 1 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` You can also provide a sensor that returns the mdi icon. | +| load2_name: | Optional | | Set the display name for the non-essential load 2 | +| load2_icon: | Optional | `default` | Change the non-essential load 2 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` You can also provide a sensor that returns the mdi icon. | +| load3_name: | Optional | | Set the display name for the non-essential load 3 | +| load3_icon: | Optional | none | Change the non-essential load 3 image using any mdi icon e.g. `mdi:ev-station`. You can also provide a sensor that returns the mdi icon. | +| Grid Entities | [Sub-menu](#grid-entities) | | Shows sub-menu with Grid Entities | +| Non-Essential Load Options | [Sub-menu](#Grid-Non-Essential-load-options) | | Shows sub-menu with Non-Essential Load Options | +| Non-Essential Load Entities | [Sub-menu](#Grid-Non-Essential-load-entities) | | Shows sub-menu with Non-Essential Load Entities | ### Grid Entities + | Attribute | Requirement | Default | Description | |-----------------------------|--------------|-----------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | day_grid_import_76: | Optional | `sensor.sunsynk_day_grid_import` | Daily grid import (kWh) | @@ -394,6 +490,32 @@ mappings if using other integration methods. | grid_current_L3: | Optional | | Grid Current L3 (A) | | grid_ct_power_total: | Optional | | For three phase systems. The card will automatically calculate this based on (Grid CT L1 power + Grid CT L2 power + Grid CT L3 power) You can optionally provide your own sensor for total grid power. (W) | | grid_voltage: | Optional | `sensor.solis_grid_voltage` | Sensor providing grid voltage (v). Used only when inverter model is set to `solis` | +| grid_connected_status_194: | Optional | `binary_sensor.sunsynk_grid_connected_status` | Grid connected status (case insensitive) `on/off`,`1/0`, `On-Grid/Off-Grid`, or `On Grid/Off Grid` | +| energy_cost_buy: | Optional | | Sensor that provides current buy energy cost per kWh | +| energy_cost_sell: | Optional | | Sensor that provides current sell energy cost per kWh | +| prepaid_units: | Optional | | Account balance of prepaid electricity units | +| max_sell_power: | Optional | `number.sunsynk_max_sell_power` | Sets the maximum allowed output power to flow to the grid. Also known as "Export Control User Limit" (W) | + + +## Grid: Non-Essential Load Options + +| Attribute | Requirement | Default | Description | +|-----------------------------|-----------------------------------------------|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| show_nonessential: | Optional | `true` | Toggles the display of non-essential | +| additional_loads: | Optional | `0` | Toggle the display of additional loads on the non-essential side (`0/1/2/3`) The third load will only be displayed if the inverter timer schedules are not used due to limited space. Set the battery attribute `hide_soc: true` to display | +| nonessential_icon: | Optional | `default` | Change the non-essential image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are:
`default` `oven`, `boiler`

`pump`, `aircon`
| +| nonessential_name: | Optional | `Non Essential` | Set the display name for the non-essential load | +| load1_name: | Optional | | Set the display name for the non-essential load 1 | +| load1_icon: | Optional | `default` | Change the non-essential load 1 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` You can also provide a sensor that returns the mdi icon. | +| load2_name: | Optional | | Set the display name for the non-essential load 2 | +| load2_icon: | Optional | `default` | Change the non-essential load 2 image using presets or any mdi icon e.g. `mdi:ev-station`. Presets are: `default`, `oven`, `boiler`, `pump`, `aircon` You can also provide a sensor that returns the mdi icon. | +| load3_name: | Optional | | Set the display name for the non-essential load 3 | +| load3_icon: | Optional | none | Change the non-essential load 3 image using any mdi icon e.g. `mdi:ev-station`. You can also provide a sensor that returns the mdi icon. | + +### Grid: Non-Essential Load Entities + +| Attribute | Requirement | Default | Description | +|-----------------------------|--------------|-----------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | nonessential_power | Optional | `none` | Sensor that provides Essential Load power (W). Check [Nonessential Power Calculation](#nonessential-power-calculation) if entity not provided or `none` | | non_essential_load1: | Optional | | Sensor that contains the power of your non-essential load 1 (W). If not present toggle state will be used instead. | | non_essential_load1_extra: | Optional | | Sensor that contains additional information you want displayed for your nonessential load 1 e.g. Daily kWh, Temperature etc | @@ -404,12 +526,18 @@ mappings if using other integration methods. | non_essential_load3: | Optional | | Sensor that contains the power of your non-essential load 3 (W). If not present toggle state will be used instead. | | non_essential_load3_extra: | Optional | | Sensor that contains additional information you want displayed for your nonessential load 3 e.g. Daily kWh, Temperature etc | | non_essential_load3_toggle: | Optional | | Sensor that contains link to entity that will show up when nonessential load 3 icon clicked | -| essential_load8_toggle: | Optional | | Sensor that contains link to entity that will show up when nonessential load 3 icon clicked | -| grid_connected_status_194: | Optional | `binary_sensor.sunsynk_grid_connected_status` | Grid connected status (case insensitive) `on/off`,`1/0`, `On-Grid/Off-Grid`, or `On Grid/Off Grid` | -| energy_cost_buy: | Optional | | Sensor that provides current buy energy cost per kWh | -| energy_cost_sell: | Optional | | Sensor that provides current sell energy cost per kWh | -| prepaid_units: | Optional | | Account balance of prepaid electricity units | -| max_sell_power: | Optional | `number.sunsynk_max_sell_power` | Sets the maximum allowed output power to flow to the grid. Also known as "Export Control User Limit" (W) | + + +## Entities + +Entity attributes below have been appended with the modbus register # e.g. `pv2_power_187` to indicate which Sunsynk +register should be read when configuring your sensors. Replace the default sensors with your own specific sensor names. +It is important that your sensors read the expected modbus register value. If you have missing sensors for any attribute +set it to none i.e. `day_pv_energy_108: none`. This will hide the sensor data from the card. To display a placeholder +with a default value of 0 set it to `zero` or any other value i.e. `solarday_108: zero`. + +See the [WIKI](https://github.com/molikk/mlk-power-flow-card/wiki/Sensor-Mappings) for more information on sensor +mappings if using other integration methods. ### Notes @@ -420,14 +548,17 @@ provide the card with sensors that calculate this data i.e essential_power: and #### Icons -In every icon field you can use preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that returns the mdi icon. +In every icon field you can use preset or any mdi icon e.g. `mdi:ev-station` Presets are: `boiler`, `pump`, `aircon`, `oven`. You can also provide a sensor that +returns the mdi icon. ## Calculations + ### Total PV Total PV is provided through `total_pv` entity. If `total_pv` entity is not provided value will be calculated as: + ``` total_pv = pv1_power_186 + pv2_power_187 + pv3_power_188 + pv4_power_189 + pv5_power ``` @@ -437,6 +568,7 @@ total_pv = pv1_power_186 + pv2_power_187 + pv3_power_188 + pv4_power_189 + pv5_p Essential Load is provided through `essential_power` entity. * For 3 phases mode (`three_phase:true`) when `essential_power` is not provided it will be calculated as: + ``` load_power_L1 + load_power_L2 + load_power_L3 ``` @@ -451,12 +583,12 @@ load_power_L1 + load_power_L2 + load_power_L3 essential_power = totalPV + battery_power_190 + grid_power_169 - aux_power_166 ``` - ### Nonessential Power Calculation Nonessential Load is provided through `nonessential_power` entity. * If there is no `nonessential_power` entity and there is no `grid_power_169` entity then + ``` nonessentialPower = non_essential_load1 + non_essential_load2 + non_essential_load3 ``` @@ -474,6 +606,7 @@ nonessentialPower = non_essential_load1 + non_essential_load2 + non_essential_lo ``` nonessential = grid_ct_power_172 + grid_ct_power_L2 + grid_ct_power_L3 - grid_power_169 ``` + ### Autarky Autarky is the percentage of self-sufficiency through Home Production.
@@ -484,9 +617,11 @@ It is calculated based on the formula below and borrowed from the [Power Distrib Home Production = Solar + Battery (discharge) + Aux (in), Home Consumption = Essential power + Nonessential power + Aux (out) + Battery (charge)
-Auto&Self mode represents Auto consumption & Self usage. Auto consumption is similar to Power Ratio, Self consumption is ratio between produced energy to all energy (produced energy + imported energy) +Auto&Self mode represents Auto consumption & Self usage. Auto consumption is similar to Power Ratio, Self consumption is ratio between produced energy to all +energy (produced energy + imported energy) ### Inverter status + inverter_status_59 Entity expects a sensor that contains inverter status represented as a string or number. | Inverter | standby | selftest | normal | alarm | fault | @@ -504,15 +639,16 @@ inverter_status_59 Entity expects a sensor that contains inverter status represe | **Solis** | '1', '2' | '4139' | '0', '3' | '4100', '4112', '4113', '4114', '4115', '4116',
'4120', '4122', '4123', '4124', '4125', '4127', '4128', '4129',
'4130', '4132', '4133', '4134', '4135', '4136', '4137', '4138',
'4140', '4144', '4145', '4146', '4147', '4148',
'4150', '4151', '4152',
'8123' | '4117', '4118', '4119',
'4121',
'4131', '4134', '4135',
'4144',
'4164', '4167' | | **Sunsynk** | '0', 'standby', 'stand-by' | '1', 'selftest', 'self-checking' | '2', 'normal', 'ok' | '3', 'alarm' | '4', 'fault' | - -| Inverter | standby | selftest | normal | alarm | fault | custom states | -|------------------|-----------------------------------------------|--------------|-------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|-----------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **EasunSMW8_SA** | '0', 'standby' | | | | '5', 'fault' | **solar_battery**: '1', 'solar/battery'
**grid**: '2', 'grid'
**power_saving**: '3', 'power saving'
**power_on**: '4', 'power on' | -| **FoxESS** | 'waiting' | 'self test' | | | 'recoverable fault', 'unrecoverable fault' | **ongrid**: 'on grid'
**offgrid**: 'off grid / eps' | -| **Goodwe** | '0', 'wait mode' | | | | '3', 'fault mode' | **ongrid**: '1', 'normal (on-grid)'
**offgrid**: '2', 'normal (off-grid)'
**flash**: '4', 'flash mode'
**check**: '5', 'check mode' | -| **GoodweGrid** | | | | | | **idle**: '0', 'idle'
**exporting**: '1', 'exporting'
**importing**: '2', 'importing' | | | | | -| **Huawei** | 'standby' | 'spot check' | 'grid-connected, grid-connected normally', 'grid-connected, grid connection with derating due to power rationing' | 'grid-connected, grid connection with derating due to internal causes of the solar inverter' | 'stop due to faults', 'stop due to power rationing' | **shutdown**: 'shutdown'
**normalstop**: 'normal stop' | -| **Solax** | 'waiting', 'checking', 'idle mode', 'standby' | 'self test' | 'normal mode' | | 'permanent fault mode', 'fault' | **offgrid**: 'off-grid waiting', 'off-grid', 'eps mode'
**check**: 'checking', 'update mode', 'eps check mode' | -| **Victron** | | | | | '2', 'fault' | **off**: '0', 'off'
**lowpower**: '1', 'low power'
**bulk**: '3', 'bulk'
**absorption**: '4', 'absorption'
**float**: '5', 'float'
**storage**: '6', 'storage'
**equalize**: '7', 'equalize'
**passthru**: '8', 'passthru'
**inverting**: '9', 'inverting'
**powerassist**: '10', 'power assist'
**powersupply**: '11', 'power supply'
**sustain**: '244', 'sustain'
**externalcontrol**: '252', 'external control' | - -Sunsynk `0, 1, 2, 3, 4` or `standby, selftest, normal, alarm, fault`. For Lux `0,1,2,4,5,7,8,9,10,11,12,16,17,20,32,40,64,136,192`. For Solis expects a numeric value `0-57`. For Goodwe `0,1,2,3,4,5` or `Wait mode, Normal (On-Grid), Normal (Off-Grid), Fault Mode, Flash Mode, Check Mode`. For Goodwe_gridmode `0,1,2` or `Idle, Exporting, Importing` \ No newline at end of file +| Inverter | standby | selftest | normal | alarm | fault | custom states | +|------------------|-----------------------------------------------|--------------|-------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|-----------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **EasunSMW8_SA** | '0', 'standby' | | | | '5', 'fault' | **solar_battery**: '1', 'solar/battery'
**grid**: '2', 'grid'
**power_saving**: '3', 'power saving'
**power_on**: '4', 'power on' | +| **FoxESS** | 'waiting' | 'self test' | | | 'recoverable fault', 'unrecoverable fault' | **ongrid**: 'on grid'
**offgrid**: 'off grid / eps' | +| **Goodwe** | '0', 'wait mode' | | | | '3', 'fault mode' | **ongrid**: '1', 'normal (on-grid)'
**offgrid**: '2', 'normal (off-grid)'
**flash**: '4', 'flash mode'
**check**: '5', 'check mode' | +| **GoodweGrid** | | | | | | **idle**: '0', 'idle'
**exporting**: '1', 'exporting'
**importing**: '2', 'importing' | | | | | +| **Huawei** | 'standby' | 'spot check' | 'grid-connected, grid-connected normally', 'grid-connected, grid connection with derating due to power rationing' | 'grid-connected, grid connection with derating due to internal causes of the solar inverter' | 'stop due to faults', 'stop due to power rationing' | **shutdown**: 'shutdown'
**normalstop**: 'normal stop' | +| **Solax** | 'waiting', 'checking', 'idle mode', 'standby' | 'self test' | 'normal mode' | | 'permanent fault mode', 'fault' | **offgrid**: 'off-grid waiting', 'off-grid', 'eps mode'
**check**: 'checking', 'update mode', 'eps check mode' | +| **Victron** | | | | | '2', 'fault' | **off**: '0', 'off'
**lowpower**: '1', 'low power'
**bulk**: '3', 'bulk'
**absorption**: '4', 'absorption'
**float**: '5', 'float'
**storage**: '6', 'storage'
**equalize**: '7', 'equalize'
**passthru**: '8', 'passthru'
**inverting**: '9', 'inverting'
**powerassist**: '10', 'power assist'
**powersupply**: '11', 'power supply'
**sustain**: '244', 'sustain'
**externalcontrol**: '252', 'external control' | + +Sunsynk `0, 1, 2, 3, 4` or `standby, selftest, normal, alarm, fault`. For Lux `0,1,2,4,5,7,8,9,10,11,12,16,17,20,32,40,64,136,192`. For Solis expects a numeric +value `0-57`. For Goodwe `0,1,2,3,4,5` or `Wait mode, Normal (On-Grid), Normal (Off-Grid), Fault Mode, Flash Mode, Check Mode`. For Goodwe_gridmode `0,1,2` or +`Idle, Exporting, Importing` \ No newline at end of file diff --git a/package.json b/package.json index f58f454..c658871 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mlk-power-flow-card", - "version": "0.11.2", + "version": "0.12.0", "description": "A customizable Home Assistant card to emulate the Sunsynk System flow that's displayed on the Inverter screen.", "main": "mlk-power-flow-card.js", "scripts": { diff --git a/src/editor.ts b/src/editor.ts index c9e5199..df256fd 100644 --- a/src/editor.ts +++ b/src/editor.ts @@ -881,6 +881,37 @@ export class ConfigurationCardEditor extends LitElement implements LovelaceCardE { name: 'prepaid_unit_name', selector: { text: {} } }, ], }, + { + type: 'expandable', + title: this._title('gri_ent'), + schema: [ + { + name: 'entities', + type: 'grid', + schema: [ + { name: 'day_grid_import_76', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } }, + { name: 'day_grid_export_77', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } }, + { name: 'grid_frequency', selector: { entity: { device_class: SensorDeviceClass.FREQUENCY } } }, + { name: 'grid_ct_power_172', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, + { name: 'grid_ct_power_L2', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, + { name: 'grid_ct_power_L3', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, + { name: 'grid_voltage_L1', selector: { entity: { device_class: SensorDeviceClass.VOLTAGE } } }, + { name: 'grid_voltage_L2', selector: { entity: { device_class: SensorDeviceClass.VOLTAGE } } }, + { name: 'grid_voltage_L3', selector: { entity: { device_class: SensorDeviceClass.VOLTAGE } } }, + { name: 'grid_current_L1', selector: { entity: { device_class: SensorDeviceClass.CURRENT } } }, + { name: 'grid_current_L2', selector: { entity: { device_class: SensorDeviceClass.CURRENT } } }, + { name: 'grid_current_L3', selector: { entity: { device_class: SensorDeviceClass.CURRENT } } }, + { name: 'grid_ct_power_total', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, + { name: 'grid_voltage', selector: { entity: { device_class: SensorDeviceClass.VOLTAGE } } }, + { 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: SensorDeviceClass.POWER } } }, + ], + }, + ], + }, { type: 'expandable', title: this._title('ness_load'), @@ -925,37 +956,7 @@ export class ConfigurationCardEditor extends LitElement implements LovelaceCardE }, ], }, - { - type: 'expandable', - title: this._title('gri_ent'), - schema: [ - { - name: 'entities', - type: 'grid', - schema: [ - { name: 'day_grid_import_76', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } }, - { name: 'day_grid_export_77', selector: { entity: { device_class: SensorDeviceClass.ENERGY } } }, - { name: 'grid_frequency', selector: { entity: { device_class: SensorDeviceClass.FREQUENCY } } }, - { name: 'grid_ct_power_172', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, - { name: 'grid_ct_power_L2', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, - { name: 'grid_ct_power_L3', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, - { name: 'grid_voltage_L1', selector: { entity: { device_class: SensorDeviceClass.VOLTAGE } } }, - { name: 'grid_voltage_L2', selector: { entity: { device_class: SensorDeviceClass.VOLTAGE } } }, - { name: 'grid_voltage_L3', selector: { entity: { device_class: SensorDeviceClass.VOLTAGE } } }, - { name: 'grid_current_L1', selector: { entity: { device_class: SensorDeviceClass.CURRENT } } }, - { name: 'grid_current_L2', selector: { entity: { device_class: SensorDeviceClass.CURRENT } } }, - { name: 'grid_current_L3', selector: { entity: { device_class: SensorDeviceClass.CURRENT } } }, - { name: 'grid_ct_power_total', selector: { entity: { device_class: SensorDeviceClass.POWER } } }, - { name: 'grid_voltage', selector: { entity: { device_class: SensorDeviceClass.VOLTAGE } } }, - { 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: SensorDeviceClass.POWER } } }, - ], - }, - ], - }, + ], }, ]} diff --git a/src/localize/languages/en.json b/src/localize/languages/en.json index e6df39e..983a8f6 100644 --- a/src/localize/languages/en.json +++ b/src/localize/languages/en.json @@ -228,8 +228,8 @@ "inv_prog": "Programs Entities", "solar": "Solar Options", - "solar_production": "Solar Production", - "solar_production_ent": "Solar Production Entites", + "solar_production": "Production Names", + "solar_production_ent": "Production Entities", "max_power": "PV Max Power", "mppt_options": "PVs options", "pv_1_ent": "PV1 Entities", @@ -248,7 +248,6 @@ "load": "Load Options", "load_ent": "Load Entities", - "additional_load": "Additional Load Options", "additional_loads_1": "Additional Load 1-8 Options", "additional_loads_2": "Additional Load 9-13 Options", "additional_loads_3": "Additional Load 14-18 Options",