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