import{r as t,h as s,f as i,a as e}from"./p-879b0f88.js";import{W as a}from"./p-a9480301.js";import"./p-9d530225.js";const n=class{constructor(s){t(this,s);this.data={wcURI:""};this.qrCodeSvg=""}componentWillLoad(){this.walletConnectBase=new a(this.data)}async getEventBus(){return this.walletConnectBase.getEventBus()}async onDataChange(t){if(t.wcURI){this.qrCodeSvg=await this.walletConnectBase.generateSVG(t.wcURI)}}render(){return s("wallet-connect-body",{key:"4463e8a2720f42c2ad932f2280b2f53a24b51c2a",qrCodeSvg:this.qrCodeSvg,description:"Scan this QR using xPortal"})}removeComponent(){var t;if((t=this.hostElement)===null||t===void 0?void 0:t.parentNode){this.hostElement.parentNode.removeChild(this.hostElement)}}componentDidLoad(){this.walletConnectBase.subscribeEventBus({closeFn:()=>this.removeComponent(),forceUpdateFn:()=>{this.data=this.walletConnectBase.data;i(this)}})}disconnectedCallback(){this.walletConnectBase.unsubscribeEventBus({closeFn:()=>this.removeComponent(),forceUpdateFn:()=>{this.data=this.walletConnectBase.data;i(this)}})}get hostElement(){return e(this)}static get watchers(){return{data:["onDataChange"]}}};export{n as wallet_connect};
//# sourceMappingURL=p-1c52fe2b.entry.js.map