import{r as t,h as s,f as i,a as e}from"./p-879b0f88.js";import{D as a}from"./p-6e09b0ac.js";import{W as o,a as c}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 o(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("generic-modal",{key:"556e1f83ac53f2e200aca1816f91f917bc455d3d",modalTitle:s("div",{"data-testid":a.walletConnetModalTitle},"xPortal Mobile Wallet"),modalSubtitle:s("div",{"data-testid":a.walletConnetModalSubtitle},"Scan this QR code with your app"),onClose:()=>this.close(),body:s("wallet-connect-body",{qrCodeSvg:this.qrCodeSvg})})}close(t={isUserClick:true}){if(t.isUserClick){this.walletConnectBase.eventBus.publish(c.CLOSE)}if(this.hostElement&&this.hostElement.parentNode){this.hostElement.parentNode.removeChild(this.hostElement)}}componentDidLoad(){this.walletConnectBase.subscribeEventBus({closeFn:()=>this.close({isUserClick:false}),forceUpdateFn:()=>{this.data=this.walletConnectBase.data;i(this)}})}disconnectedCallback(){this.walletConnectBase.unsubscribeEventBus({closeFn:()=>this.close({isUserClick:false}),forceUpdateFn:()=>{this.data=this.walletConnectBase.data;i(this)}})}get hostElement(){return e(this)}static get watchers(){return{data:["onDataChange"]}}};export{n as wallet_connect_modal};
//# sourceMappingURL=p-656b6b50.entry.js.map