export const __rspack_esm_id=51199;export const __rspack_esm_ids=[51199];export const __webpack_modules__={71618(t,i,e){e.a(t,async function(t,s){try{e.r(i);var n=e(15697),a=e(57527),o=e(79224),c=e(97901),r=e(5455),h=e(96682),d=e(62705),l=e(14936),_=e(42239),u=e(49511),f=e(72441),p=e(59366),g=e(58178),b=t([p,g]);[p,g]=b.then?(await b)():b;class y extends a.WF{_unsubscribeForecastEvents(){this._subscribed&&(this._subscribed.then(t=>t()),this._subscribed=void 0)}async _subscribeForecastEvents(){if(this._unsubscribeForecastEvents(),!this.hass||!this._config||!this.isConnected)return;const t=this.hass.states[this._config.entity],i=(0,d.JM)(t);i&&(this._subscribed=(0,d.Mu)(this.hass.connection,t.entity_id,i,t=>{this._forecastEvent=t}))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this._subscribeForecastEvents()}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribeForecastEvents()}setConfig(t){if(!t?.entity)throw new Error("Entity must be specified");this._config=t}shouldUpdate(t){return(0,f.LX)(this,t)||t.size>1||!t.has("hass")}updated(t){super.updated(t),!t.has("_config")&&this._subscribed||this._subscribeForecastEvents()}render(){if(!this.hass||!this._config)return a.s6;const t=this.hass.states[this._config.entity];if(!t)return a.qy` <hui-warning .hass=${this.hass}> ${(0,g.j)(this.hass,this._config.entity)} </hui-warning> `;const i=(0,u.A)(this._config),e=this._config.secondary_info,s=(0,d.L8)(t.state,this),n=(0,d.yd)(t.attributes,this._forecastEvent),o=n?.forecast,_=this.hass.formatEntityName(t,this._config.name);return a.qy` <div class="icon-image ${(0,c.H)({pointer:i})}" @action=${this._handleAction} .actionHandler=${(0,l.T)({hasHold:(0,u.h)(this._config.hold_action),hasDoubleClick:(0,u.h)(this._config.double_tap_action)})} tabindex=${(0,r.J)(!this._config.tap_action||(0,u.h)(this._config.tap_action)?"0":void 0)}> ${s||a.qy` <ha-state-icon class="weather-icon" .stateObj=${t}></ha-state-icon> `} </div> <div class="info ${(0,c.H)({pointer:i,"text-content":!e})}" @action=${this._handleAction} .actionHandler=${(0,l.T)({hasHold:(0,u.h)(this._config.hold_action),hasDoubleClick:(0,u.h)(this._config.double_tap_action)})}> ${_} ${e?a.qy` <div class="secondary"> ${"entity-id"===this._config.secondary_info?t.entity_id:"last-changed"===this._config.secondary_info?a.qy` <ha-relative-time .datetime=${t.last_changed} capitalize></ha-relative-time> `:"last-updated"===this._config.secondary_info?a.qy` <ha-relative-time .datetime=${t.last_updated} capitalize></ha-relative-time> `:""} </div> `:""} </div> <div class="attributes ${(0,c.H)({pointer:i})}" @action=${this._handleAction} .actionHandler=${(0,l.T)({hasHold:(0,u.h)(this._config.hold_action),hasDoubleClick:(0,u.h)(this._config.double_tap_action)})}> <div> ${t.state===h.Hh||t.state===h.HV||void 0===t.attributes.temperature||null===t.attributes.temperature?this.hass.formatEntityState(t):this.hass.formatEntityAttributeValue(t,"temperature")} </div> <div class="secondary"> ${(0,d.nO)(this.hass,t,o)} </div> </div> `}_handleAction(t){(0,_.$)(this,this.hass,this._config,t.detail.action)}static get styles(){return[d.Ry,a.AH`:host{flex-direction:row;align-items:center;display:flex}.info{margin-left:16px;flex:1 0 60px;margin-inline-start:16px;margin-inline-end:initial}.info,.info>*{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.icon-image{align-items:center;min-width:40px;display:flex}.icon-image>*{flex:0 0 40px;height:40px}.icon-image:focus{background-color:var(--divider-color);border-radius:var(--ha-border-radius-circle);outline:none}.weather-icon{--mdc-icon-size:40px}.pointer{cursor:pointer}.attributes{text-align:right;margin-left:8px;flex-direction:column;justify-content:center;margin-inline-start:8px;margin-inline-end:initial;display:flex}.secondary{color:var(--secondary-text-color)}`]}}(0,n.Cg)([(0,o.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,n.Cg)([(0,o.wk)()],y.prototype,"_config",void 0),(0,n.Cg)([(0,o.wk)()],y.prototype,"_forecastEvent",void 0),(0,n.Cg)([(0,o.wk)()],y.prototype,"_subscribed",void 0),y=(0,n.Cg)([(0,o.EM)("hui-weather-entity-row")],y),s()}catch(t){s(t)}})}};
//# sourceMappingURL=51199.e0030118d68f1789.js.map