"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["8247"],{682:function(e,t,a){a.a(e,async function(e,s){try{a.r(t),a.d(t,{HuiEnergySourcesTableCardEditor:function(){return b}});a(62953);var o=a(40445),i=a(96196),l=a(77845),r=a(63533),n=a(22786),c=a(1087),u=a(52763),h=a(84698),d=e([u]);u=(d.then?(await d)():d)[0];let p,_=e=>e;const y=(0,r.kp)(h.H,(0,r.Ik)({type:(0,r.eu)("energy-sources-table"),title:(0,r.lq)((0,r.Yj)()),collection_key:(0,r.lq)((0,r.Yj)()),types:(0,r.lq)((0,r.YO)((0,r.KC)([(0,r.eu)("grid"),(0,r.eu)("solar"),(0,r.eu)("battery"),(0,r.eu)("gas"),(0,r.eu)("water")]))),show_only_totals:(0,r.lq)((0,r.zM)())})),g=["grid","solar","battery","gas","water"];class b extends i.WF{setConfig(e){(0,r.vA)(e,y),this._config=e}render(){if(!this.hass||!this._config)return i.s6;const e=this._schema(this.hass.localize),t=Object.assign({},this._config);return(0,i.qy)(p||(p=_` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" .computeHelper="${0}" @value-changed="${0}"></ha-form>`),this.hass,t,e,this._computeLabelCallback,this._computeHelperCallback,this._valueChanged)}_valueChanged(e){(0,c.r)(this,"config-changed",{config:e.detail.value})}constructor(...e){super(...e),this._schema=(0,n.A)(e=>[{name:"title",selector:{text:{}}},{name:"",type:"grid",schema:[{name:"types",required:!1,selector:{select:{multiple:!0,mode:"list",options:g.map(t=>({value:t,label:e(`ui.panel.lovelace.editor.card.energy-sources-table.type_options.${t}`)}))}}},{name:"show_only_totals",required:!1,selector:{boolean:{}}},{type:"string",name:"collection_key",required:!1}]}]),this._computeHelperCallback=e=>{if("collection_key"===e.name)return this.hass.localize("ui.panel.lovelace.editor.card.generic.collection_key_description")},this._computeLabelCallback=e=>{switch(e.name){case"types":case"show_only_totals":return this.hass.localize(`ui.panel.lovelace.editor.card.energy-sources-table.${e.name}`);default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}}}}(0,o.Cg)([(0,l.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,o.Cg)([(0,l.wk)()],b.prototype,"_config",void 0),b=(0,o.Cg)([(0,l.EM)("hui-energy-sources-table-card-editor")],b),s()}catch(p){s(p)}})},84698:function(e,t,a){a.d(t,{H:function(){return o}});var s=a(63533);const o=(0,s.Ik)({type:(0,s.Yj)(),view_layout:(0,s.bz)(),layout_options:(0,s.bz)(),grid_options:(0,s.bz)(),visibility:(0,s.bz)(),disabled:(0,s.lq)((0,s.zM)())})}}]);
//# sourceMappingURL=8247.d33f5f9a3c4eb812.js.map