export const __rspack_esm_id="77547";export const __rspack_esm_ids=["77547"];export const __webpack_modules__={80395(t,i,s){s.a(t,async function(t,e){try{s.r(i);var a=s(62826),n=s(96196),o=s(97735),c=s(94333),r=s(32288),h=s(22675),d=s(43248),l=s(19037),_=s(37642),u=s(37544),f=s(97176),p=s(784),g=s(79757),b=s(85979),v=t([g,b]);[g,b]=v.then?(await v)():v;class y extends n.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,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,p.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 n.s6;const t=this.hass.states[this._config.entity];if(!t)return n.qy` <hui-warning .hass="${this.hass}"> ${(0,b.j)(this.hass,this._config.entity)} </hui-warning> `;const i=(0,f.A)(this._config),s=this._config.secondary_info,e=(0,d.L8)(t.state,this),a=(0,d.yd)(t.attributes,this._forecastEvent),o=a?.forecast,u=(0,_.v)(this.hass,t,this._config.name);return n.qy` <div class="icon-image ${(0,c.H)({pointer:i})}" @action="${this._handleAction}" .actionHandler="${(0,l.T)({hasHold:(0,f.h)(this._config.hold_action),hasDoubleClick:(0,f.h)(this._config.double_tap_action)})}" tabindex="${(0,r.J)(!this._config.tap_action||(0,f.h)(this._config.tap_action)?"0":void 0)}"> ${e||n.qy` <ha-state-icon class="weather-icon" .stateObj="${t}" .hass="${this.hass}"></ha-state-icon> `} </div> <div class="info ${(0,c.H)({pointer:i,"text-content":!s})}" @action="${this._handleAction}" .actionHandler="${(0,l.T)({hasHold:(0,f.h)(this._config.hold_action),hasDoubleClick:(0,f.h)(this._config.double_tap_action)})}"> ${u} ${s?n.qy` <div class="secondary"> ${"entity-id"===this._config.secondary_info?t.entity_id:"last-changed"===this._config.secondary_info?n.qy` <ha-relative-time .hass="${this.hass}" .datetime="${t.last_changed}" capitalize></ha-relative-time> `:"last-updated"===this._config.secondary_info?n.qy` <ha-relative-time .hass="${this.hass}" .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,f.h)(this._config.hold_action),hasDoubleClick:(0,f.h)(this._config.double_tap_action)})}"> <div> ${(0,h.g0)(t.state)||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,u.$)(this,this.hass,this._config,t.detail.action)}static get styles(){return[d.Ry,n.AH`:host{display:flex;align-items:center;flex-direction:row}.info{margin-left:16px;margin-inline-start:16px;margin-inline-end:initial;flex:1 0 60px}.info,.info>*{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.icon-image{display:flex;align-items:center;min-width:40px}.icon-image>*{flex:0 0 40px;height:40px}.icon-image:focus{outline:0;background-color:var(--divider-color);border-radius:var(--ha-border-radius-circle)}.weather-icon{--mdc-icon-size:40px}.pointer{cursor:pointer}.attributes{display:flex;flex-direction:column;justify-content:center;text-align:right;margin-left:8px;margin-inline-start:8px;margin-inline-end:initial}.secondary{color:var(--secondary-text-color)}`]}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,a.Cg)([(0,o.wk)()],y.prototype,"_config",void 0),(0,a.Cg)([(0,o.wk)()],y.prototype,"_forecastEvent",void 0),(0,a.Cg)([(0,o.wk)()],y.prototype,"_subscribed",void 0),y=(0,a.Cg)([(0,o.EM)("hui-weather-entity-row")],y),e()}catch(t){e(t)}})}};
//# sourceMappingURL=77547.75bf8fdf640794c5.js.map