"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["61242"],{45217:function(e,t,a){a.a(e,async function(e,n){try{a.r(t),a.d(t,{HuiThermostatCardEditor:function(){return A}});var i,s,r=a(72153),o=a(7739),c=a(44734),h=a(43080),u=a(69683),l=a(6454),f=(a(28706),a(69085),a(40445)),d=a(96196),m=a(77845),g=a(22786),_=a(63533),p=a(1087),v=a(71727),y=(a(11382),a(52763),a(67094),a(84698)),b=a(44155),C=a(7382),k=a(16161),H=e([k]);k=(H.then?(await H)():H)[0];var w={climate:["climate-hvac-modes","climate-preset-modes","climate-fan-modes","climate-swing-modes","climate-swing-horizontal-modes"],water_heater:["water-heater-operation-modes"]},V=(0,_.kp)(y.H,(0,_.Ik)({entity:(0,_.lq)((0,_.Yj)()),name:(0,_.lq)(b.q),theme:(0,_.lq)((0,_.Yj)()),show_current_as_primary:(0,_.lq)((0,_.zM)()),features:(0,_.lq)((0,_.YO)((0,_.bz)()))})),A=function(e){function t(){var e;(0,c.A)(this,t);for(var a=arguments.length,n=new Array(a),i=0;i<a;i++)n[i]=arguments[i];return(e=(0,u.A)(this,t,[].concat(n)))._featureContext=(0,g.A)(function(e){return{entity_id:e}}),e._schema=(0,g.A)(function(e){return[{name:"entity",selector:{entity:{domain:["climate","water_heater"]}}},{name:"name",selector:{entity_name:{}},context:{entity:"entity"}},{type:"grid",name:"",schema:[{name:"theme",selector:{theme:{}}}]}].concat((0,o.A)("climate"===e?[{name:"show_current_as_primary",selector:{boolean:{}}}]:[]))}),e._computeLabelCallback=function(t){return"show_current_as_primary"===t.name?e.hass.localize("ui.panel.lovelace.editor.card.thermostat.show_current_as_primary"):e.hass.localize("ui.panel.lovelace.editor.card.generic.".concat(t.name))},e}return(0,l.A)(t,e),(0,h.A)(t,[{key:"setConfig",value:function(e){(0,_.vA)(e,V),this._config=e}},{key:"render",value:function(){var e;if(!this.hass||!this._config)return d.s6;var t=this._config.entity,a=(0,v.m)(t),n=this._featureContext(t);return(0,d.qy)(i||(i=(0,r.A)([' <ha-form .hass="','" .data="','" .schema="','" .computeLabel="','" @value-changed="','"></ha-form> <ha-expansion-panel outlined> <ha-svg-icon slot="leading-icon" .path="','"></ha-svg-icon> <h3 slot="header"> ',' </h3> <div class="content"> <hui-card-features-editor .hass="','" .context="','" .featuresTypes="','" .features="','" @features-changed="','" @edit-detail-element="','"></hui-card-features-editor> </div> </ha-expansion-panel> '])),this.hass,this._config,this._schema(a),this._computeLabelCallback,this._valueChanged,"M19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.9 20.1 3 19 3M7 7H9V9H7V7M7 11H9V13H7V11M7 15H9V17H7V15M17 17H11V15H17V17M17 13H11V11H17V13M17 9H11V7H17V9Z",this.hass.localize("ui.panel.lovelace.editor.card.generic.features"),this.hass,n,w[a],null!==(e=this._config.features)&&void 0!==e?e:[],this._featuresChanged,this._editDetailElement)}},{key:"_valueChanged",value:function(e){(0,p.r)(this,"config-changed",{config:e.detail.value})}},{key:"_featuresChanged",value:function(e){if(e.stopPropagation(),this._config&&this.hass){var t=e.detail.features,a=Object.assign(Object.assign({},this._config),{},{features:t});0===t.length&&delete a.features,(0,p.r)(this,"config-changed",{config:a})}}},{key:"_editDetailElement",value:function(e){var t=this,a=e.detail.subElementConfig.index,n=this._config.features[a];(0,p.r)(this,"edit-sub-element",{config:n,saveConfig:function(e){return t._updateFeature(a,e)},context:{entity_id:this._config.entity},type:"feature"})}},{key:"_updateFeature",value:function(e,t){var a=this._config.features.concat();a[e]=t;var n=Object.assign(Object.assign({},this._config),{},{features:a});(0,p.r)(this,"config-changed",{config:n})}}],[{key:"styles",get:function(){return[C.U,(0,d.AH)(s||(s=(0,r.A)(["ha-form{display:block;margin-bottom:24px}"])))]}}])}(d.WF);(0,f.Cg)([(0,m.MZ)({attribute:!1})],A.prototype,"hass",void 0),(0,f.Cg)([(0,m.wk)()],A.prototype,"_config",void 0),A=(0,f.Cg)([(0,m.EM)("hui-thermostat-card-editor")],A),n()}catch(z){n(z)}})},84698:function(e,t,a){a.d(t,{H:function(){return i}});var n=a(63533),i=(0,n.Ik)({type:(0,n.Yj)(),view_layout:(0,n.bz)(),layout_options:(0,n.bz)(),grid_options:(0,n.bz)(),visibility:(0,n.bz)(),disabled:(0,n.lq)((0,n.zM)())})}}]);
//# sourceMappingURL=61242.59d33c8d4fcd0b7a.js.map