"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[8018],{22857:function(e,t,i){i.a(e,async function(e,n){try{i.r(t);var o=i(25979),a=i(57567),s=i(12463),r=i(16472),c=(i(28706),i(15697)),d=i(51209),u=i(26792),l=e([u]);u=(l.then?(await l)():l)[0];var h={featureType:"climate-swing-modes",i18nFeatureId:"climate-swing-modes",modeField:"swing_modes",defaultStyle:"dropdown",getAvailableModesOrdered:function(e){var t;return null!==(t=null==e?void 0:e.attributes.swing_modes)&&void 0!==t?t:[]},getModeLabel:function(e,t,i){return t?e.formatEntityAttributeValue(t,"swing_mode",i):i}},m=function(e){function t(){var e;(0,a.A)(this,t);for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return(e=(0,r.A)(this,t,[].concat(n))).descriptor=h,e}return(0,s.A)(t,e),(0,o.A)(t)}(u.k);m=(0,c.Cg)([(0,d.EM)("hui-climate-swing-modes-card-feature-editor")],m),i.d(t,{HuiClimateSwingModesCardFeatureEditor:function(){return m}}),n()}catch(f){n(f)}})},26792:function(e,t,i){i.a(e,async function(e,n){try{var o,a=i(86613),s=i(28430),r=i(97058),c=i(74512),d=i(57567),u=i(25979),l=i(12463),h=i(16472),m=i(43939),f=(i(28706),i(62062),i(18111),i(61701),i(26099),i(15697)),v=i(57527),p=i(51209),g=i(90789),y=i(148),_=i(55682),A=e([_]);_=(A.then?(await A)():A)[0];var b=["customize_modes"];function k(e){e.customize_modes;return(0,m.A)(e,b)}var w=function(e){function t(){var e;(0,d.A)(this,t);for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];return(e=(0,h.A)(this,t,[].concat(n)))._schema=(0,g.A)(function(t,i,n){var o,a=e.descriptor,s=null!==(o=a.styleListI18nFeatureId)&&void 0!==o?o:a.i18nFeatureId;return[{name:"style",selector:{select:{multiple:!1,mode:"list",options:["dropdown","icons"].map(function(e){return{value:e,label:t("ui.panel.lovelace.editor.features.types.".concat(s,".style_list.").concat(e))}})}}},{name:"customize_modes",selector:{boolean:{}}}].concat((0,c.A)(n?[{name:a.modeField,selector:{select:{reorder:!0,multiple:!0,options:a.getAvailableModesOrdered(i).map(function(t){return{value:t,label:a.getModeLabel(e.hass,i,t)}})}}}]:[]))}),e._computeLabelCallback=function(t){var i=e.descriptor.i18nFeatureId,n=e.descriptor.modeField;return"style"===t.name||"customize_modes"===t.name||t.name===n?e.hass.localize("ui.panel.lovelace.editor.features.types.".concat(i,".").concat(t.name)):""},e}return(0,l.A)(t,e),(0,u.A)(t,[{key:"setConfig",value:function(e){e.type===this.descriptor.featureType&&(this._config=e)}},{key:"render",value:function(){var e;if(!this.hass||!this._config)return v.s6;var t=null!==(e=this.context)&&void 0!==e&&e.entity_id?this.hass.states[this.context.entity_id]:void 0,i=this.descriptor,n=i.modeField,a=i.defaultStyle,c=(0,r.A)((0,r.A)({style:a},this._config),{},{customize_modes:void 0!==this._config[n]}),d=this._schema(this.hass.localize,t,c.customize_modes);return(0,v.qy)(o||(o=(0,s.A)([" <ha-form .hass="," .data="," .schema="," .computeLabel="," @value-changed=","></ha-form> "])),this.hass,c,d,this._computeLabelCallback,this._valueChanged)}},{key:"_valueChanged",value:function(e){var t,i=e.detail.value,n=i.customize_modes,o=k(i),s=null!==(t=this.context)&&void 0!==t&&t.entity_id?this.hass.states[this.context.entity_id]:void 0,c=this.descriptor,d=c.modeField,u=c.getAvailableModesOrdered,l=d;n&&!o[l]&&(o=(0,r.A)((0,r.A)({},o),{},(0,a.A)({},d,u(s)))),n||void 0===o[l]||delete o[l],(0,y.r)(this,"config-changed",{config:o})}}])}(v.WF);(0,f.Cg)([(0,p.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,f.Cg)([(0,p.MZ)({attribute:!1})],w.prototype,"context",void 0),(0,f.Cg)([(0,p.wk)()],w.prototype,"_config",void 0),i.d(t,{k:function(){return w}}),n()}catch(C){n(C)}})}}]);
//# sourceMappingURL=8018.6eea84238f9e3e97.js.map