export const __rspack_esm_id="97504";export const __rspack_esm_ids=["97504"];export const __webpack_modules__={26691(e,t,o){o.a(e,async function(e,s){try{o.r(t),o.d(t,{HuiWaterHeaterOperationModesCardFeatureEditor:()=>m});o(18111),o(61701);var a=o(62826),i=o(96196),r=o(97735),n=o(22786),c=o(1087),d=o(52763),l=o(62091),h=e([d]);d=(h.then?(await h)():h)[0];class m extends i.WF{setConfig(e){this._config=e}render(){if(!this.hass||!this._config)return i.s6;const e=this.context?.entity_id?this.hass.states[this.context?.entity_id]:void 0,t={style:"icons",...this._config,customize_modes:void 0!==this._config.operation_modes},o=this._schema(this.hass.localize,this.hass.formatEntityState,e,t.customize_modes);return i.qy` <ha-form .hass="${this.hass}" .data="${t}" .schema="${o}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}_valueChanged(e){const{customize_modes:t,...o}=e.detail.value,s=this.context?.entity_id?this.hass.states[this.context?.entity_id]:void 0;t&&!o.operation_modes&&(o.operation_modes=(s?.attributes.operation_list||[]).concat().sort(l.im)),!t&&o.operation_modes&&delete o.operation_modes,(0,c.r)(this,"config-changed",{config:o})}constructor(...e){super(...e),this._schema=(0,n.A)((e,t,o,s)=>[{name:"style",selector:{select:{multiple:!1,mode:"list",options:["dropdown","icons"].map(t=>({value:t,label:e(`ui.panel.lovelace.editor.features.types.water-heater-operation-modes.style_list.${t}`)}))}}},{name:"customize_modes",selector:{boolean:{}}},...s?[{name:"operation_modes",selector:{select:{reorder:!0,multiple:!0,options:(o?.attributes.operation_list||[]).concat().sort(l.im).map(e=>({value:e,label:o?t(o,e):e}))}}}]:[]]),this._computeLabelCallback=e=>{switch(e.name){case"operation_modes":case"style":case"customize_modes":return this.hass.localize(`ui.panel.lovelace.editor.features.types.water-heater-operation-modes.${e.name}`);default:return""}}}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"context",void 0),(0,a.Cg)([(0,r.wk)()],m.prototype,"_config",void 0),m=(0,a.Cg)([(0,r.EM)("hui-water-heater-operation-modes-card-feature-editor")],m),s()}catch(e){s(e)}})}};
//# sourceMappingURL=97504.9c81c7944b67fb48.js.map