export const __rspack_esm_id=65620;export const __rspack_esm_ids=[65620];export const __webpack_modules__={50349(t,a,e){e.d(a,{},{I:"http://192.168.1.234:8123"})},27480(t,a,e){e(50349);const s=(t,a)=>t.sendMessage({type:"connect",refreshToken:a.data.refresh_token,clientId:a.data.clientId,hassUrl:a.data.hassUrl});e.d(a,{},{oK:s,tb:(t,a,e,s)=>t.sendMessage({type:"show_lovelace_view",viewPath:e,urlPath:s||null,hassUrl:a}),xV:(t,a)=>{if(!t.castConnectedToOurHass)return new Promise(e=>{const i=t.addEventListener("connection-changed",()=>{t.castConnectedToOurHass&&(i(),e())});s(t,a)})}})},95263(t,a,e){e.a(t,async function(t,s){try{e.r(a);var i=e(15697),n=e(57527),o=e(79224),c=e(97901),r=e(27480),h=e(98747),l=(e(34159),t([h]));h=(l.then?(await l)():l)[0];class d extends n.WF{setConfig(t){this._config={icon:"mdi:television",name:"Home Assistant Cast",view:0,...t}}shouldUpdate(t){return!(1===t.size&&t.has("hass"))}render(){if(!this._config)return n.s6;const t=this._castManager&&this._castManager.status&&this._config.view===this._castManager.status.lovelacePath&&this._config.dashboard===this._castManager.status.urlPath;return n.qy` <ha-icon .icon=${this._config.icon}></ha-icon> <div class="flex"> <div class="name">${this._config.name}</div> ${this._noHTTPS?n.qy` Cast requires HTTPS `:void 0===this._castManager?n.s6:null===this._castManager?n.qy` Cast API unavailable `:"NO_DEVICES_AVAILABLE"===this._castManager.castState?n.qy` No devices found `:n.qy` <div class="controls"> <google-cast-launcher></google-cast-launcher> <ha-button @click=${this._sendLovelace} class=${(0,c.H)({inactive:!t})} appearance="plain" size="s" .disabled=${!this._castManager.status}> SHOW </ha-button> </div> `} </div> `}firstUpdated(t){super.firstUpdated(t),"http:"===location.protocol&&"localhost"!==location.hostname&&(this._noHTTPS=!0),e.e(33336).then(e.bind(e,72875)).then(({getCastManager:t})=>t(this.hass.auth).then(t=>{this._castManager=t,t.addEventListener("connection-changed",()=>{this.requestUpdate()}),t.addEventListener("state-changed",()=>{this.requestUpdate()})},()=>{this._castManager=null}))}updated(t){super.updated(t),this._config&&this._config.hide_if_unavailable&&(this.style.display=this._castManager&&"NO_DEVICES_AVAILABLE"!==this._castManager.castState?"":"none")}async _sendLovelace(){await(0,r.xV)(this._castManager,this.hass.auth),(0,r.tb)(this._castManager,this.hass.auth.data.hassUrl,this._config.view,this._config.dashboard)}constructor(...t){super(...t),this._noHTTPS=!1}}d.styles=n.AH`:host{align-items:center;display:flex}ha-icon{color:var(--state-icon-color);padding:8px}.flex{margin-left:16px;flex:1;justify-content:space-between;align-items:center;margin-inline-start:16px;margin-inline-end:initial;display:flex}.name{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.controls{align-items:center;display:flex}google-cast-launcher{margin-right:.57em;cursor:pointer;width:24px;height:24px;margin-inline-start:initial;margin-inline-end:-.57em;display:inline-block}.inactive{padding:0 4px}`,(0,i.Cg)([(0,o.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,i.Cg)([(0,o.wk)()],d.prototype,"_config",void 0),(0,i.Cg)([(0,o.wk)()],d.prototype,"_castManager",void 0),(0,i.Cg)([(0,o.wk)()],d.prototype,"_noHTTPS",void 0),d=(0,i.Cg)([(0,o.EM)("hui-cast-row")],d),s()}catch(t){s(t)}})}};
//# sourceMappingURL=65620.7434e5fc4dde628f.js.map