"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[29439],{77730:function(e,t,a){a.a(e,async function(e,o){try{a.r(t);var s,r=a(28430),n=a(97058),i=a(57567),c=a(25979),l=a(12463),u=a(16472),h=(a(28706),a(74423),a(62062),a(26099),a(21699),a(15697)),d=a(57527),f=a(51209),_=a(90789),p=a(148),y=a(55682),m=a(62705),v=a(13446),g=e([y]);y=(g.then?(await g)():g)[0];var b=function(e){function t(){var e;(0,i.A)(this,t);for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return(e=(0,u.A)(this,t,[].concat(o)))._schema=(0,_.A)(function(e,t,a){var o=e?(0,m.V7)(e):[],s="hourly"===t;return[{name:"forecast_type",required:!0,disabled:o.length<=1,selector:{select:{mode:"dropdown",options:["daily","twice_daily","hourly"].map(function(e){return{value:e,label:a("ui.panel.lovelace.editor.features.types.temperature-forecast.forecast_type_options.".concat(e)),disabled:!o.includes(e)}})}}},s?{name:"hours_to_show",default:v.S3,selector:{number:{min:1,mode:"box"}}}:{name:"days_to_show",default:v.qY,selector:{number:{min:1,mode:"box"}}},{name:"color",selector:{ui_color:{default_color:"state",include_state:!0}}},{name:"show_labels",default:!0,selector:{boolean:{}}}]}),e._computeLabelCallback=function(t){switch(t.name){case"forecast_type":return e.hass.localize("ui.panel.lovelace.editor.features.types.temperature-forecast.forecast_type");case"days_to_show":case"hours_to_show":return e.hass.localize("ui.panel.lovelace.editor.card.generic.".concat(t.name));case"color":return e.hass.localize("ui.panel.lovelace.editor.features.types.temperature-forecast.color");case"show_labels":return e.hass.localize("ui.panel.lovelace.editor.features.types.temperature-forecast.show_labels");default:return""}},e}return(0,l.A)(t,e),(0,c.A)(t,[{key:"setConfig",value:function(e){this._config=e}},{key:"render",value:function(){var e,t,a;if(!this.hass||!this._config)return d.s6;var o=null!==(e=this.context)&&void 0!==e&&e.entity_id?this.hass.states[this.context.entity_id]:void 0,i=(0,v.Sg)(o,this._config.forecast_type)||"daily",c="hourly"===i,l=(0,n.A)((0,n.A)({},this._config),{},{forecast_type:i},c?{hours_to_show:null!==(t=this._config.hours_to_show)&&void 0!==t?t:v.S3}:{days_to_show:null!==(a=this._config.days_to_show)&&void 0!==a?a:v.qY}),u=this._schema(o,i,this.hass.localize);return(0,d.qy)(s||(s=(0,r.A)([" <ha-form .hass="," .data="," .schema="," .computeLabel="," @value-changed=","></ha-form> "])),this.hass,l,u,this._computeLabelCallback,this._valueChanged)}},{key:"_valueChanged",value:function(e){(0,p.r)(this,"config-changed",{config:e.detail.value})}}])}(d.WF);(0,h.Cg)([(0,f.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,h.Cg)([(0,f.MZ)({attribute:!1})],b.prototype,"context",void 0),(0,h.Cg)([(0,f.wk)()],b.prototype,"_config",void 0),b=(0,h.Cg)([(0,f.EM)("hui-temperature-forecast-card-feature-editor")],b),a.d(t,{HuiTemperatureForecastCardFeatureEditor:function(){return b}}),o()}catch(w){o(w)}})}}]);
//# sourceMappingURL=29439.70571188d33ee440.js.map