"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["97504"],{26691:function(e,t,o){o.r(t),o.d(t,{HuiWaterHeaterOperationModesCardFeatureEditor:function(){return g}});var i,s=o(20054),a=o(72153),n=o(7739),r=o(44734),c=o(43080),l=o(69683),u=o(6454),d=(o(28706),o(62062),o(26910),o(18111),o(61701),o(69085),o(26099),o(40445)),h=o(96196),m=o(77845),p=o(22786),_=o(1087),f=(o(52763),o(62091)),v=["customize_modes"],g=function(e){function t(){var e;(0,r.A)(this,t);for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return(e=(0,l.A)(this,t,[].concat(i)))._schema=(0,p.A)(function(e,t,o,i){return[{name:"style",selector:{select:{multiple:!1,mode:"list",options:["dropdown","icons"].map(function(t){return{value:t,label:e("ui.panel.lovelace.editor.features.types.water-heater-operation-modes.style_list.".concat(t))}})}}},{name:"customize_modes",selector:{boolean:{}}}].concat((0,n.A)(i?[{name:"operation_modes",selector:{select:{reorder:!0,multiple:!0,options:((null==o?void 0:o.attributes.operation_list)||[]).concat().sort(f.im).map(function(e){return{value:e,label:o?t(o,e):e}})}}}]:[]))}),e._computeLabelCallback=function(t){switch(t.name){case"operation_modes":case"style":case"customize_modes":return e.hass.localize("ui.panel.lovelace.editor.features.types.water-heater-operation-modes.".concat(t.name));default:return""}},e}return(0,u.A)(t,e),(0,c.A)(t,[{key:"setConfig",value:function(e){this._config=e}},{key:"render",value:function(){var e,t;if(!this.hass||!this._config)return h.s6;var o=null!==(e=this.context)&&void 0!==e&&e.entity_id?this.hass.states[null===(t=this.context)||void 0===t?void 0:t.entity_id]:void 0,s=Object.assign(Object.assign({style:"icons"},this._config),{},{customize_modes:void 0!==this._config.operation_modes}),n=this._schema(this.hass.localize,this.hass.formatEntityState,o,s.customize_modes);return(0,h.qy)(i||(i=(0,a.A)([' <ha-form .hass="','" .data="','" .schema="','" .computeLabel="','" @value-changed="','"></ha-form> '])),this.hass,s,n,this._computeLabelCallback,this._valueChanged)}},{key:"_valueChanged",value:function(e){var t,o,i=e.detail.value,a=i.customize_modes,n=(0,s.A)(i,v),r=null!==(t=this.context)&&void 0!==t&&t.entity_id?this.hass.states[null===(o=this.context)||void 0===o?void 0:o.entity_id]:void 0;a&&!n.operation_modes&&(n.operation_modes=((null==r?void 0:r.attributes.operation_list)||[]).concat().sort(f.im)),!a&&n.operation_modes&&delete n.operation_modes,(0,_.r)(this,"config-changed",{config:n})}}])}(h.WF);(0,d.Cg)([(0,m.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,d.Cg)([(0,m.MZ)({attribute:!1})],g.prototype,"context",void 0),(0,d.Cg)([(0,m.wk)()],g.prototype,"_config",void 0),g=(0,d.Cg)([(0,m.EM)("hui-water-heater-operation-modes-card-feature-editor")],g)}}]);
//# sourceMappingURL=97504.a3a3bcfb4c909ca1.js.map