import{i as k,r as $,e as R,a as y,b as l,k as m,f as d,S as h,x as f,T as x,g as I,W as A,R as T,h as S}from"./index-B6fu-u6K.js";import{n as C,c as N,U as O,o as _,r as g}from"./if-defined-D6swbWyQ.js";import"./index-BcLWk3X1.js";import"./index-CuJMoJHR.js";import"./index-DUZ-8KUm.js";import"./index-3DIVdSIw.js";const E=k`
button {
display: flex;
gap: var(--wui-spacing-xl);
width: 100%;
background-color: var(--wui-color-gray-glass-002);
border-radius: var(--wui-border-radius-xxs);
padding: var(--wui-spacing-m) var(--wui-spacing-s);
}
wui-text {
width: 100%;
}
wui-flex {
width: auto;
}
.network-icon {
width: var(--wui-spacing-2l);
height: var(--wui-spacing-2l);
border-radius: calc(var(--wui-spacing-2l) / 2);
overflow: hidden;
box-shadow:
0 0 0 3px var(--wui-color-gray-glass-002),
0 0 0 3px var(--wui-color-modal-bg);
}
`;var b=function(n,e,r,t){var o=arguments.length,i=o<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,r):t,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,r,t);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(i=(o<3?s(i):o>3?s(e,r,i):s(e,r))||i);return o>3&&i&&Object.defineProperty(e,r,i),i};let p=class extends y{constructor(){super(...arguments),this.networkImages=[""],this.text=""}render(){return l`
`}networksTemplate(){const e=this.networkImages.slice(0,5);return l`
${e==null?void 0:e.map(r=>l` `)}
`}};p.styles=[$,R,E];b([C({type:Array})],p.prototype,"networkImages",void 0);b([C()],p.prototype,"text",void 0);p=b([N("wui-compatible-network")],p);const W=k`
wui-compatible-network {
margin-top: var(--wui-spacing-l);
}
`;var w=function(n,e,r,t){var o=arguments.length,i=o<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,r):t,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,r,t);else for(var a=n.length-1;a>=0;a--)(s=n[a])&&(i=(o<3?s(i):o>3?s(e,r,i):s(e,r))||i);return o>3&&i&&Object.defineProperty(e,r,i),i};let u=class extends y{constructor(){super(),this.unsubscribe=[],this.address=m.state.address,this.profileName=m.state.profileName,this.network=d.state.activeCaipNetwork,this.unsubscribe.push(m.subscribe(e=>{e.address?(this.address=e.address,this.profileName=e.profileName):h.showError("Account not found")}),d.subscribeKey("activeCaipNetwork",e=>{e!=null&&e.id&&(this.network=e)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.address)throw new Error("w3m-wallet-receive-view: No account provided");const e=f.getNetworkImage(this.network);return l`
Copy your address or scan this QR code
${this.networkTemplate()}
`}networkTemplate(){var a;const e=d.getAllRequestedCaipNetworks(),r=d.checkIfSmartAccountEnabled(),t=d.state.activeCaipNetwork,o=e.filter(c=>(c==null?void 0:c.chainNamespace)===(t==null?void 0:t.chainNamespace));if(I(t==null?void 0:t.chainNamespace)===A.ACCOUNT_TYPES.SMART_ACCOUNT&&r)return t?l``:null;const s=((a=o==null?void 0:o.filter(c=>{var v;return(v=c==null?void 0:c.assets)==null?void 0:v.imageId}))==null?void 0:a.slice(0,5)).map(f.getNetworkImage).filter(Boolean);return l``}onReceiveClick(){T.push("WalletCompatibleNetworks")}onCopyClick(){try{this.address&&(S.copyToClopboard(this.address),h.showSuccess("Address copied"))}catch{h.showError("Failed to copy")}}};u.styles=W;w([g()],u.prototype,"address",void 0);w([g()],u.prototype,"profileName",void 0);w([g()],u.prototype,"network",void 0);u=w([N("w3m-wallet-receive-view")],u);export{u as W3mWalletReceiveView};