"use strict";(self.webpackChunkfrog=self.webpackChunkfrog||[]).push([[153],{61425:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(60031),a=i(35748),s=i(87792),c=i(98414),l=i(72088),u=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let d=class extends o.WF{constructor(){super(),this.usubscribe=[],this.networkImages=s.jQ.state.networkImages,this.address=s.Uj.state.address,this.profileImage=s.Uj.state.profileImage,this.profileName=s.Uj.state.profileName,this.network=s.WB.state.activeCaipNetwork,this.preferredAccountType=s.Uj.state.preferredAccountType,this.disconnecting=!1,this.loading=!1,this.switched=!1,this.text="",this.usubscribe.push(s.Uj.subscribe((e=>{e.address?(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.preferredAccountType=e.preferredAccountType):s.W3.close()})),s.Uj.subscribeKey("preferredAccountType",(e=>this.preferredAccountType=e)),s.WB.subscribeKey("activeCaipNetwork",(e=>{e?.id&&(this.network=e)})))}disconnectedCallback(){this.usubscribe.forEach((e=>e()))}render(){if(!this.address)throw new Error("w3m-account-settings-view: No account provided");const e=this.networkImages[this.network?.assets?.imageId??""];return o.qy`
${c.UiHelperUtil.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})}
${this.authCardTemplate()}
${this.network?.name??"Unknown"}
${this.togglePreferredAccountBtnTemplate()} ${this.chooseNameButtonTemplate()}
Disconnect
`}chooseNameButtonTemplate(){const e=this.network?.chainNamespace,t=s.iT.getConnectedConnectorId(e),i=s.aK.getAuthConnector();return s.WB.checkIfNamesSupported()&&i&&t===a.oU.CONNECTOR_ID.AUTH&&!this.profileName?o.qy`
Choose account name
`:null}authCardTemplate(){const e=this.network?.chainNamespace,t=s.iT.getConnectedConnectorId(e),i=s.aK.getAuthConnector(),{origin:r}=location;return!i||t!==a.oU.CONNECTOR_ID.AUTH||r.includes(s.oU.SECURE_SITE)?null:o.qy`
`}isAllowedNetworkSwitch(){const e=s.WB.getAllRequestedCaipNetworks(),t=!!e&&e.length>1,i=e?.find((({id:e})=>e===this.network?.id));return t||!i}onCopyAddress(){try{this.address&&(s.wE.copyToClopboard(this.address),s.Pt.showSuccess("Address copied"))}catch{s.Pt.showError("Failed to copy")}}togglePreferredAccountBtnTemplate(){const e=this.network?.chainNamespace,t=s.WB.checkIfSmartAccountEnabled(),i=s.iT.getConnectedConnectorId(e);return s.aK.getAuthConnector()&&i===a.oU.CONNECTOR_ID.AUTH&&t?(this.switched||(this.text=this.preferredAccountType===l.Vl.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account"),o.qy`
${this.text}
`):null}onChooseName(){s.IN.push("ChooseAccountName")}async changePreferredAccountType(){const e=s.WB.checkIfSmartAccountEnabled(),t=this.preferredAccountType!==l.Vl.ACCOUNT_TYPES.SMART_ACCOUNT&&e?l.Vl.ACCOUNT_TYPES.SMART_ACCOUNT:l.Vl.ACCOUNT_TYPES.EOA;s.aK.getAuthConnector()&&(this.loading=!0,await s.x4.setPreferredAccountType(t),this.text=t===l.Vl.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account",this.switched=!0,s.Rv.resetSend(),this.loading=!1,this.requestUpdate())}onNetworks(){this.isAllowedNetworkSwitch()&&s.IN.push("Networks")}async onDisconnect(){try{this.disconnecting=!0,await s.x4.disconnect(),s.En.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),s.W3.close()}catch{s.En.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),s.Pt.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onGoToUpgradeView(){s.En.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),s.IN.push("UpgradeEmailWallet")}};u([(0,r.wk)()],d.prototype,"address",void 0),u([(0,r.wk)()],d.prototype,"profileImage",void 0),u([(0,r.wk)()],d.prototype,"profileName",void 0),u([(0,r.wk)()],d.prototype,"network",void 0),u([(0,r.wk)()],d.prototype,"preferredAccountType",void 0),u([(0,r.wk)()],d.prototype,"disconnecting",void 0),u([(0,r.wk)()],d.prototype,"loading",void 0),u([(0,r.wk)()],d.prototype,"switched",void 0),u([(0,r.wk)()],d.prototype,"text",void 0),d=u([(0,c.customElement)("w3m-account-settings-view")],d)},75033:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(35748),a=i(87792),s=i(98414),c=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let l=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.namespace=a.WB.state.activeChain,this.unsubscribe.push(a.WB.subscribeKey("activeChain",(e=>{this.namespace=e})))}render(){if(!this.namespace)return null;const e=a.iT.getConnectedConnectorId(this.namespace),t=a.aK.getAuthConnector();return o.qy`
${t&&e===n.oU.CONNECTOR_ID.AUTH?this.walletFeaturesTemplate():this.defaultTemplate()}
`}walletFeaturesTemplate(){return o.qy``}defaultTemplate(){return o.qy``}};c([(0,r.wk)()],l.prototype,"namespace",void 0),l=c([(0,s.customElement)("w3m-account-view")],l)},54276:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(60031),a=i(87792),s=i(98414),c=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let l=class extends o.WF{constructor(){super(...arguments),this.search="",this.onDebouncedSearch=a.wE.debounce((e=>{this.search=e}))}render(){const e=this.search.length>=2;return o.qy`
${this.qrButtonTemplate()}
${e||this.badge?o.qy``:o.qy``}
`}onInputChange(e){this.onDebouncedSearch(e.detail)}onClick(){"certified"!==this.badge?(this.badge="certified",a.Pt.showSvg("Only WalletConnect certified",{icon:"walletConnectBrown",iconColor:"accent-100"})):this.badge=void 0}qrButtonTemplate(){return a.wE.isMobile()?o.qy`
`:null}onWalletConnectQr(){a.IN.push("ConnectingWalletConnect")}};c([(0,r.wk)()],l.prototype,"search",void 0),c([(0,r.wk)()],l.prototype,"badge",void 0),l=c([(0,s.customElement)("w3m-all-wallets-view")],l)},56250:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(35748),a=i(87792),s=i(98414);const c=o.AH`
div {
width: 100%;
}
[data-ready='false'] {
transform: scale(1.05);
}
@media (max-width: 430px) {
[data-ready='false'] {
transform: translateY(-50px);
}
}
`;var l=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let u=class extends o.WF{constructor(){super(),this.bodyObserver=void 0,this.unsubscribe=[],this.iframe=document.getElementById("w3m-iframe"),this.ready=!1,this.unsubscribe.push(a.W3.subscribeKey("open",(e=>{e||(this.onHideIframe(),a.IN.popTransactionStack())})),a.W3.subscribeKey("shake",(e=>{this.iframe.style.animation=e?"w3m-shake 500ms var(--wui-ease-out-power-2)":"none"})))}disconnectedCallback(){this.onHideIframe(),this.unsubscribe.forEach((e=>e())),this.bodyObserver?.unobserve(window.document.body)}async firstUpdated(){await this.syncTheme(),this.iframe.style.display="block";const e=this?.renderRoot?.querySelector("div");this.bodyObserver=new ResizeObserver((t=>{const i=t?.[0]?.contentBoxSize,o=i?.[0]?.inlineSize;this.iframe.style.height="600px",e.style.height="600px",o&&o<=430?(this.iframe.style.width="100%",this.iframe.style.left="0px",this.iframe.style.bottom="0px",this.iframe.style.top="unset"):(this.iframe.style.width="360px",this.iframe.style.left="calc(50% - 180px)",this.iframe.style.top="calc(50% - 300px + 32px)",this.iframe.style.bottom="unset"),this.ready=!0,this.onShowIframe()})),this.bodyObserver.observe(window.document.body)}render(){return o.qy`
`}onShowIframe(){const e=window.innerWidth<=430;this.iframe.style.animation=e?"w3m-iframe-zoom-in-mobile 200ms var(--wui-ease-out-power-2)":"w3m-iframe-zoom-in 200ms var(--wui-ease-out-power-2)"}onHideIframe(){this.iframe.style.display="none",this.iframe.style.animation="w3m-iframe-fade-out 200ms var(--wui-ease-out-power-2)"}async syncTheme(){const e=a.aK.getAuthConnector();if(e){const t=a.Wn.getSnapshot().themeMode,i=a.Wn.getSnapshot().themeVariables;await e.provider.syncTheme({themeVariables:i,w3mThemeVariables:(0,n.o_)(i,t)})}}};u.styles=c,l([(0,r.wk)()],u.prototype,"ready",void 0),u=l([(0,s.customElement)("w3m-approve-transaction-view")],u)},59206:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(60031),a=i(87792),s=i(98414);const c=o.AH`
@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 {
width: var(--wui-wallet-image-size-lg);
height: var(--wui-wallet-image-size-lg);
border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs));
position: relative;
overflow: hidden;
}
wui-visual::after {
content: '';
display: block;
width: 100%;
height: 100%;
position: absolute;
inset: 0;
border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs));
box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
}
wui-icon-box {
position: absolute;
right: calc(var(--wui-spacing-3xs) * -1);
bottom: calc(var(--wui-spacing-3xs) * -1);
opacity: 0;
transform: scale(0.5);
transition:
opacity var(--wui-ease-out-power-2) var(--wui-duration-lg),
transform var(--wui-ease-out-power-2) var(--wui-duration-lg);
will-change: opacity, transform;
}
wui-text[align='center'] {
width: 100%;
padding: 0px var(--wui-spacing-l);
}
[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;
}
[data-retry='false'] wui-link {
display: none;
}
[data-retry='true'] wui-link {
display: block;
opacity: 1;
}
wui-link {
padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs);
}
`;var l=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let u=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.selectedOnRampProvider=a.aG.state.selectedProvider,this.uri=a.x4.state.wcUri,this.ready=!1,this.showRetry=!1,this.buffering=!1,this.error=!1,this.startTime=null,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(a.aG.subscribeKey("selectedProvider",(e=>{this.selectedOnRampProvider=e}))),this.watchTransactions()}disconnectedCallback(){this.intervalId&&clearInterval(this.intervalId)}render(){let e="Continue in external window";this.error?e="Buy failed":this.selectedOnRampProvider&&(e=`Buy in ${this.selectedOnRampProvider?.label}`);const t=this.error?"Buy can be declined from your side or due to and error on the provider app":"We’ll notify you once your Buy is processed";return o.qy`
${this.error?null:this.loaderTemplate()}
${e}
${t}
${this.error?this.tryAgainTemplate():null}
Copy link
`}watchTransactions(){if(this.selectedOnRampProvider&&"coinbase"===this.selectedOnRampProvider.name)this.startTime=Date.now(),this.initializeCoinbaseTransactions()}async initializeCoinbaseTransactions(){await this.watchCoinbaseTransactions(),this.intervalId=setInterval((()=>this.watchCoinbaseTransactions()),4e3)}async watchCoinbaseTransactions(){try{const e=a.Uj.state.address,t=a.Hd.state.projectId;if(!e)throw new Error("No address found");const i=await a.TP.fetchTransactions({account:e,onramp:"coinbase",projectId:t});i.data.filter((e=>new Date(e.metadata.minedAt)>new Date(this.startTime)||"ONRAMP_TRANSACTION_STATUS_IN_PROGRESS"===e.metadata.status)).length?(clearInterval(this.intervalId),a.IN.replace("OnRampActivity")):this.startTime&&Date.now()-this.startTime>=18e4&&(clearInterval(this.intervalId),this.error=!0)}catch(e){a.Pt.showError(e)}}onTryAgain(){this.selectedOnRampProvider&&(this.error=!1,a.wE.openHref(this.selectedOnRampProvider.url,"popupWindow","width=600,height=800,scrollbars=yes"))}tryAgainTemplate(){return this.selectedOnRampProvider?.url?o.qy`
Try again
`:null}loaderTemplate(){const e=a.Wn.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return o.qy``}onCopyUri(){if(!this.selectedOnRampProvider?.url)return a.Pt.showError("No link found"),void a.IN.goBack();try{a.wE.copyToClopboard(this.selectedOnRampProvider.url),a.Pt.showSuccess("Link copied")}catch{a.Pt.showError("Failed to copy")}}};u.styles=c,l([(0,r.wk)()],u.prototype,"intervalId",void 0),l([(0,r.wk)()],u.prototype,"selectedOnRampProvider",void 0),l([(0,r.wk)()],u.prototype,"uri",void 0),l([(0,r.wk)()],u.prototype,"ready",void 0),l([(0,r.wk)()],u.prototype,"showRetry",void 0),l([(0,r.wk)()],u.prototype,"buffering",void 0),l([(0,r.wk)()],u.prototype,"error",void 0),l([(0,r.wk)()],u.prototype,"startTime",void 0),l([(0,r.MZ)({type:Boolean})],u.prototype,"isMobile",void 0),l([(0,r.MZ)()],u.prototype,"onRetry",void 0),u=l([(0,s.customElement)("w3m-buy-in-progress-view")],u)},13499:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(35748),a=i(87792),s=i(98414),c=i(72088);const l=o.AH`
.continue-button-container {
width: 100%;
}
`;var u=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let d=class extends o.WF{constructor(){super(...arguments),this.loading=!1}render(){return o.qy`
${this.onboardingTemplate()} ${this.buttonsTemplate()}
{a.wE.openHref(n.TC.URLS.FAQ,"_blank")}}
>
Learn more about names
`}onboardingTemplate(){return o.qy`
Choose your account name
Finally say goodbye to 0x addresses, name your account to make it easier to exchange
assets
`}buttonsTemplate(){return o.qy`
Choose name
`}handleContinue(){a.IN.push("RegisterAccountName"),a.En.sendEvent({type:"track",event:"OPEN_ENS_FLOW",properties:{isSmartAccount:a.Uj.state.preferredAccountType===c.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}})}};d.styles=l,u([(0,r.wk)()],d.prototype,"loading",void 0),d=u([(0,s.customElement)("w3m-choose-account-name-view")],d)},83037:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(60031),a=i(87792),s=i(98414);const c=o.AH`
wui-flex {
max-height: clamp(360px, 540px, 80vh);
overflow: scroll;
scrollbar-width: none;
transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
will-change: opacity;
}
wui-flex::-webkit-scrollbar {
display: none;
}
wui-flex.disabled {
opacity: 0.3;
pointer-events: none;
user-select: none;
}
`;var l=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let u=class extends o.WF{constructor(){super(...arguments),this.checked=!1}render(){const{termsConditionsUrl:e,privacyPolicyUrl:t}=a.Hd.state,i=a.Hd.state.features?.legalCheckbox,r=Boolean(e||t)&&Boolean(i),s=r&&!this.checked,c=s?-1:void 0;return o.qy`
`}onCheckboxChange(e){this.checked=Boolean(e.detail)}};u.styles=c,l([(0,r.wk)()],u.prototype,"checked",void 0),u=l([(0,s.customElement)("w3m-connect-socials-view")],u)},52944:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(17509),a=i(53720),s=i(60031),c=i(35748),l=i(87792),u=i(98414),d=i(7689),h=i(54277);const p=o.AH`
: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 var(--wui-ease-out-power-1) var(--wui-duration-md);
will-change: opacity;
mask-image: var(--connect-mask-image);
}
.guide {
transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
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: var(--wui-spacing-s) calc(var(--wui-spacing-s) * -1);
width: calc(100% + var(--wui-spacing-s) * 2);
}
`;var w=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let m=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.connectors=l.aK.state.connectors,this.authConnector=this.connectors.find((e=>"AUTH"===e.type)),this.features=l.Hd.state.features,this.enableWallets=l.Hd.state.enableWallets,this.noAdapters=l.WB.state.noAdapters,this.walletGuide="get-started",this.checked=!1,this.isEmailEnabled=this.features?.email&&!l.WB.state.noAdapters,this.isSocialEnabled=this.features?.socials&&this.features.socials.length>0&&!l.WB.state.noAdapters,this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors),this.unsubscribe.push(l.aK.subscribeKey("connectors",(e=>{this.connectors=e,this.authConnector=this.connectors.find((e=>"AUTH"===e.type)),this.isAuthEnabled=this.checkIfAuthEnabled(this.connectors)})),l.Hd.subscribeKey("features",(e=>this.setEmailAndSocialEnableCheck(e,this.noAdapters))),l.Hd.subscribeKey("enableWallets",(e=>this.enableWallets=e)),l.WB.subscribeKey("noAdapters",(e=>this.setEmailAndSocialEnableCheck(this.features,e))))}disconnectedCallback(){this.unsubscribe.forEach((e=>e())),this.resizeObserver?.disconnect();const e=this.shadowRoot?.querySelector(".connect");e?.removeEventListener("scroll",this.handleConnectListScroll.bind(this))}firstUpdated(){const e=this.shadowRoot?.querySelector(".connect");e&&(requestAnimationFrame(this.handleConnectListScroll.bind(this)),e?.addEventListener("scroll",this.handleConnectListScroll.bind(this)),this.resizeObserver=new ResizeObserver((()=>{this.handleConnectListScroll()})),this.resizeObserver.observe(e),this.handleConnectListScroll())}render(){const{termsConditionsUrl:e,privacyPolicyUrl:t}=l.Hd.state,i=l.Hd.state.features?.legalCheckbox,r=Boolean(e||t)&&Boolean(i)&&"get-started"===this.walletGuide&&!this.checked,n={connect:!0,disabled:r},s=l.Hd.state.enableWalletGuide,c=this.enableWallets,u=this.isSocialEnabled||this.authConnector,d=r?-1:void 0;return o.qy`
${this.legalCheckboxTemplate()}
${this.renderConnectMethod(d)}
${this.guideTemplate(r)}
`}setEmailAndSocialEnableCheck(e,t){this.isEmailEnabled=e?.email&&!t,this.isSocialEnabled=e?.socials&&e.socials.length>0&&!t,this.features=e,this.noAdapters=t}checkIfAuthEnabled(e){const t=e.filter((e=>e.type===d.oU.CONNECTOR_TYPE_AUTH)).map((e=>e.chain));return c.oU.AUTH_CONNECTOR_SUPPORTED_CHAINS.some((e=>t.includes(e)))}renderConnectMethod(e){const t=h.A.getConnectOrderMethod(this.features,this.connectors);return o.qy`${t.map(((t,i)=>{switch(t){case"email":return o.qy`${this.emailTemplate(e)} ${this.separatorTemplate(i,"email")}`;case"social":return o.qy`${this.socialListTemplate(e)}
${this.separatorTemplate(i,"social")}`;case"wallet":return o.qy`${this.walletListTemplate(e)}
${this.separatorTemplate(i,"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 t=h.A.getConnectOrderMethod(this.features,this.connectors)[e+1];if(!t)return;return this.checkMethodEnabled(t)?t:this.checkIsThereNextMethod(e+1)}separatorTemplate(e,t){const i=this.checkIsThereNextMethod(e),r="explore"===this.walletGuide;switch(t){case"wallet":return this.enableWallets&&i&&!r?o.qy``:null;case"email":{const e="social"===i;return this.isAuthEnabled&&this.isEmailEnabled&&!e&&i?o.qy``:null}case"social":{const e="email"===i;return this.isAuthEnabled&&this.isSocialEnabled&&!e&&i?o.qy``:null}default:return null}}emailTemplate(e){return this.isEmailEnabled&&this.isAuthEnabled?o.qy``:null}socialListTemplate(e){return this.isSocialEnabled&&this.isAuthEnabled?o.qy``:null}walletListTemplate(e){const t=this.enableWallets,i=!1===this.features?.emailShowWallets,r=this.features?.collapseWallets,n=i||r;if(!t)return null;if((l.wE.isTelegram()||l.wE.isSafari())&&l.wE.isIos()&&l.x4.connectWalletConnect().catch((e=>({}))),"explore"===this.walletGuide)return null;return this.isAuthEnabled&&(this.isEmailEnabled||this.isSocialEnabled)&&n?o.qy``:o.qy``}guideTemplate(e=!1){if(!l.Hd.state.enableWalletGuide)return null;const t={guide:!0,disabled:e},i=e?-1:void 0;return this.authConnector||this.isSocialEnabled?o.qy`
${"explore"!==this.walletGuide||l.WB.state.noAdapters?null:o.qy``}
`:null}legalCheckboxTemplate(){return"explore"===this.walletGuide?null:o.qy``}handleConnectListScroll(){const e=this.shadowRoot?.querySelector(".connect");if(!e)return;e.scrollHeight>470?(e.style.setProperty("--connect-mask-image","linear-gradient(\n to bottom,\n rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px,\n rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px,\n black 40px,\n black calc(100% - 40px),\n rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px),\n rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100%\n )"),e.style.setProperty("--connect-scroll--top-opacity",u.MathUtil.interpolate([0,50],[0,1],e.scrollTop).toString()),e.style.setProperty("--connect-scroll--bottom-opacity",u.MathUtil.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(){l.IN.push("ConnectWallets")}onCheckboxChange(e){this.checked=Boolean(e.detail)}};m.styles=p,w([(0,n.w)()],m.prototype,"connectors",void 0),w([(0,n.w)()],m.prototype,"authConnector",void 0),w([(0,n.w)()],m.prototype,"features",void 0),w([(0,n.w)()],m.prototype,"enableWallets",void 0),w([(0,n.w)()],m.prototype,"noAdapters",void 0),w([(0,r.MZ)()],m.prototype,"walletGuide",void 0),w([(0,n.w)()],m.prototype,"checked",void 0),w([(0,n.w)()],m.prototype,"isEmailEnabled",void 0),w([(0,n.w)()],m.prototype,"isSocialEnabled",void 0),w([(0,n.w)()],m.prototype,"isAuthEnabled",void 0),m=w([(0,u.customElement)("w3m-connect-view")],m)},95403:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(60031),a=i(87792),s=i(98414);const c=o.AH`
wui-flex {
max-height: clamp(360px, 540px, 80vh);
overflow: scroll;
scrollbar-width: none;
transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
will-change: opacity;
}
wui-flex::-webkit-scrollbar {
display: none;
}
wui-flex.disabled {
opacity: 0.3;
pointer-events: none;
user-select: none;
}
`;var l=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let u=class extends o.WF{constructor(){super(...arguments),this.checked=!1}render(){const{termsConditionsUrl:e,privacyPolicyUrl:t}=a.Hd.state,i=a.Hd.state.features?.legalCheckbox,r=Boolean(e||t)&&Boolean(i),s=r&&!this.checked,c=s?-1:void 0;return o.qy`
`}onCheckboxChange(e){this.checked=Boolean(e.detail)}};u.styles=c,l([(0,r.wk)()],u.prototype,"checked",void 0),u=l([(0,s.customElement)("w3m-connect-wallets-view")],u)},23962:(e,t,i)=>{var o=i(35748),r=i(87792),n=i(98414),a=i(23522),s=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let c=class extends a.o{constructor(){if(super(),this.externalViewUnsubscribe=[],!this.connector)throw new Error("w3m-connecting-view: No connector provided");r.En.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser"}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1,this.externalViewUnsubscribe.push(r.WB.subscribeKey("activeCaipAddress",(e=>{e&&r.W3.close()})))}disconnectedCallback(){this.externalViewUnsubscribe.forEach((e=>e()))}async onConnectProxy(){try{this.error=!1,this.connector&&(this.connector.id===o.oU.CONNECTOR_ID.COINBASE_SDK&&this.error||(await r.x4.connectExternal(this.connector,this.connector.chain),r.En.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.connector.name||"Unknown"}})))}catch(e){r.En.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:e?.message??"Unknown"}}),this.error=!0}}};c=s([(0,n.customElement)("w3m-connecting-external-view")],c)},34928:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(60031),a=i(87792),s=i(98414);const c=o.AH`
@keyframes fadein {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
wui-shimmer {
width: 100%;
aspect-ratio: 1 / 1;
border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important;
}
wui-qr-code {
opacity: 0;
animation-duration: 200ms;
animation-timing-function: ease;
animation-name: fadein;
animation-fill-mode: forwards;
}
wui-logo {
width: 80px;
height: 80px;
border-radius: var(--wui-border-radius-m);
}
wui-flex:first-child:not(:only-child) {
position: relative;
}
wui-loading-thumbnail {
position: absolute;
}
wui-icon-box {
position: absolute;
right: calc(var(--wui-spacing-3xs) * -1);
bottom: calc(var(--wui-spacing-3xs) * -1);
opacity: 0;
transform: scale(0.5);
transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg);
}
`;var l=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let u=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.socialProvider=a.Uj.state.socialProvider,this.uri=a.Uj.state.farcasterUrl,this.ready=!1,this.loading=!1,this.authConnector=a.aK.getAuthConnector(),this.forceUpdate=()=>{this.requestUpdate()},this.unsubscribe.push(a.Uj.subscribeKey("farcasterUrl",(e=>{e&&(this.uri=e,this.connectFarcaster())})),a.Uj.subscribeKey("socialProvider",(e=>{e&&(this.socialProvider=e)}))),window.addEventListener("resize",this.forceUpdate)}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.timeout),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),o.qy`${this.platformTemplate()}`}platformTemplate(){return a.wE.isMobile()?o.qy`${this.mobileTemplate()}`:o.qy`${this.desktopTemplate()}`}desktopTemplate(){return this.loading?o.qy`${this.loadingTemplate()}`:o.qy`${this.qrTemplate()}`}qrTemplate(){return o.qy`
${this.qrCodeTemplate()}
Scan this QR Code with your phone
${this.copyTemplate()}
`}loadingTemplate(){return o.qy`
${this.loaderTemplate()}
Loading user data
Please wait a moment while we load your data.
`}mobileTemplate(){return o.qy`
${this.loaderTemplate()}
Continue in Farcaster
Accept connection request in the app
${this.mobileLinkTemplate()}
`}loaderTemplate(){const e=a.Wn.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return o.qy``}async connectFarcaster(){if(this.authConnector)try{await(this.authConnector?.provider.connectFarcaster()),this.socialProvider&&(a.iT.setConnectedSocialProvider(this.socialProvider),a.En.sendEvent({type:"track",event:"SOCIAL_LOGIN_REQUEST_USER_DATA",properties:{provider:this.socialProvider}})),this.loading=!0,await a.x4.connectExternal(this.authConnector,this.authConnector.chain),this.socialProvider&&a.En.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:this.socialProvider}}),this.loading=!1,a.W3.close()}catch(e){this.socialProvider&&a.En.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}}),a.IN.goBack(),a.Pt.showError(e)}}mobileLinkTemplate(){return o.qy`{this.uri&&a.wE.openHref(this.uri,"_blank")}}
>
Open farcaster`}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;return o.qy` `}copyTemplate(){const e=!this.uri||!this.ready;return o.qy`
Copy link
`}onCopyUri(){try{this.uri&&(a.wE.copyToClopboard(this.uri),a.Pt.showSuccess("Link copied"))}catch{a.Pt.showError("Failed to copy")}}};u.styles=c,l([(0,r.wk)()],u.prototype,"socialProvider",void 0),l([(0,r.wk)()],u.prototype,"uri",void 0),l([(0,r.wk)()],u.prototype,"ready",void 0),l([(0,r.wk)()],u.prototype,"loading",void 0),u=l([(0,s.customElement)("w3m-connecting-farcaster-view")],u)},85652:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(60031),a=i(35748),s=i(87792),c=i(98414);const l=o.AH`
wui-flex,
wui-list-wallet {
width: 100%;
}
`;var u=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let d=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.activeConnector=s.aK.state.activeConnector,this.unsubscribe.push(s.aK.subscribeKey("activeConnector",(e=>this.activeConnector=e)))}disconnectedCallback(){this.unsubscribe.forEach((e=>e()))}render(){return o.qy`
Select Chain for ${this.activeConnector?.name}
Select which chain to connect to your multi chain wallet
${this.networksTemplate()}
`}networksTemplate(){return this.activeConnector?.connectors?.map((e=>e.name?o.qy`
this.onConnector(e)}
data-testid="wui-list-chain-${e.chain}"
>
`:null))}onConnector(e){const t=this.activeConnector?.connectors?.find((t=>t.chain===e.chain));t?"walletConnect"===t.id?s.wE.isMobile()?s.IN.push("AllWallets"):s.IN.push("ConnectingWalletConnect"):s.IN.push("ConnectingExternal",{connector:t}):s.Pt.showError("Failed to find connector")}};d.styles=l,u([(0,r.wk)()],d.prototype,"activeConnector",void 0),d=u([(0,c.customElement)("w3m-connecting-multi-chain-view")],d)},24160:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(60031),a=i(87792),s=i(98414),c=i(39287);const l=o.AH`
wui-logo {
width: 80px;
height: 80px;
border-radius: var(--wui-border-radius-m);
}
@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-icon-box {
position: absolute;
right: calc(var(--wui-spacing-3xs) * -1);
bottom: calc(var(--wui-spacing-3xs) * -1);
opacity: 0;
transform: scale(0.5);
transition: all var(--wui-ease-out-power-2) var(--wui-duration-lg);
}
wui-text[align='center'] {
width: 100%;
padding: 0px var(--wui-spacing-l);
}
[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;
}
.capitalize {
text-transform: capitalize;
}
`;var u=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let d=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.socialProvider=a.Uj.state.socialProvider,this.socialWindow=a.Uj.state.socialWindow,this.error=!1,this.connecting=!1,this.message="Connect in the provider window",this.authConnector=a.aK.getAuthConnector(),this.handleSocialConnection=async e=>{if(e.data?.resultUri)if(e.origin===c.o.SECURE_SITE_ORIGIN){window.removeEventListener("message",this.handleSocialConnection,!1);try{if(this.authConnector&&!this.connecting){this.socialWindow&&(this.socialWindow.close(),a.Uj.setSocialWindow(void 0,a.WB.state.activeChain)),this.connecting=!0,this.updateMessage();const t=e.data.resultUri;this.socialProvider&&a.En.sendEvent({type:"track",event:"SOCIAL_LOGIN_REQUEST_USER_DATA",properties:{provider:this.socialProvider}}),await this.authConnector.provider.connectSocial(t),this.socialProvider&&(a.iT.setConnectedSocialProvider(this.socialProvider),await a.x4.connectExternal(this.authConnector,this.authConnector.chain),a.En.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:this.socialProvider}}))}}catch(e){this.error=!0,this.updateMessage(),this.socialProvider&&a.En.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})}}else a.IN.goBack(),a.Pt.showError("Untrusted Origin"),this.socialProvider&&a.En.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:this.socialProvider}})},this.unsubscribe.push(a.Uj.subscribe((e=>{e.socialProvider&&(this.socialProvider=e.socialProvider),e.socialWindow&&(this.socialWindow=e.socialWindow),e.address&&a.W3.state.open&&a.W3.close()}))),this.authConnector&&this.connectSocial()}disconnectedCallback(){this.unsubscribe.forEach((e=>e())),window.removeEventListener("message",this.handleSocialConnection,!1),this.socialWindow?.close(),a.Uj.setSocialWindow(void 0,a.WB.state.activeChain)}render(){return o.qy`
${this.error?null:this.loaderTemplate()}
Log in with
${this.socialProvider??"Social"}
${this.message}
`}loaderTemplate(){const e=a.Wn.state.themeVariables["--w3m-border-radius-master"],t=e?parseInt(e.replace("px",""),10):4;return o.qy``}connectSocial(){const e=setInterval((()=>{this.socialWindow?.closed&&(this.connecting||"ConnectingSocial"!==a.IN.state.view||(this.socialProvider&&a.En.sendEvent({type:"track",event:"SOCIAL_LOGIN_CANCELED",properties:{provider:this.socialProvider}}),a.IN.goBack()),clearInterval(e))}),1e3);window.addEventListener("message",this.handleSocialConnection,!1)}updateMessage(){this.error?this.message="Something went wrong":this.connecting?this.message="Retrieving user data":this.message="Connect in the provider window"}};d.styles=l,u([(0,r.wk)()],d.prototype,"socialProvider",void 0),u([(0,r.wk)()],d.prototype,"socialWindow",void 0),u([(0,r.wk)()],d.prototype,"error",void 0),u([(0,r.wk)()],d.prototype,"connecting",void 0),u([(0,r.wk)()],d.prototype,"message",void 0),d=u([(0,s.customElement)("w3m-connecting-social-view")],d)},73320:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(87792),a=i(98414),s=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let c=class extends o.WF{constructor(){super(...arguments),this.isMobile=n.wE.isMobile()}render(){if(this.isMobile){const{featured:e,recommended:t}=n.Np.state,{customWallets:i}=n.Hd.state,r=n.iT.getRecentWallets(),a=e.length||t.length||i?.length||r.length;return o.qy`
${a?o.qy``:null}
`}return o.qy`
`}};s([(0,r.wk)()],c.prototype,"isMobile",void 0),c=s([(0,a.customElement)("w3m-connecting-wc-basic-view")],c)},52549:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(87792),a=i(98414),s=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let c=class extends o.WF{constructor(){super(),this.interval=void 0,this.lastRetry=Date.now(),this.wallet=n.IN.state.data?.wallet,this.platform=void 0,this.platforms=[],this.isSiwxEnabled=Boolean(n.Hd.state.siwx),this.determinePlatforms(),this.initializeConnection(),this.interval=setInterval(this.initializeConnection.bind(this),n.oU.TEN_SEC_MS)}disconnectedCallback(){clearTimeout(this.interval)}render(){return o.qy`
${this.headerTemplate()}
${this.platformTemplate()}
`}async initializeConnection(e=!1){if("browser"!==this.platform)try{const{wcPairingExpiry:t,status:i}=n.x4.state;(e||n.wE.isPairingExpired(t)||"connecting"===i)&&(await n.x4.connectWalletConnect(),this.finalizeConnection(),this.isSiwxEnabled||n.W3.close())}catch(e){n.En.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:e?.message??"Unknown"}}),n.x4.setWcError(!0),n.wE.isAllowedRetry(this.lastRetry)?(n.Pt.showError(e.message??"Declined"),this.lastRetry=Date.now(),this.initializeConnection(!0)):n.Pt.showError(e.message??"Connection error")}}finalizeConnection(){const{wcLinking:e,recentWallet:t}=n.x4.state;e&&n.iT.setWalletConnectDeepLink(e),t&&n.iT.setAppKitRecent(t),n.En.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:e?"mobile":"qrcode",name:this.wallet?.name||"Unknown"}})}determinePlatforms(){if(!this.wallet)return this.platforms.push("qrcode"),void(this.platform="qrcode");if(this.platform)return;const{mobile_link:e,desktop_link:t,webapp_link:i,injected:o,rdns:r}=this.wallet,a=o?.map((({injected_id:e})=>e)).filter(Boolean),s=[...r?[r]:a??[]],c=!n.Hd.state.isUniversalProvider&&s.length,l=e,u=i,d=n.x4.checkInstalled(s),h=c&&d,p=t&&!n.wE.isMobile();h&&this.platforms.push("browser"),l&&this.platforms.push(n.wE.isMobile()?"mobile":"qrcode"),u&&this.platforms.push("web"),p&&this.platforms.push("desktop"),!h&&c&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return o.qy``;case"web":return o.qy``;case"desktop":return o.qy`
this.initializeConnection(!0)}>
`;case"mobile":return o.qy`
this.initializeConnection(!0)}>
`;case"qrcode":return o.qy``;default:return o.qy``}}headerTemplate(){return this.platforms.length>1?o.qy`
`:null}async onSelectPlatform(e){const t=this.shadowRoot?.querySelector("div");t&&(await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};s([(0,r.wk)()],c.prototype,"platform",void 0),s([(0,r.wk)()],c.prototype,"platforms",void 0),s([(0,r.wk)()],c.prototype,"isSiwxEnabled",void 0),c=s([(0,a.customElement)("w3m-connecting-wc-view")],c)},47911:(e,t,i)=>{var o=i(12618),r=i(87792),n=i(98414),a=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let s=class extends o.WF{constructor(){super(...arguments),this.wallet=r.IN.state.data?.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return o.qy`
${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()}
${this.homepageTemplate()}
`}chromeTemplate(){return this.wallet?.chrome_store?o.qy`
Chrome Extension
`:null}iosTemplate(){return this.wallet?.app_store?o.qy`
iOS App
`:null}androidTemplate(){return this.wallet?.play_store?o.qy`
Android App
`:null}homepageTemplate(){return this.wallet?.homepage?o.qy`
Website
`:null}onChromeStore(){this.wallet?.chrome_store&&r.wE.openHref(this.wallet.chrome_store,"_blank")}onAppStore(){this.wallet?.app_store&&r.wE.openHref(this.wallet.app_store,"_blank")}onPlayStore(){this.wallet?.play_store&&r.wE.openHref(this.wallet.play_store,"_blank")}onHomePage(){this.wallet?.homepage&&r.wE.openHref(this.wallet.homepage,"_blank")}};s=a([(0,n.customElement)("w3m-downloads-view")],s)},9249:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(87792),a=i(98414);const s=o.AH`
wui-icon-box {
height: var(--wui-icon-box-size-xl);
width: var(--wui-icon-box-size-xl);
}
`;var c=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let l=class extends o.WF{constructor(){super(),this.email=n.IN.state.data?.email,this.authConnector=n.aK.getAuthConnector(),this.loading=!1,this.listenForDeviceApproval()}render(){if(!this.email)throw new Error("w3m-email-verify-device-view: No email provided");if(!this.authConnector)throw new Error("w3m-email-verify-device-view: No auth connector provided");return o.qy`
Approve the login link we sent to
${this.email}
The code expires in 20 minutes
Didn't receive it?
Resend email
`}async listenForDeviceApproval(){if(this.authConnector)try{await this.authConnector.provider.connectDevice(),n.En.sendEvent({type:"track",event:"DEVICE_REGISTERED_FOR_EMAIL"}),n.En.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),n.IN.replace("EmailVerifyOtp",{email:this.email})}catch(e){n.IN.goBack()}}async onResendCode(){try{if(!this.loading){if(!this.authConnector||!this.email)throw new Error("w3m-email-login-widget: Unable to resend email");this.loading=!0,await this.authConnector.provider.connectEmail({email:this.email}),this.listenForDeviceApproval(),n.Pt.showSuccess("Code email resent")}}catch(e){n.Pt.showError(e)}finally{this.loading=!1}}};l.styles=s,c([(0,r.wk)()],l.prototype,"loading",void 0),l=c([(0,a.customElement)("w3m-email-verify-device-view")],l)},22914:(e,t,i)=>{var o=i(87792),r=i(98414),n=i(35310),a=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let s=class extends n.H{constructor(){super(...arguments),this.onOtpSubmit=async e=>{try{if(this.authConnector){if(await this.authConnector.provider.connectOtp({otp:e}),o.En.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),!o.WB.state.activeChain)throw new Error("Active chain is not set on ChainControll");await o.x4.connectExternal(this.authConnector,o.WB.state.activeChain),o.En.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"email",name:this.authConnector.name||"Unknown"}}),o.Hd.state.siwx||o.W3.close()}}catch(e){throw o.En.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL",properties:{message:o.wE.parseError(e)}}),e}},this.onOtpResend=async e=>{this.authConnector&&(await this.authConnector.provider.connectEmail({email:e}),o.En.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}))}}};s=a([(0,r.customElement)("w3m-email-verify-otp-view")],s)},92102:(e,t,i)=>{var o=i(12618),r=i(60031),n=i(87792),a=i(98414),s=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let c=class extends o.WF{render(){return o.qy`
${this.recommendedWalletsTemplate()}
{n.wE.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}}
>
`}recommendedWalletsTemplate(){const{recommended:e,featured:t}=n.Np.state,{customWallets:i}=n.Hd.state;return[...t,...i??[],...e].slice(0,4).map((e=>o.qy`
{n.wE.openHref(e.homepage??"https://walletconnect.com/explorer","_blank")}}
>
`))}};c=s([(0,a.customElement)("w3m-get-wallet-view")],c)},6735:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(60031),a=i(35748),s=i(87792),c=i(98414);const l=o.AH`
@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 u=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let d=class extends o.WF{constructor(){super(),this.network=s.IN.state.data?.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(),t=this.getSubLabel();return o.qy`
${this.error?null:o.qy``}
${e}
${t}
Try again
`}getSubLabel(){const e=s.WB.state.activeChain,t=s.iT.getConnectedConnectorId(e);return s.aK.getAuthConnector()&&t===a.oU.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(){const e=s.WB.state.activeChain,t=s.iT.getConnectedConnectorId(e);return s.aK.getAuthConnector()&&t===a.oU.CONNECTOR_ID.AUTH?`Switching to ${this.network?.name??"Unknown"} network...`:this.error?"Switch declined":"Approve in wallet"}onShowRetry(){if(this.error&&!this.showRetry){this.showRetry=!0;const e=this.shadowRoot?.querySelector("wui-button");e?.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}async onSwitchNetwork(){try{this.error=!1,this.network&&await s.WB.switchActiveNetwork(this.network)}catch(e){this.error=!0}}};d.styles=l,u([(0,r.wk)()],d.prototype,"showRetry",void 0),u([(0,r.wk)()],d.prototype,"error",void 0),d=u([(0,c.customElement)("w3m-network-switch-view")],d)},21725:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(60031),a=i(35748),s=i(87792),c=i(98414);const l=o.AH`
.container {
max-height: 360px;
overflow: auto;
}
.container::-webkit-scrollbar {
display: none;
}
`;var u=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let d=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.network=s.WB.state.activeCaipNetwork,this.requestedCaipNetworks=s.WB.getAllRequestedCaipNetworks(),this.search="",this.onDebouncedSearch=s.wE.debounce((e=>{this.search=e}),100),this.unsubscribe.push(s.WB.subscribeKey("activeCaipNetwork",(e=>this.network=e)),s.WB.subscribeKey("chains",(()=>this.requestedCaipNetworks=s.WB.getAllRequestedCaipNetworks())))}disconnectedCallback(){this.unsubscribe.forEach((e=>e()))}render(){return o.qy`
${this.templateSearchInput()}
${this.networksTemplate()}
Your connected wallet may not support some of the networks available for this dApp
What is a network
`}templateSearchInput(){return o.qy`
`}onInputChange(e){this.onDebouncedSearch(e.detail)}onNetworkHelp(){s.En.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),s.IN.push("WhatIsANetwork")}networksTemplate(){const e=s.WB.getAllRequestedCaipNetworks(),t=s.WB.getAllApprovedCaipNetworkIds(),i=s.wE.sortRequestedNetworks(t,e);return this.search?this.filteredNetworks=i?.filter((e=>e?.name?.toLowerCase().includes(this.search.toLowerCase()))):this.filteredNetworks=i,this.filteredNetworks?.map((e=>o.qy`
this.onSwitchNetwork(e)}
.disabled=${this.getNetworkDisabled(e)}
data-testid=${`w3m-network-switch-${e.name??e.id}`}
>
`))}getNetworkDisabled(e){const t=e.chainNamespace,i=s.Uj.getCaipAddress(t),o=s.WB.getAllApprovedCaipNetworkIds(),r=!1!==s.WB.getNetworkProp("supportsAllNetworks",t),n=s.iT.getConnectedConnectorId(t),c=s.aK.getAuthConnector(),l=n===a.oU.CONNECTOR_ID.AUTH&&c;return!(!i||r||l)&&!o?.includes(e.caipNetworkId)}onSwitchNetwork(e){const t=s.IN.state.data;if(e.id===this.network?.id)return;const i=e.chainNamespace!==s.WB.state.activeChain,o=s.Uj.state.caipAddress,r=s.Uj.getCaipAddress(e.chainNamespace),n=s.iT.getConnectedConnectorId(s.WB.state.activeChain)===a.oU.CONNECTOR_ID.AUTH,c=a.oU.AUTH_CONNECTOR_SUPPORTED_CHAINS.find((t=>t===e.chainNamespace));o?n&&c?s.IN.push("SwitchNetwork",{...t,network:e}):n&&!c||i&&!r?s.IN.push("SwitchActiveChain",{switchToChain:e.chainNamespace,navigateTo:"Connect",navigateWithReplace:!0,network:e}):s.IN.push("SwitchNetwork",{...t,network:e}):s.IN.push("SwitchNetwork",{...t,network:e})}};d.styles=l,u([(0,r.wk)()],d.prototype,"network",void 0),u([(0,r.wk)()],d.prototype,"requestedCaipNetworks",void 0),u([(0,r.wk)()],d.prototype,"filteredNetworks",void 0),u([(0,r.wk)()],d.prototype,"search",void 0),d=u([(0,c.customElement)("w3m-networks-view")],d)},20791:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(60031),a=i(35748),s=i(87792),c=i(98414);const l=o.AH`
:host > wui-flex {
height: 500px;
overflow-y: auto;
overflow-x: hidden;
scrollbar-width: none;
padding: var(--wui-spacing-m);
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: flex-start;
}
:host > wui-flex::-webkit-scrollbar {
display: none;
}
:host > wui-flex > wui-flex {
width: 100%;
}
wui-transaction-list-item-loader {
width: 100%;
}
`;var u=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let d=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.selectedOnRampProvider=s.aG.state.selectedProvider,this.loading=!1,this.coinbaseTransactions=s.WC.state.coinbaseTransactions,this.tokenImages=s.jQ.state.tokenImages,this.unsubscribe.push(s.aG.subscribeKey("selectedProvider",(e=>{this.selectedOnRampProvider=e})),s.jQ.subscribeKey("tokenImages",(e=>this.tokenImages=e)),(()=>{clearTimeout(this.refetchTimeout)}),s.WC.subscribe((e=>{this.coinbaseTransactions={...e.coinbaseTransactions}}))),s.WC.clearCursor(),this.fetchTransactions()}render(){return o.qy`
${this.loading?this.templateLoading():this.templateTransactionsByYear()}
`}templateTransactions(e){return e?.map((e=>{const t=a.rL.formatDate(e?.metadata?.minedAt),i=e.transfers[0],r=i?.fungible_info;if(!r)return null;const s=r?.icon?.url||this.tokenImages?.[r.symbol||""];return o.qy`
`}))}templateTransactionsByYear(){return Object.keys(this.coinbaseTransactions).sort().reverse().map((e=>{const t=parseInt(e,10);return new Array(12).fill(null).map(((e,t)=>t)).reverse().map((e=>{const i=c.TransactionUtil.getTransactionGroupTitle(t,e),r=this.coinbaseTransactions[t]?.[e];return r?o.qy`
${i}
${this.templateTransactions(r)}
`:null}))}))}async fetchTransactions(){await this.fetchCoinbaseTransactions()}async fetchCoinbaseTransactions(){const e=s.Uj.state.address,t=s.Hd.state.projectId;if(!e)throw new Error("No address found");if(!t)throw new Error("No projectId found");this.loading=!0,await s.WC.fetchTransactions(e,"coinbase"),this.loading=!1,this.refetchLoadingTransactions()}refetchLoadingTransactions(){const e=new Date;0!==(this.coinbaseTransactions[e.getFullYear()]?.[e.getMonth()]||[]).filter((e=>"ONRAMP_TRANSACTION_STATUS_IN_PROGRESS"===e.metadata.status)).length?this.refetchTimeout=setTimeout((async()=>{const e=s.Uj.state.address;await s.WC.fetchTransactions(e,"coinbase"),this.refetchLoadingTransactions()}),3e3):clearTimeout(this.refetchTimeout)}templateLoading(){return Array(7).fill(o.qy` `).map((e=>e))}};d.styles=l,u([(0,r.wk)()],d.prototype,"selectedOnRampProvider",void 0),u([(0,r.wk)()],d.prototype,"loading",void 0),u([(0,r.wk)()],d.prototype,"coinbaseTransactions",void 0),u([(0,r.wk)()],d.prototype,"tokenImages",void 0),d=u([(0,c.customElement)("w3m-onramp-activity-view")],d)},25633:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(60031),a=i(87792),s=i(98414);const c=o.AH`
:host > wui-grid {
max-height: 360px;
overflow: auto;
}
wui-flex {
transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
will-change: opacity;
}
wui-grid::-webkit-scrollbar {
display: none;
}
wui-flex.disabled {
opacity: 0.3;
pointer-events: none;
user-select: none;
}
`;var l=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let u=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=a.aG.state.paymentCurrency,this.currencies=a.aG.state.paymentCurrencies,this.currencyImages=a.jQ.state.currencyImages,this.checked=!1,this.unsubscribe.push(a.aG.subscribe((e=>{this.selectedCurrency=e.paymentCurrency,this.currencies=e.paymentCurrencies})),a.jQ.subscribeKey("currencyImages",(e=>this.currencyImages=e)))}disconnectedCallback(){this.unsubscribe.forEach((e=>e()))}render(){const{termsConditionsUrl:e,privacyPolicyUrl:t}=a.Hd.state,i=a.Hd.state.features?.legalCheckbox,r=Boolean(e||t)&&Boolean(i)&&!this.checked;return o.qy`
${this.currenciesTemplate(r)}
`}currenciesTemplate(e=!1){return this.currencies.map((t=>o.qy`
this.selectCurrency(t)}
variant="image"
tabIdx=${(0,n.J)(e?-1:void 0)}
>
${t.id}
`))}selectCurrency(e){e&&(a.aG.setPaymentCurrency(e),a.W3.close())}onCheckboxChange(e){this.checked=Boolean(e.detail)}};u.styles=c,l([(0,r.wk)()],u.prototype,"selectedCurrency",void 0),l([(0,r.wk)()],u.prototype,"currencies",void 0),l([(0,r.wk)()],u.prototype,"currencyImages",void 0),l([(0,r.wk)()],u.prototype,"checked",void 0),u=l([(0,s.customElement)("w3m-onramp-fiat-select-view")],u)},53866:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(87792),a=i(98414),s=i(72088),c=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let l=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.providers=n.aG.state.providers,this.unsubscribe.push(n.aG.subscribeKey("providers",(e=>{this.providers=e})))}firstUpdated(){const e=this.providers.map((async e=>"coinbase"===e.name?await this.getCoinbaseOnRampURL():Promise.resolve(e?.url)));Promise.all(e).then((e=>{this.providers=this.providers.map(((t,i)=>({...t,url:e[i]||""})))}))}render(){return o.qy`
${this.onRampProvidersTemplate()}
`}onRampProvidersTemplate(){return this.providers.filter((e=>e.supportedChains.includes(n.WB.state.activeChain??"eip155"))).map((e=>o.qy`
{this.onClickProvider(e)}}
?disabled=${!e.url}
>
`))}onClickProvider(e){n.aG.setSelectedProvider(e),n.IN.push("BuyInProgress"),n.wE.openHref(e.url,"popupWindow","width=600,height=800,scrollbars=yes"),n.En.sendEvent({type:"track",event:"SELECT_BUY_PROVIDER",properties:{provider:e.name,isSmartAccount:n.Uj.state.preferredAccountType===s.Vl.ACCOUNT_TYPES.SMART_ACCOUNT}})}async getCoinbaseOnRampURL(){const e=n.Uj.state.address,t=n.WB.state.activeCaipNetwork;if(!e)throw new Error("No address found");if(!t?.name)throw new Error("No network found");const i=n.oU.WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP[t.name]??n.oU.WC_COINBASE_PAY_SDK_FALLBACK_CHAIN,o=n.aG.state.purchaseCurrency,r=o?[o.symbol]:n.aG.state.purchaseCurrencies.map((e=>e.symbol));return await n.TP.generateOnRampURL({defaultNetwork:i,destinationWallets:[{address:e,blockchains:n.oU.WC_COINBASE_PAY_SDK_CHAINS,assets:r}],partnerUserId:e,purchaseAmount:n.aG.state.purchaseAmount})}};c([(0,r.wk)()],l.prototype,"providers",void 0),l=c([(0,a.customElement)("w3m-onramp-providers-view")],l)},8051:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(60031),a=i(87792),s=i(98414);const c=o.AH`
:host > wui-grid {
max-height: 360px;
overflow: auto;
}
wui-flex {
transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md);
will-change: opacity;
}
wui-grid::-webkit-scrollbar {
display: none;
}
wui-flex.disabled {
opacity: 0.3;
pointer-events: none;
user-select: none;
}
`;var l=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let u=class extends o.WF{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=a.aG.state.purchaseCurrencies,this.tokens=a.aG.state.purchaseCurrencies,this.tokenImages=a.jQ.state.tokenImages,this.checked=!1,this.unsubscribe.push(a.aG.subscribe((e=>{this.selectedCurrency=e.purchaseCurrencies,this.tokens=e.purchaseCurrencies})),a.jQ.subscribeKey("tokenImages",(e=>this.tokenImages=e)))}disconnectedCallback(){this.unsubscribe.forEach((e=>e()))}render(){const{termsConditionsUrl:e,privacyPolicyUrl:t}=a.Hd.state,i=a.Hd.state.features?.legalCheckbox,r=Boolean(e||t)&&Boolean(i)&&!this.checked;return o.qy`
${this.currenciesTemplate(r)}
`}currenciesTemplate(e=!1){return this.tokens.map((t=>o.qy`
this.selectToken(t)}
variant="image"
tabIdx=${(0,n.J)(e?-1:void 0)}
>
${t.name}
${t.symbol}
`))}selectToken(e){e&&(a.aG.setPurchaseCurrency(e),a.W3.close())}onCheckboxChange(e){this.checked=Boolean(e.detail)}};u.styles=c,l([(0,r.wk)()],u.prototype,"selectedCurrency",void 0),l([(0,r.wk)()],u.prototype,"tokens",void 0),l([(0,r.wk)()],u.prototype,"tokenImages",void 0),l([(0,r.wk)()],u.prototype,"checked",void 0),u=l([(0,s.customElement)("w3m-onramp-token-select-view")],u)},60895:(e,t,i)=>{var o=i(12618),r=i(25707),n=i(60031),a=i(87792),s=i(98414);const c=o.AH`
wui-flex {
width: 100%;
}
wui-icon-link {
margin-right: calc(var(--wui-icon-box-size-md) * -1);
}
.account-links {
display: flex;
justify-content: space-between;
align-items: center;
}
.account-links wui-flex {
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
flex: 1;
background: red;
align-items: center;
justify-content: center;
height: 48px;
padding: 10px;
flex: 1 0 0;
border-radius: var(--XS, 16px);
border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md);
will-change: background-color;
}
.account-links wui-flex:hover {
background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15));
}
.account-links wui-flex wui-icon {
width: var(--S, 20px);
height: var(--S, 20px);
}
.account-links wui-flex wui-icon svg path {
stroke: #47a1ff;
}
.account-settings-button {
padding: calc(var(--wui-spacing-m) - 1px) var(--wui-spacing-2l);
height: 40px;
border-radius: var(--wui-border-radius-xxs);
border: 1px solid var(--wui-color-gray-glass-002);
background: var(--wui-color-gray-glass-002);
cursor: pointer;
}
.account-settings-button:hover {
background: var(--wui-color-gray-glass-005);
}
`;var l=function(e,t,i,o){var r,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(n<3?r(a):n>3?r(t,i,a):r(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a};let u=class extends o.WF{constructor(){super(),this.usubscribe=[],this.address=a.Uj.state.address,this.profileImage=a.Uj.state.profileImage,this.profileName=a.Uj.state.profileName,this.accounts=a.Uj.state.allAccounts,this.loading=!1,this.usubscribe.push(a.Uj.subscribeKey("address",(e=>{e?this.address=e:a.W3.close()}))),this.usubscribe.push(a.Uj.subscribeKey("profileImage",(e=>{this.profileImage=e}))),this.usubscribe.push(a.Uj.subscribeKey("profileName",(e=>{this.profileName=e})))}disconnectedCallback(){this.usubscribe.forEach((e=>e()))}render(){if(!this.address)throw new Error("w3m-profile-view: No account provided");return o.qy`
${this.profileName?s.UiHelperUtil.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):s.UiHelperUtil.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})}
a.IN.push("AccountSettings")}
>
Account Settings
${this.accountsTemplate()}
`}accountsTemplate(){return o.qy`
Your accounts
${this.accounts.map((e=>this.accountTemplate(e)))}
`}async onSwitchAccount(e){this.loading=!0;if(a.aK.getAuthConnector()){const t=e.type;await a.x4.setPreferredAccountType(t)}a.Uj.setShouldUpdateToAddress(e.address,a.WB.state.activeChain),this.loading=!1}accountTemplate(e){return o.qy`
${e.address===this.address?"":o.qy`this.onSwitchAccount(e)}
.loading=${this.loading}
>Switch`}
`}onCopyAddress(){try{this.address&&(a.wE.copyToClopboard(this.address),a.Pt.showSuccess("Address copied"))}catch{a.Pt.showError("Failed to copy")}}};u.styles=c,l([(0,r.wk)()],u.prototype,"address",void 0),l([(0,r.wk)()],u.prototype,"profileImage",void 0),l([(0,r.wk)()],u.prototype,"profileName",void 0),l([(0,r.wk)()],u.prototype,"accounts",void 0),l([(0,r.wk)()],u.prototype,"loading",void 0),u=l([(0,s.customElement)("w3m-profile-view")],u)}}]);