"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["92923"],{46358:function(e,a,t){t.a(e,async function(e,o){try{t.r(a),t.d(a,{HuiEnergySankeyCardEditor:function(){return m}});t(62953);var r=t(40445),i=t(96196),n=t(77845),l=t(63533),s=t(22786),c=t(1087),u=t(52763),h=t(84698),y=e([u]);u=(y.then?(await y)():y)[0];let p,d=e=>e;const _=(0,l.kp)(h.H,(0,l.Ik)({type:(0,l.KC)([(0,l.eu)("power-sankey"),(0,l.eu)("water-sankey"),(0,l.eu)("energy-sankey"),(0,l.eu)("water-flow-sankey")]),title:(0,l.lq)((0,l.Yj)()),collection_key:(0,l.lq)((0,l.Yj)()),layout:(0,l.lq)((0,l.KC)([(0,l.eu)("auto"),(0,l.eu)("vertical"),(0,l.eu)("horizontal")])),group_by_floor:(0,l.lq)((0,l.zM)()),group_by_area:(0,l.lq)((0,l.zM)())})),g=["auto","vertical","horizontal"];class m extends i.WF{setConfig(e){(0,l.vA)(e,_),this._config=e}render(){if(!this.hass||!this._config)return i.s6;const e=this._schema(this.hass.localize),a=Object.assign({},this._config);return(0,i.qy)(p||(p=d` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" .computeHelper="${0}" @value-changed="${0}"></ha-form>`),this.hass,a,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,s.A)(e=>[{name:"title",selector:{text:{}}},{name:"",type:"grid",schema:[{name:"layout",required:!1,selector:{select:{options:g.map(a=>({value:a,label:e(`ui.panel.lovelace.editor.card.energy-sankey.layout_directions.${a}`)}))}}},{name:"",type:"grid",schema:[{name:"group_by_floor",required:!1,selector:{boolean:{}}},{name:"group_by_area",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"layout":case"group_by_floor":case"group_by_area":return this.hass.localize(`ui.panel.lovelace.editor.card.energy-sankey.${e.name}`);default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}}}}(0,r.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,r.Cg)([(0,n.wk)()],m.prototype,"_config",void 0),m=(0,r.Cg)([(0,n.EM)("hui-energy-sankey-card-editor")],m),o()}catch(p){o(p)}})},84698:function(e,a,t){t.d(a,{H:function(){return r}});var o=t(63533);const r=(0,o.Ik)({type:(0,o.Yj)(),view_layout:(0,o.bz)(),layout_options:(0,o.bz)(),grid_options:(0,o.bz)(),visibility:(0,o.bz)(),disabled:(0,o.lq)((0,o.zM)())})}}]);
//# sourceMappingURL=92923.08bc8e3b16ac3b92.js.map