`;this._title.prepend(c);b.append(this._title,this._message);this._overlay.append(b);this._inject();window.setInterval(()=>{this._inject()},250)}reason(a){this._message.textContent=a}_inject(){if(!this._overlay.isConnected){document.body?.prepend(this._overlay)}}}class e{constructor(a){this.url=a;this.poll_interval=5000;this._overlay=null}start(){const a=new WebSocket(this.url);a.onmessage=a=>{const b=JSON.parse(a.data);switch(b.type){case `reload`:this.reload();break;case `buildFailure`:this.buildFailure(b.data);break}};a.onclose=this.onclose}onclose(){window.setTimeout(()=>{const a=new WebSocket(this.url);a.onopen=()=>window.location.reload();a.onclose=this.onclose},this.poll_interval)}reload(){window.location.reload()}buildFailure({reason:a}){console.error(`Build failed:`,a);console.debug(`Overlay`,this._overlay);if(!this._overlay){this._overlay=new d()};this._overlay.reason=a}}new e(c).start()})()