"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["9917"],{28876:function(e,t,i){i.r(t);i(35748),i(12977),i(95013);var a=i(69868),s=i(84922),o=i(11991),n=i(44017),r=(i(80287),i(50809));let l,h,c=e=>e;class d extends s.WF{set item(e){this._item=e,e?(this._name=e.name||"",this._icon=e.icon||""):(this._name="",this._icon="")}focus(){this.updateComplete.then(()=>{var e;return null===(e=this.shadowRoot)||void 0===e||null===(e=e.querySelector("[dialogInitialFocus]"))||void 0===e?void 0:e.focus()})}render(){return this.hass?(0,s.qy)(l||(l=c` <div class="form"> <ha-textfield .value="${0}" .configValue="${0}" @input="${0}" .label="${0}" autoValidate required .validationMessage="${0}" dialogInitialFocus></ha-textfield> <ha-icon-picker .hass="${0}" .value="${0}" .configValue="${0}" @value-changed="${0}" .label="${0}"></ha-icon-picker> </div> `),this._name,"name",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.name"),this.hass.localize("ui.dialogs.helper_settings.required_error_msg"),this.hass,this._icon,"icon",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.icon")):s.s6}_valueChanged(e){var t;if(!this.new&&!this._item)return;e.stopPropagation();const i=e.target.configValue,a=(null===(t=e.detail)||void 0===t?void 0:t.value)||e.target.value;if(this[`_${i}`]===a)return;const s=Object.assign({},this._item);a?s[i]=a:delete s[i],(0,n.r)(this,"value-changed",{value:s})}static get styles(){return[r.RF,(0,s.AH)(h||(h=c`.form{color:var(--primary-text-color)}.row{padding:16px 0}ha-textfield{display:block;margin:8px 0}`))]}constructor(...e){super(...e),this.new=!1}}(0,a.__decorate)([(0,o.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,a.__decorate)([(0,o.MZ)({type:Boolean})],d.prototype,"new",void 0),(0,a.__decorate)([(0,o.wk)()],d.prototype,"_name",void 0),(0,a.__decorate)([(0,o.wk)()],d.prototype,"_icon",void 0),d=(0,a.__decorate)([(0,o.EM)("ha-input_boolean-form")],d)}}]);
//# sourceMappingURL=9917.5a3cb722b598f5a4.js.map