"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[69159],{61831:function(t,i,e){var s,a,r,n,o,u=e(28430),h=e(57567),c=e(25979),f=e(12463),l=e(16472),y=(e(28706),e(15697)),d=e(358),b=e(57527),m=e(51209),v=e(49938),_=e(80189),g=e(96682),p=function(t){function i(){return(0,h.A)(this,i),(0,l.A)(this,i,arguments)}return(0,f.A)(i,t),(0,c.A)(i,[{key:"render",value:function(){var t=this._computeCurrentStatus(),i=this.stateObj.state===g.Hh||this.stateObj.state===g.HV;return(0,b.qy)(s||(s=(0,u.A)(['<div class="target"> '," </div> ",""])),i?this._localizeState():(0,b.qy)(a||(a=(0,u.A)(['<span class="state-label"> '," ",' </span> <div class="unit">',"</div>"])),this._localizeState(),this.stateObj.attributes.mode?(0,b.qy)(r||(r=(0,u.A)(["- ",""])),this._formatters.formatEntityAttributeValue(this.stateObj,"mode")):"",this._computeTarget()),t&&!i?(0,b.qy)(n||(n=(0,u.A)(['<div class="current"> ',': <div class="unit">',"</div> </div>"])),this._localize("ui.card.humidifier.currently"),t):"")}},{key:"_computeCurrentStatus",value:function(){if(this._formatters&&this.stateObj)return null!=this.stateObj.attributes.current_humidity?"".concat(this._formatters.formatEntityAttributeValue(this.stateObj,"current_humidity")):void 0}},{key:"_computeTarget",value:function(){return this._formatters&&this.stateObj&&null!=this.stateObj.attributes.humidity?"".concat(this._formatters.formatEntityAttributeValue(this.stateObj,"humidity")):""}},{key:"_localizeState",value:function(){if(this.stateObj.state===g.Hh||this.stateObj.state===g.HV)return this._localize("state.default.".concat(this.stateObj.state));var t=this._formatters.formatEntityState(this.stateObj);if(this.stateObj.attributes.action&&this.stateObj.state!==g.KF){var i=this._formatters.formatEntityAttributeValue(this.stateObj,"action");return"".concat(i," (").concat(t,")")}return t}}])}(b.WF);p.styles=(0,b.AH)(o||(o=(0,u.A)([":host{white-space:nowrap;flex-direction:column;justify-content:center;display:flex}.target{color:var(--primary-text-color)}.current{color:var(--secondary-text-color)}.state-label{font-weight:var(--ha-font-weight-bold)}.unit{direction:ltr;display:inline-block}"]))),(0,y.Cg)([(0,m.wk)(),(0,d.Fg)({context:_.p0,subscribe:!0})],p.prototype,"_formatters",void 0),(0,y.Cg)([(0,m.wk)(),(0,v.IW)()],p.prototype,"_localize",void 0),(0,y.Cg)([(0,m.MZ)({attribute:!1})],p.prototype,"stateObj",void 0),p=(0,y.Cg)([(0,m.EM)("ha-humidifier-state")],p)},25754:function(t,i,e){e.a(t,async function(t,s){try{e.r(i);var a,r,n,o=e(28430),u=e(57567),h=e(25979),c=e(12463),f=e(16472),l=(e(16280),e(15697)),y=e(57527),d=e(51209),b=e(88293),m=(e(61831),e(72441)),v=e(59366),_=e(58178),g=t([b,v,_]);[b,v,_]=g.then?(await g)():g;var p=function(t){function i(){return(0,u.A)(this,i),(0,f.A)(this,i,arguments)}return(0,c.A)(i,t),(0,h.A)(i,[{key:"setConfig",value:function(t){if(!t||!t.entity)throw new Error("Entity must be specified");this._config=t}},{key:"shouldUpdate",value:function(t){return(0,m.LX)(this,t)}},{key:"render",value:function(){if(!this.hass||!this._config)return y.s6;var t=this.hass.states[this._config.entity];return t?(0,y.qy)(r||(r=(0,o.A)([" <hui-generic-entity-row .hass="," .config=","> <ha-humidifier-state .stateObj=","> </ha-humidifier-state> </hui-generic-entity-row> "])),this.hass,this._config,t):(0,y.qy)(a||(a=(0,o.A)([" <hui-warning .hass=","> "," </hui-warning> "])),this.hass,(0,_.j)(this.hass,this._config.entity))}}])}(y.WF);p.styles=(0,y.AH)(n||(n=(0,o.A)(["ha-humidifier-state{text-align:right}"]))),(0,l.Cg)([(0,d.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,l.Cg)([(0,d.wk)()],p.prototype,"_config",void 0),p=(0,l.Cg)([(0,d.EM)("hui-humidifier-entity-row")],p),s()}catch(A){s(A)}})}}]);
//# sourceMappingURL=69159.285f60662c58d947.js.map