"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[76837],{78468:function(e,t,r){r.a(e,async function(e,n){try{r.r(t);var o=r(36854),s=r(98117),a=r(57567),c=r(25979),i=r(12463),u=r(16472),l=(r(44114),r(18111),r(7588),r(26099),r(3362),r(23500),r(15697)),p=r(57527),y=r(51209),_=r(94465),f=r(39715),h=r(83989),w=e([_]);_=(w.then?(await w)():w)[0];var g=function(e){function t(){return(0,a.A)(this,t),(0,u.A)(this,t,arguments)}return(0,i.A)(t,e),(0,c.A)(t,null,[{key:"generate",value:(r=(0,s.A)((0,o.A)().m(function e(t,r){var n,s,a,c,i,u,l,p,y,w,g,d,k,m;return(0,o.A)().w(function(e){for(;;)switch(e.n){case 0:if(n=t.collection_key||_.e6,s=t.hidden_cards,(a=(0,_.tb)(r,{key:n,midnightRollover:!0})).prefs){e.n=1;break}return e.n=1,a.refresh();case 1:if(c=a.prefs,u=[],l={type:"sections",sections:[i={type:"grid",cards:[]}]},p=!!c&&(0,f.K9)(c),y=!!c&&(0,f.rU)(c),w=!!c&&(0,f.$s)(c),g=!!c&&(0,f.tc)(c),d=!!c&&(0,f.NR)(c),c&&(p||y||w||g||d)){e.n=2;break}return e.a(2,l);case 2:return p&&u.push({type:"power-total",collection_key:n}),(0,f.BL)("now","power-sources-graph",c,s)&&i.cards.push({title:r.localize("ui.panel.energy.cards.power_sources_graph_title"),type:"power-sources-graph",collection_key:n,grid_options:{columns:36}}),d&&u.push({type:"gas-total",collection_key:n}),g&&u.push({type:"water-total",collection_key:n}),c.energy_sources.forEach(function(e){"battery"===e.type&&e.stat_soc&&u.push({type:"entity",entity:e.stat_soc})}),(0,f.BL)("now","power-sankey",c,s)&&(k=(0,h.V)(c.device_consumption,r,function(e){return e.stat_rate}),i.cards.push({title:r.localize("ui.panel.energy.cards.power_sankey_title"),type:"power-sankey",collection_key:n,group_by_floor:k,group_by_area:k,grid_options:{columns:36}})),(0,f.BL)("now","water-flow-sankey",c,s)&&(m=(0,h.V)(c.device_consumption_water,r,function(e){return e.stat_rate}),i.cards.push({title:r.localize("ui.panel.energy.cards.water_flow_sankey_title"),type:"water-flow-sankey",collection_key:n,group_by_floor:m,group_by_area:m,grid_options:{columns:36}})),u.length&&(l.badges=u),e.a(2,l)}},e)})),function(e,t){return r.apply(this,arguments)})}]);var r}(p.mN);g.registryDependencies=[],g=(0,l.Cg)([(0,y.EM)("power-view-strategy")],g),r.d(t,{PowerViewStrategy:function(){return g}}),n()}catch(d){n(d)}})}}]);
//# sourceMappingURL=76837.658fe8872aba2603.js.map