`}onAllWallets(){I.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),m.push("AllWallets")}};it([c()],Le.prototype,"tabIdx",void 0);it([d()],Le.prototype,"connectors",void 0);it([d()],Le.prototype,"count",void 0);it([d()],Le.prototype,"filteredCount",void 0);it([d()],Le.prototype,"isFetchingRecommendedWallets",void 0);Le=it([p("w3m-all-wallets-widget")],Le);var Gt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let at=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=w.state.connectors,this.connections=y.state.connections,this.unsubscribe.push(w.subscribeKey("connectors",e=>this.connectors=e),y.subscribeKey("connections",e=>this.connections=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.filter(i=>i.type==="ANNOUNCED");return e!=null&&e.length?l`
${e.filter(We.showConnector).map(i=>{const s=(this.connections.get(i.chain)??[]).some(n=>X.isLowerCaseMatch(n.connectorId,i.id));return l`
this.onConnector(i)}
tagVariant=${s?"info":"success"}
tagLabel=${s?"connected":"installed"}
size="sm"
data-testid=${`wallet-selector-${i.id}`}
.installed=${!0}
tabIdx=${h(this.tabIdx)}
>
`})}
`:(this.style.cssText="display: none",null)}onConnector(e){e.id==="walletConnect"?b.isMobile()?m.push("AllWallets"):m.push("ConnectingWalletConnect"):m.push("ConnectingExternal",{connector:e})}};Gt([c()],at.prototype,"tabIdx",void 0);Gt([d()],at.prototype,"connectors",void 0);Gt([d()],at.prototype,"connections",void 0);at=Gt([p("w3m-connect-announced-widget")],at);var Yt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let lt=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=w.state.connectors,this.loading=!1,this.unsubscribe.push(w.subscribeKey("connectors",e=>this.connectors=e)),b.isTelegram()&&b.isIos()&&(this.loading=!y.state.wcUri,this.unsubscribe.push(y.subscribeKey("wcUri",e=>this.loading=!e)))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const{customWallets:e}=x.state;if(!(e!=null&&e.length))return this.style.cssText="display: none",null;const i=this.filterOutDuplicateWallets(e),o=y.hasAnyConnection(A.CONNECTOR_ID.WALLET_CONNECT);return l`
${i.map(s=>l`
this.onConnectWallet(s)}
size="sm"
data-testid=${`wallet-selector-${s.id}`}
tabIdx=${h(this.tabIdx)}
?loading=${this.loading}
?disabled=${o}
>
`)}
`}filterOutDuplicateWallets(e){const i=fe.getRecentWallets(),o=this.connectors.map(a=>{var g;return(g=a.info)==null?void 0:g.rdns}).filter(Boolean),s=i.map(a=>a.rdns).filter(Boolean),n=o.concat(s);if(n.includes("io.metamask.mobile")&&b.isMobile()){const a=n.indexOf("io.metamask.mobile");n[a]="io.metamask"}return e.filter(a=>!n.includes(String(a==null?void 0:a.rdns)))}onConnectWallet(e){this.loading||m.push("ConnectingWalletConnect",{wallet:e})}};Yt([c()],lt.prototype,"tabIdx",void 0);Yt([d()],lt.prototype,"connectors",void 0);Yt([d()],lt.prototype,"loading",void 0);lt=Yt([p("w3m-connect-custom-widget")],lt);var Ci=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Nt=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=w.state.connectors,this.unsubscribe.push(w.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const o=this.connectors.filter(n=>n.type==="EXTERNAL").filter(We.showConnector).filter(n=>n.id!==A.CONNECTOR_ID.COINBASE_SDK);if(!(o!=null&&o.length))return this.style.cssText="display: none",null;const s=y.hasAnyConnection(A.CONNECTOR_ID.WALLET_CONNECT);return l`
${o.map(n=>l`
this.onConnector(n)}
tabIdx=${h(this.tabIdx)}
?disabled=${s}
>
`)}
`}onConnector(e){m.push("ConnectingExternal",{connector:e})}};Ci([c()],Nt.prototype,"tabIdx",void 0);Ci([d()],Nt.prototype,"connectors",void 0);Nt=Ci([p("w3m-connect-external-widget")],Nt);var Si=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Rt=class extends f{constructor(){super(...arguments),this.tabIdx=void 0,this.wallets=[]}render(){if(!this.wallets.length)return this.style.cssText="display: none",null;const e=y.hasAnyConnection(A.CONNECTOR_ID.WALLET_CONNECT);return l`
${this.wallets.map(i=>l`
this.onConnectWallet(i)}
tabIdx=${h(this.tabIdx)}
size="sm"
?disabled=${e}
>
`)}
`}onConnectWallet(e){w.selectWalletConnector(e)}};Si([c()],Rt.prototype,"tabIdx",void 0);Si([c()],Rt.prototype,"wallets",void 0);Rt=Si([p("w3m-connect-featured-widget")],Rt);var Xt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let ct=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=[],this.connections=y.state.connections,this.unsubscribe.push(y.subscribeKey("connections",e=>this.connections=e))}render(){const e=this.connectors.filter(We.showConnector);return e.length===0?(this.style.cssText="display: none",null):l`
${e.map(i=>{const s=(this.connections.get(i.chain)??[]).some(n=>X.isLowerCaseMatch(n.connectorId,i.id));return l`
this.onConnector(i)}
tabIdx=${h(this.tabIdx)}
>
`})}
`}onConnector(e){w.setActiveConnector(e),m.push("ConnectingExternal",{connector:e})}};Xt([c()],ct.prototype,"tabIdx",void 0);Xt([c()],ct.prototype,"connectors",void 0);Xt([d()],ct.prototype,"connections",void 0);ct=Xt([p("w3m-connect-injected-widget")],ct);var Ai=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ot=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=w.state.connectors,this.unsubscribe.push(w.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.connectors.filter(i=>i.type==="MULTI_CHAIN"&&i.name!=="WalletConnect");return e!=null&&e.length?l`
${e.map(i=>l`
this.onConnector(i)}
tabIdx=${h(this.tabIdx)}
>
`)}
`:(this.style.cssText="display: none",null)}onConnector(e){w.setActiveConnector(e),m.push("ConnectingMultiChain")}};Ai([c()],Ot.prototype,"tabIdx",void 0);Ai([d()],Ot.prototype,"connectors",void 0);Ot=Ai([p("w3m-connect-multi-chain-widget")],Ot);var Qt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let dt=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=w.state.connectors,this.loading=!1,this.unsubscribe.push(w.subscribeKey("connectors",e=>this.connectors=e)),b.isTelegram()&&b.isIos()&&(this.loading=!y.state.wcUri,this.unsubscribe.push(y.subscribeKey("wcUri",e=>this.loading=!e)))}render(){const i=fe.getRecentWallets().filter(s=>!Te.isExcluded(s)).filter(s=>!this.hasWalletConnector(s)).filter(s=>this.isWalletCompatibleWithCurrentChain(s));if(!i.length)return this.style.cssText="display: none",null;const o=y.hasAnyConnection(A.CONNECTOR_ID.WALLET_CONNECT);return l`
${i.map(s=>l`
this.onConnectWallet(s)}
tagLabel="recent"
tagVariant="info"
size="sm"
tabIdx=${h(this.tabIdx)}
?loading=${this.loading}
?disabled=${o}
>
`)}
`}onConnectWallet(e){this.loading||w.selectWalletConnector(e)}hasWalletConnector(e){return this.connectors.some(i=>i.id===e.id||i.name===e.name)}isWalletCompatibleWithCurrentChain(e){const i=u.state.activeChain;return i&&e.chains?e.chains.some(o=>{const s=o.split(":")[0];return i===s}):!0}};Qt([c()],dt.prototype,"tabIdx",void 0);Qt([d()],dt.prototype,"connectors",void 0);Qt([d()],dt.prototype,"loading",void 0);dt=Qt([p("w3m-connect-recent-widget")],dt);var Zt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Xi=4;let ut=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.wallets=[],this.loading=!1,b.isTelegram()&&b.isIos()&&(this.loading=!y.state.wcUri,this.unsubscribe.push(y.subscribeKey("wcUri",e=>this.loading=!e)))}render(){var Ni,Ri,Oi,Pi,Di,ji;const{connectors:e}=w.state,{customWallets:i,featuredWalletIds:o}=x.state,s=e.find(Y=>Y.id==="walletConnect"),n=e.filter(Y=>Y.type==="INJECTED"||Y.type==="ANNOUNCED"||Y.type==="MULTI_CHAIN");if(!s&&!n.length&&!(i!=null&&i.length))return null;const r=!!((Ni=x.state.features)!=null&&Ni.email||(Ri=x.state.remoteFeatures)!=null&&Ri.email),a=Array.isArray((Oi=x.state.features)==null?void 0:Oi.socials)&&((Pi=x.state.features)==null?void 0:Pi.socials.length)>0||Array.isArray((Di=x.state.remoteFeatures)==null?void 0:Di.socials)&&((ji=x.state.remoteFeatures)==null?void 0:ji.socials.length)>0,g=n.filter(Y=>Y.name!=="Browser Wallet"),C=(o==null?void 0:o.length)||0,W=(i==null?void 0:i.length)||0,O=g.length||0,B=r?1:0,ni=a?1:0,St=C+W+O+B+ni;if(St>=Xi)return this.style.cssText="display: none",null;const Ti=Te.filterOutDuplicateWallets(this.wallets).slice(0,Xi-St);if(!Ti.length)return this.style.cssText="display: none",null;const Cn=y.hasAnyConnection(A.CONNECTOR_ID.WALLET_CONNECT);return l`
${Ti.map(Y=>l`
this.onConnectWallet(Y)}
size="sm"
tabIdx=${h(this.tabIdx)}
?loading=${this.loading}
?disabled=${Cn}
>
`)}
`}onConnectWallet(e){if(this.loading)return;const i=w.getConnector({id:e.id,rdns:e.rdns});i?m.push("ConnectingExternal",{connector:i}):m.push("ConnectingWalletConnect",{wallet:e})}};Zt([c()],ut.prototype,"tabIdx",void 0);Zt([c()],ut.prototype,"wallets",void 0);Zt([d()],ut.prototype,"loading",void 0);ut=Zt([p("w3m-connect-recommended-widget")],ut);var Jt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let ht=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=w.state.connectors,this.connectorImages=_e.state.connectorImages,this.unsubscribe.push(w.subscribeKey("connectors",e=>this.connectors=e),_e.subscribeKey("connectorImages",e=>this.connectorImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(b.isMobile())return this.style.cssText="display: none",null;const e=this.connectors.find(s=>s.id==="walletConnect");if(!e)return this.style.cssText="display: none",null;const i=e.imageUrl||this.connectorImages[(e==null?void 0:e.imageId)??""],o=y.hasAnyConnection(A.CONNECTOR_ID.WALLET_CONNECT);return l`
this.onConnector(e)}
tagLabel="qr code"
tagVariant="accent"
tabIdx=${h(this.tabIdx)}
data-testid="wallet-selector-walletconnect"
size="sm"
?disabled=${o}
>
`}onConnector(e){w.setActiveConnector(e),m.push("ConnectingWalletConnect")}};Jt([c()],ht.prototype,"tabIdx",void 0);Jt([d()],ht.prototype,"connectors",void 0);Jt([d()],ht.prototype,"connectorImages",void 0);ht=Jt([p("w3m-connect-walletconnect-widget")],ht);const $o=v`
:host {
margin-top: ${({spacing:t})=>t[1]};
}
wui-separator {
margin: ${({spacing:t})=>t[3]} calc(${({spacing:t})=>t[3]} * -1)
${({spacing:t})=>t[2]} calc(${({spacing:t})=>t[3]} * -1);
width: calc(100% + ${({spacing:t})=>t[3]} * 2);
}
`;var vt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Be=class extends f{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=w.state.connectors,this.recommended=E.state.recommended,this.featured=E.state.featured,this.unsubscribe.push(w.subscribeKey("connectors",e=>this.connectors=e),E.subscribeKey("recommended",e=>this.recommended=e),E.subscribeKey("featured",e=>this.featured=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
${this.connectorListTemplate()}
`}connectorListTemplate(){const e=We.getConnectorsByType(this.connectors,this.recommended,this.featured),{custom:i,recent:o,announced:s,injected:n,multiChain:r,recommended:a,featured:g,external:C}=e;return We.getConnectorTypeOrder({custom:i,recent:o,announced:s,injected:n,multiChain:r,recommended:a,featured:g,external:C}).map(O=>{switch(O){case"injected":return l`
${r.length?l``:null}
${s.length?l``:null}
${n.length?l``:null}
`;case"walletConnect":return l``;case"recent":return l``;case"featured":return l``;case"custom":return l``;case"external":return l``;case"recommended":return l``;default:return console.warn(`Unknown connector type: ${O}`),null}})}};Be.styles=$o;vt([c()],Be.prototype,"tabIdx",void 0);vt([d()],Be.prototype,"connectors",void 0);vt([d()],Be.prototype,"recommended",void 0);vt([d()],Be.prototype,"featured",void 0);Be=vt([p("w3m-connector-list")],Be);var fn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let ui=class extends f{constructor(){super(...arguments),this.tabIdx=void 0}render(){return l`
`}};fn([c()],ui.prototype,"tabIdx",void 0);ui=fn([p("w3m-wallet-login-list")],ui);const Co=v`
:host {
--connect-scroll--top-opacity: 0;
--connect-scroll--bottom-opacity: 0;
--connect-mask-image: none;
}
.connect {
max-height: clamp(360px, 470px, 80vh);
scrollbar-width: none;
overflow-y: scroll;
overflow-x: hidden;
transition: opacity ${({durations:t})=>t.lg}
${({easings:t})=>t["ease-out-power-2"]};
will-change: opacity;
mask-image: var(--connect-mask-image);
}
.guide {
transition: opacity ${({durations:t})=>t.lg}
${({easings:t})=>t["ease-out-power-2"]};
will-change: opacity;
}
.connect::-webkit-scrollbar {
display: none;
}
.all-wallets {
flex-flow: column;
}
.connect.disabled,
.guide.disabled {
opacity: 0.3;
pointer-events: none;
user-select: none;
}
wui-separator {
margin: ${({spacing:t})=>t[3]} calc(${({spacing:t})=>t[3]} * -1);
width: calc(100% + ${({spacing:t})=>t[3]} * 2);
}
`;var ae=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const So=470;let q=class extends f{constructor(){var e,i;super(),this.unsubscribe=[],this.connectors=w.state.connectors,this.authConnector=this.connectors.find(o=>o.type==="AUTH"),this.features=x.state.features,this.remoteFeatures=x.state.remoteFeatures,this.enableWallets=x.state.enableWallets,this.noAdapters=u.state.noAdapters,this.walletGuide="get-started",this.checked=It.state.isLegalCheckboxChecked,this.isEmailEnabled=((e=this.remoteFeatures)==null?void 0:e.email)&&!u.state.noAdapters,this.isSocialEnabled=((i=this.remoteFeatures)==null?void 0:i.socials)&&this.remoteFeatures.socials.length>0&&!u.state.noAdapters,this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors),this.unsubscribe.push(w.subscribeKey("connectors",o=>{this.connectors=o,this.authConnector=this.connectors.find(s=>s.type==="AUTH"),this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors)}),x.subscribeKey("features",o=>{this.features=o}),x.subscribeKey("remoteFeatures",o=>{this.remoteFeatures=o,this.setEmailAndSocialEnableCheck(this.noAdapters,this.remoteFeatures)}),x.subscribeKey("enableWallets",o=>this.enableWallets=o),u.subscribeKey("noAdapters",o=>this.setEmailAndSocialEnableCheck(o,this.remoteFeatures)),It.subscribeKey("isLegalCheckboxChecked",o=>this.checked=o))}disconnectedCallback(){var i,o;this.unsubscribe.forEach(s=>s()),(i=this.resizeObserver)==null||i.disconnect();const e=(o=this.shadowRoot)==null?void 0:o.querySelector(".connect");e==null||e.removeEventListener("scroll",this.handleConnectListScroll.bind(this))}firstUpdated(){var i,o;const e=(i=this.shadowRoot)==null?void 0:i.querySelector(".connect");e&&(requestAnimationFrame(this.handleConnectListScroll.bind(this)),e==null||e.addEventListener("scroll",this.handleConnectListScroll.bind(this)),this.resizeObserver=new ResizeObserver(()=>{this.handleConnectListScroll()}),(o=this.resizeObserver)==null||o.observe(e),this.handleConnectListScroll())}render(){var B;const{termsConditionsUrl:e,privacyPolicyUrl:i}=x.state,o=(B=x.state.features)==null?void 0:B.legalCheckbox,r=!!(e||i)&&!!o&&this.walletGuide==="get-started"&&!this.checked,a={connect:!0,disabled:r},g=x.state.enableWalletGuide,C=this.enableWallets,W=this.isSocialEnabled||this.authConnector,O=r?-1:void 0;return l`
${this.legalCheckboxTemplate()}
${this.renderConnectMethod(O)}
${this.reownBrandingTemplate()}
`}reownBrandingTemplate(){var e;return bi.hasFooter()||!((e=this.remoteFeatures)!=null&&e.reownBranding)?null:l``}setEmailAndSocialEnableCheck(e,i){this.isEmailEnabled=(i==null?void 0:i.email)&&!e,this.isSocialEnabled=(i==null?void 0:i.socials)&&i.socials.length>0&&!e,this.remoteFeatures=i,this.noAdapters=e}checkIfAuthEnabled(e){const i=e.filter(s=>s.type===kn.CONNECTOR_TYPE_AUTH).map(s=>s.chain);return A.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(s=>i.includes(s))}renderConnectMethod(e){const i=Te.getConnectOrderMethod(this.features,this.connectors);return l`${i.map((o,s)=>{switch(o){case"email":return l`${this.emailTemplate(e)} ${this.separatorTemplate(s,"email")}`;case"social":return l`${this.socialListTemplate(e)}
${this.separatorTemplate(s,"social")}`;case"wallet":return l`${this.walletListTemplate(e)}
${this.separatorTemplate(s,"wallet")}`;default:return null}})}`}checkMethodEnabled(e){switch(e){case"wallet":return this.enableWallets;case"social":return this.isSocialEnabled&&this.isAuthEnabled;case"email":return this.isEmailEnabled&&this.isAuthEnabled;default:return null}}checkIsThereNextMethod(e){const o=Te.getConnectOrderMethod(this.features,this.connectors)[e+1];return o?this.checkMethodEnabled(o)?o:this.checkIsThereNextMethod(e+1):void 0}separatorTemplate(e,i){const o=this.checkIsThereNextMethod(e),s=this.walletGuide==="explore";switch(i){case"wallet":return this.enableWallets&&o&&!s?l``:null;case"email":{const n=o==="social";return this.isAuthEnabled&&this.isEmailEnabled&&!n&&o?l``:null}case"social":{const n=o==="email";return this.isAuthEnabled&&this.isSocialEnabled&&!n&&o?l``:null}default:return null}}emailTemplate(e){return!this.isEmailEnabled||!this.isAuthEnabled?null:l``}socialListTemplate(e){return!this.isSocialEnabled||!this.isAuthEnabled?null:l``}walletListTemplate(e){var a,g;const i=this.enableWallets,o=((a=this.features)==null?void 0:a.emailShowWallets)===!1,s=(g=this.features)==null?void 0:g.collapseWallets,n=o||s;return!i||(b.isTelegram()&&(b.isSafari()||b.isIos())&&y.connectWalletConnect().catch(C=>({})),this.walletGuide==="explore")?null:this.isAuthEnabled&&(this.isEmailEnabled||this.isSocialEnabled)&&n?l``:l``}legalCheckboxTemplate(){return this.walletGuide==="explore"?null:l``}handleConnectListScroll(){var o;const e=(o=this.shadowRoot)==null?void 0:o.querySelector(".connect");if(!e)return;e.scrollHeight>So?(e.style.setProperty("--connect-mask-image",`linear-gradient(
to bottom,
rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px,
rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px,
black 100px,
black calc(100% - 100px),
rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px),
rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100%
)`),e.style.setProperty("--connect-scroll--top-opacity",At.interpolate([0,50],[0,1],e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",At.interpolate([0,50],[0,1],e.scrollHeight-e.scrollTop-e.offsetHeight).toString())):(e.style.setProperty("--connect-mask-image","none"),e.style.setProperty("--connect-scroll--top-opacity","0"),e.style.setProperty("--connect-scroll--bottom-opacity","0"))}onContinueWalletClick(){m.push("ConnectWallets")}};q.styles=Co;ae([d()],q.prototype,"connectors",void 0);ae([d()],q.prototype,"authConnector",void 0);ae([d()],q.prototype,"features",void 0);ae([d()],q.prototype,"remoteFeatures",void 0);ae([d()],q.prototype,"enableWallets",void 0);ae([d()],q.prototype,"noAdapters",void 0);ae([c()],q.prototype,"walletGuide",void 0);ae([d()],q.prototype,"checked",void 0);ae([d()],q.prototype,"isEmailEnabled",void 0);ae([d()],q.prototype,"isSocialEnabled",void 0);ae([d()],q.prototype,"isAuthEnabled",void 0);q=ae([p("w3m-connect-view")],q);const Ao=v`
wui-flex {
width: 100%;
height: 52px;
box-sizing: border-box;
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
border-radius: ${({borderRadius:t})=>t[5]};
padding-left: ${({spacing:t})=>t[3]};
padding-right: ${({spacing:t})=>t[3]};
display: flex;
align-items: center;
justify-content: space-between;
gap: ${({spacing:t})=>t[6]};
}
wui-text {
color: ${({tokens:t})=>t.theme.textSecondary};
}
wui-icon {
width: 12px;
height: 12px;
}
`;var ei=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ye=class extends f{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return l`
${this.label}
${this.buttonLabel}
`}};Ye.styles=[_,T,Ao];ei([c({type:Boolean})],Ye.prototype,"disabled",void 0);ei([c()],Ye.prototype,"label",void 0);ei([c()],Ye.prototype,"buttonLabel",void 0);Ye=ei([p("wui-cta-button")],Ye);const Io=v`
:host {
display: block;
padding: 0 ${({spacing:t})=>t[5]} ${({spacing:t})=>t[5]};
}
`;var wn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Pt=class extends f{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;const{name:e,app_store:i,play_store:o,chrome_store:s,homepage:n}=this.wallet,r=b.isMobile(),a=b.isIos(),g=b.isAndroid(),C=[i,o,n,s].filter(Boolean).length>1,W=V.getTruncateString({string:e,charsStart:12,charsEnd:0,truncate:"end"});return C&&!r?l`
m.push("Downloads",{wallet:this.wallet})}
>
`:!C&&n?l`
`:i&&a?l`
`:o&&g?l`
`:(this.style.display="none",null)}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&b.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&b.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&b.openHref(this.wallet.homepage,"_blank")}};Pt.styles=[Io];wn([c({type:Object})],Pt.prototype,"wallet",void 0);Pt=wn([p("w3m-mobile-download-links")],Pt);const Eo=v`
@keyframes shake {
0% {
transform: translateX(0);
}
25% {
transform: translateX(3px);
}
50% {
transform: translateX(-3px);
}
75% {
transform: translateX(3px);
}
100% {
transform: translateX(0);
}
}
wui-flex:first-child:not(:only-child) {
position: relative;
}
wui-wallet-image {
width: 56px;
height: 56px;
}
wui-loading-thumbnail {
position: absolute;
}
wui-icon-box {
position: absolute;
right: calc(${({spacing:t})=>t[1]} * -1);
bottom: calc(${({spacing:t})=>t[1]} * -1);
opacity: 0;
transform: scale(0.5);
transition-property: opacity, transform;
transition-duration: ${({durations:t})=>t.lg};
transition-timing-function: ${({easings:t})=>t["ease-out-power-2"]};
will-change: opacity, transform;
}
wui-text[align='center'] {
width: 100%;
padding: 0px ${({spacing:t})=>t[4]};
}
[data-error='true'] wui-icon-box {
opacity: 1;
transform: scale(1);
}
[data-error='true'] > wui-flex:first-child {
animation: shake 250ms ${({easings:t})=>t["ease-out-power-2"]} both;
}
[data-retry='false'] wui-link {
display: none;
}
[data-retry='true'] wui-link {
display: block;
opacity: 1;
}
w3m-mobile-download-links {
padding: 0px;
width: 100%;
}
`;var pe=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};class R extends f{constructor(){var e,i,o,s,n;super(),this.wallet=(e=m.state.data)==null?void 0:e.wallet,this.connector=(i=m.state.data)==null?void 0:i.connector,this.timeout=void 0,this.secondaryBtnIcon="refresh",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=S.getWalletImage(this.wallet)??S.getConnectorImage(this.connector),this.name=((o=this.wallet)==null?void 0:o.name)??((s=this.connector)==null?void 0:s.name)??"Wallet",this.isRetrying=!1,this.uri=y.state.wcUri,this.error=y.state.wcError,this.ready=!1,this.showRetry=!1,this.label=void 0,this.secondaryBtnLabel="Try again",this.secondaryLabel="Accept connection request in the wallet",this.isLoading=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(y.subscribeKey("wcUri",r=>{var a;this.uri=r,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,(a=this.onConnect)==null||a.call(this))}),y.subscribeKey("wcError",r=>this.error=r)),(b.isTelegram()||b.isSafari())&&b.isIos()&&y.state.wcUri&&((n=this.onConnect)==null||n.call(this))}firstUpdated(){var e;(e=this.onAutoConnect)==null||e.call(this),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),y.setWcError(!1),clearTimeout(this.timeout)}render(){var o;(o=this.onRender)==null||o.call(this),this.onShowRetry();const e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel;let i="";return this.label?i=this.label:(i=`Continue in ${this.name}`,this.error&&(i="Connection declined")),l`
${this.error?null:this.loaderTemplate()}
${i}
${e}
${this.secondaryBtnLabel?l`
${this.secondaryBtnLabel}
`:null}
${this.isWalletConnect?l`
Copy link
`:null}
`}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const i=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");i==null||i.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){var e,i;y.setWcError(!1),this.onRetry?(this.isRetrying=!0,(e=this.onRetry)==null||e.call(this)):(i=this.onConnect)==null||i.call(this)}loaderTemplate(){const e=ri.state.themeVariables["--w3m-border-radius-master"],i=e?parseInt(e.replace("px",""),10):4;return l``}onCopyUri(){try{this.uri&&(b.copyToClopboard(this.uri),k.showSuccess("Link copied"))}catch{k.showError("Failed to copy")}}}R.styles=Eo;pe([d()],R.prototype,"isRetrying",void 0);pe([d()],R.prototype,"uri",void 0);pe([d()],R.prototype,"error",void 0);pe([d()],R.prototype,"ready",void 0);pe([d()],R.prototype,"showRetry",void 0);pe([d()],R.prototype,"label",void 0);pe([d()],R.prototype,"secondaryBtnLabel",void 0);pe([d()],R.prototype,"secondaryLabel",void 0);pe([d()],R.prototype,"isLoading",void 0);pe([c({type:Boolean})],R.prototype,"isMobile",void 0);pe([c()],R.prototype,"onRetry",void 0);var ko=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Qi=class extends R{constructor(){var i,o,s,n;if(super(),this.externalViewUnsubscribe=[],this.connectionsByNamespace=y.getConnections((i=this.connector)==null?void 0:i.chain),this.hasMultipleConnections=this.connectionsByNamespace.length>0,this.remoteFeatures=x.state.remoteFeatures,this.currentActiveConnectorId=w.state.activeConnectorIds[(o=this.connector)==null?void 0:o.chain],!this.connector)throw new Error("w3m-connecting-view: No connector provided");const e=(s=this.connector)==null?void 0:s.chain;this.isAlreadyConnected(this.connector)&&(this.secondaryBtnLabel=void 0,this.label=`This account is already linked, change your account in ${this.connector.name}`,this.secondaryLabel=`To link a new account, open ${this.connector.name} and switch to the account you want to link`),I.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser",displayIndex:(n=this.wallet)==null?void 0:n.display_index}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1,this.externalViewUnsubscribe.push(w.subscribeKey("activeConnectorIds",r=>{var C;const a=r[e],g=(C=this.remoteFeatures)==null?void 0:C.multiWallet;a!==this.currentActiveConnectorId&&(this.hasMultipleConnections&&g?(m.replace("ProfileWallets"),k.showSuccess("New Wallet Added")):D.close())}),y.subscribeKey("connections",this.onConnectionsChange.bind(this)))}disconnectedCallback(){this.externalViewUnsubscribe.forEach(e=>e())}async onConnectProxy(){try{if(this.error=!1,this.connector){if(this.isAlreadyConnected(this.connector))return;(this.connector.id!==A.CONNECTOR_ID.COINBASE_SDK||!this.error)&&(await y.connectExternal(this.connector,this.connector.chain),I.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.connector.name||"Unknown"}}))}}catch(e){I.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(e==null?void 0:e.message)??"Unknown"}}),this.error=!0}}onConnectionsChange(e){var i,o;if((i=this.connector)!=null&&i.chain&&e.get(this.connector.chain)&&this.isAlreadyConnected(this.connector)){const s=e.get(this.connector.chain)??[],n=(o=this.remoteFeatures)==null?void 0:o.multiWallet;if(s.length===0)m.replace("Connect");else{const r=xe.getConnectionsByConnectorId(this.connectionsByNamespace,this.connector.id).flatMap(g=>g.accounts),a=xe.getConnectionsByConnectorId(s,this.connector.id).flatMap(g=>g.accounts);a.length===0?this.hasMultipleConnections&&n?(m.replace("ProfileWallets"),k.showSuccess("Wallet deleted")):D.close():!r.every(C=>a.some(W=>X.isLowerCaseMatch(C.address,W.address)))&&n&&m.replace("ProfileWallets")}}}isAlreadyConnected(e){return!!e&&this.connectionsByNamespace.some(i=>X.isLowerCaseMatch(i.connectorId,e.id))}};Qi=ko([p("w3m-connecting-external-view")],Qi);const _o=ne`
wui-flex,
wui-list-wallet {
width: 100%;
}
`;var mn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Dt=class extends f{constructor(){super(),this.unsubscribe=[],this.activeConnector=w.state.activeConnector,this.unsubscribe.push(w.subscribeKey("activeConnector",e=>this.activeConnector=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e;return l`
Select Chain for ${(e=this.activeConnector)==null?void 0:e.name}
Select which chain to connect to your multi chain wallet
${this.networksTemplate()}
`}networksTemplate(){var e,i;return(i=(e=this.activeConnector)==null?void 0:e.connectors)==null?void 0:i.map(o=>o.name?l`
this.onConnector(o)}
size="sm"
data-testid="wui-list-chain-${o.chain}"
>
`:null)}onConnector(e){var o,s;const i=(s=(o=this.activeConnector)==null?void 0:o.connectors)==null?void 0:s.find(n=>n.chain===e.chain);if(!i){k.showError("Failed to find connector");return}i.id==="walletConnect"?b.isMobile()?m.push("AllWallets"):m.push("ConnectingWalletConnect"):m.push("ConnectingExternal",{connector:i})}};Dt.styles=_o;mn([d()],Dt.prototype,"activeConnector",void 0);Dt=mn([p("w3m-connecting-multi-chain-view")],Dt);var Ii=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let jt=class extends f{constructor(){super(...arguments),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.generateTabs();return l`
`}generateTabs(){const e=this.platforms.map(i=>i==="browser"?{label:"Browser",icon:"extension",platform:"browser"}:i==="mobile"?{label:"Mobile",icon:"mobile",platform:"mobile"}:i==="qrcode"?{label:"Mobile",icon:"mobile",platform:"qrcode"}:i==="web"?{label:"Webapp",icon:"browser",platform:"web"}:i==="desktop"?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"});return this.platformTabs=e.map(({platform:i})=>i),e}onTabChange(e){var o;const i=this.platformTabs[e];i&&((o=this.onSelectPlatfrom)==null||o.call(this,i))}};Ii([c({type:Array})],jt.prototype,"platforms",void 0);Ii([c()],jt.prototype,"onSelectPlatfrom",void 0);jt=Ii([p("w3m-connecting-header")],jt);var Wo=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Zi=class extends R{constructor(){var e;if(super(),!this.wallet)throw new Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),I.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:(e=this.wallet)==null?void 0:e.display_index}})}async onConnectProxy(){var e;try{this.error=!1;const{connectors:i}=w.state,o=i.find(s=>{var n,r,a;return s.type==="ANNOUNCED"&&((n=s.info)==null?void 0:n.rdns)===((r=this.wallet)==null?void 0:r.rdns)||s.type==="INJECTED"||s.name===((a=this.wallet)==null?void 0:a.name)});if(o)await y.connectExternal(o,o.chain);else throw new Error("w3m-connecting-wc-browser: No connector found");D.close(),I.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:((e=this.wallet)==null?void 0:e.name)||"Unknown"}})}catch(i){I.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(i==null?void 0:i.message)??"Unknown"}}),this.error=!0}}};Zi=Wo([p("w3m-connecting-wc-browser")],Zi);var To=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ji=class extends R{constructor(){var e;if(super(),!this.wallet)throw new Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),I.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop",displayIndex:(e=this.wallet)==null?void 0:e.display_index}})}onRenderProxy(){var e;!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.desktop_link&&this.uri)try{this.error=!1;const{desktop_link:i,name:o}=this.wallet,{redirect:s,href:n}=b.formatNativeUrl(i,this.uri);y.setWcLinking({name:o,href:n}),y.setRecentWallet(this.wallet),b.openHref(s,"_blank")}catch{this.error=!0}}};Ji=To([p("w3m-connecting-wc-desktop")],Ji);var nt=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ue=class extends R{constructor(){var e;if(super(),this.btnLabelTimeout=void 0,this.redirectDeeplink=void 0,this.redirectUniversalLink=void 0,this.target=void 0,this.preferUniversalLinks=x.state.experimental_preferUniversalLinks,this.isLoading=!0,this.onConnect=()=>{var i;if((i=this.wallet)!=null&&i.mobile_link&&this.uri)try{this.error=!1;const{mobile_link:o,link_mode:s,name:n}=this.wallet,{redirect:r,redirectUniversalLink:a,href:g}=b.formatNativeUrl(o,this.uri,s);this.redirectDeeplink=r,this.redirectUniversalLink=a,this.target=b.isIframe()?"_top":"_self",y.setWcLinking({name:n,href:g}),y.setRecentWallet(this.wallet),this.preferUniversalLinks&&this.redirectUniversalLink?b.openHref(this.redirectUniversalLink,this.target):b.openHref(this.redirectDeeplink,this.target)}catch(o){I.sendEvent({type:"track",event:"CONNECT_PROXY_ERROR",properties:{message:o instanceof Error?o.message:"Error parsing the deeplink",uri:this.uri,mobile_link:this.wallet.mobile_link,name:this.wallet.name}}),this.error=!0}},!this.wallet)throw new Error("w3m-connecting-wc-mobile: No wallet provided");this.secondaryBtnLabel="Open",this.secondaryLabel=P.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.onHandleURI(),this.unsubscribe.push(y.subscribeKey("wcUri",()=>{this.onHandleURI()})),I.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile",displayIndex:(e=this.wallet)==null?void 0:e.display_index}})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.btnLabelTimeout)}onHandleURI(){var e;this.isLoading=!this.uri,!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onTryAgain(){var e;y.setWcError(!1),(e=this.onConnect)==null||e.call(this)}};nt([d()],Ue.prototype,"redirectDeeplink",void 0);nt([d()],Ue.prototype,"redirectUniversalLink",void 0);nt([d()],Ue.prototype,"target",void 0);nt([d()],Ue.prototype,"preferUniversalLinks",void 0);nt([d()],Ue.prototype,"isLoading",void 0);Ue=nt([p("w3m-connecting-wc-mobile")],Ue);const No=v`
wui-shimmer {
width: 100%;
aspect-ratio: 1 / 1;
border-radius: ${({borderRadius:t})=>t[4]};
}
wui-qr-code {
opacity: 0;
animation-duration: ${({durations:t})=>t.xl};
animation-timing-function: ${({easings:t})=>t["ease-out-power-2"]};
animation-name: fade-in;
animation-fill-mode: forwards;
}
@keyframes fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
`;var bn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Lt=class extends R{constructor(){super(),this.basic=!1,this.forceUpdate=()=>{this.requestUpdate()},window.addEventListener("resize",this.forceUpdate)}firstUpdated(){var e,i;this.basic||I.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:((e=this.wallet)==null?void 0:e.name)??"WalletConnect",platform:"qrcode",displayIndex:(i=this.wallet)==null?void 0:i.display_index}})}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.unsubscribe)==null||e.forEach(i=>i()),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),l`
${this.qrCodeTemplate()}
Scan this QR Code with your phone
${this.copyTemplate()}
`}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const e=this.getBoundingClientRect().width-40,i=this.wallet?this.wallet.name:void 0;return y.setWcLinking(void 0),y.setRecentWallet(this.wallet),l` `}copyTemplate(){const e=!this.uri||!this.ready;return l`
Copy link
`}};Lt.styles=No;bn([c({type:Boolean})],Lt.prototype,"basic",void 0);Lt=bn([p("w3m-connecting-wc-qrcode")],Lt);var Ro=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let en=class extends f{constructor(){var e,i;if(super(),this.wallet=(e=m.state.data)==null?void 0:e.wallet,!this.wallet)throw new Error("w3m-connecting-wc-unsupported: No wallet provided");I.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:(i=this.wallet)==null?void 0:i.display_index}})}render(){return l`
Not Detected
`}};en=Ro([p("w3m-connecting-wc-unsupported")],en);var gn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let hi=class extends R{constructor(){var e;if(super(),this.isLoading=!0,!this.wallet)throw new Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel=P.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.updateLoadingState(),this.unsubscribe.push(y.subscribeKey("wcUri",()=>{this.updateLoadingState()})),I.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web",displayIndex:(e=this.wallet)==null?void 0:e.display_index}})}updateLoadingState(){this.isLoading=!this.uri}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.webapp_link&&this.uri)try{this.error=!1;const{webapp_link:i,name:o}=this.wallet,{redirect:s,href:n}=b.formatUniversalUrl(i,this.uri);y.setWcLinking({name:o,href:n}),y.setRecentWallet(this.wallet),b.openHref(s,"_blank")}catch{this.error=!0}}};gn([d()],hi.prototype,"isLoading",void 0);hi=gn([p("w3m-connecting-wc-web")],hi);var Ve=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ie=class extends f{constructor(){var e;super(),this.wallet=(e=m.state.data)==null?void 0:e.wallet,this.unsubscribe=[],this.platform=void 0,this.platforms=[],this.isSiwxEnabled=!!x.state.siwx,this.remoteFeatures=x.state.remoteFeatures,this.displayBranding=!0,this.basic=!1,this.determinePlatforms(),this.initializeConnection(),this.unsubscribe.push(x.subscribeKey("remoteFeatures",i=>this.remoteFeatures=i))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
${this.headerTemplate()}
${this.platformTemplate()}
${this.reownBrandingTemplate()}
`}reownBrandingTemplate(){var e;return!((e=this.remoteFeatures)!=null&&e.reownBranding)||!this.displayBranding?null:l``}async initializeConnection(e=!1){var i,o;if(!(this.platform==="browser"||x.state.manualWCControl&&!e))try{const{wcPairingExpiry:s,status:n}=y.state;if(e||x.state.enableEmbedded||b.isPairingExpired(s)||n==="connecting"){const r=y.getConnections(u.state.activeChain),a=(i=this.remoteFeatures)==null?void 0:i.multiWallet,g=r.length>0;await y.connectWalletConnect({cache:"never"}),this.isSiwxEnabled||(g&&a?(m.replace("ProfileWallets"),k.showSuccess("New Wallet Added")):D.close())}}catch(s){if(s instanceof Error&&s.message.includes("An error occurred when attempting to switch chain")&&!x.state.enableNetworkSwitch&&u.state.activeChain){u.setActiveCaipNetwork(_n.getUnsupportedNetwork(`${u.state.activeChain}:${(o=u.state.activeCaipNetwork)==null?void 0:o.id}`)),u.showUnsupportedChainUI();return}I.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(s==null?void 0:s.message)??"Unknown"}}),y.setWcError(!0),k.showError(s.message??"Connection error"),y.resetWcConnection(),m.goBack()}}determinePlatforms(){if(!this.wallet){this.platforms.push("qrcode"),this.platform="qrcode";return}if(this.platform)return;const{mobile_link:e,desktop_link:i,webapp_link:o,injected:s,rdns:n}=this.wallet,r=s==null?void 0:s.map(({injected_id:St})=>St).filter(Boolean),a=[...n?[n]:r??[]],g=x.state.isUniversalProvider?!1:a.length,C=e,W=o,O=y.checkInstalled(a),B=g&&O,ni=i&&!b.isMobile();B&&!u.state.noAdapters&&this.platforms.push("browser"),C&&this.platforms.push(b.isMobile()?"mobile":"qrcode"),W&&this.platforms.push("web"),ni&&this.platforms.push("desktop"),!B&&g&&!u.state.noAdapters&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return l``;case"web":return l``;case"desktop":return l`
this.initializeConnection(!0)}>
`;case"mobile":return l`
this.initializeConnection(!0)}>
`;case"qrcode":return l``;default:return l``}}headerTemplate(){return this.platforms.length>1?l`
`:null}async onSelectPlatform(e){var o;const i=(o=this.shadowRoot)==null?void 0:o.querySelector("div");i&&(await i.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,i.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};Ve([d()],Ie.prototype,"platform",void 0);Ve([d()],Ie.prototype,"platforms",void 0);Ve([d()],Ie.prototype,"isSiwxEnabled",void 0);Ve([d()],Ie.prototype,"remoteFeatures",void 0);Ve([c({type:Boolean})],Ie.prototype,"displayBranding",void 0);Ve([c({type:Boolean})],Ie.prototype,"basic",void 0);Ie=Ve([p("w3m-connecting-wc-view")],Ie);var Ei=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Bt=class extends f{constructor(){super(),this.unsubscribe=[],this.isMobile=b.isMobile(),this.remoteFeatures=x.state.remoteFeatures,this.unsubscribe.push(x.subscribeKey("remoteFeatures",e=>this.remoteFeatures=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(this.isMobile){const{featured:e,recommended:i}=E.state,{customWallets:o}=x.state,s=fe.getRecentWallets(),n=e.length||i.length||(o==null?void 0:o.length)||s.length;return l`
${n?l``:null}
`}return l`
${this.reownBrandingTemplate()} `}reownBrandingTemplate(){var e;return(e=this.remoteFeatures)!=null&&e.reownBranding?l`
`:null}};Ei([d()],Bt.prototype,"isMobile",void 0);Ei([d()],Bt.prototype,"remoteFeatures",void 0);Bt=Ei([p("w3m-connecting-wc-basic-view")],Bt);const Oo=ne`
.continue-button-container {
width: 100%;
}
`;var yn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ut=class extends f{constructor(){super(...arguments),this.loading=!1}render(){return l`
${this.onboardingTemplate()} ${this.buttonsTemplate()}
{b.openHref(Rn.URLS.FAQ,"_blank")}}
>
Learn more about names
`}onboardingTemplate(){return l`
Choose your account name
Finally say goodbye to 0x addresses, name your account to make it easier to exchange
assets
`}buttonsTemplate(){return l`
Choose name
`}handleContinue(){m.push("RegisterAccountName"),I.sendEvent({type:"track",event:"OPEN_ENS_FLOW",properties:{isSmartAccount:ve(u.state.activeChain)===le.ACCOUNT_TYPES.SMART_ACCOUNT}})}};Ut.styles=Oo;yn([d()],Ut.prototype,"loading",void 0);Ut=yn([p("w3m-choose-account-name-view")],Ut);var Po=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let tn=class extends f{constructor(){var e;super(...arguments),this.wallet=(e=m.state.data)==null?void 0:e.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return l`
${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()}
${this.homepageTemplate()}
`}chromeTemplate(){var e;return(e=this.wallet)!=null&&e.chrome_store?l`
Chrome Extension
`:null}iosTemplate(){var e;return(e=this.wallet)!=null&&e.app_store?l`
iOS App
`:null}androidTemplate(){var e;return(e=this.wallet)!=null&&e.play_store?l`
Android App
`:null}homepageTemplate(){var e;return(e=this.wallet)!=null&&e.homepage?l`
Website
`:null}onChromeStore(){var e;(e=this.wallet)!=null&&e.chrome_store&&b.openHref(this.wallet.chrome_store,"_blank")}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&b.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&b.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&b.openHref(this.wallet.homepage,"_blank")}};tn=Po([p("w3m-downloads-view")],tn);var Do=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const jo="https://walletconnect.com/explorer";let nn=class extends f{render(){return l`
${this.recommendedWalletsTemplate()}
{b.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}}
>
`}recommendedWalletsTemplate(){const{recommended:e,featured:i}=E.state,{customWallets:o}=x.state;return[...i,...o??[],...e].slice(0,4).map(n=>l`
{b.openHref(n.homepage??jo,"_blank")}}
>
`)}};nn=Do([p("w3m-get-wallet-view")],nn);var xn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let pi=class extends f{constructor(){super(...arguments),this.data=[]}render(){return l`
${this.data.map(e=>l`
${e.images.map(i=>l``)}
${e.title}
${e.text}
`)}
`}};xn([c({type:Array})],pi.prototype,"data",void 0);pi=xn([p("w3m-help-widget")],pi);var Lo=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Bo=[{images:["login","profile","lock"],title:"One login for all of web3",text:"Log in to any app by connecting your wallet. Say goodbye to countless passwords!"},{images:["defi","nft","eth"],title:"A home for your digital assets",text:"A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs."},{images:["browser","noun","dao"],title:"Your gateway to a new web",text:"With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more."}];let on=class extends f{render(){return l`
Get a wallet
`}onGetWallet(){I.sendEvent({type:"track",event:"CLICK_GET_WALLET"}),m.push("GetWallet")}};on=Lo([p("w3m-what-is-a-wallet-view")],on);const Uo=v`
wui-flex {
max-height: clamp(360px, 540px, 80vh);
overflow: scroll;
scrollbar-width: none;
transition: opacity ${({durations:t})=>t.lg}
${({easings:t})=>t["ease-out-power-2"]};
will-change: opacity;
}
wui-flex::-webkit-scrollbar {
display: none;
}
wui-flex.disabled {
opacity: 0.3;
pointer-events: none;
user-select: none;
}
`;var vn=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let zt=class extends f{constructor(){super(),this.unsubscribe=[],this.checked=It.state.isLegalCheckboxChecked,this.unsubscribe.push(It.subscribeKey("isLegalCheckboxChecked",e=>{this.checked=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var g;const{termsConditionsUrl:e,privacyPolicyUrl:i}=x.state,o=(g=x.state.features)==null?void 0:g.legalCheckbox,n=!!(e||i)&&!!o,r=n&&!this.checked,a=r?-1:void 0;return l`
`}};zt.styles=Uo;vn([d()],zt.prototype,"checked",void 0);zt=vn([p("w3m-connect-wallets-view")],zt);const zo=v`
:host {
display: block;
width: 120px;
height: 120px;
}
svg {
width: 120px;
height: 120px;
fill: none;
stroke: transparent;
stroke-linecap: round;
}
use {
stroke: ${t=>t.colors.accent100};
stroke-width: 2px;
stroke-dasharray: 54, 118;
stroke-dashoffset: 172;
animation: dash 1s linear infinite;
}
@keyframes dash {
to {
stroke-dashoffset: 0px;
}
}
`;var Mo=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let fi=class extends f{render(){return l`
`}};fi.styles=[_,zo];fi=Mo([p("wui-loading-hexagon")],fi);const Fo=ne`
@keyframes shake {
0% {
transform: translateX(0);
}
25% {
transform: translateX(3px);
}
50% {
transform: translateX(-3px);
}
75% {
transform: translateX(3px);
}
100% {
transform: translateX(0);
}
}
wui-flex:first-child:not(:only-child) {
position: relative;
}
wui-loading-hexagon {
position: absolute;
}
wui-icon-box {
position: absolute;
right: 4px;
bottom: 0;
opacity: 0;
transform: scale(0.5);
z-index: 1;
}
wui-button {
display: none;
}
[data-error='true'] wui-icon-box {
opacity: 1;
transform: scale(1);
}
[data-error='true'] > wui-flex:first-child {
animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
wui-button[data-retry='true'] {
display: block;
opacity: 1;
}
`;var ki=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let pt=class extends f{constructor(){var e;super(),this.network=(e=m.state.data)==null?void 0:e.network,this.unsubscribe=[],this.showRetry=!1,this.error=!1}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.onSwitchNetwork()}render(){if(!this.network)throw new Error("w3m-network-switch-view: No network provided");this.onShowRetry();const e=this.getLabel(),i=this.getSubLabel();return l`
${this.error?null:l``}
${e}
${i}
Try again
`}getSubLabel(){const e=w.getConnectorId(u.state.activeChain);return w.getAuthConnector()&&e===A.CONNECTOR_ID.AUTH?"":this.error?"Switch can be declined if chain is not supported by a wallet or previous request is still active":"Accept connection request in your wallet"}getLabel(){var o;const e=w.getConnectorId(u.state.activeChain);return w.getAuthConnector()&&e===A.CONNECTOR_ID.AUTH?`Switching to ${((o=this.network)==null?void 0:o.name)??"Unknown"} network...`:this.error?"Switch declined":"Approve in wallet"}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const i=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");i==null||i.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}async onSwitchNetwork(){var e;try{this.error=!1,u.state.activeChain!==((e=this.network)==null?void 0:e.chainNamespace)&&u.setIsSwitchingNamespace(!0),this.network&&await u.switchActiveNetwork(this.network)}catch{this.error=!0}}};pt.styles=Fo;ki([d()],pt.prototype,"showRetry",void 0);ki([d()],pt.prototype,"error",void 0);pt=ki([p("w3m-network-switch-view")],pt);const Vo=v`
:host {
width: 100%;
}
button {
display: flex;
align-items: center;
justify-content: space-between;
padding: ${({spacing:t})=>t[3]};
width: 100%;
background-color: transparent;
border-radius: ${({borderRadius:t})=>t[4]};
}
wui-text {
text-transform: capitalize;
}
@media (hover: hover) {
button:hover:enabled {
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
}
}
button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
`;var $t=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let ze=class extends f{constructor(){super(...arguments),this.imageSrc="proxy.php?url=https%3A%2F%2Fbetswirl.com%2Fethereum",this.name="Ethereum",this.disabled=!1}render(){return l`
`}};ze.styles=[_,T,Vo];$t([c()],ze.prototype,"imageSrc",void 0);$t([c()],ze.prototype,"name",void 0);$t([c()],ze.prototype,"tabIdx",void 0);$t([c({type:Boolean})],ze.prototype,"disabled",void 0);ze=$t([p("wui-list-network")],ze);const Ho=ne`
.container {
max-height: 360px;
overflow: auto;
}
.container::-webkit-scrollbar {
display: none;
}
`;var Ct=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Me=class extends f{constructor(){super(),this.unsubscribe=[],this.network=u.state.activeCaipNetwork,this.requestedCaipNetworks=u.getCaipNetworks(),this.search="",this.onDebouncedSearch=b.debounce(e=>{this.search=e},100),this.unsubscribe.push(_e.subscribeNetworkImages(()=>this.requestUpdate()),u.subscribeKey("activeCaipNetwork",e=>this.network=e),u.subscribe(()=>{this.requestedCaipNetworks=u.getAllRequestedCaipNetworks()}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
${this.templateSearchInput()}
${this.networksTemplate()}
`}templateSearchInput(){return l`
`}onInputChange(e){this.onDebouncedSearch(e.detail)}networksTemplate(){var o;const e=u.getAllApprovedCaipNetworkIds(),i=b.sortRequestedNetworks(e,this.requestedCaipNetworks);return this.search?this.filteredNetworks=i==null?void 0:i.filter(s=>{var n;return(n=s==null?void 0:s.name)==null?void 0:n.toLowerCase().includes(this.search.toLowerCase())}):this.filteredNetworks=i,(o=this.filteredNetworks)==null?void 0:o.map(s=>{var n;return l`
this.onSwitchNetwork(s)}
.disabled=${this.getNetworkDisabled(s)}
data-testid=${`w3m-network-switch-${s.name??s.id}`}
>
`})}getNetworkDisabled(e){const i=e.chainNamespace,o=$.getCaipAddress(i),s=u.getAllApprovedCaipNetworkIds(),n=u.getNetworkProp("supportsAllNetworks",i)!==!1,r=w.getConnectorId(i),a=w.getAuthConnector(),g=r===A.CONNECTOR_ID.AUTH&&a;return!o||n||g?!1:!(s!=null&&s.includes(e.caipNetworkId))}onSwitchNetwork(e){Wn.onSwitchNetwork({network:e})}};Me.styles=Ho;Ct([d()],Me.prototype,"network",void 0);Ct([d()],Me.prototype,"requestedCaipNetworks",void 0);Ct([d()],Me.prototype,"filteredNetworks",void 0);Ct([d()],Me.prototype,"search",void 0);Me=Ct([p("w3m-networks-view")],Me);const Ko=v`
@keyframes shake {
0% {
transform: translateX(0);
}
25% {
transform: translateX(3px);
}
50% {
transform: translateX(-3px);
}
75% {
transform: translateX(3px);
}
100% {
transform: translateX(0);
}
}
wui-flex:first-child:not(:only-child) {
position: relative;
}
wui-loading-thumbnail {
position: absolute;
}
wui-visual {
border-radius: calc(
${({borderRadius:t})=>t[1]} * 9 - ${({borderRadius:t})=>t[3]}
);
position: relative;
overflow: hidden;
}
wui-visual::after {
content: '';
display: block;
width: 100%;
height: 100%;
position: absolute;
inset: 0;
border-radius: calc(
${({borderRadius:t})=>t[1]} * 9 - ${({borderRadius:t})=>t[3]}
);
box-shadow: inset 0 0 0 1px ${({tokens:t})=>t.core.glass010};
}
wui-icon-box {
position: absolute;
right: calc(${({spacing:t})=>t[1]} * -1);
bottom: calc(${({spacing:t})=>t[1]} * -1);
opacity: 0;
transform: scale(0.5);
transition:
opacity ${({durations:t})=>t.lg} ${({easings:t})=>t["ease-out-power-2"]},
transform ${({durations:t})=>t.lg}
${({easings:t})=>t["ease-out-power-2"]};
will-change: opacity, transform;
}
wui-text[align='center'] {
width: 100%;
padding: 0px ${({spacing:t})=>t[4]};
}
[data-error='true'] wui-icon-box {
opacity: 1;
transform: scale(1);
}
[data-error='true'] > wui-flex:first-child {
animation: shake 250ms ${({easings:t})=>t["ease-out-power-2"]} both;
}
[data-retry='false'] wui-link {
display: none;
}
[data-retry='true'] wui-link {
display: block;
opacity: 1;
}
wui-link {
padding: ${({spacing:t})=>t["01"]} ${({spacing:t})=>t[2]};
}
.capitalize {
text-transform: capitalize;
}
`;var $n=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const qo={eip155:"eth",solana:"solana",bip122:"bitcoin",polkadot:void 0};let Mt=class extends f{constructor(){var e,i;super(...arguments),this.unsubscribe=[],this.switchToChain=(e=m.state.data)==null?void 0:e.switchToChain,this.caipNetwork=(i=m.state.data)==null?void 0:i.network,this.activeChain=u.state.activeChain}firstUpdated(){this.unsubscribe.push(u.subscribeKey("activeChain",e=>this.activeChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.switchToChain?A.CHAIN_NAME_MAP[this.switchToChain]:"supported";if(!this.switchToChain)return null;const i=A.CHAIN_NAME_MAP[this.switchToChain];return l`
Switch to ${i}
Connected wallet doesn't support connecting to ${e} chain. You
need to connect with a different wallet.
Switch
`}async switchActiveChain(){this.switchToChain&&(u.setIsSwitchingNamespace(!0),w.setFilterByNamespace(this.switchToChain),this.caipNetwork?await u.switchActiveNetwork(this.caipNetwork):u.setActiveNamespace(this.switchToChain),m.reset("Connect"))}};Mt.styles=Ko;$n([c()],Mt.prototype,"activeChain",void 0);Mt=$n([p("w3m-switch-active-chain-view")],Mt);var Go=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};const Yo=[{images:["network","layers","system"],title:"The system’s nuts and bolts",text:"A network is what brings the blockchain to life, as this technical infrastructure allows apps to access the ledger and smart contract services."},{images:["noun","defiAlt","dao"],title:"Designed for different uses",text:"Each network is designed differently, and may therefore suit certain apps and experiences."}];let sn=class extends f{render(){return l`
{b.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}}
>
Learn more
`}};sn=Go([p("w3m-what-is-a-network-view")],sn);const Xo=ne`
:host > wui-flex {
max-height: clamp(360px, 540px, 80vh);
overflow: scroll;
scrollbar-width: none;
}
:host > wui-flex::-webkit-scrollbar {
display: none;
}
`;var _i=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let ft=class extends f{constructor(){var e;super(),this.swapUnsupportedChain=(e=m.state.data)==null?void 0:e.swapUnsupportedChain,this.unsubscribe=[],this.disconnecting=!1,this.remoteFeatures=x.state.remoteFeatures,this.unsubscribe.push(_e.subscribeNetworkImages(()=>this.requestUpdate()),x.subscribeKey("remoteFeatures",i=>{this.remoteFeatures=i}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
${this.descriptionTemplate()}
${this.networksTemplate()}
Disconnect
`}descriptionTemplate(){return this.swapUnsupportedChain?l`
The swap feature doesn’t support your current network. Switch to an available option to
continue.
`:l`
This app doesn’t support your current network. Switch to an available option to continue.
`}networksTemplate(){const e=u.getAllRequestedCaipNetworks(),i=u.getAllApprovedCaipNetworkIds(),o=b.sortRequestedNetworks(i,e);return(this.swapUnsupportedChain?o.filter(n=>P.SWAP_SUPPORTED_NETWORKS.includes(n.caipNetworkId)):o).map(n=>l`
this.onSwitchNetwork(n)}
>
`)}async onDisconnect(){var e;try{this.disconnecting=!0;const i=u.state.activeChain,s=y.getConnections(i).length>0,n=i&&w.state.activeConnectorIds[i],r=(e=this.remoteFeatures)==null?void 0:e.multiWallet;await y.disconnect(r?{id:n,namespace:i}:{}),s&&r&&(m.push("ProfileWallets"),k.showSuccess("Wallet deleted"))}catch{I.sendEvent({type:"track",event:"DISCONNECT_ERROR",properties:{message:"Failed to disconnect"}}),k.showError("Failed to disconnect")}finally{this.disconnecting=!1}}async onSwitchNetwork(e){const i=$.state.caipAddress,o=u.getAllApprovedCaipNetworkIds(),s=u.getNetworkProp("supportsAllNetworks",e.chainNamespace),n=m.state.data;i?o!=null&&o.includes(e.caipNetworkId)?await u.switchActiveNetwork(e):s?m.push("SwitchNetwork",{...n,network:e}):m.push("SwitchNetwork",{...n,network:e}):i||(u.setActiveCaipNetwork(e),m.push("Connect"))}};ft.styles=Xo;_i([d()],ft.prototype,"disconnecting",void 0);_i([d()],ft.prototype,"remoteFeatures",void 0);ft=_i([p("w3m-unsupported-chain-view")],ft);const Qo=v`
wui-flex {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
gap: ${({spacing:t})=>t[2]};
border-radius: ${({borderRadius:t})=>t[4]};
padding: ${({spacing:t})=>t[3]};
}
/* -- Types --------------------------------------------------------- */
wui-flex[data-type='info'] {
color: ${({tokens:t})=>t.theme.textSecondary};
background-color: ${({tokens:t})=>t.theme.foregroundPrimary};
}
wui-flex[data-type='success'] {
color: ${({tokens:t})=>t.core.textSuccess};
background-color: ${({tokens:t})=>t.core.backgroundSuccess};
}
wui-flex[data-type='error'] {
color: ${({tokens:t})=>t.core.textError};
background-color: ${({tokens:t})=>t.core.backgroundError};
}
wui-flex[data-type='warning'] {
color: ${({tokens:t})=>t.core.textWarning};
background-color: ${({tokens:t})=>t.core.backgroundWarning};
}
wui-flex[data-type='info'] wui-icon-box {
background-color: ${({tokens:t})=>t.theme.foregroundSecondary};
}
wui-flex[data-type='success'] wui-icon-box {
background-color: ${({tokens:t})=>t.core.backgroundSuccess};
}
wui-flex[data-type='error'] wui-icon-box {
background-color: ${({tokens:t})=>t.core.backgroundError};
}
wui-flex[data-type='warning'] wui-icon-box {
background-color: ${({tokens:t})=>t.core.backgroundWarning};
}
wui-text {
flex: 1;
}
`;var ti=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Xe=class extends f{constructor(){super(...arguments),this.icon="externalLink",this.text="",this.type="info"}render(){return l`
${this.text}
`}};Xe.styles=[_,T,Qo];ti([c()],Xe.prototype,"icon",void 0);ti([c()],Xe.prototype,"text",void 0);ti([c()],Xe.prototype,"type",void 0);Xe=ti([p("wui-banner")],Xe);const Zo=ne`
:host > wui-flex {
max-height: clamp(360px, 540px, 80vh);
overflow: scroll;
scrollbar-width: none;
}
:host > wui-flex::-webkit-scrollbar {
display: none;
}
`;var Jo=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let wi=class extends f{constructor(){super(),this.unsubscribe=[]}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return l`
${this.networkTemplate()}
`}networkTemplate(){const e=u.getAllRequestedCaipNetworks(),i=u.getAllApprovedCaipNetworkIds(),o=u.state.activeCaipNetwork,s=u.checkIfSmartAccountEnabled();let n=b.sortRequestedNetworks(i,e);if(s&&ve(o==null?void 0:o.chainNamespace)===le.ACCOUNT_TYPES.SMART_ACCOUNT){if(!o)return null;n=[o]}return n.filter(a=>a.chainNamespace===(o==null?void 0:o.chainNamespace)).map(a=>l`
`)}};wi.styles=Zo;wi=Jo([p("w3m-wallet-compatible-networks-view")],wi);const es=v`
:host {
display: flex;
justify-content: center;
align-items: center;
width: 56px;
height: 56px;
box-shadow: 0 0 0 8px ${({tokens:t})=>t.theme.borderPrimary};
border-radius: ${({borderRadius:t})=>t[4]};
overflow: hidden;
}
:host([data-border-radius-full='true']) {
border-radius: 50px;
}
wui-icon {
width: 32px;
height: 32px;
}
`;var ii=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Qe=class extends f{render(){return this.dataset.borderRadiusFull=this.borderRadiusFull?"true":"false",l`${this.templateVisual()}`}templateVisual(){return this.imageSrc?l``:l``}};Qe.styles=[_,es];ii([c()],Qe.prototype,"imageSrc",void 0);ii([c()],Qe.prototype,"alt",void 0);ii([c({type:Boolean})],Qe.prototype,"borderRadiusFull",void 0);Qe=ii([p("wui-visual-thumbnail")],Qe);const ts=v`
:host {
display: flex;
justify-content: center;
gap: ${({spacing:t})=>t[4]};
}
wui-visual-thumbnail:nth-child(1) {
z-index: 1;
}
`;var is=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let mi=class extends f{constructor(){var e,i;super(...arguments),this.dappImageUrl=(e=x.state.metadata)==null?void 0:e.icons,this.walletImageUrl=(i=$.state.connectedWalletInfo)==null?void 0:i.icon}firstUpdated(){var i;const e=(i=this.shadowRoot)==null?void 0:i.querySelectorAll("wui-visual-thumbnail");e!=null&&e[0]&&this.createAnimation(e[0],"translate(18px)"),e!=null&&e[1]&&this.createAnimation(e[1],"translate(-18px)")}render(){var e;return l`
`}createAnimation(e,i){e.animate([{transform:"translateX(0px)"},{transform:i}],{duration:1600,easing:"cubic-bezier(0.56, 0, 0.48, 1)",direction:"alternate",iterations:1/0})}};mi.styles=ts;mi=is([p("w3m-siwx-sign-message-thumbnails")],mi);var Wi=function(t,e,i,o){var s=arguments.length,n=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(s<3?r(n):s>3?r(e,i,n):r(e,i))||n);return s>3&&n&&Object.defineProperty(e,i,n),n};let Ft=class extends f{constructor(){var e;super(...arguments),this.dappName=(e=x.state.metadata)==null?void 0:e.name,this.isCancelling=!1,this.isSigning=!1}render(){return l`
${this.dappName??"Dapp"} needs to connect to your wallet
Sign this message to prove you own this wallet and proceed. Canceling will disconnect
you.
${this.isCancelling?"Cancelling...":"Cancel"}
${this.isSigning?"Signing...":"Sign"}
`}async onSign(){this.isSigning=!0;try{await Li.requestSignMessage()}catch(e){if(e instanceof Error&&e.message.includes("OTP is required")){k.showError({message:"Something went wrong. We need to verify your account again."}),m.replace("DataCapture");return}throw e}finally{this.isSigning=!1}}async onCancel(){this.isCancelling=!0,await Li.cancelSignMessage().finally(()=>this.isCancelling=!1)}};Wi([d()],Ft.prototype,"isCancelling",void 0);Wi([d()],Ft.prototype,"isSigning",void 0);Ft=Wi([p("w3m-siwx-sign-message-view")],Ft);export{Ui as AppKitAccountButton,Mi as AppKitButton,Vi as AppKitConnectButton,Ki as AppKitNetworkButton,Bi as W3mAccountButton,ce as W3mAccountSettingsView,di as W3mAccountView,Wt as W3mAllWalletsView,zi as W3mButton,Ut as W3mChooseAccountNameView,Fi as W3mConnectButton,q as W3mConnectView,zt as W3mConnectWalletsView,Qi as W3mConnectingExternalView,Dt as W3mConnectingMultiChainView,Bt as W3mConnectingWcBasicView,Ie as W3mConnectingWcView,tn as W3mDownloadsView,wa as W3mFooter,nn as W3mGetWalletView,Hi as W3mNetworkButton,pt as W3mNetworkSwitchView,Me as W3mNetworksView,U as W3mProfileWalletsView,ma as W3mRouter,Ft as W3mSIWXSignMessageView,Mt as W3mSwitchActiveChainView,ft as W3mUnsupportedChainView,wi as W3mWalletCompatibleNetworksView,sn as W3mWhatIsANetworkView,on as W3mWhatIsAWalletView};