@privy-io/react-auth 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/{importWallet-D3s13-Ir.js → importWallet-CqIkwxB-.js} +1 -1
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/{prepareFundingModalData-CT2XWfw3.js → prepareFundingModalData-BCNQSbXb.js} +1 -1
- package/dist/cjs/{smart-wallets-BggeovZV.js → smart-wallets-BJE1oUqH.js} +1 -1
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/ui.js +1 -1
- package/dist/cjs/{useActiveWallet-mT7IempW.js → useActiveWallet-CLPPplpC.js} +4 -4
- package/dist/cjs/{useFundWallet-C1OiqVXT.js → useFundWallet-BLEO3WzQ.js} +1 -1
- package/dist/cjs/{useWallets-qEcpULZl.js → useWallets-Dmyb5a0t.js} +1 -1
- package/dist/dts/index.d.mts +2 -1
- package/dist/dts/index.d.ts +2 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/{importWallet-Db-TmI57.mjs → importWallet-CJLTGjPg.mjs} +1 -1
- package/dist/esm/index.mjs +21 -21
- package/dist/esm/{prepareFundingModalData-kNpmfOTp.mjs → prepareFundingModalData-due26ueW.mjs} +1 -1
- package/dist/esm/{smart-wallets-BF48FIHR.mjs → smart-wallets-dP5AzE1-.mjs} +1 -1
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/ui.mjs +1 -1
- package/dist/esm/{useActiveWallet-C89-c9e3.mjs → useActiveWallet-C8nSK6cE.mjs} +3 -3
- package/dist/esm/{useFundWallet-DYXHQOzn.mjs → useFundWallet-DR5oafbj.mjs} +1 -1
- package/dist/esm/{useWallets-DhD2VeRF.mjs → useWallets-DTpjk5Rk.mjs} +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import e,{useRef as t,useState as i,useMemo as r,useContext as a,createContext as n,useEffect as o,useCallback as l}from"react";import{jsx as s,jsxs as c,Fragment as d}from"react/jsx-runtime";import{a as h,af as p,ag as u,u as f,q as w,w as g,x as m,r as v,M as y,s as b,Y as C,X as x,ah as A,Q as k,ai as I,aj as T,N as S,T as E,U as M,ak as N,E as L}from"./useWallets-DhD2VeRF.mjs";import{W as P,i as W,f as F,w as _,U as R,u as O,C as D,P as z,d as U}from"./prepareFundingModalData-kNpmfOTp.mjs";import{isMobile as B}from"react-device-detect";import{styled as $,css as V,keyframes as j}from"styled-components";import{b as H,P as Z,f as G,j as q,a as X,n as J,u as Y,g as Q}from"./internal-context-mSHyF0Gq.mjs";import K from"@heroicons/react/24/outline/ArrowLeftIcon";import ee from"@heroicons/react/24/outline/ArrowRightIcon";import te from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import ie from"@heroicons/react/24/outline/XMarkIcon";import{isHex as re,getAddress as ae,formatEther as ne,createPublicClient as oe,http as le}from"viem";import{EthereumProvider as se,OPTIONAL_EVENTS as ce,OPTIONAL_METHODS as de}from"@walletconnect/ethereum-provider";import{create as he}from"zustand";import{getAddress as pe,toHex as ue}from"viem/utils";import fe from"@heroicons/react/24/outline/CheckIcon";import we from"@heroicons/react/24/outline/Square2StackIcon";import ge from"qrcode";import me from"@heroicons/react/24/outline/GlobeAltIcon";import{a as ve}from"./getPublicClient-wHgCncHx.mjs";import{shallow as ye}from"zustand/shallow";import{createWithEqualityFn as be}from"zustand/traditional";const Ce=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom||"isPhantom"in e?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,xe=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==Ce(e))return!1;if(e.providers)for(let t of e.providers)if(!xe(t))return!1;return!0},Ae=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers)for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0;return!1},ke=(e,t)=>{let i=[],r=[];for(let[a,n]of e.entries())a<t?i.push(n):r.push(n);return[i,r]},Ie=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),Te=(e,t=3,i=4,r="ethereum")=>{if(!e)return"";let a="ethereum"===r?2:0;return t+i+a+3>=e.length?e:`${e.slice(0,a+t)}...${e.slice(e.length-i,e.length)}`},Se=(e,t=3,i=4)=>Te(e,t,i,"solana"),Ee=e=>new Promise((t=>setTimeout(t,e)));const Me=(e,t={})=>{let i=t.delayMs||150,r=t.maxAttempts||270;return new Promise((async(a,n)=>{let o=!1,l=0;for(;!o&&l<r;){if(t.abortSignal?.aborted)return;e().then((e=>{o=!0,a(e)}),((...e)=>{o=!0,n(...e)})),l+=1,await Ee(i)}o||n(Error("Exceeded max attempts before resolving function"))}))},Ne=(e,t,i={},r={})=>{let a=new URL(t,e);for(let[e,t]of Object.entries(i))void 0!==t&&a.searchParams.set(e,t);let n=Object.entries(r);if(n.length>0){let e=new URLSearchParams;for(let[t,i]of n)e.append(t,i);a.hash=e.toString()}return a.href},Le=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Pe=e=>"string"==typeof e?e:"0x"+e.toString(16);async function We({store:e,walletList:t,externalWalletConfig:i,walletChainType:r,timeout:a=3e3}){let n=!1,o=window;return new Promise((l=>{function s(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",s);let a=e.getProviders();console.debug("Detected injected providers:",a.map((e=>e.info)));let o=[];for(let e of a)t.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||"solana-only"===r&&"app.phantom"===e.info.rdns||o.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});if("solana-only"!==r)for(let e of function(){let e=window,t=e.ethereum;if(!t)return[];let i=[];if(t.providers?.length)for(let e of t.providers)e&&i.push(e);return i.push(e.ethereum),i}()){let t=Ce(e);if(!a.some((e=>e.info.name===t))){if(xe(e,!0)&&!o.find((e=>"metamask"===e.type))){o.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===t&&!o.find((e=>"phantom"===e.type))){o.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===t&&!o.find((e=>"coinbase_wallet"===e.type&&"smartWalletOnly"!==i.coinbaseWallet?.connectionOptions))){o.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}o.find((e=>"unknown_browser_extension"===e.type))||o.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}l(o)}o.ethereum?s():(window.addEventListener("ethereum#initialized",s,{once:!0}),setTimeout((()=>{s()}),a))}))}function Fe(e){return`eip155:${String(Number(e))}`}const _e=(e,t,i,r)=>{let a=Number(e),n=t.find((e=>e.id===a));if(!n)throw new H(`Unsupported chainId ${e}`,4901);return ve(n,i,r)},Re=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},i=e.types.EIP712Domain??Object.entries(e.domain).map((([e,i])=>{if(null!=i&&"string"==typeof e&&e in t)return{name:e,type:t[e]}})).filter((e=>void 0!==e));return{...e,types:{...e.types,EIP712Domain:i}}};const Oe=["c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96","4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0","225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f","1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369","c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a","ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18","bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6","74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d","afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7","f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d","84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04","0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150","38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662","9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0","c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576","8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4","e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4","f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2","138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98","47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83","7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26","8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3","031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa","2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568","dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd","2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01","b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f","0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92","719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3","942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef","8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2","07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80","8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819","bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a","cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e","94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43","2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715","14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc","576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd","49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd","19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b","5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b","d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b","50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b","9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8","6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa","41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071","14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd","a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1","971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709","18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1","15c8b91ade1a4e58f3ce4e7a0dd7f42b47db0c8df7e0d84f63eb39bcb96c4e0f","541d5dcd4ede02f3afaf75bf8e3e4c4f1fb09edb5fa6c4377ebf31c2785d9adf"];function De(e){return{name:e.metadata?.shortName||e.name||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}let ze="WALLETCONNECT_DEEPLINK_CHOICE";function Ue(e){return e.startsWith("http://")||e.startsWith("https://")}function Be(e,t){if(Ue(e))return $e(e,t);let i=e;return i.includes("://")||(i=e.replaceAll("/","").replaceAll(":",""),i=`${i}://`),i.endsWith("/")||(i=`${i}/`),{redirect:`${i}wc?uri=${encodeURIComponent(t)}`,href:i}}function $e(e,t){if(!Ue(e))return Be(e,t);let i=e;return i.endsWith("/")||(i=`${i}/`),{redirect:`${i}wc?uri=${encodeURIComponent(t)}`,href:i}}function Ve(e,t){window.open(e,t,"noreferrer noopener")}class je{execute(e){return null===this.promise&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}constructor(e){this.promise=null,this.fn=e}}const He=({address:e,chainId:t,nonce:i})=>`${window.location.host} wants you to sign in with your Ethereum account:\n${e}\n\nBy signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.\n\nURI: ${window.location.origin}\nVersion: 1\nChain ID: ${t}\nNonce: ${i}\nIssued At: ${(new Date).toISOString()}\nResources:\n- https://privy.io`;class Ze{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,chainId:this.wallet.chainId,address:this.wallet.address,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new Z("SiweFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.authenticateWithSiweInternal({message:e,signature:t,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw G(e)}}async link(){if(!this.client)throw new Z("SiweFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.linkWithSiweInternal({message:e,signature:t,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw G(e)}}async sign(){if(!this.client)throw new Z("SiweFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new Z("Could not prepare SIWE message");let e=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:e}}async _getNonceOnce(){if(!this.client)throw new Z("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new Z("SiweFlow has no client instance");let e=this.wallet.address,t=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=He({address:e,chainId:t,nonce:this.nonce}),this.preparedMessage}constructor(e,t,i,r=!1){this._meta={disableSignup:!1},this.getNonceOnce=new je(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=i,this.client=t,this._meta.disableSignup=r}}class Ge{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new Z("SiwsFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.authenticateWithSiwsInternal({message:e,signature:t,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw G(e)}}async link(){if(!this.client)throw new Z("SiwsFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.linkWithSiwsInternal({message:e,signature:t,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw G(e)}}async sign(){if(!this.client)throw new Z("SiwsFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new Z("Could not prepare SIWS message");if(!this.wallet.signMessage)throw new Z("Wallet does not support signMessage");let e=await this.wallet.signMessage(Buffer.from(this.preparedMessage));return{message:this.preparedMessage,signature:Buffer.from(e).toString("base64")}}async _getNonceOnce(){if(!this.client)throw new Z("SiwsFlow has no client instance");return await this.client.generateSiwsNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new Z("SiwsFlow has no client instance");let e=this.wallet.address;return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=(({address:e,nonce:t})=>`${window.location.host} wants you to sign in with your Solana account:\n${e}\n\nYou are proving you own ${e}.\n\nURI: ${window.location.origin}\nVersion: 1\nChain ID: mainnet\nNonce: ${t}\nIssued At: ${(new Date).toISOString()}\nResources:\n- https://privy.io`)({address:e,nonce:this.nonce}),this.preparedMessage}constructor(e,t,i,r=!1){this._meta={disableSignup:!1},this.getNonceOnce=new je(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=i,this.client=t,this._meta.disableSignup=r}}const qe=/*#__PURE__*/n({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:J,setError:J,setExecuting:J,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:J,reset:J,execute:J});class Xe extends q{constructor(e,t,i){super(e||"Captcha failed"),this.type="Captcha",t instanceof Error&&(this.cause=t),this.privyErrorCode=i}}const Je=({children:e,id:a,captchaSiteKey:n,captchaEnabled:o})=>{let l=t(null),[c,d]=i(),[h,p]=i(),[u,f]=i(!1),w=r((()=>o?u||c||h?!u||c||h?c&&!h?{status:"success",token:c}:h?{status:"error",error:h}:{status:"ready"}:{status:"loading"}:{status:"ready"}:{status:"disabled"}),[o,c,h,u]);/*#__PURE__*/return s(qe.Provider,{value:{...w,ref:l,enabled:o,siteKey:n,appId:a,setToken:d,setError:p,setExecuting:f,remove(){o&&(l.current?.remove(),f(!1),p(void 0),d(void 0))},reset(){o&&(l.current?.reset(),f(!1),p(void 0),d(void 0))},execute(){o&&(f(!0),l.current?.execute())},async waitForResult(){if(!o)return"";try{return await function(e,{interval:t=100,timeout:i=5e3}={}){return new Promise(((r,a)=>{let n,o=0,l=()=>{o>=i?a("Max attempts reached without result"):(n=e(),o+=t,null==n?setTimeout(l,t):r(n))};l()}))}((()=>l.current?.getResponse()),{interval:200,timeout:2e4})}catch(e){throw new Xe("Captcha failed",null,X.CAPTCHA_TIMEOUT)}}},children:e})},Ye=()=>a(qe);function Qe(e){return"ethereum"===e.type}function Ke(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++){let r=e[i],a=t[i];if(r?.address!==a?.address||r&&a&&Qe(r)&&Qe(a)&&r?.chainId!==a?.chainId||r?.connectorType!==a?.connectorType||r?.connectedAt!==a?.connectedAt||r?.walletClientType!==a?.walletClientType||r?.isConnected!==a?.isConnected||r?.linked!==a?.linked)return!1}return!0}const et=(e,t)=>e.rpcTimeouts&&e.rpcTimeouts[t]||h;function tt(e){return"ethereum"===e.chainType}class it extends P{buildConnectedWallet(e,t,i,r){let a=async()=>!!this.wallets.find((t=>pe(t.address)===pe(e)));return{type:"ethereum",address:pe(e),chainId:t,meta:i,imported:r,switchChain:async i=>{let r,n;if(!a)throw new H("Wallet is not currently connected.");let o=this.wallets.find((t=>pe(t.address)===pe(e)))?.chainId;if(!o)throw new H("Unable to determine current chainId.");if("number"==typeof i?(r=`0x${i.toString(16)}`,n=i):(r=i,n=Number(i)),o===Fe(r))return;let l=this.chains.find((e=>e.id===n));if(!l)throw new H(`Unsupported chainId: ${i}`);let s=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]})};try{return await s()}catch(e){if(((e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");case"rabby_wallet":return e.message.includes("Unrecognized chain ID");default:return 4902===e.code||e.message?.includes("4902")}})(e,this.walletClientType))return"rabby_wallet"===this.walletClientType&&await Ee(300),await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:r,chainName:l.name,nativeCurrency:l.nativeCurrency,rpcUrls:[l.rpcUrls.default?.http[0]??""],blockExplorerUrls:[l.blockExplorers?.default.url??""]}]}),s();if("rainbow"===this.walletClientType&&e.message?.includes("wallet_switchEthereumChain"))throw new H(`Rainbow does not support the chainId ${t}`);throw e}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new H("Wallet is not currently connected.");return this.proxyProvider},sign:async e=>{if(!await a())throw new H("Wallet is not currently connected.");return await this.sign(e)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let t,i=e;try{if(void 0===i){let e=await Me((()=>this.proxyProvider.request({method:"eth_accounts"})),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,e),Array.isArray(e)&&(i=e)}}catch(e){console.debug("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",e)}if(!i||!Array.isArray(i)||i.length<=0||!i[0])return;let r=i[0],a=pe(r),n=[];if("privy"===this.walletClientType){let e=W.get(p(a));this.chains.find((t=>t.id===Number(e)))||(W.del(p(a)),e=null),t=e||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]})}catch(e){console.warn(`Unable to switch embedded wallet to chain ID ${t} on initialization`)}}else try{let e=await Me((()=>this.proxyProvider.request({method:"eth_chainId"})),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,e),"string"==typeof e)t=e;else{if("number"!=typeof e)throw Error("Invalid chainId returned from provider");t=`0x${e.toString(16)}`}}catch(e){console.warn(`Failed to get chainId from provider, defaulting to ${u}`,e),t=u}let o=Fe(t);if(!n.find((e=>pe(e.address)===a))){let e={name:this.walletBranding.name,icon:"string"==typeof this.walletBranding.icon?this.walletBranding.icon:void 0,id:this.walletBranding.id};n.push(this.buildConnectedWallet(pe(r),o,e,"embedded_imported"===this.connectorType))}Ke(n,this.wallets)||(this.wallets=n,this.emit("walletsUpdated"))}async getConnectedWallet(){let e=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort(((e,t)=>t.connectedAt-e.connectedAt)).find((t=>e.find((e=>pe(e)===pe(t.address)))))||null}async isConnected(){let e=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0}async sign(e){return await this.connect({showPrompt:!1}),this.proxyProvider.request({method:"personal_sign",params:[ue(e),this.wallets[0]?.address]})}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}constructor(e,t,i,r){super(e),this.chainType="ethereum",this.onAccountsChanged=e=>{0===e.length?this.onDisconnect():this.syncAccounts(e)},this.onChainChanged=e=>{this.wallets.forEach((t=>{t.chainId=Fe(e),"privy"===this.walletClientType&&W.put(p(t.address),e)})),this.emit("walletsUpdated")},this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")},this.onConnect=()=>{this.connected=!0,this.syncAccounts()},this.wallets=[],this.walletClientType=e,this.chains=t,this.defaultChain=i,this.rpcConfig=r,this.rpcTimeoutDuration=et(r,e),this.connected=!1,this.initialized=!1}}class rt{on(e,t){if(this.walletProvider)return this.walletProvider.on(e,t);this._subscriptions.push({eventName:e,listener:t})}async request(e){if(!this.walletProvider)throw new H(`A wallet request of type ${e.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(e),this.walletTimeout()]).catch((e=>{throw F(e)}))}constructor(e,t){this.removeListener=(e,t)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(e,t)}catch(e){console.warn("Unable to remove wallet provider listener")}},this.walletTimeout=(e=new _,t=this.rpcTimeoutDuration)=>new Promise(((i,r)=>setTimeout((()=>{r(e)}),t))),this.setWalletProvider=e=>{this.walletProvider&&this._subscriptions.forEach((e=>{this.removeListener(e.eventName,e.listener)})),this.walletProvider=e,this._subscriptions.forEach((e=>{this.walletProvider?.on(e.eventName,e.listener)}))},this.walletProvider=e,this.rpcTimeoutDuration=t||h,this._subscriptions=[]}}const at=({style:e,...t})=>/*#__PURE__*/s("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:/*#__PURE__*/s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),nt=he((()=>({listings:[]}))),ot=nt.setState,lt=e=>nt.getState().listings.find((({slug:t})=>dt(t)===dt(e))),st=e=>{let t;try{t=new URL(e).hostname}catch(e){return}return nt.getState().listings.find((({homepage:e})=>{let i;try{i=new URL(e).hostname}catch(e){return!1}return t.includes(i)}))},ct=e=>nt((({listings:t})=>t.find((({slug:t})=>dt(t)===dt(e)))));function dt(e){return"cryptocom"===e?"cryptocom-defi":e.replace(/[-_]wallet$/,"")}const ht=({style:e,...t})=>{let{app:i}=f();/*#__PURE__*/return c("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[/*#__PURE__*/s("rect",{width:"28",height:"28",rx:"3",fill:"dark"===i?.appearance.palette.colorScheme?"#3396ff":"#141414"}),/*#__PURE__*/s("g",{clipPath:"url(#clip0_1765_9946)",children:/*#__PURE__*/s("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),/*#__PURE__*/s("defs",{children:/*#__PURE__*/s("clipPath",{id:"clip0_1765_9946",children:/*#__PURE__*/s("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};class pt extends it{async initialize(){let e=await this.createProvider();this.provider=e,this.proxyProvider.setWalletProvider(e),this.subscribeListeners(),e.session&&(this.walletProvider?.session?.peer.metadata.url&&(this.walletEntry=st(this.walletProvider?.session?.peer.metadata.url),this.walletClientType=this.walletEntry?.slug||"unknown"),this.connected=!0,await this.syncAccounts()),this.initialized=!0,this.emit("initialized");let{WalletConnectModal:t}=await import("@walletconnect/modal");this.modal=new t({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"},explorerRecommendedWalletIds:Oe}),this.modal.subscribeModal((e=>{e.open||this.walletProvider?.session||!this.onQrModalClosed||this.onQrModalClosed()}))}async connect(e){return e.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){let e=this.walletProvider?.session?.peer.metadata.icons?.[0];return{name:Le(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:"string"==typeof e?e:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfoDAIVODUC+w+GAAAGsUlEQVRYw6WXbYwWVxXHf+fOLAtCXYS2QJdIaClipGCTknXXNqBQMVHbfmhItH4Aral+IAEaG03UxJgYKQJGTUxtDWjaxDSNtcZqIGDwpRuW1oYiVqpdpZSlpC3qysu+PHPP3w/3mXnmeXZbPzjJZO7cefn/z/mfe865xlscq3dGDIguGiHLaMQVLja4s87FShcLo5jtApdddnHexUmHIy475JmdUkPRAQMu7gzT4ljnxJpdk0QPmMFkyAKN2OfOFpc2uuh1J3MZDrjAvXmVEQUuoosRxw642FcEG7IoDxiFxNiu8NYE+vcUYIFYRKKs113bXWx2Z34CoQZsVHOiCZ7mopdzdsFhv8NexEgRDHMxUSNREbh1bwNZwBsFblmfu/a4a6AEENYO5i3AOoEWeEUCF4MOOxBDMQAOk99OJALA2u80sBCwWGBZWG/yRwMaCAbBIAsQTJT3gea1OWfNeaPzvjoHEI85rA8ObtB1v7cIdJkIHgkh9AXpocy0LJjIKvB2wPpZB0v3wkrw5jdNEjeYeMhFX3BAyfn2ke9NUrgB9LrrcZcGJFCld4fWNddXbvbWfWzGR6xJFZsBGh0cBh3bBIxIEGTQ3W0h4NuDaSAzyAxCmGq11Vzf5uaa1aG8p+WFtrEYQGwvjICJkAEqvC+YNmcmMlMNvEaCdrcbyUvQAWDTjVuESHObM6cPGWHmzDwLaEtmzG9Z3qF1zUpXmuuZBb1z4bqeNC6f0WE1NtUTwHzEloiy3BvFisy0sYoLlQtT6XW15md2Qf9SY+2Ngfdca/TMSm/9ewz+/Boc/It45h/i4kSTsKw90SQJsPTvjSZbkWemDW7qTRZ0JEYJWSKxZJ7xmf6M224MzMzbX1s8F1YugjtvMg6eErt/4/z1jUrz1rXUKxnZC2zIg2mdBTK1mFUOKC1fOt/48kdzVixIz86Nij+eEacvpJWyZJ5xy7th8VzjjpuMJfMCW58QL73ekXPVlhsyE+vyzFiplJyauEIyrGIquruMq7qTxk+dcB495rzyTzFepCUWLIFv/kBg081Gd55WUk1IDGFTS89K++TDYxddzKnWcbluHd450xgdh7EGrOo1rr868PMTzqWJRGZ2d8oB/xpL33Xnxl2rjeNn4blXRXduzJ4B5y+28kWscAwXl+yeR654FFZPHoUb710YuPeDOUdPO48di1xptKpeEeHqOcYXNwQKGd88EDk3mqxtxPSfGRlsXRtYt8z4ytPOH/7eqpg1Aso7fYKgK4NPrMpYvsC4/poMA34yVJIQC3sCD9yecdsNyaV5yPj6ryJnR1PAvSNP4J+/1cgDfLbfePaMGGtM7Qdyl12WmKOmXgKKAp54vmBRTxfLrjE+tSYjBPjRM5FrrzIeuD2jf2lLzw8vN4JlfPVp581LsO1DgXv7jSzAiXPw/d+JiYLpjsu26Yfjf5O0rF5WoxsNT9G/bX0XKxakmPjlSee6HlizJJXSX7/oRDc+vjKR+f2wODcKd78/gR8/C9uedF44myJxmhh4OY/ipMQyqaWxmjn95TfEroMFOzbkvG+RceeqViPx1Aln1yEnOow1AnffHCpJAJ5/Vex4UvzptZRdY/O/1dJIS/NkcNmR6MTYah6qzseA4TfFtw4UvHBW1bc/O+7sPhwZHYf/jMODh5yfPudVbXj2TAJ/8XxrOZagNamj4Ei2/GNfuyRxh8t6BG2l15up+MIVODEiFr8rcPS0+O6RBF6mrrEGHHtFzOo2Lo7Dl37hvPQ6mNV6R9JYKgnYWcE37K5HlE2OT/5A0udaPUBHH+BQOMzuNsYLuDyZflTW+fTcmJFDHhJhaZqewMuewXDxcDR9IYyPN6Jj+6K4MF2vV8qBtZJScqVRNi6lpGONVJis5mpKi1WbgwsY+zIsBpcR8mzIZfuTRVZrtdu9odrptR/Xx5XONXJqBmCN0P6YMUQq9WJiwt0Je102WHdbpxSqydMObBWYdwDWLVcqcIMYe3NPjg0Ht84od0Ajju1w2XCr9e6QoqM9V23ZtnmI6cfAMMb9AY0YEHdb6oobEh4y3H3Ize6LsmGvN5IdUnhttdQ9UVrfLk/ljWEZ9wXsqAdQk1EA+O22GcgdZTke/bAs3OPY4HSdcB20HhvVtTMu0jmI8ekAhz2IICj2hKpNqI60NcuIRUHEej1quzubXa2tmZhenrfZmv3YYQ9ipDAIgvHptmblccuDjdRcmjFpWbDi/9ycZjZkRbk5jYztai/AUwiUx+qdEQB/m+25i9lxyvbcjrg45Lmd0uT/3p7/Fw6ODf+WO019AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTEyLTAyVDIxOjU2OjQ4KzAwOjAwMVpslgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNC0xMi0wMlQyMTo1Njo0OCswMDowMEAH1CoAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjQtMTItMDJUMjE6NTY6NTMrMDA6MDDZv6GRAAAAAElFTkSuQmCC",id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(e){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletClientType=e,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,function(){try{localStorage.removeItem(ze)}catch{}}(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise(((e,t)=>{this.onQrModalClosed=()=>{t(new R)},(async()=>{let t="",i=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(i?.length&&(t=i[0]),!t||""===t)throw new H("Unable to retrieve address");this.walletProvider?.session?.peer.metadata.url&&(this.walletEntry=st(this.walletProvider?.session?.peer.metadata.url),this.walletClientType=this.walletEntry?.slug||"unknown",this.proxyProvider.rpcTimeoutDuration=et(this.rpcConfig,this.walletClientType)),this.connected=!0,await this.syncAccounts(i),e()})().catch((e=>{t(e?F(e):new H("Unknown error during connection"))})).finally((()=>this.modal?.closeModal()))}))}disconnect(){this.walletProvider?.disconnect().then((()=>this.onDisconnect())).catch((()=>console.warn("Unable to disconnect Wallet Connect provider")))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(e){this.proxyProvider.setWalletProvider(e)}async createProvider(){let e={};for(let t of this.chains){let i=_e(t.id,this.chains,this.rpcConfig,this.privyAppId);i&&(e[t.id]=i)}let t=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],i=this.chains.map((e=>e.id)),r=await se.init({projectId:this.walletConnectCloudProjectId,chains:t,optionalChains:i,optionalEvents:ce,optionalMethods:de,rpcMap:e,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return r.on("display_uri",(e=>{if(r.signer.abortPairingAttempt(),this.walletEntry){let{redirect:t,href:i}=function(e,t){let i=De(t);if(i.deepLink)return Be(i.deepLink,e);if(i.universalLink)return $e(i.universalLink,e);throw new Z(`Unsupported wallet ${t.id}`)}(e,this.walletEntry);(function({href:e,name:t}){try{localStorage.setItem(ze,JSON.stringify({href:e,name:t}))}catch{}})({href:i,name:this.walletEntry.metadata?.shortName||this.walletEntry.name}),this.redirectUri=t;let r=function(e,t){let i=De(t);if(i.universalLink)return $e(i.universalLink,e)}(e,this.walletEntry);r?.redirect&&(this.fallbackUniversalRedirectUri=r.redirect),B?(Ve(t,"_self"),this.showPrivyQrModal?.({native:t,universal:this.fallbackUniversalRedirectUri})):this.showPrivyQrModal?this.showPrivyQrModal?.({native:t,universal:this.fallbackUniversalRedirectUri}):this.modal?.openModal({uri:e,chains:[this.defaultChain.id]})}else this.modal?.openModal({uri:e,chains:[this.defaultChain.id]})})),r.on("connect",(()=>{this.modal?.closeModal(),r.session?.peer.metadata.url&&(this.walletEntry=st(r.session?.peer.metadata.url),this.walletClientType=this.walletEntry?.slug||"unknown")})),r}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await(this.walletProvider?.enable())}setWalletEntry(e,t){this.walletEntry=e,this.showPrivyQrModal=t}constructor(e,t,i,r,a,n,o,l){super(l||"unknown",i,r,t),this.connectorType="wallet_connect_v2",this.privyAppId=n,this.privyAppName=o,this.walletConnectCloudProjectId=e,this.rpcConfig=t,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new rt(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=lt(l),this.walletClientType=l)}}const ut=e=>{let[t,r]=i("auto");return o((()=>{let t=new ResizeObserver((e=>{r(e[0]?.contentRect.height??"auto")}));return e.current&&t.observe(e.current),()=>{e.current&&t.unobserve(e.current)}}),[e.current]),t},ft=({success:e,fail:t})=>/*#__PURE__*/c(d,{children:[/*#__PURE__*/s(wt,{className:e?"success":t?"fail":""}),/*#__PURE__*/s(gt,{className:e?"success":t?"fail":""})]}),wt=/*#__PURE__*/$.span.withConfig({displayName:"Loader",componentId:"sc-ce7792e2-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1.2s linear infinite;transition:border-color 800ms;}@keyframes rotation{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}&&&.success{border-color:var(--privy-color-success);border-bottom-color:var(--privy-color-success);}&&&.fail{border-color:var(--privy-color-error);border-bottom-color:var(--privy-color-error);}"],(e=>e.color??"var(--privy-color-accent)")),gt=/*#__PURE__*/$(wt).withConfig({displayName:"LoaderFaint",componentId:"sc-ce7792e2-1"})(["&&{border-bottom-color:",";animation:none;opacity:0.5;}"],(e=>e.color??"var(--privy-color-accent)")),mt=e=>/*#__PURE__*/s(vt,{color:e.color||"var(--privy-color-foreground-3)"});let vt=/*#__PURE__*/$(wt).withConfig({displayName:"StyledButtonLoader",componentId:"sc-ce7792e2-2"})(["&&{height:1rem;width:1rem;margin:2px 0;border-width:1.5px;transition:border-color 200ms ease;}"]);const yt=/*#__PURE__*/$.button.withConfig({displayName:"Button",componentId:"sc-3253171f-0"})(["display:flex;flex-direction:row;align-items:center;justify-content:center;user-select:none;&{width:100%;cursor:pointer;border-radius:var(--privy-border-radius-md);font-size:1rem;font-style:normal;font-weight:500;line-height:22px;letter-spacing:-0.016px;}&&{padding:12px 16px;}"]),bt=({children:e,loading:t,disabled:i,success:r,loadingText:a="Loading...",...n})=>/*#__PURE__*/s(kt,{disabled:t||i,success:r,...n,children:t?/*#__PURE__*/c("span",{children:[/*#__PURE__*/s(mt,{}),a?/*#__PURE__*/s("span",{children:a}):null]}):e}),Ct=({children:e,loading:t,disabled:i,...r})=>/*#__PURE__*/s(xt,{disabled:i,...r,children:t?/*#__PURE__*/s(mt,{color:"var(--privy-color-foreground-accent)"}):e});let xt=/*#__PURE__*/$(yt).withConfig({displayName:"StyledPrimaryButtonWithoutGray",componentId:"sc-3253171f-1"})(["position:relative;&&{background-color:var(--privy-color-accent);color:var(--privy-color-foreground-accent);transition:background-color 200ms ease;}&:hover{background-color:var(--privy-color-accent-dark);}&:active{background-color:var(--privy-color-accent-dark);}&:disabled,&:hover:disabled,&:active:disabled{cursor:not-allowed;pointer-events:none;color:var(--privy-color-foreground-accent);background-color:var(--privy-color-accent-dark);}"]);const At=({children:e,loading:t,disabled:i,loadingText:r="Loading...",...a})=>/*#__PURE__*/s(kt,{as:"a",disabled:t||i,...a,children:t?/*#__PURE__*/c("span",{children:[/*#__PURE__*/s(mt,{}),r?/*#__PURE__*/s("span",{children:r}):null]}):e});let kt=/*#__PURE__*/$(yt).withConfig({displayName:"StyledPrimaryButton",componentId:"sc-3253171f-2"})(["position:relative;&&{background-color:",";color:var(--privy-color-foreground-accent);transition:background-color 200ms ease;}&:hover{background-color:",";}&:active{background-color:",";}&:hover:disabled,&:active:disabled{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;}"," > span{display:flex;align-items:center;gap:8px;opacity:1;animation:fadein 200ms ease;}"],(e=>e.warn?"var(--privy-color-error)":e.success?"var(--privy-color-success)":"var(--privy-color-accent)"),(e=>e.warn?"var(--privy-color-error)":e.success?"var(--privy-color-success)":"var(--privy-color-accent-dark)"),(e=>e.warn?"var(--privy-color-error)":e.success?"var(--privy-color-success)":"var(--privy-color-accent-dark)"),(e=>e.disabled?/*#__PURE__*/V(["&&&,&&&:hover,&&&:active{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;pointer-events:none;}"]):""));const It=({children:e,loading:t,disabled:i,loadingText:r="Loading...",...a})=>/*#__PURE__*/s(Tt,{disabled:t||i,...a,children:t?/*#__PURE__*/c("span",{children:[/*#__PURE__*/s(mt,{}),r?/*#__PURE__*/s("span",{children:r}):null]}):e});let Tt=/*#__PURE__*/$(yt).withConfig({displayName:"StyledSecondaryButton",componentId:"sc-3253171f-3"})(["&&{border-width:1px;border-color:",";color:var(--privy-color-foreground);transition:border-color 200ms ease;}&:hover,&:active{border-color:",";}&:hover:disabled,&:active:disabled{border-color:var(--privy-color-foreground-accent);color:var(--privy-color-foreground-3);cursor:not-allowed;}> span{display:flex;align-items:center;gap:8px;opacity:1;animation:fadein 200ms ease;}"],(e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"),(e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-3)"));const St=/*#__PURE__*/$.button.withConfig({displayName:"SoftCtaButton",componentId:"sc-3253171f-4"})(["&&{padding:12px 16px;font-weight:500;text-align:center;color:var(--privy-color-foreground-accent);background-color:var(--privy-color-accent);border-radius:var(--privy-border-radius-sm);min-width:144px;opacity:",";transition:opacity 200ms ease,background-color 200ms ease,color 200ms ease;user-select:none;"," &:hover{background-color:var(--privy-color-accent-dark);}&:active{background-color:var(--privy-color-accent-dark);}&:hover:disabled,&:active:disabled{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;}}"],(e=>e.invisible?"0":"1"),(e=>e.invisible&&/*#__PURE__*/V(["pointer-events:none;"]))),Et=({children:e,onClick:t,disabled:i,isSubmitting:r,...a})=>/*#__PURE__*/c(Mt,{$isSubmitting:r,onClick:t,disabled:i,...a,children:[/*#__PURE__*/s("span",{children:e}),
|
|
1
|
+
import e,{useRef as t,useState as i,useMemo as r,useContext as a,createContext as n,useEffect as o,useCallback as l}from"react";import{jsx as s,jsxs as c,Fragment as d}from"react/jsx-runtime";import{a as h,af as p,ag as u,u as f,q as w,w as g,x as m,r as v,M as y,s as b,Y as C,X as x,ah as A,Q as I,ai as T,aj as k,N as S,T as E,U as M,ak as N,E as L}from"./useWallets-DTpjk5Rk.mjs";import{W as P,s as W,f as F,w as _,U as R,u as O,C as D,P as z,c as U}from"./prepareFundingModalData-due26ueW.mjs";import{isMobile as B}from"react-device-detect";import{styled as $,css as V,keyframes as j}from"styled-components";import{b as H,P as Z,f as G,j as q,a as X,n as J,u as Y,g as Q}from"./internal-context-mSHyF0Gq.mjs";import K from"@heroicons/react/24/outline/ArrowLeftIcon";import ee from"@heroicons/react/24/outline/ArrowRightIcon";import te from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import ie from"@heroicons/react/24/outline/XMarkIcon";import{isHex as re,getAddress as ae,formatEther as ne,createPublicClient as oe,http as le}from"viem";import{EthereumProvider as se,OPTIONAL_EVENTS as ce,OPTIONAL_METHODS as de}from"@walletconnect/ethereum-provider";import{create as he}from"zustand";import{getAddress as pe,toHex as ue}from"viem/utils";import fe from"@heroicons/react/24/outline/CheckIcon";import we from"@heroicons/react/24/outline/Square2StackIcon";import ge from"qrcode";import me from"@heroicons/react/24/outline/GlobeAltIcon";import{a as ve}from"./getPublicClient-wHgCncHx.mjs";import{shallow as ye}from"zustand/shallow";import{createWithEqualityFn as be}from"zustand/traditional";const Ce=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom||"isPhantom"in e?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,xe=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==Ce(e))return!1;if(e.providers)for(let t of e.providers)if(!xe(t))return!1;return!0},Ae=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers)for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0;return!1},Ie=(e,t)=>{let i=[],r=[];for(let[a,n]of e.entries())a<t?i.push(n):r.push(n);return[i,r]},Te=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),ke=(e,t=3,i=4,r="ethereum")=>{if(!e)return"";let a="ethereum"===r?2:0;return t+i+a+3>=e.length?e:`${e.slice(0,a+t)}...${e.slice(e.length-i,e.length)}`},Se=(e,t=3,i=4)=>ke(e,t,i,"solana"),Ee=e=>new Promise((t=>setTimeout(t,e)));const Me=(e,t={})=>{let i=t.delayMs||150,r=t.maxAttempts||270;return new Promise((async(a,n)=>{let o=!1,l=0;for(;!o&&l<r;){if(t.abortSignal?.aborted)return;e().then((e=>{o=!0,a(e)}),((...e)=>{o=!0,n(...e)})),l+=1,await Ee(i)}o||n(Error("Exceeded max attempts before resolving function"))}))},Ne=(e,t,i={},r={})=>{let a=new URL(t,e);for(let[e,t]of Object.entries(i))void 0!==t&&a.searchParams.set(e,t);let n=Object.entries(r);if(n.length>0){let e=new URLSearchParams;for(let[t,i]of n)e.append(t,i);a.hash=e.toString()}return a.href},Le=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Pe=e=>"string"==typeof e?e:"0x"+e.toString(16);async function We({store:e,walletList:t,externalWalletConfig:i,walletChainType:r,timeout:a=3e3}){let n=!1,o=window;return new Promise((l=>{function s(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",s);let a=e.getProviders();console.debug("Detected injected providers:",a.map((e=>e.info)));let o=[];for(let e of a)t.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||"solana-only"===r&&"app.phantom"===e.info.rdns||o.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});if("solana-only"!==r)for(let e of function(){let e=window,t=e.ethereum;if(!t)return[];let i=[];if(t.providers?.length)for(let e of t.providers)e&&i.push(e);return i.push(e.ethereum),i}()){let t=Ce(e);if(!a.some((e=>e.info.name===t))){if(xe(e,!0)&&!o.find((e=>"metamask"===e.type))){o.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===t&&!o.find((e=>"phantom"===e.type))){o.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===t&&!o.find((e=>"coinbase_wallet"===e.type&&"smartWalletOnly"!==i.coinbaseWallet?.connectionOptions))){o.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}o.find((e=>"unknown_browser_extension"===e.type))||o.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}l(o)}o.ethereum?s():(window.addEventListener("ethereum#initialized",s,{once:!0}),setTimeout((()=>{s()}),a))}))}function Fe(e){return`eip155:${String(Number(e))}`}const _e=(e,t,i,r)=>{let a=Number(e),n=t.find((e=>e.id===a));if(!n)throw new H(`Unsupported chainId ${e}`,4901);return ve(n,i,r)},Re=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},i=e.types.EIP712Domain??Object.entries(e.domain).map((([e,i])=>{if(null!=i&&"string"==typeof e&&e in t)return{name:e,type:t[e]}})).filter((e=>void 0!==e));return{...e,types:{...e.types,EIP712Domain:i}}};const Oe=["c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96","4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0","225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f","1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369","c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a","ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18","bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6","74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d","afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7","f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d","84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04","0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150","38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662","9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0","c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576","8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4","e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4","f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2","138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98","47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83","7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26","8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3","031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa","2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568","dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd","2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01","b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f","0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92","719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3","942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef","8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2","07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80","8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819","bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a","cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e","94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43","2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715","14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc","576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd","49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd","19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b","5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b","d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b","50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b","9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8","6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa","41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071","14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd","a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1","971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709","18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1","15c8b91ade1a4e58f3ce4e7a0dd7f42b47db0c8df7e0d84f63eb39bcb96c4e0f","541d5dcd4ede02f3afaf75bf8e3e4c4f1fb09edb5fa6c4377ebf31c2785d9adf"];function De(e){return{name:e.metadata?.shortName||e.name||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}let ze="WALLETCONNECT_DEEPLINK_CHOICE";function Ue(e){return e.startsWith("http://")||e.startsWith("https://")}function Be(e,t){if(Ue(e))return $e(e,t);let i=e;return i.includes("://")||(i=e.replaceAll("/","").replaceAll(":",""),i=`${i}://`),i.endsWith("/")||(i=`${i}/`),{redirect:`${i}wc?uri=${encodeURIComponent(t)}`,href:i}}function $e(e,t){if(!Ue(e))return Be(e,t);let i=e;return i.endsWith("/")||(i=`${i}/`),{redirect:`${i}wc?uri=${encodeURIComponent(t)}`,href:i}}function Ve(e,t){window.open(e,t,"noreferrer noopener")}class je{execute(e){return null===this.promise&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}constructor(e){this.promise=null,this.fn=e}}const He=({address:e,chainId:t,nonce:i})=>`${window.location.host} wants you to sign in with your Ethereum account:\n${e}\n\nBy signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.\n\nURI: ${window.location.origin}\nVersion: 1\nChain ID: ${t}\nNonce: ${i}\nIssued At: ${(new Date).toISOString()}\nResources:\n- https://privy.io`;class Ze{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,chainId:this.wallet.chainId,address:this.wallet.address,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new Z("SiweFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.authenticateWithSiweInternal({message:e,signature:t,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw G(e)}}async link(){if(!this.client)throw new Z("SiweFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.linkWithSiweInternal({message:e,signature:t,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw G(e)}}async sign(){if(!this.client)throw new Z("SiweFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new Z("Could not prepare SIWE message");let e=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:e}}async _getNonceOnce(){if(!this.client)throw new Z("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new Z("SiweFlow has no client instance");let e=this.wallet.address,t=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=He({address:e,chainId:t,nonce:this.nonce}),this.preparedMessage}constructor(e,t,i,r=!1){this._meta={disableSignup:!1},this.getNonceOnce=new je(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=i,this.client=t,this._meta.disableSignup=r}}class Ge{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new Z("SiwsFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.authenticateWithSiwsInternal({message:e,signature:t,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw G(e)}}async link(){if(!this.client)throw new Z("SiwsFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.linkWithSiwsInternal({message:e,signature:t,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw G(e)}}async sign(){if(!this.client)throw new Z("SiwsFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new Z("Could not prepare SIWS message");if(!this.wallet.signMessage)throw new Z("Wallet does not support signMessage");let e=await this.wallet.signMessage(Buffer.from(this.preparedMessage));return{message:this.preparedMessage,signature:Buffer.from(e).toString("base64")}}async _getNonceOnce(){if(!this.client)throw new Z("SiwsFlow has no client instance");return await this.client.generateSiwsNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new Z("SiwsFlow has no client instance");let e=this.wallet.address;return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=(({address:e,nonce:t})=>`${window.location.host} wants you to sign in with your Solana account:\n${e}\n\nYou are proving you own ${e}.\n\nURI: ${window.location.origin}\nVersion: 1\nChain ID: mainnet\nNonce: ${t}\nIssued At: ${(new Date).toISOString()}\nResources:\n- https://privy.io`)({address:e,nonce:this.nonce}),this.preparedMessage}constructor(e,t,i,r=!1){this._meta={disableSignup:!1},this.getNonceOnce=new je(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=i,this.client=t,this._meta.disableSignup=r}}const qe=/*#__PURE__*/n({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:J,setError:J,setExecuting:J,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:J,reset:J,execute:J});class Xe extends q{constructor(e,t,i){super(e||"Captcha failed"),this.type="Captcha",t instanceof Error&&(this.cause=t),this.privyErrorCode=i}}const Je=({children:e,id:a,captchaSiteKey:n,captchaEnabled:o})=>{let l=t(null),[c,d]=i(),[h,p]=i(),[u,f]=i(!1),w=r((()=>o?u||c||h?!u||c||h?c&&!h?{status:"success",token:c}:h?{status:"error",error:h}:{status:"ready"}:{status:"loading"}:{status:"ready"}:{status:"disabled"}),[o,c,h,u]);/*#__PURE__*/return s(qe.Provider,{value:{...w,ref:l,enabled:o,siteKey:n,appId:a,setToken:d,setError:p,setExecuting:f,remove(){o&&(l.current?.remove(),f(!1),p(void 0),d(void 0))},reset(){o&&(l.current?.reset(),f(!1),p(void 0),d(void 0))},execute(){o&&(f(!0),l.current?.execute())},async waitForResult(){if(!o)return"";try{return await function(e,{interval:t=100,timeout:i=5e3}={}){return new Promise(((r,a)=>{let n,o=0,l=()=>{o>=i?a("Max attempts reached without result"):(n=e(),o+=t,null==n?setTimeout(l,t):r(n))};l()}))}((()=>l.current?.getResponse()),{interval:200,timeout:2e4})}catch(e){throw new Xe("Captcha failed",null,X.CAPTCHA_TIMEOUT)}}},children:e})},Ye=()=>a(qe);function Qe(e){return"ethereum"===e.type}function Ke(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++){let r=e[i],a=t[i];if(r?.address!==a?.address||r&&a&&Qe(r)&&Qe(a)&&r?.chainId!==a?.chainId||r?.connectorType!==a?.connectorType||r?.connectedAt!==a?.connectedAt||r?.walletClientType!==a?.walletClientType||r?.isConnected!==a?.isConnected||r?.linked!==a?.linked)return!1}return!0}const et=(e,t)=>e.rpcTimeouts&&e.rpcTimeouts[t]||h;function tt(e){return"ethereum"===e.chainType}class it extends P{buildConnectedWallet(e,t,i,r){let a=async()=>!!this.wallets.find((t=>pe(t.address)===pe(e)));return{type:"ethereum",address:pe(e),chainId:t,meta:i,imported:r,switchChain:async i=>{let r,n;if(!a)throw new H("Wallet is not currently connected.");let o=this.wallets.find((t=>pe(t.address)===pe(e)))?.chainId;if(!o)throw new H("Unable to determine current chainId.");if("number"==typeof i?(r=`0x${i.toString(16)}`,n=i):(r=i,n=Number(i)),o===Fe(r))return;let l=this.chains.find((e=>e.id===n));if(!l)throw new H(`Unsupported chainId: ${i}`);let s=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]})};try{return await s()}catch(e){if(((e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");case"rabby_wallet":return e.message.includes("Unrecognized chain ID");default:return 4902===e.code||e.message?.includes("4902")}})(e,this.walletClientType))return"rabby_wallet"===this.walletClientType&&await Ee(300),await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:r,chainName:l.name,nativeCurrency:l.nativeCurrency,rpcUrls:[l.rpcUrls.default?.http[0]??""],blockExplorerUrls:[l.blockExplorers?.default.url??""]}]}),s();if("rainbow"===this.walletClientType&&e.message?.includes("wallet_switchEthereumChain"))throw new H(`Rainbow does not support the chainId ${t}`);throw e}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new H("Wallet is not currently connected.");return this.proxyProvider},sign:async e=>{if(!await a())throw new H("Wallet is not currently connected.");return await this.sign(e)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let t,i=e;try{if(void 0===i){let e=await Me((()=>this.proxyProvider.request({method:"eth_accounts"})),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,e),Array.isArray(e)&&(i=e)}}catch(e){console.debug("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",e)}if(!i||!Array.isArray(i)||i.length<=0||!i[0])return;let r=i[0],a=pe(r),n=[];if("privy"===this.walletClientType){let e=W.get(p(a));this.chains.find((t=>t.id===Number(e)))||(W.del(p(a)),e=null),t=e||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]})}catch(e){console.warn(`Unable to switch embedded wallet to chain ID ${t} on initialization`)}}else try{let e=await Me((()=>this.proxyProvider.request({method:"eth_chainId"})),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,e),"string"==typeof e)t=e;else{if("number"!=typeof e)throw Error("Invalid chainId returned from provider");t=`0x${e.toString(16)}`}}catch(e){console.warn(`Failed to get chainId from provider, defaulting to ${u}`,e),t=u}let o=Fe(t);if(!n.find((e=>pe(e.address)===a))){let e={name:this.walletBranding.name,icon:"string"==typeof this.walletBranding.icon?this.walletBranding.icon:void 0,id:this.walletBranding.id};n.push(this.buildConnectedWallet(pe(r),o,e,"embedded_imported"===this.connectorType))}Ke(n,this.wallets)||(this.wallets=n,this.emit("walletsUpdated"))}async getConnectedWallet(){let e=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort(((e,t)=>t.connectedAt-e.connectedAt)).find((t=>e.find((e=>pe(e)===pe(t.address)))))||null}async isConnected(){let e=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0}async sign(e){return await this.connect({showPrompt:!1}),this.proxyProvider.request({method:"personal_sign",params:[ue(e),this.wallets[0]?.address]})}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}constructor(e,t,i,r){super(e),this.chainType="ethereum",this.onAccountsChanged=e=>{0===e.length?this.onDisconnect():this.syncAccounts(e)},this.onChainChanged=e=>{this.wallets.forEach((t=>{t.chainId=Fe(e),"privy"===this.walletClientType&&W.put(p(t.address),e)})),this.emit("walletsUpdated")},this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")},this.onConnect=async()=>{this.connected=!0,"coinbase_wallet"===this.connectorType&&await Ee(300),this.syncAccounts()},this.wallets=[],this.walletClientType=e,this.chains=t,this.defaultChain=i,this.rpcConfig=r,this.rpcTimeoutDuration=et(r,e),this.connected=!1,this.initialized=!1}}class rt{on(e,t){if(this.walletProvider)return this.walletProvider.on(e,t);this._subscriptions.push({eventName:e,listener:t})}async request(e){if(!this.walletProvider)throw new H(`A wallet request of type ${e.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(e),this.walletTimeout()]).catch((e=>{throw F(e)}))}constructor(e,t){this.removeListener=(e,t)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(e,t)}catch(e){console.warn("Unable to remove wallet provider listener")}},this.walletTimeout=(e=new _,t=this.rpcTimeoutDuration)=>new Promise(((i,r)=>setTimeout((()=>{r(e)}),t))),this.setWalletProvider=e=>{this.walletProvider&&this._subscriptions.forEach((e=>{this.removeListener(e.eventName,e.listener)})),this.walletProvider=e,this._subscriptions.forEach((e=>{this.walletProvider?.on(e.eventName,e.listener)}))},this.walletProvider=e,this.rpcTimeoutDuration=t||h,this._subscriptions=[]}}const at=({style:e,...t})=>/*#__PURE__*/s("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:/*#__PURE__*/s("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),nt=he((()=>({listings:[]}))),ot=nt.setState,lt=e=>nt.getState().listings.find((({slug:t})=>dt(t)===dt(e))),st=e=>{let t;try{t=new URL(e).hostname}catch(e){return}return nt.getState().listings.find((({homepage:e})=>{let i;try{i=new URL(e).hostname}catch(e){return!1}return t.includes(i)}))},ct=e=>nt((({listings:t})=>t.find((({slug:t})=>dt(t)===dt(e)))));function dt(e){return"cryptocom"===e?"cryptocom-defi":e.replace(/[-_]wallet$/,"")}const ht=({style:e,...t})=>{let{app:i}=f();/*#__PURE__*/return c("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[/*#__PURE__*/s("rect",{width:"28",height:"28",rx:"3",fill:"dark"===i?.appearance.palette.colorScheme?"#3396ff":"#141414"}),/*#__PURE__*/s("g",{clipPath:"url(#clip0_1765_9946)",children:/*#__PURE__*/s("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),/*#__PURE__*/s("defs",{children:/*#__PURE__*/s("clipPath",{id:"clip0_1765_9946",children:/*#__PURE__*/s("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};class pt extends it{async initialize(){let e=await this.createProvider();this.provider=e,this.proxyProvider.setWalletProvider(e),this.subscribeListeners(),e.session&&(this.walletProvider?.session?.peer.metadata.url&&(this.walletEntry=st(this.walletProvider?.session?.peer.metadata.url),this.walletClientType=this.walletEntry?.slug||"unknown"),this.connected=!0,await this.syncAccounts()),this.initialized=!0,this.emit("initialized");let{WalletConnectModal:t}=await import("@walletconnect/modal");this.modal=new t({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"},explorerRecommendedWalletIds:Oe}),this.modal.subscribeModal((e=>{e.open||this.walletProvider?.session||!this.onQrModalClosed||this.onQrModalClosed()}))}async connect(e){return e.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){let e=this.walletProvider?.session?.peer.metadata.icons?.[0];return{name:Le(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:"string"==typeof e?e:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfoDAIVODUC+w+GAAAGsUlEQVRYw6WXbYwWVxXHf+fOLAtCXYS2QJdIaClipGCTknXXNqBQMVHbfmhItH4Aral+IAEaG03UxJgYKQJGTUxtDWjaxDSNtcZqIGDwpRuW1oYiVqpdpZSlpC3qysu+PHPP3w/3mXnmeXZbPzjJZO7cefn/z/mfe865xlscq3dGDIguGiHLaMQVLja4s87FShcLo5jtApdddnHexUmHIy475JmdUkPRAQMu7gzT4ljnxJpdk0QPmMFkyAKN2OfOFpc2uuh1J3MZDrjAvXmVEQUuoosRxw642FcEG7IoDxiFxNiu8NYE+vcUYIFYRKKs113bXWx2Z34CoQZsVHOiCZ7mopdzdsFhv8NexEgRDHMxUSNREbh1bwNZwBsFblmfu/a4a6AEENYO5i3AOoEWeEUCF4MOOxBDMQAOk99OJALA2u80sBCwWGBZWG/yRwMaCAbBIAsQTJT3gea1OWfNeaPzvjoHEI85rA8ObtB1v7cIdJkIHgkh9AXpocy0LJjIKvB2wPpZB0v3wkrw5jdNEjeYeMhFX3BAyfn2ke9NUrgB9LrrcZcGJFCld4fWNddXbvbWfWzGR6xJFZsBGh0cBh3bBIxIEGTQ3W0h4NuDaSAzyAxCmGq11Vzf5uaa1aG8p+WFtrEYQGwvjICJkAEqvC+YNmcmMlMNvEaCdrcbyUvQAWDTjVuESHObM6cPGWHmzDwLaEtmzG9Z3qF1zUpXmuuZBb1z4bqeNC6f0WE1NtUTwHzEloiy3BvFisy0sYoLlQtT6XW15md2Qf9SY+2Ngfdca/TMSm/9ewz+/Boc/It45h/i4kSTsKw90SQJsPTvjSZbkWemDW7qTRZ0JEYJWSKxZJ7xmf6M224MzMzbX1s8F1YugjtvMg6eErt/4/z1jUrz1rXUKxnZC2zIg2mdBTK1mFUOKC1fOt/48kdzVixIz86Nij+eEacvpJWyZJ5xy7th8VzjjpuMJfMCW58QL73ekXPVlhsyE+vyzFiplJyauEIyrGIquruMq7qTxk+dcB495rzyTzFepCUWLIFv/kBg081Gd55WUk1IDGFTS89K++TDYxddzKnWcbluHd450xgdh7EGrOo1rr868PMTzqWJRGZ2d8oB/xpL33Xnxl2rjeNn4blXRXduzJ4B5y+28kWscAwXl+yeR654FFZPHoUb710YuPeDOUdPO48di1xptKpeEeHqOcYXNwQKGd88EDk3mqxtxPSfGRlsXRtYt8z4ytPOH/7eqpg1Aso7fYKgK4NPrMpYvsC4/poMA34yVJIQC3sCD9yecdsNyaV5yPj6ryJnR1PAvSNP4J+/1cgDfLbfePaMGGtM7Qdyl12WmKOmXgKKAp54vmBRTxfLrjE+tSYjBPjRM5FrrzIeuD2jf2lLzw8vN4JlfPVp581LsO1DgXv7jSzAiXPw/d+JiYLpjsu26Yfjf5O0rF5WoxsNT9G/bX0XKxakmPjlSee6HlizJJXSX7/oRDc+vjKR+f2wODcKd78/gR8/C9uedF44myJxmhh4OY/ipMQyqaWxmjn95TfEroMFOzbkvG+RceeqViPx1Aln1yEnOow1AnffHCpJAJ5/Vex4UvzptZRdY/O/1dJIS/NkcNmR6MTYah6qzseA4TfFtw4UvHBW1bc/O+7sPhwZHYf/jMODh5yfPudVbXj2TAJ/8XxrOZagNamj4Ei2/GNfuyRxh8t6BG2l15up+MIVODEiFr8rcPS0+O6RBF6mrrEGHHtFzOo2Lo7Dl37hvPQ6mNV6R9JYKgnYWcE37K5HlE2OT/5A0udaPUBHH+BQOMzuNsYLuDyZflTW+fTcmJFDHhJhaZqewMuewXDxcDR9IYyPN6Jj+6K4MF2vV8qBtZJScqVRNi6lpGONVJis5mpKi1WbgwsY+zIsBpcR8mzIZfuTRVZrtdu9odrptR/Xx5XONXJqBmCN0P6YMUQq9WJiwt0Je102WHdbpxSqydMObBWYdwDWLVcqcIMYe3NPjg0Ht84od0Ajju1w2XCr9e6QoqM9V23ZtnmI6cfAMMb9AY0YEHdb6oobEh4y3H3Ize6LsmGvN5IdUnhttdQ9UVrfLk/ljWEZ9wXsqAdQk1EA+O22GcgdZTke/bAs3OPY4HSdcB20HhvVtTMu0jmI8ekAhz2IICj2hKpNqI60NcuIRUHEej1quzubXa2tmZhenrfZmv3YYQ9ipDAIgvHptmblccuDjdRcmjFpWbDi/9ycZjZkRbk5jYztai/AUwiUx+qdEQB/m+25i9lxyvbcjrg45Lmd0uT/3p7/Fw6ODf+WO019AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTEyLTAyVDIxOjU2OjQ4KzAwOjAwMVpslgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNC0xMi0wMlQyMTo1Njo0OCswMDowMEAH1CoAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjQtMTItMDJUMjE6NTY6NTMrMDA6MDDZv6GRAAAAAElFTkSuQmCC",id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(e){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletClientType=e,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,function(){try{localStorage.removeItem(ze)}catch{}}(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise(((e,t)=>{this.onQrModalClosed=()=>{t(new R)},(async()=>{let t="",i=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(i?.length&&(t=i[0]),!t||""===t)throw new H("Unable to retrieve address");this.walletProvider?.session?.peer.metadata.url&&(this.walletEntry=st(this.walletProvider?.session?.peer.metadata.url),this.walletClientType=this.walletEntry?.slug||"unknown",this.proxyProvider.rpcTimeoutDuration=et(this.rpcConfig,this.walletClientType)),this.connected=!0,await this.syncAccounts(i),e()})().catch((e=>{t(e?F(e):new H("Unknown error during connection"))})).finally((()=>this.modal?.closeModal()))}))}disconnect(){this.walletProvider?.disconnect().then((()=>this.onDisconnect())).catch((()=>console.warn("Unable to disconnect Wallet Connect provider")))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(e){this.proxyProvider.setWalletProvider(e)}async createProvider(){let e={};for(let t of this.chains){let i=_e(t.id,this.chains,this.rpcConfig,this.privyAppId);i&&(e[t.id]=i)}let t=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],i=this.chains.map((e=>e.id)),r=await se.init({projectId:this.walletConnectCloudProjectId,chains:t,optionalChains:i,optionalEvents:ce,optionalMethods:de,rpcMap:e,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return r.on("display_uri",(e=>{if(r.signer.abortPairingAttempt(),this.walletEntry){let{redirect:t,href:i}=function(e,t){let i=De(t);if(i.deepLink)return Be(i.deepLink,e);if(i.universalLink)return $e(i.universalLink,e);throw new Z(`Unsupported wallet ${t.id}`)}(e,this.walletEntry);(function({href:e,name:t}){try{localStorage.setItem(ze,JSON.stringify({href:e,name:t}))}catch{}})({href:i,name:this.walletEntry.metadata?.shortName||this.walletEntry.name}),this.redirectUri=t;let r=function(e,t){let i=De(t);if(i.universalLink)return $e(i.universalLink,e)}(e,this.walletEntry);r?.redirect&&(this.fallbackUniversalRedirectUri=r.redirect),B?(Ve(t,"_self"),this.showPrivyQrModal?.({native:t,universal:this.fallbackUniversalRedirectUri})):this.showPrivyQrModal?this.showPrivyQrModal?.({native:t,universal:this.fallbackUniversalRedirectUri}):this.modal?.openModal({uri:e,chains:[this.defaultChain.id]})}else this.modal?.openModal({uri:e,chains:[this.defaultChain.id]})})),r.on("connect",(()=>{this.modal?.closeModal(),r.session?.peer.metadata.url&&(this.walletEntry=st(r.session?.peer.metadata.url),this.walletClientType=this.walletEntry?.slug||"unknown")})),r}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await(this.walletProvider?.enable())}setWalletEntry(e,t){this.walletEntry=e,this.showPrivyQrModal=t}constructor(e,t,i,r,a,n,o,l){super(l||"unknown",i,r,t),this.connectorType="wallet_connect_v2",this.privyAppId=n,this.privyAppName=o,this.walletConnectCloudProjectId=e,this.rpcConfig=t,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new rt(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=lt(l),this.walletClientType=l)}}const ut=e=>{let[t,r]=i("auto");return o((()=>{let t=new ResizeObserver((e=>{r(e[0]?.contentRect.height??"auto")}));return e.current&&t.observe(e.current),()=>{e.current&&t.unobserve(e.current)}}),[e.current]),t},ft=({success:e,fail:t})=>/*#__PURE__*/c(d,{children:[/*#__PURE__*/s(wt,{className:e?"success":t?"fail":""}),/*#__PURE__*/s(gt,{className:e?"success":t?"fail":""})]}),wt=/*#__PURE__*/$.span.withConfig({displayName:"Loader",componentId:"sc-ce7792e2-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1.2s linear infinite;transition:border-color 800ms;}@keyframes rotation{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}&&&.success{border-color:var(--privy-color-success);border-bottom-color:var(--privy-color-success);}&&&.fail{border-color:var(--privy-color-error);border-bottom-color:var(--privy-color-error);}"],(e=>e.color??"var(--privy-color-accent)")),gt=/*#__PURE__*/$(wt).withConfig({displayName:"LoaderFaint",componentId:"sc-ce7792e2-1"})(["&&{border-bottom-color:",";animation:none;opacity:0.5;}"],(e=>e.color??"var(--privy-color-accent)")),mt=e=>/*#__PURE__*/s(vt,{color:e.color||"var(--privy-color-foreground-3)"});let vt=/*#__PURE__*/$(wt).withConfig({displayName:"StyledButtonLoader",componentId:"sc-ce7792e2-2"})(["&&{height:1rem;width:1rem;margin:2px 0;border-width:1.5px;transition:border-color 200ms ease;}"]);const yt=/*#__PURE__*/$.button.withConfig({displayName:"Button",componentId:"sc-3253171f-0"})(["display:flex;flex-direction:row;align-items:center;justify-content:center;user-select:none;&{width:100%;cursor:pointer;border-radius:var(--privy-border-radius-md);font-size:1rem;font-style:normal;font-weight:500;line-height:22px;letter-spacing:-0.016px;}&&{padding:12px 16px;}"]),bt=({children:e,loading:t,disabled:i,success:r,loadingText:a="Loading...",...n})=>/*#__PURE__*/s(It,{disabled:t||i,success:r,...n,children:t?/*#__PURE__*/c("span",{children:[/*#__PURE__*/s(mt,{}),a?/*#__PURE__*/s("span",{children:a}):null]}):e}),Ct=({children:e,loading:t,disabled:i,...r})=>/*#__PURE__*/s(xt,{disabled:i,...r,children:t?/*#__PURE__*/s(mt,{color:"var(--privy-color-foreground-accent)"}):e});let xt=/*#__PURE__*/$(yt).withConfig({displayName:"StyledPrimaryButtonWithoutGray",componentId:"sc-3253171f-1"})(["position:relative;&&{background-color:var(--privy-color-accent);color:var(--privy-color-foreground-accent);transition:background-color 200ms ease;}&:hover{background-color:var(--privy-color-accent-dark);}&:active{background-color:var(--privy-color-accent-dark);}&:disabled,&:hover:disabled,&:active:disabled{cursor:not-allowed;pointer-events:none;color:var(--privy-color-foreground-accent);background-color:var(--privy-color-accent-dark);}"]);const At=({children:e,loading:t,disabled:i,loadingText:r="Loading...",...a})=>/*#__PURE__*/s(It,{as:"a",disabled:t||i,...a,children:t?/*#__PURE__*/c("span",{children:[/*#__PURE__*/s(mt,{}),r?/*#__PURE__*/s("span",{children:r}):null]}):e});let It=/*#__PURE__*/$(yt).withConfig({displayName:"StyledPrimaryButton",componentId:"sc-3253171f-2"})(["position:relative;&&{background-color:",";color:var(--privy-color-foreground-accent);transition:background-color 200ms ease;}&:hover{background-color:",";}&:active{background-color:",";}&:hover:disabled,&:active:disabled{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;}"," > span{display:flex;align-items:center;gap:8px;opacity:1;animation:fadein 200ms ease;}"],(e=>e.warn?"var(--privy-color-error)":e.success?"var(--privy-color-success)":"var(--privy-color-accent)"),(e=>e.warn?"var(--privy-color-error)":e.success?"var(--privy-color-success)":"var(--privy-color-accent-dark)"),(e=>e.warn?"var(--privy-color-error)":e.success?"var(--privy-color-success)":"var(--privy-color-accent-dark)"),(e=>e.disabled?/*#__PURE__*/V(["&&&,&&&:hover,&&&:active{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;pointer-events:none;}"]):""));const Tt=({children:e,loading:t,disabled:i,loadingText:r="Loading...",...a})=>/*#__PURE__*/s(kt,{disabled:t||i,...a,children:t?/*#__PURE__*/c("span",{children:[/*#__PURE__*/s(mt,{}),r?/*#__PURE__*/s("span",{children:r}):null]}):e});let kt=/*#__PURE__*/$(yt).withConfig({displayName:"StyledSecondaryButton",componentId:"sc-3253171f-3"})(["&&{border-width:1px;border-color:",";color:var(--privy-color-foreground);transition:border-color 200ms ease;}&:hover,&:active{border-color:",";}&:hover:disabled,&:active:disabled{border-color:var(--privy-color-foreground-accent);color:var(--privy-color-foreground-3);cursor:not-allowed;}> span{display:flex;align-items:center;gap:8px;opacity:1;animation:fadein 200ms ease;}"],(e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"),(e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-3)"));const St=/*#__PURE__*/$.button.withConfig({displayName:"SoftCtaButton",componentId:"sc-3253171f-4"})(["&&{padding:12px 16px;font-weight:500;text-align:center;color:var(--privy-color-foreground-accent);background-color:var(--privy-color-accent);border-radius:var(--privy-border-radius-sm);min-width:144px;opacity:",";transition:opacity 200ms ease,background-color 200ms ease,color 200ms ease;user-select:none;"," &:hover{background-color:var(--privy-color-accent-dark);}&:active{background-color:var(--privy-color-accent-dark);}&:hover:disabled,&:active:disabled{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;}}"],(e=>e.invisible?"0":"1"),(e=>e.invisible&&/*#__PURE__*/V(["pointer-events:none;"]))),Et=({children:e,onClick:t,disabled:i,isSubmitting:r,...a})=>/*#__PURE__*/c(Mt,{$isSubmitting:r,onClick:t,disabled:i,...a,children:[/*#__PURE__*/s("span",{children:e}),
|
|
2
2
|
/*#__PURE__*/s("span",{children:/*#__PURE__*/s(mt,{})})]});let Mt=/*#__PURE__*/$.button.withConfig({displayName:"StyledEmbeddedButton",componentId:"sc-3253171f-6"})(["&&{color:var(--privy-color-accent);font-size:16px;font-style:normal;font-weight:500;line-height:24px;cursor:pointer;border-radius:0px var(--privy-border-radius-mdlg) var(--privy-border-radius-mdlg) 0px;border:none;transition:color 200ms ease;@media (min-width:441px){font-size:14px;}:hover{color:var(--privy-color-accent-dark);}&& > :first-child{opacity:",";}&& > :last-child{position:absolute;display:flex;top:50%;left:50%;transform:translate3d(-50%,-50%,0);opacity:",";}:disabled,:hover:disabled{color:var(--privy-color-foreground-3);cursor:not-allowed;}}"],(e=>e.$isSubmitting?0:1),(e=>e.$isSubmitting?1:0));const Nt=({backFn:e})=>/*#__PURE__*/s("div",{children:/*#__PURE__*/s(_t,{onClick:e,children:/*#__PURE__*/s(K,{height:"16px",width:"16px",strokeWidth:2})})}),Lt=({nextFn:e})=>/*#__PURE__*/s("div",{children:/*#__PURE__*/s(_t,{onClick:e,children:/*#__PURE__*/s(ee,{height:"16px",width:"16px",strokeWidth:2})})}),Pt=({infoFn:e})=>/*#__PURE__*/s("div",{children:/*#__PURE__*/s(Rt,{"aria-label":"info",onClick:e,children:/*#__PURE__*/s(te,{height:"22px",width:"22px",strokeWidth:2})})}),Wt=e=>/*#__PURE__*/s("div",{children:/*#__PURE__*/s(_t,{"aria-label":"close modal",onClick:e.onClose,children:/*#__PURE__*/s(ie,{height:"16px",width:"16px",strokeWidth:2})})}),Ft=({backFn:e,infoFn:t,onClose:i,title:r,closeable:a=!0})=>{let{closePrivyModal:n}=Y(),o=w();/*#__PURE__*/return c(Ot,{children:[/*#__PURE__*/c(Dt,{children:[e&&/*#__PURE__*/s(Nt,{backFn:e}),t&&/*#__PURE__*/s(Pt,{infoFn:t})]}),r&&/*#__PURE__*/s(Ut,{id:"privy-dialog-title",children:r}),/*#__PURE__*/s(zt,{children:!o.render.standalone&&a&&/*#__PURE__*/s(Wt,{onClose:i||(()=>n())})})]})};let _t=/*#__PURE__*/$.button.withConfig({displayName:"StyledButton",componentId:"sc-f295093d-0"})(["&&{cursor:pointer;display:flex;opacity:0.6;background-color:var(--privy-color-background-2);border-radius:var(--privy-border-radius-full);padding:4px;> svg{margin:auto;color:var(--privy-color-foreground);}:hover{opacity:1;}}"]),Rt=/*#__PURE__*/$(_t).withConfig({displayName:"TransparentStyledButton",componentId:"sc-f295093d-1"})(["&&{background-color:transparent;}"]),Ot=/*#__PURE__*/$.div.withConfig({displayName:"StyledHeader",componentId:"sc-f295093d-2"})(["padding:16px 0;display:flex;align-items:center;justify-content:space-between;h2{font-size:16px;line-height:24px;font-weight:600;color:var(--privy-color-foreground);}"]),Dt=/*#__PURE__*/$.div.withConfig({displayName:"LeftActionContainer",componentId:"sc-f295093d-3"})(["flex:1;align-items:center;display:flex;gap:8px;"]),zt=/*#__PURE__*/$.div.withConfig({displayName:"RightActionContainer",componentId:"sc-f295093d-4"})(["flex:1;display:flex;justify-content:flex-end;"]),Ut=/*#__PURE__*/$.div.withConfig({displayName:"TitleContainer",componentId:"sc-f295093d-5"})(["overflow:hidden;white-space:nowrap;max-width:100%;text-overflow:ellipsis;text-align:center;color:var(--privy-color-foreground-2);"]);function Bt(e){/*#__PURE__*/return s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 460 40",...e,children:/*#__PURE__*/s("g",{fill:e.color||"var(--privy-color-foreground)",children:/*#__PURE__*/s("path",{d:"M0 15.4v15.38h4.64V19.96h3.58c2.47 0 3.63-.01 3.77-.02 1-.08 1.49-.15 2.18-.3a9.45 9.45 0 0 0 4.6-2.37c1.66-1.57 2.64-3.87 2.81-6.56.02-.3.02-1.19 0-1.49-.1-1.77-.56-3.35-1.36-4.72A8.84 8.84 0 0 0 15.14.57c-.93-.3-1.75-.43-3.09-.54C11.9.02 10.2 0 5.93 0H0ZM10.85 4c1.85.05 3.1.45 4.16 1.3.22.17.54.49.69.68a5.97 5.97 0 0 1 1.19 3.13c.04.35.04 1.36 0 1.71-.08.68-.23 1.3-.44 1.85a4.8 4.8 0 0 1-1.09 1.68A5.63 5.63 0 0 1 12 15.92c-.6.08-.4.08-4.01.09H4.64V3.98h2.9c1.6 0 3.08 0 3.31.02ZM187.65 5.71v5.72h-.27l-.09-.14a15.9 15.9 0 0 0-1.21-1.73c-.43-.5-1-.95-1.7-1.36-.54-.3-1.05-.5-1.73-.63a8.98 8.98 0 0 0-1.7-.17 8.84 8.84 0 0 0-7.8 4.03 12.95 12.95 0 0 0-2.03 6.39c-.07.98-.06 2.15.02 3.13.2 2.47.87 4.53 2.02 6.25a8.98 8.98 0 0 0 10.22 3.65 6.5 6.5 0 0 0 2.8-1.93c.41-.51.84-1.1 1.1-1.55l.1-.17h.37v3.58h4.38V0h-4.48Zm-5.24 5.54c1.3.14 2.3.6 3.17 1.48.9.9 1.5 2.09 1.85 3.64.36 1.6.39 3.72.06 5.43a8.13 8.13 0 0 1-1.54 3.62 5.1 5.1 0 0 1-3.93 1.96 6.13 6.13 0 0 1-2.32-.31 5.87 5.87 0 0 1-3.33-3.5c-.39-1-.62-2.05-.72-3.32-.03-.32-.04-1.35-.02-1.73.08-1.56.4-2.91.96-4.05a6.2 6.2 0 0 1 1.06-1.58 5.08 5.08 0 0 1 3.6-1.66c.25-.02.9 0 1.16.02ZM210.07 15.39l.01 15.38h4.38l.01-3.57h.37l.09.15c.24.44.84 1.26 1.21 1.7a6.79 6.79 0 0 0 2.57 1.75 9.3 9.3 0 0 0 6.86-.49 9.28 9.28 0 0 0 4.05-4.07A13.05 13.05 0 0 0 231 21.6c.21-1.73.18-3.7-.09-5.32a13.03 13.03 0 0 0-1.5-4.3 9.1 9.1 0 0 0-3.75-3.63 9.15 9.15 0 0 0-4.43-.96 7.46 7.46 0 0 0-2.8.5A7.07 7.07 0 0 0 216 9.7c-.4.52-.82 1.12-1.1 1.59l-.07.14h-.27V0h-4.5Zm11.13-4.14c1.07.1 1.94.44 2.7 1.04a6.1 6.1 0 0 1 1.64 1.98c.43.84.78 2 .94 3.11.15 1.16.16 2.4.02 3.54a9.34 9.34 0 0 1-1.39 4.03 5.33 5.33 0 0 1-2.69 2.15c-.9.3-2.04.38-3.06.2a5.14 5.14 0 0 1-3.45-2.37 6.03 6.03 0 0 1-.45-.8c-.5-1.03-.8-2.2-.92-3.58-.04-.49-.06-.89-.05-1.53.01-.76.05-1.23.13-1.85.38-2.53 1.47-4.38 3.15-5.31a5.46 5.46 0 0 1 2.3-.63 10 10 0 0 1 1.13.02ZM69.05 2.17l-.01 2.77V7.7h-3.36v3.6h3.36v6.8l.01 7.15c.06 1.4.4 2.44 1.1 3.37a5.8 5.8 0 0 0 2.97 2.07c.91.3 1.83.42 2.9.38a8.71 8.71 0 0 0 2.66-.48l-.8-3.7-.38.06a4.96 4.96 0 0 1-2.43-.06c-.33-.1-.56-.25-.8-.49-.4-.41-.6-.88-.7-1.67-.02-.2-.02-.62-.03-6.82v-6.6h4.73V7.7h-4.73V2.16h-4.49ZM133.34 2.17V7.7h-3.39v3.6h3.38v6.9l.01 7.17a5.66 5.66 0 0 0 2.36 4.49c.85.6 2.03 1.03 3.26 1.17.85.1 2.03.05 2.81-.1.3-.06.75-.18 1-.26l.2-.06v-.05l-.81-3.67-.37.06a4.99 4.99 0 0 1-1.8.09c-.85-.13-1.32-.4-1.7-.97a2.63 2.63 0 0 1-.39-1.04c-.06-.4-.06 0-.06-7.1V11.3h4.7V7.7h-4.7l-.01-2.77V2.16h-4.49ZM293.41 2.36a14.56 14.56 0 0 0-13.7 16.07 14.59 14.59 0 0 0 21.86 11.08 14.5 14.5 0 0 0 7.11-14.07 14.61 14.61 0 0 0-6.53-10.73 14.49 14.49 0 0 0-8.74-2.35ZM350.8 2.36a10.17 10.17 0 0 0-7.56 4.2c-.16.2-.45.63-.58.83l-.05.1h-.47l-.01-4.36h-7.36v36.4h7.82V27.27h.49l.05.07a11.3 11.3 0 0 0 7.49 4.15 10.52 10.52 0 0 0 9.38-4.1c1.66-2.1 2.73-4.9 3.07-8.06.1-.87.13-1.4.13-2.37 0-.8 0-1.1-.07-1.76a15.95 15.95 0 0 0-3.23-8.72 12.8 12.8 0 0 0-1.85-1.84 10.49 10.49 0 0 0-7.26-2.28Zm-.94 6.05c1.27.15 2.33.65 3.2 1.5.98.96 1.67 2.31 2.03 4 .34 1.57.38 3.68.12 5.39a9.78 9.78 0 0 1-1.04 3.25c-.14.25-.44.69-.6.89a5.35 5.35 0 0 1-4.31 2.07 5.25 5.25 0 0 1-4.41-1.9 7.35 7.35 0 0 1-1.26-2.32 14.09 14.09 0 0 1-.62-4.83c.05-1.98.38-3.53 1.02-4.85a5.63 5.63 0 0 1 2.5-2.65c.66-.34 1.3-.5 2.14-.58.18-.02 1.04 0 1.23.03ZM363.63 3.1l-.01 3.2v3.16h1.43c1.26.01 1.44.02 1.54.04.42.09.66.28.79.62.08.23.08.08.08 2.96a911.57 911.57 0 0 1 .03 10.18v7.54h7.82v-7.4l.01-7.83c.03-.94.11-1.63.27-2.28.46-1.9 1.54-2.93 3.35-3.23.52-.08.2-.08 5-.08h4.4V3.08h-3.1c-3.48 0-3.91.01-4.67.1-1.83.2-3.04.79-3.96 1.88-.5.6-.9 1.32-1.26 2.26l-.06.17h-.46V3.09h-5.6c-4.46 0-5.6 0-5.6.02ZM390.8 16.95V30.8h3.87l3.86-.01V3.09h-7.73ZM400.6 3.1l-.01.4v.38l4.66 13.4 4.69 13.47.02.05h10.3l.03-.05 4.67-13.45 4.67-13.4V3.1h-7.43l-6.7 19.26h-.5l-3.28-9.5-3.31-9.64-.05-.12h-3.88l-3.88.01ZM430.98 3.1c-.01 0-.02.19-.02.4v.39l5.08 14.59c2.8 8.02 5.08 14.6 5.08 14.61.01.02-.22.02-4.8.02h-4.82v6.42h4.95c5.09 0 5.23 0 5.87-.06 3.15-.28 5.29-1.63 6.63-4.15.28-.55.44-.95.87-2.16L459 6.78l1-2.89v-.8h-7.43l-6.69 19.26h-.5l-3.27-9.46-3.31-9.64-.06-.16h-3.88l-3.88.01ZM36.57 7.36c-1.36.1-2.6.6-3.62 1.45a5.65 5.65 0 0 0-1.67 2.42l-.05.13H31V7.7h-4.35v23.08h4.5v-7.3c0-8 0-7.34.08-7.82a4.89 4.89 0 0 1 2.06-3.18c.83-.58 1.74-.89 2.87-.98a11.87 11.87 0 0 1 2.8.25H39v-4.3l-.21-.02c-.61-.07-1.74-.1-2.22-.07ZM51.08 7.41c-2.33.12-4.3.84-5.95 2.16a9.89 9.89 0 0 0-2.03 2.2 12.5 12.5 0 0 0-2 5.78 18.04 18.04 0 0 0 0 3.65 12.13 12.13 0 0 0 2.26 6.05 9.74 9.74 0 0 0 5 3.52c2.11.64 4.7.64 6.8 0a9.78 9.78 0 0 0 4.88-3.37c1.38-1.78 2.19-4 2.4-6.58.13-1.46.06-3.06-.18-4.42a11.24 11.24 0 0 0-3.58-6.6 10 10 0 0 0-5.75-2.35c-.56-.06-1.31-.07-1.85-.04Zm1.42 3.78c.88.1 1.62.34 2.28.75a6.13 6.13 0 0 1 1.99 2.15 10.31 10.31 0 0 1 1.2 5c.02 1.23-.12 2.44-.42 3.51a7.14 7.14 0 0 1-1.81 3.32c-.61.6-1.2.98-1.95 1.24a6 6 0 0 1-2 .3 5.7 5.7 0 0 1-2.72-.6 5 5 0 0 1-1.28-.94A7.1 7.1 0 0 1 46 22.73c-.57-1.99-.6-4.46-.08-6.5a7.24 7.24 0 0 1 2.03-3.67 5.13 5.13 0 0 1 3.35-1.4 11 11 0 0 1 1.2.03ZM92.05 7.4c-.96.06-1.56.15-2.3.33a9.62 9.62 0 0 0-6.09 4.66 13.5 13.5 0 0 0-1.71 7c0 .83 0 1.04.06 1.6.16 1.77.58 3.32 1.29 4.7A9.72 9.72 0 0 0 90.28 31c1.84.37 4.08.32 5.85-.13a9.07 9.07 0 0 0 5.02-3.1A7.64 7.64 0 0 0 102.5 25l-2.11-.39-2.11-.38-.08.13a4.72 4.72 0 0 1-2.35 2.55 6.3 6.3 0 0 1-2.23.58c-.29.03-1.13.03-1.44 0a6.35 6.35 0 0 1-3.02-1.04 5.93 5.93 0 0 1-2.02-2.43 8.44 8.44 0 0 1-.72-3.18v-.26h16.38v-.81c0-1.83-.06-2.76-.25-3.87-.2-1.22-.53-2.24-1.05-3.28a8.9 8.9 0 0 0-2.66-3.26 10.1 10.1 0 0 0-5.34-1.94 18.3 18.3 0 0 0-1.46-.03Zm1.3 3.75c1.2.13 2.19.55 3.05 1.3a5.8 5.8 0 0 1 1.78 2.96c.13.51.21 1.17.21 1.66v.15H86.43v-.12c.08-.97.3-1.78.72-2.61.5-1 1.2-1.8 2.14-2.42a5.32 5.32 0 0 1 2.9-.95c.2-.01.97 0 1.17.03ZM116.79 7.41c-2 .1-3.73.65-5.22 1.65a10.7 10.7 0 0 0-4.25 6.06 16.1 16.1 0 0 0-.5 5.8c.2 2.17.84 4.13 1.88 5.76.58.9 1.32 1.73 2.15 2.4a9.37 9.37 0 0 0 3.6 1.8 12.06 12.06 0 0 0 3.92.34 10.2 10.2 0 0 0 3.84-.95 8.31 8.31 0 0 0 4.76-6.75l.01-.04h-4.37l-.05.16a4.87 4.87 0 0 1-4.24 3.75c-.59.07-1.32.06-1.93-.05a5.47 5.47 0 0 1-3.5-2.27c-.56-.75-1-1.73-1.26-2.79a13.8 13.8 0 0 1-.16-5.24 7.77 7.77 0 0 1 2.1-4.3 5.48 5.48 0 0 1 2.15-1.3 6.4 6.4 0 0 1 3.89.1c.59.21 1.03.5 1.5.96a5.32 5.32 0 0 1 1.46 2.5l.04.15h4.37v-.06a8.22 8.22 0 0 0-5.31-6.94 10.98 10.98 0 0 0-4.88-.74ZM156.2 7.41a9.87 9.87 0 0 0-6 2.29 11.02 11.02 0 0 0-3.41 5.43c-.52 1.78-.68 3.9-.48 5.97.17 1.8.63 3.38 1.37 4.8a9.68 9.68 0 0 0 5.91 4.86c1.65.48 3.63.61 5.53.36 3.72-.49 6.55-2.62 7.56-5.69.12-.39.13-.42.1-.43-.02 0-4.13-.75-4.19-.75-.03 0-.04 0-.1.16-.18.42-.45.9-.72 1.22-.16.2-.49.53-.7.7-.67.54-1.5.9-2.43 1.08-.48.08-.83.11-1.41.11-.64 0-1.07-.04-1.6-.15a5.76 5.76 0 0 1-3.93-2.83 8 8 0 0 1-.99-3.79v-.16h16.38v-1.11l-.02-1.43c-.1-2.25-.53-4-1.35-5.59a9.24 9.24 0 0 0-6.18-4.75c-1.04-.26-2.2-.36-3.33-.3Zm1.45 3.74a5.35 5.35 0 0 1 3.66 1.94 6.1 6.1 0 0 1 1.38 4.01v.12h-11.97v-.06c0-.02 0-.14.02-.25a6.6 6.6 0 0 1 2.15-4.32 5.73 5.73 0 0 1 3.5-1.46c.25-.02 1 0 1.26.02ZM233.58 7.82l8.37 23.22a49.22 49.22 0 0 1-.67 1.9 5.36 5.36 0 0 1-1.14 1.8c-.41.4-.82.58-1.48.69-.27.04-1.03.03-1.35 0a8.05 8.05 0 0 1-1.1-.23l-1.08 3.67c0 .02.32.14.66.22.83.21 1.57.29 2.56.28.56-.01.8-.03 1.24-.1 2.71-.4 4.66-2.09 5.86-5.08l9.64-26.44c0-.02-4.82-.06-4.83-.05l-2.93 8.96-2.91 8.94h-.24l-.22-.65-2.91-8.95-2.7-8.3H233.53ZM293.05 35.8c-1.18.04-1.93.09-2.8.16-2.52.24-4.53.69-5.43 1.23-.7.41-.76.86-.2 1.28.88.66 3.29 1.19 6.36 1.4a48.55 48.55 0 0 0 5.75.05c3.47-.19 6.24-.78 7.11-1.5.22-.19.3-.34.3-.53 0-.1 0-.12-.04-.22-.35-.69-2.32-1.3-5.25-1.63a41.09 41.09 0 0 0-5.8-.24Zm0 0"})})})}let $t=/*#__PURE__*/$.div.withConfig({displayName:"TermsAndConditionsContainer",componentId:"sc-bdb69ecc-0"})(["margin-top:16px;font-size:13px;text-align:center;color:var(--privy-color-foreground-3);&& > a{color:var(--privy-color-accent);}"]);function Vt({app:{legal:{privacyPolicyUrl:e,termsAndConditionsUrl:t,requireUsersAcceptTerms:i}},alwaysShowImplicitConsent:r}){let a=!(!e||!t);return i&&!r||!t&&!e?
|
|
3
3
|
/*#__PURE__*/s($t,{}):
|
|
4
|
-
/*#__PURE__*/ /*#__PURE__*/c($t,{children:["By logging in I agree to the"," ",t&&/*#__PURE__*/s("a",{href:t,target:"_blank",children:a?"Terms":"Terms of Service"}),a&&" & ",e&&/*#__PURE__*/s("a",{href:e,target:"_blank",children:"Privacy Policy"})]})}const jt=()=>{let{appearance:e}=w();/*#__PURE__*/return s(Ht,{children:e.footerLogo??/*#__PURE__*/s("a",{href:"https://www.privy.io/",target:"_blank",id:"protected-by-privy",children:/*#__PURE__*/s(Bt,{height:13,width:150})})})},Ht=/*#__PURE__*/$.div.withConfig({displayName:"ModalFooter",componentId:"sc-bdb69ecc-1"})(["display:flex;align-items:center;justify-content:center;padding-top:8px;padding-bottom:12px;gap:8px;font-size:13px;&& a{padding:0.5rem 0;&:hover{text-decoration:none;}}@media all and (display-mode:standalone){padding-bottom:30px;}"]),Zt=({address:e,showCopyIcon:t,url:r,className:a})=>{let[n,l]=i(!1);return o((()=>{if(n){let e=setTimeout((()=>l(!1)),2e3);return()=>clearTimeout(e)}}),[n]),r?/*#__PURE__*/s("a",{title:e,className:a,href:`${r}/address/${e}`,target:"_blank",children:Te(e)}):/*#__PURE__*/c("button",{title:e,className:a,onClick:t=>(t.stopPropagation(),navigator.clipboard.writeText(e).then((()=>l(!0))).catch(console.error)),children:[Te(e),t&&/*#__PURE__*/s(n?qt:Gt,{})]})};let Gt=/*#__PURE__*/$(we).withConfig({displayName:"StyledSquare2StackIcon",componentId:"sc-6eaa0c94-0"})(["&&{display:inline;}stroke-width:2;height:0.875rem;width:0.875rem;margin-left:0.125rem;color:var(--privy-color-foreground-3);"]),qt=/*#__PURE__*/$(fe).withConfig({displayName:"StyledCheckIcon",componentId:"sc-6eaa0c94-1"})(["&&{display:inline;}stroke-width:2;height:0.875rem;width:0.875rem;margin-left:0.125rem;color:var(--privy-color-success);"]);const Xt=(e,t)=>!g(e)&&("all-users"===t||"users-without-wallets"===t&&!Jt(e).length);let Jt=e=>e.linkedAccounts.filter((e=>"wallet"===e.type&&"ethereum"===e.chainType));const Yt=(e,t)=>!m(e)&&("all-users"===t||"users-without-wallets"===t&&!Qt(e).length);let Qt=e=>e.linkedAccounts.filter((e=>"wallet"===e.type&&"solana"===e.chainType));const Kt=(e,t)=>Xt(e,t.ethereum.createOnLogin)||Yt(e,t.solana.createOnLogin),ei=/*#__PURE__*/$.div.withConfig({displayName:"BottomPusherContainer",componentId:"sc-cb963810-0"})(["display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-end;margin-top:auto;gap:16px;flex-grow:100;"]),ti=/*#__PURE__*/$.div.withConfig({displayName:"CenteredItem",componentId:"sc-cb963810-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;flex-grow:1;width:100%;"]),ii=/*#__PURE__*/$.div.withConfig({displayName:"HorizontallyCenteredItem",componentId:"sc-cb963810-2"})(["display:flex;flex-direction:column;align-items:center;width:100%;"]),ri=/*#__PURE__*/$(ti).withConfig({displayName:"CenteredItemWithPadding",componentId:"sc-cb963810-3"})(["padding:20px 0;"]),ai=/*#__PURE__*/$(ti).withConfig({displayName:"CenteredItemWithGap",componentId:"sc-cb963810-4"})(["gap:16px;"]),ni=/*#__PURE__*/$.div.withConfig({displayName:"FlexContainer",componentId:"sc-cb963810-5"})(["display:flex;flex-direction:column;width:100%;"]),oi=/*#__PURE__*/$.div.withConfig({displayName:"FixedGappedContainer",componentId:"sc-cb963810-6"})(["display:flex;flex-direction:column;gap:8px;"]),li=/*#__PURE__*/$.div.withConfig({displayName:"StyledCalloutSection",componentId:"sc-cb963810-8"})(["display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;text-align:left;gap:8px;padding:16px;margin-top:16px;margin-bottom:16px;width:100%;background:var(--privy-color-background-2);border-radius:var(--privy-border-radius-md);&& h4{color:var(--privy-color-foreground-3);font-size:14px;text-decoration:underline;font-weight:medium;}&& p{color:var(--privy-color-foreground-3);font-size:14px;}"]),si=/*#__PURE__*/$.div.withConfig({displayName:"RefactorSpacerTop",componentId:"sc-cb963810-9"})(["height:16px;"]),ci=/*#__PURE__*/$.div.withConfig({displayName:"RefactorSpacerBottom",componentId:"sc-cb963810-10"})(["height:12px;"]),di=/*#__PURE__*/$.div.withConfig({displayName:"RelativeContainer",componentId:"sc-cb963810-11"})(["position:relative;"]),hi=/*#__PURE__*/$.div.withConfig({displayName:"ConfigurableSpacer",componentId:"sc-cb963810-12"})(["height:","px;"],(e=>e.height??"12")),pi=/*#__PURE__*/$.div.withConfig({displayName:"Circle",componentId:"sc-cb963810-13"})(["background-color:var(--privy-color-accent);display:flex;justify-content:center;align-items:center;border-radius:50%;border-color:white;border-width:2px !important;"]);let ui=/*#__PURE__*/j(["from,to{background:var(--privy-color-foreground-4);color:var(--privy-color-foreground-4);}50%{background:var(--privy-color-foreground-accent);color:var(--privy-color-foreground-accent);}"]);const fi=/*#__PURE__*/V(["",""],(e=>e.$isLoading?/*#__PURE__*/V(["width:35%;animation:"," 2s linear infinite;border-radius:var(--privy-border-radius-sm);"],ui):"")),wi=({children:e,color:t,isLoading:i,isPulsing:r,...a})=>/*#__PURE__*/s(gi,{$color:t,$isLoading:i,$isPulsing:r,...a,children:e});let gi=/*#__PURE__*/$.span.withConfig({displayName:"StyledSpan",componentId:"sc-eba15c9-0"})(["padding:0.125rem 0.5rem;font-size:0.75rem;font-weight:500;line-height:1.125rem;border-radius:var(--privy-border-radius-sm);display:flex;align-items:center;"," ",""],(e=>{let t,i;"green"===e.$color&&(t="var(--privy-color-success-dark)",i="var(--privy-color-success-light)"),"red"===e.$color&&(t="var(--privy-color-error)",i="var(--privy-color-error-light)"),"gray"===e.$color&&(t="var(--privy-color-foreground-2)",i="var(--privy-color-background-2)");let r=/*#__PURE__*/j(["from,to{background-color:",";}50%{background-color:rgba(",",0.8);}"],i,i);/*#__PURE__*/return V(["color:",";background-color:",";",";"],t,i,e.$isPulsing&&/*#__PURE__*/V(["animation:"," 3s linear infinite;"],r))}),fi),mi=/*#__PURE__*/n({});const vi=({children:e})=>{let t=w(),[r,a]=i({});return O("login",{onComplete:({loginAccount:e})=>{e&&"passkey"!==e.type&&"cross_app"!==e.type&&("wallet"!==e.type||"privy"!==e.walletClientType)&&(W.put(yi(t.id),e.type),"wallet"===e.type?(W.put(bi(t.id),e.walletClientType),W.put(Ci(t.id),e.chainType),a({accountType:e.type,walletClientType:e.walletClientType,chainType:e.chainType})):(W.del(bi(t.id)),W.del(Ci(t.id)),a({accountType:e.type})))}}),o((()=>{if(!t.id)return;let e=W.get(yi(t.id)),i=W.get(bi(t.id)),r=W.get(Ci(t.id));e&&a("wallet"===e?{accountType:e,walletClientType:i,chainType:r}:{accountType:e})}),[t.id]),/*#__PURE__*/s(mi.Provider,{value:r,children:e})};let yi=e=>`privy:${e}:recent-login-method`,bi=e=>`privy:${e}:recent-login-wallet-client`,Ci=e=>`privy:${e}:recent-login-chain-type`;const xi=()=>a(mi),Ai=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter((e=>re(e,{strict:!0}))).map((e=>ae(e)));return!!t?.length&&!!e?.linkedAccounts.filter((e=>"wallet"==e.type&&t.includes(e.address))).length};const ki=e=>e?.privyErrorCode===X.LINKED_TO_ANOTHER_USER?D.ERROR_USER_EXISTS:e instanceof z&&!e.details.default?e.details:e instanceof _?D.ERROR_TIMED_OUT:e instanceof R?D.ERROR_USER_REJECTED_CONNECTION:e?.privyErrorCode===X.CANNOT_LINK_MORE_OF_TYPE?D.ERROR_USER_LIMIT_REACHED:D.ERROR_WALLET_CONNECTION,Ii=()=>{let e,[r,a]=i(!1),[n,h]=i(!1),[p,u]=i(void 0),{authenticated:w,logout:g}=v(),{app:m,navigate:C,navigateBack:x,lastScreen:A,currentScreen:k,setModalData:I,data:T}=f(),{getAuthFlow:S,walletConnectionStatus:E,closePrivyModal:M,initLoginWithWallet:N,loginWithWallet:L,updateWallets:P,createAnalyticsEvent:W}=Y(),{walletConnectors:F}=v(),[_,R]=i(0),{user:O}=v(),[z]=i(O?.linkedAccounts.length||0),[U,$]=i(""),[V,j]=i(""),[H,Z]=i(!1),{hasTabbedAway:G}=function(){let[e,t]=i(!1),r=l((()=>{document.hidden&&t(!0)}),[]);return o((()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r))),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}(),{enabled:q,token:J}=Ye(),K=ct(E?.connector?.walletClientType||"unknown"),ee=B&&"wallet_connect_v2"===E?.connector?.connectorType||B&&"coinbase_wallet"===E?.connector?.connectorType||B&&"injected"===E?.connector?.connectorType&&"phantom"===E?.connector?.walletClientType,te="connected"===E?.status,ie="switching_to_supported_chain"===E?.status;o((()=>{let e=S(),t=e instanceof Ze||e instanceof Ge?e:void 0;te&&!t&&(!q||J||w?N(E.connectedWallet,J,T?.login?.disableSignup).then((()=>{Z(!0)})):(I({captchaModalData:{callback:e=>N(E.connectedWallet,e,T?.login?.disableSignup).then((()=>{Z(!0)})),userIntentRequired:!1,onSuccessNavigateTo:y.AWAITING_CONNECTION,onErrorNavigateTo:y.ERROR_SCREEN}}),C(y.CAPTCHA_SCREEN,!1))),t&&ee&&te&&!t.preparedMessage?t.buildMessage():t&&!ee&&te&&(n||(async()=>{h(!0),u(void 0);try{"wallet_connect_v2"===E?.connector?.connectorType&&"metamask"===E?.connector?.walletClientType&&await Ee(2500),await ae()}catch(e){console.warn("Auto-prompted signature failed",e)}finally{h(!1)}})())}),[_,te,H]),o((()=>{if(O&&r){let e=b-500;if(m?.legal.requireUsersAcceptTerms&&!O.hasAcceptedTerms){let t=setTimeout((()=>{C(y.AFFIRMATIVE_CONSENT_SCREEN)}),e);return()=>clearTimeout(t)}if(Kt(O,m.embeddedWallets)){let t=setTimeout((()=>{I({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),W({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"ConnectionStatusScreen"}}),g()},callAuthOnSuccessOnClose:!0}}),C(y.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),e);return()=>clearTimeout(t)}P();let t=setTimeout((()=>M({shouldCallAuthOnSuccess:!0,isSuccess:!0})),b);return()=>clearTimeout(t)}}),[O,r]);let re=e=>{if(e?.privyErrorCode!==X.ALLOWLIST_REJECTED){if(e?.privyErrorCode===X.USER_LIMIT_REACHED)return console.error(new Q(e).toString()),void C(y.USER_LIMIT_REACHED_SCREEN);if(e?.privyErrorCode!==X.USER_DOES_NOT_EXIST)return e?.privyErrorCode===X.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce?(I({accountTransfer:{nonce:e.data?.data?.nonce,account:S()?.meta.address,displayName:e.data?.data?.account?.displayName,externalWalletMetadata:{walletClientType:S()?.meta.walletClientType,chainId:S()?.meta.chainId,connectorType:S()?.meta.connectorType},linkMethod:"siwe",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void C(y.LINK_CONFLICT_SCREEN)):void u(ki(e));C(y.ACCOUNT_NOT_FOUND_SCREEN)}else C(y.ALLOWLIST_REJECTION_SCREEN)};async function ae(){try{await L(),a(!0)}catch(e){re(e)}finally{h(!1)}}o((()=>{E?.connectError&&re(E?.connectError)}),[E]),((e,i)=>{let r=t((()=>{}));o((()=>{r.current=e})),o((()=>{if(null!==i){let e=setInterval((()=>r.current()),i||0);return()=>clearInterval(e)}}),[i])})((()=>{let e="wallet_connect_v2"===ne&&E?.connector instanceof pt?E.connector.redirectUri:void 0;e&&$(e);let t="wallet_connect_v2"===ne&&E?.connector instanceof pt?E.connector.fallbackUniversalRedirectUri:void 0;t&&j(t)}),E?.connector instanceof pt&&!U?500:null);let ne=E?.connector?.connectorType||"injected",oe=E?.connector?.walletClientType||"unknown",le=K?.metadata?.shortName||K?.name||E?.connector?.walletBranding.name||"Browser Extension",se=K?.image_url?.md||E?.connector?.walletBranding.icon||(e=>/*#__PURE__*/s(at,{...e})),ce="Browser Extension"===le?le.toLowerCase():le;e=r?`Successfully connected with ${ce}`:p?p.message:ie?"Switching networks":te?n&&ee?"Signing":"Sign to verify":`Waiting for ${ce}`;let de="Don’t see your wallet? Check your other browser windows.";r?de=z===(O?.linkedAccounts.length||0)?"Wallet was already linked.":"You’re good to go!":_>=2&&p?de="Unable to connect wallet":p?de=p.detail:ie?de="Switch your wallet to the requested network.":te&&ee?de="Sign the message in your wallet to verify it belongs to you.":"metamask"===oe&&B?de="Click continue to open and connect MetaMask.":"metamask"===oe?de="For the best experience, connect only one wallet at a time.":"wallet_connect"===ne?de="Open your mobile wallet app to continue":"coinbase_wallet"!==ne||Ae()||(de=Ai(O)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Open the Coinbase app on your phone to continue.");let he=F?.walletConnectors?.find((e=>"coinbase_wallet"===e.walletClientType)),pe="coinbase_wallet"===oe&&(Ai(O)||p===D.ERROR_USER_EXISTS);/*#__PURE__*/return c(d,{children:[/*#__PURE__*/s(Ft,{backFn:A&&k!==A?x:void 0}),/*#__PURE__*/c(Ti,{children:[/*#__PURE__*/s(Ei,{walletLogo:se,success:r,fail:!!p}),/*#__PURE__*/c(oi,{children:[/*#__PURE__*/s("h3",{children:e}),/*#__PURE__*/s("p",{children:de}),te||!U||G?null:/*#__PURE__*/c("p",{children:["Still here?"," ",/*#__PURE__*/s("a",{href:U,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),V&&/*#__PURE__*/c(d,{children:[" ","or"," ",/*#__PURE__*/s("a",{href:V,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]})]}),pe?/*#__PURE__*/s(bt,{onClick:()=>he&&he?.disconnect(),disabled:r,children:"Use a different wallet"}):p==D.ERROR_USER_EXISTS&&k!==A?/*#__PURE__*/s(bt,{onClick:x,children:"Use a different wallet"}):te&&!r&&ee?/*#__PURE__*/s(bt,{onClick:()=>{h(!0),ae()},disabled:n,children:n?"Signing":"Sign with your wallet"}):!r&&p?.retryable&&_<2?/*#__PURE__*/s(bt,{onClick:()=>{R(_+1),u(void 0),te?(h(!0),ae()):E?.connectRetry()},disabled:!r&&(!p?.retryable||_>=2),children:"Retry"}):r||p?null:/*#__PURE__*/s(bt,{onClick:()=>{},disabled:!0,children:"Connecting"})]}),/*#__PURE__*/s(Ht,{})]})};let Ti=/*#__PURE__*/$.div.withConfig({displayName:"ConnectContainer",componentId:"sc-31ab032c-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]),Si=/*#__PURE__*/$.div.withConfig({displayName:"StackedContainer",componentId:"sc-31ab032c-1"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]);const Ei=e=>{let t=e.walletLogo;/*#__PURE__*/return s(d,{children:/*#__PURE__*/s(Si,{children:/*#__PURE__*/c("div",{children:[/*#__PURE__*/s(ft,{success:e.success,fail:e.fail}),"string"==typeof t?
|
|
4
|
+
/*#__PURE__*/ /*#__PURE__*/c($t,{children:["By logging in I agree to the"," ",t&&/*#__PURE__*/s("a",{href:t,target:"_blank",children:a?"Terms":"Terms of Service"}),a&&" & ",e&&/*#__PURE__*/s("a",{href:e,target:"_blank",children:"Privacy Policy"})]})}const jt=()=>{let{appearance:e}=w();/*#__PURE__*/return s(Ht,{children:e.footerLogo??/*#__PURE__*/s("a",{href:"https://www.privy.io/",target:"_blank",id:"protected-by-privy",children:/*#__PURE__*/s(Bt,{height:13,width:150})})})},Ht=/*#__PURE__*/$.div.withConfig({displayName:"ModalFooter",componentId:"sc-bdb69ecc-1"})(["display:flex;align-items:center;justify-content:center;padding-top:8px;padding-bottom:12px;gap:8px;font-size:13px;&& a{padding:0.5rem 0;&:hover{text-decoration:none;}}@media all and (display-mode:standalone){padding-bottom:30px;}"]),Zt=({address:e,showCopyIcon:t,url:r,className:a})=>{let[n,l]=i(!1);return o((()=>{if(n){let e=setTimeout((()=>l(!1)),2e3);return()=>clearTimeout(e)}}),[n]),r?/*#__PURE__*/s("a",{title:e,className:a,href:`${r}/address/${e}`,target:"_blank",children:ke(e)}):/*#__PURE__*/c("button",{title:e,className:a,onClick:t=>(t.stopPropagation(),navigator.clipboard.writeText(e).then((()=>l(!0))).catch(console.error)),children:[ke(e),t&&/*#__PURE__*/s(n?qt:Gt,{})]})};let Gt=/*#__PURE__*/$(we).withConfig({displayName:"StyledSquare2StackIcon",componentId:"sc-6eaa0c94-0"})(["&&{display:inline;}stroke-width:2;height:0.875rem;width:0.875rem;margin-left:0.125rem;color:var(--privy-color-foreground-3);"]),qt=/*#__PURE__*/$(fe).withConfig({displayName:"StyledCheckIcon",componentId:"sc-6eaa0c94-1"})(["&&{display:inline;}stroke-width:2;height:0.875rem;width:0.875rem;margin-left:0.125rem;color:var(--privy-color-success);"]);const Xt=(e,t)=>!g(e)&&("all-users"===t||"users-without-wallets"===t&&!Jt(e).length);let Jt=e=>e.linkedAccounts.filter((e=>"wallet"===e.type&&"ethereum"===e.chainType));const Yt=(e,t)=>!m(e)&&("all-users"===t||"users-without-wallets"===t&&!Qt(e).length);let Qt=e=>e.linkedAccounts.filter((e=>"wallet"===e.type&&"solana"===e.chainType));const Kt=(e,t)=>Xt(e,t.ethereum.createOnLogin)||Yt(e,t.solana.createOnLogin),ei=/*#__PURE__*/$.div.withConfig({displayName:"BottomPusherContainer",componentId:"sc-cb963810-0"})(["display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-end;margin-top:auto;gap:16px;flex-grow:100;"]),ti=/*#__PURE__*/$.div.withConfig({displayName:"CenteredItem",componentId:"sc-cb963810-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;flex-grow:1;width:100%;"]),ii=/*#__PURE__*/$.div.withConfig({displayName:"HorizontallyCenteredItem",componentId:"sc-cb963810-2"})(["display:flex;flex-direction:column;align-items:center;width:100%;"]),ri=/*#__PURE__*/$(ti).withConfig({displayName:"CenteredItemWithPadding",componentId:"sc-cb963810-3"})(["padding:20px 0;"]),ai=/*#__PURE__*/$(ti).withConfig({displayName:"CenteredItemWithGap",componentId:"sc-cb963810-4"})(["gap:16px;"]),ni=/*#__PURE__*/$.div.withConfig({displayName:"FlexContainer",componentId:"sc-cb963810-5"})(["display:flex;flex-direction:column;width:100%;"]),oi=/*#__PURE__*/$.div.withConfig({displayName:"FixedGappedContainer",componentId:"sc-cb963810-6"})(["display:flex;flex-direction:column;gap:8px;"]),li=/*#__PURE__*/$.div.withConfig({displayName:"StyledCalloutSection",componentId:"sc-cb963810-8"})(["display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;text-align:left;gap:8px;padding:16px;margin-top:16px;margin-bottom:16px;width:100%;background:var(--privy-color-background-2);border-radius:var(--privy-border-radius-md);&& h4{color:var(--privy-color-foreground-3);font-size:14px;text-decoration:underline;font-weight:medium;}&& p{color:var(--privy-color-foreground-3);font-size:14px;}"]),si=/*#__PURE__*/$.div.withConfig({displayName:"RefactorSpacerTop",componentId:"sc-cb963810-9"})(["height:16px;"]),ci=/*#__PURE__*/$.div.withConfig({displayName:"RefactorSpacerBottom",componentId:"sc-cb963810-10"})(["height:12px;"]),di=/*#__PURE__*/$.div.withConfig({displayName:"RelativeContainer",componentId:"sc-cb963810-11"})(["position:relative;"]),hi=/*#__PURE__*/$.div.withConfig({displayName:"ConfigurableSpacer",componentId:"sc-cb963810-12"})(["height:","px;"],(e=>e.height??"12")),pi=/*#__PURE__*/$.div.withConfig({displayName:"Circle",componentId:"sc-cb963810-13"})(["background-color:var(--privy-color-accent);display:flex;justify-content:center;align-items:center;border-radius:50%;border-color:white;border-width:2px !important;"]);let ui=/*#__PURE__*/j(["from,to{background:var(--privy-color-foreground-4);color:var(--privy-color-foreground-4);}50%{background:var(--privy-color-foreground-accent);color:var(--privy-color-foreground-accent);}"]);const fi=/*#__PURE__*/V(["",""],(e=>e.$isLoading?/*#__PURE__*/V(["width:35%;animation:"," 2s linear infinite;border-radius:var(--privy-border-radius-sm);"],ui):"")),wi=({children:e,color:t,isLoading:i,isPulsing:r,...a})=>/*#__PURE__*/s(gi,{$color:t,$isLoading:i,$isPulsing:r,...a,children:e});let gi=/*#__PURE__*/$.span.withConfig({displayName:"StyledSpan",componentId:"sc-eba15c9-0"})(["padding:0.125rem 0.5rem;font-size:0.75rem;font-weight:500;line-height:1.125rem;border-radius:var(--privy-border-radius-sm);display:flex;align-items:center;"," ",""],(e=>{let t,i;"green"===e.$color&&(t="var(--privy-color-success-dark)",i="var(--privy-color-success-light)"),"red"===e.$color&&(t="var(--privy-color-error)",i="var(--privy-color-error-light)"),"gray"===e.$color&&(t="var(--privy-color-foreground-2)",i="var(--privy-color-background-2)");let r=/*#__PURE__*/j(["from,to{background-color:",";}50%{background-color:rgba(",",0.8);}"],i,i);/*#__PURE__*/return V(["color:",";background-color:",";",";"],t,i,e.$isPulsing&&/*#__PURE__*/V(["animation:"," 3s linear infinite;"],r))}),fi),mi=/*#__PURE__*/n({});const vi=({children:e})=>{let t=w(),[r,a]=i({});return O("login",{onComplete:({loginAccount:e})=>{e&&"passkey"!==e.type&&"cross_app"!==e.type&&("wallet"!==e.type||"privy"!==e.walletClientType)&&(W.put(yi(t.id),e.type),"wallet"===e.type?(W.put(bi(t.id),e.walletClientType),W.put(Ci(t.id),e.chainType),a({accountType:e.type,walletClientType:e.walletClientType,chainType:e.chainType})):(W.del(bi(t.id)),W.del(Ci(t.id)),a({accountType:e.type})))}}),o((()=>{if(!t.id)return;let e=W.get(yi(t.id)),i=W.get(bi(t.id)),r=W.get(Ci(t.id));e&&a("wallet"===e?{accountType:e,walletClientType:i,chainType:r}:{accountType:e})}),[t.id]),/*#__PURE__*/s(mi.Provider,{value:r,children:e})};let yi=e=>`privy:${e}:recent-login-method`,bi=e=>`privy:${e}:recent-login-wallet-client`,Ci=e=>`privy:${e}:recent-login-chain-type`;const xi=()=>a(mi),Ai=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter((e=>re(e,{strict:!0}))).map((e=>ae(e)));return!!t?.length&&!!e?.linkedAccounts.filter((e=>"wallet"==e.type&&t.includes(e.address))).length};const Ii=e=>e?.privyErrorCode===X.LINKED_TO_ANOTHER_USER?D.ERROR_USER_EXISTS:e instanceof z&&!e.details.default?e.details:e instanceof _?D.ERROR_TIMED_OUT:e instanceof R?D.ERROR_USER_REJECTED_CONNECTION:e?.privyErrorCode===X.CANNOT_LINK_MORE_OF_TYPE?D.ERROR_USER_LIMIT_REACHED:D.ERROR_WALLET_CONNECTION,Ti=()=>{let e,[r,a]=i(!1),[n,h]=i(!1),[p,u]=i(void 0),{authenticated:w,logout:g}=v(),{app:m,navigate:C,navigateBack:x,lastScreen:A,currentScreen:I,setModalData:T,data:k}=f(),{getAuthFlow:S,walletConnectionStatus:E,closePrivyModal:M,initLoginWithWallet:N,loginWithWallet:L,updateWallets:P,createAnalyticsEvent:W}=Y(),{walletConnectors:F}=v(),[_,R]=i(0),{user:O}=v(),[z]=i(O?.linkedAccounts.length||0),[U,$]=i(""),[V,j]=i(""),[H,Z]=i(!1),{hasTabbedAway:G}=function(){let[e,t]=i(!1),r=l((()=>{document.hidden&&t(!0)}),[]);return o((()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r))),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}(),{enabled:q,token:J}=Ye(),K=ct(E?.connector?.walletClientType||"unknown"),ee=B&&"wallet_connect_v2"===E?.connector?.connectorType||B&&"coinbase_wallet"===E?.connector?.connectorType||B&&"injected"===E?.connector?.connectorType&&"phantom"===E?.connector?.walletClientType,te="connected"===E?.status,ie="switching_to_supported_chain"===E?.status;o((()=>{let e=S(),t=e instanceof Ze||e instanceof Ge?e:void 0;te&&!t&&(!q||J||w?N(E.connectedWallet,J,k?.login?.disableSignup).then((()=>{Z(!0)})):(T({captchaModalData:{callback:e=>N(E.connectedWallet,e,k?.login?.disableSignup).then((()=>{Z(!0)})),userIntentRequired:!1,onSuccessNavigateTo:y.AWAITING_CONNECTION,onErrorNavigateTo:y.ERROR_SCREEN}}),C(y.CAPTCHA_SCREEN,!1))),t&&ee&&te&&!t.preparedMessage?t.buildMessage():t&&!ee&&te&&(n||(async()=>{h(!0),u(void 0);try{"wallet_connect_v2"===E?.connector?.connectorType&&"metamask"===E?.connector?.walletClientType&&await Ee(2500),await ae()}catch(e){console.warn("Auto-prompted signature failed",e)}finally{h(!1)}})())}),[_,te,H]),o((()=>{if(O&&r){let e=b-500;if(m?.legal.requireUsersAcceptTerms&&!O.hasAcceptedTerms){let t=setTimeout((()=>{C(y.AFFIRMATIVE_CONSENT_SCREEN)}),e);return()=>clearTimeout(t)}if(Kt(O,m.embeddedWallets)){let t=setTimeout((()=>{T({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),W({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"ConnectionStatusScreen"}}),g()},callAuthOnSuccessOnClose:!0}}),C(y.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),e);return()=>clearTimeout(t)}P();let t=setTimeout((()=>M({shouldCallAuthOnSuccess:!0,isSuccess:!0})),b);return()=>clearTimeout(t)}}),[O,r]);let re=e=>{if(e?.privyErrorCode!==X.ALLOWLIST_REJECTED){if(e?.privyErrorCode===X.USER_LIMIT_REACHED)return console.error(new Q(e).toString()),void C(y.USER_LIMIT_REACHED_SCREEN);if(e?.privyErrorCode!==X.USER_DOES_NOT_EXIST)return e?.privyErrorCode===X.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce?(T({accountTransfer:{nonce:e.data?.data?.nonce,account:S()?.meta.address,displayName:e.data?.data?.account?.displayName,externalWalletMetadata:{walletClientType:S()?.meta.walletClientType,chainId:S()?.meta.chainId,connectorType:S()?.meta.connectorType},linkMethod:"siwe",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void C(y.LINK_CONFLICT_SCREEN)):void u(Ii(e));C(y.ACCOUNT_NOT_FOUND_SCREEN)}else C(y.ALLOWLIST_REJECTION_SCREEN)};async function ae(){try{await L(),a(!0)}catch(e){re(e)}finally{h(!1)}}o((()=>{E?.connectError&&re(E?.connectError)}),[E]),((e,i)=>{let r=t((()=>{}));o((()=>{r.current=e})),o((()=>{if(null!==i){let e=setInterval((()=>r.current()),i||0);return()=>clearInterval(e)}}),[i])})((()=>{let e="wallet_connect_v2"===ne&&E?.connector instanceof pt?E.connector.redirectUri:void 0;e&&$(e);let t="wallet_connect_v2"===ne&&E?.connector instanceof pt?E.connector.fallbackUniversalRedirectUri:void 0;t&&j(t)}),E?.connector instanceof pt&&!U?500:null);let ne=E?.connector?.connectorType||"injected",oe=E?.connector?.walletClientType||"unknown",le=K?.metadata?.shortName||K?.name||E?.connector?.walletBranding.name||"Browser Extension",se=K?.image_url?.md||E?.connector?.walletBranding.icon||(e=>/*#__PURE__*/s(at,{...e})),ce="Browser Extension"===le?le.toLowerCase():le;e=r?`Successfully connected with ${ce}`:p?p.message:ie?"Switching networks":te?n&&ee?"Signing":"Sign to verify":`Waiting for ${ce}`;let de="Don’t see your wallet? Check your other browser windows.";r?de=z===(O?.linkedAccounts.length||0)?"Wallet was already linked.":"You’re good to go!":_>=2&&p?de="Unable to connect wallet":p?de=p.detail:ie?de="Switch your wallet to the requested network.":te&&ee?de="Sign the message in your wallet to verify it belongs to you.":"metamask"===oe&&B?de="Click continue to open and connect MetaMask.":"metamask"===oe?de="For the best experience, connect only one wallet at a time.":"wallet_connect"===ne?de="Open your mobile wallet app to continue":"coinbase_wallet"!==ne||Ae()||(de=Ai(O)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Open the Coinbase app on your phone to continue.");let he=F?.walletConnectors?.find((e=>"coinbase_wallet"===e.walletClientType)),pe="coinbase_wallet"===oe&&(Ai(O)||p===D.ERROR_USER_EXISTS);/*#__PURE__*/return c(d,{children:[/*#__PURE__*/s(Ft,{backFn:A&&I!==A?x:void 0}),/*#__PURE__*/c(ki,{children:[/*#__PURE__*/s(Ei,{walletLogo:se,success:r,fail:!!p}),/*#__PURE__*/c(oi,{children:[/*#__PURE__*/s("h3",{children:e}),/*#__PURE__*/s("p",{children:de}),te||!U||G?null:/*#__PURE__*/c("p",{children:["Still here?"," ",/*#__PURE__*/s("a",{href:U,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),V&&/*#__PURE__*/c(d,{children:[" ","or"," ",/*#__PURE__*/s("a",{href:V,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]})]}),pe?/*#__PURE__*/s(bt,{onClick:()=>he&&he?.disconnect(),disabled:r,children:"Use a different wallet"}):p==D.ERROR_USER_EXISTS&&I!==A?/*#__PURE__*/s(bt,{onClick:x,children:"Use a different wallet"}):te&&!r&&ee?/*#__PURE__*/s(bt,{onClick:()=>{h(!0),ae()},disabled:n,children:n?"Signing":"Sign with your wallet"}):!r&&p?.retryable&&_<2?/*#__PURE__*/s(bt,{onClick:()=>{R(_+1),u(void 0),te?(h(!0),ae()):E?.connectRetry()},disabled:!r&&(!p?.retryable||_>=2),children:"Retry"}):r||p?null:/*#__PURE__*/s(bt,{onClick:()=>{},disabled:!0,children:"Connecting"})]}),/*#__PURE__*/s(Ht,{})]})};let ki=/*#__PURE__*/$.div.withConfig({displayName:"ConnectContainer",componentId:"sc-31ab032c-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]),Si=/*#__PURE__*/$.div.withConfig({displayName:"StackedContainer",componentId:"sc-31ab032c-1"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]);const Ei=e=>{let t=e.walletLogo;/*#__PURE__*/return s(d,{children:/*#__PURE__*/s(Si,{children:/*#__PURE__*/c("div",{children:[/*#__PURE__*/s(ft,{success:e.success,fail:e.fail}),"string"==typeof t?
|
|
5
5
|
/*#__PURE__*/s("span",{style:{background:`url('${t}') 0 0 / contain`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"contain"}}):/*#__PURE__*/s(t,{style:{width:"38px",height:"38px"}})]})})})};function Mi(e){let{logout:t}=a(C);return O("logout",e),{logout:t}}const Ni=/*#__PURE__*/$.div.withConfig({displayName:"Column",componentId:"sc-cfc52180-0"})(["display:flex;flex-direction:column;"]),Li=/*#__PURE__*/$.span.withConfig({displayName:"ErrorMessage",componentId:"sc-fcb8cd50-0"})(["text-align:left;font-size:0.75rem;font-weight:500;line-height:1.125rem;color:var(--privy-color-error);"]),Pi=/*#__PURE__*/$.span.withConfig({displayName:"LabelXs",componentId:"sc-4c43f9fd-0"})(["color:var(--privy-color-foreground-3);font-size:0.75rem;font-weight:500;line-height:1.125rem;"]),Wi=/*#__PURE__*/V(["&&{border-width:1px;padding:0.5rem 1rem;}width:100%;text-align:left;border:solid 1px var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);display:flex;justify-content:space-between;align-items:center;",""],(e=>"error"===e.$state?"border-color: var(--privy-color-error);":"")),Fi=/*#__PURE__*/$.div.withConfig({displayName:"Box",componentId:"sc-1660059c-0"})(["",""],Wi),_i=({errMsg:e,balance:t,address:i,isLoading:r,className:a,title:n,isPulsing:o,showIcon:l,statusColor:h="green"})=>{let p;return p=h||(e?"red":"green"),/*#__PURE__*/c(d,{children:[/*#__PURE__*/c(Fi,{className:a,$state:e?"error":void 0,children:[/*#__PURE__*/c(Ni,{children:[/*#__PURE__*/s(Pi,{children:n||"Pay with"}),/*#__PURE__*/s(Zt,{address:i,showCopyIcon:l||!!e})]}),void 0!==t&&/*#__PURE__*/s(wi,{isLoading:r,isPulsing:o,color:p,children:t})]}),e&&/*#__PURE__*/s(Li,{style:{marginTop:"0.25rem"},children:e})]})},Ri=/*#__PURE__*/$.span.withConfig({displayName:"Subtitle",componentId:"sc-7a11f796-0"})(["margin-top:4px;color:var(--privy-color-foreground);text-align:center;font-size:0.875rem;font-weight:400;line-height:1.375rem;&& a{color:var(--privy-color-accent);}"]),Oi=/*#__PURE__*/$.span.withConfig({displayName:"Title",componentId:"sc-66de63c-0"})(["color:var(--privy-color-foreground);font-size:1.125rem;font-weight:600;line-height:1.875rem;text-align:center;"]),Di=({color:e,...t})=>/*#__PURE__*/s("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...t,children:/*#__PURE__*/s("g",{children:/*#__PURE__*/s("path",{fill:e||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})}),zi=()=>/*#__PURE__*/s("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:/*#__PURE__*/s("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});let Ui=(e,t,i,r,a)=>{for(let n=t;n<t+r;n++)for(let t=i;t<i+a;t++){let i=e?.[t];i&&i[n]&&(i[n]=0)}return e},Bi=({x:e,y:t,cellSize:i,bgColor:r,fgColor:a})=>
|
|
6
|
-
/*#__PURE__*/s(d,{children:[0,1,2].map((n=>/*#__PURE__*/s("circle",{r:i*(7-2*n)/2,cx:e+7*i/2,cy:t+7*i/2,fill:n%2!=0?r:a},`finder-${e}-${t}-${n}`)))}),$i=({cellSize:e,matrixSize:t,bgColor:i,fgColor:r})=>/*#__PURE__*/s(d,{children:[[0,0],[(t-7)*e,0],[0,(t-7)*e]].map((([t,a])=>/*#__PURE__*/s(Bi,{x:t,y:a,cellSize:e,bgColor:i,fgColor:r},`finder-${t}-${a}`)))}),Vi=({matrix:t,cellSize:i,color:r})=>/*#__PURE__*/s(d,{children:t.map(((t,a)=>t.map(((t,n)=>t?/*#__PURE__*/s("rect",{height:i-.4,width:i-.4,x:a*i+.1*i,y:n*i+.1*i,rx:.5*i,ry:.5*i,fill:r},`cell-${a}-${n}`):/*#__PURE__*/s(e.Fragment,{},`circle-${a}-${n}`)))))}),ji=({cellSize:e,matrixSize:t,element:i,sizePercentage:r,bgColor:a})=>{if(!i)/*#__PURE__*/return s(d,{});let n=t*(r||.14),o=Math.floor(t/2-n/2),l=Math.floor(t/2+n/2);(l-o)%2!=t%2&&(l+=1);let h=(l-o)*e,p=h-.2*h,u=o*e;/*#__PURE__*/return c(d,{children:[/*#__PURE__*/s("rect",{x:o*e,y:o*e,width:h,height:h,fill:a}),/*#__PURE__*/s(i,{x:u+.1*h,y:u+.1*h,height:p,width:p})]})},Hi=e=>{let t=e.outputSize,i=((e,t)=>{let i=ge.create(e,{errorCorrectionLevel:t}).modules,r=((e,t)=>{let i=e.slice(0),r=[];for(;i.length;)r.push(i.splice(0,t));return r})(Array.from(i.data),i.size);return r=Ui(r,0,0,7,7),r=Ui(r,r.length-7,0,7,7),Ui(r,0,r.length-7,7,7)})(e.url,e.errorCorrectionLevel),r=t/i.length,a=function(e,{min:t,max:i}){return Math.min(Math.max(e,t),i)}(2*r,{min:.025*t,max:.036*t});/*#__PURE__*/return c("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%",padding:`${a}px`},children:[/*#__PURE__*/s(Vi,{matrix:i,cellSize:r,color:e.fgColor}),/*#__PURE__*/s($i,{cellSize:r,matrixSize:i.length,fgColor:e.fgColor,bgColor:e.bgColor}),/*#__PURE__*/s(ji,{cellSize:r,element:e.logo?.element,bgColor:e.bgColor,matrixSize:i.length})]})},Zi=/*#__PURE__*/$.div.attrs({className:"ph-no-capture"}).withConfig({displayName:"QrContainer",componentId:"sc-597e27f3-0"})(["display:flex;justify-content:center;align-items:center;height:",";width:",";margin:auto;background-color:",";&&{border-width:2px;border-color:",";border-radius:var(--privy-border-radius-md);}"],(e=>`${e.$size}px`),(e=>`${e.$size}px`),(e=>e.$bgColor),(e=>e.$borderColor));const Gi=e=>{let{appearance:t}=w(),i=e.bgColor||"#FFFFFF",r=e.fgColor||"#000000",a=e.size||160,n="dark"===t.palette.colorScheme?i:r;/*#__PURE__*/return s(Zi,{$size:a,$bgColor:i,$fgColor:r,$borderColor:n,children:/*#__PURE__*/s(Hi,{url:e.url,logo:{element:e.squareLogoElement??zi},outputSize:a,bgColor:i,fgColor:r,errorCorrectionLevel:e.errorCorrectionLevel||"Q"})})},qi=/*#__PURE__*/$.span.withConfig({displayName:"Rows",componentId:"sc-b764aab6-0"})(["display:flex;flex-direction:column;gap:0.35rem;width:100%;"]),Xi=/*#__PURE__*/$.span.withConfig({displayName:"Row",componentId:"sc-b764aab6-1"})(["display:flex;width:100%;justify-content:space-between;gap:0.5rem;"]),Ji=e=>/*#__PURE__*/c("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 397.7 311.7",enableBackground:"new 0 0 397.7 311.7",xmlSpace:"preserve",...e,children:[/*#__PURE__*/c("linearGradient",{id:"SVGID_1_",gradientUnits:"userSpaceOnUse",x1:"360.8791",y1:"351.4553",x2:"141.213",y2:"-69.2936",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[/*#__PURE__*/s("stop",{offset:"0",stopColor:"#00FFA3"}),/*#__PURE__*/s("stop",{offset:"1",stopColor:"#DC1FFF"})]}),/*#__PURE__*/s("path",{d:"M64.6,237.9c2.4-2.4,5.7-3.8,9.2-3.8h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,237.9z",fill:"url(#SVGID_1_)"}),/*#__PURE__*/c("linearGradient",{id:"SVGID_2_",gradientUnits:"userSpaceOnUse",x1:"264.8291",y1:"401.6014",x2:"45.163",y2:"-19.1475",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[/*#__PURE__*/s("stop",{offset:"0",stopColor:"#00FFA3"}),/*#__PURE__*/s("stop",{offset:"1",stopColor:"#DC1FFF"})]}),/*#__PURE__*/s("path",{d:"M64.6,3.8C67.1,1.4,70.4,0,73.8,0h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,3.8z",fill:"url(#SVGID_2_)"}),/*#__PURE__*/c("linearGradient",{id:"SVGID_3_",gradientUnits:"userSpaceOnUse",x1:"312.5484",y1:"376.688",x2:"92.8822",y2:"-44.061",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[/*#__PURE__*/s("stop",{offset:"0",stopColor:"#00FFA3"}),/*#__PURE__*/s("stop",{offset:"1",stopColor:"#DC1FFF"})]}),/*#__PURE__*/s("path",{d:"M333.1,120.1c-2.4-2.4-5.7-3.8-9.2-3.8H6.5c-5.8,0-8.7,7-4.6,11.1l62.7,62.7c2.4,2.4,5.7,3.8,9.2,3.8h317.4 c5.8,0,8.7-7,4.6-11.1L333.1,120.1z",fill:"url(#SVGID_3_)"})]});let Yi={[x.id]:e=>/*#__PURE__*/s("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 2500 2500",xmlSpace:"preserve",...e,children:/*#__PURE__*/s("g",{id:"Layer_x0020_1",children:/*#__PURE__*/c("g",{id:"_2405588477232",children:[/*#__PURE__*/s("rect",{fill:"none",width:"2500",height:"2500"}),/*#__PURE__*/s("g",{children:/*#__PURE__*/c("g",{children:[/*#__PURE__*/s("path",{fill:"#213147",d:"M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"}),/*#__PURE__*/s("g",{children:/*#__PURE__*/c("g",{children:[/*#__PURE__*/s("g",{children:/*#__PURE__*/s("path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),/*#__PURE__*/s("g",{children:/*#__PURE__*/s("path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),/*#__PURE__*/s("g",{children:/*#__PURE__*/s("path",{fill:"#9DCCED",d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"})}),/*#__PURE__*/s("polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),/*#__PURE__*/c("g",{children:[/*#__PURE__*/s("path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),/*#__PURE__*/s("path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})}),[A.id]:e=>/*#__PURE__*/c("svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[/*#__PURE__*/s("rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),/*#__PURE__*/s("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z",fill:"#E84142"})]}),[k.id]:e=>/*#__PURE__*/c("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[/*#__PURE__*/s("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),/*#__PURE__*/s("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]}),[I.id]:e=>/*#__PURE__*/c("svg",{fill:"none",height:"400",viewBox:"0 0 400 400",width:"400",xmlns:"http://www.w3.org/2000/svg",...e,children:[/*#__PURE__*/s("path",{d:"m0 0h400v400h-400z",fill:"#fcff52"}),/*#__PURE__*/s("path",{d:"m300 100h-200v200h199.996v-69.813h-33.191c-11.442 25.468-37.194 43.206-66.665 43.206-40.63 0-73.533-33.187-73.533-73.533s32.903-73.249 73.533-73.249c30.043 0 55.795 18.313 67.24 44.349h32.62z",fill:"#000"})]}),[T.id]:e=>/*#__PURE__*/c("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[/*#__PURE__*/s("rect",{width:"199.4",height:"207.623",fill:"#121212"}),/*#__PURE__*/c("g",{"clip-path":"url(#clip0_2303_643)",children:[/*#__PURE__*/s("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),/*#__PURE__*/s("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),/*#__PURE__*/s("defs",{children:/*#__PURE__*/s("clipPath",{id:"clip0_2303_643",children:/*#__PURE__*/s("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]}),[S.id]:e=>/*#__PURE__*/c("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 327.5 533.3",enableBackground:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...e,children:[/*#__PURE__*/s("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),/*#__PURE__*/s("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),/*#__PURE__*/s("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),/*#__PURE__*/s("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),/*#__PURE__*/s("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]}),[E.id]:e=>/*#__PURE__*/c("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[/*#__PURE__*/s("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),/*#__PURE__*/s("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),/*#__PURE__*/s("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]}),[M.id]:e=>/*#__PURE__*/c("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[/*#__PURE__*/s("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),/*#__PURE__*/s("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]}),[N.id]:e=>/*#__PURE__*/c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",...e,children:[/*#__PURE__*/s("g",{clipPath:"url(#clip0)",children:/*#__PURE__*/s("g",{clipPath:"url(#clip1)",children:/*#__PURE__*/s("path",{d:"M14.9188 29.8373C6.67944 29.8373 0.00012207 23.1581 0.00012207 14.9187C0.00012207 6.67931 6.67944 0 14.9188 0C23.1581 0 29.8373 6.67931 29.8373 14.9187C29.8373 23.1581 23.1581 29.8373 14.9188 29.8373Z",fill:"url(#paint0)"})})}),/*#__PURE__*/c("defs",{children:[/*#__PURE__*/c("radialGradient",{id:"paint0",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(21.6921 8.02215) rotate(180) scale(25.2008)",children:[/*#__PURE__*/s("stop",{offset:"0.00682297",stopColor:"#F2CEFE"}),/*#__PURE__*/s("stop",{offset:"0.1913",stopColor:"#AFBAF1"}),/*#__PURE__*/s("stop",{offset:"0.4982",stopColor:"#4281D3"}),/*#__PURE__*/s("stop",{offset:"0.666667",stopColor:"#2E427D"}),/*#__PURE__*/s("stop",{offset:"0.822917",stopColor:"#230101"}),/*#__PURE__*/s("stop",{offset:"1",stopColor:"#8F6B40"})]}),/*#__PURE__*/s("clipPath",{id:"clip0",children:/*#__PURE__*/s("rect",{width:"30",height:"30",fill:"white"})}),/*#__PURE__*/s("clipPath",{id:"clip1",children:/*#__PURE__*/s("rect",{width:"30",height:"30",fill:"white"})})]})]})};const Qi=({chainId:e,...t})=>{if("solana"===e)/*#__PURE__*/return s(Ji,{...t});let i=Yi[e];/*#__PURE__*/return s(i||me,{...t})};let Ki=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),er=e=>Ki.format(e);const tr=(e,t)=>{let i=er(t*parseFloat(e));return"$0.00"!==i?i:"<$0.01"},ir=(e,t)=>{let i=er(t*parseFloat(ne(e)));return"$0.00"===i?"<$0.01":i},rr=(e,t,i=6,r=!1)=>`${ar(e,i,r)} ${t}`,ar=(e,t=6,i=!1)=>{let r=parseFloat(ne(e)).toFixed(t).replace(/0+$/,"").replace(/\.$/,"");return i?r:`${"0"===r?"<0.001":r}`},nr=e=>e.reduce(((e,t)=>e+t),0n),or=(e,t)=>{let{chains:i}=Y(),r=`https://etherscan.io/address/${t}`,a=`${((e,t)=>{let i=Number(e),r=t.find((e=>e.id===i));if(!r)throw new H(`Unsupported chainId ${e}`,4901);return r.blockExplorers?.default.url})(e,i)}/address/${t}`;if(!a)return r;try{new URL(a)}catch{return r}return a};let lr=2n**256n-1n;const sr=({amount:e,decimals:t})=>e===lr?"Maximum":Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(Number(e)/10**t),cr=async({chain:e,address:t,appId:i,rpcConfig:r,erc20Address:a})=>{let n=oe({chain:e,transport:le(ve(e,r,i))});return{balance:await n.readContract({address:a,abi:dr,functionName:"balanceOf",args:[t]}).catch((()=>0n)),chain:e}};let dr=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];const hr=({...e})=>/*#__PURE__*/c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[/*#__PURE__*/s("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),/*#__PURE__*/s("path",{d:"M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2"}),/*#__PURE__*/s("path",{d:"M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21"})]}),pr=async({address:e,chain:t,rpcConfig:i,privyAppId:r})=>{try{let a=oe({chain:t,transport:le(ve(t,i,r))}),[n,o]=await Promise.all([a.readContract({abi:ur,address:e,functionName:"symbol"}),a.readContract({abi:ur,address:e,functionName:"decimals"})]);return{decimals:o,symbol:n}}catch(e){return console.log(e),null}};let ur=[{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}];function fr({rpcConfig:e,appId:t,address:a,chain:n}){let{chains:s}=Y(),[c,d]=i(0n),[h,p]=i(!1),u=r((()=>{let i=n||s[0];if(i)return oe({chain:n,transport:le(ve(i,e,t))})}),[n,e,t]),f=l((async()=>{if(!a||!u)return;p(!0);let e=await u.getBalance({address:a}).catch(console.error);return e?(d(e),p(!1),e):void 0}),[u,a,d]);return o((()=>{f().catch(console.error)}),[]),{balance:c,isLoading:h,reloadBalance:f}}let wr=/*#__PURE__*/$.label.withConfig({displayName:"BaseEmailForm",componentId:"sc-d081b0e2-0"})(["display:block;position:relative;width:100%;> svg{position:absolute;margin:13px 17px;height:24px;width:24px;color:var(--privy-color-foreground-3);}&& > input{background-color:#f00;font-size:16px;line-height:24px;padding:12px 88px 12px 52px;flex-grow:1;background:var(--privy-color-background);border:1px solid ",";border-radius:var(--privy-border-radius-mdlg);width:100%;@media (min-width:441px){font-size:14px;padding-right:78px;}:focus{outline:none;border-color:",";box-shadow:",";}:autofill,:-webkit-autofill{background:var(--privy-color-background);}&& > input::placeholder{color:var(--privy-color-foreground-3);}&:disabled{opacity:0.4;cursor:not-allowed;}&:disabled,&:disabled:hover,&:disabled > span{color:var(--privy-color-foreground-3);}}&& > button:last-child{right:0px;line-height:24px;padding:13px 17px;:focus{outline:none;}&:disabled{opacity:0.4;cursor:not-allowed;}&:disabled,&:disabled:hover,&:disabled > span{color:var(--privy-color-foreground-3);}}"],(({$error:e})=>e?"var(--privy-color-error) !important":"var(--privy-color-foreground-4)"),(({$error:e})=>e?"var(--privy-color-error) !important":"var(--privy-color-accent-light)"),(({$error:e})=>e?"none":"0 0 0 1px var(--privy-color-accent-light)"));const gr=/*#__PURE__*/$(wr).withConfig({displayName:"EmailUpdateForm",componentId:"sc-d081b0e2-1"})(["background-color:var(--privy-color-background);transition:background-color 200ms ease;&& > button{right:0;line-height:24px;position:absolute;padding:13px 17px;background-color:#090;:focus{outline:none;border-color:var(--privy-color-accent);}}"]),mr=/*#__PURE__*/$(wr).withConfig({displayName:"EmailInputForm",componentId:"sc-d081b0e2-2"})(["&& > input{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding-right:",";border:1px solid ",";&& > input::placeholder{color:var(--privy-color-foreground-3);}}&& > :last-child{right:16px;position:absolute;top:50%;transform:translate(0,-50%);}&& > button:last-child{right:0px;line-height:24px;padding:13px 17px;:focus{outline:none;}}"],(e=>e.stacked?"16px":"88px"),(({$error:e})=>e?"var(--privy-color-error) !important":"var(--privy-color-foreground-4)")),vr=/*#__PURE__*/$.div.withConfig({displayName:"InputContainerForm",componentId:"sc-d081b0e2-3"})(["width:100%;&& > ","{display:block;text-align:left;padding-left:var(--privy-border-radius-mdlg);padding-bottom:5px;}"],Li);function yr(e){let{login:t}=a(C);return O("login",e),{login:t}}function br(e){let{connectWallet:t}=a(C);return O("connectWallet",e),{connectWallet:t}}const Cr=e=>{O("fundWallet",e);let{fundWallet:t}=Y();return{fundWallet:t}},xr=he((()=>({isModalOpen:!1,resolvers:null})));let Ar=be((()=>({})),ye);const kr=(e,t)=>Ar((i=>i[e]?.[t])),Ir=(e,t,i)=>{Ar.setState((r=>({...r,[e]:{...r[e],[t]:i}})))},Tr=()=>{let e=xr.getState().resolvers;e||console.warn("useActiveWalletStore: Called close while modal was not open"),xr.setState({isModalOpen:!1}),e?.resolve({wallet:xr.getState().wallet})},Sr=({address:e,client:t,appId:i})=>{let r=`${t}:${e}`;i&&W.put(Mr(i),r),xr.setState({wallet:r})},Er=()=>xr((e=>e.isModalOpen)),Mr=e=>`privy:${e}:active-wallet-connection`,Nr=()=>{let e=w(),{wallets:t}=L(),{wallets:i}=U(),a=xr((e=>e.wallet));o((()=>{if(!e.id)return;let t=W.get(Mr(e.id));xr.setState({wallet:t})}),[e.id]);let n=r((()=>{if(!a)return;let[,e]=a.split(":");return t.find((t=>t.address===e))||i.find((t=>t.address===e))}),[a,t,i]),l=r((()=>n?"ethereum"===n.type?n.chainId:"solana":void 0),[n]);return{connect:async r=>{r?.reset&&(W.del(Mr(e.id)),xr.setState({wallet:void 0}));let{wallet:a}=await(async()=>{let e,t,i=new Promise(((i,r)=>{e=i,t=r}));return Ar.setState({}),xr.setState({isModalOpen:!0,resolvers:{resolve:e,reject:t}}),await i})();if(!a)return{};let[,n]=a.split(":"),o=t.find((e=>e.address===n));if(o)return{wallet:o,network:o.chainId};let l=i.find((e=>e.address===n));return l?{wallet:l,network:"solana"}:{}},wallet:n,network:l}};export{Fi as $,Zt as A,at as B,Xe as C,ai as D,it as E,oi as F,Oi as G,ii as H,Ri as I,Ne as J,Xt as K,Yt as L,Ft as M,yt as N,di as O,rt as P,pi as Q,je as R,Ze as S,Vt as T,Di as U,ti as V,pt as W,ri as X,Gi as Y,wt as Z,fi as _,et as a,Qi as a0,Wi as a1,mt as a2,Xi as a3,rr as a4,Li as a5,Ct as a6,qi as a7,cr as a8,tr as a9,ot as aA,Ge as aB,He as aC,Je as aD,vi as aE,Fe as aF,Ke as aG,yr as aH,br as aI,Cr as aJ,Nr as aK,nt as aL,ht as aM,Sr as aN,kr as aO,Ir as aP,Ni as aQ,Er as aR,Tr as aS,ir as aa,sr as ab,nr as ac,Se as ad,gt as ae,ni as af,pr as ag,hr as ah,fr as ai,ei as aj,St as ak,Ie as al,Et as am,vr as an,mr as ao,ke as ap,or as aq,li as ar,Nt as as,Lt as at,ar as au,gr as av,At as aw,Ii as ax,ut as ay,Me as az,Qe as b,bt as c,We as d,jt as e,It as f,Re as g,ft as h,tt as i,Ht as j,xi as k,ct as l,Ae as m,wi as n,Ve as o,Te as p,Ei as q,ki as r,Kt as s,Pe as t,Ye as u,Mi as v,si as w,ci as x,hi as y,_i as z};
|
|
6
|
+
/*#__PURE__*/s(d,{children:[0,1,2].map((n=>/*#__PURE__*/s("circle",{r:i*(7-2*n)/2,cx:e+7*i/2,cy:t+7*i/2,fill:n%2!=0?r:a},`finder-${e}-${t}-${n}`)))}),$i=({cellSize:e,matrixSize:t,bgColor:i,fgColor:r})=>/*#__PURE__*/s(d,{children:[[0,0],[(t-7)*e,0],[0,(t-7)*e]].map((([t,a])=>/*#__PURE__*/s(Bi,{x:t,y:a,cellSize:e,bgColor:i,fgColor:r},`finder-${t}-${a}`)))}),Vi=({matrix:t,cellSize:i,color:r})=>/*#__PURE__*/s(d,{children:t.map(((t,a)=>t.map(((t,n)=>t?/*#__PURE__*/s("rect",{height:i-.4,width:i-.4,x:a*i+.1*i,y:n*i+.1*i,rx:.5*i,ry:.5*i,fill:r},`cell-${a}-${n}`):/*#__PURE__*/s(e.Fragment,{},`circle-${a}-${n}`)))))}),ji=({cellSize:e,matrixSize:t,element:i,sizePercentage:r,bgColor:a})=>{if(!i)/*#__PURE__*/return s(d,{});let n=t*(r||.14),o=Math.floor(t/2-n/2),l=Math.floor(t/2+n/2);(l-o)%2!=t%2&&(l+=1);let h=(l-o)*e,p=h-.2*h,u=o*e;/*#__PURE__*/return c(d,{children:[/*#__PURE__*/s("rect",{x:o*e,y:o*e,width:h,height:h,fill:a}),/*#__PURE__*/s(i,{x:u+.1*h,y:u+.1*h,height:p,width:p})]})},Hi=e=>{let t=e.outputSize,i=((e,t)=>{let i=ge.create(e,{errorCorrectionLevel:t}).modules,r=((e,t)=>{let i=e.slice(0),r=[];for(;i.length;)r.push(i.splice(0,t));return r})(Array.from(i.data),i.size);return r=Ui(r,0,0,7,7),r=Ui(r,r.length-7,0,7,7),Ui(r,0,r.length-7,7,7)})(e.url,e.errorCorrectionLevel),r=t/i.length,a=function(e,{min:t,max:i}){return Math.min(Math.max(e,t),i)}(2*r,{min:.025*t,max:.036*t});/*#__PURE__*/return c("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%",padding:`${a}px`},children:[/*#__PURE__*/s(Vi,{matrix:i,cellSize:r,color:e.fgColor}),/*#__PURE__*/s($i,{cellSize:r,matrixSize:i.length,fgColor:e.fgColor,bgColor:e.bgColor}),/*#__PURE__*/s(ji,{cellSize:r,element:e.logo?.element,bgColor:e.bgColor,matrixSize:i.length})]})},Zi=/*#__PURE__*/$.div.attrs({className:"ph-no-capture"}).withConfig({displayName:"QrContainer",componentId:"sc-597e27f3-0"})(["display:flex;justify-content:center;align-items:center;height:",";width:",";margin:auto;background-color:",";&&{border-width:2px;border-color:",";border-radius:var(--privy-border-radius-md);}"],(e=>`${e.$size}px`),(e=>`${e.$size}px`),(e=>e.$bgColor),(e=>e.$borderColor));const Gi=e=>{let{appearance:t}=w(),i=e.bgColor||"#FFFFFF",r=e.fgColor||"#000000",a=e.size||160,n="dark"===t.palette.colorScheme?i:r;/*#__PURE__*/return s(Zi,{$size:a,$bgColor:i,$fgColor:r,$borderColor:n,children:/*#__PURE__*/s(Hi,{url:e.url,logo:{element:e.squareLogoElement??zi},outputSize:a,bgColor:i,fgColor:r,errorCorrectionLevel:e.errorCorrectionLevel||"Q"})})},qi=/*#__PURE__*/$.span.withConfig({displayName:"Rows",componentId:"sc-b764aab6-0"})(["display:flex;flex-direction:column;gap:0.35rem;width:100%;"]),Xi=/*#__PURE__*/$.span.withConfig({displayName:"Row",componentId:"sc-b764aab6-1"})(["display:flex;width:100%;justify-content:space-between;gap:0.5rem;"]),Ji=e=>/*#__PURE__*/c("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 397.7 311.7",enableBackground:"new 0 0 397.7 311.7",xmlSpace:"preserve",...e,children:[/*#__PURE__*/c("linearGradient",{id:"SVGID_1_",gradientUnits:"userSpaceOnUse",x1:"360.8791",y1:"351.4553",x2:"141.213",y2:"-69.2936",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[/*#__PURE__*/s("stop",{offset:"0",stopColor:"#00FFA3"}),/*#__PURE__*/s("stop",{offset:"1",stopColor:"#DC1FFF"})]}),/*#__PURE__*/s("path",{d:"M64.6,237.9c2.4-2.4,5.7-3.8,9.2-3.8h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,237.9z",fill:"url(#SVGID_1_)"}),/*#__PURE__*/c("linearGradient",{id:"SVGID_2_",gradientUnits:"userSpaceOnUse",x1:"264.8291",y1:"401.6014",x2:"45.163",y2:"-19.1475",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[/*#__PURE__*/s("stop",{offset:"0",stopColor:"#00FFA3"}),/*#__PURE__*/s("stop",{offset:"1",stopColor:"#DC1FFF"})]}),/*#__PURE__*/s("path",{d:"M64.6,3.8C67.1,1.4,70.4,0,73.8,0h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,3.8z",fill:"url(#SVGID_2_)"}),/*#__PURE__*/c("linearGradient",{id:"SVGID_3_",gradientUnits:"userSpaceOnUse",x1:"312.5484",y1:"376.688",x2:"92.8822",y2:"-44.061",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[/*#__PURE__*/s("stop",{offset:"0",stopColor:"#00FFA3"}),/*#__PURE__*/s("stop",{offset:"1",stopColor:"#DC1FFF"})]}),/*#__PURE__*/s("path",{d:"M333.1,120.1c-2.4-2.4-5.7-3.8-9.2-3.8H6.5c-5.8,0-8.7,7-4.6,11.1l62.7,62.7c2.4,2.4,5.7,3.8,9.2,3.8h317.4 c5.8,0,8.7-7,4.6-11.1L333.1,120.1z",fill:"url(#SVGID_3_)"})]});let Yi={[x.id]:e=>/*#__PURE__*/s("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 2500 2500",xmlSpace:"preserve",...e,children:/*#__PURE__*/s("g",{id:"Layer_x0020_1",children:/*#__PURE__*/c("g",{id:"_2405588477232",children:[/*#__PURE__*/s("rect",{fill:"none",width:"2500",height:"2500"}),/*#__PURE__*/s("g",{children:/*#__PURE__*/c("g",{children:[/*#__PURE__*/s("path",{fill:"#213147",d:"M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"}),/*#__PURE__*/s("g",{children:/*#__PURE__*/c("g",{children:[/*#__PURE__*/s("g",{children:/*#__PURE__*/s("path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),/*#__PURE__*/s("g",{children:/*#__PURE__*/s("path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),/*#__PURE__*/s("g",{children:/*#__PURE__*/s("path",{fill:"#9DCCED",d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"})}),/*#__PURE__*/s("polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),/*#__PURE__*/c("g",{children:[/*#__PURE__*/s("path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),/*#__PURE__*/s("path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})}),[A.id]:e=>/*#__PURE__*/c("svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[/*#__PURE__*/s("rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),/*#__PURE__*/s("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z",fill:"#E84142"})]}),[I.id]:e=>/*#__PURE__*/c("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[/*#__PURE__*/s("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),/*#__PURE__*/s("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]}),[T.id]:e=>/*#__PURE__*/c("svg",{fill:"none",height:"400",viewBox:"0 0 400 400",width:"400",xmlns:"http://www.w3.org/2000/svg",...e,children:[/*#__PURE__*/s("path",{d:"m0 0h400v400h-400z",fill:"#fcff52"}),/*#__PURE__*/s("path",{d:"m300 100h-200v200h199.996v-69.813h-33.191c-11.442 25.468-37.194 43.206-66.665 43.206-40.63 0-73.533-33.187-73.533-73.533s32.903-73.249 73.533-73.249c30.043 0 55.795 18.313 67.24 44.349h32.62z",fill:"#000"})]}),[k.id]:e=>/*#__PURE__*/c("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[/*#__PURE__*/s("rect",{width:"199.4",height:"207.623",fill:"#121212"}),/*#__PURE__*/c("g",{"clip-path":"url(#clip0_2303_643)",children:[/*#__PURE__*/s("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),/*#__PURE__*/s("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),/*#__PURE__*/s("defs",{children:/*#__PURE__*/s("clipPath",{id:"clip0_2303_643",children:/*#__PURE__*/s("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]}),[S.id]:e=>/*#__PURE__*/c("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 327.5 533.3",enableBackground:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...e,children:[/*#__PURE__*/s("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),/*#__PURE__*/s("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),/*#__PURE__*/s("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),/*#__PURE__*/s("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),/*#__PURE__*/s("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]}),[E.id]:e=>/*#__PURE__*/c("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[/*#__PURE__*/s("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),/*#__PURE__*/s("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),/*#__PURE__*/s("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]}),[M.id]:e=>/*#__PURE__*/c("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[/*#__PURE__*/s("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),/*#__PURE__*/s("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]}),[N.id]:e=>/*#__PURE__*/c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",...e,children:[/*#__PURE__*/s("g",{clipPath:"url(#clip0)",children:/*#__PURE__*/s("g",{clipPath:"url(#clip1)",children:/*#__PURE__*/s("path",{d:"M14.9188 29.8373C6.67944 29.8373 0.00012207 23.1581 0.00012207 14.9187C0.00012207 6.67931 6.67944 0 14.9188 0C23.1581 0 29.8373 6.67931 29.8373 14.9187C29.8373 23.1581 23.1581 29.8373 14.9188 29.8373Z",fill:"url(#paint0)"})})}),/*#__PURE__*/c("defs",{children:[/*#__PURE__*/c("radialGradient",{id:"paint0",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(21.6921 8.02215) rotate(180) scale(25.2008)",children:[/*#__PURE__*/s("stop",{offset:"0.00682297",stopColor:"#F2CEFE"}),/*#__PURE__*/s("stop",{offset:"0.1913",stopColor:"#AFBAF1"}),/*#__PURE__*/s("stop",{offset:"0.4982",stopColor:"#4281D3"}),/*#__PURE__*/s("stop",{offset:"0.666667",stopColor:"#2E427D"}),/*#__PURE__*/s("stop",{offset:"0.822917",stopColor:"#230101"}),/*#__PURE__*/s("stop",{offset:"1",stopColor:"#8F6B40"})]}),/*#__PURE__*/s("clipPath",{id:"clip0",children:/*#__PURE__*/s("rect",{width:"30",height:"30",fill:"white"})}),/*#__PURE__*/s("clipPath",{id:"clip1",children:/*#__PURE__*/s("rect",{width:"30",height:"30",fill:"white"})})]})]})};const Qi=({chainId:e,...t})=>{if("solana"===e)/*#__PURE__*/return s(Ji,{...t});let i=Yi[e];/*#__PURE__*/return s(i||me,{...t})};let Ki=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),er=e=>Ki.format(e);const tr=(e,t)=>{let i=er(t*parseFloat(e));return"$0.00"!==i?i:"<$0.01"},ir=(e,t)=>{let i=er(t*parseFloat(ne(e)));return"$0.00"===i?"<$0.01":i},rr=(e,t,i=6,r=!1)=>`${ar(e,i,r)} ${t}`,ar=(e,t=6,i=!1)=>{let r=parseFloat(ne(e)).toFixed(t).replace(/0+$/,"").replace(/\.$/,"");return i?r:`${"0"===r?"<0.001":r}`},nr=e=>e.reduce(((e,t)=>e+t),0n),or=(e,t)=>{let{chains:i}=Y(),r=`https://etherscan.io/address/${t}`,a=`${((e,t)=>{let i=Number(e),r=t.find((e=>e.id===i));if(!r)throw new H(`Unsupported chainId ${e}`,4901);return r.blockExplorers?.default.url})(e,i)}/address/${t}`;if(!a)return r;try{new URL(a)}catch{return r}return a};let lr=2n**256n-1n;const sr=({amount:e,decimals:t})=>e===lr?"Maximum":Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(Number(e)/10**t),cr=async({chain:e,address:t,appId:i,rpcConfig:r,erc20Address:a})=>{let n=oe({chain:e,transport:le(ve(e,r,i))});return{balance:await n.readContract({address:a,abi:dr,functionName:"balanceOf",args:[t]}).catch((()=>0n)),chain:e}};let dr=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];const hr=({...e})=>/*#__PURE__*/c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[/*#__PURE__*/s("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),/*#__PURE__*/s("path",{d:"M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2"}),/*#__PURE__*/s("path",{d:"M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21"})]}),pr=async({address:e,chain:t,rpcConfig:i,privyAppId:r})=>{try{let a=oe({chain:t,transport:le(ve(t,i,r))}),[n,o]=await Promise.all([a.readContract({abi:ur,address:e,functionName:"symbol"}),a.readContract({abi:ur,address:e,functionName:"decimals"})]);return{decimals:o,symbol:n}}catch(e){return console.log(e),null}};let ur=[{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}];function fr({rpcConfig:e,appId:t,address:a,chain:n}){let{chains:s}=Y(),[c,d]=i(0n),[h,p]=i(!1),u=r((()=>{let i=n||s[0];if(i)return oe({chain:n,transport:le(ve(i,e,t))})}),[n,e,t]),f=l((async()=>{if(!a||!u)return;p(!0);let e=await u.getBalance({address:a}).catch(console.error);return e?(d(e),p(!1),e):void 0}),[u,a,d]);return o((()=>{f().catch(console.error)}),[]),{balance:c,isLoading:h,reloadBalance:f}}let wr=/*#__PURE__*/$.label.withConfig({displayName:"BaseEmailForm",componentId:"sc-d081b0e2-0"})(["display:block;position:relative;width:100%;> svg{position:absolute;margin:13px 17px;height:24px;width:24px;color:var(--privy-color-foreground-3);}&& > input{background-color:#f00;font-size:16px;line-height:24px;padding:12px 88px 12px 52px;flex-grow:1;background:var(--privy-color-background);border:1px solid ",";border-radius:var(--privy-border-radius-mdlg);width:100%;@media (min-width:441px){font-size:14px;padding-right:78px;}:focus{outline:none;border-color:",";box-shadow:",";}:autofill,:-webkit-autofill{background:var(--privy-color-background);}&& > input::placeholder{color:var(--privy-color-foreground-3);}&:disabled{opacity:0.4;cursor:not-allowed;}&:disabled,&:disabled:hover,&:disabled > span{color:var(--privy-color-foreground-3);}}&& > button:last-child{right:0px;line-height:24px;padding:13px 17px;:focus{outline:none;}&:disabled{opacity:0.4;cursor:not-allowed;}&:disabled,&:disabled:hover,&:disabled > span{color:var(--privy-color-foreground-3);}}"],(({$error:e})=>e?"var(--privy-color-error) !important":"var(--privy-color-foreground-4)"),(({$error:e})=>e?"var(--privy-color-error) !important":"var(--privy-color-accent-light)"),(({$error:e})=>e?"none":"0 0 0 1px var(--privy-color-accent-light)"));const gr=/*#__PURE__*/$(wr).withConfig({displayName:"EmailUpdateForm",componentId:"sc-d081b0e2-1"})(["background-color:var(--privy-color-background);transition:background-color 200ms ease;&& > button{right:0;line-height:24px;position:absolute;padding:13px 17px;background-color:#090;:focus{outline:none;border-color:var(--privy-color-accent);}}"]),mr=/*#__PURE__*/$(wr).withConfig({displayName:"EmailInputForm",componentId:"sc-d081b0e2-2"})(["&& > input{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding-right:",";border:1px solid ",";&& > input::placeholder{color:var(--privy-color-foreground-3);}}&& > :last-child{right:16px;position:absolute;top:50%;transform:translate(0,-50%);}&& > button:last-child{right:0px;line-height:24px;padding:13px 17px;:focus{outline:none;}}"],(e=>e.stacked?"16px":"88px"),(({$error:e})=>e?"var(--privy-color-error) !important":"var(--privy-color-foreground-4)")),vr=/*#__PURE__*/$.div.withConfig({displayName:"InputContainerForm",componentId:"sc-d081b0e2-3"})(["width:100%;&& > ","{display:block;text-align:left;padding-left:var(--privy-border-radius-mdlg);padding-bottom:5px;}"],Li);function yr(e){let{login:t}=a(C);return O("login",e),{login:t}}function br(e){let{connectWallet:t}=a(C);return O("connectWallet",e),{connectWallet:t}}const Cr=e=>{O("fundWallet",e);let{fundWallet:t}=Y();return{fundWallet:t}},xr=he((()=>({isModalOpen:!1,resolvers:null})));let Ar=be((()=>({})),ye);const Ir=(e,t)=>Ar((i=>i[e]?.[t])),Tr=(e,t,i)=>{Ar.setState((r=>({...r,[e]:{...r[e],[t]:i}})))},kr=()=>{let e=xr.getState().resolvers;e||console.warn("useActiveWalletStore: Called close while modal was not open"),xr.setState({isModalOpen:!1}),e?.resolve({wallet:xr.getState().wallet})},Sr=({address:e,client:t,appId:i})=>{let r=`${t}:${e}`;i&&W.put(Mr(i),r),xr.setState({wallet:r})},Er=()=>xr((e=>e.isModalOpen)),Mr=e=>`privy:${e}:active-wallet-connection`,Nr=()=>{let e=w(),{wallets:t}=L(),{wallets:i}=U(),a=xr((e=>e.wallet));o((()=>{if(!e.id)return;let t=W.get(Mr(e.id));xr.setState({wallet:t})}),[e.id]);let n=r((()=>{if(!a)return;let[,e]=a.split(":");return t.find((t=>t.address===e))||i.find((t=>t.address===e))}),[a,t,i]),s=r((()=>n?"ethereum"===n.type?n.chainId:"solana":void 0),[n]);return{connect:async r=>{r?.reset&&(W.del(Mr(e.id)),xr.setState({wallet:void 0}));let{wallet:a}=await(async()=>{let e,t,i=new Promise(((i,r)=>{e=i,t=r}));return Ar.setState({}),xr.setState({isModalOpen:!0,resolvers:{resolve:e,reject:t}}),await i})();if(!a)return{};let[,n]=a.split(":"),o=t.find((e=>e.address===n));if(o)return{wallet:o,network:o.chainId};let l=i.find((e=>e.address===n));return l?{wallet:l,network:"solana"}:{}},setActiveWallet:l((t=>{Sr({address:t.address,client:t.walletClientType,appId:e.id})}),[e.id]),wallet:n,network:s}};export{Fi as $,Zt as A,at as B,Xe as C,ai as D,it as E,oi as F,Oi as G,ii as H,Ri as I,Ne as J,Xt as K,Yt as L,Ft as M,yt as N,di as O,rt as P,pi as Q,je as R,Ze as S,Vt as T,Di as U,ti as V,pt as W,ri as X,Gi as Y,wt as Z,fi as _,et as a,Qi as a0,Wi as a1,mt as a2,Xi as a3,rr as a4,Li as a5,Ct as a6,qi as a7,cr as a8,tr as a9,ot as aA,Ge as aB,He as aC,Je as aD,vi as aE,Fe as aF,Ke as aG,yr as aH,br as aI,Cr as aJ,Nr as aK,nt as aL,ht as aM,Sr as aN,Ir as aO,Tr as aP,Ni as aQ,Er as aR,kr as aS,ir as aa,sr as ab,nr as ac,Se as ad,gt as ae,ni as af,pr as ag,hr as ah,fr as ai,ei as aj,St as ak,Te as al,Et as am,vr as an,mr as ao,Ie as ap,or as aq,li as ar,Nt as as,Lt as at,ar as au,gr as av,At as aw,Ti as ax,ut as ay,Me as az,Qe as b,bt as c,We as d,jt as e,Tt as f,Re as g,ft as h,tt as i,Ht as j,xi as k,ct as l,Ae as m,wi as n,Ve as o,ke as p,Ei as q,Ii as r,Kt as s,Pe as t,Ye as u,Mi as v,si as w,ci as x,hi as y,_i as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as e}from"react";import{q as a,u as t,M as r}from"./useWallets-
|
|
1
|
+
import{useCallback as e}from"react";import{q as a,u as t,M as r}from"./useWallets-DTpjk5Rk.mjs";import{b as s,u as n,x as o,o as l}from"./prepareFundingModalData-due26ueW.mjs";import{Connection as i,PublicKey as c,Transaction as m,SystemProgram as d,TransactionInstruction as u,VersionedTransaction as p,TransactionMessage as f}from"@solana/web3.js";import{getSolanaRpcEndpointForCluster as w}from"@privy-io/js-sdk-core";import{u as g}from"./internal-context-mSHyF0Gq.mjs";var h={id:s,getBalance:({address:e,cluster:a})=>new i(w(a)).getBalance(new c(e)),createTransferTransaction:async({from:e,to:a,amount:t,cluster:r})=>{let s=new c(e),n=new m;n.add(d.transfer({fromPubkey:s,toPubkey:new c(a),lamports:t}));let o=new i(w(r)),l=await o.getLatestBlockhash();return n.recentBlockhash=l.blockhash,n.feePayer=s,{transaction:n,connection:o}},createBridgeTransactionFromRelayQuote:async({quote:e,from:a,cluster:t})=>{let r=e.steps[0]?.items?.[0];if(!r)return;let s=r.data.instructions.map((({keys:e,programId:a,data:t})=>new u({keys:e.map((({pubkey:e,isSigner:a,isWritable:t})=>({pubkey:new c(e),isSigner:a,isWritable:t}))),programId:new c(a),data:Buffer.from(t,"hex")}))),n=r.data.addressLookupTableAddresses?.map((e=>new c(e))),o=new i(w(t)),l=await Promise.all((n??[]).map((async e=>o.getAddressLookupTable(e).then((e=>e.value))))),{blockhash:m}=await o.getLatestBlockhash();return{transaction:new p(new f({payerKey:new c(a),instructions:s,recentBlockhash:m}).compileToV0Message(l)),connection:o}}};const k=s=>{n("fundSolanaWallet",s);let i=a(),{setModalData:c}=t(),{openModal:m}=g();return o(h),{fundWallet:e((async(e,a)=>{let t=r.FUNDING_METHOD_SELECTION_SCREEN;c({funding:l({address:e,appConfig:i,fundWalletConfig:a,methodScreen:t})}),m(t)}),[i,c,m])}};export{h as t,k as u};
|