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