"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["81228"],{88615:function(e,t,n){n.a(e,async function(e,r){try{n.r(t),n.d(t,{WaterViewStrategy:function(){return p}});n(44114),n(18111),n(13579),n(3362);var s=n(40445),o=n(96196),c=n(77845),a=n(38114),i=n(4203),l=n(7936),_=e([i,a]);[i,a]=_.then?(await _)():_;class p extends o.mN{static async generate(e,t){var n;const r=e.collection_key||i.DEFAULT_ENERGY_COLLECTION_KEY,s={type:"sections",max_columns:3,sections:[{type:"grid",cards:[],column_span:3}],footer:{card:{type:"energy-date-selection",collection_key:r,opening_direction:"right",vertical_opening_direction:"up"}}},o=(0,a.tb)(t,{key:r});o.prefs||await o.refresh();const c=o.prefs,_=null==c?void 0:c.energy_sources.some(e=>"water"===e.type),p=null==c||null===(n=c.device_consumption_water)||void 0===n?void 0:n.length;if(!c||!p&&!_)return s;const y=s.sections[0];if(y.cards.push({type:"energy-compare",collection_key:r}),_&&(y.cards.push({title:t.localize("ui.panel.energy.cards.energy_water_graph_title"),type:"energy-water-graph",collection_key:r,grid_options:{columns:24}}),y.cards.push({title:t.localize("ui.panel.energy.cards.energy_sources_table_title"),type:"energy-sources-table",collection_key:r,types:["water"],grid_options:{columns:12}})),p){const e=(0,l.V)(c.device_consumption_water,t,e=>e.stat_consumption);y.cards.push({title:t.localize("ui.panel.energy.cards.water_sankey_title"),type:"water-sankey",collection_key:r,group_by_floor:e,group_by_area:e,grid_options:{columns:24}})}return s}}p=(0,s.Cg)([(0,c.EM)("water-view-strategy")],p),r()}catch(p){r(p)}})}}]);
//# sourceMappingURL=81228.31ea495826e73414.js.map