@privy-io/react-auth 1.70.0 → 1.71.0-beta-20240611222124

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/index.js CHANGED
@@ -1,7 +1,7 @@
1
- "use strict";var k0=Object.create;var As=Object.defineProperty;var R0=Object.getOwnPropertyDescriptor;var I0=Object.getOwnPropertyNames;var M0=Object.getPrototypeOf,W0=Object.prototype.hasOwnProperty;var L0=(e,t)=>{for(var r in t)As(e,r,{get:t[r],enumerable:!0})},au=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of I0(t))!W0.call(e,n)&&n!==r&&As(e,n,{get:()=>t[n],enumerable:!(o=R0(t,n))||o.enumerable});return e};var h=(e,t,r)=>(r=e!=null?k0(M0(e)):{},au(t||!e||!e.__esModule?As(r,"default",{value:e,enumerable:!0}):r,e)),O0=e=>au(As({},"__esModule",{value:!0}),e);var ld=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var su=(e,t,r)=>(ld(e,t,"read from private field"),r?r.call(e):t.get(e)),ks=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},cd=(e,t,r,o)=>(ld(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var lu=(e,t,r)=>(ld(e,t,"access private method"),r);var J5={};L0(J5,{AsExternalProvider:()=>to,Captcha:()=>Ol,ConnectorManager:()=>Ri,LoginModal:()=>rd,PrivyClient:()=>Ii,PrivyProvider:()=>$3,PrivyProxyProvider:()=>et,SUPPORTED_CHAINS:()=>Ai,VERSION:()=>Ks,WalletConnector:()=>rr,addRpcUrlOverrideToChain:()=>E0,errorIndicatesMaxMfaRetries:()=>oc,errorIndicatesMfaTimeout:()=>fn,errorIndicatesMfaVerificationFailed:()=>hn,getAccessToken:()=>Me,getEmbeddedConnectedWallet:()=>T0,useConnectWallet:()=>o0,useCreateWallet:()=>i0,useExperimentalFarcasterSigner:()=>b0,useFundWallet:()=>a0,useLinkAccount:()=>t0,useLogin:()=>j3,useLoginWithEmail:()=>Q3,useLoginWithOAuth:()=>J3,useLoginWithSms:()=>X3,useLogout:()=>Z3,useMfa:()=>la,useMfaEnrollment:()=>Zr,useModalStatus:()=>v0,usePrivy:()=>G,useRegisterMfaListener:()=>Bl,useSendTransaction:()=>l0,useSetWalletPassword:()=>d0,useSetWalletRecovery:()=>u0,useSignMessage:()=>f0,useSignTypedData:()=>y0,useToken:()=>w0,useWallets:()=>ya});module.exports=O0(J5);var li=require("@ethersproject/address"),id=require("@ethersproject/providers"),B3=require("mipd"),se=require("react"),H3=require("react-device-detect");var cu=require("ofetch"),ut=class extends Error{constructor(r,o,n){super(r);o instanceof Error&&(this.cause=o),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},Xr=class extends ut{constructor(r,o,n,i,a){super(n,i,a);this.type=r;this.status=o}},E=class extends ut{constructor(r,o,n){super(r,o,n);this.type="client_error"}},Rs=class extends E{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var pe=class extends ut{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},he=e=>{if(e instanceof ut)return e;if(!(e instanceof cu.FetchError))return Bt(e);if(!e.response)return new Xr("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new Xr(t||"ApiError",e.response.status,r||o,e,n)},Bt=e=>e instanceof ut?e:e instanceof Error?new E(e.message,e):new E(`Internal error: ${e}`);var No=class extends E{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},tr=class extends E{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},Is=class extends E{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var Ur=class extends E{constructor(t){super("This application is in development mode and must be upgraded to production to log in new users.",t,"max_accounts_reached")}};var Ms="/api/v1/sessions",Ws="/api/v1/sessions/logout",du="/api/v1/sessions/fork",Ls="/api/v1/sessions/fork/recover",pu="/api/v1/siwe/init",uu="/api/v1/siwe/authenticate",mu="/api/v1/siwe/link",fu="/api/v1/siwe/unlink",hu="/api/v1/farcaster/init",yu="/api/v1/farcaster/authenticate",gu="/api/v1/farcaster/link",vu="/api/v1/farcaster/status",Cu="/api/v1/farcaster/unlink",wu="/api/v1/passwordless/init",bu="/api/v1/passwordless/authenticate",Eu="/api/v1/passwordless/link",Tu="/api/v1/passwordless/unlink",Pu="/api/v1/passwordless/update",Su="/api/v1/passwordless_sms/init",_u="/api/v1/passwordless_sms/link",xu="/api/v1/passwordless_sms/unlink",Au="/api/v1/passwordless_sms/authenticate",ku="/api/v1/oauth/init",Ru="/api/v1/oauth/authenticate",Iu="/api/v1/oauth/link",Mu="/api/v1/oauth/unlink",Wu="/api/v1/recovery/oauth/init",Lu="/api/v1/recovery/oauth/init_icloud",Ou="/api/v1/recovery/oauth/authenticate",Nu="/api/v1/passkeys/link/init",Du="/api/v1/passkeys/authenticate/init",Uu="/api/v1/passkeys/link",Fu="/api/v1/passkeys/authenticate",Bu="/api/v1/passkeys/unlink",Hu="/api/v1/telegram/authenticate",Gu="/api/v1/telegram/link",Vu="/api/v1/telegram/unlink";var zu="/api/v1/mfa/passwordless_sms/init",qu="/api/v1/mfa/passkeys/init",$u="/api/v1/users/me/accept_terms",Os="/api/v1/analytics_events",Ku="/api/v1/plugins/moonpay_on_ramp/sign",ju="/api/v1/custom_jwt_account/authenticate";var fi=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");try{let t=await this.api.post(ju,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw he(t)}}async link(){throw new Error("Unimplemented")}};var nn=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new E("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(bu,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw he(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new E("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(Eu,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw he(t)}}async sendCodeEmail(t,r){if(!this.api)throw new E("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new E("Email must be set when initialzing authentication.");try{return await this.api.post(wu,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw he(o)}}},Ns=class extends nn{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new E("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(Pu,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw he(r)}}};var $s=require("react-device-detect");var dd=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,r){r!==void 0?this._cache[t]=r:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},Ds=class{get(t){let r=localStorage.getItem(t);return r===null?void 0:JSON.parse(r)}put(t,r){r!==void 0?localStorage.setItem(t,JSON.stringify(r)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function pd(){try{let e="privy:__session_storage__test",t="blobby",r=new Ds;return r.put(e,t),r.del(e),!0}catch{return!1}}function N0(){return typeof window<"u"&&window.localStorage?new Ds:new dd}var ne=N0();var hi=require("@ethersproject/providers");function Yu(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let o of t.providers)o&&r.push(o);return r.push(e.ethereum),r}var Us=e=>{if(e.isApexWallet)return"Apex Wallet";if(e.isAvalanche)return"Core Wallet";if(e.isBackpack)return"Backpack";if(e.isBifrost)return"Bifrost Wallet";if(e.isBitKeep)return"BitKeep";if(e.isBitski)return"Bitski";if(e.isBlockWallet)return"BlockWallet";if(e.isBraveWallet)return"Brave Wallet";if(e.isClover)return"Clover";if(e.isCoin98)return"Coin98 Wallet";if(e.isCoinbaseWallet)return"Coinbase Wallet";if(e.isDawn)return"Dawn Wallet";if(e.isDefiant)return"Defiant";if(e.isDesig)return"Desig Wallet";if(e.isEnkrypt)return"Enkrypt";if(e.isExodus)return"Exodus";if(e.isFordefi)return"Fordefi";if(e.isFrame)return"Frame";if(e.isFrontier)return"Frontier Wallet";if(e.isGamestop)return"GameStop Wallet";if(e.isHaqqWallet)return"HAQQ Wallet";if(e.isHyperPay)return"HyperPay Wallet";if(e.isImToken)return"ImToken";if(e.isHaloWallet)return"Halo Wallet";if(e.isKuCoinWallet)return"KuCoin Wallet";if(e.isMathWallet)return"MathWallet";if(e.isNovaWallet)return"Nova Wallet";if(e.isOkxWallet||e.isOKExWallet)return"OKX Wallet";if(e.isOneInchIOSWallet||e.isOneInchAndroidWallet)return"1inch Wallet";if(e.isOneKey)return"OneKey Wallet";if(e.isOpera)return"Opera";if(e.isPhantom)return"Phantom";if(e.isPortal)return"Ripio Portal";if(e.isRabby)return"Rabby Wallet";if(e.isRainbow)return"Rainbow";if(e.isSafePal)return"SafePal Wallet";if(e.isStatus)return"Status";if(e.isSubWallet)return"SubWallet";if(e.isTalisman)return"Talisman";if(e.isTally||e.isTaho)return"Taho";if(e.isTokenPocket)return"TokenPocket";if(e.isTokenary)return"Tokenary";if(e.isTrust||e.isTrustWallet)return"Trust Wallet";if(e.isTTWallet)return"TTWallet";if(e.isXDEFI)return"XDEFI Wallet";if(e.isZeal)return"Zeal";if(e.isZerion)return"Zerion";if(e.isMetaMask)return"MetaMask"};var ud=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||Us(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!ud(r))return!1}return!0},an=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Fs=()=>{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};var Zu=(e,t)=>{let r=[],o=[];for(let[n,i]of e.entries())n<t?r.push(i):o.push(i);return[r,o]},Bs=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,}))$/),Ju=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},sn=(e,t=3,r=4)=>{if(!e)return"";let o=2,n=3;if(t+r+o+n>=e.length)return e;let i=e.slice(0,o+t),a=e.slice(e.length-r,e.length);return`${i}...${a}`},md=e=>new Promise(t=>setTimeout(t,e));function Qu(e,{interval:t=100,timeout:r=5e3}={}){return new Promise((o,n)=>{let i=0,a,l=()=>{if(i>=r){n("Max attempts reached without result");return}if(a=e(),i+=t,a!=null){o(a);return}setTimeout(l,t)};l()})}var Ta=(e,t={})=>{let r=t.delayMs||150,o=t.maxAttempts||270;return new Promise(async(n,i)=>{let a=!1,l=0;for(;!a&&l<o;){if(t.abortSignal?.aborted)return;e().then(s=>{a=!0,n(s)},(...s)=>{a=!0,i(...s)}),l+=1,await md(r)}a||i(new Error("Exceeded max attempts before resolving function"))})},Hs=(e,t,r={},o={})=>{let n=new URL(t,e);for(let[a,l]of Object.entries(r))l!==void 0&&n.searchParams.set(a,l);let i=Object.entries(o);if(i.length>0){let a=new URLSearchParams;for(let[l,s]of i)a.append(l,s);n.hash=a.toString()}return n.href};var Xu=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),Ln=e=>typeof e=="string"?e:"0x"+e.toString(16);async function em(e,t,r,o=3e3){let n=!1,i=window;return new Promise(a=>{i.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout(()=>{l()},o));function l(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",l);let s=e.getProviders(),c=[];for(let u of s)t.includes("coinbase_wallet")&&u.info.rdns==="com.coinbase.wallet"||c.push({type:u.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:u});for(let u of Yu()){let y=Us(u);if(!s.some(f=>f.info.name===y)){if(ud(u,!0)&&!c.find(f=>f.type==="metamask")){c.push({type:"metamask",legacyInjectedProvider:u});continue}if(y==="Phantom"&&!c.find(f=>f.type==="phantom")){c.push({type:"phantom",legacyInjectedProvider:u});continue}if(y==="Coinbase Wallet"&&!c.find(f=>f.type==="coinbase_wallet"&&r?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){c.push({type:"coinbase_wallet",legacyInjectedProvider:u});continue}c.find(f=>f.type==="unknown_browser_extension")||c.push({type:"unknown_browser_extension",legacyInjectedProvider:u})}}a(c)}})}function yi(e){return`eip155:${String(Number(e))}`}var tm=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new pe(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0])a=i.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[n])a=r.rpcUrls[n];else if(i.rpcUrls.privy?.http[0]){let l=new URL(i.rpcUrls.privy.http[0]);l.searchParams.append("privyAppId",o),a=l.toString()}else i.rpcUrls.public?.http[0]?a=i.rpcUrls.public.http[0]:a=i.rpcUrls.default?.http[0];if(!a)throw new pe(`No RPC url found for ${e}`);return a},rm=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new pe(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Do=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new pe(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?a=new hi.StaticJsonRpcProvider(i.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?a=new hi.StaticJsonRpcProvider(r.rpcUrls[n]):i.rpcUrls.privy?.http[0]?a=new hi.StaticJsonRpcProvider({url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):i.rpcUrls.public?.http[0]?a=new hi.StaticJsonRpcProvider(i.rpcUrls.public.http[0]):a=new hi.StaticJsonRpcProvider(i.rpcUrls.default?.http[0]),!a)throw new pe(`No RPC url found for ${e}`);return a},Gs=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map(([o,n])=>{if(n!=null&&typeof o=="string"&&o in t)return{name:o,type:t[o]}}).filter(o=>o!==void 0);return{...e,types:{...e.types,EIP712Domain:r}}};var Vs=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(zs))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var zs={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function D0(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function om(e,t){let r=D0(t);if(r.deepLink)return lm(r.deepLink,e);if(r.universalLink)return cm(r.universalLink,e);throw new E(`Unsupported wallet ${t.id}`)}var nm="WALLETCONNECT_DEEPLINK_CHOICE";function im(){try{localStorage.removeItem(nm)}catch{}}function am({href:e,name:t}){try{localStorage.setItem(nm,JSON.stringify({href:e,name:t}))}catch{}}function sm(e){return e.startsWith("http://")||e.startsWith("https://")}function lm(e,t){if(sm(e))return cm(e,t);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function cm(e,t){if(!sm(e))return lm(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function qs(e,t){window.open(e,t,"noreferrer noopener")}var lt=class{constructor(t){this.promise=null;this.fn=t}execute(t){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(t)}finally{this.promise=null}})()),this.promise}};var Pa=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new lt(this._startChannelOnce.bind(this)),this.pollForReady=new lt(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.channelToken)throw new E("Auth flow must be initialized first");try{let t=await this.api.post(yu,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new E("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw he(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");try{return await this.api.post(gu,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw he(t)}}async _startChannelOnce(){if(!this.api)throw new E("Auth flow has no API instance");let t=await this.api.post(hu,{token:this.captchaToken});$s.isMobile&&!$s.isIOS&&t.connect_uri&&qs(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new E("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.channelToken)throw new E("Auth flow must be initialized first");let t=await this.api.get(vu,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var dm="1.70.0";var pm="34357d3c125c2bcf2ce2bc3309d98715",Sa="https://auth.privy.io",um=2e4,it=1400,mm=2500,Ks=dm;var On="privy:token",fd="privy-token",js="privy:refresh_token",fm="privy-refresh-token",Ys="privy-session",_a="privy:session_transfer_token",F0="privy:wallet",xa="privy:caid",Nn="privy:state_code",Dn="privy:code_verifier",Un="privy:headless_oauth",Zs=e=>`${F0}:${e}`,hd="privy:connectors",yd="privy:connections";var Fn=12e4,Uo=1,gd="0x1",gi=3e4,hm="https://api.moonpay.com/v1",ym="https://api.moonpay.com/v1",gm="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",vm="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",Cm="0x420000000000000000000000000000000000000F",wm=["function getL1Fee(bytes memory _data) external view returns (uint256)"],bm="deprecated";var vd=require("jose");async function Em(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function Tm(e){return crypto.getRandomValues(new Uint8Array(e))}var B0="S256",H0="S256";function Aa(){return vd.base64url.encode(Tm(36))}function Js(){return Aa()}async function Qs(e,t=B0){if(t==H0){let r=await Em(e);return vd.base64url.encode(r)}else return e}function Pm(){let e=ne.get(Dn);if(!e)throw new E("Authentication error.");return e}function Xs(){return!!ne.get(Un)}var Co=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:Xs();this.meta={...t,headless:r}}addCaptchaToken(t){this.meta.captchaToken=t}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new E("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new E("User denied confirmation during OAuth flow");let t=Pm();try{let r=await this.api.post(Ru,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return ne.del(Dn),this.meta.headless&&ne.del(Un),{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user,oauth_provider_tokens:r.oauth_provider_tokens}}catch(r){let o=he(r);throw o.privyErrorCode?new E(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new E("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new E("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new E("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new E("User denied confirmation during OAuth flow");let t=ne.get(Dn);if(!t)throw new E("Authentication error.");try{let r=await this.api.post(Iu,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return ne.del(Dn),r}catch(r){throw he(r)}}async getAuthorizationUrl(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.provider)throw new E("Provider must be set when initializing OAuth authentication.");let t=Aa();ne.put(Dn,t);let r=Js();ne.put(Nn,r);let o=await Qs(t);this.meta.headless&&ne.put(Un,!0);try{return await this.api.post(ku,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw he(n)}}};function Cd(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ka=require("react/jsx-runtime"),el=({style:e,...t})=>(0,ka.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[(0,ka.jsx)("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),(0,ka.jsx)("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});var ln=require("react/jsx-runtime"),tl=({style:e,...t})=>(0,ln.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[(0,ln.jsx)("g",{clipPath:"url(#clip0)",children:(0,ln.jsx)("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),(0,ln.jsx)("defs",{children:(0,ln.jsx)("clipPath",{id:"clip0",children:(0,ln.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var wd=require("react/jsx-runtime"),rl=({style:e,...t})=>(0,wd.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:(0,wd.jsx)("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});var Bn=require("react/jsx-runtime"),ol=({style:e,...t})=>(0,Bn.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,Bn.jsx)("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),(0,Bn.jsx)("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),(0,Bn.jsx)("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),(0,Bn.jsx)("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});var xt=require("react/jsx-runtime");function nl(e){return(0,xt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...e,children:[(0,xt.jsxs)("defs",{children:[(0,xt.jsxs)("linearGradient",{id:"b",children:[(0,xt.jsx)("stop",{offset:"0",stopColor:"#3771c8"}),(0,xt.jsx)("stop",{stopColor:"#3771c8",offset:".128"}),(0,xt.jsx)("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),(0,xt.jsxs)("linearGradient",{id:"a",children:[(0,xt.jsx)("stop",{offset:"0",stopColor:"#fd5"}),(0,xt.jsx)("stop",{offset:".1",stopColor:"#fd5"}),(0,xt.jsx)("stop",{offset:".5",stopColor:"#ff543e"}),(0,xt.jsx)("stop",{offset:"1",stopColor:"#c837ab"})]}),(0,xt.jsx)("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),(0,xt.jsx)("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),(0,xt.jsx)("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,xt.jsx)("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,xt.jsx)("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}var Ra=require("react/jsx-runtime");function il({style:e,...t}){return(0,Ra.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:(0,Ra.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,Ra.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,Ra.jsx)("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}var Ia=require("react/jsx-runtime");function al(e){return(0,Ia.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,Ia.jsx)("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),(0,Ia.jsx)("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}var vi=require("react/jsx-runtime");function sl(e){return(0,vi.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[(0,vi.jsx)("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),(0,vi.jsx)("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),(0,vi.jsx)("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}var bd=require("react/jsx-runtime"),ll=({style:e,...t})=>(0,bd.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:(0,bd.jsx)("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});var G0={google:{name:"Google",component:ol},discord:{name:"Discord",component:tl},github:{name:"Github",component:rl},linkedin:{name:"LinkedIn",component:il},twitter:{name:"Twitter",component:ll},spotify:{name:"Spotify",component:al},instagram:{name:"Instagram",component:nl},tiktok:{name:"Tiktok",component:sl},apple:{name:"Apple",component:el}},Ma=e=>G0[e];function Sm(e,t){let r={detail:"",retryable:!1},o=Cd(t);if(e?.privyErrorCode==="linked_to_another_user"&&(r.detail="This account has already been linked to another user."),e?.privyErrorCode==="invalid_credentials"&&(r.retryable=!0,r.detail="Something went wrong. Try again."),e.privyErrorCode==="oauth_user_denied"&&(r.detail=`Retry and check ${o} to finish connecting your account.`,r.retryable=!0),e?.privyErrorCode==="too_many_requests"&&(r.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("provider rate limit")){let n=Ma(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=Ma(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return r}function Wa(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),o=e.get("privy_oauth_provider");return!t||!r||!o?{inProgress:!1}:{inProgress:!0,authorizationCode:t,stateCode:r,provider:o,headless:Xs(),popupFlow:window.opener!==null}}function Hn(){let e=new URL(window.location.href);e.searchParams.delete("privy_oauth_code"),e.searchParams.delete("privy_oauth_provider"),e.searchParams.delete("privy_oauth_state"),ne.del(Nn),window.history.replaceState({},"",e)}var Gn=class{constructor(t){this.initAuthenticateOnce=new lt(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new lt(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new E("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new E("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new E("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new E("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let r=await t.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options)),o=await this.api.post(Fu,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(r)});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(r){throw r.name==="NotAllowedError"?new E("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):he(r)}}async link(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new E("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new E("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let r=this.meta.initLinkResponse.options,o=await t.startRegistration(this._transformInitLinkOptionsToCamelCase(r));return await this.api.post(Uu,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new E("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):he(r)}}async _initAuthenticateOnce(){if(!this.api)throw new E("Auth flow has no API instance");return await this.api.post(Du,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new E("Auth flow has no API instance");return await this.api.post(Nu,{})}_transformInitLinkOptionsToCamelCase(t){return{rp:t.rp,user:{id:t.user.id,name:t.user.name,displayName:t.user.display_name},challenge:t.challenge,pubKeyCredParams:t.pub_key_cred_params.map(r=>({type:r.type,alg:r.alg})),timeout:t.timeout,excludeCredentials:t.exclude_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports})),authenticatorSelection:{authenticatorAttachment:t.authenticator_selection?.authenticator_attachment,requireResidentKey:t.authenticator_selection?.require_resident_key,residentKey:t.authenticator_selection?.resident_key,userVerification:t.authenticator_selection?.user_verification},attestation:t.attestation,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props?.rk,hmacCreateSecret:t.extensions?.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,attestation_object:t.response.attestationObject,authenticator_data:t.response.authenticatorData},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}_transformInitAuthenticateOptionsToCamelCase(t){return{challenge:t.challenge,allowCredentials:t.allow_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports}))||[],timeout:t.timeout,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props,hmacCreateSecret:t.extensions?.hmac_create_secret},userVerification:t.user_verification}}_transformAuthenticationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,authenticator_data:t.response.authenticatorData,signature:t.response.signature,user_handle:t.response.userHandle},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}};var Vn=class{constructor(t,r){this.createSiweMessage=(t,r,o,n,i,a,l)=>`${o} wants you to sign in with your Ethereum account:
1
+ "use strict";var z0=Object.create;var Os=Object.defineProperty;var q0=Object.getOwnPropertyDescriptor;var $0=Object.getOwnPropertyNames;var K0=Object.getPrototypeOf,j0=Object.prototype.hasOwnProperty;var Y0=(e,t)=>{for(var r in t)Os(e,r,{get:t[r],enumerable:!0})},hu=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of $0(t))!j0.call(e,n)&&n!==r&&Os(e,n,{get:()=>t[n],enumerable:!(o=q0(t,n))||o.enumerable});return e};var y=(e,t,r)=>(r=e!=null?z0(K0(e)):{},hu(t||!e||!e.__esModule?Os(r,"default",{value:e,enumerable:!0}):r,e)),Z0=e=>hu(Os({},"__esModule",{value:!0}),e);var hd=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var yu=(e,t,r)=>(hd(e,t,"read from private field"),r?r.call(e):t.get(e)),Ns=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},yd=(e,t,r,o)=>(hd(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var gu=(e,t,r)=>(hd(e,t,"access private method"),r);var f6={};Y0(f6,{AsExternalProvider:()=>to,Captcha:()=>Hl,ConnectorManager:()=>Li,LoginModal:()=>sd,PrivyClient:()=>Oi,PrivyProvider:()=>a0,PrivyProxyProvider:()=>it,SUPPORTED_CHAINS:()=>Mi,VERSION:()=>tl,WalletConnector:()=>or,addRpcUrlOverrideToChain:()=>D0,errorIndicatesMaxMfaRetries:()=>lc,errorIndicatesMfaTimeout:()=>hn,errorIndicatesMfaVerificationFailed:()=>yn,getAccessToken:()=>Me,getEmbeddedConnectedWallet:()=>U0,useConnectWallet:()=>g0,useCreateWallet:()=>C0,useCrossAppAccounts:()=>b0,useExperimentalFarcasterSigner:()=>N0,useFundWallet:()=>w0,useLinkAccount:()=>h0,useLogin:()=>l0,useLoginWithEmail:()=>u0,useLoginWithOAuth:()=>p0,useLoginWithSms:()=>m0,useLogout:()=>d0,useMfa:()=>ma,useMfaEnrollment:()=>Zr,useModalStatus:()=>W0,usePrivy:()=>H,useRegisterMfaListener:()=>$l,useSendTransaction:()=>T0,useSetWalletPassword:()=>_0,useSetWalletRecovery:()=>A0,useSignMessage:()=>k0,useSignTypedData:()=>I0,useToken:()=>O0,useWallets:()=>ba});module.exports=Z0(f6);var di=require("@ethersproject/address"),ud=require("@ethersproject/providers"),e0=require("mipd"),se=require("react"),t0=require("react-device-detect");var vu=require("ofetch"),mt=class extends Error{constructor(r,o,n){super(r);o instanceof Error&&(this.cause=o),this.privyErrorCode=n}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},Xr=class extends mt{constructor(r,o,n,i,a){super(n,i,a);this.type=r;this.status=o}},b=class extends mt{constructor(r,o,n){super(r,o,n);this.type="client_error"}},Ds=class extends b{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var fe=class extends mt{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},de=e=>{if(e instanceof mt)return e;if(!(e instanceof vu.FetchError))return Ht(e);if(!e.response)return new Xr("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new Xr(t||"ApiError",e.response.status,r||o,e,n)},Ht=e=>e instanceof mt?e:e instanceof Error?new b(e.message,e):new b(`Internal error: ${e}`);var Uo=class extends b{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},rr=class extends b{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},Us=class extends b{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var Fr=class extends b{constructor(t){super("This application is in development mode and must be upgraded to production to log in new users.",t,"max_accounts_reached")}};var Fs="/api/v1/sessions",Bs="/api/v1/sessions/logout",Cu="/api/v1/sessions/fork",Hs="/api/v1/sessions/fork/recover",wu="/api/v1/siwe/init",bu="/api/v1/siwe/authenticate",Eu="/api/v1/siwe/link",Tu="/api/v1/siwe/unlink",Pu="/api/v1/farcaster/init",_u="/api/v1/farcaster/authenticate",Su="/api/v1/farcaster/link",Au="/api/v1/farcaster/status",xu="/api/v1/farcaster/unlink",ku="/api/v1/passwordless/init",Ru="/api/v1/passwordless/authenticate",Iu="/api/v1/passwordless/link",Mu="/api/v1/passwordless/unlink",Wu="/api/v1/passwordless/update",Lu="/api/v1/passwordless_sms/init",Ou="/api/v1/passwordless_sms/link",Nu="/api/v1/passwordless_sms/unlink",Du="/api/v1/passwordless_sms/authenticate",Gs="/api/v1/oauth/init",Uu="/api/v1/oauth/authenticate",Vs="/api/v1/oauth/link",Fu="/api/v1/oauth/unlink",Bu="/api/v1/recovery/oauth/init",Hu="/api/v1/recovery/oauth/init_icloud",Gu="/api/v1/recovery/oauth/authenticate",Vu="/api/v1/passkeys/link/init",zu="/api/v1/passkeys/authenticate/init",qu="/api/v1/passkeys/link",$u="/api/v1/passkeys/authenticate",Ku="/api/v1/passkeys/unlink",ju="/api/v1/telegram/authenticate",Yu="/api/v1/telegram/link",Zu="/api/v1/telegram/unlink";var Ju="/api/v1/mfa/passwordless_sms/init",Qu="/api/v1/mfa/passkeys/init",Xu="/api/v1/users/me/accept_terms",zs="/api/v1/analytics_events",em="/api/v1/plugins/moonpay_on_ramp/sign",tm="/api/v1/custom_jwt_account/authenticate";var yi=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");try{let t=await this.api.post(tm,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw de(t)}}async link(){throw new Error("Unimplemented")}};var an=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new b("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(Ru,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw de(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new b("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(Iu,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw de(t)}}async sendCodeEmail(t,r){if(!this.api)throw new b("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new b("Email must be set when initialzing authentication.");try{return await this.api.post(ku,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw de(o)}}},qs=class extends an{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new b("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(Wu,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw de(r)}}};var el=require("react-device-detect");var gd=class{constructor(){this._cache={}}get(t){return this._cache[t]}put(t,r){r!==void 0?this._cache[t]=r:this.del(t)}del(t){delete this._cache[t]}getKeys(){return Object.keys(this._cache)}},$s=class{get(t){let r=localStorage.getItem(t);return r===null?void 0:JSON.parse(r)}put(t,r){r!==void 0?localStorage.setItem(t,JSON.stringify(r)):this.del(t)}del(t){localStorage.removeItem(t)}getKeys(){return Object.entries(localStorage).map(([t])=>t)}};function vd(){try{let e="privy:__session_storage__test",t="blobby",r=new $s;return r.put(e,t),r.del(e),!0}catch{return!1}}function J0(){return typeof window<"u"&&window.localStorage?new $s:new gd}var ee=J0();var gi=require("@ethersproject/providers");function rm(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let o of t.providers)o&&r.push(o);return r.push(e.ethereum),r}var Ks=e=>{if(e.isApexWallet)return"Apex Wallet";if(e.isAvalanche)return"Core Wallet";if(e.isBackpack)return"Backpack";if(e.isBifrost)return"Bifrost Wallet";if(e.isBitKeep)return"BitKeep";if(e.isBitski)return"Bitski";if(e.isBlockWallet)return"BlockWallet";if(e.isBraveWallet)return"Brave Wallet";if(e.isClover)return"Clover";if(e.isCoin98)return"Coin98 Wallet";if(e.isCoinbaseWallet)return"Coinbase Wallet";if(e.isDawn)return"Dawn Wallet";if(e.isDefiant)return"Defiant";if(e.isDesig)return"Desig Wallet";if(e.isEnkrypt)return"Enkrypt";if(e.isExodus)return"Exodus";if(e.isFordefi)return"Fordefi";if(e.isFrame)return"Frame";if(e.isFrontier)return"Frontier Wallet";if(e.isGamestop)return"GameStop Wallet";if(e.isHaqqWallet)return"HAQQ Wallet";if(e.isHyperPay)return"HyperPay Wallet";if(e.isImToken)return"ImToken";if(e.isHaloWallet)return"Halo Wallet";if(e.isKuCoinWallet)return"KuCoin Wallet";if(e.isMathWallet)return"MathWallet";if(e.isNovaWallet)return"Nova Wallet";if(e.isOkxWallet||e.isOKExWallet)return"OKX Wallet";if(e.isOneInchIOSWallet||e.isOneInchAndroidWallet)return"1inch Wallet";if(e.isOneKey)return"OneKey Wallet";if(e.isOpera)return"Opera";if(e.isPhantom)return"Phantom";if(e.isPortal)return"Ripio Portal";if(e.isRabby)return"Rabby Wallet";if(e.isRainbow)return"Rainbow";if(e.isSafePal)return"SafePal Wallet";if(e.isStatus)return"Status";if(e.isSubWallet)return"SubWallet";if(e.isTalisman)return"Talisman";if(e.isTally||e.isTaho)return"Taho";if(e.isTokenPocket)return"TokenPocket";if(e.isTokenary)return"Tokenary";if(e.isTrust||e.isTrustWallet)return"Trust Wallet";if(e.isTTWallet)return"TTWallet";if(e.isXDEFI)return"XDEFI Wallet";if(e.isZeal)return"Zeal";if(e.isZerion)return"Zerion";if(e.isMetaMask)return"MetaMask"};var Cd=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||Ks(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!Cd(r))return!1}return!0},sn=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),js=()=>{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};var om=(e,t)=>{let r=[],o=[];for(let[n,i]of e.entries())n<t?r.push(i):o.push(i);return[r,o]},Ys=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,}))$/),nm=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},ln=(e,t=3,r=4)=>{if(!e)return"";let o=2,n=3;if(t+r+o+n>=e.length)return e;let i=e.slice(0,o+t),a=e.slice(e.length-r,e.length);return`${i}...${a}`},wd=e=>new Promise(t=>setTimeout(t,e));function im(e,{interval:t=100,timeout:r=5e3}={}){return new Promise((o,n)=>{let i=0,a,s=()=>{if(i>=r){n("Max attempts reached without result");return}if(a=e(),i+=t,a!=null){o(a);return}setTimeout(s,t)};s()})}var xa=(e,t={})=>{let r=t.delayMs||150,o=t.maxAttempts||270;return new Promise(async(n,i)=>{let a=!1,s=0;for(;!a&&s<o;){if(t.abortSignal?.aborted)return;e().then(l=>{a=!0,n(l)},(...l)=>{a=!0,i(...l)}),s+=1,await wd(r)}a||i(new Error("Exceeded max attempts before resolving function"))})},Zs=(e,t,r={},o={})=>{let n=new URL(t,e);for(let[a,s]of Object.entries(r))s!==void 0&&n.searchParams.set(a,s);let i=Object.entries(o);if(i.length>0){let a=new URLSearchParams;for(let[s,l]of i)a.append(s,l);n.hash=a.toString()}return n.href};var am=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),On=e=>typeof e=="string"?e:"0x"+e.toString(16);async function sm(e,t,r,o=3e3){let n=!1,i=window;return new Promise(a=>{i.ethereum?s():(window.addEventListener("ethereum#initialized",s,{once:!0}),setTimeout(()=>{s()},o));function s(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",s);let l=e.getProviders(),c=[];for(let u of l)t.includes("coinbase_wallet")&&u.info.rdns==="com.coinbase.wallet"||c.push({type:u.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:u});for(let u of rm()){let f=Ks(u);if(!l.some(h=>h.info.name===f)){if(Cd(u,!0)&&!c.find(h=>h.type==="metamask")){c.push({type:"metamask",legacyInjectedProvider:u});continue}if(f==="Phantom"&&!c.find(h=>h.type==="phantom")){c.push({type:"phantom",legacyInjectedProvider:u});continue}if(f==="Coinbase Wallet"&&!c.find(h=>h.type==="coinbase_wallet"&&r?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){c.push({type:"coinbase_wallet",legacyInjectedProvider:u});continue}c.find(h=>h.type==="unknown_browser_extension")||c.push({type:"unknown_browser_extension",legacyInjectedProvider:u})}}a(c)}})}function vi(e){return`eip155:${String(Number(e))}`}var lm=(e,t,r,o)=>{let n=Number(e),i=t.find(s=>s.id===n);if(!i)throw new fe(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0])a=i.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[n])a=r.rpcUrls[n];else if(i.rpcUrls.privy?.http[0]){let s=new URL(i.rpcUrls.privy.http[0]);s.searchParams.append("privyAppId",o),a=s.toString()}else i.rpcUrls.public?.http[0]?a=i.rpcUrls.public.http[0]:a=i.rpcUrls.default?.http[0];if(!a)throw new fe(`No RPC url found for ${e}`);return a},cm=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new fe(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Fo=(e,t,r,o)=>{let n=Number(e),i=t.find(s=>s.id===n);if(!i)throw new fe(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?a=new gi.StaticJsonRpcProvider(i.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?a=new gi.StaticJsonRpcProvider(r.rpcUrls[n]):i.rpcUrls.privy?.http[0]?a=new gi.StaticJsonRpcProvider({url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):i.rpcUrls.public?.http[0]?a=new gi.StaticJsonRpcProvider(i.rpcUrls.public.http[0]):a=new gi.StaticJsonRpcProvider(i.rpcUrls.default?.http[0]),!a)throw new fe(`No RPC url found for ${e}`);return a},ka=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map(([o,n])=>{if(n!=null&&typeof o=="string"&&o in t)return{name:o,type:t[o]}}).filter(o=>o!==void 0);return{...e,types:{...e.types,EIP712Domain:r}}};var Js=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(Qs))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var Qs={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function Q0(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function dm(e,t){let r=Q0(t);if(r.deepLink)return hm(r.deepLink,e);if(r.universalLink)return ym(r.universalLink,e);throw new b(`Unsupported wallet ${t.id}`)}var pm="WALLETCONNECT_DEEPLINK_CHOICE";function um(){try{localStorage.removeItem(pm)}catch{}}function mm({href:e,name:t}){try{localStorage.setItem(pm,JSON.stringify({href:e,name:t}))}catch{}}function fm(e){return e.startsWith("http://")||e.startsWith("https://")}function hm(e,t){if(fm(e))return ym(e,t);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function ym(e,t){if(!fm(e))return hm(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function Xs(e,t){window.open(e,t,"noreferrer noopener")}var nt=class{constructor(t){this.promise=null;this.fn=t}execute(t){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(t)}finally{this.promise=null}})()),this.promise}};var Ra=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new nt(this._startChannelOnce.bind(this)),this.pollForReady=new nt(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.channelToken)throw new b("Auth flow must be initialized first");try{let t=await this.api.post(_u,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new b("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw de(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");try{return await this.api.post(Su,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw de(t)}}async _startChannelOnce(){if(!this.api)throw new b("Auth flow has no API instance");let t=await this.api.post(Pu,{token:this.captchaToken});el.isMobile&&!el.isIOS&&t.connect_uri&&Xs(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new b("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.channelToken)throw new b("Auth flow must be initialized first");let t=await this.api.get(Au,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var gm="1.71.0-beta-20240611222124";var vm="34357d3c125c2bcf2ce2bc3309d98715",Ia="https://auth.privy.io",Cm=2e4,et=1400,wm=2500,tl=gm;var Nn="privy:token",bd="privy-token",rl="privy:refresh_token",bm="privy-refresh-token",ol="privy-session",Ma="privy:session_transfer_token",ev="privy:wallet",Wa="privy:caid",La=e=>`privy:cross-app:${e}`,Dn="privy:state_code",Un="privy:code_verifier",Fn="privy:headless_oauth",nl=e=>`${ev}:${e}`,Ed="privy:connectors",Td="privy:connections";var Bn=12e4,Bo=1,Pd="0x1",Ci=3e4,Em="https://api.moonpay.com/v1",Tm="https://api.moonpay.com/v1",Pm="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",_m="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",Sm="0x420000000000000000000000000000000000000F",Am=["function getL1Fee(bytes memory _data) external view returns (uint256)"],xm="deprecated";var _d=require("jose");async function km(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function Rm(e){return crypto.getRandomValues(new Uint8Array(e))}var tv="S256",rv="S256";function Hn(){return _d.base64url.encode(Rm(36))}function wi(){return Hn()}async function bi(e,t=tv){if(t==rv){let r=await km(e);return _d.base64url.encode(r)}else return e}function Im(){let e=ee.get(Un);if(!e)throw new b("Authentication error.");return e}function il(){return!!ee.get(Fn)}var wo=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:il();this.meta={...t,headless:r}}addCaptchaToken(t){this.meta.captchaToken=t}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new b("User denied confirmation during OAuth flow");let t=Im();try{let r=await this.api.post(Uu,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return ee.del(Un),this.meta.headless&&ee.del(Fn),{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user,oauth_provider_tokens:r.oauth_provider_tokens}}catch(r){let o=de(r);throw o.privyErrorCode?new b(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new b("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new b("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new b("User denied confirmation during OAuth flow");let t=ee.get(Un);if(!t)throw new b("Authentication error.");try{let r=await this.api.post(Vs,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return ee.del(Un),r}catch(r){throw de(r)}}async getAuthorizationUrl(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.provider)throw new b("Provider must be set when initializing OAuth authentication.");let t=Hn();ee.put(Un,t);let r=wi();ee.put(Dn,r);let o=await bi(t);this.meta.headless&&ee.put(Fn,!0);try{return await this.api.post(Gs,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw de(n)}}};function Sd(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Oa=require("react/jsx-runtime"),al=({style:e,...t})=>(0,Oa.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[(0,Oa.jsx)("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),(0,Oa.jsx)("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});var cn=require("react/jsx-runtime"),sl=({style:e,...t})=>(0,cn.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[(0,cn.jsx)("g",{clipPath:"url(#clip0)",children:(0,cn.jsx)("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),(0,cn.jsx)("defs",{children:(0,cn.jsx)("clipPath",{id:"clip0",children:(0,cn.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var Ad=require("react/jsx-runtime"),ll=({style:e,...t})=>(0,Ad.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:(0,Ad.jsx)("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});var Gn=require("react/jsx-runtime"),cl=({style:e,...t})=>(0,Gn.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,Gn.jsx)("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),(0,Gn.jsx)("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),(0,Gn.jsx)("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),(0,Gn.jsx)("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});var Rt=require("react/jsx-runtime");function dl(e){return(0,Rt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...e,children:[(0,Rt.jsxs)("defs",{children:[(0,Rt.jsxs)("linearGradient",{id:"b",children:[(0,Rt.jsx)("stop",{offset:"0",stopColor:"#3771c8"}),(0,Rt.jsx)("stop",{stopColor:"#3771c8",offset:".128"}),(0,Rt.jsx)("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),(0,Rt.jsxs)("linearGradient",{id:"a",children:[(0,Rt.jsx)("stop",{offset:"0",stopColor:"#fd5"}),(0,Rt.jsx)("stop",{offset:".1",stopColor:"#fd5"}),(0,Rt.jsx)("stop",{offset:".5",stopColor:"#ff543e"}),(0,Rt.jsx)("stop",{offset:"1",stopColor:"#c837ab"})]}),(0,Rt.jsx)("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),(0,Rt.jsx)("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),(0,Rt.jsx)("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Rt.jsx)("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Rt.jsx)("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}var Na=require("react/jsx-runtime");function pl({style:e,...t}){return(0,Na.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:(0,Na.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,Na.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,Na.jsx)("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}var Da=require("react/jsx-runtime");function ul(e){return(0,Da.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,Da.jsx)("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),(0,Da.jsx)("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}var Ei=require("react/jsx-runtime");function ml(e){return(0,Ei.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[(0,Ei.jsx)("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),(0,Ei.jsx)("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),(0,Ei.jsx)("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}var xd=require("react/jsx-runtime"),fl=({style:e,...t})=>(0,xd.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:(0,xd.jsx)("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});var ov={google:{name:"Google",component:cl},discord:{name:"Discord",component:sl},github:{name:"Github",component:ll},linkedin:{name:"LinkedIn",component:pl},twitter:{name:"Twitter",component:fl},spotify:{name:"Spotify",component:ul},instagram:{name:"Instagram",component:dl},tiktok:{name:"Tiktok",component:ml},apple:{name:"Apple",component:al}},Ua=e=>ov[e];function Mm(e,t){let r={detail:"",retryable:!1},o=Sd(t);if(e?.privyErrorCode==="linked_to_another_user"&&(r.detail="This account has already been linked to another user."),e?.privyErrorCode==="invalid_credentials"&&(r.retryable=!0,r.detail="Something went wrong. Try again."),e.privyErrorCode==="oauth_user_denied"&&(r.detail=`Retry and check ${o} to finish connecting your account.`,r.retryable=!0),e?.privyErrorCode==="too_many_requests"&&(r.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("provider rate limit")){let n=Ua(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=Ua(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return r}function Fa(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),o=e.get("privy_oauth_provider");if(!t||!r||!o)return{inProgress:!1};let n=!1;try{n=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:o,headless:il(),popupFlow:window.opener!==null&&n}}function Vn(){let e=new URL(window.location.href);e.searchParams.delete("privy_oauth_code"),e.searchParams.delete("privy_oauth_provider"),e.searchParams.delete("privy_oauth_state"),ee.del(Dn),window.history.replaceState({},"",e)}var zn=class{constructor(t){this.initAuthenticateOnce=new nt(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new nt(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new b("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new b("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new b("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new b("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let r=await t.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options)),o=await this.api.post($u,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(r)});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(r){throw r.name==="NotAllowedError"?new b("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):de(r)}}async link(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new b("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new b("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let r=this.meta.initLinkResponse.options,o=await t.startRegistration(this._transformInitLinkOptionsToCamelCase(r));return await this.api.post(qu,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new b("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):de(r)}}async _initAuthenticateOnce(){if(!this.api)throw new b("Auth flow has no API instance");return await this.api.post(zu,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new b("Auth flow has no API instance");return await this.api.post(Vu,{})}_transformInitLinkOptionsToCamelCase(t){return{rp:t.rp,user:{id:t.user.id,name:t.user.name,displayName:t.user.display_name},challenge:t.challenge,pubKeyCredParams:t.pub_key_cred_params.map(r=>({type:r.type,alg:r.alg})),timeout:t.timeout,excludeCredentials:t.exclude_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports})),authenticatorSelection:{authenticatorAttachment:t.authenticator_selection?.authenticator_attachment,requireResidentKey:t.authenticator_selection?.require_resident_key,residentKey:t.authenticator_selection?.resident_key,userVerification:t.authenticator_selection?.user_verification},attestation:t.attestation,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props?.rk,hmacCreateSecret:t.extensions?.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,attestation_object:t.response.attestationObject,authenticator_data:t.response.authenticatorData},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}_transformInitAuthenticateOptionsToCamelCase(t){return{challenge:t.challenge,allowCredentials:t.allow_credentials?.map(r=>({id:r.id,type:r.type,transports:r.transports}))||[],timeout:t.timeout,extensions:{appid:t.extensions?.app_id,credProps:t.extensions?.cred_props,hmacCreateSecret:t.extensions?.hmac_create_secret},userVerification:t.user_verification}}_transformAuthenticationResponseToSnakeCase(t){return{id:t.id,raw_id:t.rawId,response:{client_data_json:t.response.clientDataJSON,authenticator_data:t.response.authenticatorData,signature:t.response.signature,user_handle:t.response.userHandle},authenticator_attachment:t.authenticatorAttachment,client_extension_results:{app_id:t.clientExtensionResults.appid,cred_props:t.clientExtensionResults.credProps,hmac_create_secret:t.clientExtensionResults.hmacCreateSecret},type:t.type}}};var qn=class{constructor(t,r){this.createSiweMessage=(t,r,o,n,i,a,s)=>`${o} wants you to sign in with your Ethereum account:
2
2
  ${r}
3
3
 
4
- ${l}
4
+ ${s}
5
5
 
6
6
  URI: ${n}
7
7
  Version: 1
@@ -9,7 +9,7 @@ Chain ID: ${t}
9
9
  Nonce: ${a}
10
10
  Issued At: ${i}
11
11
  Resources:
12
- - https://privy.io`;this.getNonceOnce=new lt(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=r}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");try{let{message:t,signature:r}=await this.sign(),o=await this.api.post(uu,{message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw he(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");try{let{message:t,signature:r}=await this.sign();return await this.api.post(mu,{message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw he(t)}}async sign(){if(!this.api)throw new E("Auth flow has no API instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new E("Could not prepare SIWE message");let t=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async _getNonceOnce(){if(!this.api)throw new E("Auth flow has no API instance");let t=this.wallet.address;return(await this.api.post(pu,{address:t,token:this.captchaToken})).nonce}async buildSiweMessage(){if(!this.api)throw new E("Auth flow has no API instance");let t=this.wallet.address,r=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=this.prepareMessage(r,t,this.nonce),this.preparedMessage}prepareMessage(t,r,o){let n=window.location.host,i=window.location.origin,a="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",l=new Date().toISOString();return this.createSiweMessage(t,r,n,i,l,o,a)}};var zn=class{constructor(t,r){this.meta={phoneNumber:t,captchaToken:r}}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new E("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(Au,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw he(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new E("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(_u,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw he(t)}}async sendSmsCode(t,r){if(!this.api)throw new E("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new E("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(Su,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw he(o)}}};var Ci=class{constructor(t){this.meta={captchaToken:t}}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");try{let t=await this.api.post(Hu,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw he(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");try{return await this.api.post(Gu,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw he(t)}}};function Td(e){let t={detail:"",retryable:!1};return e?.privyErrorCode==="linked_to_another_user"&&(t.detail="This account has already been linked to another user."),e?.privyErrorCode==="disallowed_login_method"&&(t.detail="Login with Telegram not allowed."),e?.privyErrorCode==="invalid_data"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="cannot_link_more_of_type"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="invalid_credentials"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="too_many_requests"&&(t.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("rate limit")&&(t.detail="Request limit reached for Telegram. Please wait a moment and try again."),t}function _m(){let e;if(e=V0(),e)return Ed(),{...e,flowType:"login-url"};if(e=z0(),e)return Ed(),{...e,flowType:"web-app"};Ed()}function V0(){let e=new URLSearchParams(window.location.search),t=Number(e.get("id")||""),r=e.get("hash"),o=Number(e.get("auth_date")||""),n=e.get("first_name"),i=e.get("last_name")||void 0,a=e.get("username")||void 0,l=e.get("photo_url")||void 0;if(!(!t||!n||!o||!r))return{id:t,first_name:n,last_name:i,username:a,photo_url:l,auth_date:o,hash:r}}function z0(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id"),o=t.get("user"),n=Number(t.get("auth_date")||""),i=t.get("hash");if(!(!r||!o||!n||!i))return{query_id:r,user:o,auth_date:n,hash:i}}function Ed(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),window.history.replaceState({},"",e)}var bf=require("uuid");function X(e){return e?new Date(e*1e3):null}function q0(e){let t=[];for(let r of e){let o=r.type;switch(r.type){case"wallet":let n={address:r.address,type:r.type,imported:r.imported,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at),chainType:"ethereum",chainId:r.chain_id,walletClient:r.wallet_client_type==="privy"?"privy":"unknown",walletClientType:r.wallet_client_type,connectorType:r.connector_type,recoveryMethod:r.recovery_method};t.push(n);break;case"email":let i={address:r.address,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(i);break;case"phone":let a={number:r.phoneNumber,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(a);break;case"google_oauth":let l={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(l);break;case"spotify_oauth":let s={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(s);break;case"instagram_oauth":let c={subject:r.subject,username:r.username,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(c);break;case"twitter_oauth":let u={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(u);break;case"discord_oauth":let y={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(y);break;case"github_oauth":let f={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(f);break;case"tiktok_oauth":let v={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(v);break;case"linkedin_oauth":let C={subject:r.subject,name:r.name,email:r.email,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(C);break;case"apple_oauth":let g={subject:r.subject,email:r.email,type:r.type,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(g);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)});break;case"farcaster":let _={type:r.type,fid:r.fid,ownerAddress:r.owner_address,displayName:r.display_name,username:r.username,bio:r.bio,pfp:r.profile_picture_url,url:r.homepage_url,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(_);break;case"passkey":let x={type:r.type,enrolledInMfa:r.enrolled_in_mfa,credentialId:r.credential_id,authenticatorName:r.authenticator_name,createdWithDevice:r.created_with_device,createdWithOs:r.created_with_os,createdWithBrowser:r.created_with_browser,verifiedAt:X(r.verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(x);break;case"telegram":let b={type:r.type,telegramUserId:r.telegram_user_id,firstName:r.first_name,lastName:r.last_name,username:r.username,photoUrl:r.photo_url,verifiedAt:X(r.first_verified_at),firstVerifiedAt:X(r.first_verified_at),latestVerifiedAt:X(r.latest_verified_at)};t.push(b);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function dr(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var He=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported)||null,Pd=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported)||null,$0=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),pr=(e,t)=>t==="all-users"&&!He(e)||t==="users-without-wallets"&&!$0(e)?.length;function Sr(e){if(!e)return null;let t=q0(e.linked_accounts),r=dr(t,"wallet"),o=dr(t,"email"),n=dr(t,"phone"),i=dr(t,"google_oauth"),a=dr(t,"twitter_oauth"),l=dr(t,"discord_oauth"),s=dr(t,"github_oauth"),c=dr(t,"spotify_oauth"),u=dr(t,"instagram_oauth"),y=dr(t,"tiktok_oauth"),f=dr(t,"linkedin_oauth"),v=dr(t,"apple_oauth"),C=dr(t,"farcaster"),g=dr(t,"telegram"),_=e.mfa_methods.map(({type:b,verified_at:A})=>({type:b,verifiedAt:X(A)}));return{id:e.id,createdAt:X(e.created_at),linkedAccounts:t,email:o&&{address:o?.address},phone:n&&{number:n?.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported},google:i&&{subject:i.subject,email:i.email,name:i.name},twitter:a&&{subject:a.subject,username:a.username,name:a.name,profilePictureUrl:a.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:s&&{subject:s.subject,username:s.username,name:s.name,email:s.email},spotify:c&&{subject:c.subject,email:c.email,name:c.name},instagram:u&&{subject:u.subject,username:u.username},tiktok:y&&{subject:y.subject,username:y.username,name:y.name},linkedin:f&&{subject:f.subject,name:f.name,email:f.email},apple:v&&{subject:v.subject,email:v.email},farcaster:C&&{fid:C.fid,ownerAddress:C.ownerAddress,displayName:C.displayName,username:C.username,bio:C.bio,pfp:C.pfp,url:C.url,signerPublicKey:C.signerPublicKey},telegram:g&&{telegramUserId:g.telegramUserId,firstName:g.firstName,lastName:g.lastName,username:g.username,photoUrl:g.photoUrl},mfaMethods:_.map(b=>b.type),hasAcceptedTerms:e.has_accepted_terms??!1}}var Wd=require("@ethersproject/address"),hf=require("@ethersproject/bytes"),yf=h(require("eventemitter3"));var Om=h(require("@coinbase/wallet-sdk"));var La=require("react/jsx-runtime"),Oa=({style:e,...t})=>(0,La.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,La.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,La.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});var ro=require("@ethersproject/address"),Sd=require("@ethersproject/providers"),Lm=h(require("eventemitter3"));var km=h(require("eventemitter3"));var K0=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],xm=e=>K0.includes(e);var Am=require("@ethersproject/logger");var wi=class extends pe{constructor(){super("Wallet timeout");this.type="wallet_error"}},bi=class extends pe{constructor(){super("User rejected connection");this.type="wallet_error"}},eo=e=>{if(e instanceof pe)return e;if(e?.code&&e?.reason){let t=new ct(e);return e.code===Am.ErrorCode.ACTION_REJECTED&&(t.details=Ht.E4001_USER_REJECTED_REQUEST),t}return e?.code?new ct(e):new pe("Unknown connector error",e)},_r=class extends ut{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},ct=class extends _r{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(Ht).find(i=>i.eipCode===o.code);this.details=n||Ht.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=Ht.E32002_CONNECTION_ALREADY_PENDING:this.details=Ht.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=Ht.E32002_WALLET_LOCKED))}},j0={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0}},Y0={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},Z0={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},Ht={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...Z0,...Y0},Fo={...j0,...Ht};var et=class{constructor(t,r){this.removeListener=(t,r)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(t,r)}catch{console.warn("Unable to remove wallet provider listener")}};this.walletTimeout=(t=new wi,r=this.rpcTimeoutDuration)=>new Promise((o,n)=>setTimeout(()=>{n(t)},r));this.setWalletProvider=t=>{this.walletProvider&&this._subscriptions.forEach(r=>{this.removeListener(r.eventName,r.listener)}),this.walletProvider=t,this._subscriptions.forEach(r=>{this.walletProvider?.on(r.eventName,r.listener)})};this.walletProvider=t,this.rpcTimeoutDuration=r||Fn,this._subscriptions=[]}on(t,r){if(this.walletProvider)return this.walletProvider.on(t,r);this._subscriptions.push({eventName:t,listener:r})}async request(t){if(!this.walletProvider)throw new pe(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),this.walletTimeout()]).catch(r=>{throw eo(r)})}},cn=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},Na=class extends km.default{constructor(r,o,n,i,a,l=1){super();this.walletProxy=r,this.address=o,this.chainId=l,this.rpcConfig=n,this.chains=i,this.provider=Do(l,this.chains,n,{appId:a}),this.rpcTimeoutDuration=Ei(n,"privy"),this.appId=a}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new cn(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await Me()||!this.address)throw new cn("Disconnected",4900);return(await Mm(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new cn(`Invalid params for ${r.method}`,4200);let o;if(typeof r.params[0]=="string")o=r.params[0];else if("chainId"in r.params[0]&&typeof r.params[0].chainId=="string")o=r.params[0].chainId;else throw new cn(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=Do(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",o)}async handlePersonalSign(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for personal_sign");let o=r.params[0],n=r.params[1];return await Rm(o,void 0,n)}async handleSignedTypedData(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_signTypedData_v4");let o=typeof r.params[1]=="string"?JSON.parse(r.params[1]):r.params[1];return await Im(Gs(o))}async handleEstimateGas(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_estimateGas");delete r.params[0].gasPrice,delete r.params[0].maxFeePerGas,delete r.params[0].maxPriorityFeePerGas;let o={...r.params[0],chainId:Ln(this.chainId)};try{return await this.provider.send("eth_estimateGas",[o])}catch(n){console.warn(`Gas estimation failed with error: ${n}. Retrying gas estimation by omitting the 'from' address`);try{return delete o.from,await this.provider.send("eth_estimateGas",[o])}catch(i){throw console.warn(`Gas estimation failed with error: ${i} when omitting the 'from' address`),n}}}async request(r){switch(console.debug("Embedded1193Provider.request() called with args",r),r.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return Ln(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(r);case"eth_sendTransaction":return this.handleSendTransaction(r);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(r);case"personal_sign":return this.handlePersonalSign(r);case"eth_signTypedData_v4":return this.handleSignedTypedData(r);default:break}if(xm(r.method)){let o=await Me();if(await Wm(),!o||!this.address)throw new cn("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:o,request:{method:r.method,params:r.params}})).response.data}catch(n){throw console.error(n),new cn("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await Me();if(!r||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:r})).address}catch(o){return console.error(o),null}}},to=class extends et{constructor(r){super(r,r.rpcTimeoutDuration)}},dn=class extends et{constructor(t){super(t,t.rpcTimeoutDuration)}sendAsync(t,r){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var J0=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},rr=class extends Lm.default{constructor(r,o,n,i){super();this.onAccountsChanged=r=>{r.length===0?this.onDisconnect():this.syncAccounts(r)};this.onChainChanged=r=>{this.wallets.forEach(o=>{o.chainId=yi(r),this.walletClientType==="privy"&&ne.put(Zs(o.address),r)}),this.emit("walletsUpdated")};this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")};this.onConnect=()=>{this.connected=!0,this.syncAccounts()};this.wallets=[],this.walletClientType=r,this.chains=o,this.defaultChain=n,this.rpcConfig=i,this.rpcTimeoutDuration=Ei(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,i){let a=async()=>!!this.wallets.find(l=>(0,ro.getAddress)(l.address)===(0,ro.getAddress)(r));return{address:(0,ro.getAddress)(r),chainId:o,meta:n,imported:i,switchChain:async l=>{if(!a)throw new pe("Wallet is not currently connected.");let s=this.wallets.find(v=>(0,ro.getAddress)(v.address)===(0,ro.getAddress)(r))?.chainId;if(!s)throw new pe("Unable to determine current chainId.");let c,u;if(typeof l=="number"?(c=`0x${l.toString(16)}`,u=l):(c=l,u=Number(l)),s===yi(c))return;let y=this.chains.find(v=>v.id===u);if(!y)throw new pe(`Unsupported chainId: ${l}`);let f=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:c}]})};try{return await f()}catch(v){if(J0(v,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:c,chainName:y.name,nativeCurrency:y.nativeCurrency,rpcUrls:[y.rpcUrls.default?.http[0]??""],blockExplorerUrls:[y.blockExplorers?.default.url??""]}]}),f();throw this.walletClientType==="rainbow"&&v.message?.includes("wallet_switchEthereumChain")?new pe(`Rainbow does not support the chainId ${o}`):v}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new pe("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new pe("Wallet is not currently connected.");return new Sd.Web3Provider(new to(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new pe("Wallet is not currently connected.");return new dn(this.proxyProvider)},sign:async l=>{if(!await a())throw new pe("Wallet is not currently connected.");return await this.sign(l)},disconnect:()=>{this.disconnect()}}}async syncAccounts(r){let o=r;try{if(o===void 0){let c=await Ta(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});Array.isArray(c)&&(o=c)}}catch{console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.")}if(!o||!Array.isArray(o)||o.length<=0||!o[0])return;let n=o[0],i=(0,ro.getAddress)(n),a=[],l;if(this.walletClientType==="privy"){let c=ne.get(Zs(i));this.chains.find(u=>u.id===Number(c))||(ne.del(Zs(i)),c=null),l=c||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:l}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${l} on initialization`)}}else try{let c=await Ta(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(typeof c=="string")l=c;else if(typeof c=="number")l=`0x${c.toString(16)}`;else throw new Error("Invalid chainId returned from provider")}catch(c){console.warn(`Failed to get chainId from provider, defaulting to ${gd}`,c),l=gd}let s=yi(l);if(!a.find(c=>(0,ro.getAddress)(c.address)===i)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet((0,ro.getAddress)(n),s,c,this.connectorType==="embedded_imported"))}cl(a,this.wallets)||(this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let r=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((o,n)=>n.connectedAt-o.connectedAt).find(o=>r.find(n=>(0,ro.getAddress)(n)===(0,ro.getAddress)(o.address)))||null}async isConnected(){let r=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(r)&&r.length>0}async sign(r){return await this.connect({showPrompt:!1}),new Sd.Web3Provider(new to(this.proxyProvider)).getSigner().signMessage(r)}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)}};var Q0=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],X0=(e,t)=>e.makeWeb3Provider({options:t}),_d,dl=class extends rr{constructor(r,o,n,i,a,l){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.displayName="Coinbase Wallet";if(this.proxyProvider=new et(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=i.coinbaseWallet.connectionOptions??"eoaOnly",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!_d){let s=[o.id].concat(r.map(u=>u.id)),c=this.connectionOptions!=="eoaOnly"?s.filter(u=>!Q0.includes(u)):[];c.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${c.join(", ")}`),_d=new Om.default({appName:a,appLogoUrl:l,appChainIds:s})}this.proxyProvider.setWalletProvider(X0(_d,this.connectionOptions))}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:Oa,id:"com.coinbase.wallet"}}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new pe("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw eo(r)}}};var xd=require("react/jsx-runtime"),pl=({...e})=>(0,xd.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,xd.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})});var Da=class extends rr{constructor(r,o,n,i,a=!1){super("privy",o,n,i);this.connectorType="embedded";this.proxyProvider=r,a&&(this.connectorType="embedded_imported"),this.subscribeListeners()}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[Ln(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:pl,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var Ad=require("react/jsx-runtime"),Ti=({style:e,...t})=>(0,Ad.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:(0,Ad.jsx)("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"})});var $t=require("react/jsx-runtime"),Pi=({style:e,...t})=>(0,$t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...e},...t,children:[(0,$t.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,$t.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,$t.jsx)("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),(0,$t.jsx)("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),(0,$t.jsx)("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),(0,$t.jsx)("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),(0,$t.jsx)("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),(0,$t.jsx)("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),(0,$t.jsx)("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),(0,$t.jsx)("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),(0,$t.jsx)("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),(0,$t.jsx)("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),(0,$t.jsx)("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});var Ua=require("react/jsx-runtime"),wo=({style:e,...t})=>(0,Ua.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...e},...t,children:[(0,Ua.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,Ua.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});var _i=class extends rr{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new et(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let l=i.provider;this.proxyProvider.setWalletProvider(l)}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new pe("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw eo(r)}}},Si,xi=class extends rr{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";ks(this,Si,void 0);this.proxyProvider=new et(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?cd(this,Si,{name:"MetaMask",icon:Pi,id:"io.metamask"}):a==="phantom"&&cd(this,Si,{name:"Phantom",icon:wo,id:"phantom"})}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return su(this,Si)??{name:"Browser Extension",icon:Ti,id:"extension"}}disconnect(){console.warn("Programmatic disconnect with browser wallets is not yet supported.")}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new pe("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw eo(r)}}};Si=new WeakMap;var ev=require("@ethersproject/address"),tv=require("@ethersproject/providers"),Nm=require("react-device-detect");var ul=class extends _i{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{Nm.isMobile||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let t=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!t||t.length===0||!t[0])throw new pe("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw eo(t)}}};var ml=class extends rr{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new et(void 0,Fn);this.connectorType=r}get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw new Error("connect called for an uninstalled wallet via the NullConnector")}disconnect(){throw new Error("disconnect called for an uninstalled wallet via the NullConnector")}promptConnection(r){throw new Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${r}`)}};var fl=class extends ml{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:wo,id:"phantom"}}};var ki=require("@walletconnect/ethereum-provider"),ff=require("react-device-detect");var Fr=require("react");var Dm=require("react/jsx-runtime");function hl({src:e,...t}){return(0,Dm.jsx)("img",{src:e,...t,style:{display:"none"}})}var bo=require("react"),lf=require("react");var xr={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:pm,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"eoaOnly"}},captchaEnabled:!1,_render:{standalone:!1},fiatOnRamp:{useSandbox:!1}};var Um=({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`");for(let o of e.primary.slice(1))t.includes(o)?console.warn(`Duplicated login method: ${o}`):t.push(o);for(let o of e.overflow??[])!t.includes(o)&&!r.includes(o)?r.push(o):console.warn(`Duplicated login method: ${o}`);return{primary:t,overflow:r}};var rv=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet"]),Fm=e=>rv.has(e),Bm=(e,t,r)=>r.indexOf(e)===t,Hm=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Fm).filter(Bm):e?e.filter(Fm).filter(Bm):xr.appearance.walletList;var yl={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}};var gl={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0};var vl={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0};var Gm={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}};var Vm={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0};var Cl={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}},testnet:!0};var wl={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0};var bl={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0};var zm={id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0};var qm={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1};var $m={id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0};var Km={id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}};var jm={id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}};var Ym={id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}};var Zm={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},testnet:!0};var Jm={id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}};var Qm={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1};var Xm={id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0};var El={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}};var Tl={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}};var Pl={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0};var Sl={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0};var Fa={id:137,name:"Polygon Mainnet",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}};var Ba={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0};var ef={id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}};var tf={id:17001,name:"Redstone Holesky",network:"redstone-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.holesky.redstone.xyz"]},public:{http:["https://rpc.holesky.redstone.xyz"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"},default:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"}}};var rf={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0};var _l={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}};var xl={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0};var Al={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0};var Ai=[yl,gl,vl,Zm,rf,El,Tl,Pl,Sl,Fa,Ba,qm,$m,Km,jm,Cl,wl,bl,zm,Qm,Xm,Gm,Vm,_l,Al,xl,Jm,ef,Ym,tf],z8=new Set(Ai.map(e=>e.id));var pn=h(require("tinycolor2")),of="#FFFFFF",ov="#000000",nv=of,iv="#1E1E1D";function av(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}function Bo(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,pn.default)({...e.toHsl(),l:r})}function nf({backgroundTheme:e,accentHex:t,successHex:r="#51BA81",warnHex:o="#FFB74D",errorHex:n="#EC6351",whiteHex:i=of,blackHex:a=ov}){let l;switch(e){case"light":l=nv;break;case"dark":l=iv;break;default:l=e;break}let s=(0,pn.default)(l),c=(0,pn.default)(t),u=(0,pn.default)(r),y=(0,pn.default)(o),f=(0,pn.default)(n),v=av(s.getLuminance()),C=Bo(s,v==="light"?-.04:.11),g=Bo(s,v==="light"?-.88:.87),_=Bo(s,v==="light"?-.77:.75),x=Bo(s,v==="light"?-.43:.45).desaturate(v==="light"?60:20),b=Bo(s,v==="light"?-.08:.25).desaturate(v==="light"?60:20),A=Bo(c,.15),R=Bo(c,-.06),U=Bo(f,.3),M=(0,pn.default)(c.getLuminance()>.5?a:i),I=Bo(u,-.16);return{colorScheme:v,background:s.toHslString(),background2:C.toHslString(),foreground:g.toHslString(),foreground2:_.toHslString(),foreground3:x.toHslString(),foreground4:b.toHslString(),accent:c.toHslString(),accentLight:A.toHslString(),accentDark:R.toHslString(),foregroundAccent:M.toHslString(),success:u.toHslString(),successDark:I.toHslString(),error:f.toHslString(),errorLight:U.toHslString(),warn:y.toHslString()}}function kd(e,t,r){let o=r?console.warn:()=>{},n,i,a,l,s,c,u,y,f,v,C,g,_,x,b;t?.loginMethods?(n=t.loginMethods.includes("email"),i=t.loginMethods.includes("sms"),l=t.loginMethods.includes("wallet"),s=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),u=t.loginMethods.includes("discord"),f=t.loginMethods.includes("spotify"),v=t.loginMethods.includes("instagram"),y=t.loginMethods.includes("tiktok"),g=t.loginMethods.includes("github"),C=t.loginMethods.includes("linkedin"),_=t.loginMethods.includes("apple"),x=t.loginMethods.includes("farcaster"),b=t.loginMethods.includes("telegram")):(n=e.emailAuth,i=e.smsAuth,l=e.walletAuth,s=e.googleOAuth,c=e.twitterOAuth,u=e.discordOAuth,g=e.githubOAuth,f=e.spotifyOAuth,v=e.instagramOAuth,y=e.tiktokOAuth,C=e.linkedinOAuth,_=e.appleOAuth,x=e.farcasterAuth,b=e.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?a=!1:e.passkeyAuth&&(a=!0);let A=[n,i].filter(Boolean),R=[s,c,u,g,f,v,y,C,_,x,b].filter(Boolean),U=[l].filter(Boolean);if(A.length+R.length+U.length===0)throw new Error("You must enable at least one login method");let M=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;M&&U.length===0?(o("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),M=!1):!M&&R.length+A.length===0&&(o("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),M=!0),t?.loginMethods&&t.loginMethodsAndOrder&&o("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let I=Hm({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),V=Um({input:t?.loginMethodsAndOrder}),j=t?.intl?.defaultCountry??"US",{chains:te,defaultChain:L}=sv({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),z=!!t?.defaultChain,O=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,ye,we=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?O?ye=t?.embeddedWallets?.noPromptOnSignature??!0:ye=t?.embeddedWallets?.noPromptOnSignature??we:ye=we,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&ye!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:be,...Ne}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??xr.appearance.landingHeader,loginMessage:typeof t?.appearance?.loginMessage=="string"?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:nf({backgroundTheme:t?.appearance?.theme??xr.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??xr.appearance.accentColor}),loginGroupPriority:M?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:I},loginMethods:{wallet:l,email:n,sms:i,passkey:a,google:s,twitter:c,discord:u,github:g,spotify:f,instagram:v,tiktok:y,linkedin:C,apple:_,farcaster:x,telegram:b},loginMethodsAndOrder:V,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??xr.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??xr.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??xr.rpcConfig.rpcTimeouts},chains:te,defaultChain:L,intl:{defaultCountry:j},shouldEnforceDefaultChainOnConnect:z,captchaEnabled:e.captchaEnabled??xr.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??xr.externalWallets.coinbaseWallet.connectionOptions}},embeddedWallets:{...e.embeddedWalletConfig,...typeof be=="boolean"?{requireUserOwnedRecoveryOnCreate:be}:{},...O?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...Ne,noPromptOnSignature:ye},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:O?{enabled:!0,...t.customAuth}:void 0,fiatOnRamp:{enabled:e.fiatOnRampEnabled,useSandbox:t?.fiatOnRamp?.useSandbox??xr.fiatOnRamp.useSandbox},loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1,telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??xr._render.standalone}}}function af(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:n,defaultChain:i,...a}=e;return{...a,...o?{additionalChains:o.map(s=>s.id)}:void 0,...n?{supportedChains:n.map(s=>s.id)}:void 0,...i?{defaultChain:i.id}:void 0,legacyCreateEmbeddedWalletFlag:t}}function sv({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:o}){let n;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(t.length===0)throw new Error("`supportedChains` must contain at least one chain");t.filter(s=>s.rpcUrls.privyWalletOverride).length>0&&o&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),n=t.map(s=>s.rpcUrls.privyWalletOverride?s:Ai.find(u=>u.id===s.id)??s)}else n=Ai.concat(e??[]);let i=t?n[0]:El,a=r??i;if(!n.find(l=>l.id===a.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:a}}var sf=function(e,t=0){let r=3735928559^t,o=1103547991^t;for(let n=0,i;n<e.length;n++)i=e.charCodeAt(n),r=Math.imul(r^i,2654435761),o=Math.imul(o^i,1597334677);return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(o^o>>>13,3266489909),o=Math.imul(o^o>>>16,2246822507),o^=Math.imul(r^r>>>13,3266489909),4294967296*(2097151&o)+(r>>>0)};var pf=require("react/jsx-runtime"),cf={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""},Rd=kd(cf,void 0,!1),Id=(0,lf.createContext)({appConfig:Rd,isServerConfigLoaded:!1}),df=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:o})=>{let[n,i]=(0,bo.useState)(null),a=(0,bo.useMemo)(()=>kd(n??cf,o,!!n),[n,o]);return(0,bo.useEffect)(()=>{if(!n)return;let l=af(o,t),s=sf(JSON.stringify(l)).toString(),c=`privy:sent:${n.id}:${s}`;localStorage.getItem(c)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:l}),localStorage.setItem(c,"t"))},[o,t,n]),(0,bo.useEffect)(()=>{n||(async()=>{try{let s=await r.getServerConfig();s.customApiUrl&&r.updateApiUrl(s.customApiUrl),i(s)}catch(s){console.warn("Error generating app config: ",s)}})()},[]),(0,pf.jsx)(Id.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},Kt=()=>{let{appConfig:e}=(0,bo.useContext)(Id);return e},kl=()=>{let{isServerConfigLoaded:e}=(0,bo.useContext)(Id);return e};var T=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var Rl=require("react/jsx-runtime"),uf=(0,Fr.createContext)({ready:!1,app:Rd,currentScreen:null,lastScreen:null,navigate:T,navigateBack:T,resetNavigation:T,setModalData:T,onUserCloseViaDialogOrKeybindRef:void 0}),lv=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],mf=e=>{let t=Kt(),r=e.authenticated,[o,n]=(0,Fr.useState)(e.initialScreen);(0,Fr.useEffect)(()=>{!r&&!lv.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=(0,Fr.useRef)(null);(0,Fr.useEffect)(()=>{e.open||(i.current=null)},[e.open]),(0,Fr.useEffect)(()=>{i.current=null},[e.initialScreen]);let a={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:o,navigate:(l,s=!0)=>{e.setInitialScreen(l),s&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(o)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:i};return(0,Rl.jsxs)(uf.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&(0,Rl.jsx)(hl,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},k=()=>(0,Fr.useContext)(uf);var Ho=require("react/jsx-runtime"),Ha=({style:e,...t})=>{let{app:r}=k();return(0,Ho.jsxs)("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:[(0,Ho.jsx)("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,Ho.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,Ho.jsx)("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"})}),(0,Ho.jsx)("defs",{children:(0,Ho.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,Ho.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var Eo=class extends rr{constructor(r,o,n,i,a,l,s,c){super(c||"unknown",n,i,o);this.connectorType="wallet_connect_v2";this.privyAppId=l,this.privyAppName=s,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new et(void 0,this.rpcTimeoutDuration),c&&(this.walletEntry=zs[c],this.walletClientType=c)}async initialize(){let r=await this.createProvider();if(this.provider=r,this.proxyProvider.setWalletProvider(r),this.subscribeListeners(),r.session){if(this.walletProvider?.session?.peer.metadata.url){let n=Vs(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=n?.entry,this.walletClientType=n?.walletClientType||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:o}=await import("@walletconnect/modal");this.modal=new o({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(n=>{!n.open&&!this.walletProvider?.session&&this.onQrModalClosed&&this.onQrModalClosed()})}async connect(r){return r.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){return this.walletClientType==="metamask"?{name:"MetaMask",icon:Pi,id:"io.metamask"}:{name:Xu(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Ha,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(r){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletEntry=zs[r],this.walletClientType=r,this.redirectUri=void 0,im(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new bi)};this.onQrModalClosed=n,(async()=>{let a="",l=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(l?.length&&(a=l[0]),!a||a==="")throw new pe("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=Vs(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Ei(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(a=>{if(a){o(eo(a));return}o(new pe("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(r){this.proxyProvider.setWalletProvider(r)}async createProvider(){let r={};for(let a of this.chains){let l=tm(a.id,this.chains,this.rpcConfig,this.privyAppId);l&&(r[a.id]=l)}let o=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(a=>a.id),i=await ki.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:ki.OPTIONAL_EVENTS,optionalMethods:ki.OPTIONAL_METHODS,rpcMap:r,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),ff.isMobile&&this.walletEntry){let{redirect:l,href:s}=om(a,this.walletEntry);am({href:s,name:this.walletEntry.displayName}),this.redirectUri=l,qs(l,"_self")}else this.modal?.openModal({uri:a,chains:[this.defaultChain.id]})}),i.on("connect",()=>{if(this.modal?.closeModal(),i.session?.peer.metadata.url){let a=Vs(i.session?.peer.metadata.url);this.walletEntry=a?.entry,this.walletClientType=a?.walletClientType||"unknown"}}),i}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await this.walletProvider?.enable()}};var Ld=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>(0,hf.isHexString)(o)).map(o=>(0,Wd.getAddress)(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},Ei=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||Fn:Fn,Ri=class extends yf.default{constructor(r,o,n,i,a,l,s,c,u,y,f){super();this.getEthereumProvider=()=>{let r=this.wallets[0],o=this.walletConnectors.find(n=>n.wallets.find(i=>i.address===r?.address));return!r||!o?new et:o.proxyProvider};this.privyAppId=r,this.walletConnectCloudProjectId=o,this.rpcConfig=n,this.chains=i,this.defaultChain=a,this.walletConnectors=[],this.initialized=!1,this.store=l,this.walletList=s,this.shouldEnforceDefaultChainOnConnect=c,this.externalWalletConfig=u,this.privyAppName=y,this.privyAppLogo=f,this.storedConnections=Md()}get wallets(){let r=new Set,o=this.walletConnectors.flatMap(i=>i.wallets).sort((i,a)=>i.connectedAt&&a.connectedAt?a.connectedAt-i.connectedAt:0).filter(i=>{let a=`${i.address}${i.walletClientType}${i.connectorType}`;return r.has(a)?!1:(r.add(a),!0)}),n=o.findIndex(i=>i.address===(this.activeWallet?this.activeWallet:"unknown"));return n>=0&&o.unshift(o.splice(n,1)[0]),o}async initialize(){if(this.initialized)return;ne.get(hd)&&(ne.getKeys().forEach(o=>{o.startsWith("walletconnect")&&ne.del(o)}),ne.del(hd));let r=em(this.store,this.walletList,this.externalWalletConfig).then(o=>{o.forEach(({type:n,eip6963InjectedProvider:i,legacyInjectedProvider:a})=>{this.createWalletConnector("injected",n,{eip6963InjectedProvider:i,legacyInjectedProvider:a})})});this.walletList.includes("coinbase_wallet")&&this.createWalletConnector("coinbase_wallet","coinbase_wallet"),!an()&&this.walletList.includes("phantom")&&this.createWalletConnector("phantom","phantom"),this.createWalletConnector("wallet_connect_v2","unknown"),await r,this.initialized=!0}findWalletConnector(r,o){return r==="wallet_connect_v2"?this.walletConnectors.find(n=>n.connectorType===r)??null:this.walletConnectors.find(n=>n.connectorType===r&&n.walletClientType===o)??null}onInitialized(r){r.wallets.forEach(o=>{let n=this.storedConnections.find(i=>i.address===o.address&&i.connectorType===o.connectorType&&i.walletClientType===o.walletClientType);n&&(o.connectedAt=n.connectedAt)}),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(r){r.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new Na(r,o,this.rpcConfig,this.chains,i,n.id),s=new Da(l,this.chains,n,this.rpcConfig);this.addWalletConnector(s)}}addImportedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded_imported","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new Na(r,o,this.rpcConfig,this.chains,i,n.id),s=!0,c=new Da(l,this.chains,n,this.rpcConfig,s);this.addWalletConnector(c)}}removeEmbeddedWalletConnector(){let r=this.findWalletConnector("embedded","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=Md(),this.emit("walletsUpdated")}}removeImportedWalletConnector(){let r=this.findWalletConnector("embedded_imported","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=Md(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let i=this.findWalletConnector(r,o);if(i)return i instanceof Eo&&i.resetConnection(o),i;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new ul(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new xi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new xi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new xi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new _i(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new dl(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new fl(this.defaultChain):new Eo(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,o)})();return l&&this.addWalletConnector(l),l||null}addWalletConnector(r){this.walletConnectors.push(r),r.on("initialized",()=>this.onInitialized(r)),r.on("walletsUpdated",()=>this.onWalletsUpdated(r)),r.initialize().catch(o=>{console.debug("Failed to initialize connector",o)})}saveConnectionHistory(){let r=this.wallets.map(o=>({address:o.address,connectorType:o.connectorType,walletClientType:o.walletClientType,connectedAt:o.connectedAt}));ne.put(yd,r)}async activeWalletSign(r){let o=this.wallets,n=o.length>0?o[0]:null;return n?n.sign(r):null}setActiveWallet(r){this.activeWallet=(0,Wd.getAddress)(r),this.emit("walletsUpdated")}};function cl(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let o=e[r],n=t[r];if(o?.address!==n?.address||o?.chainId!==n?.chainId||o?.connectorType!==n?.connectorType||o?.connectedAt!==n?.connectedAt||o?.walletClientType!==n?.walletClientType||o?.isConnected!==n?.isConnected||o?.linked!==n?.linked)return!1}return!0}var cv=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",Md=()=>{let e=ne.get(yd);return e&&Array.isArray(e)&&e.map(o=>cv(o)).every(Boolean)?e:[]};var gf=require("ofetch");var dv=[Ms,Ls,Ws,Os],Il=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=Ks,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=gf.ofetch.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:i,options:a})=>{let l=new Headers(a.headers);l.set("privy-app-id",this.appId),this.appClientId&&l.set("privy-client-id",this.appClientId),l.set("privy-ca-id",this.clientAnalyticsId||""),l.set("privy-client",`react-auth:${this.sdkVersion}`);let s=dv.includes(i.toString());if(!l.has("authorization")){let c=await this.client.getAccessToken({disableAutoRefresh:s});c!==null&&l.set("authorization",`Bearer ${c}`)}a.headers=l,a.retryDelay&&(a.retryDelay=a.retryDelay*3)},onRequestError:({error:i})=>{if(i instanceof DOMException&&i.name==="AbortError")throw new Rs}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw he(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw he(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw he(o)}}};var vf=e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map(t=>({id:t.id,type:t.type,transports:t.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification});var qn=h(require("js-cookie"));function Cf(e){return e instanceof nn?"email":e instanceof zn?"sms":e instanceof Vn?"siwe":e instanceof fi?"custom_auth":e instanceof Co?e.meta.provider:null}var wf=h(require("jose")),To=class{static parse(t){try{return new To(t)}catch{return null}}constructor(t){this.value=t,this._decoded=wf.decodeJwt(t)}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(t=0){let r=Date.now(),o=(this.expiration-t)*1e3;return r>=o}};var pv=30,Ml=class{constructor(){this.authenticateOnce=new lt(async t=>this._authenticate(t)),this.linkOnce=new lt(async t=>this._link(t)),this.refreshOnce=new lt(this._refresh.bind(this)),this.destroyOnce=new lt(this._destroy.bind(this)),this.forkSessionOnce=new lt(this._forkSession.bind(this))}get token(){try{let t=ne.get(On);return typeof t=="string"?new To(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=ne.get(js);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=ne.get(_a);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get mightHaveServerCookies(){try{let t=qn.default.get(Ys);return t!==void 0&&t.length>0}catch(t){console.error(t)}return!1}hasRefreshCredentials(){return this.mightHaveServerCookies||typeof this.token=="string"&&typeof this.refreshToken=="string"&&this.refreshToken!==bm}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=To.parse(this.token);return t!==null&&!t.isExpired(pv)}authenticate(t){return this.authenticateOnce.execute(t)}link(t){return this.linkOnce.execute(t)}refresh(){return this.refreshOnce.execute()}forkSession(){return this.forkSessionOnce.execute()}destroy(){return this.destroyOnce.execute()}async _authenticate(t){try{let r=await t.authenticate(),{user:o,is_new_user:n,oauth_provider_tokens:i}=r;this.handleTokenResponse(r);let a=i?{provider:i.provider,accessToken:i.access_token,accessTokenExpiresInSeconds:i.access_token_expires_in_seconds,refreshToken:i.refresh_token,scopes:i.scopes}:void 0,l=Cf(t);return l&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:l,isNewUser:n}}),l==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}}),{user:Sr(o),isNewUser:n,oAuthProviderTokens:a}}catch(r){throw console.warn("Error authenticating session"),Bt(r)}}async _link(t){try{let r=await t.link(),o=r.oauth_provider_tokens,n=o?{provider:o.provider,accessToken:o.access_token,accessTokenExpiresInSeconds:o.access_token_expires_in_seconds,refreshToken:o.refresh_token,scopes:o.scopes}:void 0;return{user:Sr(r),oAuthProviderTokens:n}}catch(r){throw console.warn("Error linking account"),Bt(r)}}async _refresh(){if(!this.api)throw new E("Session has no API instance");if(!this.client)throw new E("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let t=this.token,r=this.refreshToken,o=this.forkedToken;try{let n;if(t&&r||this.mightHaveServerCookies){let i={};t&&(i.authorization=`Bearer ${t}`);let a=r?{refresh_token:r}:{};n=await this.api.post(Ms,a,{headers:i}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(Ls,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),Sr(n.user)}catch(n){if(n instanceof Xr&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw Bt(n)}}handleTokenResponse(t){t.session_update_action?t.session_update_action==="set"?(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token)):t.session_update_action==="clear"?this.destroyLocalState():t.session_update_action==="ignore"&&t.token&&this.storeToken(t.token):(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token))}async _destroy(){try{await this.api?.post(Ws,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new E("Session has no API instance");let t=this.refreshToken;try{let r=await this.api.post(du,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw Bt(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=ne.get(On);if(ne.put(On,t),!this.client?.useServerCookies){let o=To.parse(t)?.expiration;qn.default.set(fd,t,{sameSite:"Strict",secure:!0,expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else ne.del(On),qn.default.remove(fd),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(ne.put(js,t),this.client?.useServerCookies||qn.default.set(Ys,"t",{sameSite:"Strict",secure:!0,expires:30})):(ne.del(js),qn.default.remove(fm),qn.default.remove(Ys))}clearForkedToken(){ne.del(_a)}};var Od,Wl,Ef,Ii=class{constructor(t){ks(this,Wl);this.apiUrl=t.apiUrl||Sa,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!1,this.timeout=t.timeout||um,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=lu(this,Wl,Ef).call(this),Od||(Od=new Ml),this.session=Od,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:t,rpcConfig:r,chains:o,defaultChain:n,store:i,walletList:a,shouldEnforceDefaultChainOnConnect:l,externalWalletConfig:s,appName:c}){this.connectors||(this.connectors=new Ri(this.appId,t,r,o,n,i,a,l,s,c))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new Il({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=t,t}updateApiUrl(t){this.apiUrl=t||this.fallbackApiUrl,this.api=this.generateApi(),t&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new E("No auth flow in progress.");return this.session.authenticate(this.authFlow)}link(){if(!this.authFlow)throw new E("No auth flow in progress.");return this.session.link(this.authFlow)}async logout(){await this.session.destroy(),this.authFlow=void 0}startAuthFlow(t){return t.api=this.api,this.authFlow=t,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(zu,{action:"verify"})}catch(t){throw he(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(qu,{});return vf(t.options)}catch(t){throw he(t)}}async unlinkEmail(t){try{let r=await this.api.post(Tu,{address:t});return Sr(r)}catch(r){throw Bt(r)}}async acceptTerms(){try{let t=await this.api.post($u,{});return Sr(t)}catch(t){throw Bt(t)}}async unlinkPhone(t){try{let r=await this.api.post(xu,{phoneNumber:t});return Sr(r)}catch(r){throw Bt(r)}}async unlinkWallet(t){try{let r=await this.api.post(fu,{address:t});return Sr(r)}catch(r){throw Bt(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Mu,{provider:t,subject:r});return Sr(o)}catch(o){throw Bt(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(Cu,{fid:t});return Sr(r)}catch(r){throw Bt(r)}}async unlinkTelegram(t){try{let r=await this.api.post(Vu,{telegram_user_id:t});return Sr(r)}catch(r){throw Bt(r)}}async unlinkPasskey(t){try{let r=await this.api.post(Bu,{credential_id:t});return Sr(r)}catch(r){throw Bt(r)}}async createAnalyticsEvent({eventName:t,payload:r,timestamp:o,options:n}){if(!(typeof window>"u"))try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(Os,{event_name:t,client_id:this.clientAnalyticsId,payload:{...r||{},clientTimestamp:o?o.toISOString():new Date().toISOString()}},{retry:-1,keepalive:n?.keepAlive??!1})}catch{}}async signMoonpayOnRampUrl(t){try{return this.api.post(Ku,t)}catch(r){throw Bt(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?To.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:!t?.disableAutoRefresh&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getServerConfig(){try{let t={},r=this.session.token;r&&(t.authorization=`Bearer ${r}`);let o=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:t}),n=o.telegram_auth_config?{botId:o.telegram_auth_config.bot_id,botName:o.telegram_auth_config.bot_name,linkEnabled:o.telegram_auth_config.link_enabled,seamlessAuthEnabled:o.telegram_auth_config.seamless_auth_enabled}:void 0;return{id:o.id,name:o.name,verificationKey:o.verification_key,logoUrl:o.logo_url||void 0,accentColor:o.accent_color||void 0,showWalletLoginFirst:o.show_wallet_login_first,allowlistConfig:{errorTitle:o.allowlist_config.error_title,errorDetail:o.allowlist_config.error_detail,errorCtaText:o.allowlist_config.cta_text,errorCtaLink:o.allowlist_config.cta_link},walletAuth:o.wallet_auth,emailAuth:o.email_auth,smsAuth:o.sms_auth,googleOAuth:o.google_oauth,twitterOAuth:o.twitter_oauth,discordOAuth:o.discord_oauth,githubOAuth:o.github_oauth,spotifyOAuth:o.spotify_oauth,instagramOAuth:o.instagram_oauth,tiktokOAuth:o.tiktok_oauth,linkedinOAuth:o.linkedin_oauth,appleOAuth:o.apple_oauth,farcasterAuth:o.farcaster_auth,passkeyAuth:o.passkey_auth,telegramAuth:o.telegram_auth,termsAndConditionsUrl:o.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:o.embedded_wallet_config?.create_on_login,userOwnedRecoveryOptions:o.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:o.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:o.privacy_policy_url,requireUsersAcceptTerms:o.require_users_accept_terms,customApiUrl:o.custom_api_url,walletConnectCloudProjectId:o.wallet_connect_cloud_project_id,fiatOnRampEnabled:o.fiat_on_ramp_enabled,captchaEnabled:o.captcha_enabled,captchaSiteKey:o.captcha_site_key,twitterOAuthOnMobileEnabled:o.twitter_oauth_on_mobile_enabled,createdAt:new Date(o.created_at*1e3),updatedAt:new Date(o.updated_at*1e3),mfaMethods:o.mfa_methods,enforceWalletUis:o.enforce_wallet_uis,legacyWalletUiConfig:o.legacy_wallet_ui_config,telegramAuthConfiguration:n}}catch(t){throw Bt(t)}}async getUsdTokenPrice(t){try{return(await this.api.get(`/api/v1/token_price?chainId=${t.id}&tokenSymbol=${t.nativeCurrency.symbol}`)).usd}catch{console.error(`Unable to fetch token price for chain with id ${t.id}`);return}}async requestFarcasterSignerStatus(t){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:t})}catch(r){throw console.error("Unable to fetch Farcaster signer status"),r}}async forkSession(){return await this.session.forkSession()}};Wl=new WeakSet,Ef=function(){if(typeof window>"u")return null;try{let r=ne.get(xa);if(typeof r=="string"&&r.length>0)return r}catch{}let t=(0,bf.v4)();try{return ne.put(xa,t),t}catch{return t}};var _f=require("@marsidev/react-turnstile"),Ll=require("react");var Br=require("react");var Sf=require("react/jsx-runtime"),Tf=(0,Br.createContext)({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:T,setError:T,setExecuting:T,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:T,reset:T,execute:T}),oo=class extends ut{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},Pf=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=(0,Br.useRef)(null),[i,a]=(0,Br.useState)(),[l,s]=(0,Br.useState)(),[c,u]=(0,Br.useState)(!1),y=(0,Br.useMemo)(()=>o?!c&&!i&&!l?{status:"ready"}:c&&!i&&!l?{status:"loading"}:i&&!l?{status:"success",token:i}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[o,i,l,c]);return(0,Sf.jsx)(Tf.Provider,{value:{...y,ref:n,enabled:o,siteKey:r,appId:t,setToken:a,setError:s,setExecuting:u,remove(){o&&(n.current?.remove(),u(!1),s(void 0),a(void 0))},reset(){o&&(n.current?.reset(),u(!1),s(void 0),a(void 0))},execute(){o&&(u(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await Qu(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new oo("Captcha failed",null,"captcha_timeout")}}},children:e})},_e=()=>(0,Br.useContext)(Tf);var Nd=require("react/jsx-runtime"),Ol=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=_e(),[,s]=(0,Ll.useMemo)(()=>r?.split("t:")||[],[r]);if((0,Ll.useEffect)(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return(0,Nd.jsx)("div",{className:"hidden h-0 w-0",children:(0,Nd.jsx)(_f.Turnstile,{...e,ref:l,siteKey:s,options:{action:o,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),n("Captcha failed"),a(!1)},onSuccess:c=>{e.onSuccess?.(c),i(c),a(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};var rn=require("react"),Jp=h(require("styled-components"));var Nl=require("react");var Dd=(0,Nl.createContext)({isNewUserThisSession:!1,linkingHint:null,walletConnectionStatus:null,mipdStore:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",nativeTokenSymbolForChainId:T,initializeWalletProxy:T,getAuthMeta:T,getAuthFlow:T,closePrivyModal:T,openPrivyModal:T,connectWallet:T,initLoginWithWallet:T,loginWithWallet:T,initLoginWithFarcaster:T,loginWithFarcaster:T,loginWithCode:T,initLoginWithEmail:T,initLoginWithSms:T,initUpdateEmail:T,resendEmailCode:T,resendSmsCode:T,initLoginWithHeadlessOAuth:T,loginWithHeadlessOAuth:T,initLoginWithOAuth:T,recoveryOAuthFlow:T,loginWithOAuth:T,initLoginWithPasskey:T,loginWithPasskey:T,initLinkWithPasskey:T,linkWithPasskey:T,refreshUser:T,walletProxy:null,createAnalyticsEvent:T,acceptTerms:T,getUsdTokenPrice:T,recoverEmbeddedWallet:T,getFiatOnRampConfig:T,updateWallets:T,fundWallet:T,setReadyToTrue:T,requestFarcasterSignerStatus:T,initLoginWithTelegram:T,loginWithTelegram:T}),W=()=>(0,Nl.useContext)(Dd);var Dl=require("react");var Se=(0,Dl.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:T,login:T,connectOrCreateWallet:T,linkEmail:T,linkPhone:T,linkFarcaster:T,linkWallet:T,linkGoogle:T,linkTwitter:T,linkDiscord:T,linkGithub:T,linkSpotify:T,linkInstagram:T,linkTelegram:T,linkTiktok:T,linkLinkedIn:T,linkApple:T,linkPasskey:T,updateEmail:T,logout:T,getAccessToken:T,getEthereumProvider:T,getEthersProvider:T,getWeb3jsProvider:T,unlinkEmail:T,unlinkPhone:T,unlinkWallet:T,unlinkGoogle:T,unlinkTwitter:T,unlinkDiscord:T,unlinkGithub:T,unlinkSpotify:T,unlinkInstagram:T,unlinkTiktok:T,unlinkLinkedIn:T,unlinkApple:T,unlinkFarcaster:T,unlinkTelegram:T,unlinkPasskey:T,setActiveWallet:T,forkSession:T,createWallet:T,importWallet:T,signMessage:T,signTypedData:T,enrollInMfa:T,initEnrollmentWithSms:T,initEnrollmentWithTotp:T,initEnrollmentWithPasskey:T,promptMfa:T,init:T,submitEnrollmentWithSms:T,submitEnrollmentWithTotp:T,submitEnrollmentWithPasskey:T,unenroll:T,submit:T,cancel:T,sendTransaction:T,exportWallet:T,setWalletPassword:T,setWalletRecovery:T,requestFarcasterSignerFromWarpcast:T,getFarcasterSignerPublicKey:T,signFarcasterMessage:T,initLoginWithEmail:T,initLoginWithSms:T,otpState:{status:"initial"},loginWithCode:T,fundWallet:T,initLoginWithHeadlessOAuth:T,loginWithHeadlessOAuth:T,isHeadlessOAuthLoading:!1,isModalOpen:!1,mfaMethods:[]}),G=()=>(0,Dl.useContext)(Se);var Ul=require("react"),xf=e=>{let[t,r]=(0,Ul.useState)("auto");return(0,Ul.useEffect)(()=>{let o=new ResizeObserver(n=>{r(n[0]?.contentRect.height??"auto")});return e.current&&o.observe(e.current),()=>{e.current&&o.unobserve(e.current)}},[e.current]),t};var Mi=require("react"),Af={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]}},Ud=(0,Mi.createContext)(void 0),kf=()=>(0,Mi.useContext)(Ud);function tt(e,t){if(!t)return;let o=kf().current[e];return(0,Mi.useEffect)(()=>{for(let[n,i]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]?.push(i);return()=>{for(let[n,i]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]=o[n]?.filter(a=>a!==i)}},[t])}function F(e,t,r,...o){for(let n of e.current[t][r])n(...o)}function Fl(){let e=kf();return(t,r,...o)=>F(e,t,r,...o)}function Bl(e){tt("configureMfa",e)}var zd=h(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),Df=h(require("@heroicons/react/24/solid/DocumentCheckIcon")),Uf=h(require("styled-components"));var Hr=h(require("styled-components"));var Hl=h(require("styled-components")),un=require("react/jsx-runtime"),At=({success:e,fail:t})=>(0,un.jsxs)(un.Fragment,{children:[(0,un.jsx)(kt,{className:e?"success":t?"fail":""}),(0,un.jsx)(Fd,{className:e?"success":t?"fail":""})]}),kt=Hl.default.span`
12
+ - https://privy.io`;this.getNonceOnce=new nt(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=r}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");try{let{message:t,signature:r}=await this.sign(),o=await this.api.post(bu,{message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(t){throw de(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");try{let{message:t,signature:r}=await this.sign();return await this.api.post(Eu,{message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw de(t)}}async sign(){if(!this.api)throw new b("Auth flow has no API instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new b("Could not prepare SIWE message");let t=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async _getNonceOnce(){if(!this.api)throw new b("Auth flow has no API instance");let t=this.wallet.address;return(await this.api.post(wu,{address:t,token:this.captchaToken})).nonce}async buildSiweMessage(){if(!this.api)throw new b("Auth flow has no API instance");let t=this.wallet.address,r=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=this.prepareMessage(r,t,this.nonce),this.preparedMessage}prepareMessage(t,r,o){let n=window.location.host,i=window.location.origin,a="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",s=new Date().toISOString();return this.createSiweMessage(t,r,n,i,s,o,a)}};var $n=class{constructor(t,r){this.meta={phoneNumber:t,captchaToken:r}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new b("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(Du,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw de(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new b("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(Ou,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw de(t)}}async sendSmsCode(t,r){if(!this.api)throw new b("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new b("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(Lu,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw de(o)}}};var Ti=class{constructor(t){this.meta={captchaToken:t}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");try{let t=await this.api.post(ju,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw de(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");try{return await this.api.post(Yu,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw de(t)}}};function Rd(e){let t={detail:"",retryable:!1};return e?.privyErrorCode==="linked_to_another_user"&&(t.detail="This account has already been linked to another user."),e?.privyErrorCode==="disallowed_login_method"&&(t.detail="Login with Telegram not allowed."),e?.privyErrorCode==="invalid_data"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="cannot_link_more_of_type"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="invalid_credentials"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="too_many_requests"&&(t.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("rate limit")&&(t.detail="Request limit reached for Telegram. Please wait a moment and try again."),t}function Wm(){let e;if(e=nv(),e)return kd(),{...e,flowType:"login-url"};if(e=iv(),e)return kd(),{...e,flowType:"web-app"};kd()}function nv(){let e=new URLSearchParams(window.location.search),t=Number(e.get("id")||""),r=e.get("hash"),o=Number(e.get("auth_date")||""),n=e.get("first_name"),i=e.get("last_name")||void 0,a=e.get("username")||void 0,s=e.get("photo_url")||void 0;if(!(!t||!n||!o||!r))return{id:t,first_name:n,last_name:i,username:a,photo_url:s,auth_date:o,hash:r}}function iv(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id"),o=t.get("user"),n=Number(t.get("auth_date")||""),i=t.get("hash");if(!(!r||!o||!n||!i))return{query_id:r,user:o,auth_date:n,hash:i}}function kd(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),window.history.replaceState({},"",e)}var xf=require("uuid");function J(e){return e?new Date(e*1e3):null}function av(e){let t=[];for(let r of e){let o=r.type;switch(r.type){case"wallet":let n={address:r.address,type:r.type,imported:r.imported,verifiedAt:J(r.verified_at),firstVerifiedAt:J(r.first_verified_at),latestVerifiedAt:J(r.latest_verified_at),chainType:"ethereum",chainId:r.chain_id,walletClient:r.wallet_client_type==="privy"?"privy":"unknown",walletClientType:r.wallet_client_type,connectorType:r.connector_type,recoveryMethod:r.recovery_method};t.push(n);break;case"cross_app":let i={type:r.type,embeddedWallets:r.embedded_wallets,providerApp:{id:r.provider_app_id},verifiedAt:J(r.verified_at),firstVerifiedAt:J(r.first_verified_at),latestVerifiedAt:J(r.latest_verified_at)};t.push(i);break;case"email":let a={address:r.address,type:r.type,verifiedAt:J(r.verified_at),firstVerifiedAt:J(r.first_verified_at),latestVerifiedAt:J(r.latest_verified_at)};t.push(a);break;case"phone":let s={number:r.phoneNumber,type:r.type,verifiedAt:J(r.verified_at),firstVerifiedAt:J(r.first_verified_at),latestVerifiedAt:J(r.latest_verified_at)};t.push(s);break;case"google_oauth":let l={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:J(r.verified_at),firstVerifiedAt:J(r.first_verified_at),latestVerifiedAt:J(r.latest_verified_at)};t.push(l);break;case"spotify_oauth":let c={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:J(r.verified_at),firstVerifiedAt:J(r.first_verified_at),latestVerifiedAt:J(r.latest_verified_at)};t.push(c);break;case"instagram_oauth":let u={subject:r.subject,username:r.username,type:r.type,verifiedAt:J(r.verified_at),firstVerifiedAt:J(r.first_verified_at),latestVerifiedAt:J(r.latest_verified_at)};t.push(u);break;case"twitter_oauth":let f={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:J(r.verified_at),firstVerifiedAt:J(r.first_verified_at),latestVerifiedAt:J(r.latest_verified_at)};t.push(f);break;case"discord_oauth":let h={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:J(r.verified_at),firstVerifiedAt:J(r.first_verified_at),latestVerifiedAt:J(r.latest_verified_at)};t.push(h);break;case"github_oauth":let v={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:J(r.verified_at),firstVerifiedAt:J(r.first_verified_at),latestVerifiedAt:J(r.latest_verified_at)};t.push(v);break;case"tiktok_oauth":let C={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:J(r.verified_at),firstVerifiedAt:J(r.first_verified_at),latestVerifiedAt:J(r.latest_verified_at)};t.push(C);break;case"linkedin_oauth":let g={subject:r.subject,name:r.name,email:r.email,type:r.type,verifiedAt:J(r.verified_at),firstVerifiedAt:J(r.first_verified_at),latestVerifiedAt:J(r.latest_verified_at)};t.push(g);break;case"apple_oauth":let P={subject:r.subject,email:r.email,type:r.type,verifiedAt:J(r.verified_at),firstVerifiedAt:J(r.first_verified_at),latestVerifiedAt:J(r.latest_verified_at)};t.push(P);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:J(r.verified_at),firstVerifiedAt:J(r.first_verified_at),latestVerifiedAt:J(r.latest_verified_at)});break;case"farcaster":let S={type:r.type,fid:r.fid,ownerAddress:r.owner_address,displayName:r.display_name,username:r.username,bio:r.bio,pfp:r.profile_picture_url,url:r.homepage_url,verifiedAt:J(r.verified_at),firstVerifiedAt:J(r.first_verified_at),latestVerifiedAt:J(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(S);break;case"passkey":let E={type:r.type,enrolledInMfa:r.enrolled_in_mfa,credentialId:r.credential_id,authenticatorName:r.authenticator_name,createdWithDevice:r.created_with_device,createdWithOs:r.created_with_os,createdWithBrowser:r.created_with_browser,verifiedAt:J(r.verified_at),firstVerifiedAt:J(r.first_verified_at),latestVerifiedAt:J(r.latest_verified_at)};t.push(E);break;case"telegram":let x={type:r.type,telegramUserId:r.telegram_user_id,firstName:r.first_name,lastName:r.last_name,username:r.username,photoUrl:r.photo_url,verifiedAt:J(r.first_verified_at),firstVerifiedAt:J(r.first_verified_at),latestVerifiedAt:J(r.latest_verified_at)};t.push(x);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function ur(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var He=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported)||null,Id=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported)||null,sv=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),mr=(e,t)=>t==="all-users"&&!He(e)||t==="users-without-wallets"&&!sv(e)?.length;function _r(e){if(!e)return null;let t=av(e.linked_accounts),r=ur(t,"wallet"),o=ur(t,"email"),n=ur(t,"phone"),i=ur(t,"google_oauth"),a=ur(t,"twitter_oauth"),s=ur(t,"discord_oauth"),l=ur(t,"github_oauth"),c=ur(t,"spotify_oauth"),u=ur(t,"instagram_oauth"),f=ur(t,"tiktok_oauth"),h=ur(t,"linkedin_oauth"),v=ur(t,"apple_oauth"),C=ur(t,"farcaster"),g=ur(t,"telegram"),P=e.mfa_methods.map(({type:E,verified_at:x})=>({type:E,verifiedAt:J(x)}));return{id:e.id,createdAt:J(e.created_at),linkedAccounts:t,email:o&&{address:o?.address},phone:n&&{number:n?.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported},google:i&&{subject:i.subject,email:i.email,name:i.name},twitter:a&&{subject:a.subject,username:a.username,name:a.name,profilePictureUrl:a.profilePictureUrl},discord:s&&{subject:s.subject,username:s.username,email:s.email},github:l&&{subject:l.subject,username:l.username,name:l.name,email:l.email},spotify:c&&{subject:c.subject,email:c.email,name:c.name},instagram:u&&{subject:u.subject,username:u.username},tiktok:f&&{subject:f.subject,username:f.username,name:f.name},linkedin:h&&{subject:h.subject,name:h.name,email:h.email},apple:v&&{subject:v.subject,email:v.email},farcaster:C&&{fid:C.fid,ownerAddress:C.ownerAddress,displayName:C.displayName,username:C.username,bio:C.bio,pfp:C.pfp,url:C.url,signerPublicKey:C.signerPublicKey},telegram:g&&{telegramUserId:g.telegramUserId,firstName:g.firstName,lastName:g.lastName,username:g.username,photoUrl:g.photoUrl},mfaMethods:P.map(E=>E.type),hasAcceptedTerms:e.has_accepted_terms??!1}}var Bd=require("@ethersproject/address"),Ef=require("@ethersproject/bytes"),Tf=y(require("eventemitter3"));var Gm=y(require("@coinbase/wallet-sdk"));var Ba=require("react/jsx-runtime"),Ha=({style:e,...t})=>(0,Ba.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,Ba.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,Ba.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});var ro=require("@ethersproject/address"),Md=require("@ethersproject/providers"),Hm=y(require("eventemitter3"));var Nm=y(require("eventemitter3"));var lv=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Lm=e=>lv.includes(e);var Om=require("@ethersproject/logger");var Pi=class extends fe{constructor(){super("Wallet timeout");this.type="wallet_error"}},_i=class extends fe{constructor(){super("User rejected connection");this.type="wallet_error"}},eo=e=>{if(e instanceof fe)return e;if(e?.code&&e?.reason){let t=new ct(e);return e.code===Om.ErrorCode.ACTION_REJECTED&&(t.details=Gt.E4001_USER_REJECTED_REQUEST),t}return e?.code?new ct(e):new fe("Unknown connector error",e)},Sr=class extends mt{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},ct=class extends Sr{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(Gt).find(i=>i.eipCode===o.code);this.details=n||Gt.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=Gt.E32002_CONNECTION_ALREADY_PENDING:this.details=Gt.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=Gt.E32002_WALLET_LOCKED))}},cv={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0}},dv={E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don\u2019t see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}},pv={E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1}},Gt={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...pv,...dv},Ho={...cv,...Gt};var it=class{constructor(t,r){this.removeListener=(t,r)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(t,r)}catch{console.warn("Unable to remove wallet provider listener")}};this.walletTimeout=(t=new Pi,r=this.rpcTimeoutDuration)=>new Promise((o,n)=>setTimeout(()=>{n(t)},r));this.setWalletProvider=t=>{this.walletProvider&&this._subscriptions.forEach(r=>{this.removeListener(r.eventName,r.listener)}),this.walletProvider=t,this._subscriptions.forEach(r=>{this.walletProvider?.on(r.eventName,r.listener)})};this.walletProvider=t,this.rpcTimeoutDuration=r||Bn,this._subscriptions=[]}on(t,r){if(this.walletProvider)return this.walletProvider.on(t,r);this._subscriptions.push({eventName:t,listener:r})}async request(t){if(!this.walletProvider)throw new fe(`A wallet request of type ${t.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(t),this.walletTimeout()]).catch(r=>{throw eo(r)})}},dn=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},Ga=class extends Nm.default{constructor(r,o,n,i,a,s=1){super();this.walletProxy=r,this.address=o,this.chainId=s,this.rpcConfig=n,this.chains=i,this.provider=Fo(s,this.chains,n,{appId:a}),this.rpcTimeoutDuration=Si(n,"privy"),this.appId=a}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new dn(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await Me()||!this.address)throw new dn("Disconnected",4900);return(await Fm(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new dn(`Invalid params for ${r.method}`,4200);let o;if(typeof r.params[0]=="string")o=r.params[0];else if("chainId"in r.params[0]&&typeof r.params[0].chainId=="string")o=r.params[0].chainId;else throw new dn(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=Fo(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",o)}async handlePersonalSign(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for personal_sign");let o=r.params[0],n=r.params[1];return await Dm(o,void 0,n)}async handleSignedTypedData(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_signTypedData_v4");let o=typeof r.params[1]=="string"?JSON.parse(r.params[1]):r.params[1];return await Um(ka(o))}async handleEstimateGas(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_estimateGas");delete r.params[0].gasPrice,delete r.params[0].maxFeePerGas,delete r.params[0].maxPriorityFeePerGas;let o={...r.params[0],chainId:On(this.chainId)};try{return await this.provider.send("eth_estimateGas",[o])}catch(n){console.warn(`Gas estimation failed with error: ${n}. Retrying gas estimation by omitting the 'from' address`);try{return delete o.from,await this.provider.send("eth_estimateGas",[o])}catch(i){throw console.warn(`Gas estimation failed with error: ${i} when omitting the 'from' address`),n}}}async request(r){switch(console.debug("Embedded1193Provider.request() called with args",r),r.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return On(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(r);case"eth_sendTransaction":return this.handleSendTransaction(r);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(r);case"personal_sign":return this.handlePersonalSign(r);case"eth_signTypedData_v4":return this.handleSignedTypedData(r);default:break}if(Lm(r.method)){let o=await Me();if(await Bm(),!o||!this.address)throw new dn("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:o,request:{method:r.method,params:r.params}})).response.data}catch(n){throw console.error(n),new dn("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await Me();if(!r||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:r})).address}catch(o){return console.error(o),null}}},to=class extends it{constructor(r){super(r,r.rpcTimeoutDuration)}},pn=class extends it{constructor(t){super(t,t.rpcTimeoutDuration)}sendAsync(t,r){throw new Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}};var uv=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},or=class extends Hm.default{constructor(r,o,n,i){super();this.onAccountsChanged=r=>{r.length===0?this.onDisconnect():this.syncAccounts(r)};this.onChainChanged=r=>{this.wallets.forEach(o=>{o.chainId=vi(r),this.walletClientType==="privy"&&ee.put(nl(o.address),r)}),this.emit("walletsUpdated")};this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")};this.onConnect=()=>{this.connected=!0,this.syncAccounts()};this.wallets=[],this.walletClientType=r,this.chains=o,this.defaultChain=n,this.rpcConfig=i,this.rpcTimeoutDuration=Si(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,i){let a=async()=>!!this.wallets.find(s=>(0,ro.getAddress)(s.address)===(0,ro.getAddress)(r));return{address:(0,ro.getAddress)(r),chainId:o,meta:n,imported:i,switchChain:async s=>{if(!a)throw new fe("Wallet is not currently connected.");let l=this.wallets.find(v=>(0,ro.getAddress)(v.address)===(0,ro.getAddress)(r))?.chainId;if(!l)throw new fe("Unable to determine current chainId.");let c,u;if(typeof s=="number"?(c=`0x${s.toString(16)}`,u=s):(c=s,u=Number(s)),l===vi(c))return;let f=this.chains.find(v=>v.id===u);if(!f)throw new fe(`Unsupported chainId: ${s}`);let h=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:c}]})};try{return await h()}catch(v){if(uv(v,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:c,chainName:f.name,nativeCurrency:f.nativeCurrency,rpcUrls:[f.rpcUrls.default?.http[0]??""],blockExplorerUrls:[f.blockExplorers?.default.url??""]}]}),h();throw this.walletClientType==="rainbow"&&v.message?.includes("wallet_switchEthereumChain")?new fe(`Rainbow does not support the chainId ${o}`):v}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new fe("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new fe("Wallet is not currently connected.");return new Md.Web3Provider(new to(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new fe("Wallet is not currently connected.");return new pn(this.proxyProvider)},sign:async s=>{if(!await a())throw new fe("Wallet is not currently connected.");return await this.sign(s)},disconnect:()=>{this.disconnect()}}}async syncAccounts(r){let o=r;try{if(o===void 0){let c=await xa(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});Array.isArray(c)&&(o=c)}}catch(c){console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",c)}if(!o||!Array.isArray(o)||o.length<=0||!o[0])return;let n=o[0],i=(0,ro.getAddress)(n),a=[],s;if(this.walletClientType==="privy"){let c=ee.get(nl(i));this.chains.find(u=>u.id===Number(c))||(ee.del(nl(i)),c=null),s=c||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${s} on initialization`)}}else try{let c=await xa(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(typeof c=="string")s=c;else if(typeof c=="number")s=`0x${c.toString(16)}`;else throw new Error("Invalid chainId returned from provider")}catch(c){console.warn(`Failed to get chainId from provider, defaulting to ${Pd}`,c),s=Pd}let l=vi(s);if(!a.find(c=>(0,ro.getAddress)(c.address)===i)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet((0,ro.getAddress)(n),l,c,this.connectorType==="embedded_imported"))}hl(a,this.wallets)||(this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let r=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((o,n)=>n.connectedAt-o.connectedAt).find(o=>r.find(n=>(0,ro.getAddress)(n)===(0,ro.getAddress)(o.address)))||null}async isConnected(){let r=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(r)&&r.length>0}async sign(r){return await this.connect({showPrompt:!1}),new Md.Web3Provider(new to(this.proxyProvider)).getSigner().signMessage(r)}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)}};var mv=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],fv=(e,t)=>e.makeWeb3Provider({options:t}),Wd,yl=class extends or{constructor(r,o,n,i,a,s){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.displayName="Coinbase Wallet";if(this.proxyProvider=new it(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=i.coinbaseWallet.connectionOptions??"eoaOnly",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!Wd){let l=[o.id].concat(r.map(u=>u.id)),c=this.connectionOptions!=="eoaOnly"?l.filter(u=>!mv.includes(u)):[];c.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${c.join(", ")}`),Wd=new Gm.default({appName:a,appLogoUrl:s,appChainIds:l})}this.proxyProvider.setWalletProvider(fv(Wd,this.connectionOptions))}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:Ha,id:"com.coinbase.wallet"}}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new fe("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw eo(r)}}};var Ld=require("react/jsx-runtime"),gl=({...e})=>(0,Ld.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,Ld.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})});var Va=class extends or{constructor(r,o,n,i,a=!1){super("privy",o,n,i);this.connectorType="embedded";this.proxyProvider=r,a&&(this.connectorType="embedded_imported"),this.subscribeListeners()}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[On(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:gl,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var Od=require("react/jsx-runtime"),Ai=({style:e,...t})=>(0,Od.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:(0,Od.jsx)("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"})});var jt=require("react/jsx-runtime"),xi=({style:e,...t})=>(0,jt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...e},...t,children:[(0,jt.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,jt.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,jt.jsx)("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),(0,jt.jsx)("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),(0,jt.jsx)("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),(0,jt.jsx)("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),(0,jt.jsx)("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),(0,jt.jsx)("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),(0,jt.jsx)("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),(0,jt.jsx)("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),(0,jt.jsx)("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),(0,jt.jsx)("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),(0,jt.jsx)("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});var za=require("react/jsx-runtime"),bo=({style:e,...t})=>(0,za.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...e},...t,children:[(0,za.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,za.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});var Ri=class extends or{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new it(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let s=i.provider;this.proxyProvider.setWalletProvider(s)}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new fe("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw eo(r)}}},ki,Ii=class extends or{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";Ns(this,ki,void 0);this.proxyProvider=new it(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?yd(this,ki,{name:"MetaMask",icon:xi,id:"io.metamask"}):a==="phantom"&&yd(this,ki,{name:"Phantom",icon:bo,id:"phantom"})}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return yu(this,ki)??{name:"Browser Extension",icon:Ai,id:"extension"}}disconnect(){console.warn("Programmatic disconnect with browser wallets is not yet supported.")}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new fe("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw eo(r)}}};ki=new WeakMap;var hv=require("@ethersproject/address"),yv=require("@ethersproject/providers"),Vm=require("react-device-detect");var vl=class extends Ri{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{Vm.isMobile||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let t=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!t||t.length===0||!t[0])throw new fe("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw eo(t)}}};var Cl=class extends or{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new it(void 0,Bn);this.connectorType=r}get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw new Error("connect called for an uninstalled wallet via the NullConnector")}disconnect(){throw new Error("disconnect called for an uninstalled wallet via the NullConnector")}promptConnection(r){throw new Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${r}`)}};var wl=class extends Cl{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:bo,id:"phantom"}}};var Wi=require("@walletconnect/ethereum-provider"),bf=require("react-device-detect");var Br=require("react");var zm=require("react/jsx-runtime");function bl({src:e,...t}){return(0,zm.jsx)("img",{src:e,...t,style:{display:"none"}})}var Eo=require("react"),hf=require("react");var Ar={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:vm,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"eoaOnly"}},captchaEnabled:!1,_render:{standalone:!1},fiatOnRamp:{useSandbox:!1}};var qm=({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`");for(let o of e.primary.slice(1))t.includes(o)?console.warn(`Duplicated login method: ${o}`):t.push(o);for(let o of e.overflow??[])!t.includes(o)&&!r.includes(o)?r.push(o):console.warn(`Duplicated login method: ${o}`);return{primary:t,overflow:r}};var gv=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet"]),$m=e=>gv.has(e),Km=(e,t,r)=>r.indexOf(e)===t,jm=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter($m).filter(Km):e?e.filter($m).filter(Km):Ar.appearance.walletList;var El={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}};var Tl={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0};var Pl={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0};var Ym={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}};var Zm={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0};var _l={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}},testnet:!0};var Sl={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0};var Al={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0};var Jm={id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0};var Qm={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1};var Xm={id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0};var ef={id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}};var tf={id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}};var rf={id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}};var of={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},testnet:!0};var nf={id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}};var af={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1};var sf={id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0};var xl={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}};var kl={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}};var Rl={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0};var Il={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0};var qa={id:137,name:"Polygon Mainnet",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}};var $a={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0};var lf={id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}};var cf={id:17001,name:"Redstone Holesky",network:"redstone-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.holesky.redstone.xyz"]},public:{http:["https://rpc.holesky.redstone.xyz"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"},default:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"}}};var df={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0};var Ml={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}};var Wl={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0};var Ll={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0};var Mi=[El,Tl,Pl,of,df,xl,kl,Rl,Il,qa,$a,Qm,Xm,ef,tf,_l,Sl,Al,Jm,af,sf,Ym,Zm,Ml,Ll,Wl,nf,lf,rf,cf],sE=new Set(Mi.map(e=>e.id));var un=y(require("tinycolor2")),pf="#FFFFFF",vv="#000000",Cv=pf,wv="#1E1E1D";function bv(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}function Go(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,un.default)({...e.toHsl(),l:r})}function uf({backgroundTheme:e,accentHex:t,successHex:r="#51BA81",warnHex:o="#FFB74D",errorHex:n="#EC6351",whiteHex:i=pf,blackHex:a=vv}){let s;switch(e){case"light":s=Cv;break;case"dark":s=wv;break;default:s=e;break}let l=(0,un.default)(s),c=(0,un.default)(t),u=(0,un.default)(r),f=(0,un.default)(o),h=(0,un.default)(n),v=bv(l.getLuminance()),C=Go(l,v==="light"?-.04:.11),g=Go(l,v==="light"?-.88:.87),P=Go(l,v==="light"?-.77:.75),S=Go(l,v==="light"?-.43:.45).desaturate(v==="light"?60:20),E=Go(l,v==="light"?-.08:.25).desaturate(v==="light"?60:20),x=Go(c,.15),R=Go(c,-.06),D=Go(h,.3),I=(0,un.default)(c.getLuminance()>.5?a:i),M=Go(u,-.16);return{colorScheme:v,background:l.toHslString(),background2:C.toHslString(),foreground:g.toHslString(),foreground2:P.toHslString(),foreground3:S.toHslString(),foreground4:E.toHslString(),accent:c.toHslString(),accentLight:x.toHslString(),accentDark:R.toHslString(),foregroundAccent:I.toHslString(),success:u.toHslString(),successDark:M.toHslString(),error:h.toHslString(),errorLight:D.toHslString(),warn:f.toHslString()}}function Nd(e,t,r){let o=r?console.warn:()=>{},n,i,a,s,l,c,u,f,h,v,C,g,P,S,E;t?.loginMethods?(n=t.loginMethods.includes("email"),i=t.loginMethods.includes("sms"),s=t.loginMethods.includes("wallet"),l=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),u=t.loginMethods.includes("discord"),h=t.loginMethods.includes("spotify"),v=t.loginMethods.includes("instagram"),f=t.loginMethods.includes("tiktok"),g=t.loginMethods.includes("github"),C=t.loginMethods.includes("linkedin"),P=t.loginMethods.includes("apple"),S=t.loginMethods.includes("farcaster"),E=t.loginMethods.includes("telegram")):(n=e.emailAuth,i=e.smsAuth,s=e.walletAuth,l=e.googleOAuth,c=e.twitterOAuth,u=e.discordOAuth,g=e.githubOAuth,h=e.spotifyOAuth,v=e.instagramOAuth,f=e.tiktokOAuth,C=e.linkedinOAuth,P=e.appleOAuth,S=e.farcasterAuth,E=e.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?a=!1:e.passkeyAuth&&(a=!0);let x=[n,i].filter(Boolean),R=[l,c,u,g,h,v,f,C,P,S,E].filter(Boolean),D=[s].filter(Boolean);if(x.length+R.length+D.length===0)throw new Error("You must enable at least one login method");let I=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;I&&D.length===0?(o("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),I=!1):!I&&R.length+x.length===0&&(o("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),I=!0),t?.loginMethods&&t.loginMethodsAndOrder&&o("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let M=jm({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),V=qm({input:t?.loginMethodsAndOrder}),z=t?.intl?.defaultCountry??"US",{chains:re,defaultChain:L}=Ev({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),K=!!t?.defaultChain,O=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,ge,be=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?O?ge=t?.embeddedWallets?.noPromptOnSignature??!0:ge=t?.embeddedWallets?.noPromptOnSignature??be:ge=be,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&ge!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:Ee,...Ne}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??Ar.appearance.landingHeader,loginMessage:typeof t?.appearance?.loginMessage=="string"?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:uf({backgroundTheme:t?.appearance?.theme??Ar.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??Ar.appearance.accentColor}),loginGroupPriority:I?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:M},loginMethods:{wallet:s,email:n,sms:i,passkey:a,google:l,twitter:c,discord:u,github:g,spotify:h,instagram:v,tiktok:f,linkedin:C,apple:P,farcaster:S,telegram:E},loginMethodsAndOrder:V,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??Ar.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??Ar.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??Ar.rpcConfig.rpcTimeouts},chains:re,defaultChain:L,intl:{defaultCountry:z},shouldEnforceDefaultChainOnConnect:K,captchaEnabled:e.captchaEnabled??Ar.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??Ar.externalWallets.coinbaseWallet.connectionOptions}},embeddedWallets:{...e.embeddedWalletConfig,...typeof Ee=="boolean"?{requireUserOwnedRecoveryOnCreate:Ee}:{},...O?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...Ne,noPromptOnSignature:ge},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:O?{enabled:!0,...t.customAuth}:void 0,fiatOnRamp:{enabled:e.fiatOnRampEnabled,useSandbox:t?.fiatOnRamp?.useSandbox??Ar.fiatOnRamp.useSandbox},loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1,telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??Ar._render.standalone}}}function mf(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:n,defaultChain:i,...a}=e;return{...a,...o?{additionalChains:o.map(l=>l.id)}:void 0,...n?{supportedChains:n.map(l=>l.id)}:void 0,...i?{defaultChain:i.id}:void 0,legacyCreateEmbeddedWalletFlag:t}}function Ev({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:o}){let n;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(t.length===0)throw new Error("`supportedChains` must contain at least one chain");t.filter(l=>l.rpcUrls.privyWalletOverride).length>0&&o&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),n=t.map(l=>l.rpcUrls.privyWalletOverride?l:Mi.find(u=>u.id===l.id)??l)}else n=Mi.concat(e??[]);let i=t?n[0]:xl,a=r??i;if(!n.find(s=>s.id===a.id))throw new Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:a}}var ff=function(e,t=0){let r=3735928559^t,o=1103547991^t;for(let n=0,i;n<e.length;n++)i=e.charCodeAt(n),r=Math.imul(r^i,2654435761),o=Math.imul(o^i,1597334677);return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(o^o>>>13,3266489909),o=Math.imul(o^o>>>16,2246822507),o^=Math.imul(r^r>>>13,3266489909),4294967296*(2097151&o)+(r>>>0)};var vf=require("react/jsx-runtime"),yf={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""},Dd=Nd(yf,void 0,!1),Ud=(0,hf.createContext)({appConfig:Dd,isServerConfigLoaded:!1}),gf=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:o})=>{let[n,i]=(0,Eo.useState)(null),a=(0,Eo.useMemo)(()=>Nd(n??yf,o,!!n),[n,o]);return(0,Eo.useEffect)(()=>{if(!n)return;let s=mf(o,t),l=ff(JSON.stringify(s)).toString(),c=`privy:sent:${n.id}:${l}`;localStorage.getItem(c)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:s}),localStorage.setItem(c,"t"))},[o,t,n]),(0,Eo.useEffect)(()=>{n||(async()=>{try{let l=await r.getServerConfig();l.customApiUrl&&r.updateApiUrl(l.customApiUrl),i(l)}catch(l){console.warn("Error generating app config: ",l)}})()},[]),(0,vf.jsx)(Ud.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},It=()=>{let{appConfig:e}=(0,Eo.useContext)(Ud);return e},Ol=()=>{let{isServerConfigLoaded:e}=(0,Eo.useContext)(Ud);return e};var T=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var Nl=require("react/jsx-runtime"),Cf=(0,Br.createContext)({ready:!1,app:Dd,currentScreen:null,lastScreen:null,navigate:T,navigateBack:T,resetNavigation:T,setModalData:T,onUserCloseViaDialogOrKeybindRef:void 0}),Tv=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],wf=e=>{let t=It(),r=e.authenticated,[o,n]=(0,Br.useState)(e.initialScreen);(0,Br.useEffect)(()=>{!r&&!Tv.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=(0,Br.useRef)(null);(0,Br.useEffect)(()=>{e.open||(i.current=null)},[e.open]),(0,Br.useEffect)(()=>{i.current=null},[e.initialScreen]);let a={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:o,navigate:(s,l=!0)=>{e.setInitialScreen(s),l&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(o)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:i};return(0,Nl.jsxs)(Cf.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&(0,Nl.jsx)(bl,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},k=()=>(0,Br.useContext)(Cf);var Vo=require("react/jsx-runtime"),Ka=({style:e,...t})=>{let{app:r}=k();return(0,Vo.jsxs)("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:[(0,Vo.jsx)("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,Vo.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,Vo.jsx)("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"})}),(0,Vo.jsx)("defs",{children:(0,Vo.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,Vo.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var To=class extends or{constructor(r,o,n,i,a,s,l,c){super(c||"unknown",n,i,o);this.connectorType="wallet_connect_v2";this.privyAppId=s,this.privyAppName=l,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new it(void 0,this.rpcTimeoutDuration),c&&(this.walletEntry=Qs[c],this.walletClientType=c)}async initialize(){let r=await this.createProvider();if(this.provider=r,this.proxyProvider.setWalletProvider(r),this.subscribeListeners(),r.session){if(this.walletProvider?.session?.peer.metadata.url){let n=Js(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=n?.entry,this.walletClientType=n?.walletClientType||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:o}=await import("@walletconnect/modal");this.modal=new o({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(n=>{!n.open&&!this.walletProvider?.session&&this.onQrModalClosed&&this.onQrModalClosed()})}async connect(r){return r.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){return this.walletClientType==="metamask"?{name:"MetaMask",icon:xi,id:"io.metamask"}:{name:am(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Ka,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(r){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletEntry=Qs[r],this.walletClientType=r,this.redirectUri=void 0,um(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new _i)};this.onQrModalClosed=n,(async()=>{let a="",s=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(s?.length&&(a=s[0]),!a||a==="")throw new fe("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let l=Js(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=l?.entry,this.walletClientType=l?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Si(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(s),r()})().catch(a=>{if(a){o(eo(a));return}o(new fe("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(r){this.proxyProvider.setWalletProvider(r)}async createProvider(){let r={};for(let a of this.chains){let s=lm(a.id,this.chains,this.rpcConfig,this.privyAppId);s&&(r[a.id]=s)}let o=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(a=>a.id),i=await Wi.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:Wi.OPTIONAL_EVENTS,optionalMethods:Wi.OPTIONAL_METHODS,rpcMap:r,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),bf.isMobile&&this.walletEntry){let{redirect:s,href:l}=dm(a,this.walletEntry);mm({href:l,name:this.walletEntry.displayName}),this.redirectUri=s,Xs(s,"_self")}else this.modal?.openModal({uri:a,chains:[this.defaultChain.id]})}),i.on("connect",()=>{if(this.modal?.closeModal(),i.session?.peer.metadata.url){let a=Js(i.session?.peer.metadata.url);this.walletEntry=a?.entry,this.walletClientType=a?.walletClientType||"unknown"}}),i}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await this.walletProvider?.enable()}};var Hd=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>(0,Ef.isHexString)(o)).map(o=>(0,Bd.getAddress)(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},Si=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||Bn:Bn,Li=class extends Tf.default{constructor(r,o,n,i,a,s,l,c,u,f,h){super();this.getEthereumProvider=()=>{let r=this.wallets[0],o=this.walletConnectors.find(n=>n.wallets.find(i=>i.address===r?.address));return!r||!o?new it:o.proxyProvider};this.privyAppId=r,this.walletConnectCloudProjectId=o,this.rpcConfig=n,this.chains=i,this.defaultChain=a,this.walletConnectors=[],this.initialized=!1,this.store=s,this.walletList=l,this.shouldEnforceDefaultChainOnConnect=c,this.externalWalletConfig=u,this.privyAppName=f,this.privyAppLogo=h,this.storedConnections=Fd()}get wallets(){let r=new Set,o=this.walletConnectors.flatMap(i=>i.wallets).sort((i,a)=>i.connectedAt&&a.connectedAt?a.connectedAt-i.connectedAt:0).filter(i=>{let a=`${i.address}${i.walletClientType}${i.connectorType}`;return r.has(a)?!1:(r.add(a),!0)}),n=o.findIndex(i=>i.address===(this.activeWallet?this.activeWallet:"unknown"));return n>=0&&o.unshift(o.splice(n,1)[0]),o}async initialize(){if(this.initialized)return;ee.get(Ed)&&(ee.getKeys().forEach(o=>{o.startsWith("walletconnect")&&ee.del(o)}),ee.del(Ed));let r=sm(this.store,this.walletList,this.externalWalletConfig).then(o=>{o.forEach(({type:n,eip6963InjectedProvider:i,legacyInjectedProvider:a})=>{this.createWalletConnector("injected",n,{eip6963InjectedProvider:i,legacyInjectedProvider:a})})});this.walletList.includes("coinbase_wallet")&&this.createWalletConnector("coinbase_wallet","coinbase_wallet"),!sn()&&this.walletList.includes("phantom")&&this.createWalletConnector("phantom","phantom"),this.createWalletConnector("wallet_connect_v2","unknown"),await r,this.initialized=!0}findWalletConnector(r,o){return r==="wallet_connect_v2"?this.walletConnectors.find(n=>n.connectorType===r)??null:this.walletConnectors.find(n=>n.connectorType===r&&n.walletClientType===o)??null}onInitialized(r){r.wallets.forEach(o=>{let n=this.storedConnections.find(i=>i.address===o.address&&i.connectorType===o.connectorType&&i.walletClientType===o.walletClientType);n&&(o.connectedAt=n.connectedAt)}),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(r){r.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded","privy");if(a)a.proxyProvider.walletProxy=r;else{let s=new Ga(r,o,this.rpcConfig,this.chains,i,n.id),l=new Va(s,this.chains,n,this.rpcConfig);this.addWalletConnector(l)}}addImportedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded_imported","privy");if(a)a.proxyProvider.walletProxy=r;else{let s=new Ga(r,o,this.rpcConfig,this.chains,i,n.id),l=!0,c=new Va(s,this.chains,n,this.rpcConfig,l);this.addWalletConnector(c)}}removeEmbeddedWalletConnector(){let r=this.findWalletConnector("embedded","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=Fd(),this.emit("walletsUpdated")}}removeImportedWalletConnector(){let r=this.findWalletConnector("embedded_imported","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=Fd(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let i=this.findWalletConnector(r,o);if(i)return i instanceof To&&i.resetConnection(o),i;let s=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new vl(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new Ii(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new Ii(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new Ii(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Ri(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new yl(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new wl(this.defaultChain):new To(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,o)})();return s&&this.addWalletConnector(s),s||null}addWalletConnector(r){this.walletConnectors.push(r),r.on("initialized",()=>this.onInitialized(r)),r.on("walletsUpdated",()=>this.onWalletsUpdated(r)),r.initialize().catch(o=>{console.debug("Failed to initialize connector",o)})}saveConnectionHistory(){let r=this.wallets.map(o=>({address:o.address,connectorType:o.connectorType,walletClientType:o.walletClientType,connectedAt:o.connectedAt}));ee.put(Td,r)}async activeWalletSign(r){let o=this.wallets,n=o.length>0?o[0]:null;return n?n.sign(r):null}setActiveWallet(r){this.activeWallet=(0,Bd.getAddress)(r),this.emit("walletsUpdated")}};function hl(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let o=e[r],n=t[r];if(o?.address!==n?.address||o?.chainId!==n?.chainId||o?.connectorType!==n?.connectorType||o?.connectedAt!==n?.connectedAt||o?.walletClientType!==n?.walletClientType||o?.isConnected!==n?.isConnected||o?.linked!==n?.linked)return!1}return!0}var Pv=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",Fd=()=>{let e=ee.get(Td);return e&&Array.isArray(e)&&e.map(o=>Pv(o)).every(Boolean)?e:[]};var Pf=require("ofetch");var _v=[Fs,Hs,Bs,zs],Dl=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=tl,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=Pf.ofetch.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:i,options:a})=>{let s=new Headers(a.headers);s.set("privy-app-id",this.appId),this.appClientId&&s.set("privy-client-id",this.appClientId),s.set("privy-ca-id",this.clientAnalyticsId||""),s.set("privy-client",`react-auth:${this.sdkVersion}`);let l=_v.includes(i.toString());if(!s.has("authorization")){let c=await this.client.getAccessToken({disableAutoRefresh:l});c!==null&&s.set("authorization",`Bearer ${c}`)}a.headers=s,a.retryDelay&&(a.retryDelay=a.retryDelay*3)},onRequestError:({error:i})=>{if(i instanceof DOMException&&i.name==="AbortError")throw new Ds}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw de(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw de(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw de(o)}}};var _f=e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map(t=>({id:t.id,type:t.type,transports:t.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification});var Kn=y(require("js-cookie"));function Sf(e){return e instanceof an?"email":e instanceof $n?"sms":e instanceof qn?"siwe":e instanceof yi?"custom_auth":e instanceof wo?e.meta.provider:null}var Af=y(require("jose")),oo=class{static parse(t){try{return new oo(t)}catch{return null}}constructor(t){this.value=t,this._decoded=Af.decodeJwt(t)}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(t=0){let r=Date.now(),o=(this.expiration-t)*1e3;return r>=o}};var Sv=30,Ul=class{constructor(){this.authenticateOnce=new nt(async t=>this._authenticate(t)),this.linkOnce=new nt(async t=>this._link(t)),this.refreshOnce=new nt(this._refresh.bind(this)),this.destroyOnce=new nt(this._destroy.bind(this)),this.forkSessionOnce=new nt(this._forkSession.bind(this))}get token(){try{let t=ee.get(Nn);return typeof t=="string"?new oo(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=ee.get(rl);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=ee.get(Ma);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=ee.get(La(t));if(typeof r=="string"){let o=new oo(r);return o.isExpired()?(ee.del(La(t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=Kn.default.get(ol);return t!==void 0&&t.length>0}catch(t){console.error(t)}return!1}hasRefreshCredentials(){return this.mightHaveServerCookies||typeof this.token=="string"&&typeof this.refreshToken=="string"&&this.refreshToken!==xm}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=oo.parse(this.token);return t!==null&&!t.isExpired(Sv)}authenticate(t){return this.authenticateOnce.execute(t)}link(t){return this.linkOnce.execute(t)}refresh(){return this.refreshOnce.execute()}forkSession(){return this.forkSessionOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(t,r){typeof r=="string"?ee.put(La(t),r):ee.del(La(t))}async _authenticate(t){try{let r=await t.authenticate(),{user:o,is_new_user:n,oauth_provider_tokens:i}=r;this.handleTokenResponse(r);let a=i?{provider:i.provider,accessToken:i.access_token,accessTokenExpiresInSeconds:i.access_token_expires_in_seconds,refreshToken:i.refresh_token,scopes:i.scopes}:void 0,s=Sf(t);return s&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:s,isNewUser:n}}),s==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}}),{user:_r(o),isNewUser:n,oAuthProviderTokens:a}}catch(r){throw console.warn("Error authenticating session"),Ht(r)}}async _link(t){try{let r=await t.link(),o=r.oauth_provider_tokens,n=o?{provider:o.provider,accessToken:o.access_token,accessTokenExpiresInSeconds:o.access_token_expires_in_seconds,refreshToken:o.refresh_token,scopes:o.scopes}:void 0;return{user:_r(r),oAuthProviderTokens:n}}catch(r){throw console.warn("Error linking account"),Ht(r)}}async _refresh(){if(!this.api)throw new b("Session has no API instance");if(!this.client)throw new b("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let t=this.token,r=this.refreshToken,o=this.forkedToken;try{let n;if(t&&r||this.mightHaveServerCookies){let i={};t&&(i.authorization=`Bearer ${t}`);let a=r?{refresh_token:r}:{};n=await this.api.post(Fs,a,{headers:i}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(Hs,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),_r(n.user)}catch(n){if(n instanceof Xr&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw Ht(n)}}handleTokenResponse(t){t.session_update_action?t.session_update_action==="set"?(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token)):t.session_update_action==="clear"?this.destroyLocalState():t.session_update_action==="ignore"&&t.token&&this.storeToken(t.token):(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token))}async _destroy(){try{await this.api?.post(Bs,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new b("Session has no API instance");let t=this.refreshToken;try{let r=await this.api.post(Cu,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw Ht(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=ee.get(Nn);if(ee.put(Nn,t),!this.client?.useServerCookies){let o=oo.parse(t)?.expiration;Kn.default.set(bd,t,{sameSite:"Strict",secure:!0,expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else ee.del(Nn),Kn.default.remove(bd),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(ee.put(rl,t),this.client?.useServerCookies||Kn.default.set(ol,"t",{sameSite:"Strict",secure:!0,expires:30})):(ee.del(rl),Kn.default.remove(bm),Kn.default.remove(ol))}clearForkedToken(){ee.del(Ma)}};var Gd,Fl,kf,Oi=class{constructor(t){Ns(this,Fl);this.apiUrl=t.apiUrl||Ia,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!1,this.timeout=t.timeout||Cm,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=gu(this,Fl,kf).call(this),Gd||(Gd=new Ul),this.session=Gd,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:t,rpcConfig:r,chains:o,defaultChain:n,store:i,walletList:a,shouldEnforceDefaultChainOnConnect:s,externalWalletConfig:l,appName:c}){this.connectors||(this.connectors=new Li(this.appId,t,r,o,n,i,a,s,l,c))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new Dl({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=t,t}updateApiUrl(t){this.apiUrl=t||this.fallbackApiUrl,this.api=this.generateApi(),t&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new b("No auth flow in progress.");return this.session.authenticate(this.authFlow)}link(){if(!this.authFlow)throw new b("No auth flow in progress.");return this.session.link(this.authFlow)}storeProviderAccessToken(t,r){this.session.storeProviderAccessToken(t,r)}getProviderAccessToken(t){return this.session.getProviderAccessToken(t)}async logout(){await this.session.destroy(),this.authFlow=void 0}startAuthFlow(t){return t.api=this.api,this.authFlow=t,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(Ju,{action:"verify"})}catch(t){throw de(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(Qu,{});return _f(t.options)}catch(t){throw de(t)}}async unlinkEmail(t){try{let r=await this.api.post(Mu,{address:t});return _r(r)}catch(r){throw Ht(r)}}async acceptTerms(){try{let t=await this.api.post(Xu,{});return _r(t)}catch(t){throw Ht(t)}}async unlinkPhone(t){try{let r=await this.api.post(Nu,{phoneNumber:t});return _r(r)}catch(r){throw Ht(r)}}async unlinkWallet(t){try{let r=await this.api.post(Tu,{address:t});return _r(r)}catch(r){throw Ht(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Fu,{provider:t,subject:r});return _r(o)}catch(o){throw Ht(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(xu,{fid:t});return _r(r)}catch(r){throw Ht(r)}}async unlinkTelegram(t){try{let r=await this.api.post(Zu,{telegram_user_id:t});return _r(r)}catch(r){throw Ht(r)}}async unlinkPasskey(t){try{let r=await this.api.post(Ku,{credential_id:t});return _r(r)}catch(r){throw Ht(r)}}async createAnalyticsEvent({eventName:t,payload:r,timestamp:o,options:n}){if(!(typeof window>"u"))try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(zs,{event_name:t,client_id:this.clientAnalyticsId,payload:{...r||{},clientTimestamp:o?o.toISOString():new Date().toISOString()}},{retry:-1,keepalive:n?.keepAlive??!1})}catch{}}async signMoonpayOnRampUrl(t){try{return this.api.post(em,t)}catch(r){throw Ht(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?oo.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:!t?.disableAutoRefresh&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getServerConfig(){try{let t={},r=this.session.token;r&&(t.authorization=`Bearer ${r}`);let o=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:t}),n=o.telegram_auth_config?{botId:o.telegram_auth_config.bot_id,botName:o.telegram_auth_config.bot_name,linkEnabled:o.telegram_auth_config.link_enabled,seamlessAuthEnabled:o.telegram_auth_config.seamless_auth_enabled}:void 0;return{id:o.id,name:o.name,verificationKey:o.verification_key,logoUrl:o.logo_url||void 0,accentColor:o.accent_color||void 0,showWalletLoginFirst:o.show_wallet_login_first,allowlistConfig:{errorTitle:o.allowlist_config.error_title,errorDetail:o.allowlist_config.error_detail,errorCtaText:o.allowlist_config.cta_text,errorCtaLink:o.allowlist_config.cta_link},walletAuth:o.wallet_auth,emailAuth:o.email_auth,smsAuth:o.sms_auth,googleOAuth:o.google_oauth,twitterOAuth:o.twitter_oauth,discordOAuth:o.discord_oauth,githubOAuth:o.github_oauth,spotifyOAuth:o.spotify_oauth,instagramOAuth:o.instagram_oauth,tiktokOAuth:o.tiktok_oauth,linkedinOAuth:o.linkedin_oauth,appleOAuth:o.apple_oauth,farcasterAuth:o.farcaster_auth,passkeyAuth:o.passkey_auth,telegramAuth:o.telegram_auth,termsAndConditionsUrl:o.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:o.embedded_wallet_config?.create_on_login,userOwnedRecoveryOptions:o.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:o.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:o.privacy_policy_url,requireUsersAcceptTerms:o.require_users_accept_terms,customApiUrl:o.custom_api_url,walletConnectCloudProjectId:o.wallet_connect_cloud_project_id,fiatOnRampEnabled:o.fiat_on_ramp_enabled,captchaEnabled:o.captcha_enabled,captchaSiteKey:o.captcha_site_key,twitterOAuthOnMobileEnabled:o.twitter_oauth_on_mobile_enabled,createdAt:new Date(o.created_at*1e3),updatedAt:new Date(o.updated_at*1e3),mfaMethods:o.mfa_methods,enforceWalletUis:o.enforce_wallet_uis,legacyWalletUiConfig:o.legacy_wallet_ui_config,telegramAuthConfiguration:n}}catch(t){throw Ht(t)}}async getUsdTokenPrice(t){try{return(await this.api.get(`/api/v1/token_price?chainId=${t.id}&tokenSymbol=${t.nativeCurrency.symbol}`)).usd}catch{console.error(`Unable to fetch token price for chain with id ${t.id}`);return}}async requestFarcasterSignerStatus(t){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:t})}catch(r){throw console.error("Unable to fetch Farcaster signer status"),r}}async forkSession(){return await this.session.forkSession()}};Fl=new WeakSet,kf=function(){if(typeof window>"u")return null;try{let r=ee.get(Wa);if(typeof r=="string"&&r.length>0)return r}catch{}let t=(0,xf.v4)();try{return ee.put(Wa,t),t}catch{return t}};var Wf=require("@marsidev/react-turnstile"),Bl=require("react");var Hr=require("react");var Mf=require("react/jsx-runtime"),Rf=(0,Hr.createContext)({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:T,setError:T,setExecuting:T,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:T,reset:T,execute:T}),no=class extends mt{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},If=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=(0,Hr.useRef)(null),[i,a]=(0,Hr.useState)(),[s,l]=(0,Hr.useState)(),[c,u]=(0,Hr.useState)(!1),f=(0,Hr.useMemo)(()=>o?!c&&!i&&!s?{status:"ready"}:c&&!i&&!s?{status:"loading"}:i&&!s?{status:"success",token:i}:s?{status:"error",error:s}:{status:"ready"}:{status:"disabled"},[o,i,s,c]);return(0,Mf.jsx)(Rf.Provider,{value:{...f,ref:n,enabled:o,siteKey:r,appId:t,setToken:a,setError:l,setExecuting:u,remove(){o&&(n.current?.remove(),u(!1),l(void 0),a(void 0))},reset(){o&&(n.current?.reset(),u(!1),l(void 0),a(void 0))},execute(){o&&(u(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await im(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new no("Captcha failed",null,"captcha_timeout")}}},children:e})},Ae=()=>(0,Hr.useContext)(Rf);var Vd=require("react/jsx-runtime"),Hl=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:s}=Ae(),[,l]=(0,Bl.useMemo)(()=>r?.split("t:")||[],[r]);if((0,Bl.useEffect)(()=>s.current?.remove,[]),!t)return null;if(!l)throw new Error("Unsupported captcha site key");return(0,Vd.jsx)("div",{className:"hidden h-0 w-0",children:(0,Vd.jsx)(Wf.Turnstile,{...e,ref:s,siteKey:l,options:{action:o,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),n("Captcha failed"),a(!1)},onSuccess:c=>{e.onSuccess?.(c),i(c),a(!1)},onExpire:()=>{e.onExpire?.();try{s.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};var nn=require("react"),iu=y(require("styled-components"));var Gl=require("react");var zd=(0,Gl.createContext)({isNewUserThisSession:!1,linkingHint:null,walletConnectionStatus:null,mipdStore:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",nativeTokenSymbolForChainId:T,initializeWalletProxy:T,getAuthMeta:T,getAuthFlow:T,closePrivyModal:T,openPrivyModal:T,connectWallet:T,initLoginWithWallet:T,loginWithWallet:T,initLoginWithFarcaster:T,loginWithFarcaster:T,loginWithCode:T,initLoginWithEmail:T,initLoginWithSms:T,initUpdateEmail:T,resendEmailCode:T,resendSmsCode:T,initLoginWithHeadlessOAuth:T,loginWithHeadlessOAuth:T,crossAppAuthFlow:T,initLoginWithOAuth:T,recoveryOAuthFlow:T,loginWithOAuth:T,initLoginWithPasskey:T,loginWithPasskey:T,initLinkWithPasskey:T,linkWithPasskey:T,refreshUser:T,walletProxy:null,createAnalyticsEvent:T,acceptTerms:T,getUsdTokenPrice:T,recoverEmbeddedWallet:T,getFiatOnRampConfig:T,updateWallets:T,fundWallet:T,setReadyToTrue:T,requestFarcasterSignerStatus:T,initLoginWithTelegram:T,loginWithTelegram:T}),W=()=>(0,Gl.useContext)(zd);var Vl=require("react");var Se=(0,Vl.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:T,login:T,connectOrCreateWallet:T,linkEmail:T,linkPhone:T,linkFarcaster:T,linkWallet:T,linkCrossAppAccount:T,linkGoogle:T,linkTwitter:T,linkDiscord:T,linkGithub:T,linkSpotify:T,linkInstagram:T,linkTelegram:T,linkTiktok:T,linkLinkedIn:T,linkApple:T,linkPasskey:T,updateEmail:T,logout:T,getAccessToken:T,getEthereumProvider:T,getEthersProvider:T,getWeb3jsProvider:T,unlinkEmail:T,unlinkPhone:T,unlinkWallet:T,unlinkGoogle:T,unlinkTwitter:T,unlinkDiscord:T,unlinkGithub:T,unlinkSpotify:T,unlinkInstagram:T,unlinkTiktok:T,unlinkLinkedIn:T,unlinkApple:T,unlinkFarcaster:T,unlinkTelegram:T,unlinkPasskey:T,setActiveWallet:T,forkSession:T,createWallet:T,importWallet:T,signMessage:T,signTypedData:T,enrollInMfa:T,initEnrollmentWithSms:T,initEnrollmentWithTotp:T,initEnrollmentWithPasskey:T,promptMfa:T,init:T,submitEnrollmentWithSms:T,submitEnrollmentWithTotp:T,submitEnrollmentWithPasskey:T,unenroll:T,submit:T,cancel:T,sendTransaction:T,exportWallet:T,setWalletPassword:T,setWalletRecovery:T,requestFarcasterSignerFromWarpcast:T,getFarcasterSignerPublicKey:T,signFarcasterMessage:T,initLoginWithEmail:T,initLoginWithSms:T,otpState:{status:"initial"},loginWithCode:T,fundWallet:T,initLoginWithHeadlessOAuth:T,loginWithHeadlessOAuth:T,signMessageWithCrossAppWallet:T,signTypedDataWithCrossAppWallet:T,sendTransactionWithCrossAppWallet:T,isHeadlessOAuthLoading:!1,isModalOpen:!1,mfaMethods:[]}),H=()=>(0,Vl.useContext)(Se);var zl=require("react"),Lf=e=>{let[t,r]=(0,zl.useState)("auto");return(0,zl.useEffect)(()=>{let o=new ResizeObserver(n=>{r(n[0]?.contentRect.height??"auto")});return e.current&&o.observe(e.current),()=>{e.current&&o.unobserve(e.current)}},[e.current]),t};var Ni=require("react"),Of={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]}},qd=(0,Ni.createContext)(void 0),Nf=()=>(0,Ni.useContext)(qd);function at(e,t){if(!t)return;let o=Nf().current[e];return(0,Ni.useEffect)(()=>{for(let[n,i]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]?.push(i);return()=>{for(let[n,i]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]=o[n]?.filter(a=>a!==i)}},[t])}function F(e,t,r,...o){for(let n of e.current[t][r])n(...o)}function ql(){let e=Nf();return(t,r,...o)=>F(e,t,r,...o)}function $l(e){at("configureMfa",e)}var Jd=y(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),qf=y(require("@heroicons/react/24/solid/DocumentCheckIcon")),$f=y(require("styled-components"));var io=y(require("styled-components"));var Kl=y(require("styled-components")),mn=require("react/jsx-runtime"),wt=({success:e,fail:t})=>(0,mn.jsxs)(mn.Fragment,{children:[(0,mn.jsx)(Mt,{className:e?"success":t?"fail":""}),(0,mn.jsx)($d,{className:e?"success":t?"fail":""})]}),Mt=Kl.default.span`
13
13
  && {
14
14
  width: 82px;
15
15
  height: 82px;
@@ -42,22 +42,23 @@ Resources:
42
42
  border-color: var(--privy-color-error);
43
43
  border-bottom-color: var(--privy-color-error);
44
44
  }
45
- `,Fd=(0,Hl.default)(kt)`
45
+ `,$d=(0,Kl.default)(Mt)`
46
46
  && {
47
47
  border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
48
48
  animation: none;
49
49
  opacity: 0.5;
50
50
  }
51
- `,Go=e=>(0,un.jsx)(uv,{color:e.color||"var(--privy-color-foreground-3)"}),uv=(0,Hl.default)(kt)`
51
+ `,Po=e=>(0,mn.jsx)(Av,{color:e.color||"var(--privy-color-foreground-3)"}),Av=(0,Kl.default)(Mt)`
52
52
  && {
53
- height: 0.9rem;
54
- width: 0.9rem;
53
+ height: 1rem;
54
+ width: 1rem;
55
+ margin: 2px 0;
55
56
  border-width: 1.5px;
56
57
 
57
58
  /* Override default Loader to match button transitions */
58
59
  transition: border-color 200ms ease;
59
60
  }
60
- `;var Rt=require("react/jsx-runtime"),Gl=Hr.default.button`
61
+ `;var bt=require("react/jsx-runtime"),ja=io.default.button`
61
62
  display: flex;
62
63
  flex-direction: row;
63
64
  align-items: center;
@@ -69,7 +70,7 @@ Resources:
69
70
  cursor: pointer;
70
71
  border-radius: var(--privy-border-radius-md);
71
72
 
72
- font-size: 16px;
73
+ font-size: 1rem;
73
74
  font-style: normal;
74
75
  font-weight: 500;
75
76
  line-height: 22px; /* 137.5% */
@@ -79,19 +80,33 @@ Resources:
79
80
  && {
80
81
  padding: 12px 16px;
81
82
  }
83
+ `,U=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,bt.jsx)(Uf,{disabled:t||r,...n,children:t?(0,bt.jsxs)("span",{children:[(0,bt.jsx)(Po,{}),o?(0,bt.jsx)("span",{children:o}):null]}):e}),Df=({children:e,loading:t,disabled:r,...o})=>(0,bt.jsx)(xv,{disabled:r,...o,children:t?(0,bt.jsx)(Po,{color:"var(--privy-color-foreground-accent)"}):e}),xv=(0,io.default)(ja)`
84
+ position: relative;
82
85
 
83
- &&:disabled {
84
- background-color: var(--privy-color-background-2);
85
- color: var(--privy-color-foreground-3);
86
+ && {
87
+ background-color: var(--privy-color-accent);
88
+ color: var(--privy-color-foreground-accent);
89
+
90
+ transition: background-color 200ms ease;
91
+ }
92
+
93
+ &:hover {
94
+ background-color: var(--privy-color-accent-dark);
95
+ }
96
+
97
+ &:active {
98
+ background-color: var(--privy-color-accent-dark);
99
+ }
100
+
101
+ &:disabled,
102
+ &:hover:disabled,
103
+ &:active:disabled {
86
104
  cursor: not-allowed;
105
+ pointer-events: none;
106
+ color: var(--privy-color-foreground-accent);
107
+ background-color: var(--privy-color-accent-dark);
87
108
  }
88
- `,D=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,Rt.jsx)(Rf,{disabled:t||r,...n,children:t?(0,Rt.jsxs)("span",{children:[(0,Rt.jsx)(Go,{}),o?(0,Rt.jsx)("span",{children:o}):null]}):e}),I9=(0,Hr.default)(D)`
89
- ${e=>e.hideAnimations&&Hr.css`
90
- && {
91
- transition: none;
92
- }
93
- `}
94
- `,Vl=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,Rt.jsx)(Rf,{as:"a",disabled:t||r,...n,children:t?(0,Rt.jsxs)("span",{children:[(0,Rt.jsx)(Go,{}),o?(0,Rt.jsx)("span",{children:o}):null]}):e}),Rf=(0,Hr.default)(Gl)`
109
+ `,jl=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,bt.jsx)(Uf,{as:"a",disabled:t||r,...n,children:t?(0,bt.jsxs)("span",{children:[(0,bt.jsx)(Po,{}),o?(0,bt.jsx)("span",{children:o}):null]}):e}),Uf=(0,io.default)(ja)`
95
110
  position: relative;
96
111
 
97
112
  && {
@@ -117,7 +132,7 @@ Resources:
117
132
  }
118
133
 
119
134
  /* If an anchor tag, :disabled isn't a thing, so manually set state */
120
- ${e=>e.disabled?Hr.css`
135
+ ${e=>e.disabled?io.css`
121
136
  &&&,
122
137
  &&&:hover,
123
138
  &&&:active {
@@ -136,7 +151,7 @@ Resources:
136
151
  opacity: 1;
137
152
  animation: fadein 200ms ease;
138
153
  }
139
- `,no=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,Rt.jsx)(mv,{disabled:t||r,...n,children:t?(0,Rt.jsxs)("span",{children:[(0,Rt.jsx)(Go,{}),o?(0,Rt.jsx)("span",{children:o}):null]}):e}),mv=(0,Hr.default)(Gl)`
154
+ `,ao=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,bt.jsx)(kv,{disabled:t||r,...n,children:t?(0,bt.jsxs)("span",{children:[(0,bt.jsx)(Po,{}),o?(0,bt.jsx)("span",{children:o}):null]}):e}),kv=(0,io.default)(ja)`
140
155
  && {
141
156
  border-width: 1px;
142
157
  border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"};
@@ -165,7 +180,7 @@ Resources:
165
180
  opacity: 1;
166
181
  animation: fadein 200ms ease;
167
182
  }
168
- `,Wi=Hr.default.button`
183
+ `,Di=io.default.button`
169
184
  && {
170
185
  padding: 12px 16px;
171
186
  font-weight: 500;
@@ -178,7 +193,7 @@ Resources:
178
193
  transition: opacity 200ms ease, background-color 200ms ease, color 200ms ease;
179
194
  user-select: none;
180
195
 
181
- ${e=>e.invisible&&Hr.css`
196
+ ${e=>e.invisible&&io.css`
182
197
  pointer-events: none;
183
198
  `}
184
199
 
@@ -196,10 +211,10 @@ Resources:
196
211
  cursor: not-allowed;
197
212
  }
198
213
  }
199
- `,M9=Hr.default.div`
214
+ `,j9=io.default.div`
200
215
  /* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */
201
216
  height: 44px;
202
- `,Li=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>(0,Rt.jsxs)(fv,{isSubmitting:o,onClick:t,disabled:r,...n,children:[(0,Rt.jsx)("span",{children:e}),(0,Rt.jsx)("span",{children:(0,Rt.jsx)(Go,{})})]}),fv=Hr.default.button`
217
+ `,Ui=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>(0,bt.jsxs)(Rv,{isSubmitting:o,onClick:t,disabled:r,...n,children:[(0,bt.jsx)("span",{children:e}),(0,bt.jsx)("span",{children:(0,bt.jsx)(Po,{})})]}),Rv=io.default.button`
203
218
  && {
204
219
  color: var(--privy-color-accent);
205
220
  font-size: 16px;
@@ -241,7 +256,7 @@ Resources:
241
256
  cursor: not-allowed;
242
257
  }
243
258
  }
244
- `;var Hd=h(require("styled-components"));var ur=require("react/jsx-runtime"),Bd=Hd.default.div`
259
+ `;var jd=y(require("styled-components"));var xr=require("react/jsx-runtime"),Kd=jd.default.div`
245
260
  margin-top: 16px;
246
261
  font-size: 13px;
247
262
  text-align: center;
@@ -250,7 +265,7 @@ Resources:
250
265
  && > a {
251
266
  color: var(--privy-color-accent);
252
267
  }
253
- `;function Oi(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:r,requireUsersAcceptTerms:o}}=e.app;if(o&&!e.alwaysShowImplicitConsent)return(0,ur.jsx)(Bd,{});if(!r&&!t)return(0,ur.jsx)(Bd,{});let n=!!(t&&r);return(0,ur.jsxs)(Bd,{children:["By logging in I agree to the"," ",r&&(0,ur.jsx)("a",{href:r,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&(0,ur.jsx)("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var K=({protectedByPrivy:e})=>(0,ur.jsx)(q,{children:e?(0,ur.jsxs)(ur.Fragment,{children:[(0,ur.jsx)(pl,{className:"hide-on-mobile"}),(0,ur.jsx)("span",{className:"hide-on-mobile",children:(0,ur.jsx)("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})})]}):null}),q=Hd.default.div`
268
+ `;function Fi(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:r,requireUsersAcceptTerms:o}}=e.app;if(o&&!e.alwaysShowImplicitConsent)return(0,xr.jsx)(Kd,{});if(!r&&!t)return(0,xr.jsx)(Kd,{});let n=!!(t&&r);return(0,xr.jsxs)(Kd,{children:["By logging in I agree to the"," ",r&&(0,xr.jsx)("a",{href:r,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&(0,xr.jsx)("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var j=({protectedByPrivy:e})=>(0,xr.jsx)($,{children:e?(0,xr.jsxs)(xr.Fragment,{children:[(0,xr.jsx)(gl,{}),(0,xr.jsx)("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})]}):null}),$=jd.default.div`
254
269
  display: flex;
255
270
  align-items: center;
256
271
  justify-content: center;
@@ -277,7 +292,7 @@ Resources:
277
292
  @media all and (display-mode: standalone) {
278
293
  padding-bottom: 30px;
279
294
  }
280
- `;var If=h(require("@heroicons/react/24/outline/ArrowLeftIcon")),Mf=h(require("@heroicons/react/24/outline/QuestionMarkCircleIcon")),Wf=h(require("@heroicons/react/24/outline/XMarkIcon")),$n=h(require("styled-components"));var It=require("react/jsx-runtime"),hv=({backFn:e})=>(0,It.jsx)("div",{children:(0,It.jsx)(Gd,{onClick:e,children:(0,It.jsx)(If.default,{height:"16px",width:"16px",strokeWidth:2})})}),yv=({infoFn:e})=>(0,It.jsx)("div",{children:(0,It.jsx)(vv,{"aria-label":"info",onClick:e,children:(0,It.jsx)(Mf.default,{height:"22px",width:"22px",strokeWidth:2})})}),gv=e=>(0,It.jsx)("div",{children:(0,It.jsx)(Gd,{"aria-label":"close modal",onClick:e.onClose,children:(0,It.jsx)(Wf.default,{height:"16px",width:"16px",strokeWidth:2})})});var S=({backFn:e,infoFn:t,onClose:r,title:o,closeable:n=!0})=>{let{closePrivyModal:i}=W(),a=Kt();return(0,It.jsxs)(Cv,{children:[(0,It.jsxs)(wv,{children:[e&&(0,It.jsx)(hv,{backFn:e}),t&&(0,It.jsx)(yv,{infoFn:t})]}),o&&(0,It.jsx)(Ev,{id:"privy-dialog-title",children:o}),(0,It.jsx)(bv,{children:!a.render.standalone&&n&&(0,It.jsx)(gv,{onClose:r||(()=>i())})})]})},Gd=$n.default.button`
295
+ `;var Ff=y(require("@heroicons/react/24/outline/ArrowLeftIcon")),Bf=y(require("@heroicons/react/24/outline/QuestionMarkCircleIcon")),Hf=y(require("@heroicons/react/24/outline/XMarkIcon")),jn=y(require("styled-components"));var Wt=require("react/jsx-runtime"),Iv=({backFn:e})=>(0,Wt.jsx)("div",{children:(0,Wt.jsx)(Yd,{onClick:e,children:(0,Wt.jsx)(Ff.default,{height:"16px",width:"16px",strokeWidth:2})})}),Mv=({infoFn:e})=>(0,Wt.jsx)("div",{children:(0,Wt.jsx)(Lv,{"aria-label":"info",onClick:e,children:(0,Wt.jsx)(Bf.default,{height:"22px",width:"22px",strokeWidth:2})})}),Wv=e=>(0,Wt.jsx)("div",{children:(0,Wt.jsx)(Yd,{"aria-label":"close modal",onClick:e.onClose,children:(0,Wt.jsx)(Hf.default,{height:"16px",width:"16px",strokeWidth:2})})});var A=({backFn:e,infoFn:t,onClose:r,title:o,closeable:n=!0})=>{let{closePrivyModal:i}=W(),a=It();return(0,Wt.jsxs)(Ov,{children:[(0,Wt.jsxs)(Nv,{children:[e&&(0,Wt.jsx)(Iv,{backFn:e}),t&&(0,Wt.jsx)(Mv,{infoFn:t})]}),o&&(0,Wt.jsx)(Uv,{id:"privy-dialog-title",children:o}),(0,Wt.jsx)(Dv,{children:!a.render.standalone&&n&&(0,Wt.jsx)(Wv,{onClose:r||(()=>i())})})]})},Yd=jn.default.button`
281
296
  && {
282
297
  cursor: pointer;
283
298
  display: flex;
@@ -296,11 +311,11 @@ Resources:
296
311
  opacity: 1;
297
312
  }
298
313
  }
299
- `,vv=(0,$n.default)(Gd)`
314
+ `,Lv=(0,jn.default)(Yd)`
300
315
  && {
301
316
  background-color: transparent;
302
317
  }
303
- `,Cv=$n.default.div`
318
+ `,Ov=jn.default.div`
304
319
  padding: 16px 0;
305
320
  display: flex;
306
321
  align-items: center;
@@ -312,31 +327,31 @@ Resources:
312
327
  font-weight: 600;
313
328
  color: var(--privy-color-foreground);
314
329
  }
315
- `,wv=$n.default.div`
330
+ `,Nv=jn.default.div`
316
331
  flex: 1;
317
332
  align-items: center;
318
333
  display: flex;
319
334
  gap: 8px;
320
- `,bv=$n.default.div`
335
+ `,Dv=jn.default.div`
321
336
  flex: 1;
322
337
  display: flex;
323
338
  justify-content: flex-end;
324
- `,Ev=$n.default.div`
339
+ `,Uv=jn.default.div`
325
340
  overflow: hidden;
326
341
  white-space: nowrap;
327
342
  max-width: 100%;
328
343
  text-overflow: ellipsis;
329
344
  text-align: center;
330
345
  color: var(--privy-color-foreground-2);
331
- `;var io=h(require("styled-components")),zl=io.default.div`
346
+ `;var so=y(require("styled-components")),Yl=so.default.div`
332
347
  text-align: left;
333
348
  flex-grow: 1;
334
- `,ql=io.default.div`
349
+ `,Zl=so.default.div`
335
350
  display: flex;
336
351
  flex-direction: column;
337
352
  justify-content: flex-end;
338
353
  flex-grow: 1;
339
- `,ao=io.default.div`
354
+ `,lo=so.default.div`
340
355
  display: flex;
341
356
  flex-direction: column;
342
357
  gap: 12px;
@@ -351,13 +366,13 @@ Resources:
351
366
  &::-webkit-scrollbar {
352
367
  display: none;
353
368
  }
354
- `,Lf=(0,io.default)(ao)`
369
+ `,Gf=(0,so.default)(lo)`
355
370
  ${e=>{if(e.colorScheme==="light")return"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;";if(e.colorScheme==="dark")return"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;"}}
356
371
 
357
372
  background-repeat: no-repeat;
358
373
  background-size: 100% 32px, 100% 16px;
359
374
  background-attachment: local, scroll;
360
- `,Of=io.css`
375
+ `,Vf=so.css`
361
376
  && {
362
377
  width: 100%;
363
378
  font-size: 16px;
@@ -394,18 +409,18 @@ Resources:
394
409
  max-width: 24px;
395
410
  }
396
411
  }
397
- `,$l=io.default.div`
412
+ `,Jl=so.default.div`
398
413
  text-align: center;
399
414
  font-size: 14px;
400
415
  margin-bottom: 24px;
401
- `,De=io.default.button`
402
- ${Of}
403
- `,Vd=io.default.a`
404
- ${Of}
405
- `,so=io.default.div`
416
+ `,De=so.default.button`
417
+ ${Vf}
418
+ `,Zd=so.default.a`
419
+ ${Vf}
420
+ `,co=so.default.div`
406
421
  width: 100%;
407
422
  ${e=>e.if?"display: none;":""}
408
- `;var Tt=h(require("styled-components")),Ge=Tt.default.div`
423
+ `;var St=y(require("styled-components")),Ge=St.default.div`
409
424
  display: flex;
410
425
  flex-direction: column;
411
426
  align-items: center;
@@ -413,17 +428,17 @@ Resources:
413
428
  @media (max-width: 440px) {
414
429
  padding: 10px 10px 20px;
415
430
  }
416
- `,ge=Tt.default.div`
431
+ `,ve=St.default.div`
417
432
  font-size: 18px;
418
433
  line-height: 30px;
419
434
  text-align: center;
420
435
  font-weight: 600;
421
436
  margin-bottom: 10px;
422
- `,Ce=Tt.default.div`
437
+ `,we=St.default.div`
423
438
  font-size: 0.875rem;
424
439
 
425
440
  text-align: center;
426
- `,Gr=Tt.default.div`
441
+ `,Gr=St.default.div`
427
442
  display: flex;
428
443
  flex-direction: column;
429
444
  align-items: center;
@@ -433,7 +448,7 @@ Resources:
433
448
  @media (max-width: 440px) {
434
449
  padding: 10px 10px 20px;
435
450
  }
436
- `,Kn=Tt.default.div`
451
+ `,Yn=St.default.div`
437
452
  display: flex;
438
453
  flex-direction: column;
439
454
  align-items: stretch;
@@ -441,7 +456,7 @@ Resources:
441
456
  padding: 1rem 0rem 0rem;
442
457
  flex-grow: 1;
443
458
  width: 100%;
444
- `,mr=Tt.default.div`
459
+ `,fr=St.default.div`
445
460
  width: 25px;
446
461
  display: flex;
447
462
  align-items: center;
@@ -453,19 +468,19 @@ Resources:
453
468
  width: 25px !important;
454
469
  color: var(--privy-color-accent);
455
470
  }
456
- `,fr=Tt.default.div`
471
+ `,hr=St.default.div`
457
472
  display: flex;
458
473
  align-items: center;
459
474
  gap: 10px;
460
475
  font-size: 0.875rem;
461
476
  line-height: 1rem;
462
477
  text-align: left;
463
- `,jt=Tt.default.div`
478
+ `,Yt=St.default.div`
464
479
  display: flex;
465
480
  flex-direction: column;
466
481
  gap: 10px;
467
482
  padding-top: 20px;
468
- `,Kl=Tt.default.div`
483
+ `,Ql=St.default.div`
469
484
  display: flex;
470
485
  flex-direction: column;
471
486
  align-items: stretch;
@@ -473,11 +488,11 @@ Resources:
473
488
  padding: 1rem 0rem 0rem;
474
489
  flex-grow: 1;
475
490
  width: 100%;
476
- `,jl=Tt.default.div`
491
+ `,Xl=St.default.div`
477
492
  display: flex;
478
493
  gap: 5px;
479
494
  width: 100%;
480
- `,Yl=Tt.default.button`
495
+ `,ec=St.default.button`
481
496
  && {
482
497
  background-color: transparent;
483
498
  color: var(--privy-color-foreground-3);
@@ -495,7 +510,7 @@ Resources:
495
510
  &&:hover {
496
511
  color: var(--privy-color-error);
497
512
  }
498
- `,Zl=Tt.default.div`
513
+ `,tc=St.default.div`
499
514
  display: flex;
500
515
  align-items: center;
501
516
  gap: 0.5rem;
@@ -505,7 +520,7 @@ Resources:
505
520
  height: 20px !important;
506
521
  width: 20px !important;
507
522
  }
508
- `,jn=Tt.default.div`
523
+ `,Zn=St.default.div`
509
524
  display: flex;
510
525
  align-items: center;
511
526
  gap: 6px;
@@ -519,15 +534,15 @@ Resources:
519
534
  display: flex !important;
520
535
  align-items: flex-end;
521
536
  }
522
- `,Jl=Tt.default.div`
537
+ `,rc=St.default.div`
523
538
  width: 100%;
524
539
  display: flex;
525
540
  justify-content: space-between;
526
- `,Nf=Tt.default.p`
541
+ `,zf=St.default.p`
527
542
  text-align: left;
528
543
  width: 100%;
529
544
  color: var(--privy-color-foreground-3) !important;
530
- `,Ga=Tt.default.button`
545
+ `,Ya=St.default.button`
531
546
  display: flex;
532
547
  flex-direction: row;
533
548
  align-items: center;
@@ -557,7 +572,7 @@ Resources:
557
572
  &:hover {
558
573
  text-decoration: underline;
559
574
  }
560
- `,at=Tt.default.div`
575
+ `,st=St.default.div`
561
576
  display: flex;
562
577
  align-items: center;
563
578
  justify-content: center;
@@ -572,12 +587,12 @@ Resources:
572
587
  width: auto !important;
573
588
  color: white;
574
589
  }
575
- `,Ql=Tt.default.div`
590
+ `,oc=St.default.div`
576
591
  color: var(--privy-color-error);
577
- `;var Pt=require("react/jsx-runtime"),Ff=()=>{let{user:e,logout:t}=G(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:i}=k(),{acceptTerms:a,closePrivyModal:l,createAnalyticsEvent:s}=W(),c=y=>{y?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};o.current=c;let u=async y=>{y.preventDefault(),await a(),e&&pr(e,r?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:f=>{console.error(f),s({eventName:"embedded_wallet_creation_failure_logout",payload:{error:f,screen:"AffirmativeConsentScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):l()};return(0,Pt.jsx)(Tv,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:u,onDecline:c})},Tv=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>(0,Pt.jsxs)(Pt.Fragment,{children:[(0,Pt.jsx)(S,{closeable:!1}),(0,Pt.jsx)(Df.default,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),(0,Pt.jsx)(ge,{style:{marginTop:24},children:"One last step"}),(0,Pt.jsx)(Ce,{children:"By signing up, you agree to our terms and privacy policy."}),(0,Pt.jsxs)(ao,{style:{marginTop:24},children:[e&&(0,Pt.jsxs)(Vd,{target:"_blank",href:e,children:["View Terms ",(0,Pt.jsx)(zd.default,{style:{marginLeft:"auto"}})]}),t&&(0,Pt.jsxs)(Vd,{target:"_blank",href:t,children:["View Privacy Policy ",(0,Pt.jsx)(zd.default,{style:{marginLeft:"auto"}})]})]}),(0,Pt.jsxs)(Pv,{style:{marginTop:24},children:[(0,Pt.jsx)(no,{onClick:o,children:"No thanks"}),(0,Pt.jsx)(D,{onClick:r,children:"Accept"})]}),(0,Pt.jsx)(K,{protectedByPrivy:!0})]}),Pv=Uf.default.div`
592
+ `;var At=require("react/jsx-runtime"),Kf=()=>{let{user:e,logout:t}=H(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:i}=k(),{acceptTerms:a,closePrivyModal:s,createAnalyticsEvent:l}=W(),c=f=>{f?.preventDefault(),s({shouldCallAuthOnSuccess:!1}),t()};o.current=c;let u=async f=>{f.preventDefault(),await a(),e&&mr(e,r?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:h=>{console.error(h),l({eventName:"embedded_wallet_creation_failure_logout",payload:{error:h,screen:"AffirmativeConsentScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):s()};return(0,At.jsx)(Fv,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:u,onDecline:c})},Fv=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>(0,At.jsxs)(At.Fragment,{children:[(0,At.jsx)(A,{closeable:!1}),(0,At.jsx)(qf.default,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),(0,At.jsx)(ve,{style:{marginTop:24},children:"One last step"}),(0,At.jsx)(we,{children:"By signing up, you agree to our terms and privacy policy."}),(0,At.jsxs)(lo,{style:{marginTop:24},children:[e&&(0,At.jsxs)(Zd,{target:"_blank",href:e,children:["View Terms ",(0,At.jsx)(Jd.default,{style:{marginLeft:"auto"}})]}),t&&(0,At.jsxs)(Zd,{target:"_blank",href:t,children:["View Privacy Policy ",(0,At.jsx)(Jd.default,{style:{marginLeft:"auto"}})]})]}),(0,At.jsxs)(Bv,{style:{marginTop:24},children:[(0,At.jsx)(ao,{onClick:o,children:"No thanks"}),(0,At.jsx)(U,{onClick:r,children:"Accept"})]}),(0,At.jsx)(j,{protectedByPrivy:!0})]}),Bv=$f.default.div`
578
593
  display: flex;
579
594
  gap: 10px;
580
- `;var $d=h(require("styled-components"));var Bf=h(require("styled-components")),Xl=Bf.default.span`
595
+ `;var Xd=y(require("styled-components"));var jf=y(require("styled-components")),nc=jf.default.span`
581
596
  && {
582
597
  width: 82px;
583
598
  height: 82px;
@@ -592,7 +607,7 @@ Resources:
592
607
  transition: border-color 800ms;
593
608
  border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
594
609
  }
595
- `;var Hf=h(require("styled-components")),Sv=Hf.default.div`
610
+ `;var Yf=y(require("styled-components")),Hv=Yf.default.div`
596
611
  display: flex;
597
612
  flex-direction: column;
598
613
  justify-content: center;
@@ -615,7 +630,7 @@ Resources:
615
630
  left: -19px;
616
631
  top: -19px;
617
632
  }
618
- `,Mt=Sv;var qd=require("react/jsx-runtime"),ec=({style:e,...t})=>(0,qd.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...t,children:(0,qd.jsx)("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})});var Ct=require("react/jsx-runtime"),Gf=()=>{let{navigate:e,app:t}=k(),r=t?.allowlistConfig.errorTitle||"You don't have access to this app",o=t?.allowlistConfig.errorDetail||"Have you been invited?",n=t?.allowlistConfig.errorCtaText||"Try another account";return(0,Ct.jsxs)(Ct.Fragment,{children:[(0,Ct.jsx)(S,{}),(0,Ct.jsxs)(_v,{children:[(0,Ct.jsx)(Mt,{children:(0,Ct.jsxs)("div",{children:[(0,Ct.jsx)(Xl,{}),(0,Ct.jsx)(ec,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),(0,Ct.jsxs)(xv,{children:[typeof r=="string"?(0,Ct.jsx)("h3",{children:r}):(0,Ct.jsx)(Ct.Fragment,{children:r}),typeof o=="string"?(0,Ct.jsx)("p",{children:o}):(0,Ct.jsx)(Ct.Fragment,{children:o})]}),t?.allowlistConfig.errorCtaLink?(0,Ct.jsx)(D,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):(0,Ct.jsx)(D,{onClick:()=>{e("LANDING")},children:n})]})]})},_v=$d.default.div`
633
+ `,Et=Hv;var Qd=require("react/jsx-runtime"),ic=({style:e,...t})=>(0,Qd.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...t,children:(0,Qd.jsx)("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})});var Tt=require("react/jsx-runtime"),Zf=()=>{let{navigate:e,app:t}=k(),r=t?.allowlistConfig.errorTitle||"You don't have access to this app",o=t?.allowlistConfig.errorDetail||"Have you been invited?",n=t?.allowlistConfig.errorCtaText||"Try another account";return(0,Tt.jsxs)(Tt.Fragment,{children:[(0,Tt.jsx)(A,{}),(0,Tt.jsxs)(Gv,{children:[(0,Tt.jsx)(Et,{children:(0,Tt.jsxs)("div",{children:[(0,Tt.jsx)(nc,{}),(0,Tt.jsx)(ic,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),(0,Tt.jsxs)(Vv,{children:[typeof r=="string"?(0,Tt.jsx)("h3",{children:r}):(0,Tt.jsx)(Tt.Fragment,{children:r}),typeof o=="string"?(0,Tt.jsx)("p",{children:o}):(0,Tt.jsx)(Tt.Fragment,{children:o})]}),t?.allowlistConfig.errorCtaLink?(0,Tt.jsx)(U,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):(0,Tt.jsx)(U,{onClick:()=>{e("LANDING")},children:n})]})]})},Gv=Xd.default.div`
619
634
  display: flex;
620
635
  flex-direction: column;
621
636
  align-items: center;
@@ -623,11 +638,11 @@ Resources:
623
638
  gap: 24px;
624
639
  width: 100%;
625
640
  padding-bottom: 16px;
626
- `,xv=$d.default.div`
641
+ `,Vv=Xd.default.div`
627
642
  display: flex;
628
643
  flex-direction: column;
629
644
  gap: 8px;
630
- `;var Zf=h(require("@heroicons/react/24/outline/EnvelopeIcon")),Jf=h(require("@heroicons/react/24/outline/PhoneIcon")),mn=require("react"),Qf=require("react-device-detect"),Di=h(require("styled-components"));var hr=h(require("styled-components")),Vr=hr.default.div`
645
+ `;var nh=y(require("@heroicons/react/24/outline/EnvelopeIcon")),ih=y(require("@heroicons/react/24/outline/PhoneIcon")),fn=require("react"),ah=require("react-device-detect"),Hi=y(require("styled-components"));var yr=y(require("styled-components")),Vr=yr.default.div`
631
646
  display: flex;
632
647
  flex-direction: column;
633
648
  align-items: flex-start;
@@ -635,36 +650,36 @@ Resources:
635
650
  margin-top: auto;
636
651
  gap: 16px;
637
652
  flex-grow: 100;
638
- `,or=hr.default.div`
653
+ `,nr=yr.default.div`
639
654
  display: flex;
640
655
  flex-direction: column;
641
656
  align-items: center;
642
657
  justify-content: center;
643
658
  flex-grow: 1;
644
659
  width: 100%;
645
- `,Vf=hr.default.div`
660
+ `,Jf=yr.default.div`
646
661
  display: flex;
647
662
  flex-direction: column;
648
663
  align-items: center;
649
664
  width: 100%;
650
- `,Ni=(0,hr.default)(or)`
665
+ `,Bi=(0,yr.default)(nr)`
651
666
  padding: 20px 0;
652
- `,lo=(0,hr.default)(or)`
667
+ `,po=(0,yr.default)(nr)`
653
668
  gap: 16px;
654
- `,Kd=hr.default.div`
669
+ `,ep=yr.default.div`
655
670
  display: flex;
656
671
  flex-direction: column;
657
672
  width: 100%;
658
- `,wt=hr.default.div`
673
+ `,dt=yr.default.div`
659
674
  display: flex;
660
675
  flex-direction: column;
661
676
  gap: 8px;
662
- `,sT=hr.default.div`
677
+ `,TT=yr.default.div`
663
678
  display: flex;
664
679
  flex-direction: column;
665
680
  justify-content: space-between;
666
681
  height: 100%;
667
- `,zf=hr.default.div`
682
+ `,Qf=yr.default.div`
668
683
  display: flex;
669
684
  flex-direction: column;
670
685
  justify-content: flex-start;
@@ -687,13 +702,13 @@ Resources:
687
702
  color: var(--privy-color-foreground-3);
688
703
  font-size: 14px;
689
704
  }
690
- `,ae=hr.default.div`
705
+ `,ae=yr.default.div`
691
706
  height: 16px;
692
- `,me=hr.default.div`
707
+ `,pe=yr.default.div`
693
708
  height: 12px;
694
- `,qf=hr.default.div`
709
+ `,Xf=yr.default.div`
695
710
  position: relative;
696
- `,$f=hr.default.div`
711
+ `,eh=yr.default.div`
697
712
  background-color: var(--privy-color-accent);
698
713
  display: flex;
699
714
  justify-content: center;
@@ -701,9 +716,9 @@ Resources:
701
716
  border-radius: 50%;
702
717
  border-color: white;
703
718
  border-width: 2px !important;
704
- `;var tc=h(require("styled-components")),co=require("react/jsx-runtime"),Va=({title:e,description:t,children:r,...o})=>(0,co.jsx)(Kf,{...o,children:(0,co.jsxs)(co.Fragment,{children:[(0,co.jsx)("h3",{children:e}),typeof t=="string"?(0,co.jsx)("p",{children:t}):t,r]})}),Po=(0,tc.default)(Va)`
719
+ `;var ac=y(require("styled-components")),uo=require("react/jsx-runtime"),Za=({title:e,description:t,children:r,...o})=>(0,uo.jsx)(th,{...o,children:(0,uo.jsxs)(uo.Fragment,{children:[(0,uo.jsx)("h3",{children:e}),typeof t=="string"?(0,uo.jsx)("p",{children:t}):t,r]})}),_o=(0,ac.default)(Za)`
705
720
  margin-bottom: 24px;
706
- `,Ve=({title:e,description:t,icon:r,children:o,...n})=>(0,co.jsxs)(Av,{...n,children:[r||null,(0,co.jsx)("h3",{children:e}),t&&typeof t=="string"?(0,co.jsx)("p",{children:t}):t,o]}),Kf=tc.default.div`
721
+ `,Ve=({title:e,description:t,icon:r,children:o,...n})=>(0,uo.jsxs)(zv,{...n,children:[r||null,(0,uo.jsx)("h3",{children:e}),t&&typeof t=="string"?(0,uo.jsx)("p",{children:t}):t,o]}),th=ac.default.div`
707
722
  display: flex;
708
723
  flex-direction: column;
709
724
  justify-content: flex-start;
@@ -723,7 +738,7 @@ Resources:
723
738
  color: var(--privy-color-foreground-2);
724
739
  font-size: 14px;
725
740
  }
726
- `,Av=(0,tc.default)(Kf)`
741
+ `,zv=(0,ac.default)(th)`
727
742
  align-items: center;
728
743
  text-align: center;
729
744
  gap: 16px;
@@ -731,7 +746,7 @@ Resources:
731
746
  h3 {
732
747
  margin-bottom: 24px;
733
748
  }
734
- `;var xe=require("react/jsx-runtime"),jd=6,jf=new Array(jd).fill(""),kv=1400;var Xf=()=>{let{app:e,navigate:t,navigateBack:r,setModalData:o,onUserCloseViaDialogOrKeybindRef:n}=k(),{closePrivyModal:i,resendEmailCode:a,resendSmsCode:l,getAuthMeta:s,loginWithCode:c,updateWallets:u,createAnalyticsEvent:y}=W(),{authenticated:f,logout:v,user:C}=G(),[g,_]=(0,mn.useState)(jf),[x,b]=(0,mn.useState)(!1),[A,R]=(0,mn.useState)(null),[U,M]=(0,mn.useState)(null);n.current=()=>null;let I=s()?.email?0:1,V=it,j=V-500;(0,mn.useEffect)(()=>{if(f&&x&&C){if(e?.legal.requireUsersAcceptTerms&&!C.hasAcceptedTerms){let we=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},j);return()=>clearTimeout(we)}if(pr(C,e?.embeddedWallets?.createOnLogin)){let we=setTimeout(()=>{o({createWallet:{onSuccess:()=>{},onFailure:be=>{console.error(be),y({eventName:"embedded_wallet_creation_failure_logout",payload:{error:be,screen:"AwaitingPasswordlessCodeScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},j);return()=>clearTimeout(we)}else{u();let we=setTimeout(()=>i({shouldCallAuthOnSuccess:!0,isSuccess:!0}),V);return()=>clearTimeout(we)}}},[f,x,C]),(0,mn.useEffect)(()=>{if(A&&U===0){let ye=setTimeout(()=>{_(jf),R(null),document.querySelector("input[name=code-0]")?.focus()},kv);return()=>clearTimeout(ye)}},[A]);let te=ye=>{ye.preventDefault();let we=ye.currentTarget.value.replace(" ","");if(we==="")return;if(isNaN(Number(we))){R("Code should be numeric"),M(1);return}R(null),M(null);let be=Number(ye.currentTarget.name?.charAt(5)),Ne=[...we||[""]].slice(0,jd-be),le=[...g.slice(0,be),...Ne,...g.slice(be+Ne.length)];_(le);let er=Ne.length,Et=Math.min(Math.max(be+er,0),jd-1);isNaN(Number(ye.currentTarget.value))||document.querySelector(`input[name=code-${Et}]`)?.focus(),le.every(sr=>sr&&!isNaN(+sr))&&(document.querySelector(`input[name=code-${Et}]`)?.blur(),c(le.join("")).then(()=>b(!0)).catch(_t=>{if(_t?.status===422)R("Invalid or expired verification code");else if(_t instanceof Xr&&_t.privyErrorCode==="cannot_link_more_of_type")R(_t.message);else if(_t instanceof Xr&&_t.privyErrorCode==="max_accounts_reached"){console.error(new Ur(_t).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else R("Issue verifying code");M(0)}))},L=ye=>{U===1&&(R(null),M(null));let we=[...g.slice(0,ye),"",...g.slice(ye+1)];_(we),ye>0&&document.querySelector(`input[name=code-${ye-1}]`)?.focus()},z=I==0?(0,xe.jsx)(Zf.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):(0,xe.jsx)(Jf.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),O=I==0?(0,xe.jsxs)("p",{children:["Please check ",(0,xe.jsx)(Yf,{children:s()?.email})," for an email from privy.io and enter your code below."]}):(0,xe.jsxs)("p",{children:["Please check ",(0,xe.jsx)(Yf,{children:s()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)(S,{backFn:()=>r()},"header"),(0,xe.jsxs)(Rv,{children:[(0,xe.jsx)(Ve,{title:"Enter confirmation code",description:O,icon:z}),(0,xe.jsxs)(Vf,{children:[(0,xe.jsxs)(Iv,{children:[(0,xe.jsx)(Mv,{fail:!!A,success:x,children:(0,xe.jsx)("span",{children:A||(x?"Success!":"")})}),(0,xe.jsx)("div",{children:g.map((ye,we)=>(0,xe.jsx)("input",{name:`code-${we}`,type:"text",value:g[we],onChange:te,onKeyUp:be=>{be.key==="Backspace"&&L(we)},inputMode:"numeric",autoFocus:we===0,pattern:"[0-9]",className:`${x?"success":""} ${A?"fail":""}`,autoComplete:Qf.isMobile?"one-time-code":"off"},we))})]}),(0,xe.jsx)(Wv,{children:I==0?(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)("span",{children:"Didn't get an email?"}),(0,xe.jsx)("button",{onClick:a,children:"Resend code"})]}):(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)("span",{children:"Didn't get a message?"}),(0,xe.jsx)("button",{onClick:l,children:"Resend code"})]})})]})]}),(0,xe.jsx)(K,{protectedByPrivy:!0})]})},Rv=Di.default.div`
749
+ `;var xe=require("react/jsx-runtime"),tp=6,rh=new Array(tp).fill(""),qv=1400;var sh=()=>{let{app:e,navigate:t,navigateBack:r,setModalData:o,onUserCloseViaDialogOrKeybindRef:n}=k(),{closePrivyModal:i,resendEmailCode:a,resendSmsCode:s,getAuthMeta:l,loginWithCode:c,updateWallets:u,createAnalyticsEvent:f}=W(),{authenticated:h,logout:v,user:C}=H(),[g,P]=(0,fn.useState)(rh),[S,E]=(0,fn.useState)(!1),[x,R]=(0,fn.useState)(null),[D,I]=(0,fn.useState)(null);n.current=()=>null;let M=l()?.email?0:1,V=et,z=V-500;(0,fn.useEffect)(()=>{if(h&&S&&C){if(e?.legal.requireUsersAcceptTerms&&!C.hasAcceptedTerms){let be=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},z);return()=>clearTimeout(be)}if(mr(C,e?.embeddedWallets?.createOnLogin)){let be=setTimeout(()=>{o({createWallet:{onSuccess:()=>{},onFailure:Ee=>{console.error(Ee),f({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Ee,screen:"AwaitingPasswordlessCodeScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},z);return()=>clearTimeout(be)}else{u();let be=setTimeout(()=>i({shouldCallAuthOnSuccess:!0,isSuccess:!0}),V);return()=>clearTimeout(be)}}},[h,S,C]),(0,fn.useEffect)(()=>{if(x&&D===0){let ge=setTimeout(()=>{P(rh),R(null),document.querySelector("input[name=code-0]")?.focus()},qv);return()=>clearTimeout(ge)}},[x]);let re=ge=>{ge.preventDefault();let be=ge.currentTarget.value.replace(" ","");if(be==="")return;if(isNaN(Number(be))){R("Code should be numeric"),I(1);return}R(null),I(null);let Ee=Number(ge.currentTarget.name?.charAt(5)),Ne=[...be||[""]].slice(0,tp-Ee),le=[...g.slice(0,Ee),...Ne,...g.slice(Ee+Ne.length)];P(le);let tr=Ne.length,_t=Math.min(Math.max(Ee+tr,0),tp-1);isNaN(Number(ge.currentTarget.value))||document.querySelector(`input[name=code-${_t}]`)?.focus(),le.every(lr=>lr&&!isNaN(+lr))&&(document.querySelector(`input[name=code-${_t}]`)?.blur(),c(le.join("")).then(()=>E(!0)).catch(kt=>{if(kt?.status===422)R("Invalid or expired verification code");else if(kt instanceof Xr&&kt.privyErrorCode==="cannot_link_more_of_type")R(kt.message);else if(kt instanceof Xr&&kt.privyErrorCode==="max_accounts_reached"){console.error(new Fr(kt).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else R("Issue verifying code");I(0)}))},L=ge=>{D===1&&(R(null),I(null));let be=[...g.slice(0,ge),"",...g.slice(ge+1)];P(be),ge>0&&document.querySelector(`input[name=code-${ge-1}]`)?.focus()},K=M==0?(0,xe.jsx)(nh.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):(0,xe.jsx)(ih.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),O=M==0?(0,xe.jsxs)("p",{children:["Please check ",(0,xe.jsx)(oh,{children:l()?.email})," for an email from privy.io and enter your code below."]}):(0,xe.jsxs)("p",{children:["Please check ",(0,xe.jsx)(oh,{children:l()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)(A,{backFn:()=>r()},"header"),(0,xe.jsxs)($v,{children:[(0,xe.jsx)(Ve,{title:"Enter confirmation code",description:O,icon:K}),(0,xe.jsxs)(Jf,{children:[(0,xe.jsxs)(Kv,{children:[(0,xe.jsx)(jv,{fail:!!x,success:S,children:(0,xe.jsx)("span",{children:x||(S?"Success!":"")})}),(0,xe.jsx)("div",{children:g.map((ge,be)=>(0,xe.jsx)("input",{name:`code-${be}`,type:"text",value:g[be],onChange:re,onKeyUp:Ee=>{Ee.key==="Backspace"&&L(be)},inputMode:"numeric",autoFocus:be===0,pattern:"[0-9]",className:`${S?"success":""} ${x?"fail":""}`,autoComplete:ah.isMobile?"one-time-code":"off"},be))})]}),(0,xe.jsx)(Yv,{children:M==0?(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)("span",{children:"Didn't get an email?"}),(0,xe.jsx)("button",{onClick:a,children:"Resend code"})]}):(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)("span",{children:"Didn't get a message?"}),(0,xe.jsx)("button",{onClick:s,children:"Resend code"})]})})]})]}),(0,xe.jsx)(j,{protectedByPrivy:!0})]})},$v=Hi.default.div`
735
750
  display: flex;
736
751
  flex-direction: column;
737
752
  align-items: flex-start;
@@ -739,7 +754,7 @@ Resources:
739
754
  margin: auto;
740
755
  gap: 16px;
741
756
  flex-grow: 1;
742
- `,Iv=Di.default.div`
757
+ `,Kv=Hi.default.div`
743
758
  display: flex;
744
759
  flex-direction: column;
745
760
  width: 100%;
@@ -796,7 +811,7 @@ Resources:
796
811
  transform: translate(1px, 0px);
797
812
  }
798
813
  }
799
- `,Mv=Di.default.div`
814
+ `,jv=Hi.default.div`
800
815
  line-height: 20px;
801
816
  height: 20px;
802
817
  font-size: 13px;
@@ -804,7 +819,7 @@ Resources:
804
819
  display: flex;
805
820
  justify-content: flex-end;
806
821
  width: 100%;
807
- `,Wv=Di.default.div`
822
+ `,Yv=Hi.default.div`
808
823
  font-size: 13px;
809
824
  color: var(--privy-color-foreground-3);
810
825
  display: flex;
@@ -818,10 +833,10 @@ Resources:
818
833
  > button {
819
834
  text-decoration: underline;
820
835
  }
821
- `,Yf=Di.default.span`
836
+ `,oh=Hi.default.span`
822
837
  font-weight: 500;
823
838
  word-break: break-all;
824
- `;var oh=h(require("@heroicons/react/24/solid/CheckCircleIcon")),nh=h(require("@heroicons/react/24/solid/XCircleIcon")),Ar=require("react"),ih=h(require("styled-components"));var eh=h(require("styled-components"));var po=require("react/jsx-runtime"),th=({icon:e})=>{let t=e;return(0,po.jsx)(po.Fragment,{children:(0,po.jsx)(Lv,{children:(0,po.jsxs)("div",{children:[(0,po.jsx)(At,{}),typeof t=="string"?(0,po.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?(0,po.jsx)(t,{style:{width:"38px",height:"38px"}}):(0,po.jsx)("span",{})]})})})},Lv=eh.default.div`
839
+ `;var ph=y(require("@heroicons/react/24/solid/CheckCircleIcon")),uh=y(require("@heroicons/react/24/solid/XCircleIcon")),kr=require("react"),mh=y(require("styled-components"));var lh=y(require("styled-components"));var mo=require("react/jsx-runtime"),ch=({icon:e})=>{let t=e;return(0,mo.jsx)(mo.Fragment,{children:(0,mo.jsx)(Zv,{children:(0,mo.jsxs)("div",{children:[(0,mo.jsx)(wt,{}),typeof t=="string"?(0,mo.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?(0,mo.jsx)(t,{style:{width:"38px",height:"38px"}}):(0,mo.jsx)("span",{})]})})})},Zv=lh.default.div`
825
840
  display: flex;
826
841
  flex-direction: column;
827
842
  justify-content: center;
@@ -844,14 +859,14 @@ Resources:
844
859
  left: -19px;
845
860
  top: -19px;
846
861
  }
847
- `;var Wt=require("react/jsx-runtime"),ah=500,rh=ah*2,sh=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:i}=k(),{status:a,token:l,waitForResult:s,reset:c,execute:u}=_e(),y=(0,Ar.useRef)([]),f=z=>{y.current=[z,...y.current]},[v,C]=(0,Ar.useState)(!0);(0,Ar.useEffect)(()=>{let z=setTimeout(C,rh,!1);return f(z),()=>{y.current.forEach(O=>clearTimeout(O)),y.current=[]}},[]);let[g,_]=(0,Ar.useState)(""),[x,b]=(0,Ar.useState)("Checking that you are a human..."),[A,R]=(0,Ar.useState)((0,Wt.jsx)(D,{onClick:()=>{},disabled:!0,children:"Continue"})),[U,M]=(0,Ar.useState)(!1),[I,V]=(0,Ar.useState)(3),j=r?.captchaModalData,te=async z=>{try{await j?.callback(z),j?.onSuccessNavigateTo&&n(j?.onSuccessNavigateTo,!1)}catch(O){if(O instanceof oo)return;{let ye={error:O,previousScreen:e||"LANDING"};i({errorModalData:ye}),n(j?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};(0,Ar.useEffect)(()=>{if(a==="success"){let z=setTimeout(async()=>{let O=await s();!O||j?.userIntentRequired||te(O)},rh);f(z)}else if(a==="ready"){let z=setTimeout(()=>{a==="ready"&&u()},ah);f(z)}},[a]),(0,Ar.useEffect)(()=>{if(!v)switch(a){case"success":_("Success!"),b("CAPTCHA passed successfully."),R((0,Wt.jsx)(D,{onClick:()=>{M(!0),te(l)},disabled:!j?.userIntentRequired,loading:U,children:j?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":_(""),b("Checking that you are a human..."),R((0,Wt.jsx)(D,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":_("Something went wrong"),I<=0?(b("If you use an adblocker or VPN, try disabling and re-attempting."),R(null)):(b("You did not pass CAPTCHA. Please try again."),R((0,Wt.jsx)(D,{onClick:L,children:"Retry"})));break;case"ready":default:break}},[a,v,U]);let L=async()=>{if(I<=0)return;V(O=>O-1),c(),u();let z=await s();!z||j?.userIntentRequired||te(z)};return(0,Wt.jsxs)(Wt.Fragment,{children:[(0,Wt.jsx)(S,{backFn:!e||t===e?void 0:o}),(0,Wt.jsxs)(Ov,{children:[a==="success"?(0,Wt.jsx)(oh.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?(0,Wt.jsx)(nh.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):(0,Wt.jsx)(th,{}),(0,Wt.jsxs)(wt,{children:[g?(0,Wt.jsx)("h3",{children:g}):null,(0,Wt.jsx)("p",{children:x})]}),A]}),(0,Wt.jsx)(q,{})]})},Ov=ih.default.div`
862
+ `;var Lt=require("react/jsx-runtime"),fh=500,dh=fh*2,hh=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:i}=k(),{status:a,token:s,waitForResult:l,reset:c,execute:u}=Ae(),f=(0,kr.useRef)([]),h=K=>{f.current=[K,...f.current]},[v,C]=(0,kr.useState)(!0);(0,kr.useEffect)(()=>{let K=setTimeout(C,dh,!1);return h(K),()=>{f.current.forEach(O=>clearTimeout(O)),f.current=[]}},[]);let[g,P]=(0,kr.useState)(""),[S,E]=(0,kr.useState)("Checking that you are a human..."),[x,R]=(0,kr.useState)((0,Lt.jsx)(U,{onClick:()=>{},disabled:!0,children:"Continue"})),[D,I]=(0,kr.useState)(!1),[M,V]=(0,kr.useState)(3),z=r?.captchaModalData,re=async K=>{try{await z?.callback(K),z?.onSuccessNavigateTo&&n(z?.onSuccessNavigateTo,!1)}catch(O){if(O instanceof no)return;{let ge={error:O,previousScreen:e||"LANDING"};i({errorModalData:ge}),n(z?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};(0,kr.useEffect)(()=>{if(a==="success"){let K=setTimeout(async()=>{let O=await l();!O||z?.userIntentRequired||re(O)},dh);h(K)}else if(a==="ready"){let K=setTimeout(()=>{a==="ready"&&u()},fh);h(K)}},[a]),(0,kr.useEffect)(()=>{if(!v)switch(a){case"success":P("Success!"),E("CAPTCHA passed successfully."),R((0,Lt.jsx)(U,{onClick:()=>{I(!0),re(s)},disabled:!z?.userIntentRequired,loading:D,children:z?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":P(""),E("Checking that you are a human..."),R((0,Lt.jsx)(U,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":P("Something went wrong"),M<=0?(E("If you use an adblocker or VPN, try disabling and re-attempting."),R(null)):(E("You did not pass CAPTCHA. Please try again."),R((0,Lt.jsx)(U,{onClick:L,children:"Retry"})));break;case"ready":default:break}},[a,v,D]);let L=async()=>{if(M<=0)return;V(O=>O-1),c(),u();let K=await l();!K||z?.userIntentRequired||re(K)};return(0,Lt.jsxs)(Lt.Fragment,{children:[(0,Lt.jsx)(A,{backFn:!e||t===e?void 0:o}),(0,Lt.jsxs)(Jv,{children:[a==="success"?(0,Lt.jsx)(ph.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?(0,Lt.jsx)(uh.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):(0,Lt.jsx)(ch,{}),(0,Lt.jsxs)(dt,{children:[g?(0,Lt.jsx)("h3",{children:g}):null,(0,Lt.jsx)("p",{children:S})]}),x]}),(0,Lt.jsx)($,{})]})},Jv=mh.default.div`
848
863
  display: flex;
849
864
  flex-direction: column;
850
865
  align-items: center;
851
866
  justify-content: center;
852
867
  gap: 24px;
853
868
  width: 100%;
854
- `;var fh=h(require("@heroicons/react/24/outline/WalletIcon")),Yd=require("react-device-detect"),hh=h(require("styled-components"));var nr=require("react/jsx-runtime"),lh=({...e})=>(0,nr.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[(0,nr.jsx)("defs",{children:(0,nr.jsxs)("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[(0,nr.jsx)("stop",{offset:"0",stopColor:"#f1562b"}),(0,nr.jsx)("stop",{offset:"0.3",stopColor:"#f1542b"}),(0,nr.jsx)("stop",{offset:"0.41",stopColor:"#f04d2a"}),(0,nr.jsx)("stop",{offset:"0.49",stopColor:"#ef4229"}),(0,nr.jsx)("stop",{offset:"0.5",stopColor:"#ef4029"}),(0,nr.jsx)("stop",{offset:"0.56",stopColor:"#e83e28"}),(0,nr.jsx)("stop",{offset:"0.67",stopColor:"#e13c26"}),(0,nr.jsx)("stop",{offset:"1",stopColor:"#df3c26"})]})}),(0,nr.jsx)("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),(0,nr.jsx)("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});var Lt=require("react/jsx-runtime"),ch=({style:e,...t})=>(0,Lt.jsxs)("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,Lt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),(0,Lt.jsx)("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:(0,Lt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),(0,Lt.jsxs)("g",{mask:"url(#mask0_16909_31415)",children:[(0,Lt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),(0,Lt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),(0,Lt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),(0,Lt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),(0,Lt.jsxs)("defs",{children:[(0,Lt.jsxs)("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Lt.jsx)("stop",{stopColor:"#002D72"}),(0,Lt.jsx)("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),(0,Lt.jsxs)("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Lt.jsx)("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),(0,Lt.jsx)("stop",{offset:"1",stopColor:"#002D72"})]})]})]});var mt=require("react/jsx-runtime"),dh=e=>(0,mt.jsxs)("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,mt.jsx)("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),(0,mt.jsx)("path",{d:"M43.6781 28.2954C45.1053 25.0988 38.0498 16.168 31.3094 12.4472C27.0608 9.56481 22.6337 9.96081 21.737 11.2264C19.7693 14.0039 28.2527 16.3574 33.9263 19.1037C32.7067 19.6348 31.5574 20.5879 30.8816 21.8067C28.7664 19.4915 24.1239 17.4977 18.6765 19.1037C15.0056 20.186 11.9547 22.7374 10.7756 26.5911C10.4891 26.4635 10.1719 26.3925 9.83814 26.3925C8.56192 26.3925 7.52734 27.4298 7.52734 28.7094C7.52734 29.989 8.56192 31.0263 9.83814 31.0263C10.0747 31.0263 10.8143 30.8672 10.8143 30.8672L22.6337 30.953C17.9068 38.4713 14.1713 39.5704 14.1713 40.8729C14.1713 42.1754 17.7455 41.8224 19.0876 41.3369C25.5121 39.0127 32.4123 31.7692 33.5964 29.6841C38.5688 30.3061 42.7476 30.3796 43.6781 28.2954Z",fill:"url(#paint0_linear_81034_11443)"}),(0,mt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.8741 19.076C33.8926 19.084 33.911 19.092 33.9294 19.1001C34.1923 18.9962 34.1498 18.6068 34.0776 18.301C33.9116 17.5981 31.0479 14.7629 28.3588 13.493C24.6934 11.762 21.9946 11.8518 21.5972 12.65C22.3407 14.1849 25.8031 15.6258 29.4193 17.1308C30.9407 17.7639 32.4893 18.4084 33.8741 19.076Z",fill:"url(#paint1_linear_81034_11443)"}),(0,mt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.272 34.5374C28.5323 34.2543 27.697 33.9945 26.7477 33.7587C27.7625 31.9382 27.9754 29.2432 27.0171 27.5392C25.6721 25.1478 23.9838 23.875 20.0605 23.875C17.9027 23.875 12.093 24.6037 11.9899 29.4663C11.9791 29.9743 11.9895 30.44 12.026 30.8685L22.6335 30.9456C21.2017 33.2229 19.8609 34.9113 18.6873 36.1947C20.0979 36.5571 21.2615 36.8612 22.3297 37.1404C23.3394 37.4043 24.2638 37.646 25.2309 37.8934C26.6941 36.8249 28.0698 35.6597 29.272 34.5374Z",fill:"url(#paint2_linear_81034_11443)"}),(0,mt.jsx)("path",{d:"M10.6324 30.3712C11.0658 34.065 13.1596 35.5127 17.4381 35.9411C21.7166 36.3695 24.1708 36.0821 27.4381 36.3801C30.167 36.6291 32.6036 38.0233 33.5075 37.5415C34.321 37.1079 33.8659 35.5412 32.7774 34.5361C31.3663 33.2333 29.4135 32.3274 25.9773 32.006C26.6621 30.1261 26.4702 27.4903 25.4067 26.0562C23.8689 23.9827 21.0305 23.0453 17.4381 23.4549C13.6848 23.8828 10.0885 25.7354 10.6324 30.3712Z",fill:"url(#paint3_linear_81034_11443)"}),(0,mt.jsxs)("defs",{children:[(0,mt.jsxs)("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[(0,mt.jsx)("stop",{stopColor:"white"}),(0,mt.jsx)("stop",{offset:"1",stopColor:"white"})]}),(0,mt.jsxs)("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[(0,mt.jsx)("stop",{stopColor:"#8697FF"}),(0,mt.jsx)("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),(0,mt.jsxs)("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[(0,mt.jsx)("stop",{stopColor:"#8697FF"}),(0,mt.jsx)("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),(0,mt.jsxs)("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[(0,mt.jsx)("stop",{stopColor:"white"}),(0,mt.jsx)("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]});var J=require("react/jsx-runtime"),ph=({style:e,...t})=>(0,J.jsxs)("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,J.jsx)("g",{clipPath:"url(#clip0_5_32)",children:(0,J.jsxs)("g",{clipPath:"url(#clip1_5_32)",children:[(0,J.jsx)("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:(0,J.jsx)("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),(0,J.jsx)("g",{mask:"url(#mask0_5_32)",children:(0,J.jsx)("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),(0,J.jsx)("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),(0,J.jsx)("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),(0,J.jsx)("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),(0,J.jsx)("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),(0,J.jsx)("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),(0,J.jsx)("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),(0,J.jsx)("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),(0,J.jsx)("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),(0,J.jsx)("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),(0,J.jsxs)("defs",{children:[(0,J.jsxs)("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[(0,J.jsx)("stop",{stopColor:"#174299"}),(0,J.jsx)("stop",{offset:"1",stopColor:"#001E59"})]}),(0,J.jsxs)("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[(0,J.jsx)("stop",{offset:"0.770277",stopColor:"#FF4000"}),(0,J.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,J.jsxs)("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,J.jsx)("stop",{stopColor:"#FF4000"}),(0,J.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,J.jsxs)("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[(0,J.jsx)("stop",{stopColor:"#8754C9"}),(0,J.jsx)("stop",{offset:"1",stopColor:"#FF4000"})]}),(0,J.jsxs)("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[(0,J.jsx)("stop",{offset:"0.723929",stopColor:"#FFF700"}),(0,J.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,J.jsxs)("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,J.jsx)("stop",{stopColor:"#FFF700"}),(0,J.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,J.jsxs)("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[(0,J.jsx)("stop",{stopColor:"#FFF700"}),(0,J.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,J.jsxs)("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[(0,J.jsx)("stop",{offset:"0.59513",stopColor:"#00AAFF"}),(0,J.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,J.jsxs)("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[(0,J.jsx)("stop",{stopColor:"#00AAFF"}),(0,J.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,J.jsxs)("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[(0,J.jsx)("stop",{stopColor:"#00AAFF"}),(0,J.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,J.jsx)("clipPath",{id:"clip0_5_32",children:(0,J.jsx)("rect",{width:"120",height:"120",fill:"white"})}),(0,J.jsx)("clipPath",{id:"clip1_5_32",children:(0,J.jsx)("rect",{width:"120",height:"120",fill:"white"})})]})]});var yr=require("react/jsx-runtime"),uh=({style:e,...t})=>(0,yr.jsxs)("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,yr.jsx)("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),(0,yr.jsxs)("g",{filter:"url(#filter0_d_12393_20043)",children:[(0,yr.jsx)("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),(0,yr.jsx)("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),(0,yr.jsx)("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),(0,yr.jsx)("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),(0,yr.jsx)("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),(0,yr.jsx)("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),(0,yr.jsx)("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),(0,yr.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),(0,yr.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});var Vo=require("react/jsx-runtime"),mh=({style:e,...t})=>(0,Vo.jsxs)("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,Vo.jsxs)("g",{clipPath:"url(#clip0_1704_1423)",children:[(0,Vo.jsx)("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),(0,Vo.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),(0,Vo.jsx)("defs",{children:(0,Vo.jsx)("clipPath",{id:"clip0_1704_1423",children:(0,Vo.jsx)("rect",{width:"176",height:"176",fill:"white"})})})]});var zo=require("react/jsx-runtime"),zr={coinbase_wallet:{logo:Oa,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:Oa,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:Pi,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:wo,displayName:"Phantom"},rainbow:{logo:ph,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Ha,displayName:"WalletConnect"},zerion:{logo:mh,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:lh,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:ch,displayName:"Crypto.com DeFi Wallet"},uniswap:{logo:uh,displayName:"Uniswap Wallet",rdns:"org.uniswap.app"},okx_wallet:{displayName:"OKX Wallet",rdns:"com.okex.wallet",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII="},rabby_wallet:{logo:dh,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"}},Yn=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:i}=k(),{connectWallet:a}=W(),l=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,s;return n.connectorType==="phantom"?s=()=>{an()?(a(n,l),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(Yd.isMobile?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:n.connectorType==="coinbase_wallet"&&n.connectionOptions==="eoaOnly"&&Yd.isMobile&&!Fs()?s=()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`}:s=()=>{a(n,l),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")},(0,zo.jsxs)(Fv,{onClick:s,children:[(0,zo.jsx)(Uv,{icon:Dv(e,n.connectorType,n.walletClientType)??r,name:n.walletClientType}),(0,zo.jsx)("span",{children:Nv(e,n.connectorType,n.walletClientType)||t||n.walletClientType}),(0,zo.jsx)("span",{id:"connect-text",children:"Connect"})]})},Nv=(e,t,r)=>{if(zr[e]?.displayName)return e==="coinbase_wallet"?zr[r].displayName:zr[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},Dv=(e,t,r)=>{if(zr[e]?.logo)return e==="coinbase_wallet"?zr[r].logo:zr[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Ha},Uv=({icon:e,name:t})=>typeof e=="string"?(0,zo.jsx)("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?(0,zo.jsx)(fh.default,{}):e?(0,zo.jsx)(e,{}):null,Fv=(0,hh.default)(De)`
869
+ `;var Eh=y(require("@heroicons/react/24/outline/WalletIcon")),rp=require("react-device-detect"),Th=y(require("styled-components"));var ir=require("react/jsx-runtime"),yh=({...e})=>(0,ir.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[(0,ir.jsx)("defs",{children:(0,ir.jsxs)("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[(0,ir.jsx)("stop",{offset:"0",stopColor:"#f1562b"}),(0,ir.jsx)("stop",{offset:"0.3",stopColor:"#f1542b"}),(0,ir.jsx)("stop",{offset:"0.41",stopColor:"#f04d2a"}),(0,ir.jsx)("stop",{offset:"0.49",stopColor:"#ef4229"}),(0,ir.jsx)("stop",{offset:"0.5",stopColor:"#ef4029"}),(0,ir.jsx)("stop",{offset:"0.56",stopColor:"#e83e28"}),(0,ir.jsx)("stop",{offset:"0.67",stopColor:"#e13c26"}),(0,ir.jsx)("stop",{offset:"1",stopColor:"#df3c26"})]})}),(0,ir.jsx)("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),(0,ir.jsx)("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});var Ot=require("react/jsx-runtime"),gh=({style:e,...t})=>(0,Ot.jsxs)("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,Ot.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),(0,Ot.jsx)("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:(0,Ot.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),(0,Ot.jsxs)("g",{mask:"url(#mask0_16909_31415)",children:[(0,Ot.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),(0,Ot.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),(0,Ot.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),(0,Ot.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),(0,Ot.jsxs)("defs",{children:[(0,Ot.jsxs)("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Ot.jsx)("stop",{stopColor:"#002D72"}),(0,Ot.jsx)("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),(0,Ot.jsxs)("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Ot.jsx)("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),(0,Ot.jsx)("stop",{offset:"1",stopColor:"#002D72"})]})]})]});var ft=require("react/jsx-runtime"),vh=e=>(0,ft.jsxs)("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,ft.jsx)("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),(0,ft.jsx)("path",{d:"M43.6781 28.2954C45.1053 25.0988 38.0498 16.168 31.3094 12.4472C27.0608 9.56481 22.6337 9.96081 21.737 11.2264C19.7693 14.0039 28.2527 16.3574 33.9263 19.1037C32.7067 19.6348 31.5574 20.5879 30.8816 21.8067C28.7664 19.4915 24.1239 17.4977 18.6765 19.1037C15.0056 20.186 11.9547 22.7374 10.7756 26.5911C10.4891 26.4635 10.1719 26.3925 9.83814 26.3925C8.56192 26.3925 7.52734 27.4298 7.52734 28.7094C7.52734 29.989 8.56192 31.0263 9.83814 31.0263C10.0747 31.0263 10.8143 30.8672 10.8143 30.8672L22.6337 30.953C17.9068 38.4713 14.1713 39.5704 14.1713 40.8729C14.1713 42.1754 17.7455 41.8224 19.0876 41.3369C25.5121 39.0127 32.4123 31.7692 33.5964 29.6841C38.5688 30.3061 42.7476 30.3796 43.6781 28.2954Z",fill:"url(#paint0_linear_81034_11443)"}),(0,ft.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.8741 19.076C33.8926 19.084 33.911 19.092 33.9294 19.1001C34.1923 18.9962 34.1498 18.6068 34.0776 18.301C33.9116 17.5981 31.0479 14.7629 28.3588 13.493C24.6934 11.762 21.9946 11.8518 21.5972 12.65C22.3407 14.1849 25.8031 15.6258 29.4193 17.1308C30.9407 17.7639 32.4893 18.4084 33.8741 19.076Z",fill:"url(#paint1_linear_81034_11443)"}),(0,ft.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.272 34.5374C28.5323 34.2543 27.697 33.9945 26.7477 33.7587C27.7625 31.9382 27.9754 29.2432 27.0171 27.5392C25.6721 25.1478 23.9838 23.875 20.0605 23.875C17.9027 23.875 12.093 24.6037 11.9899 29.4663C11.9791 29.9743 11.9895 30.44 12.026 30.8685L22.6335 30.9456C21.2017 33.2229 19.8609 34.9113 18.6873 36.1947C20.0979 36.5571 21.2615 36.8612 22.3297 37.1404C23.3394 37.4043 24.2638 37.646 25.2309 37.8934C26.6941 36.8249 28.0698 35.6597 29.272 34.5374Z",fill:"url(#paint2_linear_81034_11443)"}),(0,ft.jsx)("path",{d:"M10.6324 30.3712C11.0658 34.065 13.1596 35.5127 17.4381 35.9411C21.7166 36.3695 24.1708 36.0821 27.4381 36.3801C30.167 36.6291 32.6036 38.0233 33.5075 37.5415C34.321 37.1079 33.8659 35.5412 32.7774 34.5361C31.3663 33.2333 29.4135 32.3274 25.9773 32.006C26.6621 30.1261 26.4702 27.4903 25.4067 26.0562C23.8689 23.9827 21.0305 23.0453 17.4381 23.4549C13.6848 23.8828 10.0885 25.7354 10.6324 30.3712Z",fill:"url(#paint3_linear_81034_11443)"}),(0,ft.jsxs)("defs",{children:[(0,ft.jsxs)("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[(0,ft.jsx)("stop",{stopColor:"white"}),(0,ft.jsx)("stop",{offset:"1",stopColor:"white"})]}),(0,ft.jsxs)("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[(0,ft.jsx)("stop",{stopColor:"#8697FF"}),(0,ft.jsx)("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),(0,ft.jsxs)("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[(0,ft.jsx)("stop",{stopColor:"#8697FF"}),(0,ft.jsx)("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),(0,ft.jsxs)("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[(0,ft.jsx)("stop",{stopColor:"white"}),(0,ft.jsx)("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]});var Q=require("react/jsx-runtime"),Ch=({style:e,...t})=>(0,Q.jsxs)("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,Q.jsx)("g",{clipPath:"url(#clip0_5_32)",children:(0,Q.jsxs)("g",{clipPath:"url(#clip1_5_32)",children:[(0,Q.jsx)("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:(0,Q.jsx)("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),(0,Q.jsx)("g",{mask:"url(#mask0_5_32)",children:(0,Q.jsx)("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),(0,Q.jsx)("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),(0,Q.jsx)("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),(0,Q.jsx)("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),(0,Q.jsx)("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),(0,Q.jsx)("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),(0,Q.jsx)("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),(0,Q.jsx)("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),(0,Q.jsx)("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),(0,Q.jsx)("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),(0,Q.jsxs)("defs",{children:[(0,Q.jsxs)("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[(0,Q.jsx)("stop",{stopColor:"#174299"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#001E59"})]}),(0,Q.jsxs)("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[(0,Q.jsx)("stop",{offset:"0.770277",stopColor:"#FF4000"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,Q.jsxs)("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,Q.jsx)("stop",{stopColor:"#FF4000"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,Q.jsxs)("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[(0,Q.jsx)("stop",{stopColor:"#8754C9"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#FF4000"})]}),(0,Q.jsxs)("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[(0,Q.jsx)("stop",{offset:"0.723929",stopColor:"#FFF700"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,Q.jsxs)("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,Q.jsx)("stop",{stopColor:"#FFF700"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,Q.jsxs)("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[(0,Q.jsx)("stop",{stopColor:"#FFF700"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,Q.jsxs)("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[(0,Q.jsx)("stop",{offset:"0.59513",stopColor:"#00AAFF"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,Q.jsxs)("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[(0,Q.jsx)("stop",{stopColor:"#00AAFF"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,Q.jsxs)("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[(0,Q.jsx)("stop",{stopColor:"#00AAFF"}),(0,Q.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,Q.jsx)("clipPath",{id:"clip0_5_32",children:(0,Q.jsx)("rect",{width:"120",height:"120",fill:"white"})}),(0,Q.jsx)("clipPath",{id:"clip1_5_32",children:(0,Q.jsx)("rect",{width:"120",height:"120",fill:"white"})})]})]});var gr=require("react/jsx-runtime"),wh=({style:e,...t})=>(0,gr.jsxs)("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,gr.jsx)("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),(0,gr.jsxs)("g",{filter:"url(#filter0_d_12393_20043)",children:[(0,gr.jsx)("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),(0,gr.jsx)("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),(0,gr.jsx)("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),(0,gr.jsx)("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),(0,gr.jsx)("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),(0,gr.jsx)("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),(0,gr.jsx)("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),(0,gr.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),(0,gr.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});var zo=require("react/jsx-runtime"),bh=({style:e,...t})=>(0,zo.jsxs)("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,zo.jsxs)("g",{clipPath:"url(#clip0_1704_1423)",children:[(0,zo.jsx)("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),(0,zo.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),(0,zo.jsx)("defs",{children:(0,zo.jsx)("clipPath",{id:"clip0_1704_1423",children:(0,zo.jsx)("rect",{width:"176",height:"176",fill:"white"})})})]});var qo=require("react/jsx-runtime"),zr={coinbase_wallet:{logo:Ha,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:Ha,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:xi,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:bo,displayName:"Phantom"},rainbow:{logo:Ch,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Ka,displayName:"WalletConnect"},zerion:{logo:bh,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:yh,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:gh,displayName:"Crypto.com DeFi Wallet"},uniswap:{logo:wh,displayName:"Uniswap Wallet",rdns:"org.uniswap.app"},okx_wallet:{displayName:"OKX Wallet",rdns:"com.okex.wallet",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII="},rabby_wallet:{logo:vh,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"}},Jn=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:i}=k(),{connectWallet:a}=W(),s=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,l;return n.connectorType==="phantom"?l=()=>{sn()?(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(rp.isMobile?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:n.connectorType==="coinbase_wallet"&&n.connectionOptions==="eoaOnly"&&rp.isMobile&&!js()?l=()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`}:l=()=>{a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")},(0,qo.jsxs)(tC,{onClick:l,children:[(0,qo.jsx)(eC,{icon:Xv(e,n.connectorType,n.walletClientType)??r,name:n.walletClientType}),(0,qo.jsx)("span",{children:Qv(e,n.connectorType,n.walletClientType)||t||n.walletClientType}),(0,qo.jsx)("span",{id:"connect-text",children:"Connect"})]})},Qv=(e,t,r)=>{if(zr[e]?.displayName)return e==="coinbase_wallet"?zr[r].displayName:zr[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},Xv=(e,t,r)=>{if(zr[e]?.logo)return e==="coinbase_wallet"?zr[r].logo:zr[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Ka},eC=({icon:e,name:t})=>typeof e=="string"?(0,qo.jsx)("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?(0,qo.jsx)(Eh.default,{}):e?(0,qo.jsx)(e,{}):null,tC=(0,Th.default)(De)`
855
870
  /* Show "Connect" on hover */
856
871
  > #connect-text {
857
872
  font-weight: 500;
@@ -873,23 +888,23 @@ Resources:
873
888
  display: none;
874
889
  }
875
890
  }
876
- `;var uo=require("react/jsx-runtime"),Bv=["coinbase_wallet"],Hv=["metamask","okx_wallet","rainbow","uniswap","zerion","rabby_wallet"],Gv=["cryptocom"],Vv=["phantom"],Ui=({connectOnly:e})=>{let{connectors:t}=W(),{app:r}=k(),o=za(r.appearance.walletList,t,e,r.appearance.walletList);return(0,uo.jsxs)(uo.Fragment,{children:[...o]})},za=(e,t,r,o)=>{let n=[],i=[],a=[],l=t.find(s=>s.connectorType==="wallet_connect_v2");for(let s of e)if(s==="detected_wallets"){let c=t.filter(({connectorType:u,walletClientType:y})=>y==="uniswap_wallet_extension"?!o.includes("uniswap"):u==="injected"&&!o.includes(y));for(let u of c){let{walletClientType:y,walletBranding:f}=u;(y==="unknown"?i:n).push((0,uo.jsx)(Yn,{connectOnly:r,provider:y,logo:f.icon,displayName:f.name,connector:u},`${s}-${y}`))}}else if(Vv.includes(s)){let c=t.find(u=>u.connectorType==="injected"&&u.walletClientType===s||u.connectorType===s);c&&n.push((0,uo.jsx)(Yn,{connectOnly:r,provider:s,connector:c},s))}else if(Hv.includes(s)){let c=t.find(u=>s==="uniswap"?u.walletClientType==="uniswap_wallet_extension":u.connectorType==="injected"&&u.walletClientType===s)??l;c&&n.push((0,uo.jsx)(Yn,{connectOnly:r,provider:s,connector:c},s))}else if(Bv.includes(s)){let c=t.find(({connectorType:u})=>u===s);c&&n.push((0,uo.jsx)(Yn,{connectOnly:r,provider:s,connector:c},s))}else Gv.includes(s)?l&&a.push((0,uo.jsx)(Yn,{connectOnly:r,provider:s,connector:l},s)):s==="wallet_connect"&&l&&a.push((0,uo.jsx)(Yn,{connectOnly:r,provider:s,connector:l},s));return[...i,...n,...a]};var So=require("react/jsx-runtime"),yh=()=>{let{app:e}=k(),t=`Connect a wallet to ${e?.name}`;return(0,So.jsxs)(So.Fragment,{children:[(0,So.jsx)(S,{},"header"),(0,So.jsx)(Po,{title:"Connect your wallet",description:t}),(0,So.jsx)(ao,{children:(0,So.jsx)(Ui,{connectOnly:!0})}),(0,So.jsx)(K,{protectedByPrivy:!0})]})};var bh=h(require("styled-components"));var wh=h(require("styled-components"));var gh=h(require("react"));var Ch=require("react/jsx-runtime"),vh=()=>{let{app:e}=k(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?(0,Ch.jsx)("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?gh.default.cloneElement(t,{alt:r,style:o}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};var Zd=require("react/jsx-runtime"),Fi=e=>{let{app:t}=k();return t?.appearance.logo?(0,Zd.jsx)(zv,{...e,children:(0,Zd.jsx)(vh,{})}):null},zv=wh.default.div`
891
+ `;var fo=require("react/jsx-runtime"),rC=["coinbase_wallet"],oC=["metamask","okx_wallet","rainbow","uniswap","zerion","rabby_wallet"],nC=["cryptocom"],iC=["phantom"],Gi=({connectOnly:e})=>{let{connectors:t}=W(),{app:r}=k(),o=Ja(r.appearance.walletList,t,e,r.appearance.walletList);return(0,fo.jsxs)(fo.Fragment,{children:[...o]})},Ja=(e,t,r,o)=>{let n=[],i=[],a=[],s=t.find(l=>l.connectorType==="wallet_connect_v2");for(let l of e)if(l==="detected_wallets"){let c=t.filter(({connectorType:u,walletClientType:f})=>f==="uniswap_wallet_extension"?!o.includes("uniswap"):u==="injected"&&!o.includes(f));for(let u of c){let{walletClientType:f,walletBranding:h}=u;(f==="unknown"?i:n).push((0,fo.jsx)(Jn,{connectOnly:r,provider:f,logo:h.icon,displayName:h.name,connector:u},`${l}-${f}`))}}else if(iC.includes(l)){let c=t.find(u=>u.connectorType==="injected"&&u.walletClientType===l||u.connectorType===l);c&&n.push((0,fo.jsx)(Jn,{connectOnly:r,provider:l,connector:c},l))}else if(oC.includes(l)){let c=t.find(u=>l==="uniswap"?u.walletClientType==="uniswap_wallet_extension":u.connectorType==="injected"&&u.walletClientType===l)??s;c&&n.push((0,fo.jsx)(Jn,{connectOnly:r,provider:l,connector:c},l))}else if(rC.includes(l)){let c=t.find(({connectorType:u})=>u===l);c&&n.push((0,fo.jsx)(Jn,{connectOnly:r,provider:l,connector:c},l))}else nC.includes(l)?s&&a.push((0,fo.jsx)(Jn,{connectOnly:r,provider:l,connector:s},l)):l==="wallet_connect"&&s&&a.push((0,fo.jsx)(Jn,{connectOnly:r,provider:l,connector:s},l));return[...i,...n,...a]};var So=require("react/jsx-runtime"),Ph=()=>{let{app:e}=k(),t=`Connect a wallet to ${e?.name}`;return(0,So.jsxs)(So.Fragment,{children:[(0,So.jsx)(A,{},"header"),(0,So.jsx)(_o,{title:"Connect your wallet",description:t}),(0,So.jsx)(lo,{children:(0,So.jsx)(Gi,{connectOnly:!0})}),(0,So.jsx)(j,{protectedByPrivy:!0})]})};var kh=y(require("styled-components"));var xh=y(require("styled-components"));var _h=y(require("react"));var Ah=require("react/jsx-runtime"),Sh=()=>{let{app:e}=k(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?(0,Ah.jsx)("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?_h.default.cloneElement(t,{alt:r,style:o}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};var op=require("react/jsx-runtime"),Vi=e=>{let{app:t}=k();return t?.appearance.logo?(0,op.jsx)(aC,{...e,children:(0,op.jsx)(Sh,{})}):null},aC=xh.default.div`
877
892
  display: flex;
878
893
  flex-direction: column;
879
894
  align-items: center;
880
895
  padding: 24px 0;
881
896
  flex-grow: 1;
882
897
  justify-content: center;
883
- `;var mo=require("react/jsx-runtime"),Eh=()=>{let{app:e}=k();return(0,mo.jsxs)(mo.Fragment,{children:[(0,mo.jsx)(S,{},"header"),(0,mo.jsx)(qv,{}),(0,mo.jsx)(ao,{children:(0,mo.jsx)(Ui,{connectOnly:!0})}),e&&(0,mo.jsx)(Oi,{app:e,alwaysShowImplicitConsent:!0}),(0,mo.jsx)(K,{protectedByPrivy:!0})]})},qv=(0,bh.default)(Fi)`
898
+ `;var ho=require("react/jsx-runtime"),Rh=()=>{let{app:e}=k();return(0,ho.jsxs)(ho.Fragment,{children:[(0,ho.jsx)(A,{},"header"),(0,ho.jsx)(sC,{}),(0,ho.jsx)(lo,{children:(0,ho.jsx)(Gi,{connectOnly:!0})}),e&&(0,ho.jsx)(Fi,{app:e,alwaysShowImplicitConsent:!0}),(0,ho.jsx)(j,{protectedByPrivy:!0})]})},sC=(0,kh.default)(Vi)`
884
899
  margin-bottom: 16px;
885
- `;var Hi=require("react"),_h=require("react-device-detect"),xh=h(require("styled-components"));var qr=require("react"),$a=require("react-device-detect"),Qd=h(require("styled-components"));var qa=require("react"),$v=(e,t)=>{let r=(0,qa.useRef)(()=>{});(0,qa.useEffect)(()=>{r.current=e}),(0,qa.useEffect)(()=>{if(t!==null){let o=setInterval(()=>r.current(),t||0);return()=>clearInterval(o)}},[t])},Th=$v;var Bi=require("react");function Ph(){let[e,t]=(0,Bi.useState)(!1),r=(0,Bi.useCallback)(()=>{document.hidden&&t(!0)},[]);return(0,Bi.useEffect)(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}var ze=require("react/jsx-runtime"),Jd=2,Xd=e=>e?.privyErrorCode==="linked_to_another_user"?Fo.ERROR_USER_EXISTS:e instanceof ct&&!e.details.default?e.details:e instanceof wi?Fo.ERROR_TIMED_OUT:e instanceof bi?Fo.ERROR_USER_REJECTED_CONNECTION:Fo.ERROR_WALLET_CONNECTION,Sh=()=>{let[e,t]=(0,qr.useState)(!1),[r,o]=(0,qr.useState)(!1),[n,i]=(0,qr.useState)(void 0),{authenticated:a,logout:l}=G(),{app:s,navigate:c,navigateBack:u,lastScreen:y,currentScreen:f,setModalData:v}=k(),{getAuthFlow:C,walletConnectionStatus:g,closePrivyModal:_,initLoginWithWallet:x,loginWithWallet:b,updateWallets:A,createAnalyticsEvent:R}=W(),{walletConnectors:U}=G(),[M,I]=(0,qr.useState)(0),{user:V}=G(),[j]=(0,qr.useState)(V?.linkedAccounts.length||0),[te,L]=(0,qr.useState)(""),[z,O]=(0,qr.useState)(!1),{hasTabbedAway:ye}=Ph(),{enabled:we,token:be}=_e(),Ne=$a.isMobile&&g?.connector?.connectorType==="wallet_connect_v2"||$a.isMobile&&g?.connector?.connectorType==="coinbase_wallet"||$a.isMobile&&g?.connector?.connectorType==="injected"&&g?.connector?.walletClientType==="phantom",le=g?.status==="connected",er=g?.status==="switching_to_supported_chain";(0,qr.useEffect)(()=>{let Fe=C();if(le&&!Fe&&(we&&!be&&!a?(v({captchaModalData:{callback:ie=>x(g.connectedWallet,ie).then(()=>{O(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN",!1)):x(g.connectedWallet,be).then(()=>{O(!0)})),Fe&&Ne&&le&&!Fe.preparedMessage){Fe.buildSiweMessage();return}!Fe||Ne||!le||r||(async()=>{o(!0),i(void 0);try{g?.connector?.connectorType==="wallet_connect_v2"&&g?.connector?.walletClientType==="metamask"&&await md(2500),await sr()}catch(ie){console.warn("Auto-prompted signature failed",ie)}finally{o(!1)}})()},[M,le,z]),(0,qr.useEffect)(()=>{if(V&&e){let ie=it-500;if(s?.legal.requireUsersAcceptTerms&&!V.hasAcceptedTerms){let Re=setTimeout(()=>{c("AFFIRMATIVE_CONSENT_SCREEN")},ie);return()=>clearTimeout(Re)}if(pr(V,s?.embeddedWallets?.createOnLogin)){let Re=setTimeout(()=>{v({createWallet:{onSuccess:()=>{},onFailure:rt=>{console.error(rt),R({eventName:"embedded_wallet_creation_failure_logout",payload:{error:rt,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),c("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},ie);return()=>clearTimeout(Re)}A();let ce=setTimeout(()=>_({shouldCallAuthOnSuccess:!0,isSuccess:!0}),it);return()=>clearTimeout(ce)}},[V,e]);let Et=Fe=>{if(Fe?.privyErrorCode==="allowlist_rejected"){c("ALLOWLIST_REJECTION_SCREEN");return}else if(Fe?.privyErrorCode==="max_accounts_reached"){console.error(new Ur(Fe).toString()),c("USER_LIMIT_REACHED_SCREEN");return}i(Xd(Fe))};async function sr(){try{await b(),t(!0)}catch(Fe){Et(Fe)}finally{o(!1)}}(0,qr.useEffect)(()=>{g?.connectError&&Et(g?.connectError)},[g]),Th(()=>{let Fe=_t==="wallet_connect_v2"&&g?.connector instanceof Eo?g.connector.redirectUri:void 0;Fe&&L(Fe)},g?.connector instanceof Eo&&!te?500:null);let _t=g?.connector?.connectorType||"injected",Nr=g?.connector?.walletClientType||"unknown",Ze=zr[Nr]?.displayName||g?.connector?.walletBranding.name||"Browser Extension",yt=zr[Nr]?.logo||g?.connector?.walletBranding.icon||(Fe=>(0,ze.jsx)(Ti,{...Fe})),Dr=Ze==="Browser Extension"?Ze.toLowerCase():Ze,lr;e?lr=`Successfully connected with ${Dr}`:n?lr=n.message:er?lr="Switching networks":le?lr=r&&Ne?"Signing":"Sign to verify":lr=`Waiting for ${Dr}`;let pt="Don\u2019t see your wallet? Check your other browser windows.";if(e){let Fe=V?.linkedAccounts.length||0;j===Fe?pt="Wallet was already linked.":pt="You\u2019re good to go!"}else M>=Jd&&n?pt="Unable to connect wallet":n?pt=n.detail:er?pt="Switch your wallet to the requested network.":le&&Ne?pt="Sign the message in your wallet to verify it belongs to you.":Nr==="metamask"&&$a.isMobile?pt="Click continue to open and connect MetaMask.":Nr==="metamask"?pt="For the best experience, connect only one wallet at a time.":_t==="wallet_connect"?pt="Open your mobile wallet app to continue":_t==="coinbase_wallet"&&(Fs()||(Ld(V)?pt="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":pt="Open the Coinbase app on your phone to continue."));let N=U?.walletConnectors?.find(Fe=>Fe.walletClientType==="coinbase_wallet"),In=Nr==="coinbase_wallet"&&(Ld(V)||n===Fo.ERROR_USER_EXISTS);return(0,ze.jsxs)(ze.Fragment,{children:[(0,ze.jsx)(S,{backFn:!y||f===y?void 0:u}),(0,ze.jsxs)(Kv,{children:[(0,ze.jsx)(ep,{walletLogo:yt,success:e,fail:!!n}),(0,ze.jsxs)(wt,{children:[(0,ze.jsx)("h3",{children:lr}),(0,ze.jsx)("p",{children:pt}),!le&&te&&!ye?(0,ze.jsxs)("p",{children:["Still here?"," ",(0,ze.jsx)("a",{href:te,target:"_blank",style:{textDecoration:"underline"},children:"Try again"})]}):null]}),In?(0,ze.jsx)(D,{onClick:()=>N&&N?.disconnect(),disabled:e,children:"Use a different wallet"}):n==Fo.ERROR_USER_EXISTS&&f!==y?(0,ze.jsx)(D,{onClick:u,children:"Use a different wallet"}):le&&!e&&Ne?(0,ze.jsx)(D,{onClick:()=>{o(!0),sr()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&M<Jd?(0,ze.jsx)(D,{onClick:()=>{I(M+1),i(void 0),le?(o(!0),sr()):g?.connectRetry()},disabled:!e&&(!n?.retryable||M>=Jd),children:"Retry"}):!e&&!n?(0,ze.jsx)(D,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),(0,ze.jsx)(q,{})]})},Kv=Qd.default.div`
900
+ `;var qi=require("react"),Lh=require("react-device-detect"),Oh=y(require("styled-components"));var qr=require("react"),Xa=require("react-device-detect"),ip=y(require("styled-components"));var Qa=require("react"),lC=(e,t)=>{let r=(0,Qa.useRef)(()=>{});(0,Qa.useEffect)(()=>{r.current=e}),(0,Qa.useEffect)(()=>{if(t!==null){let o=setInterval(()=>r.current(),t||0);return()=>clearInterval(o)}},[t])},Ih=lC;var zi=require("react");function Mh(){let[e,t]=(0,zi.useState)(!1),r=(0,zi.useCallback)(()=>{document.hidden&&t(!0)},[]);return(0,zi.useEffect)(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}var ze=require("react/jsx-runtime"),np=2,ap=e=>e?.privyErrorCode==="linked_to_another_user"?Ho.ERROR_USER_EXISTS:e instanceof ct&&!e.details.default?e.details:e instanceof Pi?Ho.ERROR_TIMED_OUT:e instanceof _i?Ho.ERROR_USER_REJECTED_CONNECTION:Ho.ERROR_WALLET_CONNECTION,Wh=()=>{let[e,t]=(0,qr.useState)(!1),[r,o]=(0,qr.useState)(!1),[n,i]=(0,qr.useState)(void 0),{authenticated:a,logout:s}=H(),{app:l,navigate:c,navigateBack:u,lastScreen:f,currentScreen:h,setModalData:v}=k(),{getAuthFlow:C,walletConnectionStatus:g,closePrivyModal:P,initLoginWithWallet:S,loginWithWallet:E,updateWallets:x,createAnalyticsEvent:R}=W(),{walletConnectors:D}=H(),[I,M]=(0,qr.useState)(0),{user:V}=H(),[z]=(0,qr.useState)(V?.linkedAccounts.length||0),[re,L]=(0,qr.useState)(""),[K,O]=(0,qr.useState)(!1),{hasTabbedAway:ge}=Mh(),{enabled:be,token:Ee}=Ae(),Ne=Xa.isMobile&&g?.connector?.connectorType==="wallet_connect_v2"||Xa.isMobile&&g?.connector?.connectorType==="coinbase_wallet"||Xa.isMobile&&g?.connector?.connectorType==="injected"&&g?.connector?.walletClientType==="phantom",le=g?.status==="connected",tr=g?.status==="switching_to_supported_chain";(0,qr.useEffect)(()=>{let Fe=C();if(le&&!Fe&&(be&&!Ee&&!a?(v({captchaModalData:{callback:oe=>S(g.connectedWallet,oe).then(()=>{O(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN",!1)):S(g.connectedWallet,Ee).then(()=>{O(!0)})),Fe&&Ne&&le&&!Fe.preparedMessage){Fe.buildSiweMessage();return}!Fe||Ne||!le||r||(async()=>{o(!0),i(void 0);try{g?.connector?.connectorType==="wallet_connect_v2"&&g?.connector?.walletClientType==="metamask"&&await wd(2500),await lr()}catch(oe){console.warn("Auto-prompted signature failed",oe)}finally{o(!1)}})()},[I,le,K]),(0,qr.useEffect)(()=>{if(V&&e){let oe=et-500;if(l?.legal.requireUsersAcceptTerms&&!V.hasAcceptedTerms){let Ie=setTimeout(()=>{c("AFFIRMATIVE_CONSENT_SCREEN")},oe);return()=>clearTimeout(Ie)}if(mr(V,l?.embeddedWallets?.createOnLogin)){let Ie=setTimeout(()=>{v({createWallet:{onSuccess:()=>{},onFailure:rt=>{console.error(rt),R({eventName:"embedded_wallet_creation_failure_logout",payload:{error:rt,screen:"ConnectionStatusScreen"}}),s()},callAuthOnSuccessOnClose:!0}}),c("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},oe);return()=>clearTimeout(Ie)}x();let ce=setTimeout(()=>P({shouldCallAuthOnSuccess:!0,isSuccess:!0}),et);return()=>clearTimeout(ce)}},[V,e]);let _t=Fe=>{if(Fe?.privyErrorCode==="allowlist_rejected"){c("ALLOWLIST_REJECTION_SCREEN");return}else if(Fe?.privyErrorCode==="max_accounts_reached"){console.error(new Fr(Fe).toString()),c("USER_LIMIT_REACHED_SCREEN");return}i(ap(Fe))};async function lr(){try{await E(),t(!0)}catch(Fe){_t(Fe)}finally{o(!1)}}(0,qr.useEffect)(()=>{g?.connectError&&_t(g?.connectError)},[g]),Ih(()=>{let Fe=kt==="wallet_connect_v2"&&g?.connector instanceof To?g.connector.redirectUri:void 0;Fe&&L(Fe)},g?.connector instanceof To&&!re?500:null);let kt=g?.connector?.connectorType||"injected",Dr=g?.connector?.walletClientType||"unknown",Ze=zr[Dr]?.displayName||g?.connector?.walletBranding.name||"Browser Extension",gt=zr[Dr]?.logo||g?.connector?.walletBranding.icon||(Fe=>(0,ze.jsx)(Ai,{...Fe})),Ur=Ze==="Browser Extension"?Ze.toLowerCase():Ze,cr;e?cr=`Successfully connected with ${Ur}`:n?cr=n.message:tr?cr="Switching networks":le?cr=r&&Ne?"Signing":"Sign to verify":cr=`Waiting for ${Ur}`;let ut="Don\u2019t see your wallet? Check your other browser windows.";if(e){let Fe=V?.linkedAccounts.length||0;z===Fe?ut="Wallet was already linked.":ut="You\u2019re good to go!"}else I>=np&&n?ut="Unable to connect wallet":n?ut=n.detail:tr?ut="Switch your wallet to the requested network.":le&&Ne?ut="Sign the message in your wallet to verify it belongs to you.":Dr==="metamask"&&Xa.isMobile?ut="Click continue to open and connect MetaMask.":Dr==="metamask"?ut="For the best experience, connect only one wallet at a time.":kt==="wallet_connect"?ut="Open your mobile wallet app to continue":kt==="coinbase_wallet"&&(js()||(Hd(V)?ut="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":ut="Open the Coinbase app on your phone to continue."));let N=D?.walletConnectors?.find(Fe=>Fe.walletClientType==="coinbase_wallet"),Mn=Dr==="coinbase_wallet"&&(Hd(V)||n===Ho.ERROR_USER_EXISTS);return(0,ze.jsxs)(ze.Fragment,{children:[(0,ze.jsx)(A,{backFn:!f||h===f?void 0:u}),(0,ze.jsxs)(cC,{children:[(0,ze.jsx)(sp,{walletLogo:gt,success:e,fail:!!n}),(0,ze.jsxs)(dt,{children:[(0,ze.jsx)("h3",{children:cr}),(0,ze.jsx)("p",{children:ut}),!le&&re&&!ge?(0,ze.jsxs)("p",{children:["Still here?"," ",(0,ze.jsx)("a",{href:re,target:"_blank",style:{textDecoration:"underline"},children:"Try again"})]}):null]}),Mn?(0,ze.jsx)(U,{onClick:()=>N&&N?.disconnect(),disabled:e,children:"Use a different wallet"}):n==Ho.ERROR_USER_EXISTS&&h!==f?(0,ze.jsx)(U,{onClick:u,children:"Use a different wallet"}):le&&!e&&Ne?(0,ze.jsx)(U,{onClick:()=>{o(!0),lr()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&I<np?(0,ze.jsx)(U,{onClick:()=>{M(I+1),i(void 0),le?(o(!0),lr()):g?.connectRetry()},disabled:!e&&(!n?.retryable||I>=np),children:"Retry"}):!e&&!n?(0,ze.jsx)(U,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),(0,ze.jsx)($,{})]})},cC=ip.default.div`
886
901
  display: flex;
887
902
  flex-direction: column;
888
903
  align-items: center;
889
904
  justify-content: center;
890
905
  gap: 24px;
891
906
  width: 100%;
892
- `,jv=Qd.default.div`
907
+ `,dC=ip.default.div`
893
908
  display: flex;
894
909
  flex-direction: column;
895
910
  justify-content: center;
@@ -912,14 +927,22 @@ Resources:
912
927
  left: -19px;
913
928
  top: -19px;
914
929
  }
915
- `,ep=e=>{let t=e.walletLogo;return(0,ze.jsx)(ze.Fragment,{children:(0,ze.jsx)(jv,{children:(0,ze.jsxs)("div",{children:[(0,ze.jsx)(At,{success:e.success,fail:e.fail}),typeof t=="string"?(0,ze.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):(0,ze.jsx)(t,{style:{width:"38px",height:"38px"}})]})})})};var Yt=require("react/jsx-runtime"),rc=2,Ah=()=>{let{navigateBack:e,lastScreen:t,currentScreen:r}=k(),{walletConnectionStatus:o,closePrivyModal:n}=W(),[i,a]=(0,Hi.useState)(void 0),[l,s]=(0,Hi.useState)(0),c=o?.status==="connected",u=o?.status==="switching_to_supported_chain";(0,Hi.useEffect)(()=>{if(c){let A=setTimeout(n,it);return()=>clearTimeout(A)}},[c]);let y=A=>{a(Xd(A))};(0,Hi.useEffect)(()=>{o?.connectError&&y(o?.connectError)},[o]);let f=o?.connector?.connectorType||"injected",v=o?.connector?.walletClientType||"unknown",C=zr[v]?.displayName||o?.connector?.walletBranding.name||"Browser Extension",g=zr[v]?.logo||o?.connector?.walletBranding.icon||(A=>(0,Yt.jsx)(Ti,{...A})),_=C==="Browser Extension"?C.toLowerCase():C,x;c?x=`Successfully connected with ${_}`:i?x=i.message:u?x="Switching networks":x=`Waiting for ${_}`;let b="Don\u2019t see your wallet? Check your other browser windows.";return c?b="You\u2019re good to go!":l>=rc&&i?b="Unable to connect wallet":i?b=i.detail:u?b="Switch your wallet to the requested network.":v==="metamask"&&_h.isMobile?b="Click to continue to open and connect MetaMask.":v==="metamask"?b="For the best experience, connect only one wallet at a time.":f==="wallet_connect_v2"?b="Open your mobile wallet app to continue":f==="coinbase_wallet"&&(b="Open the Coinbase app on your phone to continue."),(0,Yt.jsxs)(Yt.Fragment,{children:[(0,Yt.jsx)(S,{backFn:r===t?void 0:e}),(0,Yt.jsxs)(Yv,{children:[(0,Yt.jsx)(ep,{walletLogo:g,success:c,fail:!!i}),(0,Yt.jsxs)(wt,{children:[(0,Yt.jsx)("h3",{children:x}),(0,Yt.jsx)("p",{children:b})]}),i==Fo.ERROR_USER_EXISTS?(0,Yt.jsx)(D,{onClick:e,children:"Use a different wallet"}):!c&&i?.retryable&&l<rc?(0,Yt.jsx)(D,{onClick:()=>{s(l+1),a(void 0),o?.connectRetry()},disabled:!c&&(!i?.retryable||l>=rc),children:"Retry"}):!c&&i&&l>=rc?(0,Yt.jsx)(D,{onClick:e,children:"Use a different wallet"}):null]}),(0,Yt.jsx)(q,{})]})},Yv=xh.default.div`
930
+ `,sp=e=>{let t=e.walletLogo;return(0,ze.jsx)(ze.Fragment,{children:(0,ze.jsx)(dC,{children:(0,ze.jsxs)("div",{children:[(0,ze.jsx)(wt,{success:e.success,fail:e.fail}),typeof t=="string"?(0,ze.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):(0,ze.jsx)(t,{style:{width:"38px",height:"38px"}})]})})})};var Zt=require("react/jsx-runtime"),sc=2,Nh=()=>{let{navigateBack:e,lastScreen:t,currentScreen:r}=k(),{walletConnectionStatus:o,closePrivyModal:n}=W(),[i,a]=(0,qi.useState)(void 0),[s,l]=(0,qi.useState)(0),c=o?.status==="connected",u=o?.status==="switching_to_supported_chain";(0,qi.useEffect)(()=>{if(c){let x=setTimeout(n,et);return()=>clearTimeout(x)}},[c]);let f=x=>{a(ap(x))};(0,qi.useEffect)(()=>{o?.connectError&&f(o?.connectError)},[o]);let h=o?.connector?.connectorType||"injected",v=o?.connector?.walletClientType||"unknown",C=zr[v]?.displayName||o?.connector?.walletBranding.name||"Browser Extension",g=zr[v]?.logo||o?.connector?.walletBranding.icon||(x=>(0,Zt.jsx)(Ai,{...x})),P=C==="Browser Extension"?C.toLowerCase():C,S;c?S=`Successfully connected with ${P}`:i?S=i.message:u?S="Switching networks":S=`Waiting for ${P}`;let E="Don\u2019t see your wallet? Check your other browser windows.";return c?E="You\u2019re good to go!":s>=sc&&i?E="Unable to connect wallet":i?E=i.detail:u?E="Switch your wallet to the requested network.":v==="metamask"&&Lh.isMobile?E="Click to continue to open and connect MetaMask.":v==="metamask"?E="For the best experience, connect only one wallet at a time.":h==="wallet_connect_v2"?E="Open your mobile wallet app to continue":h==="coinbase_wallet"&&(E="Open the Coinbase app on your phone to continue."),(0,Zt.jsxs)(Zt.Fragment,{children:[(0,Zt.jsx)(A,{backFn:r===t?void 0:e}),(0,Zt.jsxs)(pC,{children:[(0,Zt.jsx)(sp,{walletLogo:g,success:c,fail:!!i}),(0,Zt.jsxs)(dt,{children:[(0,Zt.jsx)("h3",{children:S}),(0,Zt.jsx)("p",{children:E})]}),i==Ho.ERROR_USER_EXISTS?(0,Zt.jsx)(U,{onClick:e,children:"Use a different wallet"}):!c&&i?.retryable&&s<sc?(0,Zt.jsx)(U,{onClick:()=>{l(s+1),a(void 0),o?.connectRetry()},disabled:!c&&(!i?.retryable||s>=sc),children:"Retry"}):!c&&i&&s>=sc?(0,Zt.jsx)(U,{onClick:e,children:"Use a different wallet"}):null]}),(0,Zt.jsx)($,{})]})},pC=Oh.default.div`
916
931
  display: flex;
917
932
  flex-direction: column;
918
933
  align-items: center;
919
934
  justify-content: center;
920
935
  gap: 24px;
921
936
  width: 100%;
922
- `;var Wh=h(require("@heroicons/react/24/solid/XCircleIcon")),$i=require("react"),Lh=h(require("styled-components"));var Ka=h(require("styled-components")),Gi=require("react/jsx-runtime"),Vi=()=>(0,Gi.jsx)(Zv,{children:(0,Gi.jsxs)(Jv,{children:[(0,Gi.jsx)(Qv,{}),(0,Gi.jsx)(Xv,{})]})}),Zv=Ka.default.div`
937
+ `;var $i=require("react"),Uh=y(require("styled-components"));var lp=require("react/jsx-runtime"),Dh=({name:e,logoUrl:t})=>{let r=`${e??"Provider app"} logo`;return typeof t=="string"?(0,lp.jsx)("img",{src:t,alt:r,style:{width:"38px",height:"38px",maxHeight:"90px",maxWidth:"180px"}}):(0,lp.jsx)("span",{})};var Vt=require("react/jsx-runtime"),Fh=()=>{let{authenticated:e,ready:t,user:r}=H(),{data:o}=k(),{crossAppAuthFlow:n,updateWallets:i,closePrivyModal:a}=W(),[s,l]=(0,$i.useState)(!1),[c,u]=(0,$i.useState)(void 0),f={id:o?.crossAppAuth?.appId??"",name:o?.crossAppAuth?.name??"app",logoUrl:o?.crossAppAuth?.logoUrl},h=et,v=new nt(P=>new Promise(S=>{setTimeout(async()=>{try{if(!o?.crossAppAuth?.popup){u({message:"Authentication failed",detail:`There was an issue connecting your ${f.name} account. Please try again.`,retryable:!1});return}await n({appId:P,popup:o.crossAppAuth.popup}),l(!0),S()}catch(E){u({message:"Authentication failed",detail:E instanceof b?E.message:`There was an issue connecting your ${f.name} account. Please try again.`,retryable:!1}),S()}},0)}));(0,$i.useEffect)(()=>{f.id.length&&v.execute(f.id)},[f.id]),(0,$i.useEffect)(()=>{if(!(t&&e&&s&&r))return;let S=setTimeout(()=>a({shouldCallAuthOnSuccess:!0,isSuccess:!0}),h);return i(),()=>clearTimeout(S)},[t,e,s,r]);let C=s?`Successfully connected with ${f.name}`:c?c.message:`Connecting to ${f.name}`,g="";return s?g="You\u2019re good to go!":c?g=c.detail:g=`Please check the pop-up from ${f.name} to continue`,(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsx)(A,{}),(0,Vt.jsx)(ae,{}),(0,Vt.jsxs)(uC,{children:[(0,Vt.jsx)(Et,{children:(0,Vt.jsxs)("div",{children:[(0,Vt.jsx)(wt,{success:s,fail:!!c}),(0,Vt.jsx)(Dh,{name:f.name,logoUrl:f.logoUrl})]})}),(0,Vt.jsxs)(dt,{children:[(0,Vt.jsx)("h3",{children:C}),(0,Vt.jsx)("p",{children:g})]})]}),(0,Vt.jsx)(pe,{}),(0,Vt.jsx)($,{})]})},uC=Uh.default.div`
938
+ display: flex;
939
+ flex-direction: column;
940
+ align-items: center;
941
+ justify-content: center;
942
+ margin-left: 27px;
943
+ margin-right: 27px;
944
+ gap: 24px;
945
+ `;var zh=y(require("@heroicons/react/24/solid/XCircleIcon")),Ji=require("react"),qh=y(require("styled-components"));var es=y(require("styled-components")),Ki=require("react/jsx-runtime"),ji=()=>(0,Ki.jsx)(mC,{children:(0,Ki.jsxs)(fC,{children:[(0,Ki.jsx)(hC,{}),(0,Ki.jsx)(yC,{})]})}),mC=es.default.div`
923
946
  display: flex;
924
947
  justify-content: center;
925
948
  align-items: center;
@@ -931,14 +954,14 @@ Resources:
931
954
  @media all and (display-mode: standalone) {
932
955
  margin-bottom: 30px;
933
956
  }
934
- `,Jv=Ka.default.div`
957
+ `,fC=es.default.div`
935
958
  position: relative;
936
959
  height: 140px;
937
960
  width: 140px;
938
961
 
939
962
  opacity: 1;
940
963
  animation: fadein 200ms ease;
941
- `,Qv=Ka.default.div`
964
+ `,hC=es.default.div`
942
965
  position: absolute;
943
966
  top: 0;
944
967
  right: 0;
@@ -951,7 +974,7 @@ Resources:
951
974
  border: 4px solid var(--privy-color-accent-light);
952
975
  border-radius: 50%;
953
976
  }
954
- `,Xv=Ka.default.div`
977
+ `,yC=es.default.div`
955
978
  position: absolute;
956
979
  top: 0;
957
980
  right: 0;
@@ -975,20 +998,20 @@ Resources:
975
998
  transform: rotate(360deg);
976
999
  }
977
1000
  }
978
- `;var kh=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];var st=class extends Error{constructor(r,o){super(o);this.type=r}};function zi(e){let t=e.type;return typeof t=="string"&&kh.includes(t)}function eC(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function qi(e){return zi(e)&&e.type==="wallet_not_on_device"}function Rh(e){return zi(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function fn(e){return!!(zi(e)&&e.type==="mfa_timeout")}function hn(e){return!!(zi(e)&&e.type==="missing_or_invalid_mfa")}function oc(e){return!!(zi(e)&&e.type==="mfa_verification_max_attempts_reached")}function nc(e){return!!(zi(e)&&e.message.includes("code 429"))}function ic(e){return!!(eC(e)&&e.message==="MFA canceled")}function tp({isCreatingWallet:e,skipSplashScreen:t}){return e?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":t?"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function ac({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r=!1,isResettingPassword:o=!1}){return r||t.length===1?tp({isCreatingWallet:e==="create",skipSplashScreen:o}):"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"}function sc(e){switch(e){case"user-passcode":return"EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN";case"google-drive":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";case"icloud":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";default:throw new Error("Recovery method not supported")}}async function rp({api:e,provider:t}){let r=Aa(),o=Js(),n=await Qs(r);try{return t==="icloud"?{url:(await e.post(Lu,{client_type:"web"})).url}:{url:(await e.post(Wu,{redirect_to:window.location.href,code_challenge:n,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(i){throw he(i)}}async function Ih({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new E("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new E("User denied confirmation during OAuth flow");try{return(await e.post(Ou,{authorization_code:n,state_code:r,code_verifier:o,provider:t})).access_token}catch(i){let a=he(i);throw a.privyErrorCode?new E(a.message||"Invalid code during OAuth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during OAuth flow"?new E("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new E("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}var gr=require("react/jsx-runtime"),Mh=1,Oh=()=>{let{authenticated:e,user:t,getAccessToken:r}=G(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:i}=W(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:c}=k(),u=(0,$i.useMemo)(()=>Date.now(),[]),[y,f]=(0,$i.useState)(!1),{onCompleteNavigateTo:v,onFailure:C,shouldForceMFA:g,address:_}=l?.connectWallet,x=A=>{y||(f(!0),C(typeof A=="string"?new Error(A):A))};(0,$i.useEffect)(()=>{let A=_?t?.linkedAccounts.find(M=>M.type==="wallet"&&M.walletClientType==="privy"&&M.address===_):He(t),R;return!e||!A?x("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let M=await r();if(!M)return x("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:M,address:A.address}),g&&await i.verifyMfa({accessToken:M});let I=(Date.now()-u)/1e3;v==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&I<Mh?R=setTimeout(()=>{a(v)},(Mh-I)*1e3):a(v)}catch(I){if(qi(I)&&A.recoveryMethod==="privy"){let V=await r();if(!V)return x("User must be authenticated and have a Privy wallet before it can be recovered");try{n({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:A.address}}),(await i?.recover({address:A.address,accessToken:V,recoveryMethod:A.recoveryMethod}))?.address||x(new Error("Unable to recover wallet")),v?a(v):o({shouldCallAuthOnSuccess:!1}),n({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:A.address}}),a(v)}catch{x("An error has occurred, please try again.")}}else if(qi(I)&&A.recoveryMethod!=="privy"){s({...l,recoverWallet:{privyWallet:A,onCompleteNavigateTo:v,onFailure:C},recoveryOAuthStatus:{provider:A.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}});let V=sc(A.recoveryMethod);a(V)}else x(I)}})(),()=>clearTimeout(R)):void 0},[e,t,i]);let b=()=>{x("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return c.current=b,(0,gr.jsxs)(gr.Fragment,{children:[(0,gr.jsx)(S,{onClose:b}),y?(0,gr.jsxs)(gr.Fragment,{children:[(0,gr.jsxs)(lo,{children:[(0,gr.jsx)(Wh.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,gr.jsx)(Ve,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),(0,gr.jsx)(D,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):(0,gr.jsx)(Vi,{}),(0,gr.jsx)(tC,{})]})},tC=Lh.default.div`
1001
+ `;var Bh=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];var lt=class extends Error{constructor(r,o){super(o);this.type=r}};function Yi(e){let t=e.type;return typeof t=="string"&&Bh.includes(t)}function gC(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function Zi(e){return Yi(e)&&e.type==="wallet_not_on_device"}function Hh(e){return Yi(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function hn(e){return!!(Yi(e)&&e.type==="mfa_timeout")}function yn(e){return!!(Yi(e)&&e.type==="missing_or_invalid_mfa")}function lc(e){return!!(Yi(e)&&e.type==="mfa_verification_max_attempts_reached")}function cc(e){return!!(Yi(e)&&e.message.includes("code 429"))}function dc(e){return!!(gC(e)&&e.message==="MFA canceled")}function cp({isCreatingWallet:e,skipSplashScreen:t}){return e?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":t?"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function pc({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r=!1,isResettingPassword:o=!1}){return r||t.length===1?cp({isCreatingWallet:e==="create",skipSplashScreen:o}):"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"}function uc(e){switch(e){case"user-passcode":return"EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN";case"google-drive":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";case"icloud":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";default:throw new Error("Recovery method not supported")}}async function dp({api:e,provider:t}){let r=Hn(),o=wi(),n=await bi(r);try{return t==="icloud"?{url:(await e.post(Hu,{client_type:"web"})).url}:{url:(await e.post(Bu,{redirect_to:window.location.href,code_challenge:n,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(i){throw de(i)}}async function Gh({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new b("User denied confirmation during OAuth flow");try{return(await e.post(Gu,{authorization_code:n,state_code:r,code_verifier:o,provider:t})).access_token}catch(i){let a=de(i);throw a.privyErrorCode?new b(a.message||"Invalid code during OAuth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during OAuth flow"?new b("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new b("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}var vr=require("react/jsx-runtime"),Vh=1,$h=()=>{let{authenticated:e,user:t,getAccessToken:r}=H(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:i}=W(),{navigate:a,data:s,setModalData:l,onUserCloseViaDialogOrKeybindRef:c}=k(),u=(0,Ji.useMemo)(()=>Date.now(),[]),[f,h]=(0,Ji.useState)(!1),{onCompleteNavigateTo:v,onFailure:C,shouldForceMFA:g,address:P}=s?.connectWallet,S=x=>{f||(h(!0),C(typeof x=="string"?new Error(x):x))};(0,Ji.useEffect)(()=>{let x=P?t?.linkedAccounts.find(I=>I.type==="wallet"&&I.walletClientType==="privy"&&I.address===P):He(t),R;return!e||!x?S("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let I=await r();if(!I)return S("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:I,address:x.address}),g&&await i.verifyMfa({accessToken:I});let M=(Date.now()-u)/1e3;v==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&M<Vh?R=setTimeout(()=>{a(v)},(Vh-M)*1e3):a(v)}catch(M){if(Zi(M)&&x.recoveryMethod==="privy"){let V=await r();if(!V)return S("User must be authenticated and have a Privy wallet before it can be recovered");try{n({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:x.address}}),(await i?.recover({address:x.address,accessToken:V,recoveryMethod:x.recoveryMethod}))?.address||S(new Error("Unable to recover wallet")),v?a(v):o({shouldCallAuthOnSuccess:!1}),n({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:x.address}}),a(v)}catch{S("An error has occurred, please try again.")}}else if(Zi(M)&&x.recoveryMethod!=="privy"){l({...s,recoverWallet:{privyWallet:x,onCompleteNavigateTo:v,onFailure:C},recoveryOAuthStatus:{provider:x.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}});let V=uc(x.recoveryMethod);a(V)}else S(M)}})(),()=>clearTimeout(R)):void 0},[e,t,i]);let E=()=>{S("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return c.current=E,(0,vr.jsxs)(vr.Fragment,{children:[(0,vr.jsx)(A,{onClose:E}),f?(0,vr.jsxs)(vr.Fragment,{children:[(0,vr.jsxs)(po,{children:[(0,vr.jsx)(zh.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,vr.jsx)(Ve,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),(0,vr.jsx)(U,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):(0,vr.jsx)(ji,{}),(0,vr.jsx)(vC,{})]})},vC=qh.default.div`
979
1002
  height: 44px;
980
- `;var Nh=h(require("@heroicons/react/24/solid/CheckCircleIcon")),Dh=require("react");var $r=require("react/jsx-runtime"),Uh=()=>{let{user:e}=G(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=W(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=k(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:c}=i.createWallet,u=()=>{let y=He(e);y?(o(),l(y)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return(0,Dh.useEffect)(()=>{let y=setTimeout(u,mm);return()=>clearTimeout(y)},[]),a.current=u,(0,$r.jsxs)($r.Fragment,{children:[(0,$r.jsx)(S,{onClose:u}),(0,$r.jsx)(ae,{}),(0,$r.jsxs)(lo,{children:[(0,$r.jsx)(Nh.default,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,$r.jsx)(Ve,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),(0,$r.jsx)(me,{}),(0,$r.jsx)(K,{protectedByPrivy:!0})]})};var Hh=h(require("@heroicons/react/20/solid/ExclamationTriangleIcon")),Gh=h(require("@heroicons/react/24/outline/ArrowRightOnRectangleIcon")),qo=require("react"),$o=h(require("styled-components"));var Te=require("react/jsx-runtime"),Vh=()=>{let[e,t]=(0,qo.useState)(null),{authenticated:r,user:o,getAccessToken:n}=G(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=W(),{data:s,onUserCloseViaDialogOrKeybindRef:c}=k(),u=He(o)?.address,{onFailure:y,onSuccess:f,origin:v,appId:C,appClientId:g}=s.keyExport,_=b=>{i({shouldCallAuthOnSuccess:!1}),y(typeof b=="string"?new Error(b):b)},x=()=>{i({shouldCallAuthOnSuccess:!1}),f(),a({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:u}})};return(0,qo.useEffect)(()=>{let b=He(o);if(!r||!b)return _("User must be authenticated before exporting their wallet");n().then(t,_)},[r,o]),c.current=x,(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(S,{onClose:x}),(0,Te.jsxs)(nC,{children:[(0,Te.jsxs)(Ve,{icon:(0,Te.jsx)(Gh.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),title:"Transfer Wallet",children:[(0,Te.jsxs)(lC,{children:[(0,Te.jsx)(oC,{style:{marginRight:6}}),sn(u)]}),(0,Te.jsx)("p",{children:"You can bring your account with you to another site using an external wallet."})]}),(0,Te.jsxs)(iC,{children:[(0,Te.jsxs)(Fh,{children:[(0,Te.jsx)(Bh,{children:"1"}),(0,Te.jsxs)("span",{children:[(0,Te.jsx)("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Follow the guide"})," ","to transfer your account to your wallet of choice."]})]}),(0,Te.jsxs)(Fh,{children:[(0,Te.jsx)(Bh,{children:"2"}),(0,Te.jsx)("span",{children:"Copy this key into your other wallet"})]})]}),(0,Te.jsx)("div",{style:{width:"100%"},children:e&&(0,Te.jsx)(rC,{origin:v,appId:C,appClientId:g,accessToken:e,clientAnalyticsId:l,address:u,dimensions:{height:"44px"}})}),(0,Te.jsxs)(cC,{children:[(0,Te.jsxs)("div",{children:[(0,Te.jsx)(Hh.default,{viewBox:"0 0 20 18"}),(0,Te.jsx)("h4",{children:"Warning"})]}),(0,Te.jsx)("p",{children:"Never share your private key with anyone! It controls your account."})]})]}),(0,Te.jsx)(K,{protectedByPrivy:!0})]})};function rC(e){let[t,r]=(0,qo.useState)(e.dimensions.width),[o,n]=(0,qo.useState)(void 0),i=(0,qo.useRef)(null);return(0,qo.useEffect)(()=>{if(i.current&&t===void 0){let{width:l}=i.current.getBoundingClientRect();r(l)}let a=getComputedStyle(document.documentElement);n({background2:a.getPropertyValue("--privy-color-background-2"),foreground3:a.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:a.getPropertyValue("--privy-color-foreground-accent"),accent:a.getPropertyValue("--privy-color-accent"),accentDark:a.getPropertyValue("--privy-color-accent-dark"),success:a.getPropertyValue("--privy-color-success")})},[]),(0,Te.jsx)("div",{ref:i,children:t&&(0,Te.jsxs)(aC,{children:[(0,Te.jsx)("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:Hs(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{client_id:e.appClientId,address:e.address,width:`${t}px`,caid:e.clientAnalyticsId,...o},{token:e.accessToken})}),(0,Te.jsx)(sC,{children:"Loading..."})]})})}function oC(e){return(0,Te.jsx)("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e.style,children:(0,Te.jsx)("path",{d:"M14 8.81335C14 7.98493 13.3284 7.31335 12.5 7.31335H10C10 8.41792 9.10457 9.31335 8 9.31335C6.89543 9.31335 6 8.41792 6 7.31335H3.5C2.67157 7.31335 2 7.98493 2 8.81335M14 8.81335V12.8134C14 13.6418 13.3284 14.3134 12.5 14.3134H3.5C2.67157 14.3134 2 13.6418 2 12.8134V8.81335M14 8.81335V6.81335M2 8.81335V6.81335M14 6.81335C14 5.98493 13.3284 5.31335 12.5 5.31335H3.5C2.67157 5.31335 2 5.98493 2 6.81335M14 6.81335V4.81335C14 3.98493 13.3284 3.31335 12.5 3.31335H3.5C2.67157 3.31335 2 3.98493 2 4.81335V6.81335",stroke:"var(--privy-color-foreground-3)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var nC=$o.default.div`
1003
+ `;var Kh=y(require("@heroicons/react/24/solid/CheckCircleIcon")),jh=require("react");var $r=require("react/jsx-runtime"),Yh=()=>{let{user:e}=H(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=W(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=k(),{onSuccess:s,onFailure:l,callAuthOnSuccessOnClose:c}=i.createWallet,u=()=>{let f=He(e);f?(o(),s(f)):l(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return(0,jh.useEffect)(()=>{let f=setTimeout(u,wm);return()=>clearTimeout(f)},[]),a.current=u,(0,$r.jsxs)($r.Fragment,{children:[(0,$r.jsx)(A,{onClose:u}),(0,$r.jsx)(ae,{}),(0,$r.jsxs)(po,{children:[(0,$r.jsx)(Kh.default,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,$r.jsx)(Ve,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),(0,$r.jsx)(pe,{}),(0,$r.jsx)(j,{protectedByPrivy:!0})]})};var Qh=y(require("@heroicons/react/20/solid/ExclamationTriangleIcon")),Xh=y(require("@heroicons/react/24/outline/ArrowRightOnRectangleIcon")),$o=require("react"),Ko=y(require("styled-components"));var Te=require("react/jsx-runtime"),ey=()=>{let[e,t]=(0,$o.useState)(null),{authenticated:r,user:o,getAccessToken:n}=H(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:s}=W(),{data:l,onUserCloseViaDialogOrKeybindRef:c}=k(),u=He(o)?.address,{onFailure:f,onSuccess:h,origin:v,appId:C,appClientId:g}=l.keyExport,P=E=>{i({shouldCallAuthOnSuccess:!1}),f(typeof E=="string"?new Error(E):E)},S=()=>{i({shouldCallAuthOnSuccess:!1}),h(),a({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:u}})};return(0,$o.useEffect)(()=>{let E=He(o);if(!r||!E)return P("User must be authenticated before exporting their wallet");n().then(t,P)},[r,o]),c.current=S,(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(A,{onClose:S}),(0,Te.jsxs)(bC,{children:[(0,Te.jsxs)(Ve,{icon:(0,Te.jsx)(Xh.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),title:"Transfer Wallet",children:[(0,Te.jsxs)(_C,{children:[(0,Te.jsx)(wC,{style:{marginRight:6}}),ln(u)]}),(0,Te.jsx)("p",{children:"You can bring your account with you to another site using an external wallet."})]}),(0,Te.jsxs)(EC,{children:[(0,Te.jsxs)(Zh,{children:[(0,Te.jsx)(Jh,{children:"1"}),(0,Te.jsxs)("span",{children:[(0,Te.jsx)("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Follow the guide"})," ","to transfer your account to your wallet of choice."]})]}),(0,Te.jsxs)(Zh,{children:[(0,Te.jsx)(Jh,{children:"2"}),(0,Te.jsx)("span",{children:"Copy this key into your other wallet"})]})]}),(0,Te.jsx)("div",{style:{width:"100%"},children:e&&(0,Te.jsx)(CC,{origin:v,appId:C,appClientId:g,accessToken:e,clientAnalyticsId:s,address:u,dimensions:{height:"44px"}})}),(0,Te.jsxs)(SC,{children:[(0,Te.jsxs)("div",{children:[(0,Te.jsx)(Qh.default,{viewBox:"0 0 20 18"}),(0,Te.jsx)("h4",{children:"Warning"})]}),(0,Te.jsx)("p",{children:"Never share your private key with anyone! It controls your account."})]})]}),(0,Te.jsx)(j,{protectedByPrivy:!0})]})};function CC(e){let[t,r]=(0,$o.useState)(e.dimensions.width),[o,n]=(0,$o.useState)(void 0),i=(0,$o.useRef)(null);return(0,$o.useEffect)(()=>{if(i.current&&t===void 0){let{width:s}=i.current.getBoundingClientRect();r(s)}let a=getComputedStyle(document.documentElement);n({background2:a.getPropertyValue("--privy-color-background-2"),foreground3:a.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:a.getPropertyValue("--privy-color-foreground-accent"),accent:a.getPropertyValue("--privy-color-accent"),accentDark:a.getPropertyValue("--privy-color-accent-dark"),success:a.getPropertyValue("--privy-color-success")})},[]),(0,Te.jsx)("div",{ref:i,children:t&&(0,Te.jsxs)(TC,{children:[(0,Te.jsx)("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:Zs(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{client_id:e.appClientId,address:e.address,width:`${t}px`,caid:e.clientAnalyticsId,...o},{token:e.accessToken})}),(0,Te.jsx)(PC,{children:"Loading..."})]})})}function wC(e){return(0,Te.jsx)("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e.style,children:(0,Te.jsx)("path",{d:"M14 8.81335C14 7.98493 13.3284 7.31335 12.5 7.31335H10C10 8.41792 9.10457 9.31335 8 9.31335C6.89543 9.31335 6 8.41792 6 7.31335H3.5C2.67157 7.31335 2 7.98493 2 8.81335M14 8.81335V12.8134C14 13.6418 13.3284 14.3134 12.5 14.3134H3.5C2.67157 14.3134 2 13.6418 2 12.8134V8.81335M14 8.81335V6.81335M2 8.81335V6.81335M14 6.81335C14 5.98493 13.3284 5.31335 12.5 5.31335H3.5C2.67157 5.31335 2 5.98493 2 6.81335M14 6.81335V4.81335C14 3.98493 13.3284 3.31335 12.5 3.31335H3.5C2.67157 3.31335 2 3.98493 2 4.81335V6.81335",stroke:"var(--privy-color-foreground-3)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var bC=Ko.default.div`
981
1004
  display: flex;
982
1005
  flex-direction: column;
983
1006
  text-align: left;
984
- `,iC=$o.default.div`
1007
+ `,EC=Ko.default.div`
985
1008
  display: flex;
986
1009
  flex-direction: column;
987
1010
  gap: 24px;
988
1011
  padding-bottom: 16px;
989
1012
  margin-left: 11px;
990
1013
  border-left: 1px solid var(--privy-color-foreground-4) !important;
991
- `,Fh=$o.default.div`
1014
+ `,Zh=Ko.default.div`
992
1015
  display: flex;
993
1016
  align-items: top;
994
1017
  gap: 8px;
@@ -997,7 +1020,7 @@ Resources:
997
1020
  color: var(--privy-color-accent);
998
1021
  text-decoration: underline;
999
1022
  }
1000
- `,Bh=$o.default.div`
1023
+ `,Jh=Ko.default.div`
1001
1024
  display: flex;
1002
1025
  align-items: center;
1003
1026
  justify-content: center;
@@ -1011,11 +1034,11 @@ Resources:
1011
1034
  border-radius: 100%;
1012
1035
  background: var(--privy-color-background);
1013
1036
  color: var(--privy-color-accent);
1014
- `,aC=$o.default.div`
1037
+ `,TC=Ko.default.div`
1015
1038
  overflow: visible;
1016
1039
  position: relative;
1017
1040
  height: 44px;
1018
- `,sC=$o.default.div`
1041
+ `,PC=Ko.default.div`
1019
1042
  position: absolute;
1020
1043
  display: flex;
1021
1044
  align-items: center;
@@ -1027,7 +1050,7 @@ Resources:
1027
1050
  border-radius: var(--privy-border-radius-md);
1028
1051
  background-color: var(--privy-color-background-2);
1029
1052
  color: var(--privy-color-foreground-3);
1030
- `,lC=$o.default.div`
1053
+ `,_C=Ko.default.div`
1031
1054
  display: flex;
1032
1055
  align-items: center;
1033
1056
  padding-top: 1px;
@@ -1040,7 +1063,7 @@ Resources:
1040
1063
  font-size: 12px;
1041
1064
  font-weight: 500;
1042
1065
  margin: auto;
1043
- `,cC=$o.default.div`
1066
+ `,SC=Ko.default.div`
1044
1067
  border: 1px solid var(--privy-color-background-2) !important;
1045
1068
  border-radius: var(--privy-border-radius-md);
1046
1069
  padding: 16px;
@@ -1062,9 +1085,9 @@ Resources:
1062
1085
  color: var(--privy-color-error);
1063
1086
  }
1064
1087
  }
1065
- `;var zh=h(require("@heroicons/react/24/solid/XCircleIcon")),ja=require("react"),qh=h(require("styled-components"));var lc=require("react");function cc(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=W(),o=(0,lc.useRef)(!1);return{createWallet:(0,lc.useCallback)(async i=>{let a=await Me();if(!a)throw t({eventName:"embedded_wallet_creation_failed",payload:{error:"Missing access token for user."}}),new Error("An error has occured, please login again.");try{t({eventName:"embedded_wallet_creation_started"});let l=await r(gi);if(!l)throw new Error("walletProxy does not exist.");let s=1e4,c=new Promise((v,C)=>{setTimeout(()=>{C(new Error("walletProxy.create timed out."))},s)});if(!await Promise.race([l.create({accessToken:a,recoveryPassword:i}),c]))throw new Error("walletProxy.create did not send a response.");let y=await e();if(!y)throw new Error("Failed to refresh user.");let f=He(y);if(!f)throw new Error("Updated user is missing embedded wallet.");return t({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:f.address}}),o.current=!0,f}catch(l){if(o.current)return;throw t({eventName:"embedded_wallet_creation_failed",payload:{error:l.toString()}}),console.warn(l),l}},[])}}var Kr=require("react/jsx-runtime"),$h=()=>{let{app:e,setModalData:t,navigate:r,data:o,onUserCloseViaDialogOrKeybindRef:n}=k(),[i,a]=(0,ja.useState)(""),{embeddedWallets:l}=Kt(),{authenticated:s}=G(),{closePrivyModal:c}=W(),{onSuccess:u,onFailure:y,callAuthOnSuccessOnClose:f}=o.createWallet,v=e?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,{createWallet:C}=cc(),[g,_]=(0,ja.useState)(null),x=new lt(async()=>{try{let A=await C();if(!A)return;_(A),r("EMBEDDED_WALLET_CREATED_SCREEN")}catch(A){a(A.message)}});(0,ja.useEffect)(()=>{if(!s){r("LANDING"),y(new Error("User must be authenticated before creating a Privy wallet"));return}if(v){t({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}});let A=ac({walletAction:"create",availableRecoveryMethods:l.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1});return r(A)}x.execute()},[v,s]);let b=()=>{g?(u(g),c({shouldCallAuthOnSuccess:f})):(y(new tr("User wallet creation failed")),c({shouldCallAuthOnSuccess:!1}))};return n.current=()=>null,i?(0,Kr.jsxs)(Kr.Fragment,{children:[(0,Kr.jsx)(S,{closeable:!1}),(0,Kr.jsxs)(lo,{children:[(0,Kr.jsx)(zh.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,Kr.jsx)(Ve,{title:"Something went wrong",description:i})]}),(0,Kr.jsx)(D,{onClick:b,children:"Close"}),(0,Kr.jsx)(dC,{})]}):(0,Kr.jsx)(Vi,{})},dC=qh.default.div`
1088
+ `;var ty=y(require("@heroicons/react/24/solid/XCircleIcon")),ts=require("react"),ry=y(require("styled-components"));var mc=require("react");function fc(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=W(),o=(0,mc.useRef)(!1);return{createWallet:(0,mc.useCallback)(async i=>{let a=await Me();if(!a)throw t({eventName:"embedded_wallet_creation_failed",payload:{error:"Missing access token for user."}}),new Error("An error has occured, please login again.");try{t({eventName:"embedded_wallet_creation_started"});let s=await r(Ci);if(!s)throw new Error("walletProxy does not exist.");let l=1e4,c=new Promise((v,C)=>{setTimeout(()=>{C(new Error("walletProxy.create timed out."))},l)});if(!await Promise.race([s.create({accessToken:a,recoveryPassword:i}),c]))throw new Error("walletProxy.create did not send a response.");let f=await e();if(!f)throw new Error("Failed to refresh user.");let h=He(f);if(!h)throw new Error("Updated user is missing embedded wallet.");return t({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:h.address}}),o.current=!0,h}catch(s){if(o.current)return;throw t({eventName:"embedded_wallet_creation_failed",payload:{error:s.toString()}}),console.warn(s),s}},[])}}var Kr=require("react/jsx-runtime"),oy=()=>{let{app:e,setModalData:t,navigate:r,data:o,onUserCloseViaDialogOrKeybindRef:n}=k(),[i,a]=(0,ts.useState)(""),{embeddedWallets:s}=It(),{authenticated:l}=H(),{closePrivyModal:c}=W(),{onSuccess:u,onFailure:f,callAuthOnSuccessOnClose:h}=o.createWallet,v=e?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,{createWallet:C}=fc(),[g,P]=(0,ts.useState)(null),S=new nt(async()=>{try{let x=await C();if(!x)return;P(x),r("EMBEDDED_WALLET_CREATED_SCREEN")}catch(x){a(x.message)}});(0,ts.useEffect)(()=>{if(!l){r("LANDING"),f(new Error("User must be authenticated before creating a Privy wallet"));return}if(v){t({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}});let x=pc({walletAction:"create",availableRecoveryMethods:s.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1});return r(x)}S.execute()},[v,l]);let E=()=>{g?(u(g),c({shouldCallAuthOnSuccess:h})):(f(new rr("User wallet creation failed")),c({shouldCallAuthOnSuccess:!1}))};return n.current=()=>null,i?(0,Kr.jsxs)(Kr.Fragment,{children:[(0,Kr.jsx)(A,{closeable:!1}),(0,Kr.jsxs)(po,{children:[(0,Kr.jsx)(ty.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,Kr.jsx)(Ve,{title:"Something went wrong",description:i})]}),(0,Kr.jsx)(U,{onClick:E,children:"Close"}),(0,Kr.jsx)(AC,{})]}):(0,Kr.jsx)(ji,{})},AC=ry.default.div`
1066
1089
  height: 44px;
1067
- `;var Zn=require("react");var ea=require("react");var ey=h(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Ji=require("react");var Kh=h(require("@heroicons/react/24/outline/ArrowPathIcon")),jh=h(require("@heroicons/react/24/outline/EyeIcon")),Yh=h(require("@heroicons/react/24/outline/EyeSlashIcon")),ft=h(require("styled-components"));var pC=ft.css`
1090
+ `;var Qn=require("react");var ia=require("react");var py=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),ra=require("react");var ny=y(require("@heroicons/react/24/outline/ArrowPathIcon")),iy=y(require("@heroicons/react/24/outline/EyeIcon")),ay=y(require("@heroicons/react/24/outline/EyeSlashIcon")),ht=y(require("styled-components"));var xC=ht.css`
1068
1091
  font-size: 14px;
1069
1092
  font-style: normal;
1070
1093
  font-weight: 400;
@@ -1072,8 +1095,8 @@ Resources:
1072
1095
  letter-spacing: -0.008px;
1073
1096
  text-align: left;
1074
1097
  transition: color 0.1s ease-in;
1075
- `,dc=ft.default.span`
1076
- ${pC}
1098
+ `,hc=ht.default.span`
1099
+ ${xC}
1077
1100
  transition: color 0.1s ease-in;
1078
1101
  color: ${({error:e})=>e?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
1079
1102
  text-transform: ${({error:e})=>e?"":"capitalize"};
@@ -1081,18 +1104,18 @@ Resources:
1081
1104
  &[aria-hidden='true'] {
1082
1105
  visibility: hidden;
1083
1106
  }
1084
- `,yn=ft.default.div`
1107
+ `,gn=ht.default.div`
1085
1108
  display: flex;
1086
1109
  flex-direction: column;
1087
1110
  justify-content: center;
1088
1111
  flex-grow: 1;
1089
- `,gn=(0,ft.default)(D)`
1090
- ${e=>e.hideAnimations&&ft.css`
1112
+ `,vn=(0,ht.default)(U)`
1113
+ ${e=>e.hideAnimations&&ht.css`
1091
1114
  && {
1092
1115
  transition: none;
1093
1116
  }
1094
1117
  `}
1095
- `,Zh=ft.css`
1118
+ `,sy=ht.css`
1096
1119
  && {
1097
1120
  width: 100%;
1098
1121
  border-width: 1px;
@@ -1107,8 +1130,8 @@ Resources:
1107
1130
  font-weight: 300;
1108
1131
  line-height: 22px; /* 137.5% */
1109
1132
  }
1110
- `,Ki=ft.default.input`
1111
- ${Zh}
1133
+ `,Qi=ht.default.input`
1134
+ ${sy}
1112
1135
 
1113
1136
  &::placeholder {
1114
1137
  color: var(--privy-color-foreground-3);
@@ -1119,15 +1142,15 @@ Resources:
1119
1142
  overflow: hidden;
1120
1143
  text-overflow: ellipsis;
1121
1144
  white-space: nowrap;
1122
- `,Jh=ft.default.div`
1123
- ${Zh}
1124
- `,vn=ft.default.div`
1145
+ `,ly=ht.default.div`
1146
+ ${sy}
1147
+ `,Cn=ht.default.div`
1125
1148
  position: relative;
1126
1149
  width: 100%;
1127
1150
  display: flex;
1128
1151
  align-items: center;
1129
1152
  justify-content: ${({centered:e})=>e?"center":"space-between"};
1130
- `,Cn=ft.default.div`
1153
+ `,wn=ht.default.div`
1131
1154
  display: flex;
1132
1155
  flex-direction: column;
1133
1156
  align-items: center;
@@ -1149,12 +1172,12 @@ Resources:
1149
1172
  font-weight: 400;
1150
1173
  line-height: 20px;
1151
1174
  }
1152
- `,Ya=ft.default.div`
1175
+ `,rs=ht.default.div`
1153
1176
  display: flex;
1154
1177
  flex-direction: column;
1155
1178
  gap: 10px;
1156
1179
  padding-bottom: 1rem;
1157
- `,Za=ft.default.div`
1180
+ `,os=ht.default.div`
1158
1181
  display: flex;
1159
1182
  text-align: left;
1160
1183
  align-items: center;
@@ -1174,13 +1197,13 @@ Resources:
1174
1197
  > :first-child {
1175
1198
  min-width: 24px;
1176
1199
  }
1177
- `,c_=ft.default.div`
1200
+ `,FS=ht.default.div`
1178
1201
  height: var(--privy-height-modal-full);
1179
1202
 
1180
1203
  @media (max-width: 440px) {
1181
1204
  height: var(--privy-height-modal-compact);
1182
1205
  }
1183
- `,op=(0,ft.default)(Gl)`
1206
+ `,pp=(0,ht.default)(ja)`
1184
1207
  display: flex;
1185
1208
  flex: 1;
1186
1209
  gap: 4px;
@@ -1192,7 +1215,7 @@ Resources:
1192
1215
  border-color: var(--privy-color-foreground-3);
1193
1216
  border-width: 1px;
1194
1217
  }
1195
- `,ji=ft.default.div`
1218
+ `,Xi=ht.default.div`
1196
1219
  position: absolute;
1197
1220
  right: 0.5rem;
1198
1221
 
@@ -1200,7 +1223,7 @@ Resources:
1200
1223
  flex-direction: row;
1201
1224
  justify-content: space-around;
1202
1225
  align-items: center;
1203
- `,Qh=(0,ft.default)(Kh.default)`
1226
+ `,cy=(0,ht.default)(ny.default)`
1204
1227
  height: 1.25rem;
1205
1228
  width: 1.25rem;
1206
1229
  stroke: var(--privy-color-accent);
@@ -1209,7 +1232,7 @@ Resources:
1209
1232
  :active {
1210
1233
  stroke: var(--privy-color-accent-light);
1211
1234
  }
1212
- `,Yi=(0,ft.default)(Yh.default)`
1235
+ `,ea=(0,ht.default)(ay.default)`
1213
1236
  height: 1.25rem;
1214
1237
  width: 1.25rem;
1215
1238
  stroke: var(--privy-color-accent);
@@ -1218,7 +1241,7 @@ Resources:
1218
1241
  :active {
1219
1242
  stroke: var(--privy-color-accent-light);
1220
1243
  }
1221
- `,Zi=(0,ft.default)(jh.default)`
1244
+ `,ta=(0,ht.default)(iy.default)`
1222
1245
  height: 1.25rem;
1223
1246
  width: 1.25rem;
1224
1247
  stroke: var(--privy-color-accent);
@@ -1227,7 +1250,7 @@ Resources:
1227
1250
  :active {
1228
1251
  stroke: var(--privy-color-accent-light);
1229
1252
  }
1230
- `,Xh=ft.default.progress`
1253
+ `,dy=ht.default.progress`
1231
1254
  height: 4px;
1232
1255
  width: 100%;
1233
1256
  margin: 8px 0;
@@ -1243,7 +1266,7 @@ Resources:
1243
1266
  transition: all 0.1s ease-out;
1244
1267
  background: ${({label:e})=>e==="Strong"&&"#78dca6"||e==="Medium"&&"var(--privy-color-warn)"||"var(--privy-color-error)"};
1245
1268
  }
1246
- `;var ht=require("react/jsx-runtime"),ty=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[i,a]=(0,Ji.useState)(!0),[l,s]=(0,Ji.useState)(!1),[c,u]=(0,Ji.useState)(""),y=r===c;return(0,Ji.useEffect)(()=>{c&&!l&&s(!0)},[c]),(0,ht.jsxs)(ht.Fragment,{children:[(0,ht.jsx)(S,{closeable:!1,backFn:n}),(0,ht.jsx)(ae,{}),(0,ht.jsxs)(yn,{children:[(0,ht.jsxs)(Cn,{children:[(0,ht.jsx)(ey.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,ht.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),(0,ht.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),(0,ht.jsxs)(vn,{children:[(0,ht.jsx)(Ki,{value:c,onChange:f=>u(f.target.value),onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text",style:{paddingRight:"2.3rem"}}),(0,ht.jsx)(ji,{style:{right:"0.75rem"},children:i?(0,ht.jsx)(Yi,{onClick:()=>a(!1)}):(0,ht.jsx)(Zi,{onClick:()=>a(!0)})})]}),(0,ht.jsx)(dc,{"aria-hidden":!l||y,error:!0,children:"Passwords do not match"})]}),(0,ht.jsx)(gn,{onClick:o,loading:t,disabled:!y,hideAnimations:e,children:"Continue"}),(0,ht.jsx)(me,{}),(0,ht.jsx)(K,{protectedByPrivy:!0})]})};var iy=h(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),ay=require("react"),sy=h(require("styled-components"));var Qi=h(require("styled-components")),wn=require("react/jsx-runtime"),ry=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>(0,wn.jsx)("label",{children:(0,wn.jsxs)(uC,{className:e,children:[(0,wn.jsx)(ny,{checked:t,...o}),(0,wn.jsx)(mC,{color:r,checked:t,children:(0,wn.jsx)(oy,{viewBox:"0 0 24 24",children:(0,wn.jsx)("polyline",{points:"20 6 9 17 4 12"})})})]})});var g_=Qi.default.label`
1269
+ `;var yt=require("react/jsx-runtime"),uy=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[i,a]=(0,ra.useState)(!0),[s,l]=(0,ra.useState)(!1),[c,u]=(0,ra.useState)(""),f=r===c;return(0,ra.useEffect)(()=>{c&&!s&&l(!0)},[c]),(0,yt.jsxs)(yt.Fragment,{children:[(0,yt.jsx)(A,{closeable:!1,backFn:n}),(0,yt.jsx)(ae,{}),(0,yt.jsxs)(gn,{children:[(0,yt.jsxs)(wn,{children:[(0,yt.jsx)(py.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,yt.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),(0,yt.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),(0,yt.jsxs)(Cn,{children:[(0,yt.jsx)(Qi,{value:c,onChange:h=>u(h.target.value),onBlur:()=>l(!0),placeholder:"confirm your password",type:i?"password":"text",style:{paddingRight:"2.3rem"}}),(0,yt.jsx)(Xi,{style:{right:"0.75rem"},children:i?(0,yt.jsx)(ea,{onClick:()=>a(!1)}):(0,yt.jsx)(ta,{onClick:()=>a(!0)})})]}),(0,yt.jsx)(hc,{"aria-hidden":!s||f,error:!0,children:"Passwords do not match"})]}),(0,yt.jsx)(vn,{onClick:o,loading:t,disabled:!f,hideAnimations:e,children:"Continue"}),(0,yt.jsx)(pe,{}),(0,yt.jsx)(j,{protectedByPrivy:!0})]})};var yy=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),gy=require("react"),vy=y(require("styled-components"));var oa=y(require("styled-components")),bn=require("react/jsx-runtime"),my=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>(0,bn.jsx)("label",{children:(0,bn.jsxs)(kC,{className:e,children:[(0,bn.jsx)(hy,{checked:t,...o}),(0,bn.jsx)(RC,{color:r,checked:t,children:(0,bn.jsx)(fy,{viewBox:"0 0 24 24",children:(0,bn.jsx)("polyline",{points:"20 6 9 17 4 12"})})})]})});var KS=oa.default.label`
1247
1270
  && {
1248
1271
  cursor: pointer;
1249
1272
  display: flex;
@@ -1255,14 +1278,14 @@ Resources:
1255
1278
  border: 1px solid var(--privy-color-foreground-4);
1256
1279
  width: 100%;
1257
1280
  }
1258
- `,uC=Qi.default.div`
1281
+ `,kC=oa.default.div`
1259
1282
  display: inline-block;
1260
1283
  vertical-align: middle;
1261
- `,oy=Qi.default.svg`
1284
+ `,fy=oa.default.svg`
1262
1285
  fill: none;
1263
1286
  stroke: white;
1264
1287
  stroke-width: 3px;
1265
- `,ny=Qi.default.input.attrs({type:"checkbox"})`
1288
+ `,hy=oa.default.input.attrs({type:"checkbox"})`
1266
1289
  border: 0;
1267
1290
  clip: rect(0 0 0 0);
1268
1291
  clippath: inset(50%);
@@ -1273,7 +1296,7 @@ Resources:
1273
1296
  position: absolute;
1274
1297
  white-space: nowrap;
1275
1298
  width: 1px;
1276
- `,mC=Qi.default.div`
1299
+ `,RC=oa.default.div`
1277
1300
  display: inline-block;
1278
1301
  width: 18px;
1279
1302
  height: 18px;
@@ -1288,28 +1311,28 @@ Resources:
1288
1311
  border-width: 1px;
1289
1312
  }
1290
1313
 
1291
- ${ny}:focus + & {
1314
+ ${hy}:focus + & {
1292
1315
  box-shadow: 0 0 0 1px ${e=>e.color};
1293
1316
  }
1294
1317
 
1295
- ${oy} {
1318
+ ${fy} {
1296
1319
  visibility: ${e=>e.checked?"visible":"hidden"};
1297
1320
  }
1298
- `;var dt=require("react/jsx-runtime"),ly=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[i,a]=(0,ay.useState)(!1);return(0,dt.jsxs)(dt.Fragment,{children:[(0,dt.jsx)(S,{closeable:!1,backFn:o}),(0,dt.jsx)(ae,{}),(0,dt.jsxs)(yn,{children:[(0,dt.jsxs)(Cn,{children:[(0,dt.jsx)(iy.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),(0,dt.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),(0,dt.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),(0,dt.jsx)(Ya,{children:(0,dt.jsxs)(Za,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[(0,dt.jsx)(ry,{color:"var(--privy-color-error)",readOnly:!0,checked:i}),(0,dt.jsx)(dt.Fragment,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),(0,dt.jsxs)(fC,{children:[n.initiatedBy==="user"&&(0,dt.jsx)(no,{onClick:n.onCancel,disabled:t,children:"Cancel"}),(0,dt.jsx)(gn,{onClick:r,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),(0,dt.jsx)(me,{}),(0,dt.jsx)(K,{protectedByPrivy:!0})]})},fC=sy.default.div`
1321
+ `;var pt=require("react/jsx-runtime"),Cy=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[i,a]=(0,gy.useState)(!1);return(0,pt.jsxs)(pt.Fragment,{children:[(0,pt.jsx)(A,{closeable:!1,backFn:o}),(0,pt.jsx)(ae,{}),(0,pt.jsxs)(gn,{children:[(0,pt.jsxs)(wn,{children:[(0,pt.jsx)(yy.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),(0,pt.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),(0,pt.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),(0,pt.jsx)(rs,{children:(0,pt.jsxs)(os,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:s=>{s.preventDefault(),a(l=>!l)},children:[(0,pt.jsx)(my,{color:"var(--privy-color-error)",readOnly:!0,checked:i}),(0,pt.jsx)(pt.Fragment,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),(0,pt.jsxs)(IC,{children:[n.initiatedBy==="user"&&(0,pt.jsx)(ao,{onClick:n.onCancel,disabled:t,children:"Cancel"}),(0,pt.jsx)(vn,{onClick:r,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),(0,pt.jsx)(pe,{}),(0,pt.jsx)(j,{protectedByPrivy:!0})]})},IC=vy.default.div`
1299
1322
  display: flex;
1300
1323
  gap: 10px;
1301
- `;var gy=h(require("@heroicons/react/24/outline/KeyIcon")),np=h(require("@heroicons/react/24/solid/CheckCircleIcon")),Ko=require("react"),ip=h(require("styled-components"));var cy=h(require("fast-password-entropy")),dy=h(require("secure-password-utilities")),py=require("secure-password-utilities/wordlists"),hC=95,yC=8,gC=3,vC=.3,CC=/[a-z]/,wC=/[A-Z]/,bC=/[0-9]/,EC="a-zA-Z0-9",uy="!@#$%^&*()\\-_+.",my=`${EC}${uy}`,TC=new RegExp(`[${uy}]`),PC=new RegExp(`[${my}]`),fy=new RegExp(`^[${my}]{6,}$`),hy=(e="")=>{let t=e.split("").filter(r=>!PC.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},pc=()=>dy.generatePassphrase(4,py.DEFAULT_WORDLIST);function SC(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function _C(e){if(e.length<yC)return 0;let t=0;CC.test(e)&&(t+=1),wC.test(e)&&(t+=1),bC.test(e)&&(t+=1),TC.test(e)&&(t+=1);let r=t/gC;return Math.max(0,Math.min(1,r))}function xC(e=""){let t=_C(e),r=(0,cy.default)(e)/hC;return(t*vC+r)/2}function yy(e=""){let t=xC(e);return{value:t,label:SC(t)}}var Ae=require("react/jsx-runtime"),vy=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,isResettingPassword:n,onSubmit:i,onClose:a,onBack:l,onPasswordChange:s,onPasswordGenerate:c})=>{let[u,y]=(0,Ko.useState)(!1),[f,v]=(0,Ko.useState)(!1);(0,Ko.useEffect)(()=>{r&&!f&&v(!0)},[r]);let C=(0,Ko.useMemo)(()=>f?(r?.length||0)<6?"Password must be at least 6 characters":fy.test(r||"")?null:`Invalid characters used ( ${hy(r).join(" ")} )`:null,[r,f]),g=(0,Ko.useMemo)(()=>C?{value:0,label:"Weak"}:yy(r),[r,C]),_=(0,Ko.useMemo)(()=>!!(!r?.length||C),[C,r]);return(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsx)(S,{onClose:a,closeable:o.initiatedBy==="user",backFn:l}),(0,Ae.jsx)(ae,{}),(0,Ae.jsxs)(yn,{children:[(0,Ae.jsxs)(Cn,{children:[(0,Ae.jsx)(gy.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,Ae.jsxs)("h3",{style:{color:"var(--privy-color-foreground)"},children:[n?"Reset":"Set"," your password"]}),(0,Ae.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),(0,Ae.jsxs)(vn,{children:[(0,Ae.jsx)(Ki,{value:r,onChange:x=>s(x.target.value),placeholder:"enter or generate a strong password",type:u?"password":"text",style:{paddingRight:"3.8rem"}}),(0,Ae.jsxs)(ji,{style:{width:"3.5rem"},children:[u?(0,Ae.jsx)(Yi,{onClick:()=>y(!1)}):(0,Ae.jsx)(Zi,{onClick:()=>y(!0)}),(0,Ae.jsx)(Qh,{onClick:c})]})]}),(0,Ae.jsx)(Xh,{value:g.value===0?.01:g.value,label:g.label}),(0,Ae.jsx)(dc,{error:!!C,children:C||`Password Strength: ${f?g.label:"--"}`}),(0,Ae.jsxs)(kC,{children:[(0,Ae.jsx)(AC,{children:(0,Ae.jsxs)(Ya,{children:[(0,Ae.jsxs)(Za,{children:[(0,Ae.jsx)(np.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),(0,Ae.jsxs)(Za,{children:[(0,Ae.jsx)(np.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),(0,Ae.jsx)(gn,{onClick:i,loading:t,disabled:_,hideAnimations:e,children:"Continue"})]})]}),(0,Ae.jsx)(me,{}),(0,Ae.jsx)(K,{protectedByPrivy:!0})]})},AC=(0,ip.default)(Ya)`
1324
+ `;var xy=y(require("@heroicons/react/24/outline/KeyIcon")),up=y(require("@heroicons/react/24/solid/CheckCircleIcon")),jo=require("react"),mp=y(require("styled-components"));var wy=y(require("fast-password-entropy")),by=y(require("secure-password-utilities")),Ey=require("secure-password-utilities/wordlists"),MC=95,WC=8,LC=3,OC=.3,NC=/[a-z]/,DC=/[A-Z]/,UC=/[0-9]/,FC="a-zA-Z0-9",Ty="!@#$%^&*()\\-_+.",Py=`${FC}${Ty}`,BC=new RegExp(`[${Ty}]`),HC=new RegExp(`[${Py}]`),_y=new RegExp(`^[${Py}]{6,}$`),Sy=(e="")=>{let t=e.split("").filter(r=>!HC.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},yc=()=>by.generatePassphrase(4,Ey.DEFAULT_WORDLIST);function GC(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function VC(e){if(e.length<WC)return 0;let t=0;NC.test(e)&&(t+=1),DC.test(e)&&(t+=1),UC.test(e)&&(t+=1),BC.test(e)&&(t+=1);let r=t/LC;return Math.max(0,Math.min(1,r))}function zC(e=""){let t=VC(e),r=(0,wy.default)(e)/MC;return(t*OC+r)/2}function Ay(e=""){let t=zC(e);return{value:t,label:GC(t)}}var ke=require("react/jsx-runtime"),ky=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,isResettingPassword:n,onSubmit:i,onClose:a,onBack:s,onPasswordChange:l,onPasswordGenerate:c})=>{let[u,f]=(0,jo.useState)(!1),[h,v]=(0,jo.useState)(!1);(0,jo.useEffect)(()=>{r&&!h&&v(!0)},[r]);let C=(0,jo.useMemo)(()=>h?(r?.length||0)<6?"Password must be at least 6 characters":_y.test(r||"")?null:`Invalid characters used ( ${Sy(r).join(" ")} )`:null,[r,h]),g=(0,jo.useMemo)(()=>C?{value:0,label:"Weak"}:Ay(r),[r,C]),P=(0,jo.useMemo)(()=>!!(!r?.length||C),[C,r]);return(0,ke.jsxs)(ke.Fragment,{children:[(0,ke.jsx)(A,{onClose:a,closeable:o.initiatedBy==="user",backFn:s}),(0,ke.jsx)(ae,{}),(0,ke.jsxs)(gn,{children:[(0,ke.jsxs)(wn,{children:[(0,ke.jsx)(xy.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,ke.jsxs)("h3",{style:{color:"var(--privy-color-foreground)"},children:[n?"Reset":"Set"," your password"]}),(0,ke.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),(0,ke.jsxs)(Cn,{children:[(0,ke.jsx)(Qi,{value:r,onChange:S=>l(S.target.value),placeholder:"enter or generate a strong password",type:u?"password":"text",style:{paddingRight:"3.8rem"}}),(0,ke.jsxs)(Xi,{style:{width:"3.5rem"},children:[u?(0,ke.jsx)(ea,{onClick:()=>f(!1)}):(0,ke.jsx)(ta,{onClick:()=>f(!0)}),(0,ke.jsx)(cy,{onClick:c})]})]}),(0,ke.jsx)(dy,{value:g.value===0?.01:g.value,label:g.label}),(0,ke.jsx)(hc,{error:!!C,children:C||`Password Strength: ${h?g.label:"--"}`}),(0,ke.jsxs)($C,{children:[(0,ke.jsx)(qC,{children:(0,ke.jsxs)(rs,{children:[(0,ke.jsxs)(os,{children:[(0,ke.jsx)(up.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),(0,ke.jsxs)(os,{children:[(0,ke.jsx)(up.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),(0,ke.jsx)(vn,{onClick:i,loading:t,disabled:P,hideAnimations:e,children:"Continue"})]})]}),(0,ke.jsx)(pe,{}),(0,ke.jsx)(j,{protectedByPrivy:!0})]})},qC=(0,mp.default)(rs)`
1302
1325
  flex: 1;
1303
1326
  padding-top: 1rem;
1304
- `,kC=ip.default.div`
1327
+ `,$C=mp.default.div`
1305
1328
  display: flex;
1306
1329
  flex-direction: column;
1307
1330
  height: 100%;
1308
- `;var Cy=h(require("@heroicons/react/24/outline/ArrowDownTrayIcon")),wy=h(require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon")),by=h(require("@heroicons/react/24/outline/DocumentDuplicateIcon")),Ey=h(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Ja=require("react");var qe=require("react/jsx-runtime"),Ty=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:i})=>{let[a,l]=(0,Ja.useState)(!1),s=(0,Ja.useCallback)(()=>{l(!0),o&&navigator.clipboard.writeText(o)},[o]),c=(0,Ja.useCallback)(()=>{let u=document.createElement("a"),y=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),f=new Blob([RC(r,o)],{type:"text/plain"}),v=URL.createObjectURL(f);u.href=v,u.target="_blank",u.download=`${y}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(v)},5e3)},[o]);return(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(S,{backFn:i,closeable:!1}),(0,qe.jsx)(ae,{}),(0,qe.jsxs)(yn,{children:[(0,qe.jsxs)(Cn,{children:[(0,qe.jsx)(Ey.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,qe.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),(0,qe.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),(0,qe.jsx)(vn,{centered:!0,children:(0,qe.jsx)(Jh,{children:o})}),(0,qe.jsxs)("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[(0,qe.jsx)(op,{onClick:s,children:a?(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(wy.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(by.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),(0,qe.jsxs)(op,{onClick:c,children:[(0,qe.jsx)(Cy.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),(0,qe.jsx)(gn,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),(0,qe.jsx)(me,{}),(0,qe.jsx)(K,{protectedByPrivy:!0})]})},RC=(e,t)=>`Your wallet recovery password for ${e} is
1331
+ `;var Ry=y(require("@heroicons/react/24/outline/ArrowDownTrayIcon")),Iy=y(require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon")),My=y(require("@heroicons/react/24/outline/DocumentDuplicateIcon")),Wy=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),ns=require("react");var qe=require("react/jsx-runtime"),Ly=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:i})=>{let[a,s]=(0,ns.useState)(!1),l=(0,ns.useCallback)(()=>{s(!0),o&&navigator.clipboard.writeText(o)},[o]),c=(0,ns.useCallback)(()=>{let u=document.createElement("a"),f=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),h=new Blob([KC(r,o)],{type:"text/plain"}),v=URL.createObjectURL(h);u.href=v,u.target="_blank",u.download=`${f}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(v)},5e3)},[o]);return(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(A,{backFn:i,closeable:!1}),(0,qe.jsx)(ae,{}),(0,qe.jsxs)(gn,{children:[(0,qe.jsxs)(wn,{children:[(0,qe.jsx)(Wy.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,qe.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),(0,qe.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),(0,qe.jsx)(Cn,{centered:!0,children:(0,qe.jsx)(ly,{children:o})}),(0,qe.jsxs)("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[(0,qe.jsx)(pp,{onClick:l,children:a?(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(Iy.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(My.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),(0,qe.jsxs)(pp,{onClick:c,children:[(0,qe.jsx)(Ry.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),(0,qe.jsx)(vn,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),(0,qe.jsx)(pe,{}),(0,qe.jsx)(j,{protectedByPrivy:!0})]})},KC=(e,t)=>`Your wallet recovery password for ${e} is
1309
1332
 
1310
1333
  ${t}
1311
1334
 
1312
- You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;var Py=h(require("@heroicons/react/24/solid/CheckCircleIcon")),Sy=h(require("@heroicons/react/24/solid/XCircleIcon"));var Zt=require("react/jsx-runtime"),_y=({error:e,onClose:t})=>(0,Zt.jsxs)(Zt.Fragment,{children:[(0,Zt.jsx)(S,{closeable:!1}),(0,Zt.jsx)(ae,{}),e?(0,Zt.jsxs)(lo,{children:[(0,Zt.jsx)(Sy.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,Zt.jsx)(Ve,{title:"Something went wrong",description:e})]}):(0,Zt.jsxs)(lo,{children:[(0,Zt.jsx)(Py.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,Zt.jsx)(Ve,{title:"Success"})]}),(0,Zt.jsx)(D,{onClick:t,children:"Close"}),(0,Zt.jsx)(me,{}),(0,Zt.jsx)(K,{protectedByPrivy:!0})]});var xy=require("react"),IC=(e,t)=>{switch(e){case"creating":return t==="back"?e:"saving";case"saving":return t==="back"?"creating":"confirming";case"confirming":return t==="back"?"saving":"finalizing";case"finalizing":return t==="back"?"confirming":"done";default:return e}},Ay=()=>{let[e,t]=(0,xy.useReducer)(IC,"creating");return{send:t,state:e}};var Xi=require("react/jsx-runtime"),uc=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:o}=k(),{send:n,state:i}=Ay(),a=(0,ea.useCallback)(async()=>{i==="finalizing"&&await e(),n("next")},[i,n,e]);(0,ea.useEffect)(()=>{let c;return i==="done"&&t.config.initiatedBy==="automatic"&&(c=setTimeout(()=>t.onClose?.(),it)),()=>{c&&clearTimeout(c)}},[i,t.config.initiatedBy,t.onClose]);let l=(0,ea.useCallback)(()=>{n("back")},[n]),s=(0,ea.useCallback)(()=>{o("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,o]);return i==="creating"?(0,Xi.jsx)(vy,{...t,onSubmit:a,onBack:r==="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"?s:void 0}):i==="saving"?(0,Xi.jsx)(Ty,{...t,onSubmit:a,onBack:l}):i==="confirming"?(0,Xi.jsx)(ty,{...t,onSubmit:a,onBack:l}):i==="finalizing"?(0,Xi.jsx)(ly,{...t,onSubmit:a,onBack:l}):i==="done"?(0,Xi.jsx)(_y,{...t,onSubmit:a}):null};var Ry=require("react/jsx-runtime"),ky=()=>{let[e,t]=(0,Zn.useState)(null),[r,o]=(0,Zn.useState)(!1),[n,i]=(0,Zn.useState)(null),[a,l]=(0,Zn.useState)(""),{authenticated:s,getAccessToken:c,user:u}=G(),{walletProxy:y,refreshUser:f,closePrivyModal:v,createAnalyticsEvent:C}=W(),{app:g,navigate:_,data:x,onUserCloseViaDialogOrKeybindRef:b}=k(),{onSuccess:A,onFailure:R}=x.createWallet,U=He(u),M=e?.recoveryMethod==="user-passcode",I=U?.recoveryMethod==="user-passcode";(0,Zn.useEffect)(()=>{s||(_("LANDING"),R(new Is("User must be authenticated before setting a password on a Privy wallet")))},[s]);let V=()=>{if(n){R(n),v({shouldCallAuthOnSuccess:!1});return}if(!M){R(new tr("Exited before password was added to wallet")),v({shouldCallAuthOnSuccess:!1});return}A(e),v({shouldCallAuthOnSuccess:!1})};b.current=V;let j=async()=>{let L=await c();if(L&&U?.address&&a&&y)try{if(C({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:U.address,recoveryMethod:"user-passcode",isResettingPassword:I}}),!(await y.setRecovery({accessToken:L,address:U.address,recoveryPassword:a,recoveryMethod:"user-passcode"})).address){i(new tr("Error setting password on privy wallet")),C({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:U.address,recoveryMethod:"user-passcode",isResettingPassword:I,reason:"error setting password"}});return}let O=await f(),ye=He(O);if(!ye){i(new tr("Error setting password on privy wallet")),C({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:U.address,recoveryMethod:"user-passcode",isResettingPassword:I,reason:"wallet disconnected"}});return}t(ye),C({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:U.address,recoveryMethod:"user-passcode",isResettingPassword:I}})}catch(z){console.warn(z),i(z instanceof Error?z:new Error("Error setting password on privy wallet")),C({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:U.address,reason:z}})}},te=async()=>{M?(A(e),v({shouldCallAuthOnSuccess:!1})):(o(!0),i(null),await j(),o(!1))};return(0,Ry.jsx)(uc,{appName:g?.name||"privy",config:{initiatedBy:"user",onCancel:V},error:n?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:a,isResettingPassword:I,onPasswordGenerate:()=>l(pc()),onPasswordChange:l,onSubmit:te,onClose:V})};var Iy=h(require("@heroicons/react/24/outline/UserCircleIcon")),My=h(require("@heroicons/react/24/solid/LockClosedIcon"));var Gt=require("react/jsx-runtime"),Wy=()=>{let{closePrivyModal:e}=W(),{data:t,setModalData:r,navigate:o,onUserCloseViaDialogOrKeybindRef:n}=k(),{onSuccess:i,onFailure:a}=t.setWalletPassword,l=()=>{a(new tr("Exited before password was added to wallet")),e({shouldCallAuthOnSuccess:!1})};return n.current=l,(0,Gt.jsxs)(Gt.Fragment,{children:[(0,Gt.jsx)(S,{onClose:l}),(0,Gt.jsx)(ae,{}),(0,Gt.jsxs)(lo,{children:[(0,Gt.jsxs)(qf,{children:[(0,Gt.jsx)(Iy.default,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,Gt.jsx)($f,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:(0,Gt.jsx)(My.default,{width:"12px",height:"12px",fill:"white"})})]}),(0,Gt.jsxs)(Ve,{title:"Secure Your Account",children:["Please set a password to secure your account.",(0,Gt.jsx)("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),(0,Gt.jsx)(D,{onClick:()=>{r({createWallet:{onFailure:a,onSuccess:i,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),o("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),(0,Gt.jsx)(me,{}),(0,Gt.jsx)(K,{protectedByPrivy:!0})]})};var Ly=h(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Oy=h(require("@heroicons/react/24/outline/PhoneIcon")),ap=h(require("styled-components"));var bt=require("react/jsx-runtime"),MC=e=>{let t=(0,bt.jsx)(Ly.default,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof E)switch(e.privyErrorCode){case"client_request_timeout":return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else{if(e instanceof st&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:(0,bt.jsx)(Oy.default,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof ut)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:t};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:t};case"allowlist_rejected":return{title:"You don't have access to this app",detail:"Have you been invited?",ctaText:"Try another account",icon:(0,bt.jsx)(ec,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case"captcha_failure":return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:(0,bt.jsx)("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:(0,bt.jsx)("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:t};case"not_supported":return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:t};case"too_many_requests":return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else return e instanceof Xr&&e.status===422?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:t}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}},Ny=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=k();return(0,bt.jsx)(Qa,{error:r?.errorModalData?.error||new Error,backFn:!o||n===o?void 0:t,onClick:()=>e(o||"LANDING",!1)})},Qa=({error:e,backFn:t,onClick:r})=>{let{reset:o}=_e(),n=MC(e),i=()=>{e instanceof ut&&e.privyErrorCode==="invalid_captcha"&&o(),r?.()};return(0,bt.jsxs)(bt.Fragment,{children:[(0,bt.jsx)(S,{backFn:t}),(0,bt.jsxs)(WC,{children:[(0,bt.jsx)(Mt,{children:(0,bt.jsxs)("div",{children:[(0,bt.jsx)(Xl,{color:"var(--privy-color-error)"}),n.icon]})}),(0,bt.jsxs)(LC,{children:[(0,bt.jsx)("h3",{children:n.title}),(0,bt.jsx)("p",{children:n.detail})]}),(0,bt.jsx)(D,{color:"var(--privy-color-error)",onClick:i,children:n.ctaText})]})]})},WC=ap.default.div`
1335
+ You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;var Oy=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Ny=y(require("@heroicons/react/24/solid/XCircleIcon"));var Jt=require("react/jsx-runtime"),Dy=({error:e,onClose:t})=>(0,Jt.jsxs)(Jt.Fragment,{children:[(0,Jt.jsx)(A,{closeable:!1}),(0,Jt.jsx)(ae,{}),e?(0,Jt.jsxs)(po,{children:[(0,Jt.jsx)(Ny.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,Jt.jsx)(Ve,{title:"Something went wrong",description:e})]}):(0,Jt.jsxs)(po,{children:[(0,Jt.jsx)(Oy.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,Jt.jsx)(Ve,{title:"Success"})]}),(0,Jt.jsx)(U,{onClick:t,children:"Close"}),(0,Jt.jsx)(pe,{}),(0,Jt.jsx)(j,{protectedByPrivy:!0})]});var Uy=require("react"),jC=(e,t)=>{switch(e){case"creating":return t==="back"?e:"saving";case"saving":return t==="back"?"creating":"confirming";case"confirming":return t==="back"?"saving":"finalizing";case"finalizing":return t==="back"?"confirming":"done";default:return e}},Fy=()=>{let[e,t]=(0,Uy.useReducer)(jC,"creating");return{send:t,state:e}};var na=require("react/jsx-runtime"),gc=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:o}=k(),{send:n,state:i}=Fy(),a=(0,ia.useCallback)(async()=>{i==="finalizing"&&await e(),n("next")},[i,n,e]);(0,ia.useEffect)(()=>{let c;return i==="done"&&t.config.initiatedBy==="automatic"&&(c=setTimeout(()=>t.onClose?.(),et)),()=>{c&&clearTimeout(c)}},[i,t.config.initiatedBy,t.onClose]);let s=(0,ia.useCallback)(()=>{n("back")},[n]),l=(0,ia.useCallback)(()=>{o("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,o]);return i==="creating"?(0,na.jsx)(ky,{...t,onSubmit:a,onBack:r==="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"?l:void 0}):i==="saving"?(0,na.jsx)(Ly,{...t,onSubmit:a,onBack:s}):i==="confirming"?(0,na.jsx)(uy,{...t,onSubmit:a,onBack:s}):i==="finalizing"?(0,na.jsx)(Cy,{...t,onSubmit:a,onBack:s}):i==="done"?(0,na.jsx)(Dy,{...t,onSubmit:a}):null};var Hy=require("react/jsx-runtime"),By=()=>{let[e,t]=(0,Qn.useState)(null),[r,o]=(0,Qn.useState)(!1),[n,i]=(0,Qn.useState)(null),[a,s]=(0,Qn.useState)(""),{authenticated:l,getAccessToken:c,user:u}=H(),{walletProxy:f,refreshUser:h,closePrivyModal:v,createAnalyticsEvent:C}=W(),{app:g,navigate:P,data:S,onUserCloseViaDialogOrKeybindRef:E}=k(),{onSuccess:x,onFailure:R}=S.createWallet,D=He(u),I=e?.recoveryMethod==="user-passcode",M=D?.recoveryMethod==="user-passcode";(0,Qn.useEffect)(()=>{l||(P("LANDING"),R(new Us("User must be authenticated before setting a password on a Privy wallet")))},[l]);let V=()=>{if(n){R(n),v({shouldCallAuthOnSuccess:!1});return}if(!I){R(new rr("Exited before password was added to wallet")),v({shouldCallAuthOnSuccess:!1});return}x(e),v({shouldCallAuthOnSuccess:!1})};E.current=V;let z=async()=>{let L=await c();if(L&&D?.address&&a&&f)try{if(C({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:D.address,recoveryMethod:"user-passcode",isResettingPassword:M}}),!(await f.setRecovery({accessToken:L,address:D.address,recoveryPassword:a,recoveryMethod:"user-passcode"})).address){i(new rr("Error setting password on privy wallet")),C({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,recoveryMethod:"user-passcode",isResettingPassword:M,reason:"error setting password"}});return}let O=await h(),ge=He(O);if(!ge){i(new rr("Error setting password on privy wallet")),C({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,recoveryMethod:"user-passcode",isResettingPassword:M,reason:"wallet disconnected"}});return}t(ge),C({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:D.address,recoveryMethod:"user-passcode",isResettingPassword:M}})}catch(K){console.warn(K),i(K instanceof Error?K:new Error("Error setting password on privy wallet")),C({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:D.address,reason:K}})}},re=async()=>{I?(x(e),v({shouldCallAuthOnSuccess:!1})):(o(!0),i(null),await z(),o(!1))};return(0,Hy.jsx)(gc,{appName:g?.name||"privy",config:{initiatedBy:"user",onCancel:V},error:n?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:a,isResettingPassword:M,onPasswordGenerate:()=>s(yc()),onPasswordChange:s,onSubmit:re,onClose:V})};var Gy=y(require("@heroicons/react/24/outline/UserCircleIcon")),Vy=y(require("@heroicons/react/24/solid/LockClosedIcon"));var zt=require("react/jsx-runtime"),zy=()=>{let{closePrivyModal:e}=W(),{data:t,setModalData:r,navigate:o,onUserCloseViaDialogOrKeybindRef:n}=k(),{onSuccess:i,onFailure:a}=t.setWalletPassword,s=()=>{a(new rr("Exited before password was added to wallet")),e({shouldCallAuthOnSuccess:!1})};return n.current=s,(0,zt.jsxs)(zt.Fragment,{children:[(0,zt.jsx)(A,{onClose:s}),(0,zt.jsx)(ae,{}),(0,zt.jsxs)(po,{children:[(0,zt.jsxs)(Xf,{children:[(0,zt.jsx)(Gy.default,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,zt.jsx)(eh,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:(0,zt.jsx)(Vy.default,{width:"12px",height:"12px",fill:"white"})})]}),(0,zt.jsxs)(Ve,{title:"Secure Your Account",children:["Please set a password to secure your account.",(0,zt.jsx)("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),(0,zt.jsx)(U,{onClick:()=>{r({createWallet:{onFailure:a,onSuccess:i,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),o("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),(0,zt.jsx)(pe,{}),(0,zt.jsx)(j,{protectedByPrivy:!0})]})};var qy=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),$y=y(require("@heroicons/react/24/outline/PhoneIcon")),fp=y(require("styled-components"));var Pt=require("react/jsx-runtime"),YC=e=>{let t=(0,Pt.jsx)(qy.default,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof b)switch(e.privyErrorCode){case"client_request_timeout":return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else{if(e instanceof lt&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:(0,Pt.jsx)($y.default,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof mt)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:t};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:t};case"allowlist_rejected":return{title:"You don't have access to this app",detail:"Have you been invited?",ctaText:"Try another account",icon:(0,Pt.jsx)(ic,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case"captcha_failure":return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:(0,Pt.jsx)("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:(0,Pt.jsx)("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:t};case"not_supported":return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:t};case"too_many_requests":return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else return e instanceof Xr&&e.status===422?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:t}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}},Ky=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=k();return(0,Pt.jsx)(is,{error:r?.errorModalData?.error||new Error,backFn:!o||n===o?void 0:t,onClick:()=>e(o||"LANDING",!1)})},is=({error:e,backFn:t,onClick:r})=>{let{reset:o}=Ae(),n=YC(e),i=()=>{e instanceof mt&&e.privyErrorCode==="invalid_captcha"&&o(),r?.()};return(0,Pt.jsxs)(Pt.Fragment,{children:[(0,Pt.jsx)(A,{backFn:t}),(0,Pt.jsxs)(ZC,{children:[(0,Pt.jsx)(Et,{children:(0,Pt.jsxs)("div",{children:[(0,Pt.jsx)(nc,{color:"var(--privy-color-error)"}),n.icon]})}),(0,Pt.jsxs)(JC,{children:[(0,Pt.jsx)("h3",{children:n.title}),(0,Pt.jsx)("p",{children:n.detail})]}),(0,Pt.jsx)(U,{color:"var(--privy-color-error)",onClick:i,children:n.ctaText})]})]})},ZC=fp.default.div`
1313
1336
  display: flex;
1314
1337
  flex-direction: column;
1315
1338
  align-items: center;
@@ -1317,11 +1340,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1317
1340
  gap: 24px;
1318
1341
  width: 100%;
1319
1342
  padding-bottom: 16px;
1320
- `,LC=ap.default.div`
1343
+ `,JC=fp.default.div`
1321
1344
  display: flex;
1322
1345
  flex-direction: column;
1323
1346
  gap: 8px;
1324
- `;var jo=require("react"),es=require("react-device-detect"),dp=h(require("styled-components"));var Uy=require("react"),Fy=h(require("styled-components"));var sp=require("react/jsx-runtime"),mc=({style:e,color:t,...r})=>(0,sp.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:t||"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...r,children:(0,sp.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});var fc=require("react/jsx-runtime"),Dy=({color:e,...t})=>(0,fc.jsx)("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:(0,fc.jsx)("g",{children:(0,fc.jsx)("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"})})});var Xa=require("react/jsx-runtime"),bn=e=>{let[t,r]=(0,Uy.useState)(!1);return(0,Xa.jsxs)(OC,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?(0,Xa.jsx)(mc,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):(0,Xa.jsx)(Dy,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},OC=Fy.default.button`
1347
+ `;var Yo=require("react"),ss=require("react-device-detect"),vp=y(require("styled-components"));var Yy=require("react"),Zy=y(require("styled-components"));var hp=require("react/jsx-runtime"),vc=({style:e,color:t,...r})=>(0,hp.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:t||"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...r,children:(0,hp.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});var Cc=require("react/jsx-runtime"),jy=({color:e,...t})=>(0,Cc.jsx)("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:(0,Cc.jsx)("g",{children:(0,Cc.jsx)("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"})})});var as=require("react/jsx-runtime"),En=e=>{let[t,r]=(0,Yy.useState)(!1);return(0,as.jsxs)(QC,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?(0,as.jsx)(vc,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):(0,as.jsx)(jy,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},QC=Zy.default.button`
1325
1348
  display: flex;
1326
1349
  align-items: center;
1327
1350
  gap: 6px;
@@ -1359,7 +1382,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1359
1382
  width: 14px;
1360
1383
  height: 14px;
1361
1384
  }
1362
- `;var By=require("react"),Hy=h(require("styled-components")),Gy=require("react/jsx-runtime"),hc=e=>{let[t,r]=(0,By.useState)(!1);return(0,Gy.jsx)(NC,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},NC=Hy.default.a`
1385
+ `;var Jy=require("react"),Qy=y(require("styled-components")),Xy=require("react/jsx-runtime"),wc=e=>{let[t,r]=(0,Jy.useState)(!1);return(0,Xy.jsx)(XC,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},XC=Qy.default.a`
1363
1386
  display: flex;
1364
1387
  align-items: center;
1365
1388
  gap: 6px;
@@ -1397,7 +1420,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1397
1420
  width: 14px;
1398
1421
  height: 14px;
1399
1422
  }
1400
- `;var zy=h(require("qrcode")),qy=h(require("react")),$y=h(require("styled-components"));var lp=require("react/jsx-runtime"),Vy=()=>(0,lp.jsx)("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:(0,lp.jsx)("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});var Xe=require("react/jsx-runtime"),kr=7,cp=(e,t,r,o,n)=>{for(let i=t;i<t+o;i++)for(let a=r;a<r+n;a++){let l=e?.[a];l&&l[i]&&(l[i]=0)}return e},DC=e=>{let t=zy.default.create(e,{errorCorrectionLevel:"high"}).modules,r=Ju(Array.from(t.data),t.size);return r=cp(r,0,0,kr,kr),r=cp(r,r.length-kr,0,kr,kr),r=cp(r,0,r.length-kr,kr,kr),r},UC=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>(0,Xe.jsx)(Xe.Fragment,{children:[0,1,2].map(i=>(0,Xe.jsx)("circle",{r:r*(kr-i*2)/2,cx:e+r*kr/2,cy:t+r*kr/2,fill:i%2!==0?o:n},`finder-${e}-${t}-${i}`))}),FC=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-kr)*e,0],[0,(t-kr)*e]];return(0,Xe.jsx)(Xe.Fragment,{children:n.map(([i,a])=>(0,Xe.jsx)(UC,{x:i,y:a,cellSize:e,bgColor:r,fgColor:o},`finder-${i}-${a}`))})},BC=({matrix:e,cellSize:t,color:r})=>(0,Xe.jsx)(Xe.Fragment,{children:e.map((i,a)=>i.map((l,s)=>l?(0,Xe.jsx)("rect",{height:t-.2*2,width:t-.2*2,x:a*t+t*(.2/2),y:s*t+t*(.2/2),rx:t*.5,ry:t*.5,fill:r},`cell-${a}-${s}`):(0,Xe.jsx)(qy.default.Fragment,{},`circle-${a}-${s}`)))}),HC=({cellSize:e,matrixSize:t,element:r,sizePercentage:o,bgColor:n})=>{if(!r)return(0,Xe.jsx)(Xe.Fragment,{});let i=t*(o||.15),a=Math.floor(t/2-i/2),l=Math.floor(t/2+i/2);(l-a)%2!==t%2&&(l+=1);let s=(l-a)*e,c=.1,u=s-s*c*2,y=r,f=a*e;return(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)("rect",{x:a*e,y:a*e,width:s,height:s,fill:n}),(0,Xe.jsx)(y,{x:f+s*c,y:f+s*c,height:u,width:u})]})},GC=e=>{let t=e.outputSize,r=DC(e.url),o=t/r.length;return(0,Xe.jsxs)("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%"},children:[(0,Xe.jsx)(BC,{matrix:r,cellSize:o,color:e.fgColor}),(0,Xe.jsx)(FC,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),(0,Xe.jsx)(HC,{cellSize:o,element:e.logo?.element,bgColor:e.bgColor,matrixSize:r.length})]})},VC=$y.default.div`
1423
+ `;var tg=y(require("qrcode")),rg=y(require("react")),og=y(require("styled-components"));var yp=require("react/jsx-runtime"),eg=()=>(0,yp.jsx)("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:(0,yp.jsx)("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});var tt=require("react/jsx-runtime"),Rr=7,gp=(e,t,r,o,n)=>{for(let i=t;i<t+o;i++)for(let a=r;a<r+n;a++){let s=e?.[a];s&&s[i]&&(s[i]=0)}return e},e4=e=>{let t=tg.default.create(e,{errorCorrectionLevel:"high"}).modules,r=nm(Array.from(t.data),t.size);return r=gp(r,0,0,Rr,Rr),r=gp(r,r.length-Rr,0,Rr,Rr),r=gp(r,0,r.length-Rr,Rr,Rr),r},t4=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>(0,tt.jsx)(tt.Fragment,{children:[0,1,2].map(i=>(0,tt.jsx)("circle",{r:r*(Rr-i*2)/2,cx:e+r*Rr/2,cy:t+r*Rr/2,fill:i%2!==0?o:n},`finder-${e}-${t}-${i}`))}),r4=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-Rr)*e,0],[0,(t-Rr)*e]];return(0,tt.jsx)(tt.Fragment,{children:n.map(([i,a])=>(0,tt.jsx)(t4,{x:i,y:a,cellSize:e,bgColor:r,fgColor:o},`finder-${i}-${a}`))})},o4=({matrix:e,cellSize:t,color:r})=>(0,tt.jsx)(tt.Fragment,{children:e.map((i,a)=>i.map((s,l)=>s?(0,tt.jsx)("rect",{height:t-.2*2,width:t-.2*2,x:a*t+t*(.2/2),y:l*t+t*(.2/2),rx:t*.5,ry:t*.5,fill:r},`cell-${a}-${l}`):(0,tt.jsx)(rg.default.Fragment,{},`circle-${a}-${l}`)))}),n4=({cellSize:e,matrixSize:t,element:r,sizePercentage:o,bgColor:n})=>{if(!r)return(0,tt.jsx)(tt.Fragment,{});let i=t*(o||.15),a=Math.floor(t/2-i/2),s=Math.floor(t/2+i/2);(s-a)%2!==t%2&&(s+=1);let l=(s-a)*e,c=.1,u=l-l*c*2,f=r,h=a*e;return(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)("rect",{x:a*e,y:a*e,width:l,height:l,fill:n}),(0,tt.jsx)(f,{x:h+l*c,y:h+l*c,height:u,width:u})]})},i4=e=>{let t=e.outputSize,r=e4(e.url),o=t/r.length;return(0,tt.jsxs)("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%"},children:[(0,tt.jsx)(o4,{matrix:r,cellSize:o,color:e.fgColor}),(0,tt.jsx)(r4,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),(0,tt.jsx)(n4,{cellSize:o,element:e.logo?.element,bgColor:e.bgColor,matrixSize:r.length})]})},a4=og.default.div`
1401
1424
  display: flex;
1402
1425
  justify-content: center;
1403
1426
  align-items: center;
@@ -1412,7 +1435,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1412
1435
  border-color: ${e=>e.borderColor};
1413
1436
  border-radius: var(--privy-border-radius-md);
1414
1437
  }
1415
- `,ta=e=>{let{appearance:t}=Kt(),r=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",n=e.size||160,i=t.palette.colorScheme==="dark"?r:o;return(0,Xe.jsx)(VC,{size:n,bgColor:r,fgColor:o,borderColor:i,children:(0,Xe.jsx)(GC,{url:e.url,logo:{element:e.squareLogoElement??Vy},outputSize:n,bgColor:r,fgColor:o})})};var Jn=require("react/jsx-runtime"),_o=({style:e,...t})=>(0,Jn.jsxs)("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...e},...t,children:[(0,Jn.jsx)("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),(0,Jn.jsx)("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),(0,Jn.jsx)("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),(0,Jn.jsx)("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});var re=require("react/jsx-runtime"),Ky="#8a63d2",Yy=1e3,zC=Yy*2,qC=Yy*120,Zy=()=>{let{authenticated:e,logout:t,ready:r,user:o}=G(),{lastScreen:n,navigate:i,navigateBack:a,setModalData:l,app:s}=k(),{getAuthFlow:c,loginWithFarcaster:u,closePrivyModal:y,createAnalyticsEvent:f}=W(),[v,C]=(0,jo.useState)(void 0),[g,_]=(0,jo.useState)(!1),[x,b]=(0,jo.useState)(!1),A=(0,jo.useRef)([]),R=it,U=c(),M=U?.meta.connectUri;return(0,jo.useEffect)(()=>{let I=Date.now(),V=setInterval(async()=>{let j=await U.pollForReady.execute(),te=Date.now()-I;if(j){clearInterval(V),_(!0);try{await u(),b(!0)}catch(L){let z={retryable:!1,message:"Authentication failed"};if(L?.privyErrorCode==="allowlist_rejected"){i("ALLOWLIST_REJECTION_SCREEN");return}else if(L?.privyErrorCode==="max_accounts_reached"){console.error(new Ur(L).toString()),i("USER_LIMIT_REACHED_SCREEN");return}else L?.privyErrorCode==="linked_to_another_user"?z.detail="This account has already been linked to another user.":L?.privyErrorCode==="invalid_credentials"?(z.retryable=!0,z.detail="Something went wrong. Try again."):L?.privyErrorCode==="too_many_requests"&&(z.detail="Too many requests. Please wait before trying again.");C(z)}}else te>qC&&(clearInterval(V),C({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},zC);return()=>{clearInterval(V),A.current.forEach(j=>clearTimeout(j))}},[]),(0,jo.useEffect)(()=>{if(r&&e&&x&&o){if(s?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let V=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},R);return()=>clearTimeout(V)}x&&(pr(o,s?.embeddedWallets.createOnLogin)?A.current.push(setTimeout(()=>{l({createWallet:{onSuccess:()=>{},onFailure:V=>{console.error(V),f({eventName:"embedded_wallet_creation_failure_logout",payload:{error:V,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},R)):A.current.push(setTimeout(()=>y({shouldCallAuthOnSuccess:!0,isSuccess:!0}),R)))}},[x,r,e,o]),es.isMobile||g?(0,re.jsxs)(re.Fragment,{children:[(0,re.jsx)(S,{backFn:n?a:void 0,onClose:y},"header"),(0,re.jsx)(ae,{}),es.isIOS?(0,re.jsx)(re.Fragment,{children:(0,re.jsxs)($C,{children:[(0,re.jsx)(Mt,{children:(0,re.jsxs)("div",{children:[(0,re.jsx)(At,{success:x,fail:!!v}),(0,re.jsx)(_o,{style:{width:"38px",height:"38px"}})]})}),(0,re.jsxs)(wt,{children:[(0,re.jsx)(ge,{children:v?v.message:"Sign in with Farcaster"}),(0,re.jsx)(Ce,{children:v?v.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),M&&(0,re.jsx)(D,{onClick:I=>{I.preventDefault(),window.location.href=M},children:"Open Warpcast app"})]})}):(0,re.jsx)(re.Fragment,{children:(0,re.jsxs)(jy,{children:[(0,re.jsx)(Mt,{children:(0,re.jsxs)("div",{children:[(0,re.jsx)(At,{success:x,fail:!!v}),(0,re.jsx)(_o,{style:{width:"38px",height:"38px"}})]})}),(0,re.jsxs)(wt,{children:[(0,re.jsx)(ge,{children:v?v.message:"Signing in with Farcaster"}),(0,re.jsx)(Ce,{children:v?v.detail:"This should only take a moment"}),(0,re.jsx)(or,{children:M&&es.isMobile&&(0,re.jsx)(hc,{text:"Take me to Warpcast",url:M,color:Ky})})]})]})}),(0,re.jsx)(q,{})]}):(0,re.jsxs)(re.Fragment,{children:[(0,re.jsx)(S,{backFn:n?a:void 0,onClose:y},"header"),(0,re.jsx)(ae,{}),(0,re.jsx)(jy,{children:(0,re.jsxs)("div",{children:[(0,re.jsx)(ge,{children:"Sign in with Farcaster"}),(0,re.jsx)(Ce,{children:"Scan with your phone's camera to continue."}),(0,re.jsx)(Ni,{children:M?(0,re.jsx)(ta,{url:M,size:275,squareLogoElement:_o}):(0,re.jsx)(kt,{})}),(0,re.jsxs)(or,{children:[(0,re.jsx)(Ce,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),M&&(0,re.jsx)(bn,{text:M,itemName:"link",color:Ky})]})]})}),(0,re.jsx)(q,{})]})},jy=dp.default.div`
1438
+ `,aa=e=>{let{appearance:t}=It(),r=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",n=e.size||160,i=t.palette.colorScheme==="dark"?r:o;return(0,tt.jsx)(a4,{size:n,bgColor:r,fgColor:o,borderColor:i,children:(0,tt.jsx)(i4,{url:e.url,logo:{element:e.squareLogoElement??eg},outputSize:n,bgColor:r,fgColor:o})})};var Xn=require("react/jsx-runtime"),Ao=({style:e,...t})=>(0,Xn.jsxs)("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...e},...t,children:[(0,Xn.jsx)("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),(0,Xn.jsx)("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),(0,Xn.jsx)("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),(0,Xn.jsx)("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});var ne=require("react/jsx-runtime"),ng="#8a63d2",ag=1e3,s4=ag*2,l4=ag*120,sg=()=>{let{authenticated:e,logout:t,ready:r,user:o}=H(),{lastScreen:n,navigate:i,navigateBack:a,setModalData:s,app:l}=k(),{getAuthFlow:c,loginWithFarcaster:u,closePrivyModal:f,createAnalyticsEvent:h}=W(),[v,C]=(0,Yo.useState)(void 0),[g,P]=(0,Yo.useState)(!1),[S,E]=(0,Yo.useState)(!1),x=(0,Yo.useRef)([]),R=et,D=c(),I=D?.meta.connectUri;return(0,Yo.useEffect)(()=>{let M=Date.now(),V=setInterval(async()=>{let z=await D.pollForReady.execute(),re=Date.now()-M;if(z){clearInterval(V),P(!0);try{await u(),E(!0)}catch(L){let K={retryable:!1,message:"Authentication failed"};if(L?.privyErrorCode==="allowlist_rejected"){i("ALLOWLIST_REJECTION_SCREEN");return}else if(L?.privyErrorCode==="max_accounts_reached"){console.error(new Fr(L).toString()),i("USER_LIMIT_REACHED_SCREEN");return}else L?.privyErrorCode==="linked_to_another_user"?K.detail="This account has already been linked to another user.":L?.privyErrorCode==="invalid_credentials"?(K.retryable=!0,K.detail="Something went wrong. Try again."):L?.privyErrorCode==="too_many_requests"&&(K.detail="Too many requests. Please wait before trying again.");C(K)}}else re>l4&&(clearInterval(V),C({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},s4);return()=>{clearInterval(V),x.current.forEach(z=>clearTimeout(z))}},[]),(0,Yo.useEffect)(()=>{if(r&&e&&S&&o){if(l?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let V=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},R);return()=>clearTimeout(V)}S&&(mr(o,l?.embeddedWallets.createOnLogin)?x.current.push(setTimeout(()=>{s({createWallet:{onSuccess:()=>{},onFailure:V=>{console.error(V),h({eventName:"embedded_wallet_creation_failure_logout",payload:{error:V,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},R)):x.current.push(setTimeout(()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0}),R)))}},[S,r,e,o]),ss.isMobile||g?(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(A,{backFn:n?a:void 0,onClose:f},"header"),(0,ne.jsx)(ae,{}),ss.isIOS?(0,ne.jsx)(ne.Fragment,{children:(0,ne.jsxs)(c4,{children:[(0,ne.jsx)(Et,{children:(0,ne.jsxs)("div",{children:[(0,ne.jsx)(wt,{success:S,fail:!!v}),(0,ne.jsx)(Ao,{style:{width:"38px",height:"38px"}})]})}),(0,ne.jsxs)(dt,{children:[(0,ne.jsx)(ve,{children:v?v.message:"Sign in with Farcaster"}),(0,ne.jsx)(we,{children:v?v.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),I&&(0,ne.jsx)(U,{onClick:M=>{M.preventDefault(),window.location.href=I},children:"Open Warpcast app"})]})}):(0,ne.jsx)(ne.Fragment,{children:(0,ne.jsxs)(ig,{children:[(0,ne.jsx)(Et,{children:(0,ne.jsxs)("div",{children:[(0,ne.jsx)(wt,{success:S,fail:!!v}),(0,ne.jsx)(Ao,{style:{width:"38px",height:"38px"}})]})}),(0,ne.jsxs)(dt,{children:[(0,ne.jsx)(ve,{children:v?v.message:"Signing in with Farcaster"}),(0,ne.jsx)(we,{children:v?v.detail:"This should only take a moment"}),(0,ne.jsx)(nr,{children:I&&ss.isMobile&&(0,ne.jsx)(wc,{text:"Take me to Warpcast",url:I,color:ng})})]})]})}),(0,ne.jsx)($,{})]}):(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(A,{backFn:n?a:void 0,onClose:f},"header"),(0,ne.jsx)(ae,{}),(0,ne.jsx)(ig,{children:(0,ne.jsxs)("div",{children:[(0,ne.jsx)(ve,{children:"Sign in with Farcaster"}),(0,ne.jsx)(we,{children:"Scan with your phone's camera to continue."}),(0,ne.jsx)(Bi,{children:I?(0,ne.jsx)(aa,{url:I,size:275,squareLogoElement:Ao}):(0,ne.jsx)(Mt,{})}),(0,ne.jsxs)(nr,{children:[(0,ne.jsx)(we,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),I&&(0,ne.jsx)(En,{text:I,itemName:"link",color:ng})]})]})}),(0,ne.jsx)($,{})]})},ig=vp.default.div`
1416
1439
  display: flex;
1417
1440
  flex-direction: column;
1418
1441
  align-items: center;
@@ -1420,14 +1443,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
1420
1443
  margin-left: 27px;
1421
1444
  margin-right: 27px;
1422
1445
  gap: 24px;
1423
- `,$C=dp.default.div`
1446
+ `,c4=vp.default.div`
1424
1447
  display: flex;
1425
1448
  flex-direction: column;
1426
1449
  align-items: center;
1427
1450
  justify-content: center;
1428
1451
  gap: 24px;
1429
1452
  width: 100%;
1430
- `;var En=require("react"),ts=require("react-device-detect"),pp=h(require("styled-components"));var oe=require("react/jsx-runtime"),Jy="#8a63d2",Xy=1e3,KC=Xy*2,jC=Xy*300,e1=()=>{let{lastScreen:e,navigateBack:t,data:r,app:o}=k(),{requestFarcasterSignerStatus:n,closePrivyModal:i}=W(),[a,l]=(0,En.useState)(void 0),[s,c]=(0,En.useState)(!1),[u,y]=(0,En.useState)(!1),f=(0,En.useRef)([]),v=it,C=r?.farcasterSigner;(0,En.useEffect)(()=>{let _=Date.now(),x=setInterval(async()=>{if(!C?.public_key){clearInterval(x),l({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}C.status==="approved"&&(clearInterval(x),c(!1),y(!0),f.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),v)));let b=await n(C?.public_key),A=Date.now()-_;b.status==="approved"?(clearInterval(x),c(!1),y(!0),f.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),v))):A>jC?(clearInterval(x),l({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):b.status==="revoked"&&(clearInterval(x),l({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},KC);return()=>{clearInterval(x),f.current.forEach(b=>clearTimeout(b))}},[]);let g=C?.status==="pending_approval"?C.signer_approval_url:void 0;return ts.isMobile||s?(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(S,{backFn:e?t:void 0,onClose:i},"header"),(0,oe.jsx)(ae,{}),ts.isIOS?(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsxs)(YC,{children:[(0,oe.jsx)(Mt,{children:(0,oe.jsxs)("div",{children:[(0,oe.jsx)(At,{success:u,fail:!!a}),(0,oe.jsx)(_o,{style:{width:"38px",height:"38px"}})]})}),(0,oe.jsxs)(wt,{children:[(0,oe.jsx)(ge,{children:a?a.message:"Add a signer to Farcaster"}),(0,oe.jsx)(Ce,{children:a?a.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),g&&(0,oe.jsx)(D,{onClick:_=>{_.preventDefault(),window.location.href=g},children:"Open Warpcast app"})]})}):(0,oe.jsx)(oe.Fragment,{children:(0,oe.jsxs)(Qy,{children:[(0,oe.jsx)(Mt,{children:(0,oe.jsxs)("div",{children:[(0,oe.jsx)(At,{success:u,fail:!!a}),(0,oe.jsx)(_o,{style:{width:"38px",height:"38px"}})]})}),(0,oe.jsxs)(wt,{children:[(0,oe.jsx)(ge,{children:a?a.message:"Requesting signer from Farcaster"}),(0,oe.jsx)(Ce,{children:a?a.detail:"This should only take a moment"}),(0,oe.jsx)(or,{children:g&&ts.isMobile&&(0,oe.jsx)(hc,{text:"Take me to Warpcast",url:g,color:Jy})})]})]})}),(0,oe.jsx)(q,{})]}):(0,oe.jsxs)(oe.Fragment,{children:[(0,oe.jsx)(S,{backFn:e?t:void 0,onClose:i},"header"),(0,oe.jsx)(ae,{}),(0,oe.jsx)(Qy,{children:(0,oe.jsxs)("div",{children:[(0,oe.jsx)(ge,{children:"Add a signer to Farcaster"}),(0,oe.jsxs)(Ce,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),(0,oe.jsx)(Ni,{children:C?.status==="pending_approval"?(0,oe.jsx)(ta,{url:C.signer_approval_url,size:275,squareLogoElement:_o}):(0,oe.jsx)(kt,{})}),(0,oe.jsxs)(or,{children:[(0,oe.jsx)(Ce,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),C?.status==="pending_approval"&&(0,oe.jsx)(bn,{text:C.signer_approval_url,itemName:"link",color:Jy})]})]})}),(0,oe.jsx)(q,{})]})},Qy=pp.default.div`
1453
+ `;var Tn=require("react"),ls=require("react-device-detect"),Cp=y(require("styled-components"));var ie=require("react/jsx-runtime"),lg="#8a63d2",dg=1e3,d4=dg*2,p4=dg*300,pg=()=>{let{lastScreen:e,navigateBack:t,data:r,app:o}=k(),{requestFarcasterSignerStatus:n,closePrivyModal:i}=W(),[a,s]=(0,Tn.useState)(void 0),[l,c]=(0,Tn.useState)(!1),[u,f]=(0,Tn.useState)(!1),h=(0,Tn.useRef)([]),v=et,C=r?.farcasterSigner;(0,Tn.useEffect)(()=>{let P=Date.now(),S=setInterval(async()=>{if(!C?.public_key){clearInterval(S),s({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}C.status==="approved"&&(clearInterval(S),c(!1),f(!0),h.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),v)));let E=await n(C?.public_key),x=Date.now()-P;E.status==="approved"?(clearInterval(S),c(!1),f(!0),h.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),v))):x>p4?(clearInterval(S),s({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):E.status==="revoked"&&(clearInterval(S),s({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},d4);return()=>{clearInterval(S),h.current.forEach(E=>clearTimeout(E))}},[]);let g=C?.status==="pending_approval"?C.signer_approval_url:void 0;return ls.isMobile||l?(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(A,{backFn:e?t:void 0,onClose:i},"header"),(0,ie.jsx)(ae,{}),ls.isIOS?(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsxs)(u4,{children:[(0,ie.jsx)(Et,{children:(0,ie.jsxs)("div",{children:[(0,ie.jsx)(wt,{success:u,fail:!!a}),(0,ie.jsx)(Ao,{style:{width:"38px",height:"38px"}})]})}),(0,ie.jsxs)(dt,{children:[(0,ie.jsx)(ve,{children:a?a.message:"Add a signer to Farcaster"}),(0,ie.jsx)(we,{children:a?a.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),g&&(0,ie.jsx)(U,{onClick:P=>{P.preventDefault(),window.location.href=g},children:"Open Warpcast app"})]})}):(0,ie.jsx)(ie.Fragment,{children:(0,ie.jsxs)(cg,{children:[(0,ie.jsx)(Et,{children:(0,ie.jsxs)("div",{children:[(0,ie.jsx)(wt,{success:u,fail:!!a}),(0,ie.jsx)(Ao,{style:{width:"38px",height:"38px"}})]})}),(0,ie.jsxs)(dt,{children:[(0,ie.jsx)(ve,{children:a?a.message:"Requesting signer from Farcaster"}),(0,ie.jsx)(we,{children:a?a.detail:"This should only take a moment"}),(0,ie.jsx)(nr,{children:g&&ls.isMobile&&(0,ie.jsx)(wc,{text:"Take me to Warpcast",url:g,color:lg})})]})]})}),(0,ie.jsx)($,{})]}):(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(A,{backFn:e?t:void 0,onClose:i},"header"),(0,ie.jsx)(ae,{}),(0,ie.jsx)(cg,{children:(0,ie.jsxs)("div",{children:[(0,ie.jsx)(ve,{children:"Add a signer to Farcaster"}),(0,ie.jsxs)(we,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),(0,ie.jsx)(Bi,{children:C?.status==="pending_approval"?(0,ie.jsx)(aa,{url:C.signer_approval_url,size:275,squareLogoElement:Ao}):(0,ie.jsx)(Mt,{})}),(0,ie.jsxs)(nr,{children:[(0,ie.jsx)(we,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),C?.status==="pending_approval"&&(0,ie.jsx)(En,{text:C.signer_approval_url,itemName:"link",color:lg})]})]})}),(0,ie.jsx)($,{})]})},cg=Cp.default.div`
1431
1454
  display: flex;
1432
1455
  flex-direction: column;
1433
1456
  align-items: center;
@@ -1435,14 +1458,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
1435
1458
  margin-left: 27px;
1436
1459
  margin-right: 27px;
1437
1460
  gap: 24px;
1438
- `,YC=pp.default.div`
1461
+ `,u4=Cp.default.div`
1439
1462
  display: flex;
1440
1463
  flex-direction: column;
1441
1464
  align-items: center;
1442
1465
  justify-content: center;
1443
1466
  gap: 24px;
1444
1467
  width: 100%;
1445
- `;var t1=h(require("@heroicons/react/24/outline/ClockIcon")),r1=h(require("@heroicons/react/24/outline/EyeSlashIcon")),o1=h(require("@heroicons/react/24/outline/LinkIcon")),fo=h(require("styled-components"));var ra=require("react/jsx-runtime"),yc=({size:e=61,...t})=>(0,ra.jsx)("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,ra.jsxs)("g",{id:"moonpay_symbol_wht 2",children:[(0,ra.jsx)("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),(0,ra.jsx)("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});var $e=require("react/jsx-runtime"),up=({title:e,desc:t,icon:r})=>(0,$e.jsxs)(t4,{children:[(0,$e.jsx)(o4,{children:r}),(0,$e.jsxs)(r4,{children:[(0,$e.jsx)(XC,{children:e}),(0,$e.jsx)(e4,{children:t})]})]}),n1=({app:e,signedUrl:t,onContinue:r})=>(0,$e.jsxs)($e.Fragment,{children:[(0,$e.jsxs)(JC,{children:[(0,$e.jsx)(yc,{size:"3.75rem"}),(0,$e.jsxs)(QC,{children:[e?.name," uses ",(0,$e.jsx)("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),(0,$e.jsxs)(n4,{children:[(0,$e.jsx)(up,{icon:(0,$e.jsx)(o1.default,{width:"1rem"}),title:"Purchase assets to fund your account",desc:(0,$e.jsxs)($e.Fragment,{children:["Connect a payment method (",(0,$e.jsx)("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),(0,$e.jsx)(up,{icon:(0,$e.jsx)(t1.default,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),(0,$e.jsx)(up,{icon:(0,$e.jsx)(r1.default,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),(0,$e.jsx)(i4,{className:"mobile-only"})]}),(0,$e.jsx)(ZC,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),(0,$e.jsx)(Vl,{href:t,target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),ZC=fo.default.span`
1468
+ `;var ug=y(require("@heroicons/react/24/outline/ClockIcon")),mg=y(require("@heroicons/react/24/outline/EyeSlashIcon")),fg=y(require("@heroicons/react/24/outline/LinkIcon")),yo=y(require("styled-components"));var sa=require("react/jsx-runtime"),bc=({size:e=61,...t})=>(0,sa.jsx)("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,sa.jsxs)("g",{id:"moonpay_symbol_wht 2",children:[(0,sa.jsx)("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),(0,sa.jsx)("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});var $e=require("react/jsx-runtime"),wp=({title:e,desc:t,icon:r})=>(0,$e.jsxs)(v4,{children:[(0,$e.jsx)(w4,{children:r}),(0,$e.jsxs)(C4,{children:[(0,$e.jsx)(y4,{children:e}),(0,$e.jsx)(g4,{children:t})]})]}),hg=({app:e,signedUrl:t,onContinue:r})=>(0,$e.jsxs)($e.Fragment,{children:[(0,$e.jsxs)(f4,{children:[(0,$e.jsx)(bc,{size:"3.75rem"}),(0,$e.jsxs)(h4,{children:[e?.name," uses ",(0,$e.jsx)("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),(0,$e.jsxs)(b4,{children:[(0,$e.jsx)(wp,{icon:(0,$e.jsx)(fg.default,{width:"1rem"}),title:"Purchase assets to fund your account",desc:(0,$e.jsxs)($e.Fragment,{children:["Connect a payment method (",(0,$e.jsx)("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),(0,$e.jsx)(wp,{icon:(0,$e.jsx)(ug.default,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),(0,$e.jsx)(wp,{icon:(0,$e.jsx)(mg.default,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),(0,$e.jsx)(E4,{className:"mobile-only"})]}),(0,$e.jsx)(m4,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),(0,$e.jsx)(jl,{href:t,target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),m4=yo.default.span`
1446
1469
  display: inline-block;
1447
1470
  color: var(--privy-color-foreground-3);
1448
1471
  text-align: center;
@@ -1451,13 +1474,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
1451
1474
  font-weight: 400;
1452
1475
  line-height: 140%; /* 0.875rem */
1453
1476
  margin-bottom: 0.25rem;
1454
- `,JC=fo.default.div`
1477
+ `,f4=yo.default.div`
1455
1478
  display: flex;
1456
1479
  flex-direction: column;
1457
1480
  align-items: center;
1458
1481
  justify-content: center;
1459
1482
  padding: 1.5rem 0;
1460
- `,QC=fo.default.span`
1483
+ `,h4=yo.default.span`
1461
1484
  color: var(--privy-color-foreground);
1462
1485
  text-align: center;
1463
1486
  font-size: 1.125rem;
@@ -1466,46 +1489,46 @@ You will need this password to access your ${e} wallet on a new device. Please k
1466
1489
  margin: 1.5rem 0;
1467
1490
  text-align: center;
1468
1491
  max-width: 19.5rem;
1469
- `,XC=fo.default.span`
1492
+ `,y4=yo.default.span`
1470
1493
  color: var(--privy-color-foreground);
1471
1494
  font-size: 0.875rem;
1472
1495
  font-weight: 500;
1473
1496
  line-height: 1.225rem;
1474
1497
  width: 100%;
1475
- `,e4=fo.default.span`
1498
+ `,g4=yo.default.span`
1476
1499
  color: var(--privy-color-foreground-2);
1477
1500
  font-size: 0.875rem;
1478
1501
  font-weight: 400;
1479
1502
  line-height: 1.225rem;
1480
- `,t4=fo.default.div`
1503
+ `,v4=yo.default.div`
1481
1504
  display: flex;
1482
1505
  align-items: flex-start;
1483
1506
  gap: 0.5rem;
1484
1507
  align-self: stretch;
1485
- `,r4=fo.default.div`
1508
+ `,C4=yo.default.div`
1486
1509
  display: flex;
1487
1510
  flex-direction: column;
1488
1511
  gap: 0.25rem;
1489
1512
  align-items: flex-start;
1490
1513
  text-align: left;
1491
1514
  flex: 1 0 0;
1492
- `,o4=fo.default.div`
1515
+ `,w4=yo.default.div`
1493
1516
  padding-top: 2px;
1494
- `,n4=fo.default.div`
1517
+ `,b4=yo.default.div`
1495
1518
  display: flex;
1496
1519
  flex-direction: column;
1497
1520
  gap: 1.25rem;
1498
1521
  margin: 0 0.5rem;
1499
- `,i4=fo.default.div`
1522
+ `,E4=yo.default.div`
1500
1523
  margin: 30px 0;
1501
- `;var a1=require("ofetch"),oa=require("react");var gc="moonpay",i1="sdk_fiat_on_ramp_completed_with_status";async function s1(e,t,r,o,n=!1){let i=r.currencyCode?{}:{defaultCurrencyCode:"ETH_ETHEREUM"},a=r.uiConfig||{accentColor:o.accent,theme:o.colorScheme};return e.signMoonpayOnRampUrl({address:t,useSandbox:n,config:{...r,...i,...a}})}async function a4(e,t){let r=t?ym:hm,o=t?vm:gm;return(0,a1.ofetch)(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function l1(e,t=!1){let[r,o]=(0,oa.useState)(null),{createAnalyticsEvent:n}=W(),i=(0,oa.useRef)(0);return(0,oa.useEffect)(()=>{let a=setInterval(async()=>{if(e)try{let[l]=await a4(e,t),s=l.status==="waitingAuthorization"&&l.paymentMethod==="credit_debit_card"?"pending":l.status;o(s),["failed","completed","awaitingAuthorization"].includes(s)&&(n({eventName:i1,payload:{status:s,provider:gc,paymentMethod:l.paymentMethod,cardPaymentType:l.cardPaymentType,currency:l.currency?.code,baseCurrencyAmount:l.baseCurrencyAmount,quoteCurrencyAmount:l.quoteCurrencyAmount,feeAmount:l.feeAmount,extraFeeAmount:l.extraFeeAmount,networkFeeAmount:l.networkFeeAmount}}),clearInterval(a))}catch(l){l.response?.status!==404&&(i.current+=1),i.current>=3&&(o("serviceFailure"),n({eventName:i1,payload:{status:"serviceFailure",provider:gc}}),clearInterval(a))}},3e3);return()=>clearInterval(a)},[e,i]),r}var Tn=require("react/jsx-runtime"),c1=()=>{let{app:e,data:t,navigate:r}=k(),{createAnalyticsEvent:o}=W(),{signedUrl:n}=t.fiatOnRampPrompt;return!e||!n?null:(0,Tn.jsxs)(Tn.Fragment,{children:[(0,Tn.jsx)(S,{title:"Fund account"},"header"),(0,Tn.jsx)(n1,{app:e,signedUrl:n,onContinue:()=>{o({eventName:"sdk_fiat_on_ramp_started",payload:{provider:gc}}),r("FIAT_ON_RAMP_STATUS_SCREEN")}}),(0,Tn.jsx)(K,{protectedByPrivy:!0})]})};var d1=h(require("@heroicons/react/24/solid/ArrowsRightLeftIcon")),p1=h(require("@heroicons/react/24/solid/CheckCircleIcon")),u1=h(require("@heroicons/react/24/solid/XCircleIcon")),m1=require("react"),mp=h(require("styled-components"));var Ue=require("react/jsx-runtime"),f1=()=>{let{app:e,data:t}=k(),{closePrivyModal:r}=W(),{externalTransactionId:o}=t?.fiatOnRampStatus,n=l1(o||null,e.fiatOnRamp.useSandbox);return(0,Ue.jsxs)(Ue.Fragment,{children:[(0,Ue.jsx)(S,{title:"Fund account"},"header"),(0,Ue.jsx)(l4,{status:n,onClickCta:r}),(0,Ue.jsx)(K,{protectedByPrivy:!0})]})},s4=e=>{switch(e){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"failed":return{title:"Something went wrong!",body:(0,Ue.jsxs)(Ue.Fragment,{children:[(0,Ue.jsxs)("p",{children:["It looks like there was an issue with your payment. Please contact"," ",(0,Ue.jsx)("a",{href:"https://support.moonpay.com/hc/en-gb",target:"_blank",rel:"noreferrer noopener",style:{textDecoration:"underline"},children:"Moonpay support"})," ","for assistance."]}),(0,Ue.jsx)("p",{style:{fontStyle:"italic"},children:"Note that debit cards typically work better than credit cards here."})]}),cta:"Done"};case"serviceFailure":return{title:"Something went wrong!",body:"MoonPay ran into an error when processing your transaction. Try again?",cta:"Done"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}},l4=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=(0,m1.useMemo)(()=>s4(e),[e]);return(0,Ue.jsxs)(Ue.Fragment,{children:[(0,Ue.jsxs)(m4,{children:[(0,Ue.jsx)(p4,{status:e}),(0,Ue.jsxs)(wt,{children:[(0,Ue.jsx)("h3",{children:r}),(0,Ue.jsx)(u4,{children:o})]})]}),n&&(0,Ue.jsx)(D,{onClick:t,children:n})]})},c4=e=>e?{completed:"var(--privy-color-success)",failed:"var(--privy-color-error)",serviceFailure:"var(--privy-color-error)",waitingAuthorization:"var(--privy-color-accent)",pending:"var(--privy-color-foreground-4)"}[e]:"var(--privy-color-foreground-4)",d4=e=>{switch(e){case"serviceFailure":case"failed":return u1.default;case"completed":return p1.default;case"waitingAuthorization":return()=>(0,Ue.jsx)(d1.default,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}},p4=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return(0,Ue.jsxs)("div",{style:{position:"relative"},children:[(0,Ue.jsx)(kt,{color:o,style:{position:"absolute"}}),(0,Ue.jsx)(Fd,{color:o}),(0,Ue.jsx)(yc,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=d4(e),r=c4(e);return(0,Ue.jsx)("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&(0,Ue.jsx)(t,{width:"4rem",height:"4rem",color:r})})},u4=mp.default.p`
1524
+ `;var gg=require("ofetch"),la=require("react");var Ec="moonpay",yg="sdk_fiat_on_ramp_completed_with_status";async function vg(e,t,r,o,n=!1){let i=r.currencyCode?{}:{defaultCurrencyCode:"ETH_ETHEREUM"},a=r.uiConfig||{accentColor:o.accent,theme:o.colorScheme};return e.signMoonpayOnRampUrl({address:t,useSandbox:n,config:{...r,...i,...a}})}async function T4(e,t){let r=t?Tm:Em,o=t?_m:Pm;return(0,gg.ofetch)(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function Cg(e,t=!1){let[r,o]=(0,la.useState)(null),{createAnalyticsEvent:n}=W(),i=(0,la.useRef)(0);return(0,la.useEffect)(()=>{let a=setInterval(async()=>{if(e)try{let[s]=await T4(e,t),l=s.status==="waitingAuthorization"&&s.paymentMethod==="credit_debit_card"?"pending":s.status;o(l),["failed","completed","awaitingAuthorization"].includes(l)&&(n({eventName:yg,payload:{status:l,provider:Ec,paymentMethod:s.paymentMethod,cardPaymentType:s.cardPaymentType,currency:s.currency?.code,baseCurrencyAmount:s.baseCurrencyAmount,quoteCurrencyAmount:s.quoteCurrencyAmount,feeAmount:s.feeAmount,extraFeeAmount:s.extraFeeAmount,networkFeeAmount:s.networkFeeAmount}}),clearInterval(a))}catch(s){s.response?.status!==404&&(i.current+=1),i.current>=3&&(o("serviceFailure"),n({eventName:yg,payload:{status:"serviceFailure",provider:Ec}}),clearInterval(a))}},3e3);return()=>clearInterval(a)},[e,i]),r}var Pn=require("react/jsx-runtime"),wg=()=>{let{app:e,data:t,navigate:r}=k(),{createAnalyticsEvent:o}=W(),{signedUrl:n}=t.fiatOnRampPrompt;return!e||!n?null:(0,Pn.jsxs)(Pn.Fragment,{children:[(0,Pn.jsx)(A,{title:"Fund account"},"header"),(0,Pn.jsx)(hg,{app:e,signedUrl:n,onContinue:()=>{o({eventName:"sdk_fiat_on_ramp_started",payload:{provider:Ec}}),r("FIAT_ON_RAMP_STATUS_SCREEN")}}),(0,Pn.jsx)(j,{protectedByPrivy:!0})]})};var bg=y(require("@heroicons/react/24/solid/ArrowsRightLeftIcon")),Eg=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Tg=y(require("@heroicons/react/24/solid/XCircleIcon")),Pg=require("react"),bp=y(require("styled-components"));var Ue=require("react/jsx-runtime"),_g=()=>{let{app:e,data:t}=k(),{closePrivyModal:r}=W(),{externalTransactionId:o}=t?.fiatOnRampStatus,n=Cg(o||null,e.fiatOnRamp.useSandbox);return(0,Ue.jsxs)(Ue.Fragment,{children:[(0,Ue.jsx)(A,{title:"Fund account"},"header"),(0,Ue.jsx)(_4,{status:n,onClickCta:r}),(0,Ue.jsx)(j,{protectedByPrivy:!0})]})},P4=e=>{switch(e){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"failed":return{title:"Something went wrong!",body:(0,Ue.jsxs)(Ue.Fragment,{children:[(0,Ue.jsxs)("p",{children:["It looks like there was an issue with your payment. Please contact"," ",(0,Ue.jsx)("a",{href:"https://support.moonpay.com/hc/en-gb",target:"_blank",rel:"noreferrer noopener",style:{textDecoration:"underline"},children:"Moonpay support"})," ","for assistance."]}),(0,Ue.jsx)("p",{style:{fontStyle:"italic"},children:"Note that debit cards typically work better than credit cards here."})]}),cta:"Done"};case"serviceFailure":return{title:"Something went wrong!",body:"MoonPay ran into an error when processing your transaction. Try again?",cta:"Done"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}},_4=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=(0,Pg.useMemo)(()=>P4(e),[e]);return(0,Ue.jsxs)(Ue.Fragment,{children:[(0,Ue.jsxs)(R4,{children:[(0,Ue.jsx)(x4,{status:e}),(0,Ue.jsxs)(dt,{children:[(0,Ue.jsx)("h3",{children:r}),(0,Ue.jsx)(k4,{children:o})]})]}),n&&(0,Ue.jsx)(U,{onClick:t,children:n})]})},S4=e=>e?{completed:"var(--privy-color-success)",failed:"var(--privy-color-error)",serviceFailure:"var(--privy-color-error)",waitingAuthorization:"var(--privy-color-accent)",pending:"var(--privy-color-foreground-4)"}[e]:"var(--privy-color-foreground-4)",A4=e=>{switch(e){case"serviceFailure":case"failed":return Tg.default;case"completed":return Eg.default;case"waitingAuthorization":return()=>(0,Ue.jsx)(bg.default,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}},x4=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return(0,Ue.jsxs)("div",{style:{position:"relative"},children:[(0,Ue.jsx)(Mt,{color:o,style:{position:"absolute"}}),(0,Ue.jsx)($d,{color:o}),(0,Ue.jsx)(bc,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=A4(e),r=S4(e);return(0,Ue.jsx)("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&(0,Ue.jsx)(t,{width:"4rem",height:"4rem",color:r})})},k4=bp.default.p`
1502
1525
  font-size: 1rem;
1503
1526
  color: var(--privy-color-foreground-3);
1504
1527
  margin-bottom: 1rem;
1505
1528
  display: flex;
1506
1529
  flex-direction: column;
1507
1530
  gap: 1rem;
1508
- `,m4=mp.default.div`
1531
+ `,R4=bp.default.div`
1509
1532
  display: flex;
1510
1533
  flex-direction: column;
1511
1534
  align-items: center;
@@ -1513,7 +1536,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1513
1536
  margin-left: 1.75rem;
1514
1537
  margin-right: 1.75rem;
1515
1538
  padding: 2rem 0;
1516
- `;var h1=h(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),y1=h(require("styled-components"));var Rr=require("react/jsx-runtime"),g1=()=>{let{closePrivyModal:e}=W();return(0,Rr.jsxs)(Rr.Fragment,{children:[(0,Rr.jsx)(S,{},"header"),(0,Rr.jsx)(f4,{children:(0,Rr.jsx)(h1.default,{style:{width:32,height:32}})}),(0,Rr.jsx)(Po,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,Rr.jsx)(Vr,{children:(0,Rr.jsx)(D,{onClick:()=>e(),children:"Close"})}),(0,Rr.jsx)(me,{}),(0,Rr.jsx)(K,{protectedByPrivy:!0})]})},f4=y1.default.div`
1539
+ `;var Sg=y(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),Ag=y(require("styled-components"));var Ir=require("react/jsx-runtime"),xg=()=>{let{closePrivyModal:e}=W();return(0,Ir.jsxs)(Ir.Fragment,{children:[(0,Ir.jsx)(A,{},"header"),(0,Ir.jsx)(I4,{children:(0,Ir.jsx)(Sg.default,{style:{width:32,height:32}})}),(0,Ir.jsx)(_o,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,Ir.jsx)(Vr,{children:(0,Ir.jsx)(U,{onClick:()=>e(),children:"Close"})}),(0,Ir.jsx)(pe,{}),(0,Ir.jsx)(j,{protectedByPrivy:!0})]})},I4=Ag.default.div`
1517
1540
  border-radius: 50%;
1518
1541
  height: 68px;
1519
1542
  width: 68px;
@@ -1523,18 +1546,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1523
1546
  background-color: var(--privy-color-accent);
1524
1547
  color: white;
1525
1548
  margin: 0 auto 24px auto;
1526
- `;var w1=h(require("react-device-detect")),b1=h(require("styled-components"));var vc=h(require("styled-components"));var fp=require("react/jsx-runtime"),v1=({style:e,...t})=>(0,fp.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"17",height:"17",viewBox:"0 0 17 17",style:{height:"1.25rem",width:"1.25rem",...e},...t,children:(0,fp.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})});var wc=require("react/jsx-runtime"),C1=vc.default.div`
1549
+ `;var Ig=y(require("react-device-detect")),Mg=y(require("styled-components"));var Tc=y(require("styled-components"));var Ep=require("react/jsx-runtime"),kg=({style:e,...t})=>(0,Ep.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"17",height:"17",viewBox:"0 0 17 17",style:{height:"1.25rem",width:"1.25rem",...e},...t,children:(0,Ep.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})});var _c=require("react/jsx-runtime"),Rg=Tc.default.div`
1527
1550
  display: flex;
1528
1551
  flex-direction: column;
1529
1552
  justify-content: flex-start;
1530
1553
  gap: 4px;
1531
- `,hp=vc.default.div`
1554
+ `,Tp=Tc.default.div`
1532
1555
  &&& {
1533
1556
  margin-left: 7px; /* TODO: This is a total hack */
1534
1557
  border-left: 2px solid var(--privy-color-foreground-4);
1535
1558
  height: 12px;
1536
1559
  }
1537
- `,Cc=({children:e})=>(0,wc.jsxs)(h4,{children:[(0,wc.jsx)(v1,{style:{width:"16px",height:"16px"}}),e]}),h4=vc.default.div`
1560
+ `,Pc=({children:e})=>(0,_c.jsxs)(M4,{children:[(0,_c.jsx)(kg,{style:{width:"16px",height:"16px"}}),e]}),M4=Tc.default.div`
1538
1561
  display: flex;
1539
1562
  justify-content: flex-start;
1540
1563
  justify-items: center;
@@ -1552,15 +1575,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
1552
1575
  margin-bottom: auto;
1553
1576
  }
1554
1577
  }
1555
- `;var Je=require("react/jsx-runtime"),y4=()=>(0,Je.jsxs)(g4,{children:[(0,Je.jsx)(Va,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),(0,Je.jsx)(or,{children:(0,Je.jsx)(wo,{style:{width:"152px",height:"152px"}})}),(0,Je.jsxs)(C1,{children:[(0,Je.jsx)(Cc,{children:(0,Je.jsxs)("div",{children:[(0,Je.jsx)("span",{children:"Install the "}),(0,Je.jsx)("a",{href:w1.isFirefox?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",target:"_blank",children:"Phantom browser extension"})]})}),(0,Je.jsx)(hp,{}),(0,Je.jsx)(Cc,{children:"Set up your first wallet"}),(0,Je.jsx)(hp,{}),(0,Je.jsx)(Cc,{children:"Store your recovery phrase in a safe place!"})]}),(0,Je.jsx)(Wi,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),E1=()=>{let{navigateBack:e}=k();return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(S,{backFn:e},"header"),(0,Je.jsx)(ae,{}),(0,Je.jsx)(y4,{}),(0,Je.jsx)(me,{}),(0,Je.jsxs)(q,{children:[(0,Je.jsx)("span",{children:"Still not sure? "}),(0,Je.jsx)("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},g4=(0,b1.default)(or)`
1578
+ `;var Je=require("react/jsx-runtime"),W4=()=>(0,Je.jsxs)(L4,{children:[(0,Je.jsx)(Za,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),(0,Je.jsx)(nr,{children:(0,Je.jsx)(bo,{style:{width:"152px",height:"152px"}})}),(0,Je.jsxs)(Rg,{children:[(0,Je.jsx)(Pc,{children:(0,Je.jsxs)("div",{children:[(0,Je.jsx)("span",{children:"Install the "}),(0,Je.jsx)("a",{href:Ig.isFirefox?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",target:"_blank",children:"Phantom browser extension"})]})}),(0,Je.jsx)(Tp,{}),(0,Je.jsx)(Pc,{children:"Set up your first wallet"}),(0,Je.jsx)(Tp,{}),(0,Je.jsx)(Pc,{children:"Store your recovery phrase in a safe place!"})]}),(0,Je.jsx)(Di,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),Wg=()=>{let{navigateBack:e}=k();return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(A,{backFn:e},"header"),(0,Je.jsx)(ae,{}),(0,Je.jsx)(W4,{}),(0,Je.jsx)(pe,{}),(0,Je.jsxs)($,{children:[(0,Je.jsx)("span",{children:"Still not sure? "}),(0,Je.jsx)("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},L4=(0,Mg.default)(nr)`
1556
1579
  gap: 30px;
1557
1580
 
1558
1581
  > :first-child > svg {
1559
1582
  margin-top: 20px;
1560
1583
  }
1561
- `;var U1=h(require("@heroicons/react/24/outline/UserCircleIcon")),is=require("react"),F1=require("react-device-detect"),B1=h(require("styled-components"));var P1=h(require("@heroicons/react/24/outline/EnvelopeIcon")),S1=require("react");var T1=h(require("@heroicons/react/24/outline/EnvelopeIcon")),rs=require("react"),yp=h(require("styled-components"));var ho=require("react/jsx-runtime"),bc=(0,rs.forwardRef)((e,t)=>{let[r,o]=(0,rs.useState)(""),[n,i]=(0,rs.useState)(!1),{authenticated:a}=G(),{initLoginWithEmail:l}=W(),{navigate:s,setModalData:c,currentScreen:u}=k(),{enabled:y,token:f}=_e(),v=Bs(r),C=n,g=n||!v,_=b=>{i(!0),l(r,b).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(A=>{c({errorModalData:{error:A,previousScreen:u||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},x=()=>{y&&!f&&!a?(c({captchaModalData:{callback:b=>l(r,b),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):_(f)};return(0,ho.jsxs)(ho.Fragment,{children:[(0,ho.jsx)(v4,{children:(0,ho.jsxs)(C4,{stacked:e.stacked,children:[(0,ho.jsx)(T1.default,{}),(0,ho.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:b=>o(b.target.value),onKeyUp:b=>{b.key==="Enter"&&x()},value:r,autoComplete:"email"}),e.stacked?null:(0,ho.jsx)(Li,{isSubmitting:C,onClick:x,disabled:g,children:"Submit"})]})}),e.stacked?(0,ho.jsx)(D,{loadingText:null,loading:C,disabled:g,onClick:x,children:"Submit"}):null]})}),v4=yp.default.div`
1584
+ `;var Yg=y(require("@heroicons/react/24/outline/UserCircleIcon")),us=require("react"),Zg=require("react-device-detect"),Jg=y(require("styled-components"));var Og=y(require("@heroicons/react/24/outline/EnvelopeIcon")),Ng=require("react");var Lg=y(require("@heroicons/react/24/outline/EnvelopeIcon")),cs=require("react"),Pp=y(require("styled-components"));var go=require("react/jsx-runtime"),Sc=(0,cs.forwardRef)((e,t)=>{let[r,o]=(0,cs.useState)(""),[n,i]=(0,cs.useState)(!1),{authenticated:a}=H(),{initLoginWithEmail:s}=W(),{navigate:l,setModalData:c,currentScreen:u}=k(),{enabled:f,token:h}=Ae(),v=Ys(r),C=n,g=n||!v,P=E=>{i(!0),s(r,E).then(()=>{l("AWAITING_PASSWORDLESS_CODE")}).catch(x=>{c({errorModalData:{error:x,previousScreen:u||"LANDING"}}),l("ERROR_SCREEN")}).finally(()=>{i(!1)})},S=()=>{f&&!h&&!a?(c({captchaModalData:{callback:E=>s(r,E),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),l("CAPTCHA_SCREEN")):P(h)};return(0,go.jsxs)(go.Fragment,{children:[(0,go.jsx)(O4,{children:(0,go.jsxs)(N4,{stacked:e.stacked,children:[(0,go.jsx)(Lg.default,{}),(0,go.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:E=>o(E.target.value),onKeyUp:E=>{E.key==="Enter"&&S()},value:r,autoComplete:"email"}),e.stacked?null:(0,go.jsx)(Ui,{isSubmitting:C,onClick:S,disabled:g,children:"Submit"})]})}),e.stacked?(0,go.jsx)(U,{loadingText:null,loading:C,disabled:g,onClick:S,children:"Submit"}):null]})}),O4=Pp.default.div`
1562
1585
  width: 100%;
1563
- `,C4=yp.default.label`
1586
+ `,N4=Pp.default.label`
1564
1587
  display: block;
1565
1588
  position: relative;
1566
1589
  width: 100%;
@@ -1621,7 +1644,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1621
1644
  && > input::placeholder {
1622
1645
  color: var(--privy-color-foreground-3);
1623
1646
  }
1624
- `;var xo=require("react/jsx-runtime"),Ec=({isEditable:e,setIsEditable:t})=>{let r=(0,S1.useRef)(null);return(0,xo.jsxs)(xo.Fragment,{children:[(0,xo.jsx)(so,{if:!e,children:(0,xo.jsx)(bc,{ref:r})}),(0,xo.jsx)(so,{if:e,children:(0,xo.jsxs)(De,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,xo.jsx)(P1.default,{})," Continue with Email"]})})]})};var _1=require("react");var na=require("react/jsx-runtime"),Tc=()=>{let[e,t]=(0,_1.useState)(!1),{currentScreen:r,navigate:o,setModalData:n}=k(),{enabled:i,token:a}=_e(),{initLoginWithFarcaster:l}=W();return(0,na.jsxs)(De,{onClick:async()=>{t(!0);try{i&&!a?(n({captchaModalData:{callback:c=>l(c),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):(await l(a),o("AWAITING_FARCASTER_CONNECTION"))}catch(c){n({errorModalData:{error:c,previousScreen:r||"LANDING"}}),o("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[(0,na.jsx)(_o,{})," Farcaster",e&&(0,na.jsx)("span",{children:(0,na.jsx)(Go,{})})]})};var Pc=h(require("styled-components"));var x1=require("react/jsx-runtime"),Sc=()=>{let{enabled:e,token:t}=_e(),{navigate:r,setModalData:o}=k(),{initLoginWithPasskey:n}=W();return(0,x1.jsx)(b4,{onClick:async()=>{e&&!t?(o({captchaModalData:{callback:a=>n(a),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSKEY_SYSTEM_DIALOGUE",onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN")):(await n(),r("AWAITING_PASSKEY_SYSTEM_DIALOGUE"))},children:"I have a passkey"})},w4=Pc.css`
1647
+ `;var xo=require("react/jsx-runtime"),Ac=({isEditable:e,setIsEditable:t})=>{let r=(0,Ng.useRef)(null);return(0,xo.jsxs)(xo.Fragment,{children:[(0,xo.jsx)(co,{if:!e,children:(0,xo.jsx)(Sc,{ref:r})}),(0,xo.jsx)(co,{if:e,children:(0,xo.jsxs)(De,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,xo.jsx)(Og.default,{})," Continue with Email"]})})]})};var Dg=require("react");var ca=require("react/jsx-runtime"),xc=()=>{let[e,t]=(0,Dg.useState)(!1),{currentScreen:r,navigate:o,setModalData:n}=k(),{enabled:i,token:a}=Ae(),{initLoginWithFarcaster:s}=W();return(0,ca.jsxs)(De,{onClick:async()=>{t(!0);try{i&&!a?(n({captchaModalData:{callback:c=>s(c),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):(await s(a),o("AWAITING_FARCASTER_CONNECTION"))}catch(c){n({errorModalData:{error:c,previousScreen:r||"LANDING"}}),o("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[(0,ca.jsx)(Ao,{})," Farcaster",e&&(0,ca.jsx)("span",{children:(0,ca.jsx)(Po,{})})]})};var kc=y(require("styled-components"));var Ug=require("react/jsx-runtime"),Rc=()=>{let{enabled:e,token:t}=Ae(),{navigate:r,setModalData:o}=k(),{initLoginWithPasskey:n}=W();return(0,Ug.jsx)(U4,{onClick:async()=>{e&&!t?(o({captchaModalData:{callback:a=>n(a),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSKEY_SYSTEM_DIALOGUE",onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN")):(await n(),r("AWAITING_PASSKEY_SYSTEM_DIALOGUE"))},children:"I have a passkey"})},D4=kc.css`
1625
1648
  && {
1626
1649
  width: 100%;
1627
1650
  font-size: 0.875rem;
@@ -1646,11 +1669,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1646
1669
  box-shadow: none;
1647
1670
  }
1648
1671
  }
1649
- `,b4=Pc.default.button`
1650
- ${w4}
1651
- `;var W1=h(require("@heroicons/react/24/outline/PhoneIcon")),L1=require("react");var ia=require("react"),gp=h(require("styled-components"));var A1=h(require("libphonenumber-js/examples.mobile.json")),Ir=require("libphonenumber-js/min"),xc=require("react/jsx-runtime");var os=(e,t)=>(0,Ir.isPossiblePhoneNumber)(String(e),t),_c=(e,t)=>`+${(0,Ir.getCountryCallingCode)(t)} ${e}`,k1=e=>`*${e.replaceAll("-","").slice(-4)}`,R1=e=>new Ir.AsYouType(e),E4=(0,Ir.getCountries)().map(e=>({code:e,callCode:(0,Ir.getCountryCallingCode)(e)})),I1=e=>{let t=(0,Ir.getExampleNumber)(e,A1.default)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},M1=({value:e,onChange:t})=>(0,xc.jsx)("select",{value:e,onChange:t,children:E4.map(r=>(0,xc.jsxs)("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))});var yo=require("react/jsx-runtime"),aa=(0,ia.forwardRef)((e,t)=>{let{app:r}=k(),[o,n]=(0,ia.useState)(""),[i,a]=(0,ia.useState)(r?.intl.defaultCountry??"US"),l=os(o,i),s=R1(i),c=I1(i),u=(0,Ir.getCountryCallingCode)(i),y=!l,[f,v]=(0,ia.useState)(!1),C=u.length,g=b=>{let A=b.target.value;a(A),n(""),e.onChange&&e.onChange({rawPhoneNumber:o,qualifiedPhoneNumber:_c(o,A),countryCode:A,isValid:os(o,i)})},_=b=>{try{let A=b.replace(/\D/g,""),R=o.replace(/\D/g,""),U=A===R?b:s.input(b);n(U),e.onChange&&e.onChange({rawPhoneNumber:U,qualifiedPhoneNumber:_c(b,i),countryCode:i,isValid:os(b,i)})}catch(A){console.error("Error processing phone number:",A)}},x=()=>{v(!0);let b=_c(o,i);e.onSubmit({rawPhoneNumber:o,qualifiedPhoneNumber:b,countryCode:i,isValid:os(o,i)}).finally(()=>v(!1))};return(0,yo.jsxs)(yo.Fragment,{children:[(0,yo.jsx)(T4,{children:(0,yo.jsxs)(P4,{callingCodeLength:C,stacked:e.stacked,children:[(0,yo.jsx)(M1,{value:i,onChange:g}),(0,yo.jsx)("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:c,onChange:b=>{_(b.target.value)},onKeyUp:b=>{b.key==="Enter"&&x()},value:o,autoComplete:"tel"}),!e.stacked&&!e.noIncludeSubmitButton?(0,yo.jsx)(Li,{isSubmitting:f,onClick:x,disabled:y,children:"Submit"}):null]})}),e.stacked&&!e.noIncludeSubmitButton?(0,yo.jsx)(D,{loading:f,loadingText:null,onClick:x,disabled:y,children:"Submit"}):null]})}),T4=gp.default.div`
1672
+ `,U4=kc.default.button`
1673
+ ${D4}
1674
+ `;var zg=y(require("@heroicons/react/24/outline/PhoneIcon")),qg=require("react");var da=require("react"),_p=y(require("styled-components"));var Fg=y(require("libphonenumber-js/examples.mobile.json")),Mr=require("libphonenumber-js/min"),Mc=require("react/jsx-runtime");var ds=(e,t)=>(0,Mr.isPossiblePhoneNumber)(String(e),t),Ic=(e,t)=>`+${(0,Mr.getCountryCallingCode)(t)} ${e}`,Bg=e=>`*${e.replaceAll("-","").slice(-4)}`,Hg=e=>new Mr.AsYouType(e),F4=(0,Mr.getCountries)().map(e=>({code:e,callCode:(0,Mr.getCountryCallingCode)(e)})),Gg=e=>{let t=(0,Mr.getExampleNumber)(e,Fg.default)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},Vg=({value:e,onChange:t})=>(0,Mc.jsx)("select",{value:e,onChange:t,children:F4.map(r=>(0,Mc.jsxs)("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))});var vo=require("react/jsx-runtime"),pa=(0,da.forwardRef)((e,t)=>{let{app:r}=k(),[o,n]=(0,da.useState)(""),[i,a]=(0,da.useState)(r?.intl.defaultCountry??"US"),s=ds(o,i),l=Hg(i),c=Gg(i),u=(0,Mr.getCountryCallingCode)(i),f=!s,[h,v]=(0,da.useState)(!1),C=u.length,g=E=>{let x=E.target.value;a(x),n(""),e.onChange&&e.onChange({rawPhoneNumber:o,qualifiedPhoneNumber:Ic(o,x),countryCode:x,isValid:ds(o,i)})},P=E=>{try{let x=E.replace(/\D/g,""),R=o.replace(/\D/g,""),D=x===R?E:l.input(E);n(D),e.onChange&&e.onChange({rawPhoneNumber:D,qualifiedPhoneNumber:Ic(E,i),countryCode:i,isValid:ds(E,i)})}catch(x){console.error("Error processing phone number:",x)}},S=()=>{v(!0);let E=Ic(o,i);e.onSubmit({rawPhoneNumber:o,qualifiedPhoneNumber:E,countryCode:i,isValid:ds(o,i)}).finally(()=>v(!1))};return(0,vo.jsxs)(vo.Fragment,{children:[(0,vo.jsx)(B4,{children:(0,vo.jsxs)(H4,{callingCodeLength:C,stacked:e.stacked,children:[(0,vo.jsx)(Vg,{value:i,onChange:g}),(0,vo.jsx)("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:c,onChange:E=>{P(E.target.value)},onKeyUp:E=>{E.key==="Enter"&&S()},value:o,autoComplete:"tel"}),!e.stacked&&!e.noIncludeSubmitButton?(0,vo.jsx)(Ui,{isSubmitting:h,onClick:S,disabled:f,children:"Submit"}):null]})}),e.stacked&&!e.noIncludeSubmitButton?(0,vo.jsx)(U,{loading:h,loadingText:null,onClick:S,disabled:f,children:"Submit"}):null]})}),B4=_p.default.div`
1652
1675
  width: 100%;
1653
- `,P4=gp.default.label`
1676
+ `,H4=_p.default.label`
1654
1677
  --country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.callingCodeLength}px));
1655
1678
  --phone-input-extra-padding-left: calc(12px + calc(3 * ${e=>e.callingCodeLength}px));
1656
1679
  display: block;
@@ -1737,11 +1760,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1737
1760
  && > input::placeholder {
1738
1761
  color: var(--privy-color-foreground-3);
1739
1762
  }
1740
- `;var Ao=require("react/jsx-runtime"),Ac=({isEditable:e,setIsEditable:t})=>{let r=(0,L1.useRef)(null),{authenticated:o}=G(),{navigate:n,setModalData:i,currentScreen:a}=k(),{initLoginWithSms:l}=W(),{enabled:s,token:c}=_e();async function u({qualifiedPhoneNumber:y}){if(s&&!c&&!o)i({captchaModalData:{callback:f=>l(y,f),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(y,c),n("AWAITING_PASSWORDLESS_CODE")}catch(f){i({errorModalData:{error:f,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return(0,Ao.jsxs)(Ao.Fragment,{children:[(0,Ao.jsx)(so,{if:!e,children:(0,Ao.jsx)(aa,{ref:r,onSubmit:u})}),(0,Ao.jsx)(so,{if:e,children:(0,Ao.jsxs)(De,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,Ao.jsx)(W1.default,{})," Continue with SMS"]})})]})};var O1=require("react");var jr=require("react/jsx-runtime"),S4={apple:{logo:(0,jr.jsx)(el,{}),displayName:"Apple"},discord:{logo:(0,jr.jsx)(tl,{}),displayName:"Discord"},github:{logo:(0,jr.jsx)(rl,{}),displayName:"GitHub"},google:{logo:(0,jr.jsx)(ol,{}),displayName:"Google"},linkedin:{logo:(0,jr.jsx)(il,{}),displayName:"LinkedIn"},spotify:{logo:(0,jr.jsx)(al,{}),displayName:"Spotify"},instagram:{logo:(0,jr.jsx)(nl,{}),displayName:"Instagram"},twitter:{logo:(0,jr.jsx)(ll,{}),displayName:"Twitter"},tiktok:{logo:(0,jr.jsx)(sl,{}),displayName:"TikTok"}},Ot=({provider:e})=>{let{enabled:t,token:r}=_e(),{navigate:o,setModalData:n}=k(),[i,a]=(0,O1.useState)(!1),{initLoginWithOAuth:l}=W(),{displayName:s,logo:c}=S4[e];return(0,jr.jsxs)(De,{onClick:()=>{a(!0),t&&!r?(n({captchaModalData:{callback:y=>l(e,y),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):l(e)},disabled:i,children:[c," ",s]})};var N1=require("react");var Yr=require("react/jsx-runtime");function kc(e){return(0,Yr.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...e,children:[(0,Yr.jsx)("defs",{children:(0,Yr.jsxs)("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[(0,Yr.jsx)("stop",{offset:"0",stopColor:"#1d93d2"}),(0,Yr.jsx)("stop",{offset:"1",stopColor:"#38b0e3"})]})}),(0,Yr.jsx)("title",{children:"Telegram_logo"}),(0,Yr.jsx)("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),(0,Yr.jsx)("path",{d:"M81.229,128.772l14.237,39.406s1.78,3.687,3.686,3.687,30.255-29.492,30.255-29.492l31.525-60.89L81.737,118.6Z",fill:"#c8daea"}),(0,Yr.jsx)("path",{d:"M100.106,138.878l-2.733,29.046s-1.144,8.9,7.754,0,17.415-15.763,17.415-15.763",fill:"#a9c6d8"}),(0,Yr.jsx)("path",{d:"M81.486,130.178,52.2,120.636s-3.5-1.42-2.373-4.64c.232-.664.7-1.229,2.1-2.2,6.489-4.523,120.106-45.36,120.106-45.36s3.208-1.081,5.1-.362a2.766,2.766,0,0,1,1.885,2.055,9.357,9.357,0,0,1,.254,2.585c-.009.752-.1,1.449-.169,2.542-.692,11.165-21.4,94.493-21.4,94.493s-1.239,4.876-5.678,5.043A8.13,8.13,0,0,1,146.1,172.5c-8.711-7.493-38.819-27.727-45.472-32.177a1.27,1.27,0,0,1-.546-.9c-.093-.469.417-1.05.417-1.05s52.426-46.6,53.821-51.492c.108-.379-.3-.566-.848-.4-3.482,1.281-63.844,39.4-70.506,43.607A3.21,3.21,0,0,1,81.486,130.178Z",fill:"#fff"})]})}var Ic=require("react/jsx-runtime"),Rc=()=>{let{enabled:e,token:t}=_e(),{navigate:r,setModalData:o}=k(),[n,i]=(0,N1.useState)(!1),{initLoginWithTelegram:a}=W();async function l(c){try{await a(c),r("TELEGRAM_AUTH_SCREEN")}catch(u){console.error(u),i(!1)}}async function s(){if(i(!0),e&&!t){o({captchaModalData:{callback:l,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN");return}await l()}return(0,Ic.jsxs)(De,{onClick:s,disabled:n,children:[(0,Ic.jsx)(kc,{})," Telegram"]})};var D1=h(require("@heroicons/react/24/outline/ChevronRightIcon"));var ns=require("react/jsx-runtime"),Mc=({onClick:e,text:t,icon:r})=>(0,ns.jsxs)(De,{onClick:e,children:[r,(0,ns.jsx)(zl,{children:t}),(0,ns.jsx)(D1.default,{})]});var ke=require("react/jsx-runtime"),Lc=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=W(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=k(),{appearance:{palette:{colorScheme:i}}}=Kt(),a=o.loginMethodsAndOrder?.primary??[],l=o.loginMethodsAndOrder?.overflow??[],s=[...a,...l],c=o.loginMethods.passkey,[u,y]=(0,is.useState)("default"),[f,v]=(0,is.useState)("email");(0,is.useEffect)(()=>{let I=s.indexOf("sms"),V=s.indexOf("email");I>-1&&I<V&&v("sms")},[a,l]);let C=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{y("default")},150)};n.current=C;let g=I=>I==="email"?(0,ke.jsx)(Ec,{isEditable:f==="email",setIsEditable:()=>{v("email")}},I):I==="sms"?(0,ke.jsx)(Ac,{isEditable:f==="sms",setIsEditable:()=>{v("sms")}},I):I==="apple"?(0,ke.jsx)(Ot,{provider:"apple"},I):I==="discord"?(0,ke.jsx)(Ot,{provider:"discord"},I):I==="farcaster"?(0,ke.jsx)(Tc,{},I):I==="github"?(0,ke.jsx)(Ot,{provider:"github"},I):I==="google"?(0,ke.jsx)(Ot,{provider:"google"},I):I==="linkedin"?(0,ke.jsx)(Ot,{provider:"linkedin"},I):I==="tiktok"?(0,ke.jsx)(Ot,{provider:"tiktok"},I):I==="twitter"&&(!F1.isMobile||o?.loginConfig.twitterOAuthOnMobileEnabled)?(0,ke.jsx)(Ot,{provider:"twitter"},I):I==="telegram"?(0,ke.jsx)(Rc,{},I):za([I],r,e,s),_=a.map(g).flat(),x=l.map(g).flat(),b=[..._,...x],A=_4({primary:_.length,overflow:x.length}),[R,U]=Zu(b,A),M=u==="default"?void 0:()=>{y("default")};return(0,ke.jsxs)(ke.Fragment,{children:[(0,ke.jsx)(S,{title:o.appearance.landingHeader,onClose:C,backFn:M}),u==="default"&&(0,ke.jsx)(x4,{}),u==="default"&&(typeof o.appearance.loginMessage=="string"?(0,ke.jsx)($l,{children:o.appearance.loginMessage}):o.appearance.loginMessage),(0,ke.jsx)(ql,{style:{overflow:"hidden"},children:(0,ke.jsxs)(Lf,{colorScheme:i,style:{maxHeight:400,overflowY:"scroll",padding:2},children:[u==="default"&&(0,ke.jsxs)(ke.Fragment,{children:[...R,U.length>0&&(0,ke.jsx)(Mc,{text:"More options",icon:(0,ke.jsx)(U1.default,{}),onClick:()=>y("overflow")})]}),u==="overflow"&&(0,ke.jsxs)(ke.Fragment,{children:[...U]}),c&&u==="default"&&(0,ke.jsx)(Sc,{})]})}),o&&(0,ke.jsx)(Oi,{app:o}),(0,ke.jsx)(K,{protectedByPrivy:!0})]})},Wc=5,_4=({primary:e,overflow:t})=>e<Wc?e:e===Wc&&t===0?Wc:Wc-1,x4=(0,B1.default)(Fi)`
1763
+ `;var ko=require("react/jsx-runtime"),Wc=({isEditable:e,setIsEditable:t})=>{let r=(0,qg.useRef)(null),{authenticated:o}=H(),{navigate:n,setModalData:i,currentScreen:a}=k(),{initLoginWithSms:s}=W(),{enabled:l,token:c}=Ae();async function u({qualifiedPhoneNumber:f}){if(l&&!c&&!o)i({captchaModalData:{callback:h=>s(f,h),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await s(f,c),n("AWAITING_PASSWORDLESS_CODE")}catch(h){i({errorModalData:{error:h,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return(0,ko.jsxs)(ko.Fragment,{children:[(0,ko.jsx)(co,{if:!e,children:(0,ko.jsx)(pa,{ref:r,onSubmit:u})}),(0,ko.jsx)(co,{if:e,children:(0,ko.jsxs)(De,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,ko.jsx)(zg.default,{})," Continue with SMS"]})})]})};var $g=require("react");var jr=require("react/jsx-runtime"),G4={apple:{logo:(0,jr.jsx)(al,{}),displayName:"Apple"},discord:{logo:(0,jr.jsx)(sl,{}),displayName:"Discord"},github:{logo:(0,jr.jsx)(ll,{}),displayName:"GitHub"},google:{logo:(0,jr.jsx)(cl,{}),displayName:"Google"},linkedin:{logo:(0,jr.jsx)(pl,{}),displayName:"LinkedIn"},spotify:{logo:(0,jr.jsx)(ul,{}),displayName:"Spotify"},instagram:{logo:(0,jr.jsx)(dl,{}),displayName:"Instagram"},twitter:{logo:(0,jr.jsx)(fl,{}),displayName:"Twitter"},tiktok:{logo:(0,jr.jsx)(ml,{}),displayName:"TikTok"}},Nt=({provider:e})=>{let{enabled:t,token:r}=Ae(),{navigate:o,setModalData:n}=k(),[i,a]=(0,$g.useState)(!1),{initLoginWithOAuth:s}=W(),{displayName:l,logo:c}=G4[e];return(0,jr.jsxs)(De,{onClick:()=>{a(!0),t&&!r?(n({captchaModalData:{callback:f=>s(e,f),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):s(e)},disabled:i,children:[c," ",l]})};var Kg=require("react");var Yr=require("react/jsx-runtime");function Lc(e){return(0,Yr.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...e,children:[(0,Yr.jsx)("defs",{children:(0,Yr.jsxs)("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[(0,Yr.jsx)("stop",{offset:"0",stopColor:"#1d93d2"}),(0,Yr.jsx)("stop",{offset:"1",stopColor:"#38b0e3"})]})}),(0,Yr.jsx)("title",{children:"Telegram_logo"}),(0,Yr.jsx)("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),(0,Yr.jsx)("path",{d:"M81.229,128.772l14.237,39.406s1.78,3.687,3.686,3.687,30.255-29.492,30.255-29.492l31.525-60.89L81.737,118.6Z",fill:"#c8daea"}),(0,Yr.jsx)("path",{d:"M100.106,138.878l-2.733,29.046s-1.144,8.9,7.754,0,17.415-15.763,17.415-15.763",fill:"#a9c6d8"}),(0,Yr.jsx)("path",{d:"M81.486,130.178,52.2,120.636s-3.5-1.42-2.373-4.64c.232-.664.7-1.229,2.1-2.2,6.489-4.523,120.106-45.36,120.106-45.36s3.208-1.081,5.1-.362a2.766,2.766,0,0,1,1.885,2.055,9.357,9.357,0,0,1,.254,2.585c-.009.752-.1,1.449-.169,2.542-.692,11.165-21.4,94.493-21.4,94.493s-1.239,4.876-5.678,5.043A8.13,8.13,0,0,1,146.1,172.5c-8.711-7.493-38.819-27.727-45.472-32.177a1.27,1.27,0,0,1-.546-.9c-.093-.469.417-1.05.417-1.05s52.426-46.6,53.821-51.492c.108-.379-.3-.566-.848-.4-3.482,1.281-63.844,39.4-70.506,43.607A3.21,3.21,0,0,1,81.486,130.178Z",fill:"#fff"})]})}var Nc=require("react/jsx-runtime"),Oc=()=>{let{enabled:e,token:t}=Ae(),{navigate:r,setModalData:o}=k(),[n,i]=(0,Kg.useState)(!1),{initLoginWithTelegram:a}=W();async function s(c){try{await a(c),r("TELEGRAM_AUTH_SCREEN")}catch(u){console.error(u),i(!1)}}async function l(){if(i(!0),e&&!t){o({captchaModalData:{callback:s,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN");return}await s()}return(0,Nc.jsxs)(De,{onClick:l,disabled:n,children:[(0,Nc.jsx)(Lc,{})," Telegram"]})};var jg=y(require("@heroicons/react/24/outline/ChevronRightIcon"));var ps=require("react/jsx-runtime"),Dc=({onClick:e,text:t,icon:r})=>(0,ps.jsxs)(De,{onClick:e,children:[r,(0,ps.jsx)(Yl,{children:t}),(0,ps.jsx)(jg.default,{})]});var Re=require("react/jsx-runtime"),Fc=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=W(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=k(),{appearance:{palette:{colorScheme:i}}}=It(),a=o.loginMethodsAndOrder?.primary??[],s=o.loginMethodsAndOrder?.overflow??[],l=[...a,...s],c=o.loginMethods.passkey,[u,f]=(0,us.useState)("default"),[h,v]=(0,us.useState)("email");(0,us.useEffect)(()=>{let M=l.indexOf("sms"),V=l.indexOf("email");M>-1&&M<V&&v("sms")},[a,s]);let C=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{f("default")},150)};n.current=C;let g=M=>M==="email"?(0,Re.jsx)(Ac,{isEditable:h==="email",setIsEditable:()=>{v("email")}},M):M==="sms"?(0,Re.jsx)(Wc,{isEditable:h==="sms",setIsEditable:()=>{v("sms")}},M):M==="apple"?(0,Re.jsx)(Nt,{provider:"apple"},M):M==="discord"?(0,Re.jsx)(Nt,{provider:"discord"},M):M==="farcaster"?(0,Re.jsx)(xc,{},M):M==="github"?(0,Re.jsx)(Nt,{provider:"github"},M):M==="google"?(0,Re.jsx)(Nt,{provider:"google"},M):M==="linkedin"?(0,Re.jsx)(Nt,{provider:"linkedin"},M):M==="tiktok"?(0,Re.jsx)(Nt,{provider:"tiktok"},M):M==="twitter"&&(!Zg.isMobile||o?.loginConfig.twitterOAuthOnMobileEnabled)?(0,Re.jsx)(Nt,{provider:"twitter"},M):M==="telegram"?(0,Re.jsx)(Oc,{},M):Ja([M],r,e,l),P=a.map(g).flat(),S=s.map(g).flat(),E=[...P,...S],x=V4({primary:P.length,overflow:S.length}),[R,D]=om(E,x),I=u==="default"?void 0:()=>{f("default")};return(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(A,{title:o.appearance.landingHeader,onClose:C,backFn:I}),u==="default"&&(0,Re.jsx)(z4,{}),u==="default"&&(typeof o.appearance.loginMessage=="string"?(0,Re.jsx)(Jl,{children:o.appearance.loginMessage}):o.appearance.loginMessage),(0,Re.jsx)(Zl,{style:{overflow:"hidden"},children:(0,Re.jsxs)(Gf,{colorScheme:i,style:{maxHeight:400,overflowY:"scroll",padding:2},children:[u==="default"&&(0,Re.jsxs)(Re.Fragment,{children:[...R,D.length>0&&(0,Re.jsx)(Dc,{text:"More options",icon:(0,Re.jsx)(Yg.default,{}),onClick:()=>f("overflow")})]}),u==="overflow"&&(0,Re.jsxs)(Re.Fragment,{children:[...D]}),c&&u==="default"&&(0,Re.jsx)(Rc,{})]})}),o&&(0,Re.jsx)(Fi,{app:o}),(0,Re.jsx)(j,{protectedByPrivy:!0})]})},Uc=5,V4=({primary:e,overflow:t})=>e<Uc?e:e===Uc&&t===0?Uc:Uc-1,z4=(0,Jg.default)(Vi)`
1741
1764
  margin-bottom: 16px;
1742
- `;var q1=h(require("@heroicons/react/24/outline/EnvelopeIcon")),$1=h(require("@heroicons/react/24/outline/PhoneIcon")),K1=h(require("@heroicons/react/24/outline/UserCircleIcon")),as=require("react"),j1=require("react-device-detect"),Y1=h(require("styled-components"));var Yo=require("react/jsx-runtime"),H1=({...e})=>(0,Yo.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[(0,Yo.jsxs)("g",{clipPath:"url(#clip0_2856_1743)",children:[(0,Yo.jsx)("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,Yo.jsx)("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,Yo.jsx)("defs",{children:(0,Yo.jsx)("clipPath",{id:"clip0_2856_1743",children:(0,Yo.jsx)("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});var G1=h(require("@heroicons/react/24/outline/ChevronRightIcon")),V1=h(require("@heroicons/react/24/outline/WalletIcon"));var sa=require("react/jsx-runtime"),z1=({onClick:e,text:t})=>(0,sa.jsxs)(De,{onClick:e,children:[(0,sa.jsx)(V1.default,{}),(0,sa.jsx)(zl,{children:t}),(0,sa.jsx)(G1.default,{})]});var de=require("react/jsx-runtime"),Oc=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=W(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=k(),{email:i,sms:a,google:l,twitter:s,discord:c,github:u,spotify:y,instagram:f,tiktok:v,linkedin:C,apple:g,wallet:_,farcaster:x,passkey:b,telegram:A}=o?.loginMethods??{},R=o?.appearance.loginGroupPriority||"web2-first",U=o?.appearance.hideDirectWeb2Inputs,[M,I]=(0,as.useState)("default"),[V,j]=(0,as.useState)(i?"email":"sms");(0,as.useEffect)(()=>{j(i?"email":"sms")},[i]);let te=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{I("default")},150)};n.current=te;let L=[i&&(0,de.jsx)(Ec,{isEditable:V==="email",setIsEditable:()=>{j("email")}}),a&&(0,de.jsx)(Ac,{isEditable:V==="sms",setIsEditable:()=>{j("sms")}})].filter(Boolean),z=[l&&(0,de.jsx)(Ot,{provider:"google"}),s&&(!j1.isMobile||o?.loginConfig.twitterOAuthOnMobileEnabled)&&(0,de.jsx)(Ot,{provider:"twitter"}),c&&(0,de.jsx)(Ot,{provider:"discord"}),u&&(0,de.jsx)(Ot,{provider:"github"}),y&&(0,de.jsx)(Ot,{provider:"spotify"}),f&&(0,de.jsx)(Ot,{provider:"instagram"}),v&&(0,de.jsx)(Ot,{provider:"tiktok"}),C&&(0,de.jsx)(Ot,{provider:"linkedin"}),g&&(0,de.jsx)(Ot,{provider:"apple"}),x&&(0,de.jsx)(Tc,{}),A&&(0,de.jsx)(Rc,{})].filter(Boolean),O=za(o.appearance.walletList,r,e,o.appearance.walletList),ye=M==="default"?void 0:()=>{I("default")},we=k4({priority:R,email:i,sms:a,social:z}),be=R4({priority:R,email:i,sms:a,social:z}),Ne=I4({priority:R,email:i,sms:a,social:z}),le=(0,de.jsx)(z1,{text:Ne,onClick:()=>I("web3-overflow")}),er=(0,de.jsx)(Mc,{text:we,icon:be,onClick:()=>I("web2-overflow")}),Et=U?0:1;return(0,de.jsxs)(de.Fragment,{children:[(0,de.jsx)(S,{title:o.appearance.landingHeader,onClose:te,backFn:ye}),M==="default"&&(0,de.jsx)(A4,{}),M==="default"&&(typeof o.appearance.loginMessage=="string"?(0,de.jsx)($l,{children:o.appearance.loginMessage}):o.appearance.loginMessage),(0,de.jsx)(ql,{style:{overflow:"hidden",padding:2},children:(0,de.jsxs)(ao,{children:[M==="default"&&R==="web2-first"&&(0,de.jsxs)(de.Fragment,{children:[...L,...z.length+L.length>4?z.slice(0,3-L.length):z,L.length+z.length>4&&er,_&&le]}),M==="default"&&R==="web3-first"&&(0,de.jsxs)(de.Fragment,{children:[_&&(0,de.jsxs)(de.Fragment,{children:[...O.length>4?O.slice(0,3):O,O.length>4&&le]}),L.length+z.length>Et&&er,L.length+z.length===Et&&L.length?L[0]:null,L.length+z.length===Et&&z.length?z[0]:null]}),M==="web2-overflow"&&(0,de.jsxs)(de.Fragment,{children:[...R==="web3-first"?L:[],...z]}),...M==="web3-overflow"?O:[],b&&M==="default"&&(0,de.jsx)(Sc,{})]})}),o&&(0,de.jsx)(Oi,{app:o}),(0,de.jsx)(K,{protectedByPrivy:!0})]})},A4=(0,Y1.default)(Fi)`
1765
+ `;var r1=y(require("@heroicons/react/24/outline/EnvelopeIcon")),o1=y(require("@heroicons/react/24/outline/PhoneIcon")),n1=y(require("@heroicons/react/24/outline/UserCircleIcon")),ms=require("react"),i1=require("react-device-detect"),a1=y(require("styled-components"));var Zo=require("react/jsx-runtime"),Qg=({...e})=>(0,Zo.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[(0,Zo.jsxs)("g",{clipPath:"url(#clip0_2856_1743)",children:[(0,Zo.jsx)("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,Zo.jsx)("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,Zo.jsx)("defs",{children:(0,Zo.jsx)("clipPath",{id:"clip0_2856_1743",children:(0,Zo.jsx)("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});var Xg=y(require("@heroicons/react/24/outline/ChevronRightIcon")),e1=y(require("@heroicons/react/24/outline/WalletIcon"));var ua=require("react/jsx-runtime"),t1=({onClick:e,text:t})=>(0,ua.jsxs)(De,{onClick:e,children:[(0,ua.jsx)(e1.default,{}),(0,ua.jsx)(Yl,{children:t}),(0,ua.jsx)(Xg.default,{})]});var ue=require("react/jsx-runtime"),Bc=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=W(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=k(),{email:i,sms:a,google:s,twitter:l,discord:c,github:u,spotify:f,instagram:h,tiktok:v,linkedin:C,apple:g,wallet:P,farcaster:S,passkey:E,telegram:x}=o?.loginMethods??{},R=o?.appearance.loginGroupPriority||"web2-first",D=o?.appearance.hideDirectWeb2Inputs,[I,M]=(0,ms.useState)("default"),[V,z]=(0,ms.useState)(i?"email":"sms");(0,ms.useEffect)(()=>{z(i?"email":"sms")},[i]);let re=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{M("default")},150)};n.current=re;let L=[i&&(0,ue.jsx)(Ac,{isEditable:V==="email",setIsEditable:()=>{z("email")}}),a&&(0,ue.jsx)(Wc,{isEditable:V==="sms",setIsEditable:()=>{z("sms")}})].filter(Boolean),K=[s&&(0,ue.jsx)(Nt,{provider:"google"}),l&&(!i1.isMobile||o?.loginConfig.twitterOAuthOnMobileEnabled)&&(0,ue.jsx)(Nt,{provider:"twitter"}),c&&(0,ue.jsx)(Nt,{provider:"discord"}),u&&(0,ue.jsx)(Nt,{provider:"github"}),f&&(0,ue.jsx)(Nt,{provider:"spotify"}),h&&(0,ue.jsx)(Nt,{provider:"instagram"}),v&&(0,ue.jsx)(Nt,{provider:"tiktok"}),C&&(0,ue.jsx)(Nt,{provider:"linkedin"}),g&&(0,ue.jsx)(Nt,{provider:"apple"}),S&&(0,ue.jsx)(xc,{}),x&&(0,ue.jsx)(Oc,{})].filter(Boolean),O=Ja(o.appearance.walletList,r,e,o.appearance.walletList),ge=I==="default"?void 0:()=>{M("default")},be=$4({priority:R,email:i,sms:a,social:K}),Ee=K4({priority:R,email:i,sms:a,social:K}),Ne=j4({priority:R,email:i,sms:a,social:K}),le=(0,ue.jsx)(t1,{text:Ne,onClick:()=>M("web3-overflow")}),tr=(0,ue.jsx)(Dc,{text:be,icon:Ee,onClick:()=>M("web2-overflow")}),_t=D?0:1;return(0,ue.jsxs)(ue.Fragment,{children:[(0,ue.jsx)(A,{title:o.appearance.landingHeader,onClose:re,backFn:ge}),I==="default"&&(0,ue.jsx)(q4,{}),I==="default"&&(typeof o.appearance.loginMessage=="string"?(0,ue.jsx)(Jl,{children:o.appearance.loginMessage}):o.appearance.loginMessage),(0,ue.jsx)(Zl,{style:{overflow:"hidden",padding:2},children:(0,ue.jsxs)(lo,{children:[I==="default"&&R==="web2-first"&&(0,ue.jsxs)(ue.Fragment,{children:[...L,...K.length+L.length>4?K.slice(0,3-L.length):K,L.length+K.length>4&&tr,P&&le]}),I==="default"&&R==="web3-first"&&(0,ue.jsxs)(ue.Fragment,{children:[P&&(0,ue.jsxs)(ue.Fragment,{children:[...O.length>4?O.slice(0,3):O,O.length>4&&le]}),L.length+K.length>_t&&tr,L.length+K.length===_t&&L.length?L[0]:null,L.length+K.length===_t&&K.length?K[0]:null]}),I==="web2-overflow"&&(0,ue.jsxs)(ue.Fragment,{children:[...R==="web3-first"?L:[],...K]}),...I==="web3-overflow"?O:[],E&&I==="default"&&(0,ue.jsx)(Rc,{})]})}),o&&(0,ue.jsx)(Fi,{app:o}),(0,ue.jsx)(j,{protectedByPrivy:!0})]})},q4=(0,a1.default)(Vi)`
1743
1766
  margin-bottom: 16px;
1744
- `,k4=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"?"Other socials":t&&r&&o.length>0||t&&o.length>0?"Log in with email or socials":r&&o.length>0?"Log in with sms or socials":t&&r?"Continue with email or sms":t?"Continue with email":r?"Continue with sms":"Log in with a social account",R4=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?(0,de.jsx)(K1.default,{}):t&&r?(0,de.jsx)(H1,{}):t?(0,de.jsx)(q1.default,{}):r?(0,de.jsx)($1.default,{}):null,I4=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets";var vp=require("react/jsx-runtime"),Z1=()=>{let{app:e}=k();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,vp.jsx)(Lc,{connectOnly:!0}):(0,vp.jsx)(Oc,{connectOnly:!0})};var Cp=require("react/jsx-runtime"),J1=()=>{let{app:e}=k();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Cp.jsx)(Lc,{connectOnly:!1}):(0,Cp.jsx)(Oc,{connectOnly:!1})};var Q1=h(require("@heroicons/react/24/outline/EnvelopeIcon"));var Mr=require("react/jsx-runtime"),X1=()=>{let{app:e}=k();return(0,Mr.jsxs)(Mr.Fragment,{children:[(0,Mr.jsx)(S,{},"header"),(0,Mr.jsx)(ae,{}),(0,Mr.jsx)(Ve,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:(0,Mr.jsx)(Q1.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,Mr.jsx)(Vr,{children:(0,Mr.jsx)(bc,{stacked:!0})}),(0,Mr.jsx)(me,{}),(0,Mr.jsx)(K,{protectedByPrivy:!0})]})};var rg=h(require("@heroicons/react/24/outline/ClockIcon")),og=h(require("@heroicons/react/24/outline/TrashIcon")),ng=h(require("@heroicons/react/24/solid/CheckBadgeIcon")),ig=h(require("@heroicons/react/24/solid/CheckCircleIcon")),ag=h(require("@heroicons/react/24/solid/LockClosedIcon")),Pn=require("react"),Jt=h(require("styled-components"));var wp=require("react/jsx-runtime"),Qn=({style:e,...t})=>(0,wp.jsx)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,wp.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})});var We=require("react/jsx-runtime"),Xn=({style:e,...t})=>(0,We.jsxs)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,We.jsxs)("g",{clipPath:"url(#clip0_113_33841)",children:[(0,We.jsx)("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),(0,We.jsx)("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),(0,We.jsx)("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),(0,We.jsx)("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),(0,We.jsx)("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),(0,We.jsx)("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),(0,We.jsx)("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),(0,We.jsx)("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),(0,We.jsx)("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),(0,We.jsx)("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),(0,We.jsx)("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),(0,We.jsx)("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),(0,We.jsx)("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),(0,We.jsx)("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),(0,We.jsx)("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),(0,We.jsx)("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),(0,We.jsx)("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),(0,We.jsx)("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.4301C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),(0,We.jsx)("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),(0,We.jsx)("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),(0,We.jsx)("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),(0,We.jsx)("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),(0,We.jsx)("defs",{children:(0,We.jsx)("clipPath",{id:"clip0_113_33841",children:(0,We.jsx)("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});var Y=require("react/jsx-runtime"),eg=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,i]=(0,Pn.useState)([]),a=t?e.length:2,l=c=>c.authenticatorName?c.createdWithBrowser?`${c.authenticatorName} on ${c.createdWithBrowser}`:c.authenticatorName:c.createdWithBrowser?c.createdWithOs?`${c.createdWithBrowser} on ${c.createdWithOs}`:`${c.createdWithBrowser}`:"Unknown device",s=async c=>{i(u=>u.concat([c])),await r(c),i(u=>u.filter(y=>y!==c))};return(0,Y.jsxs)("div",{children:[(0,Y.jsx)(U4,{children:"Your passkeys"}),(0,Y.jsxs)(lg,{children:[e.slice(0,a).map(c=>(0,Y.jsxs)(H4,{children:[(0,Y.jsxs)("div",{children:[(0,Y.jsx)(F4,{children:l(c)}),(0,Y.jsxs)(B4,{children:["Last used: ",(c.latestVerifiedAt??c.verifiedAt).toLocaleString()]})]}),(0,Y.jsx)(V4,{disabled:n.includes(c.credentialId),onClick:()=>s(c.credentialId),children:n.includes(c.credentialId)?(0,Y.jsx)(Go,{}):(0,Y.jsx)(og.default,{height:"1.6em"})})]},c.credentialId)),e.length>2&&!t&&(0,Y.jsx)(O4,{onClick:o,children:"View all"})]})]})},M4=()=>(0,Y.jsxs)(lg,{children:[(0,Y.jsxs)(fr,{children:[(0,Y.jsx)(mr,{children:(0,Y.jsx)(ng.default,{})}),"Log in with Touch ID, Face ID, or a security key."]}),(0,Y.jsxs)(fr,{children:[(0,Y.jsx)(mr,{children:(0,Y.jsx)(ag.default,{})}),"More secure than a password."]}),(0,Y.jsxs)(fr,{children:[(0,Y.jsx)(mr,{children:(0,Y.jsx)(rg.default,{})}),"Takes seconds to set up and use."]})]}),sg=()=>{let{user:e,unlinkPasskey:t}=G(),{linkWithPasskey:r,closePrivyModal:o}=W(),n=e?.linkedAccounts.filter(g=>g.type==="passkey"),[i,a]=(0,Pn.useState)(!1),[l,s]=(0,Pn.useState)(""),[c,u]=(0,Pn.useState)(!1),[y,f]=(0,Pn.useState)(!1);(0,Pn.useEffect)(()=>{n.length===0&&f(!1)},[n.length]);let v=()=>{a(!0),r().then(()=>u(!0)).catch(g=>{if(g instanceof ut){if(g.privyErrorCode==="cannot_link_more_of_type"){s("Cannot link more passkeys to account.");return}else if(g.privyErrorCode==="passkey_not_allowed"){s("Passkey request timed out or rejected by user.");return}}s("Unknown error occurred.")}).finally(()=>{a(!1)})},C=async g=>(a(!0),await t(g).then(()=>u(!0)).catch(_=>{if(_ instanceof ut&&_.privyErrorCode==="missing_or_invalid_mfa"){s("Cannot unlink a passkey enrolled in MFA");return}s("Unknown error occurred.")}).finally(()=>{a(!1)}));return c?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(S,{onClose:()=>o()},"header"),(0,Y.jsx)(Ge,{children:(0,Y.jsx)(at,{status:"success",children:(0,Y.jsx)(ig.default,{})})}),(0,Y.jsx)(tg,{children:"Passkey added"}),(0,Y.jsx)(N4,{children:"From now on, you can use your passkey to log in."}),(0,Y.jsx)(jt,{children:(0,Y.jsx)(D,{onClick:()=>o(),children:"Done"})}),(0,Y.jsx)(q,{})]}):y?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(S,{backFn:()=>f(!1),onClose:()=>o()},"header"),(0,Y.jsx)(eg,{passkeys:n,expanded:y,onUnlink:C,onExpand:()=>f(!0)}),(0,Y.jsx)(q,{})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(S,{onClose:()=>o()},"header"),(0,Y.jsx)(Ge,{children:(0,Y.jsxs)(Nc,{children:[(0,Y.jsx)(Qn,{}),(0,Y.jsx)(Xn,{})]})}),(0,Y.jsx)(tg,{children:"Secure your account with a passkey"}),(0,Y.jsx)(D4,{}),n.length===0?(0,Y.jsx)(M4,{}):(0,Y.jsx)(eg,{passkeys:n,expanded:y,onUnlink:C,onExpand:()=>f(!0)}),(0,Y.jsxs)(jt,{style:{marginTop:"12px"},children:[l&&(0,Y.jsx)(W4,{fail:!0,children:l}),(0,Y.jsx)(D,{onClick:v,loading:i,children:"Add new passkey"})]}),(0,Y.jsx)(q,{})]})},Nc=Jt.default.div`
1767
+ `,$4=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"?"Other socials":t&&r&&o.length>0||t&&o.length>0?"Log in with email or socials":r&&o.length>0?"Log in with sms or socials":t&&r?"Continue with email or sms":t?"Continue with email":r?"Continue with sms":"Log in with a social account",K4=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?(0,ue.jsx)(n1.default,{}):t&&r?(0,ue.jsx)(Qg,{}):t?(0,ue.jsx)(r1.default,{}):r?(0,ue.jsx)(o1.default,{}):null,j4=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets";var Sp=require("react/jsx-runtime"),s1=()=>{let{app:e}=k();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Sp.jsx)(Fc,{connectOnly:!0}):(0,Sp.jsx)(Bc,{connectOnly:!0})};var Ap=require("react/jsx-runtime"),l1=()=>{let{app:e}=k();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Ap.jsx)(Fc,{connectOnly:!1}):(0,Ap.jsx)(Bc,{connectOnly:!1})};var c1=y(require("@heroicons/react/24/outline/EnvelopeIcon"));var Wr=require("react/jsx-runtime"),d1=()=>{let{app:e}=k();return(0,Wr.jsxs)(Wr.Fragment,{children:[(0,Wr.jsx)(A,{},"header"),(0,Wr.jsx)(ae,{}),(0,Wr.jsx)(Ve,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:(0,Wr.jsx)(c1.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,Wr.jsx)(Vr,{children:(0,Wr.jsx)(Sc,{stacked:!0})}),(0,Wr.jsx)(pe,{}),(0,Wr.jsx)(j,{protectedByPrivy:!0})]})};var m1=y(require("@heroicons/react/24/outline/ClockIcon")),f1=y(require("@heroicons/react/24/outline/TrashIcon")),h1=y(require("@heroicons/react/24/solid/CheckBadgeIcon")),y1=y(require("@heroicons/react/24/solid/CheckCircleIcon")),g1=y(require("@heroicons/react/24/solid/LockClosedIcon")),_n=require("react"),Qt=y(require("styled-components"));var xp=require("react/jsx-runtime"),ei=({style:e,...t})=>(0,xp.jsx)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,xp.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})});var We=require("react/jsx-runtime"),ti=({style:e,...t})=>(0,We.jsxs)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,We.jsxs)("g",{clipPath:"url(#clip0_113_33841)",children:[(0,We.jsx)("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),(0,We.jsx)("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),(0,We.jsx)("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),(0,We.jsx)("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),(0,We.jsx)("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),(0,We.jsx)("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),(0,We.jsx)("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),(0,We.jsx)("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),(0,We.jsx)("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),(0,We.jsx)("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),(0,We.jsx)("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),(0,We.jsx)("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),(0,We.jsx)("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),(0,We.jsx)("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),(0,We.jsx)("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),(0,We.jsx)("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),(0,We.jsx)("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),(0,We.jsx)("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.4301C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),(0,We.jsx)("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),(0,We.jsx)("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),(0,We.jsx)("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),(0,We.jsx)("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),(0,We.jsx)("defs",{children:(0,We.jsx)("clipPath",{id:"clip0_113_33841",children:(0,We.jsx)("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});var Y=require("react/jsx-runtime"),p1=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,i]=(0,_n.useState)([]),a=t?e.length:2,s=c=>c.authenticatorName?c.createdWithBrowser?`${c.authenticatorName} on ${c.createdWithBrowser}`:c.authenticatorName:c.createdWithBrowser?c.createdWithOs?`${c.createdWithBrowser} on ${c.createdWithOs}`:`${c.createdWithBrowser}`:"Unknown device",l=async c=>{i(u=>u.concat([c])),await r(c),i(u=>u.filter(f=>f!==c))};return(0,Y.jsxs)("div",{children:[(0,Y.jsx)(tw,{children:"Your passkeys"}),(0,Y.jsxs)(C1,{children:[e.slice(0,a).map(c=>(0,Y.jsxs)(nw,{children:[(0,Y.jsxs)("div",{children:[(0,Y.jsx)(rw,{children:s(c)}),(0,Y.jsxs)(ow,{children:["Last used: ",(c.latestVerifiedAt??c.verifiedAt).toLocaleString()]})]}),(0,Y.jsx)(aw,{disabled:n.includes(c.credentialId),onClick:()=>l(c.credentialId),children:n.includes(c.credentialId)?(0,Y.jsx)(Po,{}):(0,Y.jsx)(f1.default,{height:"1.6em"})})]},c.credentialId)),e.length>2&&!t&&(0,Y.jsx)(Q4,{onClick:o,children:"View all"})]})]})},Y4=()=>(0,Y.jsxs)(C1,{children:[(0,Y.jsxs)(hr,{children:[(0,Y.jsx)(fr,{children:(0,Y.jsx)(h1.default,{})}),"Log in with Touch ID, Face ID, or a security key."]}),(0,Y.jsxs)(hr,{children:[(0,Y.jsx)(fr,{children:(0,Y.jsx)(g1.default,{})}),"More secure than a password."]}),(0,Y.jsxs)(hr,{children:[(0,Y.jsx)(fr,{children:(0,Y.jsx)(m1.default,{})}),"Takes seconds to set up and use."]})]}),v1=()=>{let{user:e,unlinkPasskey:t}=H(),{linkWithPasskey:r,closePrivyModal:o}=W(),n=e?.linkedAccounts.filter(g=>g.type==="passkey"),[i,a]=(0,_n.useState)(!1),[s,l]=(0,_n.useState)(""),[c,u]=(0,_n.useState)(!1),[f,h]=(0,_n.useState)(!1);(0,_n.useEffect)(()=>{n.length===0&&h(!1)},[n.length]);let v=()=>{a(!0),r().then(()=>u(!0)).catch(g=>{if(g instanceof mt){if(g.privyErrorCode==="cannot_link_more_of_type"){l("Cannot link more passkeys to account.");return}else if(g.privyErrorCode==="passkey_not_allowed"){l("Passkey request timed out or rejected by user.");return}}l("Unknown error occurred.")}).finally(()=>{a(!1)})},C=async g=>(a(!0),await t(g).then(()=>u(!0)).catch(P=>{if(P instanceof mt&&P.privyErrorCode==="missing_or_invalid_mfa"){l("Cannot unlink a passkey enrolled in MFA");return}l("Unknown error occurred.")}).finally(()=>{a(!1)}));return c?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(A,{onClose:()=>o()},"header"),(0,Y.jsx)(Ge,{children:(0,Y.jsx)(st,{status:"success",children:(0,Y.jsx)(y1.default,{})})}),(0,Y.jsx)(u1,{children:"Passkey added"}),(0,Y.jsx)(X4,{children:"From now on, you can use your passkey to log in."}),(0,Y.jsx)(Yt,{children:(0,Y.jsx)(U,{onClick:()=>o(),children:"Done"})}),(0,Y.jsx)($,{})]}):f?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(A,{backFn:()=>h(!1),onClose:()=>o()},"header"),(0,Y.jsx)(p1,{passkeys:n,expanded:f,onUnlink:C,onExpand:()=>h(!0)}),(0,Y.jsx)($,{})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(A,{onClose:()=>o()},"header"),(0,Y.jsx)(Ge,{children:(0,Y.jsxs)(Hc,{children:[(0,Y.jsx)(ei,{}),(0,Y.jsx)(ti,{})]})}),(0,Y.jsx)(u1,{children:"Secure your account with a passkey"}),(0,Y.jsx)(ew,{}),n.length===0?(0,Y.jsx)(Y4,{}):(0,Y.jsx)(p1,{passkeys:n,expanded:f,onUnlink:C,onExpand:()=>h(!0)}),(0,Y.jsxs)(Yt,{style:{marginTop:"12px"},children:[s&&(0,Y.jsx)(Z4,{fail:!0,children:s}),(0,Y.jsx)(U,{onClick:v,loading:i,children:"Add new passkey"})]}),(0,Y.jsx)($,{})]})},Hc=Qt.default.div`
1745
1768
  display: flex;
1746
1769
  align-items: center;
1747
1770
  justify-content: center;
@@ -1757,7 +1780,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1757
1780
  stroke: var(--privy-color-accent) !important;
1758
1781
  fill: var(--privy-color-accent) !important;
1759
1782
  }
1760
- `,W4=Jt.default.div`
1783
+ `,Z4=Qt.default.div`
1761
1784
  line-height: 20px;
1762
1785
  height: 20px;
1763
1786
  font-size: 13px;
@@ -1765,7 +1788,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1765
1788
  display: flex;
1766
1789
  justify-content: flex-beginngin;
1767
1790
  width: 100%;
1768
- `,L4=Jt.css`
1791
+ `,J4=Qt.css`
1769
1792
  && {
1770
1793
  width: 100%;
1771
1794
  font-size: 0.875rem;
@@ -1790,9 +1813,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
1790
1813
  box-shadow: none;
1791
1814
  }
1792
1815
  }
1793
- `,O4=Jt.default.button`
1794
- ${L4}
1795
- `,lg=Jt.default.div`
1816
+ `,Q4=Qt.default.button`
1817
+ ${J4}
1818
+ `,C1=Qt.default.div`
1796
1819
  display: flex;
1797
1820
  flex-direction: column;
1798
1821
  align-items: stretch;
@@ -1800,18 +1823,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1800
1823
  padding: 0.5rem 0rem 0rem;
1801
1824
  flex-grow: 1;
1802
1825
  width: 100%;
1803
- `,tg=Jt.default.div`
1826
+ `,u1=Qt.default.div`
1804
1827
  font-size: 18px;
1805
1828
  line-height: 18px;
1806
1829
  text-align: center;
1807
1830
  font-weight: 600;
1808
- `,N4=Jt.default.div`
1831
+ `,X4=Qt.default.div`
1809
1832
  font-size: 0.875rem;
1810
1833
  text-align: center;
1811
1834
  margin-top: 10px;
1812
- `,D4=Jt.default.div`
1835
+ `,ew=Qt.default.div`
1813
1836
  height: 32px;
1814
- `,U4=Jt.default.div`
1837
+ `,tw=Qt.default.div`
1815
1838
  line-height: 20px;
1816
1839
  height: 20px;
1817
1840
  font-size: 1em;
@@ -1819,18 +1842,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1819
1842
  display: flex;
1820
1843
  justify-content: flex-beginning;
1821
1844
  width: 100%;
1822
- `,F4=Jt.default.div`
1845
+ `,rw=Qt.default.div`
1823
1846
  font-size: 1em;
1824
1847
  line-height: 1.3em;
1825
1848
  font-weight: 500;
1826
1849
  color: var(--privy-color-foreground-2);
1827
1850
  padding: 0.2em 0;
1828
- `,B4=Jt.default.div`
1851
+ `,ow=Qt.default.div`
1829
1852
  font-size: 0.875rem;
1830
1853
  line-height: 1rem;
1831
1854
  color: #64668b;
1832
1855
  padding: 0.2em 0;
1833
- `,H4=Jt.default.div`
1856
+ `,nw=Qt.default.div`
1834
1857
  display: flex;
1835
1858
  align-items: center;
1836
1859
  justify-content: space-between;
@@ -1843,7 +1866,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1843
1866
  border: 1px solid #e2e3f0 !important;
1844
1867
  width: 100%;
1845
1868
  height: 5em;
1846
- `,G4=Jt.css`
1869
+ `,iw=Qt.css`
1847
1870
  :focus,
1848
1871
  :hover,
1849
1872
  :active {
@@ -1860,9 +1883,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
1860
1883
  svg:hover {
1861
1884
  color: var(--privy-color-foreground-3);
1862
1885
  }
1863
- `,V4=Jt.default.button`
1864
- ${G4}
1865
- `;var cg=h(require("@heroicons/react/24/outline/PhoneIcon"));var Wr=require("react/jsx-runtime"),dg=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=k(),{initLoginWithSms:i}=W();async function a({qualifiedPhoneNumber:l}){try{await i(l),o("AWAITING_PASSWORDLESS_CODE")}catch(s){n({errorModalData:{error:s,previousScreen:r?.errorModalData?.previousScreen||t||"LINK_PHONE_SCREEN"}}),o("ERROR_SCREEN")}}return(0,Wr.jsxs)(Wr.Fragment,{children:[(0,Wr.jsx)(S,{},"header"),(0,Wr.jsx)(ae,{}),(0,Wr.jsx)(Ve,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:(0,Wr.jsx)(cg.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),(0,Wr.jsx)(Vr,{children:(0,Wr.jsx)(aa,{stacked:!0,onSubmit:a})}),(0,Wr.jsx)(me,{}),(0,Wr.jsx)(K,{protectedByPrivy:!0})]})};var ko=require("react/jsx-runtime"),pg=()=>{let{linkingHint:e}=W(),{app:t}=k(),r=e?`Select the wallet with ${sn(e)} and follow the instructions to reconnect your wallet${t?.name?` to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return(0,ko.jsxs)(ko.Fragment,{children:[(0,ko.jsx)(S,{},"header"),(0,ko.jsx)(Po,{title:`${e?"Reconnect":"Connect"} your wallet`,description:r}),(0,ko.jsx)(ao,{children:(0,ko.jsx)(Ui,{connectOnly:!1})}),(0,ko.jsx)(K,{protectedByPrivy:!0})]})};var ss=require("react/jsx-runtime"),ug=({style:e,...t})=>(0,ss.jsxs)("svg",{width:"164",height:"164",viewBox:"0 0 164 164",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,ss.jsx)("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),(0,ss.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});var vr=require("react/jsx-runtime"),mg=()=>{let{closePrivyModal:e}=W(),{navigate:t}=k();return(0,vr.jsxs)(vr.Fragment,{children:[(0,vr.jsx)(S,{},"header"),(0,vr.jsx)(ae,{}),(0,vr.jsx)(ug,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),(0,vr.jsx)(Po,{title:"Could not connect with wallet",description:"Please check that Phantom multichain is enabled and try again.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,vr.jsxs)(Vr,{children:[(0,vr.jsx)(D,{onClick:()=>t("LANDING"),children:"Try again"}),(0,vr.jsx)(no,{onClick:()=>e(),children:"Cancel"})]}),(0,vr.jsx)(me,{}),(0,vr.jsx)(K,{protectedByPrivy:!0})]})};var Bg=h(require("@heroicons/react/24/solid/CheckBadgeIcon")),Hg=h(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),Gg=h(require("@heroicons/react/24/solid/IdentificationIcon")),Vg=h(require("@heroicons/react/24/solid/PhoneIcon")),zg=h(require("@heroicons/react/24/solid/QuestionMarkCircleIcon")),Sp=h(require("@heroicons/react/24/solid/ShieldCheckIcon")),Zo=require("react");var fg=require("react");function la(){let{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}=(0,fg.useContext)(Se);return{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}}var hg=require("react");function Zr(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenroll:a,enrollInMfa:l}=(0,hg.useContext)(Se);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenrollWithSms:()=>a("sms"),unenrollWithTotp:()=>a("totp"),unenrollWithPasskey:()=>a("passkey"),showMfaEnrollmentModal:()=>l(!0),closeMfaEnrollmentModal:()=>l(!1)}}var yg=h(require("styled-components")),ls=require("react/jsx-runtime"),gg=e=>(0,ls.jsxs)(z4,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[(0,ls.jsx)("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),(0,ls.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]}),z4=yg.default.svg`
1886
+ `,aw=Qt.default.button`
1887
+ ${iw}
1888
+ `;var w1=y(require("@heroicons/react/24/outline/PhoneIcon"));var Lr=require("react/jsx-runtime"),b1=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=k(),{initLoginWithSms:i}=W();async function a({qualifiedPhoneNumber:s}){try{await i(s),o("AWAITING_PASSWORDLESS_CODE")}catch(l){n({errorModalData:{error:l,previousScreen:r?.errorModalData?.previousScreen||t||"LINK_PHONE_SCREEN"}}),o("ERROR_SCREEN")}}return(0,Lr.jsxs)(Lr.Fragment,{children:[(0,Lr.jsx)(A,{},"header"),(0,Lr.jsx)(ae,{}),(0,Lr.jsx)(Ve,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:(0,Lr.jsx)(w1.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),(0,Lr.jsx)(Vr,{children:(0,Lr.jsx)(pa,{stacked:!0,onSubmit:a})}),(0,Lr.jsx)(pe,{}),(0,Lr.jsx)(j,{protectedByPrivy:!0})]})};var Ro=require("react/jsx-runtime"),E1=()=>{let{linkingHint:e}=W(),{app:t}=k(),r=e?`Select the wallet with ${ln(e)} and follow the instructions to reconnect your wallet${t?.name?` to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return(0,Ro.jsxs)(Ro.Fragment,{children:[(0,Ro.jsx)(A,{},"header"),(0,Ro.jsx)(_o,{title:`${e?"Reconnect":"Connect"} your wallet`,description:r}),(0,Ro.jsx)(lo,{children:(0,Ro.jsx)(Gi,{connectOnly:!1})}),(0,Ro.jsx)(j,{protectedByPrivy:!0})]})};var fs=require("react/jsx-runtime"),T1=({style:e,...t})=>(0,fs.jsxs)("svg",{width:"164",height:"164",viewBox:"0 0 164 164",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,fs.jsx)("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),(0,fs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});var Cr=require("react/jsx-runtime"),P1=()=>{let{closePrivyModal:e}=W(),{navigate:t}=k();return(0,Cr.jsxs)(Cr.Fragment,{children:[(0,Cr.jsx)(A,{},"header"),(0,Cr.jsx)(ae,{}),(0,Cr.jsx)(T1,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),(0,Cr.jsx)(_o,{title:"Could not connect with wallet",description:"Please check that Phantom multichain is enabled and try again.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,Cr.jsxs)(Vr,{children:[(0,Cr.jsx)(U,{onClick:()=>t("LANDING"),children:"Try again"}),(0,Cr.jsx)(ao,{onClick:()=>e(),children:"Cancel"})]}),(0,Cr.jsx)(pe,{}),(0,Cr.jsx)(j,{protectedByPrivy:!0})]})};var J1=y(require("@heroicons/react/24/solid/CheckBadgeIcon")),Q1=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),X1=y(require("@heroicons/react/24/solid/IdentificationIcon")),e2=y(require("@heroicons/react/24/solid/PhoneIcon")),t2=y(require("@heroicons/react/24/solid/QuestionMarkCircleIcon")),Wp=y(require("@heroicons/react/24/solid/ShieldCheckIcon")),Jo=require("react");var _1=require("react");function ma(){let{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}=(0,_1.useContext)(Se);return{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}}var S1=require("react");function Zr(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenroll:a,enrollInMfa:s}=(0,S1.useContext)(Se);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenrollWithSms:()=>a("sms"),unenrollWithTotp:()=>a("totp"),unenrollWithPasskey:()=>a("passkey"),showMfaEnrollmentModal:()=>s(!0),closeMfaEnrollmentModal:()=>s(!1)}}var A1=y(require("styled-components")),hs=require("react/jsx-runtime"),x1=e=>(0,hs.jsxs)(sw,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[(0,hs.jsx)("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),(0,hs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]}),sw=A1.default.svg`
1866
1889
  height: 90px;
1867
1890
  width: 90px;
1868
1891
 
@@ -1873,7 +1896,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1873
1896
  > path {
1874
1897
  fill: white;
1875
1898
  }
1876
- `;var Dc=h(require("@heroicons/react/20/solid/CheckIcon")),vg=h(require("@heroicons/react/24/outline/ChevronRightIcon")),Cg=h(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),wg=h(require("@heroicons/react/24/outline/FingerPrintIcon")),bg=h(require("@heroicons/react/24/outline/PhoneIcon")),Uc=h(require("@heroicons/react/24/outline/TrashIcon")),Eg=h(require("@heroicons/react/24/solid/ShieldCheckIcon"));var ee=require("react/jsx-runtime"),Tg=({showIntro:e,userMfaMethods:t,appMfaMethods:r,userHasAuthSms:o,isTotpLoading:n,isPasskeyLoading:i,error:a,onClose:l,onBackToIntro:s,handleSelectMethod:c,setRemovingMfaMethod:u})=>{let y=t.reduce((v,C)=>({...v,[C]:!0}),{}),f=r.reduce((v,C)=>({...v,[C]:!0}),{});return(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(S,{backFn:e?s:void 0,onClose:l},"header"),(0,ee.jsx)(Ge,{children:(0,ee.jsx)(at,{children:(0,ee.jsx)(Eg.default,{})})}),(0,ee.jsx)(ge,{children:"Choose a verification method"}),t.length>0?(0,ee.jsx)(Ce,{children:"To add or delete verification methods, verification is required."}):(0,ee.jsx)(Ce,{children:"How would you like to verify your identity? You can change this later."}),a&&(0,ee.jsx)(Ql,{style:{marginTop:"1.25rem"},children:a.message}),(0,ee.jsxs)(Kl,{children:[(f.totp||y.totp)&&(0,ee.jsxs)(jl,{children:[(0,ee.jsx)(De,{style:{justifyContent:"center"},disabled:y.totp||n,onClick:()=>c("totp"),children:n?(0,ee.jsx)(kt,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):(0,ee.jsxs)(Jl,{children:[(0,ee.jsxs)(Zl,{children:[(0,ee.jsx)(Cg.default,{}),"Authenticator App"]}),y.totp?(0,ee.jsxs)(jn,{children:[(0,ee.jsx)(Dc.default,{}),"Added"]}):(0,ee.jsx)(jn,{children:"Recommended"})]})}),y.totp&&(0,ee.jsx)(Yl,{onClick:()=>u("totp"),children:(0,ee.jsx)(Uc.default,{})})]},"totp"),(f.sms||y.sms)&&(0,ee.jsxs)(jl,{children:[(0,ee.jsx)(De,{disabled:y.sms||o,onClick:()=>c("sms"),children:(0,ee.jsxs)(Jl,{children:[(0,ee.jsxs)(Zl,{children:[(0,ee.jsx)(bg.default,{}),"SMS"]}),y.sms&&(0,ee.jsxs)(jn,{children:[(0,ee.jsx)(Dc.default,{}),"Added"]}),o&&(0,ee.jsx)(jn,{children:"Disabled"})]})}),y.sms&&(0,ee.jsx)(Yl,{onClick:()=>u("sms"),children:(0,ee.jsx)(Uc.default,{})})]},"sms"),(f.passkey||y.passkey)&&(0,ee.jsxs)(jl,{children:[(0,ee.jsx)(De,{style:{justifyContent:"center"},onClick:()=>c("passkey"),disabled:y.passkey||i,children:i?(0,ee.jsx)(kt,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):(0,ee.jsxs)(Jl,{children:[(0,ee.jsxs)(Zl,{children:[(0,ee.jsx)(wg.default,{}),"Passkey"]}),y.passkey?(0,ee.jsxs)(jn,{children:[(0,ee.jsx)(Dc.default,{}),"Added"]}):(0,ee.jsx)(jn,{isAccent:!0,children:(0,ee.jsx)(vg.default,{})})]})}),y.passkey&&(0,ee.jsx)(Yl,{onClick:()=>u("passkey"),children:(0,ee.jsx)(Uc.default,{})})]},"passkey")]}),(0,ee.jsx)(q,{})]})};var Sg=h(require("@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon")),_g=h(require("@heroicons/react/24/outline/ClockIcon")),xg=h(require("@heroicons/react/24/outline/ShieldCheckIcon")),Ag=h(require("@heroicons/react/24/solid/CheckCircleIcon")),Sn=require("react"),cs=h(require("styled-components"));var Z=require("react/jsx-runtime"),kg=({onComplete:e,onClose:t,onReset:r})=>{let{user:o}=G(),{data:n}=k(),{initLinkWithPasskey:i,linkWithPasskey:a}=W(),{initEnrollmentWithPasskey:l,submitEnrollmentWithPasskey:s}=Zr(),[c,u]=(0,Sn.useState)(!1),[y,f]=(0,Sn.useState)(!1),[v,C]=(0,Sn.useState)(!1),[g,_]=(0,Sn.useState)(null),x=(0,Sn.useMemo)(()=>o?.linkedAccounts.filter(U=>U.type==="passkey")??[],[o]),b=()=>{n?.mfaEnrollmentFlow?.onSuccess(),e()},A=async U=>{u(!0);try{await l(),await s({credentialIds:U}),C(!0)}catch(M){_(M)}finally{u(!1)}},R=async()=>{f(!0),_(null);try{await i();let M=(await a())?.linkedAccounts.filter(I=>I.type==="passkey").map(I=>I.credentialId)??[];await A(M)}catch(U){_(U)}finally{f(!1)}};return x.length===0||y?(0,Z.jsx)(q4,{onReset:r,onClose:t,onClick:R,isCreating:y}):v?(0,Z.jsx)(K4,{onClick:b,onClose:b}):g?(0,Z.jsx)(Qa,{error:g,backFn:()=>_(null),onClick:()=>_(null)}):(0,Z.jsx)($4,{passkeys:x,isSubmitting:c,isCreating:y,onReset:r,onClose:t,onSubmitEnrollment:()=>A(x.map(U=>U.credentialId)),onAddPasskey:R})},q4=({onReset:e,onClose:t,onClick:r,isCreating:o})=>(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(S,{backFn:e,onClose:t},"header"),(0,Z.jsx)(Ge,{children:(0,Z.jsxs)(Nc,{children:[(0,Z.jsx)(Qn,{}),(0,Z.jsx)(Xn,{})]})}),(0,Z.jsx)(ge,{children:"Set up passkey verification"}),(0,Z.jsxs)(Kn,{children:[(0,Z.jsxs)(fr,{children:[(0,Z.jsx)(mr,{children:(0,Z.jsx)(xg.default,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),(0,Z.jsxs)(fr,{children:[(0,Z.jsx)(mr,{children:(0,Z.jsx)(_g.default,{})}),"Takes seconds to set up and use"]}),(0,Z.jsxs)(fr,{children:[(0,Z.jsx)(mr,{children:(0,Z.jsx)(Sg.default,{})}),"Use your passkey to verify transactions and login to your account"]})]}),(0,Z.jsx)(D,{style:{marginTop:"2.25rem"},onClick:r,loading:o,children:"Add a new passkey"}),(0,Z.jsx)(q,{})]}),$4=({onReset:e,onClose:t,onAddPasskey:r,onSubmitEnrollment:o,passkeys:n,isSubmitting:i,isCreating:a})=>{let[l,s]=(0,Sn.useState)(!1),c=l?n.length:n.length>3?2:3;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(S,{backFn:l?()=>s(!1):e,onClose:t},"header"),!l&&(0,Z.jsx)(Ge,{children:(0,Z.jsxs)(Nc,{children:[(0,Z.jsx)(Qn,{}),(0,Z.jsx)(Xn,{})]})}),(0,Z.jsx)(ge,{children:"Enable your passkeys for verification"}),(0,Z.jsxs)(Kn,{children:[n.slice(0,c).map(u=>(0,Z.jsxs)(j4,{children:[(0,Z.jsx)(Y4,{children:J4(u)}),(0,Z.jsxs)(Z4,{children:["Last used: ",u.latestVerifiedAt?.toLocaleString()]})]},u.credentialId)),!l&&n.length>3&&(0,Z.jsx)(Pg,{onClick:()=>s(!0),children:"View All"})]}),(0,Z.jsx)(D,{style:{marginTop:"1.5rem"},onClick:o,loading:i,children:"Enable passkeys"}),n.length<5&&(0,Z.jsx)(Pg,{style:{marginTop:"0.5rem"},onClick:r,disabled:a,children:a?(0,Z.jsx)(kt,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),(0,Z.jsx)(q,{})]})},K4=({onClick:e,onClose:t})=>(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(S,{onClose:t},"header"),(0,Z.jsx)(Ge,{children:(0,Z.jsx)(at,{status:"success",children:(0,Z.jsx)(Ag.default,{})})}),(0,Z.jsx)(ge,{children:"Passkey verification added"}),(0,Z.jsx)(Ce,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),(0,Z.jsx)(jt,{children:(0,Z.jsx)(D,{onClick:e,children:"Done"})}),(0,Z.jsx)(q,{})]}),j4=cs.default.div`
1899
+ `;var Gc=y(require("@heroicons/react/20/solid/CheckIcon")),k1=y(require("@heroicons/react/24/outline/ChevronRightIcon")),R1=y(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),I1=y(require("@heroicons/react/24/outline/FingerPrintIcon")),M1=y(require("@heroicons/react/24/outline/PhoneIcon")),Vc=y(require("@heroicons/react/24/outline/TrashIcon")),W1=y(require("@heroicons/react/24/solid/ShieldCheckIcon"));var te=require("react/jsx-runtime"),L1=({showIntro:e,userMfaMethods:t,appMfaMethods:r,userHasAuthSms:o,isTotpLoading:n,isPasskeyLoading:i,error:a,onClose:s,onBackToIntro:l,handleSelectMethod:c,setRemovingMfaMethod:u})=>{let f=t.reduce((v,C)=>({...v,[C]:!0}),{}),h=r.reduce((v,C)=>({...v,[C]:!0}),{});return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(A,{backFn:e?l:void 0,onClose:s},"header"),(0,te.jsx)(Ge,{children:(0,te.jsx)(st,{children:(0,te.jsx)(W1.default,{})})}),(0,te.jsx)(ve,{children:"Choose a verification method"}),t.length>0?(0,te.jsx)(we,{children:"To add or delete verification methods, verification is required."}):(0,te.jsx)(we,{children:"How would you like to verify your identity? You can change this later."}),a&&(0,te.jsx)(oc,{style:{marginTop:"1.25rem"},children:a.message}),(0,te.jsxs)(Ql,{children:[(h.totp||f.totp)&&(0,te.jsxs)(Xl,{children:[(0,te.jsx)(De,{style:{justifyContent:"center"},disabled:f.totp||n,onClick:()=>c("totp"),children:n?(0,te.jsx)(Mt,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):(0,te.jsxs)(rc,{children:[(0,te.jsxs)(tc,{children:[(0,te.jsx)(R1.default,{}),"Authenticator App"]}),f.totp?(0,te.jsxs)(Zn,{children:[(0,te.jsx)(Gc.default,{}),"Added"]}):(0,te.jsx)(Zn,{children:"Recommended"})]})}),f.totp&&(0,te.jsx)(ec,{onClick:()=>u("totp"),children:(0,te.jsx)(Vc.default,{})})]},"totp"),(h.sms||f.sms)&&(0,te.jsxs)(Xl,{children:[(0,te.jsx)(De,{disabled:f.sms||o,onClick:()=>c("sms"),children:(0,te.jsxs)(rc,{children:[(0,te.jsxs)(tc,{children:[(0,te.jsx)(M1.default,{}),"SMS"]}),f.sms&&(0,te.jsxs)(Zn,{children:[(0,te.jsx)(Gc.default,{}),"Added"]}),o&&(0,te.jsx)(Zn,{children:"Disabled"})]})}),f.sms&&(0,te.jsx)(ec,{onClick:()=>u("sms"),children:(0,te.jsx)(Vc.default,{})})]},"sms"),(h.passkey||f.passkey)&&(0,te.jsxs)(Xl,{children:[(0,te.jsx)(De,{style:{justifyContent:"center"},onClick:()=>c("passkey"),disabled:f.passkey||i,children:i?(0,te.jsx)(Mt,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):(0,te.jsxs)(rc,{children:[(0,te.jsxs)(tc,{children:[(0,te.jsx)(I1.default,{}),"Passkey"]}),f.passkey?(0,te.jsxs)(Zn,{children:[(0,te.jsx)(Gc.default,{}),"Added"]}):(0,te.jsx)(Zn,{isAccent:!0,children:(0,te.jsx)(k1.default,{})})]})}),f.passkey&&(0,te.jsx)(ec,{onClick:()=>u("passkey"),children:(0,te.jsx)(Vc.default,{})})]},"passkey")]}),(0,te.jsx)($,{})]})};var N1=y(require("@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon")),D1=y(require("@heroicons/react/24/outline/ClockIcon")),U1=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),F1=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Sn=require("react"),ys=y(require("styled-components"));var Z=require("react/jsx-runtime"),B1=({onComplete:e,onClose:t,onReset:r})=>{let{user:o}=H(),{data:n}=k(),{initLinkWithPasskey:i,linkWithPasskey:a}=W(),{initEnrollmentWithPasskey:s,submitEnrollmentWithPasskey:l}=Zr(),[c,u]=(0,Sn.useState)(!1),[f,h]=(0,Sn.useState)(!1),[v,C]=(0,Sn.useState)(!1),[g,P]=(0,Sn.useState)(null),S=(0,Sn.useMemo)(()=>o?.linkedAccounts.filter(D=>D.type==="passkey")??[],[o]),E=()=>{n?.mfaEnrollmentFlow?.onSuccess(),e()},x=async D=>{u(!0);try{await s(),await l({credentialIds:D}),C(!0)}catch(I){P(I)}finally{u(!1)}},R=async()=>{h(!0),P(null);try{await i();let I=(await a())?.linkedAccounts.filter(M=>M.type==="passkey").map(M=>M.credentialId)??[];await x(I)}catch(D){P(D)}finally{h(!1)}};return S.length===0||f?(0,Z.jsx)(lw,{onReset:r,onClose:t,onClick:R,isCreating:f}):v?(0,Z.jsx)(dw,{onClick:E,onClose:E}):g?(0,Z.jsx)(is,{error:g,backFn:()=>P(null),onClick:()=>P(null)}):(0,Z.jsx)(cw,{passkeys:S,isSubmitting:c,isCreating:f,onReset:r,onClose:t,onSubmitEnrollment:()=>x(S.map(D=>D.credentialId)),onAddPasskey:R})},lw=({onReset:e,onClose:t,onClick:r,isCreating:o})=>(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(A,{backFn:e,onClose:t},"header"),(0,Z.jsx)(Ge,{children:(0,Z.jsxs)(Hc,{children:[(0,Z.jsx)(ei,{}),(0,Z.jsx)(ti,{})]})}),(0,Z.jsx)(ve,{children:"Set up passkey verification"}),(0,Z.jsxs)(Yn,{children:[(0,Z.jsxs)(hr,{children:[(0,Z.jsx)(fr,{children:(0,Z.jsx)(U1.default,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),(0,Z.jsxs)(hr,{children:[(0,Z.jsx)(fr,{children:(0,Z.jsx)(D1.default,{})}),"Takes seconds to set up and use"]}),(0,Z.jsxs)(hr,{children:[(0,Z.jsx)(fr,{children:(0,Z.jsx)(N1.default,{})}),"Use your passkey to verify transactions and login to your account"]})]}),(0,Z.jsx)(U,{style:{marginTop:"2.25rem"},onClick:r,loading:o,children:"Add a new passkey"}),(0,Z.jsx)($,{})]}),cw=({onReset:e,onClose:t,onAddPasskey:r,onSubmitEnrollment:o,passkeys:n,isSubmitting:i,isCreating:a})=>{let[s,l]=(0,Sn.useState)(!1),c=s?n.length:n.length>3?2:3;return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(A,{backFn:s?()=>l(!1):e,onClose:t},"header"),!s&&(0,Z.jsx)(Ge,{children:(0,Z.jsxs)(Hc,{children:[(0,Z.jsx)(ei,{}),(0,Z.jsx)(ti,{})]})}),(0,Z.jsx)(ve,{children:"Enable your passkeys for verification"}),(0,Z.jsxs)(Yn,{children:[n.slice(0,c).map(u=>(0,Z.jsxs)(pw,{children:[(0,Z.jsx)(uw,{children:fw(u)}),(0,Z.jsxs)(mw,{children:["Last used: ",u.latestVerifiedAt?.toLocaleString()]})]},u.credentialId)),!s&&n.length>3&&(0,Z.jsx)(O1,{onClick:()=>l(!0),children:"View All"})]}),(0,Z.jsx)(U,{style:{marginTop:"1.5rem"},onClick:o,loading:i,children:"Enable passkeys"}),n.length<5&&(0,Z.jsx)(O1,{style:{marginTop:"0.5rem"},onClick:r,disabled:a,children:a?(0,Z.jsx)(Mt,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),(0,Z.jsx)($,{})]})},dw=({onClick:e,onClose:t})=>(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(A,{onClose:t},"header"),(0,Z.jsx)(Ge,{children:(0,Z.jsx)(st,{status:"success",children:(0,Z.jsx)(F1.default,{})})}),(0,Z.jsx)(ve,{children:"Passkey verification added"}),(0,Z.jsx)(we,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),(0,Z.jsx)(Yt,{children:(0,Z.jsx)(U,{onClick:e,children:"Done"})}),(0,Z.jsx)($,{})]}),pw=ys.default.div`
1877
1900
  && {
1878
1901
  padding: 0.75rem 1rem;
1879
1902
  text-align: left;
@@ -1881,19 +1904,19 @@ You will need this password to access your ${e} wallet on a new device. Please k
1881
1904
  border: 1px solid var(--privy-color-foreground-4);
1882
1905
  width: 100%;
1883
1906
  }
1884
- `,Y4=cs.default.div`
1907
+ `,uw=ys.default.div`
1885
1908
  font-size: 0.875rem;
1886
1909
  line-height: 1.375rem;
1887
1910
  font-weight: 500;
1888
1911
 
1889
1912
  color: var(--privy-color-foreground-1);
1890
- `,Z4=cs.default.div`
1913
+ `,mw=ys.default.div`
1891
1914
  font-size: 0.75rem;
1892
1915
  font-weight: 400;
1893
1916
  line-height: 1.125rem;
1894
1917
 
1895
1918
  color: var(--privy-color-foreground-2);
1896
- `,J4=e=>e.authenticatorName?e.createdWithBrowser?`${e.authenticatorName} on ${e.createdWithBrowser}`:e.authenticatorName:e.createdWithBrowser?e.createdWithOs?`${e.createdWithBrowser} on ${e.createdWithOs}`:`${e.createdWithBrowser}`:"Unknown device",Pg=cs.default.button`
1919
+ `,fw=e=>e.authenticatorName?e.createdWithBrowser?`${e.authenticatorName} on ${e.createdWithBrowser}`:e.authenticatorName:e.createdWithBrowser?e.createdWithOs?`${e.createdWithBrowser} on ${e.createdWithOs}`:`${e.createdWithBrowser}`:"Unknown device",O1=ys.default.button`
1897
1920
  && {
1898
1921
  width: 100%;
1899
1922
  font-size: 0.875rem;
@@ -1918,7 +1941,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1918
1941
  box-shadow: none;
1919
1942
  }
1920
1943
  }
1921
- `;var Mg=h(require("@heroicons/react/24/solid/CheckCircleIcon")),Tp=h(require("@heroicons/react/24/solid/PhoneIcon")),ps=require("react");var Fc=require("react"),Ig=require("react-device-detect"),Ep=h(require("styled-components")),Ro=require("react/jsx-runtime"),ds=6,Q4=new Array(ds).fill("");function X4(e){return e.replace(/\s+/g,"")}function bp(e){return/^[0-9]{1}$/.test(e)}function Rg(e){return e.length===ds&&e.every(bp)}function ew(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var ei=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,i]=(0,Fc.useState)(Q4),[a,l]=(0,Fc.useState)(null),[s,c]=(0,Fc.useState)(null),u=async C=>{C.preventDefault();let g=X4(C.currentTarget.value);if(g==="")return;let _=ew(n,bp),x=g.split(""),b=!x.every(bp),A=x.length+_>ds;if(b){l("Passcode can only be numbers"),c(1);return}if(A){l("Passcode must be exactly 6 numbers"),c(1);return}l(null),c(null);let R=Number(C.currentTarget.name?.charAt(4)),U=[...g||[""]].slice(0,ds-R),M=[...n.slice(0,R),...U,...n.slice(R+U.length)];i(M);let I=U.length,V=Math.min(Math.max(R+I,0),ds-1);if(document.querySelector(`input[name=pin-${V}]`)?.focus(),Rg(M))try{await e(M.join("")),document.querySelector(`input[name=pin-${V}]`)?.blur()}catch(te){c(1),l(te.message)}else try{await e(null)}catch(te){c(1),l(te.message)}},y=C=>{s===1&&(l(null),c(null));let g=[...n.slice(0,C),"",...n.slice(C+1)];i(g),C>0&&document.querySelector(`input[name=pin-${C-1}]`)?.focus(),Rg(g)?e(g.join("")):e(null)},v=o?"success":!!(r||a)?"fail":"";return(0,Ro.jsx)(Ro.Fragment,{children:(0,Ro.jsxs)(tw,{children:[(0,Ro.jsx)("div",{children:n.map((C,g)=>(0,Ro.jsx)("input",{name:`pin-${g}`,type:"text",value:n[g],onChange:u,onKeyUp:_=>{_.key==="Backspace"&&y(g)},inputMode:"numeric",autoFocus:g===0,pattern:"[0-9]",className:v,autoComplete:Ig.isMobile?"one-time-code":"off",disabled:t},g))}),(0,Ro.jsx)("div",{children:(0,Ro.jsx)(rw,{fail:!!r||!!a,children:r||a})})]})})},tw=Ep.default.div`
1944
+ `;var V1=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Ip=y(require("@heroicons/react/24/solid/PhoneIcon")),vs=require("react");var zc=require("react"),G1=require("react-device-detect"),Rp=y(require("styled-components")),Io=require("react/jsx-runtime"),gs=6,hw=new Array(gs).fill("");function yw(e){return e.replace(/\s+/g,"")}function kp(e){return/^[0-9]{1}$/.test(e)}function H1(e){return e.length===gs&&e.every(kp)}function gw(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var ri=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,i]=(0,zc.useState)(hw),[a,s]=(0,zc.useState)(null),[l,c]=(0,zc.useState)(null),u=async C=>{C.preventDefault();let g=yw(C.currentTarget.value);if(g==="")return;let P=gw(n,kp),S=g.split(""),E=!S.every(kp),x=S.length+P>gs;if(E){s("Passcode can only be numbers"),c(1);return}if(x){s("Passcode must be exactly 6 numbers"),c(1);return}s(null),c(null);let R=Number(C.currentTarget.name?.charAt(4)),D=[...g||[""]].slice(0,gs-R),I=[...n.slice(0,R),...D,...n.slice(R+D.length)];i(I);let M=D.length,V=Math.min(Math.max(R+M,0),gs-1);if(document.querySelector(`input[name=pin-${V}]`)?.focus(),H1(I))try{await e(I.join("")),document.querySelector(`input[name=pin-${V}]`)?.blur()}catch(re){c(1),s(re.message)}else try{await e(null)}catch(re){c(1),s(re.message)}},f=C=>{l===1&&(s(null),c(null));let g=[...n.slice(0,C),"",...n.slice(C+1)];i(g),C>0&&document.querySelector(`input[name=pin-${C-1}]`)?.focus(),H1(g)?e(g.join("")):e(null)},v=o?"success":!!(r||a)?"fail":"";return(0,Io.jsx)(Io.Fragment,{children:(0,Io.jsxs)(vw,{children:[(0,Io.jsx)("div",{children:n.map((C,g)=>(0,Io.jsx)("input",{name:`pin-${g}`,type:"text",value:n[g],onChange:u,onKeyUp:P=>{P.key==="Backspace"&&f(g)},inputMode:"numeric",autoFocus:g===0,pattern:"[0-9]",className:v,autoComplete:G1.isMobile?"one-time-code":"off",disabled:t},g))}),(0,Io.jsx)("div",{children:(0,Io.jsx)(Cw,{fail:!!r||!!a,children:r||a})})]})})},vw=Rp.default.div`
1922
1945
  display: flex;
1923
1946
  flex-direction: column;
1924
1947
  width: 100%;
@@ -1986,7 +2009,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1986
2009
  transform: translate(1px, 0px);
1987
2010
  }
1988
2011
  }
1989
- `,rw=Ep.default.div`
2012
+ `,Cw=Rp.default.div`
1990
2013
  line-height: 20px;
1991
2014
  font-size: 13px;
1992
2015
  display: flex;
@@ -1994,7 +2017,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1994
2017
  width: 100%;
1995
2018
 
1996
2019
  color: ${e=>e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
1997
- `;var ue=require("react/jsx-runtime"),Wg=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=(0,ps.useState)(""),[i,a]=(0,ps.useState)(!1),[l,s]=(0,ps.useState)(null),[c,u]=(0,ps.useState)("enroll"),{initEnrollmentWithSms:y,submitEnrollmentWithSms:f}=Zr(),{app:v,data:C}=k();function g(){C?.mfaEnrollmentFlow?.onSuccess(),e()}async function _({qualifiedPhoneNumber:A}){try{await y({phoneNumber:A}),n(A),u("verify")}catch(R){s(R)}}async function x(A){try{if(!A)return;await f({phoneNumber:o,mfaCode:A}),a(!0)}catch(R){throw nc(R)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):hn(R)?new Error("The code you entered is not valid"):fn(R)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):ic(R)?new Error("Verification canceled"):new Error("Unknown error")}}function b(){c==="verify"?u("enroll"):t()}return l?(0,ue.jsx)(Qa,{error:l,backFn:()=>s(null),onClick:()=>s(null)}):c==="enroll"?(0,ue.jsxs)(ue.Fragment,{children:[(0,ue.jsx)(S,{backFn:t,onClose:r},"header"),(0,ue.jsx)(Ge,{children:(0,ue.jsx)(at,{children:(0,ue.jsx)(Tp.default,{})})}),(0,ue.jsx)(ge,{children:"Set up SMS verification"}),(0,ue.jsx)(Ce,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),(0,ue.jsxs)(Gr,{children:[(0,ue.jsx)(aa,{onSubmit:_}),(0,ue.jsxs)(Nf,{children:["By providing your mobile number, you agree to receive text messages from ",v?.name,". Some carrier charges may apply"]})]}),(0,ue.jsx)(q,{})]}):i?(0,ue.jsxs)(ue.Fragment,{children:[(0,ue.jsx)(S,{onClose:g},"header"),(0,ue.jsx)(Ge,{children:(0,ue.jsx)(at,{status:"success",children:(0,ue.jsx)(Mg.default,{})})}),(0,ue.jsx)(ge,{children:"SMS verification added"}),(0,ue.jsx)(Ce,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),(0,ue.jsx)(jt,{children:(0,ue.jsx)(D,{onClick:g,children:"Done"})}),(0,ue.jsx)(q,{})]}):(0,ue.jsxs)(ue.Fragment,{children:[(0,ue.jsx)(S,{backFn:b,onClose:r},"header"),(0,ue.jsx)(Ge,{children:(0,ue.jsx)(at,{children:(0,ue.jsx)(Tp.default,{})})}),(0,ue.jsx)(ge,{children:"Enter enrollment code"}),(0,ue.jsxs)(Gr,{children:[(0,ue.jsx)(ei,{onChange:x}),(0,ue.jsxs)(Ce,{children:["To continue, enter the 6-digit code sent to ",(0,ue.jsx)("strong",{children:k1(o)})]})]}),(0,ue.jsx)(q,{})]})};var Dg=h(require("@heroicons/react/24/solid/CheckCircleIcon")),Ug=h(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),Pp=require("react");var Lg=h(require("@heroicons/react/24/solid/ShieldCheckIcon"));var Ng=require("react/jsx-runtime");var Og=({size:e,authUrl:t})=>(0,Ng.jsx)(ta,{url:t,squareLogoElement:Lg.default,size:e,fgColor:"#1F1F1F"});var fe=require("react/jsx-runtime"),Fg=({onComplete:e,onClose:t,onReset:r,totpInfo:o})=>{let[n,i]=(0,Pp.useState)("enroll"),[a,l]=(0,Pp.useState)(!1),{submitEnrollmentWithTotp:s}=Zr(),{data:c}=k();function u(){c?.mfaEnrollmentFlow?.onSuccess(),e()}function y(){i("verify")}async function f(C){try{if(!C)return;await s({mfaCode:C}),l(!0)}catch(g){throw nc(g)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):hn(g)?new Error("The code you entered is not valid"):fn(g)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):ic(g)?new Error("Verification canceled"):new Error("Unknown error")}}function v(){n==="verify"?i("enroll"):r()}return n==="enroll"?(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(S,{backFn:r,onClose:t},"header"),(0,fe.jsx)(ge,{children:"Scan QR code"}),(0,fe.jsx)(Ce,{children:"Open your authenticator app and scan the QR code to continue."}),(0,fe.jsx)(Ni,{children:(0,fe.jsx)(Og,{authUrl:o.authUrl,size:200})}),(0,fe.jsxs)(jt,{children:[(0,fe.jsx)(or,{children:(0,fe.jsx)(bn,{itemName:"secret",text:o.secret})}),(0,fe.jsx)(D,{onClick:y,children:"Continue"})]}),(0,fe.jsx)(q,{})]}):a?(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(S,{onClose:u},"header"),(0,fe.jsx)(Ge,{children:(0,fe.jsx)(at,{status:"success",children:(0,fe.jsx)(Dg.default,{})})}),(0,fe.jsx)(ge,{children:"Authenticator app verification added"}),(0,fe.jsx)(Ce,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),(0,fe.jsx)(jt,{children:(0,fe.jsx)(D,{onClick:u,children:"Done"})}),(0,fe.jsx)(q,{})]}):(0,fe.jsxs)(fe.Fragment,{children:[(0,fe.jsx)(S,{backFn:v,onClose:t},"header"),(0,fe.jsx)(Ge,{children:(0,fe.jsx)(at,{children:(0,fe.jsx)(Ug.default,{})})}),(0,fe.jsx)(ge,{children:"Enter enrollment code"}),(0,fe.jsx)(Gr,{children:(0,fe.jsx)(ei,{onChange:f})}),(0,fe.jsxs)(Ce,{children:["To continue, enter the 6-digit code generated from your ",(0,fe.jsx)("strong",{children:"authenticator app"})]}),(0,fe.jsx)(q,{})]})};var B=require("react/jsx-runtime"),qg=()=>{let{user:e,enrollInMfa:t}=G(),[r,o]=(0,Zo.useState)(null),{unenrollWithSms:n,unenrollWithTotp:i,unenrollWithPasskey:a}=Zr(),{app:l,ready:s,data:c,onUserCloseViaDialogOrKeybindRef:u}=k(),{closePrivyModal:y}=W(),{promptMfa:f}=la(),{initEnrollmentWithTotp:v}=Zr(),[C,g]=(0,Zo.useState)(!1),[_,x]=(0,Zo.useState)(null),[b,A]=(0,Zo.useState)(null),R=()=>{y({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),x(null)},500)},{initEnrollmentWithPasskey:U,submitEnrollmentWithPasskey:M}=Zr(),[I,V]=(0,Zo.useState)(!1),[j,te]=(0,Zo.useState)(null);u.current=R;let L=e?.mfaMethods.includes("sms"),z=!!e?.phone,O=e?.mfaMethods.includes("totp"),ye=e?.mfaMethods.includes("passkey"),we=L||O||ye,be=e?.linkedAccounts.filter(yt=>yt.type==="passkey").map(yt=>yt.credentialId)??[];(0,Zo.useEffect)(()=>{we&&g(!0)},[we]);function Ne(){o(null),x(null)}function le(){g(!1)}async function er(){V(!0);try{await U(),await M({credentialIds:be})}catch(yt){te(yt)}finally{V(!1)}}async function Et(yt){if(await f().catch(te),yt==="totp"){x(yt),A(null),v().then(Dr=>{A(Dr)}).catch(()=>{A(null),Ne()});return}if(yt==="passkey"&&be.length===1)return await er();x(yt)}if(!s||!e||!l)return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(S,{onClose:R},"header"),(0,B.jsx)(Ge,{children:(0,B.jsx)(gg,{})}),(0,B.jsx)(Gr,{children:(0,B.jsx)(kt,{})}),(0,B.jsx)(q,{})]});async function sr(){o(null);try{await n()}catch{o(null)}}async function _t(){o(null);try{await i()}catch{o(null)}}async function Nr(){o(null);try{await f(),await a()}catch{o(null)}}if(r==="sms")return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(S,{backFn:Ne,onClose:R},"header"),(0,B.jsx)(Ge,{children:(0,B.jsx)(at,{children:(0,B.jsx)(Vg.default,{})})}),(0,B.jsx)(ge,{children:"Remove SMS verification?"}),(0,B.jsxs)(Ce,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),(0,B.jsx)(jt,{children:(0,B.jsx)(D,{warn:!0,onClick:sr,children:"Remove SMS for MFA"})}),(0,B.jsx)(q,{})]});if(r==="totp")return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(S,{backFn:Ne,onClose:R},"header"),(0,B.jsx)(Ge,{children:(0,B.jsx)(at,{children:(0,B.jsx)(Hg.default,{})})}),(0,B.jsx)(ge,{children:"Remove Authenticator App verification?"}),(0,B.jsxs)(Ce,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),(0,B.jsx)(jt,{children:(0,B.jsx)(D,{warn:!0,onClick:_t,children:"Remove Authenticator App for MFA"})}),(0,B.jsx)(q,{})]});if(r==="passkey")return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(S,{backFn:Ne,onClose:R},"header"),(0,B.jsx)(Ge,{children:(0,B.jsx)(at,{children:(0,B.jsx)(zg.default,{})})}),(0,B.jsx)(ge,{children:"Are you sure you want to remove passkey verification?"}),(0,B.jsx)(Ce,{children:"This will disable any passkeys you have set up for verification. You\u2019ll still be able to login with your passkeys if you\u2019ve set up passkey login."}),(0,B.jsx)(jt,{children:(0,B.jsx)(D,{warn:!0,onClick:Nr,children:"Yes, remove"})}),(0,B.jsx)(q,{})]});if(c.mfaEnrollmentFlow.mfaMethods.length===0&&!we)return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(S,{onClose:R},"header"),(0,B.jsx)(Ge,{children:(0,B.jsx)(at,{children:(0,B.jsx)(Sp.default,{})})}),(0,B.jsx)(ge,{children:"Add more security"}),(0,B.jsxs)(Ce,{children:[l?.name," does not have any verification methods enabled."]}),(0,B.jsx)(jt,{children:(0,B.jsx)(D,{onClick:R,children:"Close"})}),(0,B.jsx)(q,{})]});let Ze=!we&&!C;return Ze?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(S,{onClose:R},"header"),(0,B.jsx)(Ge,{children:(0,B.jsx)(at,{children:(0,B.jsx)(Sp.default,{})})}),(0,B.jsx)(ge,{children:"Transaction Protection"}),(0,B.jsx)(Ce,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,B.jsxs)(Kn,{children:[(0,B.jsxs)(fr,{children:[(0,B.jsx)(mr,{children:(0,B.jsx)(Bg.default,{})}),"Enable 2-Step verification for your ",l?.name," wallet."]}),(0,B.jsxs)(fr,{children:[(0,B.jsx)(mr,{children:(0,B.jsx)(Gg.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,B.jsxs)(jt,{children:[(0,B.jsx)(D,{onClick:()=>g(!0),children:"Continue"}),(0,B.jsx)(no,{onClick:R,children:"Not now"})]}),(0,B.jsx)(q,{})]}):_==="sms"?(0,B.jsx)(Wg,{onComplete:R,onReset:Ne,onClose:R}):_==="totp"&&b?(0,B.jsx)(Fg,{onComplete:R,onClose:R,onReset:Ne,totpInfo:b}):_==="passkey"?(0,B.jsx)(kg,{onComplete:R,onReset:Ne,onClose:R}):(0,B.jsx)(Tg,{showIntro:Ze,userMfaMethods:e.mfaMethods,appMfaMethods:l.mfa.methods,userHasAuthSms:z,onBackToIntro:le,handleSelectMethod:Et,isTotpLoading:_==="totp"&&!b,isPasskeyLoading:I,error:j,onClose:R,setRemovingMfaMethod:o})};var M2=h(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),W2=h(require("@heroicons/react/24/outline/FingerPrintIcon")),L2=h(require("@heroicons/react/24/outline/PhoneIcon")),O2=h(require("@heroicons/react/24/outline/ShieldCheckIcon")),N2=h(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),D2=h(require("@heroicons/react/24/solid/PhoneIcon")),xn=require("react");var oi=require("react"),x2=h(require("styled-components"));var Mp=h(require("styled-components"));var _p=h(require("styled-components")),us=require("react/jsx-runtime"),Bc=({label:e,children:t,valueStyles:r})=>(0,us.jsxs)(ow,{children:[(0,us.jsx)("div",{children:e}),(0,us.jsx)(nw,{style:{...r},children:t})]}),ow=_p.default.div`
2020
+ `;var he=require("react/jsx-runtime"),z1=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=(0,vs.useState)(""),[i,a]=(0,vs.useState)(!1),[s,l]=(0,vs.useState)(null),[c,u]=(0,vs.useState)("enroll"),{initEnrollmentWithSms:f,submitEnrollmentWithSms:h}=Zr(),{app:v,data:C}=k();function g(){C?.mfaEnrollmentFlow?.onSuccess(),e()}async function P({qualifiedPhoneNumber:x}){try{await f({phoneNumber:x}),n(x),u("verify")}catch(R){l(R)}}async function S(x){try{if(!x)return;await h({phoneNumber:o,mfaCode:x}),a(!0)}catch(R){throw cc(R)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):yn(R)?new Error("The code you entered is not valid"):hn(R)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):dc(R)?new Error("Verification canceled"):new Error("Unknown error")}}function E(){c==="verify"?u("enroll"):t()}return s?(0,he.jsx)(is,{error:s,backFn:()=>l(null),onClick:()=>l(null)}):c==="enroll"?(0,he.jsxs)(he.Fragment,{children:[(0,he.jsx)(A,{backFn:t,onClose:r},"header"),(0,he.jsx)(Ge,{children:(0,he.jsx)(st,{children:(0,he.jsx)(Ip.default,{})})}),(0,he.jsx)(ve,{children:"Set up SMS verification"}),(0,he.jsx)(we,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),(0,he.jsxs)(Gr,{children:[(0,he.jsx)(pa,{onSubmit:P}),(0,he.jsxs)(zf,{children:["By providing your mobile number, you agree to receive text messages from ",v?.name,". Some carrier charges may apply"]})]}),(0,he.jsx)($,{})]}):i?(0,he.jsxs)(he.Fragment,{children:[(0,he.jsx)(A,{onClose:g},"header"),(0,he.jsx)(Ge,{children:(0,he.jsx)(st,{status:"success",children:(0,he.jsx)(V1.default,{})})}),(0,he.jsx)(ve,{children:"SMS verification added"}),(0,he.jsx)(we,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),(0,he.jsx)(Yt,{children:(0,he.jsx)(U,{onClick:g,children:"Done"})}),(0,he.jsx)($,{})]}):(0,he.jsxs)(he.Fragment,{children:[(0,he.jsx)(A,{backFn:E,onClose:r},"header"),(0,he.jsx)(Ge,{children:(0,he.jsx)(st,{children:(0,he.jsx)(Ip.default,{})})}),(0,he.jsx)(ve,{children:"Enter enrollment code"}),(0,he.jsxs)(Gr,{children:[(0,he.jsx)(ri,{onChange:S}),(0,he.jsxs)(we,{children:["To continue, enter the 6-digit code sent to ",(0,he.jsx)("strong",{children:Bg(o)})]})]}),(0,he.jsx)($,{})]})};var j1=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Y1=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),Mp=require("react");var q1=y(require("@heroicons/react/24/solid/ShieldCheckIcon"));var K1=require("react/jsx-runtime");var $1=({size:e,authUrl:t})=>(0,K1.jsx)(aa,{url:t,squareLogoElement:q1.default,size:e,fgColor:"#1F1F1F"});var ye=require("react/jsx-runtime"),Z1=({onComplete:e,onClose:t,onReset:r,totpInfo:o})=>{let[n,i]=(0,Mp.useState)("enroll"),[a,s]=(0,Mp.useState)(!1),{submitEnrollmentWithTotp:l}=Zr(),{data:c}=k();function u(){c?.mfaEnrollmentFlow?.onSuccess(),e()}function f(){i("verify")}async function h(C){try{if(!C)return;await l({mfaCode:C}),s(!0)}catch(g){throw cc(g)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):yn(g)?new Error("The code you entered is not valid"):hn(g)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):dc(g)?new Error("Verification canceled"):new Error("Unknown error")}}function v(){n==="verify"?i("enroll"):r()}return n==="enroll"?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(A,{backFn:r,onClose:t},"header"),(0,ye.jsx)(ve,{children:"Scan QR code"}),(0,ye.jsx)(we,{children:"Open your authenticator app and scan the QR code to continue."}),(0,ye.jsx)(Bi,{children:(0,ye.jsx)($1,{authUrl:o.authUrl,size:200})}),(0,ye.jsxs)(Yt,{children:[(0,ye.jsx)(nr,{children:(0,ye.jsx)(En,{itemName:"secret",text:o.secret})}),(0,ye.jsx)(U,{onClick:f,children:"Continue"})]}),(0,ye.jsx)($,{})]}):a?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(A,{onClose:u},"header"),(0,ye.jsx)(Ge,{children:(0,ye.jsx)(st,{status:"success",children:(0,ye.jsx)(j1.default,{})})}),(0,ye.jsx)(ve,{children:"Authenticator app verification added"}),(0,ye.jsx)(we,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),(0,ye.jsx)(Yt,{children:(0,ye.jsx)(U,{onClick:u,children:"Done"})}),(0,ye.jsx)($,{})]}):(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(A,{backFn:v,onClose:t},"header"),(0,ye.jsx)(Ge,{children:(0,ye.jsx)(st,{children:(0,ye.jsx)(Y1.default,{})})}),(0,ye.jsx)(ve,{children:"Enter enrollment code"}),(0,ye.jsx)(Gr,{children:(0,ye.jsx)(ri,{onChange:h})}),(0,ye.jsxs)(we,{children:["To continue, enter the 6-digit code generated from your ",(0,ye.jsx)("strong",{children:"authenticator app"})]}),(0,ye.jsx)($,{})]})};var B=require("react/jsx-runtime"),r2=()=>{let{user:e,enrollInMfa:t}=H(),[r,o]=(0,Jo.useState)(null),{unenrollWithSms:n,unenrollWithTotp:i,unenrollWithPasskey:a}=Zr(),{app:s,ready:l,data:c,onUserCloseViaDialogOrKeybindRef:u}=k(),{closePrivyModal:f}=W(),{promptMfa:h}=ma(),{initEnrollmentWithTotp:v}=Zr(),[C,g]=(0,Jo.useState)(!1),[P,S]=(0,Jo.useState)(null),[E,x]=(0,Jo.useState)(null),R=()=>{f({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),S(null)},500)},{initEnrollmentWithPasskey:D,submitEnrollmentWithPasskey:I}=Zr(),[M,V]=(0,Jo.useState)(!1),[z,re]=(0,Jo.useState)(null);u.current=R;let L=e?.mfaMethods.includes("sms"),K=!!e?.phone,O=e?.mfaMethods.includes("totp"),ge=e?.mfaMethods.includes("passkey"),be=L||O||ge,Ee=e?.linkedAccounts.filter(gt=>gt.type==="passkey").map(gt=>gt.credentialId)??[];(0,Jo.useEffect)(()=>{be&&g(!0)},[be]);function Ne(){o(null),S(null)}function le(){g(!1)}async function tr(){V(!0);try{await D(),await I({credentialIds:Ee})}catch(gt){re(gt)}finally{V(!1)}}async function _t(gt){if(await h().catch(re),gt==="totp"){S(gt),x(null),v().then(Ur=>{x(Ur)}).catch(()=>{x(null),Ne()});return}if(gt==="passkey"&&Ee.length===1)return await tr();S(gt)}if(!l||!e||!s)return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(A,{onClose:R},"header"),(0,B.jsx)(Ge,{children:(0,B.jsx)(x1,{})}),(0,B.jsx)(Gr,{children:(0,B.jsx)(Mt,{})}),(0,B.jsx)($,{})]});async function lr(){o(null);try{await n()}catch{o(null)}}async function kt(){o(null);try{await i()}catch{o(null)}}async function Dr(){o(null);try{await h(),await a()}catch{o(null)}}if(r==="sms")return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(A,{backFn:Ne,onClose:R},"header"),(0,B.jsx)(Ge,{children:(0,B.jsx)(st,{children:(0,B.jsx)(e2.default,{})})}),(0,B.jsx)(ve,{children:"Remove SMS verification?"}),(0,B.jsxs)(we,{children:["MFA adds an extra layer of security to your ",s?.name," account. Make sure you have other methods to secure your account."]}),(0,B.jsx)(Yt,{children:(0,B.jsx)(U,{warn:!0,onClick:lr,children:"Remove SMS for MFA"})}),(0,B.jsx)($,{})]});if(r==="totp")return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(A,{backFn:Ne,onClose:R},"header"),(0,B.jsx)(Ge,{children:(0,B.jsx)(st,{children:(0,B.jsx)(Q1.default,{})})}),(0,B.jsx)(ve,{children:"Remove Authenticator App verification?"}),(0,B.jsxs)(we,{children:["MFA adds an extra layer of security to your ",s?.name," account. Make sure you have other methods to secure your account."]}),(0,B.jsx)(Yt,{children:(0,B.jsx)(U,{warn:!0,onClick:kt,children:"Remove Authenticator App for MFA"})}),(0,B.jsx)($,{})]});if(r==="passkey")return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(A,{backFn:Ne,onClose:R},"header"),(0,B.jsx)(Ge,{children:(0,B.jsx)(st,{children:(0,B.jsx)(t2.default,{})})}),(0,B.jsx)(ve,{children:"Are you sure you want to remove passkey verification?"}),(0,B.jsx)(we,{children:"This will disable any passkeys you have set up for verification. You\u2019ll still be able to login with your passkeys if you\u2019ve set up passkey login."}),(0,B.jsx)(Yt,{children:(0,B.jsx)(U,{warn:!0,onClick:Dr,children:"Yes, remove"})}),(0,B.jsx)($,{})]});if(c.mfaEnrollmentFlow.mfaMethods.length===0&&!be)return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(A,{onClose:R},"header"),(0,B.jsx)(Ge,{children:(0,B.jsx)(st,{children:(0,B.jsx)(Wp.default,{})})}),(0,B.jsx)(ve,{children:"Add more security"}),(0,B.jsxs)(we,{children:[s?.name," does not have any verification methods enabled."]}),(0,B.jsx)(Yt,{children:(0,B.jsx)(U,{onClick:R,children:"Close"})}),(0,B.jsx)($,{})]});let Ze=!be&&!C;return Ze?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(A,{onClose:R},"header"),(0,B.jsx)(Ge,{children:(0,B.jsx)(st,{children:(0,B.jsx)(Wp.default,{})})}),(0,B.jsx)(ve,{children:"Transaction Protection"}),(0,B.jsx)(we,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,B.jsxs)(Yn,{children:[(0,B.jsxs)(hr,{children:[(0,B.jsx)(fr,{children:(0,B.jsx)(J1.default,{})}),"Enable 2-Step verification for your ",s?.name," wallet."]}),(0,B.jsxs)(hr,{children:[(0,B.jsx)(fr,{children:(0,B.jsx)(X1.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,B.jsxs)(Yt,{children:[(0,B.jsx)(U,{onClick:()=>g(!0),children:"Continue"}),(0,B.jsx)(ao,{onClick:R,children:"Not now"})]}),(0,B.jsx)($,{})]}):P==="sms"?(0,B.jsx)(z1,{onComplete:R,onReset:Ne,onClose:R}):P==="totp"&&E?(0,B.jsx)(Z1,{onComplete:R,onClose:R,onReset:Ne,totpInfo:E}):P==="passkey"?(0,B.jsx)(B1,{onComplete:R,onReset:Ne,onClose:R}):(0,B.jsx)(L1,{showIntro:Ze,userMfaMethods:e.mfaMethods,appMfaMethods:s.mfa.methods,userHasAuthSms:K,onBackToIntro:le,handleSelectMethod:_t,isTotpLoading:P==="totp"&&!E,isPasskeyLoading:M,error:z,onClose:R,setRemovingMfaMethod:o})};var V2=y(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),z2=y(require("@heroicons/react/24/outline/FingerPrintIcon")),q2=y(require("@heroicons/react/24/outline/PhoneIcon")),$2=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),K2=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),j2=y(require("@heroicons/react/24/solid/PhoneIcon")),xn=require("react");var ii=require("react"),U2=y(require("styled-components"));var Bp=y(require("styled-components"));var Lp=y(require("styled-components")),Cs=require("react/jsx-runtime"),qc=({label:e,children:t,valueStyles:r})=>(0,Cs.jsxs)(ww,{children:[(0,Cs.jsx)("div",{children:e}),(0,Cs.jsx)(bw,{style:{...r},children:t})]}),ww=Lp.default.div`
1998
2021
  display: flex;
1999
2022
  align-items: center;
2000
2023
  justify-content: space-between;
@@ -2009,7 +2032,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2009
2032
  color: var(--privy-color-foreground-2);
2010
2033
  text-align: right;
2011
2034
  }
2012
- `,nw=_p.default.div`
2035
+ `,bw=Lp.default.div`
2013
2036
  font-size: 14px;
2014
2037
  line-height: 100%;
2015
2038
  display: flex;
@@ -2018,28 +2041,28 @@ You will need this password to access your ${e} wallet on a new device. Please k
2018
2041
  border-radius: var(--privy-border-radius-full);
2019
2042
  background-color: var(--privy-color-background-2);
2020
2043
  padding: 4px 8px;
2021
- `;var fs=h(require("styled-components"));var xp=require("@ethersproject/bignumber"),Ap=require("@ethersproject/units");var ms=(e,t)=>{let r=(t*parseFloat((0,Ap.formatEther)(e))).toFixed(2);return r!=="0.00"?`$${r}`:"<$0.01"},Io=(e,t,r=6,o=!1)=>{let i=parseFloat((0,Ap.formatEther)(e)).toFixed(r).replace(/0+$/,"").replace(/\.$/,"");return o?`${i} ${t}`:`${i==="0"?"<0.001":i} ${t}`},kp=e=>e.map(Qt).reduce((t,r)=>t.add(r),xp.BigNumber.from(0)).toHexString(),$g=(e,t)=>{let{chains:r}=W(),o=`https://etherscan.io/address/${t}`,n=`${rm(e,r)}/address/${t}`;if(!n)return o;try{new URL(n)}catch{return o}return n},Qt=e=>xp.BigNumber.from(e);var Mo=require("react/jsx-runtime"),Kg=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=kp(e),n=t?ms(o,t):void 0,i=Io(o,r);return(0,Mo.jsx)(jg,{children:n||i})},Rp=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=kp(e),n=t?ms(o,t):void 0,i=Io(o,r);return(0,Mo.jsx)(jg,{children:n?(0,Mo.jsxs)(Mo.Fragment,{children:[(0,Mo.jsx)(iw,{children:"USD"}),n==="<$0.01"?(0,Mo.jsxs)(sw,{children:[(0,Mo.jsx)(aw,{children:"<"}),"$0.01"]}):n]}):i})},jg=fs.default.span`
2044
+ `;var bs=y(require("styled-components"));var Op=require("@ethersproject/bignumber"),Np=require("@ethersproject/units");var ws=(e,t)=>{let r=(t*parseFloat((0,Np.formatEther)(e))).toFixed(2);return r!=="0.00"?`$${r}`:"<$0.01"},Mo=(e,t,r=6,o=!1)=>{let i=parseFloat((0,Np.formatEther)(e)).toFixed(r).replace(/0+$/,"").replace(/\.$/,"");return o?`${i} ${t}`:`${i==="0"?"<0.001":i} ${t}`},Dp=e=>e.map(Xt).reduce((t,r)=>t.add(r),Op.BigNumber.from(0)).toHexString(),o2=(e,t)=>{let{chains:r}=W(),o=`https://etherscan.io/address/${t}`,n=`${cm(e,r)}/address/${t}`;if(!n)return o;try{new URL(n)}catch{return o}return n},Xt=e=>Op.BigNumber.from(e);var Wo=require("react/jsx-runtime"),n2=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Dp(e),n=t?ws(o,t):void 0,i=Mo(o,r);return(0,Wo.jsx)(i2,{children:n||i})},Up=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Dp(e),n=t?ws(o,t):void 0,i=Mo(o,r);return(0,Wo.jsx)(i2,{children:n?(0,Wo.jsxs)(Wo.Fragment,{children:[(0,Wo.jsx)(Ew,{children:"USD"}),n==="<$0.01"?(0,Wo.jsxs)(Pw,{children:[(0,Wo.jsx)(Tw,{children:"<"}),"$0.01"]}):n]}):i})},i2=bs.default.span`
2022
2045
  font-size: 14px;
2023
2046
  line-height: 140%;
2024
2047
  display: flex;
2025
2048
  gap: 4px;
2026
2049
  align-items: center;
2027
- `,iw=fs.default.span`
2050
+ `,Ew=bs.default.span`
2028
2051
  font-size: 12px;
2029
2052
  line-height: 12px;
2030
2053
  color: var(--privy-color-foreground-3);
2031
- `,aw=fs.default.span`
2054
+ `,Tw=bs.default.span`
2032
2055
  font-size: 10px;
2033
- `,sw=fs.default.span`
2056
+ `,Pw=bs.default.span`
2034
2057
  display: flex;
2035
2058
  align-items: center;
2036
- `;var Hc=h(require("styled-components"));var Cr=require("react/jsx-runtime"),Yg=({gas:e,tokenPrice:t,tokenSymbol:r})=>(0,Cr.jsxs)(Kd,{style:{paddingBottom:"12px"},children:[(0,Cr.jsxs)(Jg,{children:[(0,Cr.jsx)(Xg,{children:"Est. Fees"}),(0,Cr.jsx)("div",{children:(0,Cr.jsx)(Rp,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&(0,Cr.jsx)(Qg,{children:`${Io(e,r)}`})]}),Zg=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=Qt(e.value||0).add(Qt(t)).toHexString();return(0,Cr.jsxs)(Kd,{children:[(0,Cr.jsxs)(Jg,{children:[(0,Cr.jsx)(Xg,{children:"Total (including fees)"}),(0,Cr.jsx)("div",{children:(0,Cr.jsx)(Rp,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&(0,Cr.jsx)(Qg,{children:Io(n,o)})]})},Jg=Hc.default.div`
2059
+ `;var $c=y(require("styled-components"));var wr=require("react/jsx-runtime"),a2=({gas:e,tokenPrice:t,tokenSymbol:r})=>(0,wr.jsxs)(ep,{style:{paddingBottom:"12px"},children:[(0,wr.jsxs)(l2,{children:[(0,wr.jsx)(d2,{children:"Est. Fees"}),(0,wr.jsx)("div",{children:(0,wr.jsx)(Up,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&(0,wr.jsx)(c2,{children:`${Mo(e,r)}`})]}),s2=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=Xt(e.value||0).add(Xt(t)).toHexString();return(0,wr.jsxs)(ep,{children:[(0,wr.jsxs)(l2,{children:[(0,wr.jsx)(d2,{children:"Total (including fees)"}),(0,wr.jsx)("div",{children:(0,wr.jsx)(Up,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&(0,wr.jsx)(c2,{children:Mo(n,o)})]})},l2=$c.default.div`
2037
2060
  display: flex;
2038
2061
  flex-direction: row;
2039
2062
  justify-content: space-between;
2040
2063
  align-items: center;
2041
2064
  padding-top: 4px;
2042
- `,Qg=Hc.default.div`
2065
+ `,c2=$c.default.div`
2043
2066
  display: flex;
2044
2067
  flex-direction: row;
2045
2068
  height: 12px;
@@ -2048,23 +2071,23 @@ You will need this password to access your ${e} wallet on a new device. Please k
2048
2071
  line-height: 12px;
2049
2072
  color: var(--privy-color-foreground-3);
2050
2073
  font-weight: 400;
2051
- `,Xg=Hc.default.div`
2074
+ `,d2=$c.default.div`
2052
2075
  font-size: 14px;
2053
2076
  line-height: 22.4px;
2054
2077
  font-weight: 400;
2055
- `;var e2=h(require("@heroicons/react/24/outline/ChevronDownIcon")),Wo=require("react"),Jo=h(require("styled-components"));var Gc=require("react"),ca=(0,Gc.createContext)(void 0);var hs=(0,Gc.createContext)(void 0);var Vt=require("react/jsx-runtime"),t2=({defaultValue:e,children:t})=>{let[r,o]=(0,Wo.useState)(e||null),n=i=>{o(r===i?null:i)};return(0,Vt.jsx)(ca.Provider,{value:{activePanel:r,togglePanel:n},children:(0,Vt.jsx)(lw,{children:t})})},r2=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=(0,Wo.useContext)(ca),n=r===e;return(0,Vt.jsx)(hs.Provider,{value:{onToggle:()=>o(e),value:e},children:(0,Vt.jsx)(uw,{isActive:n,"data-open":n,children:t})})},o2=({children:e})=>{let{activePanel:t}=(0,Wo.useContext)(ca),{onToggle:r,value:o}=(0,Wo.useContext)(hs),n=t===o;return(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsxs)(cw,{onClick:r,"data-open":n,children:[(0,Vt.jsx)(pw,{children:e}),(0,Vt.jsx)(fw,{isactive:n,children:(0,Vt.jsx)(e2.default,{height:"16px",width:"16px",strokeWidth:"2"})})]}),(0,Vt.jsx)(dw,{})]})},n2=({children:e})=>{let{activePanel:t}=(0,Wo.useContext)(ca),{value:r}=(0,Wo.useContext)(hs);return(0,Vt.jsx)(mw,{"data-open":t===r,children:(0,Vt.jsx)(a2,{children:e})})},i2=({children:e})=>{let{activePanel:t}=(0,Wo.useContext)(ca),{value:r}=(0,Wo.useContext)(hs);return(0,Vt.jsx)(a2,{children:typeof e=="function"?e({isActive:t===r}):e})},lw=Jo.default.div`
2078
+ `;var p2=y(require("@heroicons/react/24/outline/ChevronDownIcon")),Lo=require("react"),Qo=y(require("styled-components"));var Kc=require("react"),fa=(0,Kc.createContext)(void 0);var Es=(0,Kc.createContext)(void 0);var qt=require("react/jsx-runtime"),u2=({defaultValue:e,children:t})=>{let[r,o]=(0,Lo.useState)(e||null),n=i=>{o(r===i?null:i)};return(0,qt.jsx)(fa.Provider,{value:{activePanel:r,togglePanel:n},children:(0,qt.jsx)(_w,{children:t})})},m2=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=(0,Lo.useContext)(fa),n=r===e;return(0,qt.jsx)(Es.Provider,{value:{onToggle:()=>o(e),value:e},children:(0,qt.jsx)(kw,{isActive:n,"data-open":n,children:t})})},f2=({children:e})=>{let{activePanel:t}=(0,Lo.useContext)(fa),{onToggle:r,value:o}=(0,Lo.useContext)(Es),n=t===o;return(0,qt.jsxs)(qt.Fragment,{children:[(0,qt.jsxs)(Sw,{onClick:r,"data-open":n,children:[(0,qt.jsx)(xw,{children:e}),(0,qt.jsx)(Iw,{isactive:n,children:(0,qt.jsx)(p2.default,{height:"16px",width:"16px",strokeWidth:"2"})})]}),(0,qt.jsx)(Aw,{})]})},h2=({children:e})=>{let{activePanel:t}=(0,Lo.useContext)(fa),{value:r}=(0,Lo.useContext)(Es);return(0,qt.jsx)(Rw,{"data-open":t===r,children:(0,qt.jsx)(g2,{children:e})})},y2=({children:e})=>{let{activePanel:t}=(0,Lo.useContext)(fa),{value:r}=(0,Lo.useContext)(Es);return(0,qt.jsx)(g2,{children:typeof e=="function"?e({isActive:t===r}):e})},_w=Qo.default.div`
2056
2079
  display: flex;
2057
2080
  flex-direction: column;
2058
2081
  width: 100%;
2059
2082
  gap: 8px;
2060
- `,cw=Jo.default.div`
2083
+ `,Sw=Qo.default.div`
2061
2084
  display: flex;
2062
2085
  justify-content: space-between;
2063
2086
  align-items: center;
2064
2087
  width: 100%;
2065
2088
  cursor: pointer;
2066
2089
  padding-bottom: 8px;
2067
- `,dw=Jo.default.div`
2090
+ `,Aw=Qo.default.div`
2068
2091
  width: 100%;
2069
2092
 
2070
2093
  && {
@@ -2072,13 +2095,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
2072
2095
  border-color: var(--privy-color-foreground-4);
2073
2096
  }
2074
2097
  padding-bottom: 12px;
2075
- `,pw=Jo.default.div`
2098
+ `,xw=Qo.default.div`
2076
2099
  font-size: 14px;
2077
2100
  font-weight: 500;
2078
2101
  line-height: 19.6px;
2079
2102
  width: 100%;
2080
2103
  padding-right: 8px;
2081
- `,uw=Jo.default.div`
2104
+ `,kw=Qo.default.div`
2082
2105
  display: flex;
2083
2106
  flex-direction: column;
2084
2107
  width: 100%;
@@ -2090,7 +2113,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2090
2113
  border-color: var(--privy-color-foreground-4);
2091
2114
  border-radius: var(--privy-border-radius-md);
2092
2115
  }
2093
- `,mw=Jo.default.div`
2116
+ `,Rw=Qo.default.div`
2094
2117
  position: relative;
2095
2118
  overflow: hidden;
2096
2119
  transition: max-height 25ms ease-out;
@@ -2102,38 +2125,38 @@ You will need this password to access your ${e} wallet on a new device. Please k
2102
2125
  &[data-open='false'] {
2103
2126
  max-height: 0;
2104
2127
  }
2105
- `,a2=Jo.default.div`
2128
+ `,g2=Qo.default.div`
2106
2129
  display: flex;
2107
2130
  flex-direction: column;
2108
2131
  gap: 12px;
2109
2132
  flex: 1 1 auto;
2110
2133
  min-height: 1px;
2111
- `,fw=Jo.default.div`
2134
+ `,Iw=Qo.default.div`
2112
2135
  transform: ${e=>e.isactive?"rotate(180deg)":"rotate(0deg)"};
2113
- `;var s2=h(require("styled-components"));var l2=require("react/jsx-runtime"),Ip=({walletAddress:e,chainId:t=Uo})=>(0,l2.jsx)(hw,{href:$g(t,e),target:"_blank",children:sn(e)}),hw=s2.default.a`
2136
+ `;var v2=y(require("styled-components"));var C2=require("react/jsx-runtime"),Fp=({walletAddress:e,chainId:t=Bo})=>(0,C2.jsx)(Mw,{href:o2(t,e),target:"_blank",children:ln(e)}),Mw=v2.default.a`
2114
2137
  &:hover {
2115
2138
  text-decoration: underline;
2116
2139
  }
2117
- `;var Nt=require("react/jsx-runtime"),da=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=r?.value||0;return(0,Nt.jsx)(t2,{children:(0,Nt.jsxs)(r2,{value:"details",children:[(0,Nt.jsx)(o2,{children:(0,Nt.jsxs)(yw,{children:[(0,Nt.jsx)("div",{children:o?.title||o?.actionDescription||"Details"}),(0,Nt.jsx)(gw,{children:(0,Nt.jsx)(Kg,{weiQuantities:[l],tokenPrice:n,tokenSymbol:a})})]})}),(0,Nt.jsxs)(n2,{children:[(0,Nt.jsx)(Bc,{label:"From",children:(0,Nt.jsx)(Ip,{walletAddress:e,chainId:r.chainId||Uo})}),(0,Nt.jsx)(Bc,{label:"To",children:(0,Nt.jsx)(Ip,{walletAddress:t,chainId:r.chainId||Uo})}),o&&o.action&&(0,Nt.jsx)(Bc,{label:"Action",children:o.action}),i&&(0,Nt.jsx)(Yg,{transactionData:r,gas:i,tokenPrice:n,tokenSymbol:a})]}),(0,Nt.jsx)(i2,{children:({isActive:s})=>(0,Nt.jsx)(Zg,{transactionData:r,displayFee:s,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},yw=Mp.default.div`
2140
+ `;var Dt=require("react/jsx-runtime"),ha=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:i,tokenSymbol:a})=>{let s=r?.value||0,l=It();return(0,Dt.jsx)(u2,{...l.render.standalone?{defaultValue:"details"}:{},children:(0,Dt.jsxs)(m2,{value:"details",children:[(0,Dt.jsx)(f2,{children:(0,Dt.jsxs)(Ww,{children:[(0,Dt.jsx)("div",{children:o?.title||o?.actionDescription||"Details"}),(0,Dt.jsx)(Lw,{children:(0,Dt.jsx)(n2,{weiQuantities:[s],tokenPrice:n,tokenSymbol:a})})]})}),(0,Dt.jsxs)(h2,{children:[(0,Dt.jsx)(qc,{label:"From",children:(0,Dt.jsx)(Fp,{walletAddress:e,chainId:r.chainId||Bo})}),(0,Dt.jsx)(qc,{label:"To",children:(0,Dt.jsx)(Fp,{walletAddress:t,chainId:r.chainId||Bo})}),o&&o.action&&(0,Dt.jsx)(qc,{label:"Action",children:o.action}),i&&(0,Dt.jsx)(a2,{transactionData:r,gas:i,tokenPrice:n,tokenSymbol:a})]}),(0,Dt.jsx)(y2,{children:({isActive:c})=>(0,Dt.jsx)(s2,{transactionData:r,displayFee:c,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},Ww=Bp.default.div`
2118
2141
  display: flex;
2119
2142
  flex-direction: row;
2120
2143
  justify-content: space-between;
2121
- `,gw=Mp.default.div`
2144
+ `,Lw=Bp.default.div`
2122
2145
  flex-shrink: 0;
2123
2146
  padding-left: 8px;
2124
- `;var pa=h(require("styled-components")),_n=require("react/jsx-runtime"),Wp=({description:e,contractInfo:t})=>(0,_n.jsxs)(vw,{children:[t.imgUrl&&(0,_n.jsx)(Cw,{size:t.imgSize||"sm",src:t.imgUrl,alt:t.imgAltText||`${t.name} image`}),t.url&&(0,_n.jsx)(ww,{children:(0,_n.jsx)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:t.url.replace(/^(https?:\/\/)(www\.)?/,"")})}),t.name&&(0,_n.jsx)(bw,{children:t.name}),(0,_n.jsx)(Ew,{children:e||t.actionText})]}),vw=pa.default.div`
2147
+ `;var ya=y(require("styled-components")),An=require("react/jsx-runtime"),Hp=({description:e,contractInfo:t})=>(0,An.jsxs)(Ow,{children:[t.imgUrl&&(0,An.jsx)(Nw,{size:t.imgSize||"sm",src:t.imgUrl,alt:t.imgAltText||`${t.name} image`}),t.url&&(0,An.jsx)(Dw,{children:(0,An.jsx)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:t.url.replace(/^(https?:\/\/)(www\.)?/,"")})}),t.name&&(0,An.jsx)(Uw,{children:t.name}),(0,An.jsx)(Fw,{children:e||t.actionText})]}),Ow=ya.default.div`
2125
2148
  display: flex;
2126
2149
  flex-direction: column;
2127
2150
  align-items: center;
2128
2151
  margin-bottom: 8px;
2129
- `,Cw=pa.default.img`
2152
+ `,Nw=ya.default.img`
2130
2153
  && {
2131
2154
  height: ${e=>e.size==="sm"?"65px":"140px"};
2132
2155
  width: ${e=>e.size==="sm"?"65px":"140px"};
2133
2156
  border-radius: 16px;
2134
2157
  margin-bottom: 12px;
2135
2158
  }
2136
- `,ww=pa.default.div`
2159
+ `,Dw=ya.default.div`
2137
2160
  font-size: 12px;
2138
2161
  line-height: 12px;
2139
2162
  padding: 7px;
@@ -2146,7 +2169,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2146
2169
  text-decoration: underline;
2147
2170
  }
2148
2171
  }
2149
- `,bw=pa.default.div`
2172
+ `,Uw=ya.default.div`
2150
2173
  font-size: 18px;
2151
2174
  line-height: 18px;
2152
2175
  font-weight: 500;
@@ -2154,7 +2177,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2154
2177
  white-space: nowrap;
2155
2178
  max-width: 275px;
2156
2179
  text-overflow: ellipsis;
2157
- `,Ew=pa.default.div`
2180
+ `,Fw=ya.default.div`
2158
2181
  font-size: 16px;
2159
2182
  line-height: 140%;
2160
2183
  font-weight: 400;
@@ -2162,7 +2185,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2162
2185
  overflow: hidden;
2163
2186
  max-width: 275px;
2164
2187
  text-overflow: ellipsis;
2165
- `;var c2=h(require("@heroicons/react/24/outline/WalletIcon")),Vc=h(require("styled-components"));var ti=require("react/jsx-runtime"),d2=({address:e,txn:t,balance:r,hasFunds:o})=>{let n=!!r,{nativeTokenSymbolForChainId:i}=W(),a=i(t.chainId)||"ETH";return(0,ti.jsxs)(Tw,{children:[(0,ti.jsxs)(Pw,{children:[(0,ti.jsx)(c2.default,{strokeWidth:"2",width:"16px",height:"16px"}),(0,ti.jsx)("div",{children:sn(e)})]}),(0,ti.jsxs)(Sw,{displayBalanceColor:n,hasFunds:o,children:[r?Io(r,a,6,!0):0," available"]})]})},Tw=Vc.default.div`
2188
+ `;var w2=y(require("@heroicons/react/24/outline/WalletIcon")),jc=y(require("styled-components"));var oi=require("react/jsx-runtime"),b2=({address:e,txn:t,balance:r,hasFunds:o})=>{let n=!!r,{nativeTokenSymbolForChainId:i}=W(),a=i(t.chainId)||"ETH";return(0,oi.jsxs)(Bw,{children:[(0,oi.jsxs)(Hw,{children:[(0,oi.jsx)(w2.default,{strokeWidth:"2",width:"16px",height:"16px"}),(0,oi.jsx)("div",{children:ln(e)})]}),(0,oi.jsxs)(Gw,{displayBalanceColor:n,hasFunds:o,children:[r?Mo(r,a,6,!0):0," available"]})]})},Bw=jc.default.div`
2166
2189
  display: flex;
2167
2190
  flex-direction: row;
2168
2191
  justify-content: space-between;
@@ -2175,12 +2198,12 @@ You will need this password to access your ${e} wallet on a new device. Please k
2175
2198
  border: 1px solid var(--privy-color-foreground-4);
2176
2199
  border-radius: var(--privy-border-radius-md);
2177
2200
  }
2178
- `,Pw=Vc.default.div`
2201
+ `,Hw=jc.default.div`
2179
2202
  display: flex;
2180
2203
  flex-direction: row;
2181
2204
  align-items: center;
2182
2205
  gap: 8px;
2183
- `,Sw=Vc.default.div`
2206
+ `,Gw=jc.default.div`
2184
2207
  display: flex;
2185
2208
  align-items: center;
2186
2209
  justify-content: center;
@@ -2190,35 +2213,35 @@ You will need this password to access your ${e} wallet on a new device. Please k
2190
2213
  background-color: var(--privy-color-background-2);
2191
2214
  padding: 5px 8px;
2192
2215
  color: ${e=>e.displayBalanceColor?e.hasFunds?"var(--privy-color-success-dark)":"var(--privy-color-error)":"inherit"};
2193
- `;var ys=h(require("styled-components"));var Jr=require("react/jsx-runtime"),u2=({description:e,txn:t,tokenSymbol:r,tokenPrice:o})=>{let n=t.value||0,i=o?ms(n,o):void 0,a=Io(n,r);return(0,Jr.jsxs)(_w,{children:[i?(0,Jr.jsxs)(Jr.Fragment,{children:[(0,Jr.jsx)(p2,{children:i}),(0,Jr.jsx)(xw,{children:a})]}):(0,Jr.jsx)(Jr.Fragment,{children:(0,Jr.jsx)(p2,{children:a})}),(0,Jr.jsx)(Aw,{children:e})]})},_w=ys.default.div`
2216
+ `;var Ts=y(require("styled-components"));var Jr=require("react/jsx-runtime"),T2=({description:e,txn:t,tokenSymbol:r,tokenPrice:o})=>{let n=t.value||0,i=o?ws(n,o):void 0,a=Mo(n,r);return(0,Jr.jsxs)(Vw,{children:[i?(0,Jr.jsxs)(Jr.Fragment,{children:[(0,Jr.jsx)(E2,{children:i}),(0,Jr.jsx)(zw,{children:a})]}):(0,Jr.jsx)(Jr.Fragment,{children:(0,Jr.jsx)(E2,{children:a})}),(0,Jr.jsx)(qw,{children:e})]})},Vw=Ts.default.div`
2194
2217
  display: flex;
2195
2218
  flex-direction: column;
2196
2219
  align-items: center;
2197
2220
  margin-bottom: 20px;
2198
- `,p2=ys.default.h2`
2221
+ `,E2=Ts.default.h2`
2199
2222
  && {
2200
2223
  font-size: 48px;
2201
2224
  line-height: 48px;
2202
2225
  margin: 8px auto;
2203
2226
  }
2204
- `,xw=ys.default.p`
2227
+ `,zw=Ts.default.p`
2205
2228
  margin-bottom: 12px;
2206
2229
  && {
2207
2230
  font-size: 17px;
2208
2231
  line-height: 17px;
2209
2232
  color: var(--privy-color-foreground-3);
2210
2233
  }
2211
- `,Aw=ys.default.div`
2234
+ `,qw=Ts.default.div`
2212
2235
  font-size: 16px;
2213
2236
  line-height: 22.4px;
2214
2237
  font-weight: 400;
2215
2238
  overflow: hidden;
2216
2239
  max-width: 275px;
2217
2240
  text-overflow: ellipsis;
2218
- `;var P2=require("@ethersproject/abstract-signer"),Ww=require("@ethersproject/providers");var Lp=require("@ethersproject/bignumber");var ri=require("@ethersproject/bignumber"),m2=require("@ethersproject/contracts"),f2=require("@ethersproject/transactions");var kw=81457,Rw=168587773,ua=e=>[Cl.id,wl.id,bl.id,Tl.id,Pl.id,Sl.id,_l.id,Al.id,xl.id,kw,Rw].includes(e),h2=async(e,t)=>{if(!ua(e.chainId))throw new Error("Invalid chain ID for OP Stack gas estimation.");if(e.type===void 0&&(e.type=2),e.maxPriorityFeePerGas&&e.maxFeePerGas||e.gasPrice)return e;try{if(!e.maxPriorityFeePerGas){let r=await t.send("eth_maxPriorityFeePerGas",[]);e.maxPriorityFeePerGas=r}if(e.maxFeePerGas&&(console.warn("maxFeePerGas is specified without maxPriorityFeePerGas - this can result in hung transactions."),e.maxPriorityFeePerGas>=e.maxFeePerGas))throw new Error("Overridden maxFeePerGas is less than or equal to the calculated maxPriorityFeePerGas. Please set both values or maxPriorityFeePerGas alone for correct gas estimation.");if(!e.maxFeePerGas){let{lastBaseFeePerGas:r}=await t.getFeeData();if(!r)throw new Error("Unable to fetch baseFee for last block.");let i=ri.BigNumber.from(r).mul(ri.BigNumber.from(126)).div(ri.BigNumber.from(100)).add(ri.BigNumber.from(e.maxPriorityFeePerGas));e.maxFeePerGas=gs(i)}}catch(r){throw new Error(`Failed to set gas price for OP stack transaction: ${r}.`)}return e};async function y2(e,t){if(!e.chainId||e.chainId&&!ua(e.chainId))return ri.BigNumber.from(0);let r=ri.BigNumber.from(0);try{let o=new m2.Contract(Cm,wm,t),n=g2(e),i=(0,f2.serialize)(n);r=await o.getL1Fee(i)}catch{}return r}async function v2(e,t){try{return(await t.estimateGas(e)).toHexString()}catch(r){console.warn(`Gas estimation failed with error: ${r}. Retrying gas estimation by omitting the 'from' address`);try{let o={...e,from:void 0};return(await t.estimateGas(o)).toHexString()}catch(o){throw console.warn(`Gas estimation failed with error: ${o} when omitting the 'from' address`),r}}}var C2=async(e,t)=>{if(e.type===void 0&&(e.type=2),e.type===2){if(!e.maxFeePerGas||!e.maxPriorityFeePerGas){let r=await t.getFeeData();e.maxFeePerGas||(e.maxFeePerGas=r.maxFeePerGas?.toHexString()),e.maxPriorityFeePerGas||(e.maxPriorityFeePerGas=r.maxPriorityFeePerGas?.toHexString())}}else if(!e.gasPrice){let r=await t.getFeeData();e.gasPrice=r.gasPrice?.toHexString()}return e};async function ma(e,t){if(!e.gasLimit)throw new ct("gasLimit was not successfully set for transaction.");let r=Qt(e.gasLimit),o=Lp.BigNumber.from(0);if(e.type==2)if(e.maxFeePerGas)o=Qt(e.maxFeePerGas);else throw new ct("maxFeePerGas was not successfully set for transaction of type 2.");else if(e.gasPrice)o=Qt(e.gasPrice);else throw new ct("gasPrice was not successfully set for transaction of type 0 or 1.");let n=r.mul(o),i=Lp.BigNumber.from(0);if(e.chainId&&ua(e.chainId))try{i=await y2(e,t),n=n.add(i)}catch{}return{totalGasEstimate:n,l1ExecutionFeeEstimate:i}}var zc=require("@ethersproject/bignumber");var Op=e=>[yl.id,gl.id,vl.id].includes(e),w2=async(e,t)=>{if(!Op(e.chainId))throw new Error("Invalid chain ID for Arbitrum gas estimation.");if(e.type===void 0&&(e.type=2),e.maxFeePerGas)return e;try{let{lastBaseFeePerGas:r}=await t.getFeeData();if(r){let o=r.mul(zc.BigNumber.from(120)).div(zc.BigNumber.from(100));e.maxFeePerGas=gs(o),e.maxPriorityFeePerGas=gs(zc.BigNumber.from(0))}}catch(r){throw new Error(`Failed to set gas price for Arbitrum transaction: ${r}.`)}return e};var Np=e=>[56,97].includes(e),b2=async(e,t)=>{if(!Np(e.chainId))throw new Error("Invalid chain ID for BSC gas estimation.");if(e.type===void 0?e.type=0:(e.type==1||e.type==2)&&console.warn("Transaction request type specified is incompatible for chain and will result in undefined behavior. Please use transaction type 0."),!e.gasPrice){let r=await t.getFeeData();e.gasPrice=r.gasPrice?.toHexString()}return e};var Fp=require("@ethersproject/units"),E2=require("ofetch");var Dp={id:80002,name:"Polygon Amoy",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0};var Bp=e=>[Fa.id,Ba.id,Dp.id].includes(e),Up=e=>({maxPriorityFee:(0,Fp.parseUnits)(e.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:(0,Fp.parseUnits)(e.maxFee.toFixed(9),"gwei").toHexString()}),Iw=e=>({safeLow:Up(e.safeLow),standard:Up(e.standard),fast:Up(e.fast)}),Mw=async e=>{let t="";switch(e){case Fa.id:t="https://gasstation.polygon.technology/v2";break;case Ba.id:t="https://gasstation-testnet.polygon.technology/v2";break;case Dp.id:t="https://gasstation-testnet.polygon.technology/amoy";break;default:throw Error(`chainId ${e} does not support polygon gas stations`)}return Iw(await(0,E2.ofetch)(t))};async function T2(e){if(!Bp(e.chainId))throw new Error("Invalid chain ID for Polygon gas estimation.");if(e.type===void 0&&(e.type=2),e.maxPriorityFeePerGas&&e.maxFeePerGas)return e;try{let{standard:t}=await Mw(e.chainId);e.maxPriorityFeePerGas||(e.maxPriorityFeePerGas=t.maxPriorityFee),e.maxFeePerGas||(e.maxFeePerGas=t.maxFee)}catch(t){throw new Error(`Failed to set gas prices from Polygon gas station with error: ${t}.`)}return e}function gs(e){if(typeof e=="number"||typeof e=="bigint"||typeof e=="string")return e;if(typeof e.toHexString=="function")return e.toHexString();throw new Error(`Expected numeric value but received ${e}`)}function g2(e){let t={};return e.to!==void 0&&(t.to=e.to),e.data!==void 0&&(t.data=e.data),e.chainId!==void 0&&(t.chainId=e.chainId),e.type!==void 0&&(t.type=e.type),e.accessList!==void 0&&(t.accessList=e.accessList),e.nonce!==void 0&&(t.nonce=Qt(e.nonce).toNumber()),e.gasLimit!==void 0&&(t.gasLimit=Qt(e.gasLimit)),e.gasPrice!==void 0&&(t.gasPrice=Qt(e.gasPrice)),e.value!==void 0&&(t.value=Qt(e.value)),e.maxFeePerGas!==void 0&&(t.maxFeePerGas=Qt(e.maxFeePerGas)),e.maxPriorityFeePerGas!==void 0&&(t.maxPriorityFeePerGas=Qt(e.maxPriorityFeePerGas)),t}async function fa(e,t,r){if(t.chainId=Number(t.chainId),S2(t),t.from||(t.from=e),!t.nonce){let o=new P2.VoidSigner(e,r);t.nonce=await o.getTransactionCount("pending")}return t.gasLimit||(t.gas?(t.gasLimit=t.gas,delete t.gas):t.gasLimit=await v2(t,r)),typeof t.type=="string"&&_2(t.type)&&(t.type=Number(t.type)),[23294,23295].includes(t.chainId)&&(t.type=0),Bp(t.chainId)?t=await T2(t):Op(t.chainId)?t=await w2(t,r):ua(t.chainId)?t=await h2(t,r):Np(t.chainId)?t=await b2(t,r):t=await C2(t,r),t.type===0&&delete t.accessList,t.type!==2&&(delete t.maxPriorityFeePerGas,delete t.maxFeePerGas),t}async function qc(e,t,r,o,n){o=Object.assign({chainId:Uo},o),S2(o);let a=(await r.rpc({address:t,accessToken:e,request:{method:"eth_signTransaction",params:[o]}})).response.data;return await n.sendTransaction(a)}async function $c(e,t,r,o){let n=await o.getBalance(e),i=t.value||0,l=!n.sub(Qt(i)).sub(r).isNegative();return{balance:n,hasSufficientFunds:l}}function S2(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!Lw(o))throw new Error(`Transaction request property '${r}' must be a valid number, bigint, or hex string representing a quantity`)}if(typeof e.chainId!="number")throw new Error("Transaction request property 'chainId' must be a number")}function Lw(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&_2(e);return t||r||o}function _2(e){return/^-?0x[a-f0-9]+$/i.test(e)}function Kc(e){return{to:e.to,from:e.from,contractAddress:e.contractAddress,transactionIndex:e.transactionIndex,root:e.root,logsBloom:e.logsBloom,blockHash:e.blockHash,transactionHash:e.transactionHash,logs:e.logs,blockNumber:e.blockNumber,confirmations:e.confirmations,byzantium:e.byzantium,type:e.type,status:e.status,gasUsed:e.gasUsed.toHexString(),cumulativeGasUsed:e.cumulativeGasUsed.toHexString(),effectiveGasPrice:e.effectiveGasPrice?e.effectiveGasPrice.toHexString():void 0}}var ha=require("react");var jc=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=W(),[n,i]=(0,ha.useState)(!0),[a,l]=(0,ha.useState)(void 0),[s,c]=(0,ha.useState)(void 0);return(0,ha.useEffect)(()=>{let u=e.chainId||Uo,y=o.find(v=>v.id===Number(u));if(!y)throw new pe(`Unsupported chain: ${u}`);(async()=>{if(!t){i(!1);return}try{i(!0);let v=await r(y);v?c(v):l(new Error(`Unable to fetch token price on chain id ${y.id}`))}catch(v){l(v)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};var Yc=require("react"),Hp=(0,Yc.createContext)(null);function ya(){let e=(0,Yc.useContext)(Hp);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}var Gp=require("react/jsx-runtime"),vs=({pendingTransaction:e})=>{let{getAccessToken:t}=G(),{wallets:r}=ya(),{walletProxy:o,rpcConfig:n,chains:i,appId:a,nativeTokenSymbolForChainId:l}=W(),[s,c]=(0,oi.useState)(null),[u,y]=(0,oi.useState)(e),{tokenPrice:f}=jc(u),v=l(e.chainId)||"ETH",C=(0,oi.useMemo)(()=>r.find(g=>g.walletClientType==="privy"),[r]);return(0,oi.useEffect)(()=>{async function g(){if(!await t()||!o||!C)return u;let x=Do(u.chainId,i,n,{appId:a}),b=await fa(C.address,u,x),{totalGasEstimate:A}=await ma(b,x);return c(A.toHexString()),b}g().then(y).catch(console.error)},[o]),C?(0,Gp.jsx)(Ow,{children:(0,Gp.jsx)(da,{from:C.address,to:u.to,txn:u,gas:s??void 0,tokenPrice:f,tokenSymbol:v})}):null},Ow=x2.default.div`
2241
+ `;var O2=require("@ethersproject/abstract-signer"),Zw=require("@ethersproject/providers");var Gp=require("@ethersproject/bignumber");var ni=require("@ethersproject/bignumber"),P2=require("@ethersproject/contracts"),_2=require("@ethersproject/transactions");var $w=81457,Kw=168587773,ga=e=>[_l.id,Sl.id,Al.id,kl.id,Rl.id,Il.id,Ml.id,Ll.id,Wl.id,$w,Kw].includes(e),S2=async(e,t)=>{if(!ga(e.chainId))throw new Error("Invalid chain ID for OP Stack gas estimation.");if(e.type===void 0&&(e.type=2),e.maxPriorityFeePerGas&&e.maxFeePerGas||e.gasPrice)return e;try{if(!e.maxPriorityFeePerGas){let r=await t.send("eth_maxPriorityFeePerGas",[]);e.maxPriorityFeePerGas=r}if(e.maxFeePerGas&&(console.warn("maxFeePerGas is specified without maxPriorityFeePerGas - this can result in hung transactions."),e.maxPriorityFeePerGas>=e.maxFeePerGas))throw new Error("Overridden maxFeePerGas is less than or equal to the calculated maxPriorityFeePerGas. Please set both values or maxPriorityFeePerGas alone for correct gas estimation.");if(!e.maxFeePerGas){let{lastBaseFeePerGas:r}=await t.getFeeData();if(!r)throw new Error("Unable to fetch baseFee for last block.");let i=ni.BigNumber.from(r).mul(ni.BigNumber.from(126)).div(ni.BigNumber.from(100)).add(ni.BigNumber.from(e.maxPriorityFeePerGas));e.maxFeePerGas=Ps(i)}}catch(r){throw new Error(`Failed to set gas price for OP stack transaction: ${r}.`)}return e};async function A2(e,t){if(!e.chainId||e.chainId&&!ga(e.chainId))return ni.BigNumber.from(0);let r=ni.BigNumber.from(0);try{let o=new P2.Contract(Sm,Am,t),n=x2(e),i=(0,_2.serialize)(n);r=await o.getL1Fee(i)}catch{}return r}async function k2(e,t){try{return(await t.estimateGas(e)).toHexString()}catch(r){console.warn(`Gas estimation failed with error: ${r}. Retrying gas estimation by omitting the 'from' address`);try{let o={...e,from:void 0};return(await t.estimateGas(o)).toHexString()}catch(o){throw console.warn(`Gas estimation failed with error: ${o} when omitting the 'from' address`),r}}}var R2=async(e,t)=>{if(e.type===void 0&&(e.type=2),e.type===2){if(!e.maxFeePerGas||!e.maxPriorityFeePerGas){let r=await t.getFeeData();e.maxFeePerGas||(e.maxFeePerGas=r.maxFeePerGas?.toHexString()),e.maxPriorityFeePerGas||(e.maxPriorityFeePerGas=r.maxPriorityFeePerGas?.toHexString())}}else if(!e.gasPrice){let r=await t.getFeeData();e.gasPrice=r.gasPrice?.toHexString()}return e};async function va(e,t){if(!e.gasLimit)throw new ct("gasLimit was not successfully set for transaction.");let r=Xt(e.gasLimit),o=Gp.BigNumber.from(0);if(e.type==2)if(e.maxFeePerGas)o=Xt(e.maxFeePerGas);else throw new ct("maxFeePerGas was not successfully set for transaction of type 2.");else if(e.gasPrice)o=Xt(e.gasPrice);else throw new ct("gasPrice was not successfully set for transaction of type 0 or 1.");let n=r.mul(o),i=Gp.BigNumber.from(0);if(e.chainId&&ga(e.chainId))try{i=await A2(e,t),n=n.add(i)}catch{}return{totalGasEstimate:n,l1ExecutionFeeEstimate:i}}var Yc=require("@ethersproject/bignumber");var Vp=e=>[El.id,Tl.id,Pl.id].includes(e),I2=async(e,t)=>{if(!Vp(e.chainId))throw new Error("Invalid chain ID for Arbitrum gas estimation.");if(e.type===void 0&&(e.type=2),e.maxFeePerGas)return e;try{let{lastBaseFeePerGas:r}=await t.getFeeData();if(r){let o=r.mul(Yc.BigNumber.from(120)).div(Yc.BigNumber.from(100));e.maxFeePerGas=Ps(o),e.maxPriorityFeePerGas=Ps(Yc.BigNumber.from(0))}}catch(r){throw new Error(`Failed to set gas price for Arbitrum transaction: ${r}.`)}return e};var zp=e=>[56,97].includes(e),M2=async(e,t)=>{if(!zp(e.chainId))throw new Error("Invalid chain ID for BSC gas estimation.");if(e.type===void 0?e.type=0:(e.type==1||e.type==2)&&console.warn("Transaction request type specified is incompatible for chain and will result in undefined behavior. Please use transaction type 0."),!e.gasPrice){let r=await t.getFeeData();e.gasPrice=r.gasPrice?.toHexString()}return e};var Kp=require("@ethersproject/units"),W2=require("ofetch");var qp={id:80002,name:"Polygon Amoy",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0};var jp=e=>[qa.id,$a.id,qp.id].includes(e),$p=e=>({maxPriorityFee:(0,Kp.parseUnits)(e.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:(0,Kp.parseUnits)(e.maxFee.toFixed(9),"gwei").toHexString()}),jw=e=>({safeLow:$p(e.safeLow),standard:$p(e.standard),fast:$p(e.fast)}),Yw=async e=>{let t="";switch(e){case qa.id:t="https://gasstation.polygon.technology/v2";break;case $a.id:t="https://gasstation-testnet.polygon.technology/v2";break;case qp.id:t="https://gasstation-testnet.polygon.technology/amoy";break;default:throw Error(`chainId ${e} does not support polygon gas stations`)}return jw(await(0,W2.ofetch)(t))};async function L2(e){if(!jp(e.chainId))throw new Error("Invalid chain ID for Polygon gas estimation.");if(e.type===void 0&&(e.type=2),e.maxPriorityFeePerGas&&e.maxFeePerGas)return e;try{let{standard:t}=await Yw(e.chainId);e.maxPriorityFeePerGas||(e.maxPriorityFeePerGas=t.maxPriorityFee),e.maxFeePerGas||(e.maxFeePerGas=t.maxFee)}catch(t){throw new Error(`Failed to set gas prices from Polygon gas station with error: ${t}.`)}return e}function Ps(e){if(typeof e=="number"||typeof e=="bigint"||typeof e=="string")return e;if(typeof e.toHexString=="function")return e.toHexString();throw new Error(`Expected numeric value but received ${e}`)}function x2(e){let t={};return e.to!==void 0&&(t.to=e.to),e.data!==void 0&&(t.data=e.data),e.chainId!==void 0&&(t.chainId=e.chainId),e.type!==void 0&&(t.type=e.type),e.accessList!==void 0&&(t.accessList=e.accessList),e.nonce!==void 0&&(t.nonce=Xt(e.nonce).toNumber()),e.gasLimit!==void 0&&(t.gasLimit=Xt(e.gasLimit)),e.gasPrice!==void 0&&(t.gasPrice=Xt(e.gasPrice)),e.value!==void 0&&(t.value=Xt(e.value)),e.maxFeePerGas!==void 0&&(t.maxFeePerGas=Xt(e.maxFeePerGas)),e.maxPriorityFeePerGas!==void 0&&(t.maxPriorityFeePerGas=Xt(e.maxPriorityFeePerGas)),t}async function Ca(e,t,r){if(t.chainId=Number(t.chainId),N2(t),t.from||(t.from=e),!t.nonce){let o=new O2.VoidSigner(e,r);t.nonce=await o.getTransactionCount("pending")}return t.gasLimit||(t.gas?(t.gasLimit=t.gas,delete t.gas):t.gasLimit=await k2(t,r)),typeof t.type=="string"&&D2(t.type)&&(t.type=Number(t.type)),[23294,23295].includes(t.chainId)&&(t.type=0),jp(t.chainId)?t=await L2(t):Vp(t.chainId)?t=await I2(t,r):ga(t.chainId)?t=await S2(t,r):zp(t.chainId)?t=await M2(t,r):t=await R2(t,r),t.type===0&&delete t.accessList,t.type!==2&&(delete t.maxPriorityFeePerGas,delete t.maxFeePerGas),t}async function Zc(e,t,r,o,n){o=Object.assign({chainId:Bo},o),N2(o);let a=(await r.rpc({address:t,accessToken:e,request:{method:"eth_signTransaction",params:[o]}})).response.data;return await n.sendTransaction(a)}async function Jc(e,t,r,o){let n=await o.getBalance(e),i=t.value||0,s=!n.sub(Xt(i)).sub(r).isNegative();return{balance:n,hasSufficientFunds:s}}function N2(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!Jw(o))throw new Error(`Transaction request property '${r}' must be a valid number, bigint, or hex string representing a quantity`)}if(typeof e.chainId!="number")throw new Error("Transaction request property 'chainId' must be a number")}function Jw(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&D2(e);return t||r||o}function D2(e){return/^-?0x[a-f0-9]+$/i.test(e)}function Qc(e){return{to:e.to,from:e.from,contractAddress:e.contractAddress,transactionIndex:e.transactionIndex,root:e.root,logsBloom:e.logsBloom,blockHash:e.blockHash,transactionHash:e.transactionHash,logs:e.logs,blockNumber:e.blockNumber,confirmations:e.confirmations,byzantium:e.byzantium,type:e.type,status:e.status,gasUsed:e.gasUsed.toHexString(),cumulativeGasUsed:e.cumulativeGasUsed.toHexString(),effectiveGasPrice:e.effectiveGasPrice?e.effectiveGasPrice.toHexString():void 0}}var wa=require("react");var Xc=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=W(),[n,i]=(0,wa.useState)(!0),[a,s]=(0,wa.useState)(void 0),[l,c]=(0,wa.useState)(void 0);return(0,wa.useEffect)(()=>{let u=e.chainId||Bo,f=o.find(v=>v.id===Number(u));if(!f)throw new fe(`Unsupported chain: ${u}`);(async()=>{if(!t){i(!1);return}try{i(!0);let v=await r(f);v?c(v):s(new Error(`Unable to fetch token price on chain id ${f.id}`))}catch(v){s(v)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:l,isTokenPriceLoading:n,tokenPriceError:a}};var ed=require("react"),Yp=(0,ed.createContext)(null);function ba(){let e=(0,ed.useContext)(Yp);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}var Zp=require("react/jsx-runtime"),_s=({pendingTransaction:e})=>{let{getAccessToken:t}=H(),{wallets:r}=ba(),{walletProxy:o,rpcConfig:n,chains:i,appId:a,nativeTokenSymbolForChainId:s}=W(),[l,c]=(0,ii.useState)(null),[u,f]=(0,ii.useState)(e),{tokenPrice:h}=Xc(u),v=s(e.chainId)||"ETH",C=(0,ii.useMemo)(()=>r.find(g=>g.walletClientType==="privy"),[r]);return(0,ii.useEffect)(()=>{async function g(){if(!await t()||!o||!C)return u;let S=Fo(u.chainId,i,n,{appId:a}),E=await Ca(C.address,u,S),{totalGasEstimate:x}=await va(E,S);return c(x.toHexString()),E}g().then(f).catch(console.error)},[o]),C?(0,Zp.jsx)(Qw,{children:(0,Zp.jsx)(ha,{from:C.address,to:u.to,txn:u,gas:l??void 0,tokenPrice:h,tokenSymbol:v})}):null},Qw=U2.default.div`
2219
2242
  width: 100%;
2220
2243
  padding: 1rem 0;
2221
- `;var A2=h(require("@heroicons/react/24/outline/CalendarIcon")),k2=h(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),R2=h(require("@heroicons/react/24/outline/ShieldCheckIcon"));var Ke=require("react/jsx-runtime"),I2=({hasBlockingError:e,error:t,onClose:r,onBack:o,handleSubmit:n,account:i,submitSuccess:a})=>{let{pendingTransaction:l}=W();return(0,Ke.jsxs)(Ke.Fragment,{children:[(0,Ke.jsx)(S,{onClose:r},"header"),(0,Ke.jsx)(Mt,{children:(0,Ke.jsxs)("div",{children:[(0,Ke.jsx)(At,{success:a,fail:!!t}),t?(0,Ke.jsx)(k2.default,{style:{width:"38px",height:"38px"}}):(0,Ke.jsx)(Qn,{style:{width:"38px",height:"38px"}})]})}),(0,Ke.jsx)(ge,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),(0,Ke.jsxs)(Kn,{children:[(0,Ke.jsxs)(fr,{children:[(0,Ke.jsx)(mr,{children:(0,Ke.jsx)(R2.default,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),(0,Ke.jsxs)(fr,{children:[(0,Ke.jsx)(mr,{children:(0,Ke.jsx)(A2.default,{})}),"You last added a passkey on"," ",i?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),l&&(0,Ke.jsx)(Gr,{children:(0,Ke.jsx)(vs,{pendingTransaction:l})}),t&&(0,Ke.jsxs)(Ke.Fragment,{children:[(0,Ke.jsx)(Ql,{style:{marginTop:"1.25rem"},children:t.message}),(0,Ke.jsx)(D,{disabled:e,onClick:n,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&(0,Ke.jsx)(Ga,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),(0,Ke.jsx)(q,{})]})};var Q=require("react/jsx-runtime"),Vp=({open:e,onClose:t})=>{let{user:r}=G(),[o,n]=(0,xn.useState)(null),{init:i,cancel:a,submit:l}=la(),[s,c]=(0,xn.useState)(!1),[u,y]=(0,xn.useState)(!1),[f,v]=(0,xn.useState)(null),[C,g]=(0,xn.useState)(null);(0,xn.useEffect)(()=>{e&&r?.mfaMethods&&r.mfaMethods.length>0?b(r.mfaMethods[0]):n(null)},[r?.mfaMethods,e]);let _=U=>oc(U)?(c(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):hn(U)?(c(!1),new Error("The code you entered is not valid")):fn(U)?(c(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(U),c(!1),new Error("Something went wrong."));async function x(U){g(null);try{if(!U||!o)return;await l(o,U),y(!0),c(!1),t()}catch(M){throw _(M)}}async function b(U){if(U==="passkey"){try{n(U);let M=await i(U);if(!M)throw new Error("something went wrong");v(M),await l(U,M),y(!0),c(!1),t()}catch(M){g(_(M))}return}try{n(U),await i(U)}catch(M){console.error(M)}}let A=()=>{n(null),g(null),a(),t()},R=()=>{n(null),g(null)};if(!e||!r)return null;if(o==="passkey"){let U=r.linkedAccounts.filter(M=>M.type==="passkey"&&M.enrolledInMfa).sort((M,I)=>I.firstVerifiedAt.valueOf()-M.firstVerifiedAt.valueOf())[0];return(0,Q.jsx)(I2,{account:U,selectedMethod:o,submitSuccess:u,hasBlockingError:s,error:C,onClose:A,onBack:R,handleSubmit:()=>x(f).catch(g)})}return o?(0,Q.jsx)(Nw,{submitSuccess:u,hasBlockingError:s,handleSubmitCode:x,selectedMethod:o,onClose:A,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(S,{onClose:A},"header"),(0,Q.jsx)(Ge,{children:(0,Q.jsx)(at,{children:(0,Q.jsx)(O2.default,{})})}),(0,Q.jsx)(ge,{children:"Verify your identity"}),(0,Q.jsx)(Ce,{children:"Choose a verification method"}),(0,Q.jsxs)(Kl,{children:[r.mfaMethods.includes("totp")&&(0,Q.jsxs)(De,{onClick:()=>b("totp"),children:[(0,Q.jsx)(M2.default,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&(0,Q.jsxs)(De,{onClick:()=>b("sms"),children:[(0,Q.jsx)(L2.default,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&(0,Q.jsxs)(De,{onClick:()=>b("passkey"),children:[(0,Q.jsx)(W2.default,{}),"Passkey"]},"passkey")]}),(0,Q.jsx)(q,{})]})},Nw=({selectedMethod:e,submitSuccess:t,hasBlockingError:r,onClose:o,onBack:n,handleSubmitCode:i})=>{let{app:a}=k(),{pendingTransaction:l}=W();switch(e){case"sms":return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(S,{onClose:o},"header"),(0,Q.jsx)(Ge,{children:(0,Q.jsx)(at,{children:(0,Q.jsx)(D2.default,{})})}),(0,Q.jsx)(ge,{children:"Enter verification code"}),(0,Q.jsxs)(Gr,{children:[(0,Q.jsx)(ei,{success:t,disabled:r,onChange:i}),(0,Q.jsxs)(Ce,{children:["To continue, please enter the 6-digit code sent to your ",(0,Q.jsx)("strong",{children:"mobile device"})]}),l&&(0,Q.jsx)(vs,{pendingTransaction:l})]}),n&&(0,Q.jsx)(Ga,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),(0,Q.jsx)(no,{onClick:o,children:"Not now"}),(0,Q.jsx)(q,{})]});case"totp":return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(S,{onClose:o},"header"),(0,Q.jsx)(Ge,{children:(0,Q.jsx)(at,{children:(0,Q.jsx)(N2.default,{})})}),(0,Q.jsx)(ge,{children:"Enter verification code"}),(0,Q.jsxs)(Gr,{children:[(0,Q.jsx)(ei,{success:t,disabled:r,onChange:i}),(0,Q.jsxs)(Ce,{children:["To continue, please enter the 6-digit code generated from your"," ",(0,Q.jsx)("strong",{children:"authenticator app"})]}),l&&(0,Q.jsx)(vs,{pendingTransaction:l})]}),n&&(0,Q.jsx)(Ga,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),(0,Q.jsx)(no,{onClick:o,children:"Not now"}),(0,Q.jsx)(q,{})]});default:return null}};var ga=require("react"),U2=h(require("styled-components"));var Dt=require("react/jsx-runtime"),F2=()=>{let{authenticated:e,logout:t,ready:r,user:o}=G(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=k(),{getAuthMeta:s,initLoginWithOAuth:c,loginWithOAuth:u,updateWallets:y,setReadyToTrue:f,closePrivyModal:v,createAnalyticsEvent:C}=W(),[g,_]=(0,ga.useState)(!1),[x,b]=(0,ga.useState)(void 0),A=s()?.provider||"google",{name:R,component:U}=Ma(A),M=Fl(),I=it;(0,ga.useEffect)(()=>{u(A).then(te=>{_(!0),f(!0),te&&M("login","onOAuthLoginComplete",te)}).catch(te=>{if(te?.privyErrorCode==="allowlist_rejected"){b(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(te?.privyErrorCode==="max_accounts_reached"){console.error(new Ur(te).toString()),b(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}let{retryable:L,detail:z}=Sm(te,A);b({retryable:L,detail:z,message:"Authentication failed"}),f(!1)}).finally(()=>{Hn()})},[R,A]),(0,ga.useEffect)(()=>{if(r&&e&&g&&o){if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let L=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},I);return()=>clearTimeout(L)}if(pr(o,n?.embeddedWallets?.createOnLogin)){let L=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:z=>{console.error(z),C({eventName:"embedded_wallet_creation_failure_logout",payload:{error:z,provider:A,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},I);return()=>clearTimeout(L)}else{let L=setTimeout(()=>v({shouldCallAuthOnSuccess:!0,isSuccess:!0}),I);return y(),()=>clearTimeout(L)}}},[r,e,g,o]);let V=g?`Successfully connected with ${R}`:x?x.message:`Verifying connection to ${R}`,j="";return g?j="You\u2019re good to go!":x?j=x.detail:j="Just a few moments more",(0,Dt.jsxs)(Dt.Fragment,{children:[(0,Dt.jsx)(S,{}),(0,Dt.jsx)(ae,{}),(0,Dt.jsxs)(Dw,{children:[(0,Dt.jsx)(Mt,{children:(0,Dt.jsxs)("div",{children:[(0,Dt.jsx)(At,{success:g,fail:!!x}),(0,Dt.jsx)(U,{style:{width:"38px",height:"38px"}})]})}),(0,Dt.jsxs)(wt,{children:[(0,Dt.jsx)("h3",{children:V}),(0,Dt.jsx)("p",{children:j})]}),x&&x?.retryable?(0,Dt.jsx)(Wi,{onClick:()=>{Hn(),c(A),b(void 0)},disabled:!g&&!x?.retryable,children:"Retry"}):null]}),(0,Dt.jsx)(me,{}),(0,Dt.jsx)(q,{})]})},Dw=U2.default.div`
2244
+ `;var F2=y(require("@heroicons/react/24/outline/CalendarIcon")),B2=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),H2=y(require("@heroicons/react/24/outline/ShieldCheckIcon"));var Ke=require("react/jsx-runtime"),G2=({hasBlockingError:e,error:t,onClose:r,onBack:o,handleSubmit:n,account:i,submitSuccess:a})=>{let{pendingTransaction:s}=W();return(0,Ke.jsxs)(Ke.Fragment,{children:[(0,Ke.jsx)(A,{onClose:r},"header"),(0,Ke.jsx)(Et,{children:(0,Ke.jsxs)("div",{children:[(0,Ke.jsx)(wt,{success:a,fail:!!t}),t?(0,Ke.jsx)(B2.default,{style:{width:"38px",height:"38px"}}):(0,Ke.jsx)(ei,{style:{width:"38px",height:"38px"}})]})}),(0,Ke.jsx)(ve,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),(0,Ke.jsxs)(Yn,{children:[(0,Ke.jsxs)(hr,{children:[(0,Ke.jsx)(fr,{children:(0,Ke.jsx)(H2.default,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),(0,Ke.jsxs)(hr,{children:[(0,Ke.jsx)(fr,{children:(0,Ke.jsx)(F2.default,{})}),"You last added a passkey on"," ",i?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),s&&(0,Ke.jsx)(Gr,{children:(0,Ke.jsx)(_s,{pendingTransaction:s})}),t&&(0,Ke.jsxs)(Ke.Fragment,{children:[(0,Ke.jsx)(oc,{style:{marginTop:"1.25rem"},children:t.message}),(0,Ke.jsx)(U,{disabled:e,onClick:n,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&(0,Ke.jsx)(Ya,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),(0,Ke.jsx)($,{})]})};var X=require("react/jsx-runtime"),Jp=({open:e,onClose:t})=>{let{user:r}=H(),[o,n]=(0,xn.useState)(null),{init:i,cancel:a,submit:s}=ma(),[l,c]=(0,xn.useState)(!1),[u,f]=(0,xn.useState)(!1),[h,v]=(0,xn.useState)(null),[C,g]=(0,xn.useState)(null);(0,xn.useEffect)(()=>{e&&r?.mfaMethods&&r.mfaMethods.length>0?E(r.mfaMethods[0]):n(null)},[r?.mfaMethods,e]);let P=D=>lc(D)?(c(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):yn(D)?(c(!1),new Error("The code you entered is not valid")):hn(D)?(c(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(D),c(!1),new Error("Something went wrong."));async function S(D){g(null);try{if(!D||!o)return;await s(o,D),f(!0),c(!1),t()}catch(I){throw P(I)}}async function E(D){if(D==="passkey"){try{n(D);let I=await i(D);if(!I)throw new Error("something went wrong");v(I),await s(D,I),f(!0),c(!1),t()}catch(I){g(P(I))}return}try{n(D),await i(D)}catch(I){console.error(I)}}let x=()=>{n(null),g(null),a(),t()},R=()=>{n(null),g(null)};if(!e||!r)return null;if(o==="passkey"){let D=r.linkedAccounts.filter(I=>I.type==="passkey"&&I.enrolledInMfa).sort((I,M)=>M.firstVerifiedAt.valueOf()-I.firstVerifiedAt.valueOf())[0];return(0,X.jsx)(G2,{account:D,selectedMethod:o,submitSuccess:u,hasBlockingError:l,error:C,onClose:x,onBack:R,handleSubmit:()=>S(h).catch(g)})}return o?(0,X.jsx)(Xw,{submitSuccess:u,hasBlockingError:l,handleSubmitCode:S,selectedMethod:o,onClose:x,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A,{onClose:x},"header"),(0,X.jsx)(Ge,{children:(0,X.jsx)(st,{children:(0,X.jsx)($2.default,{})})}),(0,X.jsx)(ve,{children:"Verify your identity"}),(0,X.jsx)(we,{children:"Choose a verification method"}),(0,X.jsxs)(Ql,{children:[r.mfaMethods.includes("totp")&&(0,X.jsxs)(De,{onClick:()=>E("totp"),children:[(0,X.jsx)(V2.default,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&(0,X.jsxs)(De,{onClick:()=>E("sms"),children:[(0,X.jsx)(q2.default,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&(0,X.jsxs)(De,{onClick:()=>E("passkey"),children:[(0,X.jsx)(z2.default,{}),"Passkey"]},"passkey")]}),(0,X.jsx)($,{})]})},Xw=({selectedMethod:e,submitSuccess:t,hasBlockingError:r,onClose:o,onBack:n,handleSubmitCode:i})=>{let{app:a}=k(),{pendingTransaction:s}=W();switch(e){case"sms":return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A,{onClose:o},"header"),(0,X.jsx)(Ge,{children:(0,X.jsx)(st,{children:(0,X.jsx)(j2.default,{})})}),(0,X.jsx)(ve,{children:"Enter verification code"}),(0,X.jsxs)(Gr,{children:[(0,X.jsx)(ri,{success:t,disabled:r,onChange:i}),(0,X.jsxs)(we,{children:["To continue, please enter the 6-digit code sent to your ",(0,X.jsx)("strong",{children:"mobile device"})]}),s&&(0,X.jsx)(_s,{pendingTransaction:s})]}),n&&(0,X.jsx)(Ya,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),(0,X.jsx)(ao,{onClick:o,children:"Not now"}),(0,X.jsx)($,{})]});case"totp":return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A,{onClose:o},"header"),(0,X.jsx)(Ge,{children:(0,X.jsx)(st,{children:(0,X.jsx)(K2.default,{})})}),(0,X.jsx)(ve,{children:"Enter verification code"}),(0,X.jsxs)(Gr,{children:[(0,X.jsx)(ri,{success:t,disabled:r,onChange:i}),(0,X.jsxs)(we,{children:["To continue, please enter the 6-digit code generated from your"," ",(0,X.jsx)("strong",{children:"authenticator app"})]}),s&&(0,X.jsx)(_s,{pendingTransaction:s})]}),n&&(0,X.jsx)(Ya,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),(0,X.jsx)(ao,{onClick:o,children:"Not now"}),(0,X.jsx)($,{})]});default:return null}};var Ea=require("react"),Y2=y(require("styled-components"));var Ut=require("react/jsx-runtime"),Z2=()=>{let{authenticated:e,logout:t,ready:r,user:o}=H(),{app:n,setModalData:i,navigate:a,resetNavigation:s}=k(),{getAuthMeta:l,initLoginWithOAuth:c,loginWithOAuth:u,updateWallets:f,setReadyToTrue:h,closePrivyModal:v,createAnalyticsEvent:C}=W(),[g,P]=(0,Ea.useState)(!1),[S,E]=(0,Ea.useState)(void 0),x=l()?.provider||"google",{name:R,component:D}=Ua(x),I=ql(),M=et;(0,Ea.useEffect)(()=>{u(x).then(re=>{P(!0),h(!0),re&&I("login","onOAuthLoginComplete",re)}).catch(re=>{if(re?.privyErrorCode==="allowlist_rejected"){E(void 0),s(),a("ALLOWLIST_REJECTION_SCREEN");return}if(re?.privyErrorCode==="max_accounts_reached"){console.error(new Fr(re).toString()),E(void 0),s(),a("USER_LIMIT_REACHED_SCREEN");return}let{retryable:L,detail:K}=Mm(re,x);E({retryable:L,detail:K,message:"Authentication failed"}),h(!1)}).finally(()=>{Vn()})},[R,x]),(0,Ea.useEffect)(()=>{if(r&&e&&g&&o){if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let L=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},M);return()=>clearTimeout(L)}if(mr(o,n?.embeddedWallets?.createOnLogin)){let L=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:K=>{console.error(K),C({eventName:"embedded_wallet_creation_failure_logout",payload:{error:K,provider:x,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},M);return()=>clearTimeout(L)}else{let L=setTimeout(()=>v({shouldCallAuthOnSuccess:!0,isSuccess:!0}),M);return f(),()=>clearTimeout(L)}}},[r,e,g,o]);let V=g?`Successfully connected with ${R}`:S?S.message:`Verifying connection to ${R}`,z="";return g?z="You\u2019re good to go!":S?z=S.detail:z="Just a few moments more",(0,Ut.jsxs)(Ut.Fragment,{children:[(0,Ut.jsx)(A,{}),(0,Ut.jsx)(ae,{}),(0,Ut.jsxs)(e5,{children:[(0,Ut.jsx)(Et,{children:(0,Ut.jsxs)("div",{children:[(0,Ut.jsx)(wt,{success:g,fail:!!S}),(0,Ut.jsx)(D,{style:{width:"38px",height:"38px"}})]})}),(0,Ut.jsxs)(dt,{children:[(0,Ut.jsx)("h3",{children:V}),(0,Ut.jsx)("p",{children:z})]}),S&&S?.retryable?(0,Ut.jsx)(Di,{onClick:()=>{Vn(),c(x),E(void 0)},disabled:!g&&!S?.retryable,children:"Retry"}):null]}),(0,Ut.jsx)(pe,{}),(0,Ut.jsx)($,{})]})},e5=Y2.default.div`
2222
2245
  display: flex;
2223
2246
  flex-direction: column;
2224
2247
  align-items: center;
@@ -2226,17 +2249,17 @@ You will need this password to access your ${e} wallet on a new device. Please k
2226
2249
  margin-left: 27px;
2227
2250
  margin-right: 27px;
2228
2251
  gap: 24px;
2229
- `;var Qo=require("react"),zp=h(require("styled-components"));var zt=require("react/jsx-runtime"),B2=()=>{let{lastScreen:e,currentScreen:t,navigateBack:r}=k(),{loginWithPasskey:o,closePrivyModal:n}=W(),i=it,[a,l]=(0,Qo.useState)("loading"),[s,c]=(0,Qo.useState)(null),u=(0,Qo.useRef)([]),y=_=>{u.current=[_,...u.current]};(0,Qo.useEffect)(()=>()=>{u.current.forEach(_=>clearTimeout(_)),u.current=[]},[]);let f=()=>{switch(a){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}},v=()=>{switch(a){case"loading":return`Please follow prompts to verify your passkey.
2230
- You will have to sign up with another method first to register a passkey for your account.`;case"success":return"You've successfully logged in with your passkey.";case"error":if(s instanceof ut){if(s.privyErrorCode==="cannot_link_more_of_type")return"Cannot link more passkeys to account.";if(s.privyErrorCode==="passkey_not_allowed")return`Passkey request timed out or rejected by user.
2252
+ `;var Xo=require("react"),Qp=y(require("styled-components"));var $t=require("react/jsx-runtime"),J2=()=>{let{lastScreen:e,currentScreen:t,navigateBack:r}=k(),{loginWithPasskey:o,closePrivyModal:n}=W(),i=et,[a,s]=(0,Xo.useState)("loading"),[l,c]=(0,Xo.useState)(null),u=(0,Xo.useRef)([]),f=P=>{u.current=[P,...u.current]};(0,Xo.useEffect)(()=>()=>{u.current.forEach(P=>clearTimeout(P)),u.current=[]},[]);let h=()=>{switch(a){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}},v=()=>{switch(a){case"loading":return`Please follow prompts to verify your passkey.
2253
+ You will have to sign up with another method first to register a passkey for your account.`;case"success":return"You've successfully logged in with your passkey.";case"error":if(l instanceof mt){if(l.privyErrorCode==="cannot_link_more_of_type")return"Cannot link more passkeys to account.";if(l.privyErrorCode==="passkey_not_allowed")return`Passkey request timed out or rejected by user.
2231
2254
  You will have to sign up with another method first to register a passkey for your account.`}return`An unknown error occurred.
2232
- You will have to sign up with another method first to register a passkey for your account.`}},C=()=>{switch(a){case"loading":case"success":return(0,zt.jsx)(D,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return(0,zt.jsx)(D,{onClick:g,disabled:!1,children:"Retry"})}},g=async()=>{l("loading");try{await o(),l("success")}catch(_){c(_),l("error")}};return(0,Qo.useEffect)(()=>{a==="success"&&y(setTimeout(()=>{n({shouldCallAuthOnSuccess:!0,isSuccess:!0})},i))},[a]),(0,Qo.useEffect)(()=>{g()},[]),(0,zt.jsxs)(zt.Fragment,{children:[(0,zt.jsx)(S,{backFn:!e||t===e?void 0:r}),(0,zt.jsxs)(Uw,{children:[(0,zt.jsx)(Mt,{children:(0,zt.jsxs)("div",{children:[(0,zt.jsx)(At,{success:a==="success",fail:a==="error"}),(0,zt.jsx)(Xn,{style:{width:"38px",height:"38px"}})]})}),(0,zt.jsxs)(wt,{children:[(0,zt.jsx)("h3",{children:f()}),(0,zt.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:v()})]}),C()]}),(0,zt.jsx)(q,{})]})},Uw=zp.default.div`
2255
+ You will have to sign up with another method first to register a passkey for your account.`}},C=()=>{switch(a){case"loading":case"success":return(0,$t.jsx)(U,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return(0,$t.jsx)(U,{onClick:g,disabled:!1,children:"Retry"})}},g=async()=>{s("loading");try{await o(),s("success")}catch(P){c(P),s("error")}};return(0,Xo.useEffect)(()=>{a==="success"&&f(setTimeout(()=>{n({shouldCallAuthOnSuccess:!0,isSuccess:!0})},i))},[a]),(0,Xo.useEffect)(()=>{g()},[]),(0,$t.jsxs)($t.Fragment,{children:[(0,$t.jsx)(A,{backFn:!e||t===e?void 0:r}),(0,$t.jsxs)(t5,{children:[(0,$t.jsx)(Et,{children:(0,$t.jsxs)("div",{children:[(0,$t.jsx)(wt,{success:a==="success",fail:a==="error"}),(0,$t.jsx)(ti,{style:{width:"38px",height:"38px"}})]})}),(0,$t.jsxs)(dt,{children:[(0,$t.jsx)("h3",{children:h()}),(0,$t.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:v()})]}),C()]}),(0,$t.jsx)($,{})]})},t5=Qp.default.div`
2233
2256
  display: flex;
2234
2257
  flex-direction: column;
2235
2258
  align-items: center;
2236
2259
  justify-content: center;
2237
2260
  gap: 24px;
2238
2261
  width: 100%;
2239
- `,IO=zp.default.div`
2262
+ `,lN=Qp.default.div`
2240
2263
  display: flex;
2241
2264
  align-items: center;
2242
2265
  justify-content: center;
@@ -2252,9 +2275,9 @@ You will have to sign up with another method first to register a passkey for you
2252
2275
  stroke: var(--privy-color-accent) !important;
2253
2276
  fill: var(--privy-color-accent) !important;
2254
2277
  }
2255
- `;var Cs=require("react"),V2=h(require("styled-components"));var H2=require("react-device-detect");var G2=(e,t)=>{let r=new URL(window.location.href),o=encodeURIComponent(r.href.replace(/\/$/g,"")+`?privy_token=${e}&privy_connector=injected&privy_wallet_client=phantom`);if(!an()&&H2.isMobile)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};var ir=require("react/jsx-runtime"),z2=()=>{let{forkSession:e,ready:t,authenticated:r}=G(),[o,n]=(0,Cs.useState)(""),[i,a]=(0,Cs.useState)(!1);(0,Cs.useEffect)(()=>{t&&r&&e().then(n)},[t,r]);let l=G2(o,!i),s={title:"Redirecting to Phantom Mobile Wallet",description:"We'll take you to the Phantom Mobile Wallet app to continue your login experience.",footnote:""};return t&&(s.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",s.footnote="Once you're done, you can always return here and refresh to view your updated account."),i&&(s.title="Still here?",s.description="You may need to install the Phantom mobile app.",s.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),(0,ir.jsxs)(ir.Fragment,{children:[(0,ir.jsx)(S,{},"header"),(0,ir.jsx)(ae,{}),(0,ir.jsx)(Po,{title:s.title,description:s.description}),(0,ir.jsxs)(Vr,{children:[(0,ir.jsx)(Fw,{children:(0,ir.jsx)(wo,{style:{width:"72px",height:"72px"}})}),(0,ir.jsx)(Vl,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?(0,ir.jsx)("p",{children:s.footnote}):null]}),(0,ir.jsx)(me,{}),(0,ir.jsx)(K,{protectedByPrivy:!0})]})},Fw=(0,V2.default)(or)`
2278
+ `;var Ss=require("react"),e3=y(require("styled-components"));var Q2=require("react-device-detect");var X2=(e,t)=>{let r=new URL(window.location.href),o=encodeURIComponent(r.href.replace(/\/$/g,"")+`?privy_token=${e}&privy_connector=injected&privy_wallet_client=phantom`);if(!sn()&&Q2.isMobile)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};var ar=require("react/jsx-runtime"),t3=()=>{let{forkSession:e,ready:t,authenticated:r}=H(),[o,n]=(0,Ss.useState)(""),[i,a]=(0,Ss.useState)(!1);(0,Ss.useEffect)(()=>{t&&r&&e().then(n)},[t,r]);let s=X2(o,!i),l={title:"Redirecting to Phantom Mobile Wallet",description:"We'll take you to the Phantom Mobile Wallet app to continue your login experience.",footnote:""};return t&&(l.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",l.footnote="Once you're done, you can always return here and refresh to view your updated account."),i&&(l.title="Still here?",l.description="You may need to install the Phantom mobile app.",l.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),(0,ar.jsxs)(ar.Fragment,{children:[(0,ar.jsx)(A,{},"header"),(0,ar.jsx)(ae,{}),(0,ar.jsx)(_o,{title:l.title,description:l.description}),(0,ar.jsxs)(Vr,{children:[(0,ar.jsx)(r5,{children:(0,ar.jsx)(bo,{style:{width:"72px",height:"72px"}})}),(0,ar.jsx)(jl,{href:s,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!s,children:i?"Go to App Store":"Continue"}),l.footnote?(0,ar.jsx)("p",{children:l.footnote}):null]}),(0,ar.jsx)(pe,{}),(0,ar.jsx)(j,{protectedByPrivy:!0})]})},r5=(0,e3.default)(nr)`
2256
2279
  margin: 16px auto;
2257
- `;var q2=h(require("@heroicons/react/24/outline/ShieldCheckIcon")),ni=require("react"),ii=h(require("styled-components"));var Qe=require("react/jsx-runtime"),$2=()=>{let[e,t]=(0,ni.useState)(!0),{authenticated:r,getAccessToken:o}=G(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=W(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=k(),[u,y]=(0,ni.useState)(void 0),[f,v]=(0,ni.useState)(""),[C,g]=(0,ni.useState)(!1),{privyWallet:_,onCompleteNavigateTo:x,onSuccess:b,onFailure:A}=s.recoverWallet,R=(I="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),A(typeof I=="string"?new tr(I):I)};c.current=R,(0,ni.useEffect)(()=>{if(!r||!_)return R("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let U=I=>{I&&y(I)};return(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(S,{onClose:R}),(0,Qe.jsx)(ae,{}),(0,Qe.jsxs)(Hw,{children:[(0,Qe.jsxs)(Bw,{children:[(0,Qe.jsx)(q2.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,Qe.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),(0,Qe.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),(0,Qe.jsxs)("div",{children:[(0,Qe.jsxs)(vn,{children:[(0,Qe.jsx)(Ki,{type:e?"password":"text",onChange:I=>U(I.target.value),disabled:C,style:{paddingRight:"2.3rem"}}),(0,Qe.jsx)(ji,{style:{right:"0.75rem"},children:e?(0,Qe.jsx)(Yi,{onClick:()=>t(!1)}):(0,Qe.jsx)(Zi,{onClick:()=>t(!0)})})]}),!!f&&(0,Qe.jsx)(Gw,{children:f})]}),(0,Qe.jsxs)("div",{children:[(0,Qe.jsxs)(zf,{children:[(0,Qe.jsx)("h4",{children:"Why is this necessary?"}),(0,Qe.jsx)("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),(0,Qe.jsx)(Vw,{loading:C||!n,disabled:!u,onClick:async()=>{g(!0);let I=await o();if(I&&_&&u!==null)try{a({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:_.address}}),await n?.recover({address:_.address,accessToken:I,recoveryPin:u,recoveryMethod:_.recoveryMethod}),v(""),x?l(x):i({shouldCallAuthOnSuccess:!1}),b?.(_),a({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:_.address}})}catch(V){Rh(V)?v("Invalid recovery password, please try again."):v("An error has occurred, please try again.")}finally{g(!1)}else return R("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!_&&C,children:"Recover your account"})]})]}),(0,Qe.jsx)(me,{}),(0,Qe.jsx)(K,{protectedByPrivy:!0})]})},Bw=ii.default.div`
2280
+ `;var r3=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),ai=require("react"),si=y(require("styled-components"));var Qe=require("react/jsx-runtime"),o3=()=>{let[e,t]=(0,ai.useState)(!0),{authenticated:r,getAccessToken:o}=H(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=W(),{navigate:s,data:l,onUserCloseViaDialogOrKeybindRef:c}=k(),[u,f]=(0,ai.useState)(void 0),[h,v]=(0,ai.useState)(""),[C,g]=(0,ai.useState)(!1),{privyWallet:P,onCompleteNavigateTo:S,onSuccess:E,onFailure:x}=l.recoverWallet,R=(M="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),x(typeof M=="string"?new rr(M):M)};c.current=R,(0,ai.useEffect)(()=>{if(!r||!P)return R("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let D=M=>{M&&f(M)};return(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(A,{onClose:R}),(0,Qe.jsx)(ae,{}),(0,Qe.jsxs)(n5,{children:[(0,Qe.jsxs)(o5,{children:[(0,Qe.jsx)(r3.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,Qe.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),(0,Qe.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),(0,Qe.jsxs)("div",{children:[(0,Qe.jsxs)(Cn,{children:[(0,Qe.jsx)(Qi,{type:e?"password":"text",onChange:M=>D(M.target.value),disabled:C,style:{paddingRight:"2.3rem"}}),(0,Qe.jsx)(Xi,{style:{right:"0.75rem"},children:e?(0,Qe.jsx)(ea,{onClick:()=>t(!1)}):(0,Qe.jsx)(ta,{onClick:()=>t(!0)})})]}),!!h&&(0,Qe.jsx)(i5,{children:h})]}),(0,Qe.jsxs)("div",{children:[(0,Qe.jsxs)(Qf,{children:[(0,Qe.jsx)("h4",{children:"Why is this necessary?"}),(0,Qe.jsx)("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),(0,Qe.jsx)(a5,{loading:C||!n,disabled:!u,onClick:async()=>{g(!0);let M=await o();if(M&&P&&u!==null)try{a({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:P.address}}),await n?.recover({address:P.address,accessToken:M,recoveryPin:u,recoveryMethod:P.recoveryMethod}),v(""),S?s(S):i({shouldCallAuthOnSuccess:!1}),E?.(P),a({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:P.address}})}catch(V){Hh(V)?v("Invalid recovery password, please try again."):v("An error has occurred, please try again.")}finally{g(!1)}else return R("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!P&&C,children:"Recover your account"})]})]}),(0,Qe.jsx)(pe,{}),(0,Qe.jsx)(j,{protectedByPrivy:!0})]})},o5=si.default.div`
2258
2281
  display: flex;
2259
2282
  flex-direction: column;
2260
2283
  align-items: center;
@@ -2276,45 +2299,45 @@ You will have to sign up with another method first to register a passkey for you
2276
2299
  font-weight: 400;
2277
2300
  line-height: 20px;
2278
2301
  }
2279
- `,Hw=ii.default.div`
2302
+ `,n5=si.default.div`
2280
2303
  display: flex;
2281
2304
  flex-direction: column;
2282
2305
  justify-content: space-between;
2283
- `,Gw=ii.default.div`
2306
+ `,i5=si.default.div`
2284
2307
  line-height: 20px;
2285
2308
  height: 20px;
2286
2309
  font-size: 13px;
2287
2310
  color: var(--privy-color-error);
2288
2311
  text-align: left;
2289
2312
  margin-top: 0.5rem;
2290
- `,Vw=(0,ii.default)(D)`
2291
- ${e=>e.hideAnimations&&ii.css`
2313
+ `,a5=(0,si.default)(U)`
2314
+ ${e=>e.hideAnimations&&si.css`
2292
2315
  && {
2293
2316
  // Remove animations because the recoverWallet task on the iframe partially
2294
2317
  // blocks the renderer, so the animation stutters and doesn't look good
2295
2318
  transition: none;
2296
2319
  }
2297
2320
  `}
2298
- `;var Xo=require("react");var An=require("react/jsx-runtime"),Zc=e=>(0,An.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...e,children:[(0,An.jsx)("path",{fill:"url(#icloud-gradient)",d:"M12.34 7.315a4.26 4.26 0 0 0-3.707 2.18 2.336 2.336 0 0 0-1.02-.236 2.336 2.336 0 0 0-2.3 1.963 3.217 3.217 0 0 0 1.244 6.181c.135-.001.27-.01.404-.029h8.943c.047.004.094.006.141.007.045-.001.09-.004.135-.007h.214v-.016a2.99 2.99 0 0 0 1.887-.988c.487-.55.757-1.261.757-1.998v-.006a3.017 3.017 0 0 0-.69-1.915 2.992 2.992 0 0 0-1.748-1.034 4.26 4.26 0 0 0-4.26-4.102Z"}),(0,An.jsx)("defs",{children:(0,An.jsxs)("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[(0,An.jsx)("stop",{stopColor:"#3E82F4"}),(0,An.jsx)("stop",{offset:1,stopColor:"#93DCF7"})]})})]});var Lr=require("react/jsx-runtime"),Jc=({style:e,...t})=>(0,Lr.jsxs)("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,Lr.jsxs)("g",{clipPath:"url(#clip0_2115_829)",children:[(0,Lr.jsx)("path",{d:"M2.34709 12.9404L2.3471 12.9404L2.34565 12.938L1.64031 11.7448L1.64004 11.7444L0.651257 10.0677C0.640723 10.0496 0.630746 10.0314 0.621325 10.0129H4.16461L2.39424 13.0139C2.3775 12.9901 2.36178 12.9656 2.34709 12.9404Z",fill:"#0066DA",stroke:"#6366F1"}),(0,Lr.jsx)("path",{d:"M8 4.48713L5.47995 0.215332C5.23253 0.358922 5.02176 0.556358 4.87514 0.80764L0.219931 8.70508C0.076007 8.95094 0.000191627 9.22937 0 9.51277H5.04009L8 4.48713Z",fill:"#00AC47"}),(0,Lr.jsx)("path",{d:"M13.48 13.7847C13.7274 13.6411 13.9382 13.4437 14.0848 13.1924L14.3781 12.6988L15.7801 10.3206C15.9267 10.0693 16.0001 9.79114 16.0001 9.51294H10.9596L12.0321 11.577L13.48 13.7847Z",fill:"#EA4335"}),(0,Lr.jsx)("path",{d:"M8.00003 4.48718L10.5201 0.215385C10.2726 0.0717949 9.98857 0 9.69533 0H6.30472C6.01148 0 5.7274 0.0807692 5.47998 0.215385L8.00003 4.48718Z",fill:"#00832D"}),(0,Lr.jsx)("path",{d:"M10.9599 9.51294H5.04007L2.52002 13.7847C2.76744 13.9283 3.05152 14.0001 3.34476 14.0001H12.6552C12.9484 14.0001 13.2325 13.9194 13.4799 13.7847L10.9599 9.51294Z",fill:"#2684FC"}),(0,Lr.jsx)("path",{d:"M13.4525 4.75636L11.1249 0.80764C10.9782 0.556358 10.7675 0.358922 10.52 0.215332L8 4.48713L10.9599 9.51277H15.9908C15.9908 9.23456 15.9175 8.95636 15.7709 8.70508L13.4525 4.75636Z",fill:"#FFBA00"})]}),(0,Lr.jsx)("defs",{children:(0,Lr.jsx)("clipPath",{id:"clip0_2115_829",children:(0,Lr.jsx)("rect",{width:"16",height:"14",fill:"white"})})})]});var qp=h(require("styled-components")),ws=qp.default.div`
2321
+ `;var en=require("react");var kn=require("react/jsx-runtime"),td=e=>(0,kn.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...e,children:[(0,kn.jsx)("path",{fill:"url(#icloud-gradient)",d:"M12.34 7.315a4.26 4.26 0 0 0-3.707 2.18 2.336 2.336 0 0 0-1.02-.236 2.336 2.336 0 0 0-2.3 1.963 3.217 3.217 0 0 0 1.244 6.181c.135-.001.27-.01.404-.029h8.943c.047.004.094.006.141.007.045-.001.09-.004.135-.007h.214v-.016a2.99 2.99 0 0 0 1.887-.988c.487-.55.757-1.261.757-1.998v-.006a3.017 3.017 0 0 0-.69-1.915 2.992 2.992 0 0 0-1.748-1.034 4.26 4.26 0 0 0-4.26-4.102Z"}),(0,kn.jsx)("defs",{children:(0,kn.jsxs)("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[(0,kn.jsx)("stop",{stopColor:"#3E82F4"}),(0,kn.jsx)("stop",{offset:1,stopColor:"#93DCF7"})]})})]});var Or=require("react/jsx-runtime"),rd=({style:e,...t})=>(0,Or.jsxs)("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,Or.jsxs)("g",{clipPath:"url(#clip0_2115_829)",children:[(0,Or.jsx)("path",{d:"M2.34709 12.9404L2.3471 12.9404L2.34565 12.938L1.64031 11.7448L1.64004 11.7444L0.651257 10.0677C0.640723 10.0496 0.630746 10.0314 0.621325 10.0129H4.16461L2.39424 13.0139C2.3775 12.9901 2.36178 12.9656 2.34709 12.9404Z",fill:"#0066DA",stroke:"#6366F1"}),(0,Or.jsx)("path",{d:"M8 4.48713L5.47995 0.215332C5.23253 0.358922 5.02176 0.556358 4.87514 0.80764L0.219931 8.70508C0.076007 8.95094 0.000191627 9.22937 0 9.51277H5.04009L8 4.48713Z",fill:"#00AC47"}),(0,Or.jsx)("path",{d:"M13.48 13.7847C13.7274 13.6411 13.9382 13.4437 14.0848 13.1924L14.3781 12.6988L15.7801 10.3206C15.9267 10.0693 16.0001 9.79114 16.0001 9.51294H10.9596L12.0321 11.577L13.48 13.7847Z",fill:"#EA4335"}),(0,Or.jsx)("path",{d:"M8.00003 4.48718L10.5201 0.215385C10.2726 0.0717949 9.98857 0 9.69533 0H6.30472C6.01148 0 5.7274 0.0807692 5.47998 0.215385L8.00003 4.48718Z",fill:"#00832D"}),(0,Or.jsx)("path",{d:"M10.9599 9.51294H5.04007L2.52002 13.7847C2.76744 13.9283 3.05152 14.0001 3.34476 14.0001H12.6552C12.9484 14.0001 13.2325 13.9194 13.4799 13.7847L10.9599 9.51294Z",fill:"#2684FC"}),(0,Or.jsx)("path",{d:"M13.4525 4.75636L11.1249 0.80764C10.9782 0.556358 10.7675 0.358922 10.52 0.215332L8 4.48713L10.9599 9.51277H15.9908C15.9908 9.23456 15.9175 8.95636 15.7709 8.70508L13.4525 4.75636Z",fill:"#FFBA00"})]}),(0,Or.jsx)("defs",{children:(0,Or.jsx)("clipPath",{id:"clip0_2115_829",children:(0,Or.jsx)("rect",{width:"16",height:"14",fill:"white"})})})]});var Xp=y(require("styled-components")),As=Xp.default.div`
2299
2322
  display: flex;
2300
2323
  flex-direction: column;
2301
2324
  gap: 12px;
2302
2325
  padding-top: 24px;
2303
2326
  padding-bottom: 24px;
2304
- `,K2=qp.default.div`
2327
+ `,n3=Xp.default.div`
2305
2328
  padding-bottom: 24px;
2306
- `;var qt=require("react/jsx-runtime"),j2={"google-drive":{name:"Google Drive",component:Jc},icloud:{name:"iCloud",component:Zc}},Y2=()=>{let{logout:e}=G(),{navigate:t,setModalData:r,data:o}=k(),{recoveryOAuthFlow:n,closePrivyModal:i,createAnalyticsEvent:a}=W(),[l,s]=(0,Xo.useState)(!1),{provider:c,action:u,isInAccountCreateFlow:y}=o?.recoveryOAuthStatus,[f,v]=(0,Xo.useState)(void 0),[C,g]=(0,Xo.useState)(u==="create-wallet");if(c==="user-passcode")throw new Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let _=j2[c].name,x=j2[c].component,b=o?.recoverWallet?.onCompleteNavigateTo,A=new lt(async(te="create-wallet")=>(g(!0),new Promise((L,z)=>{setTimeout(async()=>{try{let O=window.open();await n(c,te,O),s(!0),L()}catch{v({message:`${te==="recover"?"Recovery":"Back up"} with ${_} unsuccessful`,detail:u==="recover"?`Please verify that you are selecting the ${_} account associated with your backup.`:"",retryable:!0}),z()}},0)})));(0,Xo.useEffect)(()=>{u!=="recover"&&A.execute(y?"create-wallet":"set-recovery")},[]),(0,Xo.useEffect)(()=>{if(!l)return;let te=setTimeout(()=>{y?(r({createWallet:{onSuccess:()=>{},onFailure:L=>{a({eventName:"embedded_wallet_creation_failure_logout",payload:{error:L,screen:"RecoveryOAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_CREATED_SCREEN")):i({shouldCallAuthOnSuccess:!1})},it);return()=>clearTimeout(te)},[l]);let R=(0,Xo.useCallback)(async()=>{await A.execute("recover"),b?t(b):s(!0)},[]),U=c==="google-drive"?"Google Drive":"Apple iCloud",M=u==="recover"?"recovered":"backed up",I=u==="recover"?"Recovering":"Backing up",V=l&&`Successfully ${M} with ${U}.`||f&&f.message||`${I} with ${U}...`,j=f?f.detail:"";return(0,qt.jsxs)(qt.Fragment,{children:[(0,qt.jsx)(S,{}),C?(0,qt.jsx)(qt.Fragment,{children:(0,qt.jsxs)(ws,{children:[(0,qt.jsx)(Ve,{title:V,icon:(0,qt.jsx)(x,{style:{width:"38px",height:"38px"}}),description:j}),f&&f?.retryable?(0,qt.jsx)(D,{onClick:()=>{Hn(),v(void 0),u==="create-wallet"?A.execute("create-wallet"):R()},disabled:!l&&!f?.retryable,children:"Try again"}):null]})}):(0,qt.jsxs)(ws,{children:[(0,qt.jsx)(Ve,{title:"Confirm it's really you",icon:(0,qt.jsx)(x,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${U} where your account is backed up.`}),(0,qt.jsxs)(D,{onClick:R,children:["Confirm with ",U]})]}),(0,qt.jsx)(K,{protectedByPrivy:!0})]})};var en=require("react");var J2=require("react/jsx-runtime"),Z2=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=k(),[n,i]=(0,en.useState)(""),[a,l]=(0,en.useState)(!1),[s,c]=(0,en.useState)(),[u,y]=(0,en.useState)(null),{authenticated:f}=G(),{closePrivyModal:v,isNewUserThisSession:C,initializeWalletProxy:g}=W(),{onSuccess:_,onFailure:x,callAuthOnSuccessOnClose:b}=r.createWallet,{createWallet:A}=cc(),[R,U]=(0,en.useState)(null),M=new lt(async()=>{try{let j=await A(s);if(!j)return;U(j),C?t("EMBEDDED_WALLET_CREATED_SCREEN"):(_(j),v({shouldCallAuthOnSuccess:b}))}catch(j){i(j.message)}});(0,en.useEffect)(()=>{u||g(3e4).then(j=>y(j))},[u]),(0,en.useEffect)(()=>{if(!f){t("LANDING"),x(new Error("User must be authenticated before creating a Privy wallet"));return}},[f]);let I=()=>{R&&R?.recoveryMethod!=="user-passcode"?(x(new tr("User created a wallet but failed to set a password for it")),v({shouldCallAuthOnSuccess:!1})):R?(_(R),v({shouldCallAuthOnSuccess:b})):(x(new tr("User wallet creation failed")),v({shouldCallAuthOnSuccess:!1}))};o.current=()=>null;let V=async()=>{l(!0);let j=250;return M.execute().then(()=>new Promise(te=>setTimeout(te,j))).finally(()=>l(!1))};return(0,J2.jsx)(uc,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!u,buttonLoading:a,buttonHideAnimations:!R&&a,isResettingPassword:!1,error:n,password:s||"",onClose:I,onPasswordChange:c,onPasswordGenerate:()=>c(pc()),onSubmit:V})};var Q2=h(require("@heroicons/react/24/outline/LockClosedIcon")),X2=h(require("@heroicons/react/24/outline/PencilSquareIcon")),e3=h(require("@heroicons/react/24/outline/QuestionMarkCircleIcon")),t3=require("react"),r3=h(require("styled-components"));var Pe=require("react/jsx-runtime"),$p=r3.default.div`
2329
+ `;var Kt=require("react/jsx-runtime"),i3={"google-drive":{name:"Google Drive",component:rd},icloud:{name:"iCloud",component:td}},a3=()=>{let{logout:e}=H(),{navigate:t,setModalData:r,data:o}=k(),{recoveryOAuthFlow:n,closePrivyModal:i,createAnalyticsEvent:a}=W(),[s,l]=(0,en.useState)(!1),{provider:c,action:u,isInAccountCreateFlow:f}=o?.recoveryOAuthStatus,[h,v]=(0,en.useState)(void 0),[C,g]=(0,en.useState)(u==="create-wallet");if(c==="user-passcode")throw new Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let P=i3[c].name,S=i3[c].component,E=o?.recoverWallet?.onCompleteNavigateTo,x=new nt(async(re="create-wallet")=>(g(!0),new Promise((L,K)=>{setTimeout(async()=>{try{let O=window.open();await n(c,re,O),l(!0),L()}catch{v({message:`${re==="recover"?"Recovery":"Back up"} with ${P} unsuccessful`,detail:u==="recover"?`Please verify that you are selecting the ${P} account associated with your backup.`:"",retryable:!0}),K()}},0)})));(0,en.useEffect)(()=>{u!=="recover"&&x.execute(f?"create-wallet":"set-recovery")},[]),(0,en.useEffect)(()=>{if(!s)return;let re=setTimeout(()=>{f?(r({createWallet:{onSuccess:()=>{},onFailure:L=>{a({eventName:"embedded_wallet_creation_failure_logout",payload:{error:L,screen:"RecoveryOAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_CREATED_SCREEN")):i({shouldCallAuthOnSuccess:!1})},et);return()=>clearTimeout(re)},[s]);let R=(0,en.useCallback)(async()=>{await x.execute("recover"),E?t(E):l(!0)},[]),D=c==="google-drive"?"Google Drive":"Apple iCloud",I=u==="recover"?"recovered":"backed up",M=u==="recover"?"Recovering":"Backing up",V=s&&`Successfully ${I} with ${D}.`||h&&h.message||`${M} with ${D}...`,z=h?h.detail:"";return(0,Kt.jsxs)(Kt.Fragment,{children:[(0,Kt.jsx)(A,{}),C?(0,Kt.jsx)(Kt.Fragment,{children:(0,Kt.jsxs)(As,{children:[(0,Kt.jsx)(Ve,{title:V,icon:(0,Kt.jsx)(S,{style:{width:"38px",height:"38px"}}),description:z}),h&&h?.retryable?(0,Kt.jsx)(U,{onClick:()=>{Vn(),v(void 0),u==="create-wallet"?x.execute("create-wallet"):R()},disabled:!s&&!h?.retryable,children:"Try again"}):null]})}):(0,Kt.jsxs)(As,{children:[(0,Kt.jsx)(Ve,{title:"Confirm it's really you",icon:(0,Kt.jsx)(S,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${D} where your account is backed up.`}),(0,Kt.jsxs)(U,{onClick:R,children:["Confirm with ",D]})]}),(0,Kt.jsx)(j,{protectedByPrivy:!0})]})};var tn=require("react");var l3=require("react/jsx-runtime"),s3=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=k(),[n,i]=(0,tn.useState)(""),[a,s]=(0,tn.useState)(!1),[l,c]=(0,tn.useState)(),[u,f]=(0,tn.useState)(null),{authenticated:h}=H(),{closePrivyModal:v,isNewUserThisSession:C,initializeWalletProxy:g}=W(),{onSuccess:P,onFailure:S,callAuthOnSuccessOnClose:E}=r.createWallet,{createWallet:x}=fc(),[R,D]=(0,tn.useState)(null),I=new nt(async()=>{try{let z=await x(l);if(!z)return;D(z),C?t("EMBEDDED_WALLET_CREATED_SCREEN"):(P(z),v({shouldCallAuthOnSuccess:E}))}catch(z){i(z.message)}});(0,tn.useEffect)(()=>{u||g(3e4).then(z=>f(z))},[u]),(0,tn.useEffect)(()=>{if(!h){t("LANDING"),S(new Error("User must be authenticated before creating a Privy wallet"));return}},[h]);let M=()=>{R&&R?.recoveryMethod!=="user-passcode"?(S(new rr("User created a wallet but failed to set a password for it")),v({shouldCallAuthOnSuccess:!1})):R?(P(R),v({shouldCallAuthOnSuccess:E})):(S(new rr("User wallet creation failed")),v({shouldCallAuthOnSuccess:!1}))};o.current=()=>null;let V=async()=>{s(!0);let z=250;return I.execute().then(()=>new Promise(re=>setTimeout(re,z))).finally(()=>s(!1))};return(0,l3.jsx)(gc,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!u,buttonLoading:a,buttonHideAnimations:!R&&a,isResettingPassword:!1,error:n,password:l||"",onClose:M,onPasswordChange:c,onPasswordGenerate:()=>c(yc()),onSubmit:V})};var c3=y(require("@heroicons/react/24/outline/LockClosedIcon")),d3=y(require("@heroicons/react/24/outline/PencilSquareIcon")),p3=y(require("@heroicons/react/24/outline/QuestionMarkCircleIcon")),u3=require("react"),m3=y(require("styled-components"));var Pe=require("react/jsx-runtime"),eu=m3.default.div`
2307
2330
  width: 24px;
2308
2331
  height: 24px;
2309
2332
  display: flex;
2310
2333
  justify-content: center;
2311
2334
  align-items: center;
2312
- `,zw={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},qw=({onClose:e})=>(0,Pe.jsxs)(K2,{children:[(0,Pe.jsx)(Ve,{title:"Why do I need to secure my account?",icon:(0,Pe.jsx)(e3.default,{width:48}),description:(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),(0,Pe.jsx)("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It\u2019s important you don\u2019t lose access to the method you choose."})]})}),(0,Pe.jsx)(D,{onClick:e,children:"Select backup method"})]}),o3=()=>{let[e,t]=(0,t3.useState)(!1),{navigate:r,setModalData:o,data:n}=k(),{user:i}=G(),{embeddedWallets:a}=Kt(),l=He(i),s=l===null,{isInAccountCreateFlow:c,isResettingPassword:u}=n.recoverySelection,y=l?.recoveryMethod!=="privy",f=y?"Update backup method":"Secure your account",v=y?(0,Pe.jsxs)("span",{children:["Your account is currently secured using"," ",(0,Pe.jsx)("strong",{children:zw[l?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function C(g){o({recoveryOAuthStatus:{provider:g,action:s?"create-wallet":"set-recovery",isInAccountCreateFlow:c}}),r("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")}return(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(S,{backFn:e?()=>t(!1):void 0,infoFn:e?void 0:()=>t(!0)},"header"),e?(0,Pe.jsx)(qw,{onClose:()=>t(!1)}):(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(Ve,{title:f,icon:(0,Pe.jsx)(Q2.default,{width:48}),description:v}),(0,Pe.jsx)(ws,{children:a.userOwnedRecoveryOptions.filter(g=>["icloud","google-drive"].includes(l?.recoveryMethod||"")?g!==l?.recoveryMethod:!0).sort().map(g=>{switch(g){case"google-drive":return(0,Pe.jsxs)(De,{onClick:()=>C("google-drive"),children:[(0,Pe.jsx)($p,{children:(0,Pe.jsx)(Jc,{style:{width:18}})}),"Back up to Google Drive"]},g);case"icloud":return(0,Pe.jsxs)(De,{onClick:()=>C("icloud"),children:[(0,Pe.jsx)($p,{children:(0,Pe.jsx)(Zc,{style:{width:24}})}),"Back up to Apple iCloud"]},g);case"user-passcode":return(0,Pe.jsxs)(De,{onClick:()=>{let _=tp({isCreatingWallet:s,skipSplashScreen:!0});r(_)},children:[(0,Pe.jsx)($p,{children:(0,Pe.jsx)(X2.default,{style:{width:18}})}),u?"Reset your":"Set a"," password"]},g);default:return null}})})]}),(0,Pe.jsx)(K,{protectedByPrivy:!0})]})};var Kp=require("@ethersproject/bignumber"),St=require("react"),ai=h(require("styled-components"));function n3(e){return e.to&&e.data?"CONTRACT_CALL":e.to&&e.value?"SEND":"UNKNOWN"}var va=require("@heroicons/react/24/outline"),d3=require("react"),wr=h(require("styled-components"));var bs=require("@ethersproject/logger"),$w=new Set([bs.ErrorCode.CALL_EXCEPTION,bs.ErrorCode.NONCE_EXPIRED,bs.ErrorCode.REPLACEMENT_UNDERPRICED,bs.ErrorCode.TRANSACTION_REPLACED]),i3=e=>{let t;return e.code&&e.code!==-32e3&&$w.has(e.code)&&(t=e.transactionHash),t},a3=e=>e.code==="SERVER_ERROR"?e.error?.message??e.reason??e.message??"unknown error":e.error?.code==="SERVER_ERROR"?e.error?.error?.message??e.reason??e.message??"unknown error":e.reason??e.message??"unknown error";var je=require("react/jsx-runtime"),Kw=e=>{let t=e.code?e.code?.toString().charAt(0)+e.code?.toString().slice(1).replace("_"," ").toLowerCase():"Something went wrong.",r=i3(e),o=a3(e);return{errorCode:t,transactionHash:r,errorMessage:o}},jw=()=>(0,je.jsxs)(Qw,{children:[(0,je.jsx)(e5,{}),(0,je.jsx)(Xw,{})]}),p3=({transactionError:e,chainId:t,onClose:r,onRetry:o})=>{let{chains:n}=W(),[i,a]=(0,d3.useState)(!1),{errorCode:l,transactionHash:s,errorMessage:c}=Kw(e),u=n.find(y=>y.id===t)?.blockExplorers?.default.url??"https://etherscan.io";return(0,je.jsxs)(je.Fragment,{children:[(0,je.jsx)(S,{onClose:r}),(0,je.jsxs)(Yw,{children:[(0,je.jsx)(jw,{}),(0,je.jsx)(Zw,{children:l}),(0,je.jsx)(Jw,{children:"Please try again."}),(0,je.jsxs)(l3,{children:[(0,je.jsx)(s3,{children:"Error message"}),(0,je.jsx)(c3,{clickable:!1,children:c})]}),s&&(0,je.jsxs)(l3,{children:[(0,je.jsx)(s3,{children:"Transaction hash"}),(0,je.jsxs)(r5,{children:["Copy this hash to view details about the transaction on a"," ",(0,je.jsx)("u",{children:(0,je.jsx)("a",{href:u,children:"block explorer"})}),"."]}),(0,je.jsxs)(c3,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(s),a(!0)},children:[s,(0,je.jsx)(i5,{clicked:i})]})]}),(0,je.jsx)(t5,{onClick:()=>o({resetNonce:!!s}),children:"Retry transaction"})]}),(0,je.jsx)(q,{})]})},Yw=wr.default.div`
2335
+ `,s5={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},l5=({onClose:e})=>(0,Pe.jsxs)(n3,{children:[(0,Pe.jsx)(Ve,{title:"Why do I need to secure my account?",icon:(0,Pe.jsx)(p3.default,{width:48}),description:(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),(0,Pe.jsx)("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It\u2019s important you don\u2019t lose access to the method you choose."})]})}),(0,Pe.jsx)(U,{onClick:e,children:"Select backup method"})]}),f3=()=>{let[e,t]=(0,u3.useState)(!1),{navigate:r,setModalData:o,data:n}=k(),{user:i}=H(),{embeddedWallets:a}=It(),s=He(i),l=s===null,{isInAccountCreateFlow:c,isResettingPassword:u}=n.recoverySelection,f=s?.recoveryMethod!=="privy",h=f?"Update backup method":"Secure your account",v=f?(0,Pe.jsxs)("span",{children:["Your account is currently secured using"," ",(0,Pe.jsx)("strong",{children:s5[s?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function C(g){o({recoveryOAuthStatus:{provider:g,action:l?"create-wallet":"set-recovery",isInAccountCreateFlow:c}}),r("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")}return(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(A,{backFn:e?()=>t(!1):void 0,infoFn:e?void 0:()=>t(!0)},"header"),e?(0,Pe.jsx)(l5,{onClose:()=>t(!1)}):(0,Pe.jsxs)(Pe.Fragment,{children:[(0,Pe.jsx)(Ve,{title:h,icon:(0,Pe.jsx)(c3.default,{width:48}),description:v}),(0,Pe.jsx)(As,{children:a.userOwnedRecoveryOptions.filter(g=>["icloud","google-drive"].includes(s?.recoveryMethod||"")?g!==s?.recoveryMethod:!0).sort().map(g=>{switch(g){case"google-drive":return(0,Pe.jsxs)(De,{onClick:()=>C("google-drive"),children:[(0,Pe.jsx)(eu,{children:(0,Pe.jsx)(rd,{style:{width:18}})}),"Back up to Google Drive"]},g);case"icloud":return(0,Pe.jsxs)(De,{onClick:()=>C("icloud"),children:[(0,Pe.jsx)(eu,{children:(0,Pe.jsx)(td,{style:{width:24}})}),"Back up to Apple iCloud"]},g);case"user-passcode":return(0,Pe.jsxs)(De,{onClick:()=>{let P=cp({isCreatingWallet:l,skipSplashScreen:!0});r(P)},children:[(0,Pe.jsx)(eu,{children:(0,Pe.jsx)(d3.default,{style:{width:18}})}),u?"Reset your":"Set a"," password"]},g);default:return null}})})]}),(0,Pe.jsx)(j,{protectedByPrivy:!0})]})};var tu=require("@ethersproject/bignumber"),xt=require("react"),li=y(require("styled-components"));function h3(e){return e.to&&e.data?"CONTRACT_CALL":e.to&&e.value?"SEND":"UNKNOWN"}var Ta=require("@heroicons/react/24/outline"),b3=require("react"),br=y(require("styled-components"));var xs=require("@ethersproject/logger"),c5=new Set([xs.ErrorCode.CALL_EXCEPTION,xs.ErrorCode.NONCE_EXPIRED,xs.ErrorCode.REPLACEMENT_UNDERPRICED,xs.ErrorCode.TRANSACTION_REPLACED]),y3=e=>{let t;return e.code&&e.code!==-32e3&&c5.has(e.code)&&(t=e.transactionHash),t},g3=e=>e.code==="SERVER_ERROR"?e.error?.message??e.reason??e.message??"unknown error":e.error?.code==="SERVER_ERROR"?e.error?.error?.message??e.reason??e.message??"unknown error":e.reason??e.message??"unknown error";var je=require("react/jsx-runtime"),d5=e=>{let t=e.code?e.code?.toString().charAt(0)+e.code?.toString().slice(1).replace("_"," ").toLowerCase():"Something went wrong.",r=y3(e),o=g3(e);return{errorCode:t,transactionHash:r,errorMessage:o}},p5=()=>(0,je.jsxs)(h5,{children:[(0,je.jsx)(g5,{}),(0,je.jsx)(y5,{})]}),E3=({transactionError:e,chainId:t,onClose:r,onRetry:o})=>{let{chains:n}=W(),[i,a]=(0,b3.useState)(!1),{errorCode:s,transactionHash:l,errorMessage:c}=d5(e),u=n.find(f=>f.id===t)?.blockExplorers?.default.url??"https://etherscan.io";return(0,je.jsxs)(je.Fragment,{children:[(0,je.jsx)(A,{onClose:r}),(0,je.jsxs)(u5,{children:[(0,je.jsx)(p5,{}),(0,je.jsx)(m5,{children:s}),(0,je.jsx)(f5,{children:"Please try again."}),(0,je.jsxs)(C3,{children:[(0,je.jsx)(v3,{children:"Error message"}),(0,je.jsx)(w3,{clickable:!1,children:c})]}),l&&(0,je.jsxs)(C3,{children:[(0,je.jsx)(v3,{children:"Transaction hash"}),(0,je.jsxs)(C5,{children:["Copy this hash to view details about the transaction on a"," ",(0,je.jsx)("u",{children:(0,je.jsx)("a",{href:u,children:"block explorer"})}),"."]}),(0,je.jsxs)(w3,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(l),a(!0)},children:[l,(0,je.jsx)(E5,{clicked:i})]})]}),(0,je.jsx)(v5,{onClick:()=>o({resetNonce:!!l}),children:"Retry transaction"})]}),(0,je.jsx)($,{})]})},u5=br.default.div`
2313
2336
  display: flex;
2314
2337
  flex-direction: column;
2315
2338
  align-items: center;
2316
2339
  justify-content: center;
2317
- `,Zw=wr.default.span`
2340
+ `,m5=br.default.span`
2318
2341
  color: var(--privy-color-foreground);
2319
2342
  text-align: center;
2320
2343
  font-size: 1.125rem;
@@ -2322,7 +2345,7 @@ You will have to sign up with another method first to register a passkey for you
2322
2345
  line-height: 1.25rem; /* 111.111% */
2323
2346
  text-align: center;
2324
2347
  margin: 10px;
2325
- `,Jw=wr.default.span`
2348
+ `,f5=br.default.span`
2326
2349
  margin-top: 4px;
2327
2350
  margin-bottom: 10px;
2328
2351
  color: var(--privy-color-foreground-3);
@@ -2333,7 +2356,7 @@ You will have to sign up with another method first to register a passkey for you
2333
2356
  font-weight: 400;
2334
2357
  line-height: 20px; /* 142.857% */
2335
2358
  letter-spacing: -0.008px;
2336
- `,Qw=wr.default.div`
2359
+ `,h5=br.default.div`
2337
2360
  position: relative;
2338
2361
  width: 60px;
2339
2362
  height: 60px;
@@ -2341,37 +2364,37 @@ You will have to sign up with another method first to register a passkey for you
2341
2364
  display: flex;
2342
2365
  justify-content: center;
2343
2366
  align-items: center;
2344
- `,Xw=(0,wr.default)(va.ExclamationCircleIcon)`
2367
+ `,y5=(0,br.default)(Ta.ExclamationCircleIcon)`
2345
2368
  position: absolute;
2346
2369
  width: 35px;
2347
2370
  height: 35px;
2348
2371
  color: var(--privy-color-error);
2349
- `,e5=wr.default.div`
2372
+ `,g5=br.default.div`
2350
2373
  position: absolute;
2351
2374
  width: 60px;
2352
2375
  height: 60px;
2353
2376
  border-radius: 50%;
2354
2377
  background-color: var(--privy-color-error);
2355
2378
  opacity: 0.1;
2356
- `,t5=(0,wr.default)(D)`
2379
+ `,v5=(0,br.default)(U)`
2357
2380
  && {
2358
2381
  margin-top: 24px;
2359
2382
  }
2360
2383
  transition: color 350ms ease, background-color 350ms ease;
2361
- `,s3=wr.default.span`
2384
+ `,v3=br.default.span`
2362
2385
  width: 100%;
2363
2386
  text-align: left;
2364
2387
  font-size: 0.825rem;
2365
2388
  color: var(--privy-color-foreground);
2366
2389
  padding: 4px;
2367
- `,l3=wr.default.div`
2390
+ `,C3=br.default.div`
2368
2391
  width: 100%;
2369
2392
  margin: 5px;
2370
2393
  display: flex;
2371
2394
  flex-direction: column;
2372
2395
  justify-content: center;
2373
2396
  align-items: center;
2374
- `,r5=wr.default.text`
2397
+ `,C5=br.default.text`
2375
2398
  position: relative;
2376
2399
  width: 100%;
2377
2400
  padding: 5px;
@@ -2379,7 +2402,7 @@ You will have to sign up with another method first to register a passkey for you
2379
2402
  color: var(--privy-color-foreground-3);
2380
2403
  text-align: left;
2381
2404
  word-wrap: break-word;
2382
- `,c3=wr.default.span`
2405
+ `,w3=br.default.span`
2383
2406
  position: relative;
2384
2407
  width: 100%;
2385
2408
  background-color: var(--privy-color-background-2);
@@ -2397,65 +2420,65 @@ You will have to sign up with another method first to register a passkey for you
2397
2420
  &:hover {
2398
2421
  background-color: var(--privy-color-foreground-4);
2399
2422
  }`}
2400
- `,o5=(0,wr.default)(va.ClipboardDocumentIcon)`
2423
+ `,w5=(0,br.default)(Ta.ClipboardDocumentIcon)`
2401
2424
  position: absolute;
2402
2425
  top: 13px;
2403
2426
  right: 13px;
2404
2427
  width: 24px;
2405
2428
  height: 24px;
2406
- `,n5=(0,wr.default)(va.ClipboardDocumentCheckIcon)`
2429
+ `,b5=(0,br.default)(Ta.ClipboardDocumentCheckIcon)`
2407
2430
  position: absolute;
2408
2431
  top: 13px;
2409
2432
  right: 13px;
2410
2433
  width: 24px;
2411
2434
  height: 24px;
2412
- `,i5=({clicked:e})=>e?(0,je.jsx)(n5,{}):(0,je.jsx)(o5,{});var Qc=require("@ethersproject/bignumber"),u3=h(require("styled-components"));var Lo=require("react/jsx-runtime"),a5=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=Qc.BigNumber.from(e.gasUsed),o=Qc.BigNumber.from(e.effectiveGasPrice),n=r.mul(o);if(t){let i=Qc.BigNumber.from(t);n=n.add(i)}return n.toString()}catch{return}else return},m3=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a,receiptHeader:l,receiptDescription:s})=>(0,Lo.jsxs)(Lo.Fragment,{children:[(0,Lo.jsx)(S,{onClose:o}),(0,Lo.jsx)(Va,{title:l??"Transaction complete!",description:s??"You're all set."}),(0,Lo.jsx)(da,{tokenPrice:n,from:t.from,to:t.to,gas:a5(t,a),txn:e,transactionInfo:r,tokenSymbol:i}),(0,Lo.jsx)(s5,{loading:!1,onClick:o,children:"All Done"}),(0,Lo.jsx)(q,{})]}),s5=(0,u3.default)(D)`
2435
+ `,E5=({clicked:e})=>e?(0,je.jsx)(b5,{}):(0,je.jsx)(w5,{});var od=require("@ethersproject/bignumber"),T3=y(require("styled-components"));var Oo=require("react/jsx-runtime"),T5=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=od.BigNumber.from(e.gasUsed),o=od.BigNumber.from(e.effectiveGasPrice),n=r.mul(o);if(t){let i=od.BigNumber.from(t);n=n.add(i)}return n.toString()}catch{return}else return},P3=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a,receiptHeader:s,receiptDescription:l})=>(0,Oo.jsxs)(Oo.Fragment,{children:[(0,Oo.jsx)(A,{onClose:o}),(0,Oo.jsx)(Za,{title:s??"Transaction complete!",description:l??"You're all set."}),(0,Oo.jsx)(ha,{tokenPrice:n,from:t.from,to:t.to,gas:T5(t,a),txn:e,transactionInfo:r,tokenSymbol:i}),(0,Oo.jsx)(P5,{loading:!1,onClick:o,children:"All Done"}),(0,Oo.jsx)($,{})]}),P5=(0,T3.default)(U)`
2413
2436
  && {
2414
2437
  margin-top: 24px;
2415
2438
  }
2416
2439
  transition: color 350ms ease, background-color 350ms ease;
2417
- `;var Le=require("react/jsx-runtime");var l5=({txn:e,txnFamily:t,uiOptions:r,tokenSymbol:o,tokenPrice:n})=>{if(t==="CONTRACT_CALL"){if(r.transactionInfo?.contractInfo)return(0,Le.jsx)(Wp,{contractInfo:r.transactionInfo.contractInfo,description:r.description});if(r.senderInfo)return(0,Le.jsx)(Wp,{contractInfo:r.senderInfo,description:r.description||r.senderInfo.actionText})}return(0,Le.jsx)(Le.Fragment,{children:(0,Le.jsx)(u2,{description:r.description||r.transactionInfo?.description||"",txn:e,tokenSymbol:o,tokenPrice:n})})},h3=()=>{let{authenticated:e,getAccessToken:t}=G(),{wallets:r}=ya(),{walletProxy:o,closePrivyModal:n,getFiatOnRampConfig:i,rpcConfig:a,chains:l,nativeTokenSymbolForChainId:s,appId:c}=W(),{app:u,navigate:y,data:f,onUserCloseViaDialogOrKeybindRef:v,setModalData:C}=k(),{transactionRequest:g,onSuccess:_,onFailure:x,uiOptions:b,fundWalletConfig:A}=f.sendTransaction,[R,U]=(0,St.useState)(null),[M,I]=(0,St.useState)(null),[V,j]=(0,St.useState)(""),[te,L]=(0,St.useState)(),[z,O]=(0,St.useState)(),[ye,we]=(0,St.useState)(!1),be=()=>{j(""),L(void 0),O(void 0)},Ne=(gt,vt,ui)=>{j(gt),L(new ct(new _r(vt??gt,ui??Ht.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))},[le,er]=(0,St.useState)(!1),[Et,sr]=(0,St.useState)(!0),[_t,Nr]=(0,St.useState)(null),[Ze,yt]=(0,St.useState)(g),{tokenPrice:Dr,isTokenPriceLoading:lr}=jc(Ze),pt=s(g.chainId)||"ETH",[N,In]=(0,St.useState)(null),[Fe,ie]=(0,St.useState)(null),[ce,Re]=(0,St.useState)(!0);(0,St.useEffect)(()=>{e||(y("LANDING"),x(new Error("User must be authenticated before transacting with a Privy wallet")))},[e]);let rt=g.from?r.find(gt=>gt.address===g.from):r.find(gt=>gt.walletClientType==="privy"&&!gt.imported),ad=async()=>{if(!rt)return console.warn("No privy wallet found, cannot fund wallet.");let{signedUrl:gt,externalTransactionId:vt}=await i(rt.address,{config:A?.config||{}});C({fiatOnRampPrompt:{signedUrl:gt},fiatOnRampStatus:{externalTransactionId:vt}}),y("FIAT_ON_RAMP_PROMPT_SCREEN")},ci=(0,St.useMemo)(()=>Do(Ze.chainId,l,a,{appId:c}),[Ze.chainId,a]);async function Ss(gt){let vt=gt;if(!await t()||!o||!rt)return;try{vt=await fa(rt.address,gt,ci),yt(vt)}catch(Oo){console.error(Oo),Ne("There was an error preparing your transaction. Your transaction request will likely fail.",Oo.reason)}let Mn=Kp.BigNumber.from(0),Wn=Kp.BigNumber.from(0);try{({totalGasEstimate:Mn,l1ExecutionFeeEstimate:Wn}=await ma(vt,ci)),In(Mn.toHexString()),ie(Wn.toHexString())}catch{In(null)}try{let{balance:Oo,hasSufficientFunds:_s}=await $c(rt.address,vt,Mn,ci);Nr(Oo.toHexString()),_s||(sr(!1),Ne("Wallet has insufficient funds on this network for this transaction."),u?.fiatOnRamp.enabled&&we(!0))}catch(Oo){console.warn(`Failed to fetch wallet balance with error: ${Oo}`)}Re(!1)}(0,St.useEffect)(()=>{Ss(Ze)},[o]);let di=n3(Ze),pi=di==="SEND"?`Send ${pt}`:"Review transaction",Ea={modalTitle:b.header||b.modalTitle||pi,buttonText:b.buttonText||"Submit"},ot=()=>{le||(M?_(M):x(te||new ct(new _r("The user rejected the request",Ht.E4001_USER_REJECTED_REQUEST.eipCode))),n({shouldCallAuthOnSuccess:!1}))};return v.current=ot,Dr===void 0&&lr||ce?(0,Le.jsxs)(Le.Fragment,{children:[b.transactionInfo?.contractInfo?.imgUrl&&(0,Le.jsx)(hl,{src:b.transactionInfo?.contractInfo?.imgUrl}),(0,Le.jsx)(S,{title:Ea.modalTitle,onClose:ot}),(0,Le.jsx)(f3,{children:(0,Le.jsx)(Vi,{})})]}):R!==null?(0,Le.jsx)(m3,{txn:Ze,onClose:ot,receipt:R,transactionInfo:b.transactionInfo,tokenPrice:Dr,tokenSymbol:pt,l1GasEstimate:Fe,receiptHeader:b.successHeader,receiptDescription:b.successDescription}):z?(0,Le.jsx)(p3,{transactionError:z,chainId:Ze.chainId,onClose:ot,onRetry:({resetNonce:gt})=>{be();let vt=Ze;gt&&(vt={...Ze,nonce:void 0}),Ss(vt)}}):(0,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)(S,{title:Ea.modalTitle,onClose:ot}),(0,Le.jsxs)(f3,{children:[(0,Le.jsxs)(u5,{children:[(0,Le.jsx)(l5,{txn:Ze,txnFamily:di,uiOptions:b,tokenSymbol:pt,tokenPrice:Dr}),rt?(0,Le.jsx)(da,{from:rt.address,to:Ze.to,txn:Ze,transactionInfo:b.transactionInfo,gas:N||void 0,tokenPrice:Dr,tokenSymbol:pt}):null]}),(0,Le.jsxs)(m5,{children:[(0,Le.jsx)(c5,{children:V}),(0,Le.jsx)(d2,{txn:Ze,address:rt?.address??"",hasFunds:Et,balance:_t}),(0,Le.jsxs)(d5,{children:[ye&&(0,Le.jsx)(D,{onClick:ad,children:"Add Funds"}),(0,Le.jsx)(p5,{disabled:le||!Et,loading:!o||le,loadingText:le?"Submitting (may take a few moments)...":"Loading...",onClick:async()=>{er(!0);let gt=await t();if(gt&&!le&&rt)try{let vt=await qc(gt,rt.address,o,Ze,ci);I(vt);let ui=await vt.wait();U(Kc(ui)),be()}catch(vt){console.warn({transaction:Ze,error:vt}),O(vt),L(new ct(new _r(vt.reason??"Error processing transaction",Ht.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))}finally{er(!1)}},children:Ea.buttonText})]})]})]})]})},f3=ai.default.div`
2440
+ `;var Le=require("react/jsx-runtime");var _5=({txn:e,txnFamily:t,uiOptions:r,tokenSymbol:o,tokenPrice:n})=>{if(t==="CONTRACT_CALL"){if(r.transactionInfo?.contractInfo)return(0,Le.jsx)(Hp,{contractInfo:r.transactionInfo.contractInfo,description:r.description});if(r.senderInfo)return(0,Le.jsx)(Hp,{contractInfo:r.senderInfo,description:r.description||r.senderInfo.actionText})}return(0,Le.jsx)(Le.Fragment,{children:(0,Le.jsx)(T2,{description:r.description||r.transactionInfo?.description||"",txn:e,tokenSymbol:o,tokenPrice:n})})},S3=()=>{let{authenticated:e,getAccessToken:t}=H(),{wallets:r}=ba(),{walletProxy:o,closePrivyModal:n,getFiatOnRampConfig:i,rpcConfig:a,chains:s,nativeTokenSymbolForChainId:l,appId:c}=W(),{app:u,navigate:f,data:h,onUserCloseViaDialogOrKeybindRef:v,setModalData:C}=k(),{transactionRequest:g,onSuccess:P,onFailure:S,uiOptions:E,fundWalletConfig:x}=h.sendTransaction,[R,D]=(0,xt.useState)(null),[I,M]=(0,xt.useState)(null),[V,z]=(0,xt.useState)(""),[re,L]=(0,xt.useState)(),[K,O]=(0,xt.useState)(),[ge,be]=(0,xt.useState)(!1),Ee=()=>{z(""),L(void 0),O(void 0)},Ne=(vt,Ct,fi)=>{z(vt),L(new ct(new Sr(Ct??vt,fi??Gt.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))},[le,tr]=(0,xt.useState)(!1),[_t,lr]=(0,xt.useState)(!0),[kt,Dr]=(0,xt.useState)(null),[Ze,gt]=(0,xt.useState)(g),{tokenPrice:Ur,isTokenPriceLoading:cr}=Xc(Ze),ut=l(g.chainId)||"ETH",[N,Mn]=(0,xt.useState)(null),[Fe,oe]=(0,xt.useState)(null),[ce,Ie]=(0,xt.useState)(!0);(0,xt.useEffect)(()=>{e||(f("LANDING"),S(new Error("User must be authenticated before transacting with a Privy wallet")))},[e]);let rt=g.from?r.find(vt=>vt.address===g.from):r.find(vt=>vt.walletClientType==="privy"&&!vt.imported),md=async()=>{if(!rt)return console.warn("No privy wallet found, cannot fund wallet.");let{signedUrl:vt,externalTransactionId:Ct}=await i(rt.address,{config:x?.config||{}});C({fiatOnRampPrompt:{signedUrl:vt},fiatOnRampStatus:{externalTransactionId:Ct}}),f("FIAT_ON_RAMP_PROMPT_SCREEN")},pi=(0,xt.useMemo)(()=>Fo(Ze.chainId,s,a,{appId:c}),[Ze.chainId,a]);async function Ms(vt){let Ct=vt;if(!await t()||!o||!rt)return;try{Ct=await Ca(rt.address,vt,pi),gt(Ct)}catch(Do){console.error(Do),Ne("There was an error preparing your transaction. Your transaction request will likely fail.",Do.reason)}let Wn=tu.BigNumber.from(0),Ln=tu.BigNumber.from(0);try{({totalGasEstimate:Wn,l1ExecutionFeeEstimate:Ln}=await va(Ct,pi)),Mn(Wn.toHexString()),oe(Ln.toHexString())}catch{Mn(null)}try{let{balance:Do,hasSufficientFunds:Ws}=await Jc(rt.address,Ct,Wn,pi);Dr(Do.toHexString()),Ws||(lr(!1),Ne("Wallet has insufficient funds on this network for this transaction."),u?.fiatOnRamp.enabled&&be(!0))}catch(Do){console.warn(`Failed to fetch wallet balance with error: ${Do}`)}Ie(!1)}(0,xt.useEffect)(()=>{Ms(Ze)},[o]);let ui=h3(Ze),mi=ui==="SEND"?`Send ${ut}`:"Review transaction",Aa={modalTitle:E.header||E.modalTitle||mi,buttonText:E.buttonText||"Submit"},ot=()=>{le||(I?P(I):S(re||new ct(new Sr("The user rejected the request",Gt.E4001_USER_REJECTED_REQUEST.eipCode))),n({shouldCallAuthOnSuccess:!1}))};return v.current=ot,Ur===void 0&&cr||ce?(0,Le.jsxs)(Le.Fragment,{children:[E.transactionInfo?.contractInfo?.imgUrl&&(0,Le.jsx)(bl,{src:E.transactionInfo?.contractInfo?.imgUrl}),(0,Le.jsx)(A,{title:Aa.modalTitle,onClose:ot}),(0,Le.jsx)(_3,{children:(0,Le.jsx)(ji,{})})]}):R!==null?(0,Le.jsx)(P3,{txn:Ze,onClose:ot,receipt:R,transactionInfo:E.transactionInfo,tokenPrice:Ur,tokenSymbol:ut,l1GasEstimate:Fe,receiptHeader:E.successHeader,receiptDescription:E.successDescription}):K?(0,Le.jsx)(E3,{transactionError:K,chainId:Ze.chainId,onClose:ot,onRetry:({resetNonce:vt})=>{Ee();let Ct=Ze;vt&&(Ct={...Ze,nonce:void 0}),Ms(Ct)}}):(0,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)(A,{title:Aa.modalTitle,onClose:ot}),(0,Le.jsxs)(_3,{children:[(0,Le.jsxs)(k5,{children:[(0,Le.jsx)(_5,{txn:Ze,txnFamily:ui,uiOptions:E,tokenSymbol:ut,tokenPrice:Ur}),rt?(0,Le.jsx)(ha,{from:rt.address,to:Ze.to,txn:Ze,transactionInfo:E.transactionInfo,gas:N||void 0,tokenPrice:Ur,tokenSymbol:ut}):null]}),(0,Le.jsxs)(R5,{children:[(0,Le.jsx)(S5,{children:V}),(0,Le.jsx)(b2,{txn:Ze,address:rt?.address??"",hasFunds:_t,balance:kt}),(0,Le.jsxs)(A5,{children:[ge&&(0,Le.jsx)(U,{onClick:md,children:"Add Funds"}),(0,Le.jsx)(x5,{disabled:le||!_t,loading:!o||le,loadingText:le?"Submitting (may take a few moments)...":"Loading...",onClick:async()=>{tr(!0);let vt=await t();if(vt&&!le&&rt)try{let Ct=await Zc(vt,rt.address,o,Ze,pi);M(Ct);let fi=await Ct.wait();D(Qc(fi)),Ee()}catch(Ct){console.warn({transaction:Ze,error:Ct}),O(Ct),L(new ct(new Sr(Ct.reason??"Error processing transaction",Gt.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))}finally{tr(!1)}},children:Aa.buttonText})]})]})]})]})},_3=li.default.div`
2418
2441
  display: flex;
2419
2442
  flex-direction: column;
2420
2443
  justify-content: space-between;
2421
2444
  flex-grow: 1;
2422
2445
  padding-bottom: 16px;
2423
- `,c5=ai.default.div`
2446
+ `,S5=li.default.div`
2424
2447
  font-size: 13px;
2425
2448
  color: var(--privy-color-error);
2426
2449
  width: 100%;
2427
2450
  margin-top: 16px;
2428
- `,d5=ai.default.div`
2451
+ `,A5=li.default.div`
2429
2452
  display: flex;
2430
2453
  direction: row;
2431
2454
  justify-content: space-between;
2432
2455
  align-items: center;
2433
2456
  gap: 8px;
2434
- `,p5=(0,ai.default)(D)`
2457
+ `,x5=(0,li.default)(U)`
2435
2458
  transition: color 350ms ease, background-color 350ms ease;
2436
- `,u5=ai.default.div`
2459
+ `,k5=li.default.div`
2437
2460
  height: 100%;
2438
2461
  display: flex;
2439
2462
  flex-direction: column;
2440
2463
  justify-content: space-evenly;
2441
2464
  flex-grow: 1;
2442
- `,m5=ai.default.div`
2465
+ `,R5=li.default.div`
2443
2466
  display: flex;
2444
2467
  flex-direction: column;
2445
2468
  gap: 8px;
2446
- `;var y3=require("@ethersproject/bytes"),g3=require("@ethersproject/strings"),kn=require("react"),go=h(require("styled-components"));var Oe=require("react/jsx-runtime"),f5=e=>{if(!(0,y3.isHexString)(e))return e;try{return(0,g3.toUtf8String)(e)}catch{return e}},h5=e=>JSON.stringify(e,null,2),y5=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?(0,Oe.jsx)(b5,{children:Object.entries(r).map(([o,n])=>(0,Oe.jsxs)("li",{children:[(0,Oe.jsxs)("strong",{children:[o,":"]})," ",t(n)]},o))}):(0,Oe.jsx)("span",{children:String(r)});return(0,Oe.jsx)("div",{children:t(e)})},g5=e=>{let{types:t,primaryType:r,...o}=e.typedData;return(0,Oe.jsxs)(Oe.Fragment,{children:[(0,Oe.jsx)(C3,{children:(0,Oe.jsx)(y5,{data:o})}),(0,Oe.jsx)(bn,{text:h5(e.typedData),itemName:"full payload to clipboard"})," "]})},v3=()=>{let{authenticated:e}=G(),{initializeWalletProxy:t,closePrivyModal:r}=W(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:i}=k(),[a,l]=(0,kn.useState)(!0),[s,c]=(0,kn.useState)(""),[u,y]=(0,kn.useState)(),[f,v]=(0,kn.useState)(null),C=f!==null;(0,kn.useEffect)(()=>{e||o("LANDING")},[e]),(0,kn.useEffect)(()=>{t(gi).then(I=>{l(!1),I||(c("An error has occurred, please try again."),y(new ct(new _r(s,Ht.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:g,data:_,confirmAndSign:x,onSuccess:b,onFailure:A,uiOptions:R}=n.signMessage,U={title:R.title||"Sign message",description:R.description||"Signing this message will not cost you any fees.",buttonText:R.buttonText||"Sign and continue"},M=I=>{I?b(I):A(u||new ct(new _r("The user rejected the request.",Ht.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),v(null),c(""),y(void 0)};return i.current=()=>{M(f)},(0,Oe.jsxs)(Oe.Fragment,{children:[(0,Oe.jsx)(S,{onClose:()=>M(f)}),(0,Oe.jsx)(ae,{}),(0,Oe.jsxs)(v5,{children:[(0,Oe.jsx)(C5,{children:U.title}),(0,Oe.jsx)(w5,{children:U.description}),g==="personal_sign"&&(0,Oe.jsx)(C3,{children:f5(_)}),g==="eth_signTypedData_v4"&&(0,Oe.jsx)(g5,{typedData:_}),(0,Oe.jsx)(E5,{fail:!0,children:s}),(0,Oe.jsx)(P5,{success:C,loading:a,disabled:C,onClick:async()=>{try{let I=await x();v(I),c(""),setTimeout(()=>{M(I)},it)}catch(I){console.error(I),c("An error has occurred, please try again."),y(new ct(new _r(s,Ht.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))}},children:C?(0,Oe.jsxs)(T5,{children:[(0,Oe.jsx)(mc,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",(0,Oe.jsx)("span",{children:"Success"})]}):U.buttonText})]}),(0,Oe.jsx)(me,{}),(0,Oe.jsx)(K,{protectedByPrivy:!0})]})},v5=go.default.div`
2469
+ `;var A3=require("@ethersproject/bytes"),x3=require("@ethersproject/strings"),rn=require("react"),Rn=y(require("styled-components"));var Oe=require("react/jsx-runtime"),I5=e=>{if(!(0,A3.isHexString)(e))return e;try{return(0,x3.toUtf8String)(e)}catch{return e}},M5=e=>JSON.stringify(e,null,2),W5=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?(0,Oe.jsx)(U5,{children:Object.entries(r).map(([o,n])=>(0,Oe.jsxs)("li",{children:[(0,Oe.jsxs)("strong",{children:[o,":"]})," ",t(n)]},o))}):(0,Oe.jsx)("span",{children:String(r)});return(0,Oe.jsx)("div",{children:t(e)})},L5=e=>{let{types:t,primaryType:r,...o}=e.typedData;return(0,Oe.jsxs)(Oe.Fragment,{children:[(0,Oe.jsx)(R3,{children:(0,Oe.jsx)(W5,{data:o})}),(0,Oe.jsx)(En,{text:M5(e.typedData),itemName:"full payload to clipboard"})," "]})},k3=()=>{let{authenticated:e}=H(),{initializeWalletProxy:t,closePrivyModal:r}=W(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:i}=k(),[a,s]=(0,rn.useState)(!0),[l,c]=(0,rn.useState)(""),[u,f]=(0,rn.useState)(),[h,v]=(0,rn.useState)(null),[C,g]=(0,rn.useState)(!1),P=h!==null;(0,rn.useEffect)(()=>{e||o("LANDING")},[e]),(0,rn.useEffect)(()=>{t(Ci).then(z=>{s(!1),z||(c("An error has occurred, please try again."),f(new ct(new Sr(l,Gt.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:S,data:E,confirmAndSign:x,onSuccess:R,onFailure:D,uiOptions:I}=n.signMessage,M={title:I.title||"Sign message",description:I.description||"Signing this message will not cost you any fees.",buttonText:I.buttonText||"Sign and continue"},V=z=>{z?R(z):D(u||new ct(new Sr("The user rejected the request.",Gt.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout(()=>{v(null),c(""),f(void 0)},200)};return i.current=()=>{V(h)},(0,Oe.jsxs)(Oe.Fragment,{children:[(0,Oe.jsx)(A,{onClose:()=>V(h)}),(0,Oe.jsx)(ae,{}),(0,Oe.jsxs)(O5,{children:[(0,Oe.jsx)(N5,{children:M.title}),(0,Oe.jsx)(D5,{children:M.description}),S==="personal_sign"&&(0,Oe.jsx)(R3,{children:I5(E)}),S==="eth_signTypedData_v4"&&(0,Oe.jsx)(L5,{typedData:E}),(0,Oe.jsx)(F5,{fail:!0,children:l}),(0,Oe.jsx)(Df,{disabled:C||P||a,loading:C,onClick:async()=>{g(!0),c("");try{let z=await x();v(z),g(!1),setTimeout(()=>{V(z)},et)}catch(z){console.error(z),c("An error has occurred, please try again."),f(new ct(new Sr(l,Gt.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),g(!1)}},children:C?"Signing...":P?(0,Oe.jsxs)(B5,{children:[(0,Oe.jsx)(vc,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",(0,Oe.jsx)("span",{children:"Success"})]}):M.buttonText})]}),(0,Oe.jsx)(pe,{}),(0,Oe.jsx)(j,{protectedByPrivy:!0})]})},O5=Rn.default.div`
2447
2470
  display: flex;
2448
2471
  flex-direction: column;
2449
2472
  align-items: center;
2450
2473
  justify-content: center;
2451
- `,C5=go.default.span`
2474
+ `,N5=Rn.default.span`
2452
2475
  color: var(--privy-color-foreground);
2453
2476
  text-align: center;
2454
2477
  font-size: 1.125rem;
2455
2478
  font-weight: 500;
2456
2479
  line-height: 1.25rem; /* 111.111% */
2457
2480
  text-align: center;
2458
- `,w5=go.default.span`
2481
+ `,D5=Rn.default.span`
2459
2482
  margin-top: 4px;
2460
2483
  color: var(--privy-color-foreground);
2461
2484
  text-align: center;
@@ -2465,7 +2488,7 @@ You will have to sign up with another method first to register a passkey for you
2465
2488
  font-weight: 400;
2466
2489
  line-height: 20px; /* 142.857% */
2467
2490
  letter-spacing: -0.008px;
2468
- `,C3=go.default.div`
2491
+ `,R3=Rn.default.div`
2469
2492
  margin-top: 1.5rem;
2470
2493
  background-color: var(--privy-color-background-2);
2471
2494
  border-radius: var(--privy-border-radius-md);
@@ -2484,7 +2507,7 @@ You will have to sign up with another method first to register a passkey for you
2484
2507
  display: none; /* Safari and Chrome */
2485
2508
  }
2486
2509
  }
2487
- `,b5=go.default.ul`
2510
+ `,U5=Rn.default.ul`
2488
2511
  margin-left: 12px !important;
2489
2512
  white-space: nowrap;
2490
2513
 
@@ -2496,7 +2519,7 @@ You will have to sign up with another method first to register a passkey for you
2496
2519
  font-weight: 500 !important;
2497
2520
  }
2498
2521
  }
2499
- `,E5=go.default.div`
2522
+ `,F5=Rn.default.div`
2500
2523
  line-height: 20px;
2501
2524
  height: 20px;
2502
2525
  font-size: 13px;
@@ -2506,20 +2529,11 @@ You will have to sign up with another method first to register a passkey for you
2506
2529
  width: 100%;
2507
2530
  margin-top: 16px;
2508
2531
  margin-bottom: 4px;
2509
- `,T5=go.default.span`
2532
+ `,B5=Rn.default.span`
2510
2533
  display: flex;
2511
2534
  align-items: center;
2512
2535
  gap: 8px;
2513
- `,P5=(0,go.default)(D)`
2514
- transition: color 350ms ease, background-color 350ms ease;
2515
-
2516
- ${e=>e.success&&go.css`
2517
- &&&& {
2518
- background-color: var(--privy-color-success);
2519
- color: #ffffff;
2520
- }
2521
- `}
2522
- `;var Ca=require("react"),w3=h(require("styled-components"));var Ut=require("react/jsx-runtime"),b3=()=>{let{authenticated:e,logout:t,ready:r,user:o}=G(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=k(),{initLoginWithTelegram:s,loginWithTelegram:c,updateWallets:u,setReadyToTrue:y,closePrivyModal:f,createAnalyticsEvent:v}=W(),[C,g]=(0,Ca.useState)(!1),[_,x]=(0,Ca.useState)(void 0),b=it;async function A(){try{await c(),g(!0),y(!0)}catch(M){if(M?.privyErrorCode==="allowlist_rejected"){x(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(M?.privyErrorCode==="max_accounts_reached"){console.error(new Ur(M).toString()),x(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}let{retryable:I,detail:V}=Td(M);x({retryable:I,detail:V,message:"Authentication failed"})}}(0,Ca.useEffect)(()=>{A()},[]),(0,Ca.useEffect)(()=>{if(!(r&&e&&C&&o))return;if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let V=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},b);return()=>clearTimeout(V)}if(pr(o,n?.embeddedWallets?.createOnLogin)){let V=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:j=>{console.error(j),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:j,provider:"telegram",screen:"TelegramAuthScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},b);return()=>clearTimeout(V)}u();let I=setTimeout(()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0}),b);return()=>clearTimeout(I)},[r,e,C,o]);let R=C?"Successfully connected with Telegram":_?_.message:"Verifying connection to Telegram",U="";return C?U="You\u2019re good to go!":_?U=_.detail:U="Just a few moments more",(0,Ut.jsxs)(Ut.Fragment,{children:[(0,Ut.jsx)(S,{}),(0,Ut.jsx)(ae,{}),(0,Ut.jsxs)(S5,{children:[(0,Ut.jsx)(Mt,{children:(0,Ut.jsxs)("div",{children:[(0,Ut.jsx)(At,{success:C,fail:!!_}),(0,Ut.jsx)(kc,{style:{width:"38px",height:"38px"}})]})}),(0,Ut.jsxs)(wt,{children:[(0,Ut.jsx)("h3",{children:R}),(0,Ut.jsx)("p",{children:U})]}),_&&_?.retryable?(0,Ut.jsx)(Wi,{onClick:()=>{s().then(async()=>A()).catch(M=>{let{retryable:I,detail:V}=Td(M);x({retryable:I,detail:V,message:"Authentication failed"})}),x(void 0)},disabled:!C&&!_?.retryable,children:"Retry"}):null]}),(0,Ut.jsx)(me,{}),(0,Ut.jsx)(q,{})]})},S5=w3.default.div`
2536
+ `;var Pa=require("react"),I3=y(require("styled-components"));var Ft=require("react/jsx-runtime"),M3=()=>{let{authenticated:e,logout:t,ready:r,user:o}=H(),{app:n,setModalData:i,navigate:a,resetNavigation:s}=k(),{initLoginWithTelegram:l,loginWithTelegram:c,updateWallets:u,setReadyToTrue:f,closePrivyModal:h,createAnalyticsEvent:v}=W(),[C,g]=(0,Pa.useState)(!1),[P,S]=(0,Pa.useState)(void 0),E=et;async function x(){try{await c(),g(!0),f(!0)}catch(I){if(I?.privyErrorCode==="allowlist_rejected"){S(void 0),s(),a("ALLOWLIST_REJECTION_SCREEN");return}if(I?.privyErrorCode==="max_accounts_reached"){console.error(new Fr(I).toString()),S(void 0),s(),a("USER_LIMIT_REACHED_SCREEN");return}let{retryable:M,detail:V}=Rd(I);S({retryable:M,detail:V,message:"Authentication failed"})}}(0,Pa.useEffect)(()=>{x()},[]),(0,Pa.useEffect)(()=>{if(!(r&&e&&C&&o))return;if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let V=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},E);return()=>clearTimeout(V)}if(mr(o,n?.embeddedWallets?.createOnLogin)){let V=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:z=>{console.error(z),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:z,provider:"telegram",screen:"TelegramAuthScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},E);return()=>clearTimeout(V)}u();let M=setTimeout(()=>h({shouldCallAuthOnSuccess:!0,isSuccess:!0}),E);return()=>clearTimeout(M)},[r,e,C,o]);let R=C?"Successfully connected with Telegram":P?P.message:"Verifying connection to Telegram",D="";return C?D="You\u2019re good to go!":P?D=P.detail:D="Just a few moments more",(0,Ft.jsxs)(Ft.Fragment,{children:[(0,Ft.jsx)(A,{}),(0,Ft.jsx)(ae,{}),(0,Ft.jsxs)(H5,{children:[(0,Ft.jsx)(Et,{children:(0,Ft.jsxs)("div",{children:[(0,Ft.jsx)(wt,{success:C,fail:!!P}),(0,Ft.jsx)(Lc,{style:{width:"38px",height:"38px"}})]})}),(0,Ft.jsxs)(dt,{children:[(0,Ft.jsx)("h3",{children:R}),(0,Ft.jsx)("p",{children:D})]}),P&&P?.retryable?(0,Ft.jsx)(Di,{onClick:()=>{l().then(async()=>x()).catch(I=>{let{retryable:M,detail:V}=Rd(I);S({retryable:M,detail:V,message:"Authentication failed"})}),S(void 0)},disabled:!C&&!P?.retryable,children:"Retry"}):null]}),(0,Ft.jsx)(pe,{}),(0,Ft.jsx)($,{})]})},H5=I3.default.div`
2523
2537
  display: flex;
2524
2538
  flex-direction: column;
2525
2539
  align-items: center;
@@ -2527,9 +2541,9 @@ You will have to sign up with another method first to register a passkey for you
2527
2541
  margin-left: 27px;
2528
2542
  margin-right: 27px;
2529
2543
  gap: 24px;
2530
- `;var P3=h(require("@heroicons/react/24/outline/EnvelopeIcon"));var E3=h(require("@heroicons/react/24/outline/EnvelopeIcon")),Es=require("react"),jp=h(require("styled-components"));var vo=require("react/jsx-runtime"),T3=(0,Es.forwardRef)((e,t)=>{let[r,o]=(0,Es.useState)(""),[n,i]=(0,Es.useState)(!1),{authenticated:a,user:l}=G(),{initUpdateEmail:s}=W(),{navigate:c,setModalData:u,currentScreen:y}=k(),{enabled:f,token:v}=_e(),C=Bs(r),g=n,_=n||!C,x=async A=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");i(!0);try{await s(l.email.address,r,A),c("AWAITING_PASSWORDLESS_CODE")}catch(R){u({errorModalData:{error:R,previousScreen:y||"LANDING"}})}i(!1)},b=()=>{f&&!v&&!a?(u({captchaModalData:{callback:A=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");return s(l.email.address,r,A)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):x(v)};return(0,vo.jsxs)(vo.Fragment,{children:[(0,vo.jsx)(_5,{children:(0,vo.jsxs)(x5,{children:[(0,vo.jsx)(E3.default,{}),(0,vo.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:A=>o(A.target.value),onKeyUp:A=>{A.key==="Enter"&&b()},value:r,autoComplete:"email"}),e.stacked?null:(0,vo.jsx)(Li,{isSubmitting:g,onClick:b,disabled:_,children:"Submit"})]})}),e.stacked?(0,vo.jsx)(D,{loadingText:null,loading:g,disabled:_,onClick:b,children:"Submit"}):null]})}),_5=jp.default.div`
2544
+ `;var O3=y(require("@heroicons/react/24/outline/EnvelopeIcon"));var W3=y(require("@heroicons/react/24/outline/EnvelopeIcon")),ks=require("react"),ru=y(require("styled-components"));var Co=require("react/jsx-runtime"),L3=(0,ks.forwardRef)((e,t)=>{let[r,o]=(0,ks.useState)(""),[n,i]=(0,ks.useState)(!1),{authenticated:a,user:s}=H(),{initUpdateEmail:l}=W(),{navigate:c,setModalData:u,currentScreen:f}=k(),{enabled:h,token:v}=Ae(),C=Ys(r),g=n,P=n||!C,S=async x=>{if(!s?.email)throw new Error("User is required to have an email address to update it.");i(!0);try{await l(s.email.address,r,x),c("AWAITING_PASSWORDLESS_CODE")}catch(R){u({errorModalData:{error:R,previousScreen:f||"LANDING"}})}i(!1)},E=()=>{h&&!v&&!a?(u({captchaModalData:{callback:x=>{if(!s?.email)throw new Error("User is required to have an email address to update it.");return l(s.email.address,r,x)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):S(v)};return(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(G5,{children:(0,Co.jsxs)(V5,{children:[(0,Co.jsx)(W3.default,{}),(0,Co.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:x=>o(x.target.value),onKeyUp:x=>{x.key==="Enter"&&E()},value:r,autoComplete:"email"}),e.stacked?null:(0,Co.jsx)(Ui,{isSubmitting:g,onClick:E,disabled:P,children:"Submit"})]})}),e.stacked?(0,Co.jsx)(U,{loadingText:null,loading:g,disabled:P,onClick:E,children:"Submit"}):null]})}),G5=ru.default.div`
2531
2545
  width: 100%;
2532
- `,x5=jp.default.label`
2546
+ `,V5=ru.default.label`
2533
2547
  display: block;
2534
2548
  position: relative;
2535
2549
  width: 100%;
@@ -2587,7 +2601,7 @@ You will have to sign up with another method first to register a passkey for you
2587
2601
  && > input::placeholder {
2588
2602
  color: var(--privy-color-foreground-3);
2589
2603
  }
2590
- `;var Or=require("react/jsx-runtime"),S3=()=>(0,Or.jsxs)(Or.Fragment,{children:[(0,Or.jsx)(S,{},"header"),(0,Or.jsx)(ae,{}),(0,Or.jsx)(Ve,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:(0,Or.jsx)(P3.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,Or.jsx)(Vr,{children:(0,Or.jsx)(T3,{stacked:!0})}),(0,Or.jsx)(me,{}),(0,Or.jsx)(K,{protectedByPrivy:!0})]});var Xc=h(require("styled-components"));var Yp=require("react/jsx-runtime"),_3=({style:e,...t})=>(0,Yp.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...e},...t,children:(0,Yp.jsx)("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})});var br=require("react/jsx-runtime"),x3=()=>{let{navigate:e}=k();return(0,br.jsxs)(br.Fragment,{children:[(0,br.jsx)(S,{}),(0,br.jsxs)(A5,{children:[(0,br.jsx)(k5,{children:(0,br.jsx)(_3,{})}),(0,br.jsxs)(R5,{children:[(0,br.jsx)("h3",{children:"Unable to sign in"}),(0,br.jsx)("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),(0,br.jsx)(D,{onClick:()=>{e("LANDING")},children:"Go back"})]}),(0,br.jsx)(K,{protectedByPrivy:!0})]})},A5=Xc.default.div`
2604
+ `;var Nr=require("react/jsx-runtime"),N3=()=>(0,Nr.jsxs)(Nr.Fragment,{children:[(0,Nr.jsx)(A,{},"header"),(0,Nr.jsx)(ae,{}),(0,Nr.jsx)(Ve,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:(0,Nr.jsx)(O3.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,Nr.jsx)(Vr,{children:(0,Nr.jsx)(L3,{stacked:!0})}),(0,Nr.jsx)(pe,{}),(0,Nr.jsx)(j,{protectedByPrivy:!0})]});var nd=y(require("styled-components"));var ou=require("react/jsx-runtime"),D3=({style:e,...t})=>(0,ou.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...e},...t,children:(0,ou.jsx)("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})});var Er=require("react/jsx-runtime"),U3=()=>{let{navigate:e}=k();return(0,Er.jsxs)(Er.Fragment,{children:[(0,Er.jsx)(A,{}),(0,Er.jsxs)(z5,{children:[(0,Er.jsx)(q5,{children:(0,Er.jsx)(D3,{})}),(0,Er.jsxs)($5,{children:[(0,Er.jsx)("h3",{children:"Unable to sign in"}),(0,Er.jsx)("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),(0,Er.jsx)(U,{onClick:()=>{e("LANDING")},children:"Go back"})]}),(0,Er.jsx)(j,{protectedByPrivy:!0})]})},z5=nd.default.div`
2591
2605
  display: flex;
2592
2606
  flex-direction: column;
2593
2607
  align-items: center;
@@ -2596,7 +2610,7 @@ You will have to sign up with another method first to register a passkey for you
2596
2610
  width: 100%;
2597
2611
  padding-top: 8px;
2598
2612
  padding-bottom: 32px;
2599
- `,k5=Xc.default.div`
2613
+ `,q5=nd.default.div`
2600
2614
  display: flex;
2601
2615
  align-items: center;
2602
2616
  justify-content: center;
@@ -2605,11 +2619,11 @@ You will have to sign up with another method first to register a passkey for you
2605
2619
  color: var(--privy-color-error);
2606
2620
  background-color: var(--privy-color-error-light);
2607
2621
  border-radius: 50%;
2608
- `,R5=Xc.default.div`
2622
+ `,$5=nd.default.div`
2609
2623
  display: flex;
2610
2624
  flex-direction: column;
2611
2625
  gap: 8px;
2612
- `;var ed=h(require("styled-components"));var I5=`
2626
+ `;var id=y(require("styled-components"));var K5=`
2613
2627
  *,
2614
2628
  ::before,
2615
2629
  ::after {
@@ -2839,7 +2853,7 @@ You will have to sign up with another method first to register a passkey for you
2839
2853
  [hidden] {
2840
2854
  display: none;
2841
2855
  }
2842
- `,A3=I5;var k3=ed.createGlobalStyle`
2856
+ `,F3=K5;var B3=id.createGlobalStyle`
2843
2857
  :root {
2844
2858
  // Borders
2845
2859
  --privy-border-radius-sm: 6px;
@@ -2872,10 +2886,10 @@ You will have to sign up with another method first to register a passkey for you
2872
2886
  --privy-height-modal-full: 620px;
2873
2887
  --privy-height-modal-compact: 480px;
2874
2888
  };
2875
- `,Zp=ed.default.div`
2889
+ `,nu=id.default.div`
2876
2890
  // css normalize only the privy application to avoid conflicts
2877
2891
  // with consuming application
2878
- ${A3}
2892
+ ${F3}
2879
2893
 
2880
2894
  // Privy styles
2881
2895
  color: var(--privy-color-foreground-2);
@@ -2910,14 +2924,6 @@ You will have to sign up with another method first to register a passkey for you
2910
2924
  box-shadow: 0 0 0 1px var(--privy-color-accent-light);
2911
2925
  }
2912
2926
 
2913
- /* Utilities when you can't add an additional span tag for mobile formatting */
2914
-
2915
- .hide-on-mobile {
2916
- @media (max-width: 440px) {
2917
- display: none;
2918
- }
2919
- }
2920
-
2921
2927
  .mobile-only {
2922
2928
  @media (min-width: 441px) {
2923
2929
  display: none;
@@ -2934,7 +2940,7 @@ You will have to sign up with another method first to register a passkey for you
2934
2940
  opacity: 1;
2935
2941
  }
2936
2942
  }
2937
- `;var si=require("@headlessui/react"),td=h(require("react")),wa=h(require("styled-components")),tn=require("react/jsx-runtime"),R3=({children:e,open:t,onClick:r,...o})=>(0,tn.jsx)(si.Transition,{show:t,as:td.default.Fragment,children:(0,tn.jsxs)(si.Dialog,{onClose:r,...o,as:W5,children:[(0,tn.jsx)(si.Transition.Child,{as:td.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,tn.jsx)(M5,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),(0,tn.jsx)(L5,{children:(0,tn.jsx)(si.Transition.Child,{as:td.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,tn.jsx)(si.Dialog.Panel,{as:O5,children:e})})})]})}),M5=wa.default.div`
2943
+ `;var ci=require("@headlessui/react"),ad=y(require("react")),_a=y(require("styled-components")),on=require("react/jsx-runtime"),H3=({children:e,open:t,onClick:r,...o})=>(0,on.jsx)(ci.Transition,{show:t,as:ad.default.Fragment,children:(0,on.jsxs)(ci.Dialog,{onClose:r,...o,as:Y5,children:[(0,on.jsx)(ci.Transition.Child,{as:ad.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,on.jsx)(j5,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),(0,on.jsx)(Z5,{children:(0,on.jsx)(ci.Transition.Child,{as:ad.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,on.jsx)(ci.Dialog.Panel,{as:J5,children:e})})})]})}),j5=_a.default.div`
2938
2944
  position: fixed;
2939
2945
  inset: 0;
2940
2946
 
@@ -2947,10 +2953,10 @@ You will have to sign up with another method first to register a passkey for you
2947
2953
  backdrop-filter: unset;
2948
2954
  -webkit-backdrop-filter: unset;
2949
2955
  }
2950
- `,W5=wa.default.div`
2956
+ `,Y5=_a.default.div`
2951
2957
  position: relative;
2952
2958
  z-index: 999999;
2953
- `,L5=wa.default.div`
2959
+ `,Z5=_a.default.div`
2954
2960
  position: fixed;
2955
2961
  inset: 0;
2956
2962
  display: flex;
@@ -2958,7 +2964,7 @@ You will have to sign up with another method first to register a passkey for you
2958
2964
  justify-content: center;
2959
2965
  width: 100vw;
2960
2966
  min-height: 100vh;
2961
- `,O5=wa.default.div`
2967
+ `,J5=_a.default.div`
2962
2968
  // reset some default dialog styles
2963
2969
  padding: 0;
2964
2970
  background: transparent;
@@ -3005,13 +3011,13 @@ You will have to sign up with another method first to register a passkey for you
3005
3011
  box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
3006
3012
  border-radius: var(--privy-border-radius-lg);
3007
3013
  }
3008
- `,I3=wa.default.div`
3014
+ `,G3=_a.default.div`
3009
3015
  display: flex;
3010
3016
  flex-direction: column;
3011
3017
  align-items: center;
3012
3018
  justify-content: center;
3013
3019
  height: 100%;
3014
- `;var Ye=require("react/jsx-runtime"),N5={["LANDING"]:J1,["CONNECT_OR_CREATE"]:Z1,["AWAITING_PASSWORDLESS_CODE"]:Xf,["AWAITING_CONNECTION"]:Sh,["AWAITING_CONNECT_ONLY_CONNECTION"]:Ah,["AWAITING_FARCASTER_CONNECTION"]:Zy,["AWAITING_FARCASTER_SIGNER"]:e1,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:B2,["PHANTOM_INTERSTITIAL_SCREEN"]:z2,["LOGIN_FAILED_SCREEN"]:mg,["AWAITING_OAUTH_SCREEN"]:F2,["ALLOWLIST_REJECTION_SCREEN"]:Gf,["USER_LIMIT_REACHED_SCREEN"]:x3,["INSTALL_PHANTOM_SCREEN"]:E1,["LINK_EMAIL_SCREEN"]:X1,["LINK_PHONE_SCREEN"]:dg,["LINK_WALLET_SCREEN"]:pg,["LINK_PASSKEY_SCREEN"]:sg,["UPDATE_EMAIL_SCREEN"]:S3,["CONNECT_ONLY_LANDING_SCREEN"]:Eh,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:yh,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:$h,["EMBEDDED_WALLET_CREATED_SCREEN"]:Uh,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:Oh,["EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN"]:$2,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:o3,["EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN"]:Y2,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:Vh,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:v3,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:h3,["FIAT_ON_RAMP_PROMPT_SCREEN"]:c1,["FIAT_ON_RAMP_STATUS_SCREEN"]:f1,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:Wy,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:ky,["EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN"]:Z2,["MFA_ENROLLMENT_FLOW_SCREEN"]:qg,["CAPTCHA_SCREEN"]:sh,["ERROR_SCREEN"]:Ny,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:g1,["AFFIRMATIVE_CONSENT_SCREEN"]:Ff,["TELEGRAM_AUTH_SCREEN"]:b3},D5=["LANDING","AWAITING_CONNECTION"],M3=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=G(),{headless:n}=Kt(),{ready:i,currentScreen:a}=k(),{status:l,execute:s,reset:c,enabled:u}=_e(),y=o&&a&&D5.includes(a)&&!n&&l==="ready";if((0,rn.useEffect)(()=>{y&&s()},[y]),(0,rn.useEffect)(()=>{!o&&u&&c()},[o,u]),(!r||!i)&&a!=="AWAITING_OAUTH_SCREEN"&&a!=="TELEGRAM_AUTH_SCREEN")return(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(S,{}),(0,Ye.jsx)(ae,{}),(0,Ye.jsx)(I3,{children:(0,Ye.jsx)(kt,{})}),(0,Ye.jsx)(me,{}),(0,Ye.jsx)(q,{})]});if(!a&&e)return(0,Ye.jsx)(Vp,{open:e,onClose:t});if(!a)return null;let f=N5[a];return(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(so,{if:!!e,children:(0,Ye.jsx)(f,{})}),(0,Ye.jsx)(so,{if:!e,children:(0,Ye.jsx)(Vp,{open:e,onClose:t})})]})},U5=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let r=(0,rn.useRef)(null),o=xf(r);return(0,Ye.jsx)(B5,{style:{height:o},id:"privy-modal-content",children:(0,Ye.jsx)("div",{ref:r,children:(0,Ye.jsx)(M3,{isMfaVerifying:e,onMfaVerificationComplete:t})})})},F5=()=>{let{closePrivyModal:e}=W(),{onUserCloseViaDialogOrKeybindRef:t}=k();return{gracefulClosePrivyModal:(0,rn.useCallback)(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},rd=({open:e})=>{let{app:t}=k(),{gracefulClosePrivyModal:r}=F5(),[o,n]=(0,rn.useState)(!1);Bl({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=e||o;return t.render.standalone?(0,Ye.jsx)(Zp,{children:(0,Ye.jsx)(W3,{children:(0,Ye.jsx)(M3,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})}):(0,Ye.jsx)(R3,{open:i,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:(0,Ye.jsx)(Zp,{children:(0,Ye.jsx)(U5,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})})},W3=Jp.default.div`
3020
+ `;var Ye=require("react/jsx-runtime"),Q5={["LANDING"]:l1,["CONNECT_OR_CREATE"]:s1,["AWAITING_PASSWORDLESS_CODE"]:sh,["AWAITING_CONNECTION"]:Wh,["AWAITING_CONNECT_ONLY_CONNECTION"]:Nh,["AWAITING_FARCASTER_CONNECTION"]:sg,["AWAITING_FARCASTER_SIGNER"]:pg,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:J2,["PHANTOM_INTERSTITIAL_SCREEN"]:t3,["LOGIN_FAILED_SCREEN"]:P1,["AWAITING_OAUTH_SCREEN"]:Z2,["CROSS_APP_AUTH_SCREEN"]:Fh,["ALLOWLIST_REJECTION_SCREEN"]:Zf,["USER_LIMIT_REACHED_SCREEN"]:U3,["INSTALL_PHANTOM_SCREEN"]:Wg,["LINK_EMAIL_SCREEN"]:d1,["LINK_PHONE_SCREEN"]:b1,["LINK_WALLET_SCREEN"]:E1,["LINK_PASSKEY_SCREEN"]:v1,["UPDATE_EMAIL_SCREEN"]:N3,["CONNECT_ONLY_LANDING_SCREEN"]:Rh,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:Ph,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:oy,["EMBEDDED_WALLET_CREATED_SCREEN"]:Yh,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:$h,["EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN"]:o3,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:f3,["EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN"]:a3,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:ey,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:k3,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:S3,["FIAT_ON_RAMP_PROMPT_SCREEN"]:wg,["FIAT_ON_RAMP_STATUS_SCREEN"]:_g,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:zy,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:By,["EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN"]:s3,["MFA_ENROLLMENT_FLOW_SCREEN"]:r2,["CAPTCHA_SCREEN"]:hh,["ERROR_SCREEN"]:Ky,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:xg,["AFFIRMATIVE_CONSENT_SCREEN"]:Kf,["TELEGRAM_AUTH_SCREEN"]:M3},X5=["LANDING","AWAITING_CONNECTION"],V3=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=H(),{headless:n}=It(),{ready:i,currentScreen:a}=k(),{status:s,execute:l,reset:c,enabled:u}=Ae(),f=o&&a&&X5.includes(a)&&!n&&s==="ready";if((0,nn.useEffect)(()=>{f&&l()},[f]),(0,nn.useEffect)(()=>{!o&&u&&c()},[o,u]),(!r||!i)&&a!=="AWAITING_OAUTH_SCREEN"&&a!=="CROSS_APP_AUTH_SCREEN"&&a!=="TELEGRAM_AUTH_SCREEN")return(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(A,{}),(0,Ye.jsx)(ae,{}),(0,Ye.jsx)(G3,{children:(0,Ye.jsx)(Mt,{})}),(0,Ye.jsx)(pe,{}),(0,Ye.jsx)($,{})]});if(!a&&e)return(0,Ye.jsx)(Jp,{open:e,onClose:t});if(!a)return null;let h=Q5[a];return(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(co,{if:!!e,children:(0,Ye.jsx)(h,{})}),(0,Ye.jsx)(co,{if:!e,children:(0,Ye.jsx)(Jp,{open:e,onClose:t})})]})},e6=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let r=(0,nn.useRef)(null),o=Lf(r);return(0,Ye.jsx)(r6,{style:{height:o},id:"privy-modal-content",children:(0,Ye.jsx)("div",{ref:r,children:(0,Ye.jsx)(V3,{isMfaVerifying:e,onMfaVerificationComplete:t})})})},t6=()=>{let{closePrivyModal:e}=W(),{onUserCloseViaDialogOrKeybindRef:t}=k();return{gracefulClosePrivyModal:(0,nn.useCallback)(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},sd=({open:e})=>{let{app:t}=k(),{gracefulClosePrivyModal:r}=t6(),[o,n]=(0,nn.useState)(!1);$l({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=e||o;return t.render.standalone?(0,Ye.jsx)(nu,{children:(0,Ye.jsx)(z3,{children:(0,Ye.jsx)(V3,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})}):(0,Ye.jsx)(H3,{open:i,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:(0,Ye.jsx)(nu,{children:(0,Ye.jsx)(e6,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})})},z3=iu.default.div`
3015
3021
  display: flex;
3016
3022
  flex-direction: column;
3017
3023
  text-align: center;
@@ -3020,7 +3026,7 @@ You will have to sign up with another method first to register a passkey for you
3020
3026
  width: 100%;
3021
3027
  background: var(--privy-color-background);
3022
3028
  padding: 0 16px;
3023
- `,B5=(0,Jp.default)(W3)`
3029
+ `,r6=(0,iu.default)(z3)`
3024
3030
  transition: height 150ms ease-out;
3025
3031
  overflow: hidden;
3026
3032
 
@@ -3034,4 +3040,4 @@ You will have to sign up with another method first to register a passkey for you
3034
3040
  box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
3035
3041
  border-radius: var(--privy-border-radius-lg);
3036
3042
  }
3037
- `;var Ts=require("react"),O3=require("react/jsx-runtime");function H5({botUsername:e,scriptHost:t}){let r=document.createElement("script"),{origin:o}=new URL(t);return r.async=!0,r.src=`${o}/js/telegram-login.js`,r.setAttribute("data-telegram-login",e),r.setAttribute("data-request-access","write"),r.setAttribute("data-lang","en"),r}function L3(e){let t=(0,Ts.useRef)(null),r=(0,Ts.useRef)();return(0,Ts.useEffect)(()=>{r.current?.remove(),r.current=H5(e),t.current?.after(r.current)},[e]),(0,O3.jsx)("div",{ref:t,hidden:!0})}var N3=require("react"),ba=require("react");var od=class{constructor(){this.callbacks={}}enqueue(t,r){this.callbacks[t]=r}dequeue(t,r){let o=this.callbacks[r];if(!o)throw new Error(`cannot dequeue ${t} event: no event found for id ${r}`);switch(delete this.callbacks[r],t){case"privy:iframe:ready":return o;case"privy:wallet:create":return o;case"privy:wallet:import":return o;case"privy:wallet:connect":return o;case"privy:wallet:recover":return o;case"privy:wallet:rpc":return o;case"privy:wallet:set-recovery":return o;case"privy:mfa:verify":return o;case"privy:mfa:init-enrollment":return o;case"privy:mfa:submit-enrollment":return o;case"privy:mfa:unenroll":return o;case"privy:mfa:clear":return o;case"privy:farcaster:init-signer":return o;case"privy:farcaster:sign":return o;default:throw new Error(`invalid wallet event type ${t}`)}}};async function Rn(e,t,r,o,n,i=!1){let a=i,l=async u=>{if(a&&t&&t.length>0){u===(i?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new st("missing_or_invalid_mfa","MFA verification failed, retry."));let y=await new Promise((f,v)=>{r.current={resolve:f,reject:v};let C=1e3*60*5;setTimeout(()=>{let g=new st("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(g),v(g)},C)});return await e(y)}return await e()},s=4,c=null;for(let u=0;u<s;u++)try{c=await l(u),o.current?.resolve(void 0);break}catch(y){if(y.type==="missing_or_invalid_mfa")a=!0;else throw o.current?.resolve(void 0),y}if(c===null){let u=new st("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(u),u}return c}var U3=require("react/jsx-runtime"),G5=function(e){return()=>`id-${e++}`}(0);function V5(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function Er(e){return e.error!==void 0}var ar=new od,Qp=new Map,z5=(e,t)=>typeof t=="bigint"?t.toString():t,q5=(e,t)=>`${e}${JSON.stringify(t,z5)}`;function Tr(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let i=q5(e,t);if(e==="privy:wallet:create"){let l=Qp.get(i);if(l)return l}let a=new Promise((l,s)=>{let c=G5();ar.enqueue(c,{resolve:l,reject:s}),n.postMessage({id:c,event:e,data:t},o)}).finally(()=>{Qp.delete(i)});return Qp.set(i,a),a}function $5(e){switch(e.event){case"privy:iframe:ready":let t=ar.dequeue(e.event,e.id);return Er(e)?t.reject(new st(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=ar.dequeue(e.event,e.id);return Er(e)?r.reject(new st(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:import":let o=ar.dequeue(e.event,e.id);return Er(e)?o.reject(new st(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let n=ar.dequeue(e.event,e.id);return Er(e)?n.reject(new st(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:recover":let i=ar.dequeue(e.event,e.id);return Er(e)?i.reject(new st(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:rpc":let a=ar.dequeue(e.event,e.id);return Er(e)?a.reject(new st(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:set-recovery":let l=ar.dequeue(e.event,e.id);return Er(e)?l.reject(new st(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:verify":let s=ar.dequeue(e.event,e.id);return Er(e)?s.reject(new st(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:init-enrollment":{let c=ar.dequeue(e.event,e.id);return Er(e)?c.reject(new st(e.error.type,e.error.message)):c.resolve(e.data)}case"privy:mfa:submit-enrollment":{let c=ar.dequeue(e.event,e.id);return Er(e)?c.reject(new st(e.error.type,e.error.message)):c.resolve(e.data)}case"privy:mfa:unenroll":{let c=ar.dequeue(e.event,e.id);return Er(e)?c.reject(new st(e.error.type,e.error.message)):c.resolve(e.data)}case"privy:mfa:clear":{let c=ar.dequeue(e.event,e.id);return Er(e)?c.reject(new st(e.error.type,e.error.message)):c.resolve(e.data)}case"privy:farcaster:init-signer":{let c=ar.dequeue(e.event,e.id);return Er(e)?c.reject(new st(e.error.type,e.error.message)):c.resolve(e.data)}case"privy:farcaster:sign":{let c=ar.dequeue(e.event,e.id);return Er(e)?c.reject(new st(e.error.type,e.error.message)):c.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function D3(e){let t=(0,ba.useRef)(null),r=(0,ba.useRef)(e.mfaMethods),o=Fl(),[n,i]=(0,N3.useState)(!1);return(0,ba.useEffect)(()=>{r.current=e.mfaMethods},[e.mfaMethods]),(0,ba.useEffect)(()=>{if(!n)return;let a=t.current;if(!a)return;function l(f){f&&f.origin===e.origin&&V5(f.data)&&$5(f.data)}let s={create(f){return Tr("privy:wallet:create",f,a,e.origin)},import(f){return Tr("privy:wallet:import",f,a,e.origin)},connect(f){return Tr("privy:wallet:connect",f,a,e.origin)},recover(f){return Rn(v=>Tr("privy:wallet:recover",{...f,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!f.recoveryMethod||f.recoveryMethod==="privy")},rpc(f){return Rn(v=>Tr("privy:wallet:rpc",{...f,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},setRecovery(f){return Rn(v=>Tr("privy:wallet:set-recovery",{...f,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(f){return Rn(v=>Tr("privy:mfa:verify",{...f,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(f){return Rn(v=>Tr("privy:mfa:init-enrollment",{...f,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(f){return Rn(v=>Tr("privy:mfa:submit-enrollment",{...f,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(f){return Rn(v=>Tr("privy:mfa:unenroll",{...f,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(f){return Tr("privy:mfa:clear",f,a,e.origin)},initFarcasterSigner(f){return Tr("privy:farcaster:init-signer",f,a,e.origin)},signFarcasterMessage(f){return Tr("privy:farcaster:sign",f,a,e.origin)}};window.addEventListener("message",l);let c=()=>e.onLoad(s),u=(...f)=>{console.warn("Privy iframe failed to load: ",...f),e.onLoadFailed()},y=new AbortController;return Ta(()=>Tr("privy:iframe:ready",{},a,e.origin),{abortSignal:y.signal}).then(c,u),()=>{window.removeEventListener("message",l),y.abort()}},[n]),(0,U3.jsx)("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>i(!0),src:Hs(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}function nd(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some(n=>t.includes(n))}var K5="https://cdn.apple-cloudkit.com";async function Xp({url:e,popup:t,provider:r}){return t.location=e,new Promise((n,i)=>{function a(){t?.close(),window.removeEventListener("message",l)}function l(s){s.data&&(s.data.type==="PRIVY_OAUTH_RESPONSE"&&s.data.stateCode&&s.data.authorizationCode&&(n(s.data),a()),s.origin===K5&&s.data.ckSession&&(n({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:s.data.ckSession}),a()),s.data.type==="PRIVY_OAUTH_ERROR"&&(i(s.data.error),a()))}window.addEventListener("message",l)})}var F3=e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type});var Xt=require("react/jsx-runtime"),on;function j5(e){return typeof e=="string"&&e.length===25}function Me(){if(!on){let e=ne.get(On);return Promise.resolve(e||null)}return on.getAccessToken()}var G3,Rm=(e,t,r)=>G3(e,t,r),V3,Im=(e,t)=>V3(e,t),z3,Mm=(e,t)=>z3(e,t),q3,Wm=()=>q3(),Y5=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;ne.put(_a,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},$3=({config:e,...t})=>{if(!j5(t.appId))throw new E("Cannot initialize the Privy provider with an invalid Privy app ID");on||(on=new Ii({appId:t.appId,appClientId:t.clientId,apiUrl:t.apiUrl||Sa}));let r=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&r.embeddedWallets?.createOnLogin===void 0&&(r.embeddedWallets||(r.embeddedWallets={}),r.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),(0,Xt.jsx)(df,{client:on,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:(0,Xt.jsx)(Z5,{...t,client:on})})},Z5=e=>{let t=e.client,[r,o]=(0,se.useState)(!1),[n,i]=(0,se.useState)(!1),[a,l]=(0,se.useState)(!1),[s,c]=(0,se.useState)(null),[u,y]=(0,se.useState)([]),f=(0,se.useRef)(u),[v,C]=(0,se.useState)(!1),[g,_]=(0,se.useState)(null),[x,b]=(0,se.useState)(!1),[A,R]=(0,se.useState)({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:T}),[U,M]=(0,se.useState)({status:"initial"}),[I,V]=(0,se.useState)(null),[j,te]=(0,se.useState)(null),[L,z]=(0,se.useState)(null),O=Kt(),ye=kl(),[we,be]=(0,se.useState)(!0),[Ne,le]=(0,se.useState)({}),[er,Et]=(0,se.useState)(null),[sr,_t]=(0,se.useState)(null),[Nr,Ze]=(0,se.useState)(!1),[yt,Dr]=(0,se.useState)(!1),lr=(0,se.useRef)(null),pt=(0,se.useRef)(null),N=(0,se.useRef)(Af),[In,Fe]=(0,se.useState)(!1);t.onStoreToken=d=>{d&&F(N,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{c(null),l(!1),F(N,"accessToken","onAccessTokenRemoved")};let ie=(0,se.useRef)(null),ce=(0,se.useRef)(null),Re=d=>{_(d),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:d}})},rt=d=>{O.embeddedWallets.createOnLogin!=="off"&&be(!0),Re(d)};(0,se.useEffect)(()=>{let d=()=>{document.visibilityState==="hidden"&&t.createAnalyticsEvent({eventName:"page_hidden",options:{keepAlive:!0}})};return document.addEventListener("visibilitychange",d),()=>{document.removeEventListener("visibilitychange",d)}},[]),(0,se.useEffect)(()=>{if(!s){t.connectors?.removeEmbeddedWalletConnector();return}let d=He(s),p=Pd(s);if(d||t.connectors?.removeEmbeddedWalletConnector(),p||t.connectors?.removeImportedWalletConnector(),!t.connectors){console.debug("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!L){console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized");return}d&&t.connectors.addEmbeddedWalletConnector(L,d.address,O.defaultChain,e.appId),p&&t.connectors.addImportedWalletConnector(L,p.address,O.defaultChain,e.appId)},[L,s]),(0,se.useEffect)(()=>{L&&sr?.(L)},[L]),(0,se.useEffect)(()=>{(async()=>{if(!O.customAuth?.enabled)return;be(!0);let{getCustomAccessToken:p,isLoading:m}=O.customAuth;if(!(!n||m))try{let w=await p();if(!w&&a){await mi.logout();return}if(!w||a)return;t.startAuthFlow(new fi(w));let{user:P,isNewUser:H}=await t.authenticate();if(!P){await mi.logout();return}c(P||null),C(H||!1),l(!0),Dr(!0)}catch(w){console.warn(w),a&&await mi.logout()}})()},[O.customAuth?.enabled,O.customAuth?.getCustomAccessToken,O.customAuth?.isLoading,n,a]),(0,se.useEffect)(()=>{yt&&L&&s&&pr(s,O.embeddedWallets.createOnLogin)&&(Dr(!1),_s(s,gi).catch(console.error))},[yt&&L&&s]),(0,se.useEffect)(()=>{async function d(){let p=ad(),m=ci();Y5();let w=(0,B3.createStore)();V(w),t.initializeConnectorManager({walletConnectCloudProjectId:O.walletConnectCloudProjectId,rpcConfig:O.rpcConfig,chains:O.chains,defaultChain:O.defaultChain,store:w,walletList:O.appearance.walletList,shouldEnforceDefaultChainOnConnect:O.shouldEnforceDefaultChainOnConnect,externalWalletConfig:O.externalWallets,appName:O.name??"Privy"});let P;t.connectors?.on("connectorInitialized",()=>{P&&clearTimeout(P);let ve=t.connectors.walletConnectors.length,nt=t.connectors.walletConnectors.reduce((Ie,Ft)=>Ie+(Ft.initialized?1:0),0);nt===ve?Fe(!0):P=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:nt,expected:ve}),Fe(!0)},1500)}),t.connectors?.initialize().then(()=>{Ea()});let H=await t.getAuthenticatedUser(),$=!!H;if(O.customAuth?.enabled||(l(!!H),H&&F(N,"login","onComplete",H,!1,!0,null,null),c(H)),p){ce.current=$?"link":"login";return}if(m&&!$){ce.current="login",rt("TELEGRAM_AUTH_SCREEN");return}Ee.setReadyToTrue(!!H)}!n&&ye&&d()},[t,er,n,ye]),(0,se.useEffect)(()=>{if(!n)return;if(!s){Ze(!0);return}if(!!!s.linkedAccounts.find(m=>m.type==="wallet"&&m.walletClientType==="privy")){Ze(!0);return}let p=!!u.find(m=>m.walletClientType==="privy");Ze(p)},[n,s,u]);let ad=()=>{let d=Wa();if(d.inProgress&&d.popupFlow){if(window.opener.location.origin!==window.location.origin){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."});return}window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:d.stateCode,authorizationCode:d.authorizationCode});return}return!d.inProgress||d.headless?!1:(t.startAuthFlow(new Co(d)),rt("AWAITING_OAUTH_SCREEN"),!0)},ci=()=>{let d=_m();if(!d||!O.loginMethods.telegram||!O.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let p=new Ci;return t.startAuthFlow(p),d.flowType==="login-url"&&(p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult={id:d.id,first_name:d.first_name,last_name:d.last_name,auth_date:d.auth_date,username:d.username,photo_url:d.photo_url,hash:d.hash}),d.flowType==="web-app"&&(p.meta.telegramAuthResult=void 0,p.meta.telegramWebAppData={query_id:d.query_id,user:d.user,auth_date:d.auth_date,hash:d.hash}),!0},Ss=async(d,p,m,w)=>{let P=await t.connectors?.createWalletConnector(d,p)||null;di(P,p,m,w)};async function di(d,p,m,w){if(d)R({status:"disconnected",connectedWallet:null,connectError:null,connector:d,connectRetry:T});else return R({status:"disconnected",connectedWallet:null,connectError:new pe("Unable to connect to wallet."),connector:null,connectRetry:T}),w?.(null,m);d instanceof Eo&&p&&await d.resetConnection(p),R({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>di(d,p,m,w)});try{let P=await d.connect({showPrompt:!0});if(O.shouldEnforceDefaultChainOnConnect&&!O.chains.find(H=>H.id===Number(P?.chainId))&&!(P?.connectorType==="wallet_connect_v2"&&P?.walletClientType==="metamask")&&!(P?.connectorType==="coinbase_wallet"&&O.externalWallets.coinbaseWallet.connectionOptions!=="eoaOnly")){R(H=>({...H,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:T}));try{await P?.switchChain(O.defaultChain.id),P&&(P.chainId=yi(Ln(O.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${O.defaultChain.id}`)}}return R(H=>({...H,status:"connected",connectedWallet:P,connectError:null,connectRetry:T})),P&&F(N,"connectWallet","onSuccess",P),w?.(P,m)}catch(P){return P instanceof ut?(console.warn(P.cause?P.cause:P.message),F(N,"connectWallet","onError",P.privyErrorCode||"generic_connect_wallet_error")):(console.warn(P),F(N,"connectWallet","onError","unknown_connect_wallet_error")),R(H=>({...H,status:"disconnected",connectedWallet:null,connectError:P})),w?.(null,m)}}let pi=async(d,p)=>{if(d===null)return;let m=new Vn(d,p);t.startAuthFlow(m)},Ea=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_connector"),m=d.get("privy_wallet_client");if(!p||!m)return;if(m==="phantom"&&!an()&&rt("LOGIN_FAILED_SCREEN"),!t.connectors)throw new E("Connector not initialized");Re("AWAITING_CONNECTION");let w=new URL(window.location.href);w.searchParams.delete("privy_connector"),w.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",w),Ss(p,m,void 0,pi)};(0,se.useEffect)(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let ot=()=>{if(!a)throw F(N,"linkAccount","onError","must_be_authenticated"),new E("User must be authenticated before linking an account.")},gt=()=>{ot(),ie.current="siwe",ce.current="link",Re("LINK_WALLET_SCREEN")},vt=d=>{if(!a||!s)return!1;if(d.walletClientType==="privy")return!0;for(let p of s.linkedAccounts)if(p.type==="wallet"&&p.address===d.address&&p.walletClientType!=="privy")return!0;return!1},ui=async d=>{if(!t.connectors)throw new E("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(R(m=>({...m,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:T})),O.captchaEnabled&&!a){let m={callback:w=>pi(d,w),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};le({captchaModalData:m}),rt("CAPTCHA_SCREEN")}else await pi(d),rt("AWAITING_CONNECTION")},Mn=async(d,p)=>{if(!O.fiatOnRamp.enabled)throw new E("Fiat on-ramp is not enabled");if(!p||!p.provider||p.provider==="moonpay"){let{signedUrl:m,externalTransactionId:w}=await s1(t,d,p?.config??{},O.appearance.palette,O.fiatOnRamp.useSandbox);return{signedUrl:m,externalTransactionId:w}}else throw new E("Unsupported fund provider. Currently supported option is `moonpay`.")},Wn=()=>{y(d=>{let p=t.connectors?.wallets.map(m=>({...m,linked:vt(m),loginOrLink:async()=>{if(!await m.isConnected())throw new E("Wallet is not connected");if(m.connectorType==="embedded"&&m.walletClientType==="privy")throw new E("Cannot link or login with embedded wallet");ui(m)},fund:async w=>{let{signedUrl:P,externalTransactionId:H}=await Mn(m.address,w);le({fiatOnRampPrompt:{signedUrl:P},fiatOnRampStatus:{externalTransactionId:H}}),Re("FIAT_ON_RAMP_PROMPT_SCREEN")},unlink:async()=>{if(!a)throw new E("User is not authenticated.");if(m.connectorType==="embedded"&&m.walletClientType==="privy")throw new E("Cannot unlink an embedded wallet");let w=await t.unlinkWallet(m.address);c(w)}}))||[];return cl(d,p)?d:p})};(0,se.useEffect)(()=>{Wn()},[s?.linkedAccounts,a,n]),(0,se.useEffect)(()=>{if(n){if(!t.connectors)throw new E("Connector not initialized");Wn(),t.connectors.on("walletsUpdated",Wn)}},[n]);let Oo=()=>{Re(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};(0,se.useEffect)(()=>{if(!u[0])return;let d=u[0],p=f.current.find(w=>w.address===d.address),m;if(d.walletClientType==="privy"?m=s?.linkedAccounts.find(w=>w.type==="wallet"&&w.address===d.address&&w.walletClientType==="privy"):m=s?.linkedAccounts.find(w=>w.type==="wallet"&&w.address===d.address&&w.walletClientType!=="privy"),!p&&m){let w=Object.assign({},s);w.wallet=m&&{address:m.address,chainType:m.chainType,chainId:m.chainId,walletClient:m.walletClient,walletClientType:m.walletClientType,connectorType:m.connectorType,imported:m.imported},c(w)}f.current=u},[u]);let _s=async(d,p)=>{if(He(d))throw F(N,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[w,P]=await Promise.all([Ee.initializeWalletProxy(p),Me()]);if(!w&&O.customAuth?.enabled)throw F(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!w||!P||O.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((H,$)=>{be(!0),le({createWallet:{onSuccess:nt=>{F(N,"createWallet","onSuccess",nt),H(nt)},onFailure:nt=>{F(N,"createWallet","onError","unknown_embedded_wallet_error"),$(nt)},callAuthOnSuccessOnClose:!1}}),Re("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await w.create({accessToken:P});let H=await Ee.refreshUser(),$=He(H);if(!$)throw F(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return F(N,"createWallet","onSuccess",$),$}},P0=d=>{if(!O.chains.map(p=>p.id).includes(d))throw new pe(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},ru=(d,p,m)=>new Promise(async(w,P)=>{if(!a||!s){F(N,"sendTransaction","onError","must_be_authenticated"),P(new Error("User must be authenticated before signing with a Privy wallet"));return}let H=d.from,$=H?s?.linkedAccounts.find(Be=>Be.type==="wallet"&&Be.walletClientType==="privy"&&Be.address===H):He(s);if(!$){F(N,"sendTransaction","onError","embedded_wallet_not_found"),P(new Error("Must have a Privy wallet before signing"));return}be(!0);let ve=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,nt=d.chainId?Number(d.chainId):ve.chainId;P0(nt);let Ie=Object.assign({},d,{chainId:nt}),Ft=async()=>{let Be=await Me();if(!Be||!L){F(N,"sendTransaction","onError","embedded_wallet_not_found"),P(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await Ee.recoverEmbeddedWallet()){F(N,"sendTransaction","onError","unknown_connect_wallet_error"),P(new Error("Unable to connect to wallet"));return}let Qr=Do(Ie.chainId,O.chains,O.rpcConfig,{appId:e.appId}),sd=await fa($.address,Ie,Qr);if(O.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:x0}=await ma(sd,Qr),{hasSufficientFunds:A0}=await $c($.address,sd,x0,Qr);if(!A0)throw new ct(new _r("Wallet has insufficient funds for this transaction.",Ht.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let iu=await qc(Be,$.address,L,sd,Qr);F(N,"sendTransaction","onSuccess",iu),w(iu)}catch(xs){F(N,"sendTransaction","onError","transaction_failure"),P(xs)}};if(O.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),Ft();else{let Be={transactionRequest:Ie,onSuccess:Qr=>{F(N,"sendTransaction","onSuccess",Qr),w(Qr)},onFailure:Qr=>{F(N,"sendTransaction","onError","transaction_failure"),P(Qr)},uiOptions:p||{},fundWalletConfig:m},xs={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:Qr=>{F(N,"sendTransaction","onError","unknown_connect_wallet_error"),P(Qr)}};le({connectWallet:xs,sendTransaction:Be}),Re("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function ou(){return new Promise(async(d,p)=>{let m=await Me();if(!m||!L)throw new Error("Must have valid access token to enroll in MFA");try{await L.verifyMfa({accessToken:m}),d()}catch(w){p(w)}})}let cr=d=>{if(d==="passkey"){if(s&&s.linkedAccounts.filter(p=>p.type==="passkey").length>=5)throw F(N,"linkAccount","onError","cannot_link_more_of_type"),new E(`User already has an account of type ${d} linked.`)}else if(s?.[d])throw F(N,"linkAccount","onError","cannot_link_more_of_type"),new E(`User already has an account of type ${d} linked.`)},S0=()=>{if(!O.loginConfig.telegramAuthConfiguration?.linkEnabled)throw F(N,"linkAccount","onError","cannot_link_more_of_type"),new E("User can't link an account because Telegram linking is disabled.")};async function nu({legacySetWalletPasswordFlow:d=!1}){_(null);let p=d?"setWalletPassword":"setWalletRecovery";if(!a||!s)throw F(N,p,"onError","must_be_authenticated"),new Error("User must be authenticated before adding recovery method to Privy wallet");let m=He(s);if(!m||!L)throw F(N,p,"onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a recovery method");try{await ou()}catch(w){throw F(N,p,"onError","missing_or_invalid_mfa"),w}return new Promise((w,P)=>{be(!0);let H={onSuccess:Ie=>{F(N,p,"onSuccess","user-passcode",Ie),w(Ie)},onFailure:Ie=>{F(N,p,"onError","user_exited_set_password_flow"),P(Ie)},callAuthOnSuccessOnClose:!1},$=m.recoveryMethod==="user-passcode",nt={onCompleteNavigateTo:ac({walletAction:"update",availableRecoveryMethods:O.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:d,isResettingPassword:$}),shouldForceMFA:!1,onFailure:Ie=>{F(N,p,"onError","unknown_connect_wallet_error"),P(Ie)}};le({setWalletPassword:H,createWallet:H,connectWallet:nt,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:$}}),Re("EMBEDDED_WALLET_CONNECTING_SCREEN")})}let mi={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:Oo,importWallet:async({privateKey:d})=>{ot();let[p,m]=await Promise.all([Ee.initializeWalletProxy(15e3),Me()]);if(p&&m){await p.import({privateKey:d,accessToken:m});let w=await Ee.refreshUser(),P=Pd(w);if(!P)throw F(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to import wallet");return F(N,"createWallet","onSuccess",P),P}else throw new E("User is not authenticated")},linkWallet:gt,linkEmail:()=>{ot(),cr("email"),ie.current="email",ce.current="link",Re("LINK_EMAIL_SCREEN")},linkPhone:()=>{ot(),cr("phone"),ie.current="sms",ce.current="link",Re("LINK_PHONE_SCREEN")},linkGoogle:async()=>{ot(),cr("google"),ce.current="link",await Ee.initLoginWithOAuth("google")},linkTwitter:async()=>{ot(),cr("twitter"),ce.current="link",await Ee.initLoginWithOAuth("twitter")},linkDiscord:async()=>{ot(),cr("discord"),ce.current="link",await Ee.initLoginWithOAuth("discord")},linkGithub:async()=>{ot(),cr("github"),ce.current="link",await Ee.initLoginWithOAuth("github")},linkSpotify:async()=>{ot(),cr("spotify"),ce.current="link",await Ee.initLoginWithOAuth("spotify")},linkInstagram:async()=>{ot(),cr("instagram"),ce.current="link",await Ee.initLoginWithOAuth("instagram")},linkTiktok:async()=>{ot(),cr("tiktok"),ce.current="link",await Ee.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{ot(),cr("linkedin"),ce.current="link",await Ee.initLoginWithOAuth("linkedin")},linkApple:async()=>{ot(),cr("apple"),ce.current="link",await Ee.initLoginWithOAuth("apple")},linkPasskey:async()=>{ot(),cr("passkey"),await Ee.initLinkWithPasskey(),Re("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{ot(),cr("telegram"),S0(),ce.current="link",ie.current="telegram",await Ee.initLoginWithTelegram(),Re("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{ot(),cr("farcaster"),await Ee.initLoginWithFarcaster(),ce.current="link",ie.current="farcaster",Re("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(ot(),!s?.email)throw new E("User does not have an email linked to their account.");ce.current="link",ie.current="email",Re("UPDATE_EMAIL_SCREEN")},login:async()=>{let d="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!n){let p=await new Promise(m=>{Et(w=>m.bind(w))});if(Et(null),p){console.warn(d);return}}if(a){console.warn(d);return}ce.current="login",rt("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{Et(()=>d)}),Et(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(u[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}rt("CONNECT_OR_CREATE")},logout:async()=>{if(await t.logout(),s&&L)try{await L.clearMfa({userId:s.id})}catch{}c(null),l(!1),_(null),F(N,"logout","onSuccess"),ce.current=null,ie.current=null,o(!1),ne.del(xa)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new et;let d=u.find(m=>s.wallet&&m.address===s.wallet.address),p=t.connectors?.walletConnectors.find(m=>m.wallets.find(w=>w.address===d?.address));return!d||!p?new et:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new id.Web3Provider(new to(new et));let d=u.find(m=>s.wallet&&m.address===s.wallet.address),p=t.connectors?.walletConnectors.find(m=>m.wallets.find(w=>w.address===d?.address));return!d||!p?new id.Web3Provider(new to(new et)):new id.Web3Provider(new to(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new dn(new et);let d=u.find(m=>s.wallet&&m.address===s.wallet.address),p=t.connectors?.walletConnectors.find(m=>m.wallets.find(w=>w.address===d?.address));return!d||!p?new dn(new et):new dn(p.proxyProvider)},unlinkWallet:async d=>{let p=await t.unlinkWallet(d);return c(p),p},unlinkEmail:async d=>{let p=await t.unlinkEmail(d);return c(p),p},unlinkPhone:async d=>{let p=await t.unlinkPhone(d);return c(p),p},unlinkGoogle:async d=>{let p=await t.unlinkOAuth("google",d);return c(p),p},unlinkTwitter:async d=>{let p=await t.unlinkOAuth("twitter",d);return c(p),p},unlinkDiscord:async d=>{let p=await t.unlinkOAuth("discord",d);return c(p),p},unlinkGithub:async d=>{let p=await t.unlinkOAuth("github",d);return c(p),p},unlinkSpotify:async d=>{let p=await t.unlinkOAuth("spotify",d);return c(p),p},unlinkInstagram:async d=>{let p=await t.unlinkOAuth("instagram",d);return c(p),p},unlinkTiktok:async d=>{let p=await t.unlinkOAuth("tiktok",d);return c(p),p},unlinkLinkedIn:async d=>{let p=await t.unlinkOAuth("linkedin",d);return c(p),p},unlinkApple:async d=>{let p=await t.unlinkOAuth("apple",d);return c(p),p},unlinkFarcaster:async d=>{let p=await t.unlinkFarcaster(d);return c(p),p},unlinkTelegram:async d=>{let p=await t.unlinkTelegram(d);return c(p),p},unlinkPasskey:async d=>{let p=await t.unlinkPasskey(d);return c(p),p},setActiveWallet:async d=>{let p=u.find(w=>(0,li.getAddress)(w.address)===(0,li.getAddress)(d)),m=s?.linkedAccounts.find(w=>w.type==="wallet"&&(0,li.getAddress)(w.address)===(0,li.getAddress)(d));if(!p||!await p.isConnected())te(d),gt();else if(!p.linked)p.loginOrLink();else{let w=Object.assign({},s);w.wallet=m&&{address:m.address,chainType:m.chainType,chainId:m.chainId,walletClient:m.walletClient,walletClientType:m.walletClientType,connectorType:m.connectorType,imported:m.imported},c(w)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw F(N,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return _s(s,15e3)},setWalletRecovery:async()=>nu({legacySetWalletPasswordFlow:!1}),setWalletPassword:async()=>nu({legacySetWalletPasswordFlow:!0}),signMessage:(d,p,m)=>new Promise(async(w,P)=>{if(!a||!s){F(N,"signMessage","onError","must_be_authenticated"),P(new Error("User must be authenticated before signing with a Privy wallet"));return}let H=m?s?.linkedAccounts.find(ve=>ve.type==="wallet"&&ve.walletClientType==="privy"&&(0,li.getAddress)(ve.address)===(0,li.getAddress)(m)):He(s);if(!H){F(N,"signMessage","onError","embedded_wallet_not_found"),P(new Error("Must have a Privy wallet before signing"));return}if(typeof d!="string"||d.length<1){F(N,"signMessage","onError","invalid_message"),P(new Error("Message must be a non-empty string"));return}be(!0);let $=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let ve=await Me();if(!L||!ve)throw new Error("Unable to connect to wallet");if(!await Ee.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:H.address}});let{response:Ie}=await L.rpc({accessToken:ve,address:H.address,request:{method:"personal_sign",params:[d,H.address]}}),Ft=Ie.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:H.address}}),Ft};if(O.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ve=await $();F(N,"signMessage","onSuccess",ve),w(ve)}catch(ve){F(N,"signMessage","onError","unable_to_sign"),P(ve??new ct("Unable to sign message"))}}else{let Ie={method:"personal_sign",data:d,confirmAndSign:$,onSuccess:Be=>{F(N,"signMessage","onSuccess",Be),w(Be)},onFailure:Be=>{F(N,"signMessage","onError","unable_to_sign"),P(Be)},uiOptions:p||{}},Ft={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Be=>{F(N,"signMessage","onError","unknown_connect_wallet_error"),P(Be)},address:H.address};le({signMessage:Ie,connectWallet:Ft}),Re("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(m,w)=>{if(!a||!s){F(N,"signTypedData","onError","must_be_authenticated"),w(new Error("User must be authenticated before signing with a Privy wallet"));return}let P=He(s);if(!P){F(N,"signTypedData","onError","embedded_wallet_not_found"),w(new Error("Must have a Privy wallet before signing"));return}be(!0);let H=Gs(d),$=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let ve=await Me();if(!L||!ve)throw new Error("Unable to connect to wallet");if(!await Ee.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:P.address}});let{response:Ie}=await L.rpc({accessToken:ve,address:P.address,request:{method:"eth_signTypedData_v4",params:[P.address,H]}}),Ft=Ie.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:P.address}}),Ft};if(O.embeddedWallets.noPromptOnSignature||(O.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ve=await $();F(N,"signTypedData","onSuccess",ve),m(ve)}catch(ve){F(N,"signTypedData","onError","unable_to_sign"),w(ve??new ct("Unable to sign message"))}}else{let Ie={method:"eth_signTypedData_v4",data:H,confirmAndSign:$,onSuccess:Be=>{F(N,"signTypedData","onSuccess",Be),m(Be)},onFailure:Be=>{F(N,"signTypedData","onError","unable_to_sign"),w(Be)},uiOptions:p||{}},Ft={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Be=>{F(N,"signMessage","onError","unknown_connect_wallet_error"),w(Be)}};le({signMessage:Ie,connectWallet:Ft}),Re("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,m)=>{let P=await(await ru(d,p,m)).wait();return Kc(P)},exportWallet:()=>new Promise(async(d,p)=>{if(!a||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}if(!He(s)){p(new Error("Must have a Privy wallet before exporting"));return}be(!0);let w={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p,shouldForceMFA:!0};if(le(Ne),!await Me()||!L){p(new Error("Must have valid access token to enroll in MFA"));return}if(!L){p(new Error("Must have a Privy wallet before exporting"));return}let H={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,onSuccess:d,onFailure:p};le({keyExport:H,connectWallet:w}),Re("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:ou,async init(d){switch(d){case"sms":await t.initMfaSmsVerification();return;case"passkey":return await t.initMfaPasskeyVerification();case"totp":return;default:throw new Error(`Unsupported MFA method: ${d}`)}},async submit(d,p){switch(d){case"totp":case"sms":if(typeof p!="string")throw new E("Invalid MFA code");lr.current?.resolve({mfaMethod:d,mfaCode:p,relyingParty:window.origin}),await new Promise((H,$)=>{pt.current={resolve:H,reject:$}});break;case"passkey":if(typeof p=="string")throw new E("Invalid authenticator response");let w=await(await import("@simplewebauthn/browser")).startAuthentication(p),P=F3(w);lr.current?.resolve({mfaMethod:d,mfaCode:P,relyingParty:window.origin}),await new Promise((H,$)=>{pt.current={resolve:H,reject:$}});break;default:throw lr.current?.reject(new E("Unsupported MFA method")),new E(`Unsupported MFA method: ${d}`)}},cancel(){lr.current?.reject(new E("MFA canceled"))},async initEnrollmentWithSms(d){let p=await Me();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber})},enrollInMfa(d){return new Promise((p,m)=>{if(!d){Ee.closePrivyModal(),p();return}O.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),le({mfaEnrollmentFlow:{mfaMethods:O.mfa.methods,onSuccess:p,onFailure:m}}),Re("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await Me();if(!d||!L)throw new Error("Must have valid access token to enroll in MFA");let p=await L.initEnrollMfa({method:"totp",accessToken:d});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(d){let p=await Me();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber,code:d.mfaCode});let m=await t.getAuthenticatedUser();c(m)},async submitEnrollmentWithTotp(d){let p=await Me();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"totp",accessToken:p,code:d.mfaCode});let m=await t.getAuthenticatedUser();c(m)},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:d}){let p=await Me();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:d});let m=await t.getAuthenticatedUser();c(m)},async unenroll(d){let p=await Me();if(!p||!L)throw new Error("Must have valid access token to remove MFA");d==="passkey"?await L.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:[]}):await L.unenrollMfa({method:d,accessToken:p});let m=await t.getAuthenticatedUser();c(m)},requestFarcasterSignerFromWarpcast:async()=>{let d=await Me(),p=s?.linkedAccounts.find(P=>P.type==="wallet"&&P.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await Ee.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");let w=await L.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:d,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(w.status==="approved"){let P=await t.getAuthenticatedUser();c(P||s||null)}le({farcasterSigner:w}),Re("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let d=await Me(),p=s?.linkedAccounts.find(P=>P.type==="wallet"&&P.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await Ee.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");if(!s.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");return(P=>Uint8Array.from(P.match(/.{1,2}/g).map(H=>parseInt(H,16))))(s.farcaster.signerPublicKey.slice(2))},signFarcasterMessage:async d=>{let p=await Me(),m=s?.linkedAccounts.find($=>$.type==="wallet"&&$.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!m)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await Ee.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");if(!s.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");let P=await import("@simplewebauthn/browser"),H=await L.signFarcasterMessage({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{hash:P.bufferToBase64URLString(d)},fid:BigInt(s.farcaster.fid),relyingParty:window.origin});return new Uint8Array(P.base64URLStringToBuffer(H.signature))},isHeadlessOAuthLoading:x,loginWithCode(d){return Ee.loginWithCode(d)},initLoginWithEmail(d){return Ee.initLoginWithEmail(d)},initLoginWithSms(d){return Ee.initLoginWithSms(d)},otpState:U,fundWallet(d,p){return Ee.fundWallet(d,p)},initLoginWithHeadlessOAuth(d,p){return Ee.initLoginWithHeadlessOAuth(d,p)},loginWithHeadlessOAuth(d){return Ee.loginWithHeadlessOAuth(d)},isModalOpen:r,mfaMethods:O.mfa.methods};G3=mi.signMessage,V3=mi.signTypedData,z3=async(...d)=>{let p=await ru(...d);return O.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let Ee=(()=>({isNewUserThisSession:v,linkingHint:j,pendingTransaction:null,walletConnectionStatus:A,mipdStore:I,connectors:t.connectors?.walletConnectors??[],rpcConfig:O.rpcConfig,chains:O.chains,appId:e.appId,showFiatPrices:O.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>O.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(L)return L;let p=new Promise(P=>{_t(()=>H=>P(H))}),m=new Promise(P=>setTimeout(()=>P(null),d)),w=await Promise.race([p,m]);return _t(null),w},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(d={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s,m;p&&ie.current&&(m=s?.linkedAccounts.filter(w=>w.latestVerifiedAt!==null&&!(w.type==="wallet"&&w.walletClientType==="privy")).sort((w,P)=>P.latestVerifiedAt.getTime()-w.latestVerifiedAt.getTime())[0]),ce.current==="login"&&ie.current?d.shouldCallAuthOnSuccess&&p?(F(N,"login","onComplete",s,v,!1,ie.current,m??null),e.onSuccess?.(s,v)):F(N,"login","onError","exited_auth_flow"):ce.current==="link"&&ie.current&&m&&(d.isSuccess&&p?F(N,"linkAccount","onSuccess",s,ie.current,m):F(N,"linkAccount","onError","exited_link_flow")),te(null),ce.current=null,ie.current=null,C(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},openPrivyModal:Re,connectWallet:di,initLoginWithWallet:async(d,p)=>{ie.current="siwe",pi(d,p)},loginWithWallet:async()=>{if(!n)throw new No;if(!(t.authFlow instanceof Vn))throw new E("Must initialize SIWE flow first.");let d,p;if(a)try{({user:d}=await t.link()),ie.current="siwe"}catch(m){throw F(N,"linkAccount","onError",m.privyErrorCode||"failed_to_link_account"),m}else try{({user:d,isNewUser:p}=await t.authenticate()),ie.current="siwe"}catch(m){throw F(N,"login","onError",m.privyErrorCode||"generic_connect_wallet_error"),m}c(d||s||null),C(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new Pa(d);t.startAuthFlow(p);try{ie.current="farcaster",await p.initializeFarcasterConnect()}catch(m){throw ce.current==="login"?F(N,"login","onError",m.privyErrorCode||"unknown_auth_error"):ce.current==="link"&&F(N,"linkAccount","onError",m.privyErrorCode||"unknown_auth_error"),m}},loginWithFarcaster:async()=>{if(!n)throw new No;if(!(t.authFlow instanceof Pa))throw new E("Must initialize Farcaster flow first.");let d,p;if(a)try{({user:d}=await t.link()),ie.current="farcaster"}catch(m){throw F(N,"linkAccount","onError",m.privyErrorCode||"failed_to_link_account"),m}else try{({user:d,isNewUser:p}=await t.authenticate()),ie.current="farcaster"}catch(m){throw F(N,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}c(d||null),C(p||!1),l(!0)},async initLoginWithOAuth(d,p){if(ie.current=d,pd()){if(d==="google"&&nd(window.navigator.userAgent)){rt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{rt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}ne.del(Un);let m=new Co({provider:d});p&&m.addCaptchaToken(p),t.startAuthFlow(m);let w=await t.authFlow.getAuthorizationUrl();w&&w.url&&(d==="twitter"&&H3.isAndroid&&(w.url=w.url.replace("x.com","twitter.com")),window.location.assign(w.url))},async initLoginWithTelegram(d){if(!n)throw new No;ie.current="telegram";let p=new Ci(d);t.startAuthFlow(p),p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult=await new Promise((m,w)=>{if(!O.loginConfig.telegramAuthConfiguration)return w(new E("Telegram Auth configuration is not loaded"));if(!window.Telegram)return w(new E("Telegram was not initialized"));window.Telegram.Login.auth({bot_id:O.loginConfig.telegramAuthConfiguration.botId,request_access:!0},P=>P?m(P):w(new E("Telegram auth failed or was canceled by the client")))})},async loginWithTelegram(){if(!(t.authFlow instanceof Ci))throw new E("Must initialize Telegram flow before calling loginWithTelegram");let d,p;if(a)try{({user:d}=await t.link()),ie.current="telegram"}catch(m){throw F(N,"linkAccount","onError",m.privyErrorCode||"failed_to_link_account"),m}else try{let m=await t.authenticate();d=m.user,p=m.isNewUser,ie.current="telegram"}catch(m){throw ce.current==="login"?F(N,"login","onError",m.privyErrorCode||"unknown_auth_error"):ce.current==="link"&&F(N,"linkAccount","onError",m.privyErrorCode||"failed_to_link_account"),m}c(d),C(p||!1),l(!0)},async recoveryOAuthFlow(d,p,m){let w,P;function H($){if(!$)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:d}}),new E("Recovery OAuth failed")}switch(d){case"google-drive":{let{url:$,codeVerifier:ve,stateCode:nt}=await rp({api:on.api,provider:d});H($);let Ie,Ft;try{let Be=await Xp({url:$,popup:m,provider:d});if(Ie=Be.stateCode,Ft=Be.authorizationCode,Ie!==nt)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:nt??"",returnedStateCode:Ie??""}}),new E("Unexpected auth flow. This may be a phishing attempt.")}catch(Be){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:Be.toString(),provider:d}}),new E("Recovery OAuth failed")}[w,P]=await Promise.all([Me(),Ih({api:on.api,provider:d,codeVerifier:ve,stateCode:Ie,authorizationCode:Ft})]);break}case"icloud":{let{url:$}=await rp({api:on.api,provider:d});H($);let{ckWebAuthToken:ve}=await Xp({url:$,popup:m,provider:d});P=ve,w=await Me();break}}if(!L)throw new E("Cannot connect to wallet proxy");if(!w)throw new E("Unable to authorize user");switch(p){case"recover":let $=Ne.recoverWallet?.privyWallet?.address;if(!$)throw new E("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:$,recoveryMethod:d}}),await L.recover({address:$,accessToken:w,recoveryAccessToken:P,recoveryMethod:d}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:$,recoveryMethod:d}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await L.create({accessToken:w,recoveryAccessToken:P,recoveryMethod:d});let ve=await Ee.refreshUser(),nt=He(ve);if(!nt)throw F(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:nt.address}}),F(N,"createWallet","onSuccess",nt);break;case"set-recovery":let Ie=He(s);if(!Ie)throw F(N,"setWalletRecovery","onError","embedded_wallet_not_found"),new Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{recoveryMethod:d}}),await L.setRecovery({address:Ie.address,accessToken:w,recoveryAccessToken:P,recoveryMethod:d});let Ft=He(await Ee.refreshUser());if(!Ft)throw F(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:Ie.address,recoveryMethod:d}}),F(N,"setWalletRecovery","onSuccess",d,Ft);break;default:throw new E("Unsupported recovery action")}},async loginWithOAuth(d){if(!(t.authFlow instanceof Co))throw new E("Must initialize OAuth flow before calling loginWithOAuth");let p=ne.get(Nn),m=t.authFlow.meta.stateCode;if(p!==m)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:p??"",returnedStateCode:m??""}}),new E("Unexpected auth flow. This may be a phishing attempt.");let w,P,H;if(a)try{let $=await t.link();w=$.user,H=$.oAuthProviderTokens,ie.current=d}catch($){throw F(N,"linkAccount","onError",$.privyErrorCode||"failed_to_link_account"),$}else try{let $=await t.authenticate();w=$.user,P=$.isNewUser,H=$.oAuthProviderTokens,ie.current=d}catch($){throw ce.current==="login"?F(N,"login","onError",$.privyErrorCode||"unknown_auth_error"):ce.current==="link"&&F(N,"linkAccount","onError",$.privyErrorCode||"failed_to_link_account"),$}return c(w),C(P||!1),l(!0),H},async initLoginWithPasskey(d){let p=new Gn(d);t.startAuthFlow(p),ce.current="login";try{ie.current="passkey",await p.initAuthenticationFlow()}catch(m){throw F(N,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}},async loginWithPasskey(){if(!n)throw new No;if(!(t.authFlow instanceof Gn))throw new E("Must initialize Passkey flow first.");if(ie.current!=="passkey")throw new E("Must init login with Passkey flow first.");let d,p;try{ie.current="passkey",{user:d,isNewUser:p}=await t.authenticate()}catch(m){throw F(N,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}c(d),C(p||!1),l(!0)},async initLinkWithPasskey(d){let p=new Gn(d);t.startAuthFlow(p),ce.current="link",ie.current="passkey";try{await p.initLinkFlow()}catch(m){throw F(N,"linkAccount","onError",m.privyErrorCode||"unknown_auth_error"),m}},async linkWithPasskey(){if(!n)throw new No;if(!(t.authFlow instanceof Gn))throw new E("Must initialize Passkey flow first.");if(ie.current!=="passkey")throw new E("Must init login with Passkey flow first.");let d;try{ie.current="passkey",{user:d}=await t.link()}catch(p){throw F(N,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account"),p}return c(d||s||null),d},async initLoginWithHeadlessOAuth(d,p){if(pd()){if(d==="google"&&nd(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.")}else throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let m=new Co({provider:d,headless:!0});p&&m.addCaptchaToken(p);let w=await t.startAuthFlow(m).getAuthorizationUrl();w?.url&&window.location.assign(w.url)},async loginWithHeadlessOAuth(d){b(!0),t.startAuthFlow(new Co(d));let p=ne.get(Nn),m=d.stateCode;if(p!==m)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d.provider,storedStateCode:p??"",returnedStateCode:m??""}}),b(!1),new E("Unexpected auth flow. This may be a phishing attempt.");let w,P;if(a)try{({user:w}=await t.link()),ie.current=d.provider}catch(H){throw F(N,"linkAccount","onError",H.privyErrorCode||"failed_to_link_account"),H}else try{({user:w,isNewUser:P}=await t.authenticate()),ie.current=d.provider}catch(H){throw ce.current==="login"?F(N,"login","onError",H.privyErrorCode||"unknown_auth_error"):ce.current==="link"&&F(N,"linkAccount","onError",H.privyErrorCode||"failed_to_link_account"),H}return c(w),C(P||!1),l(!0),b(!1),w??void 0},initLoginWithEmail:async(d,p)=>{let m=new nn(d,p);t.startAuthFlow(m);try{ie.current="email",await m.sendCodeEmail()}catch(w){throw ce.current==="login"?F(N,"login","onError",w.privyErrorCode||"unknown_auth_error"):ce.current==="link"&&F(N,"linkAccount","onError",w.privyErrorCode||"failed_to_link_account"),w}},initUpdateEmail:async(d,p,m)=>{let w=new Ns(d,p,m);t.startAuthFlow(w),await w.sendCodeEmail()},initLoginWithSms:async(d,p)=>{M({status:"sending-code"});let m=new zn(d,p);t.startAuthFlow(m);try{ie.current="sms",await m.sendSmsCode(),M({status:"awaiting-code-input"})}catch(w){throw M({status:"error",error:w}),ce.current==="login"?F(N,"login","onError",w.privyErrorCode||"unknown_auth_error"):ce.current==="link"&&F(N,"linkAccount","onError",w.privyErrorCode||"failed_to_link_account"),w}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(M({status:"submitting-code"}),!n){let P=new No;throw M({status:"error",error:P}),P}if(t.authFlow instanceof nn)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof zn)t.authFlow.meta.smsCode=d.trim();else{let P=new E("Must initialize a passwordless code flow first");throw M({status:"error",error:P}),P}let p=await Me(),m,w;if(p&&t.sessionHasActiveToken())try{({user:m}=await t.link())}catch(P){throw M({status:"error",error:P}),F(N,"linkAccount","onError",P.privyErrorCode||"failed_to_link_account"),P}else try{({user:m,isNewUser:w}=await t.authenticate())}catch(P){throw M({status:"error",error:P}),F(N,"login","onError",P.privyErrorCode||"unknown_auth_error"),P}c(m||s||null),C(w||!1),l(!0),M({status:"done"})},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:L,createAnalyticsEvent:({eventName:d,payload:p,timestamp:m})=>t.createAnalyticsEvent({eventName:d,payload:p,timestamp:m}),acceptTerms:async()=>{let d=await t.acceptTerms();return c(d),d},getUsdTokenPrice:d=>t.getUsdTokenPrice(d),recoverEmbeddedWallet:async()=>new Promise(async(d,p)=>{let m=s?.linkedAccounts.find(P=>P.type==="wallet"&&P.walletClientType==="privy"),w=await Me();if(!w||!L||!m){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}be(!0);try{await L.connect({accessToken:w,address:m.address}),d(!0)}catch(P){if(qi(P)&&m.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:m.address}}),(await L.recover({address:m.address,accessToken:w,recoveryMethod:m.recoveryMethod})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:m.address}}),d(!0);else if(qi(P)&&m.recoveryMethod!=="privy"){le({recoverWallet:{privyWallet:m,onFailure:p,onSuccess:()=>d(!0)},recoveryOAuthStatus:{provider:m.recoveryMethod,action:"recover"}});let H=sc(m.recoveryMethod);Re(H)}else p(P)}}),getFiatOnRampConfig:Mn,setReadyToTrue:d=>{i(!0),er?.(d)},updateWallets:()=>Wn(),fundWallet:async(d,p)=>{let{signedUrl:m,externalTransactionId:w}=await Mn(d,p);le({fiatOnRampPrompt:{signedUrl:m},fiatOnRampStatus:{externalTransactionId:w}}),Re("FIAT_ON_RAMP_PROMPT_SCREEN")},requestFarcasterSignerStatus:async d=>{let p=await Me(),m=s?.linkedAccounts.find(P=>P.type==="wallet"&&P.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!m)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");let w=await t.requestFarcasterSignerStatus(d);if(w.status==="approved"){let P=await t.getAuthenticatedUser();c(P||s||null)}return w}}))();q3=Ee.recoverEmbeddedWallet;let _0=(0,se.useMemo)(()=>({wallets:u,ready:Nr&&In}),[u,Nr,In]);return(0,Xt.jsx)(Se.Provider,{value:mi,children:(0,Xt.jsx)(Ud.Provider,{value:N,children:(0,Xt.jsx)(Hp.Provider,{value:_0,children:(0,Xt.jsx)(Pf,{...O,children:(0,Xt.jsxs)(Dd.Provider,{value:Ee,children:[(0,Xt.jsxs)(mf,{data:Ne,setModalData:le,setInitialScreen:_,initialScreen:g,authenticated:a,open:r,children:[e.children,!O.headless&&O.captchaEnabled&&n&&!a&&(0,Xt.jsx)(Ol,{delayedExecution:!1}),(0,Xt.jsx)(k3,{theme:{...O.appearance.palette||{}}}),!O.render.standalone&&(0,Xt.jsx)(rd,{open:r})]}),we&&ye?(0,Xt.jsx)(D3,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:lr,mfaSubmitPromise:pt,onLoad:z,onLoadFailed:()=>null}):null,O.loginMethods.telegram&&O.loginConfig.telegramAuthConfiguration&&(0,Xt.jsx)(so,{if:!0,children:(0,Xt.jsx)(L3,{scriptHost:e.apiUrl||Sa,botUsername:O.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};var K3=require("react");function j3(e){let{login:t}=(0,K3.useContext)(Se);return tt("login",e),{login:t}}var Y3=require("react");function Z3(e){let{logout:t}=(0,Y3.useContext)(Se);return tt("logout",e),{logout:t}}var Ps=require("react");function J3(){let e=_e(),t=kl(),{initLoginWithHeadlessOAuth:r,loginWithHeadlessOAuth:o,isHeadlessOAuthLoading:n,ready:i,user:a}=G(),l=(0,Ps.useCallback)(async c=>{if(e.enabled&&e.status!=="success")throw new oo(e.error,null,"captcha_failure");return r(c.provider,e.token)},[r,e]),s=(0,Ps.useCallback)(async()=>{let c=Wa();if(a)return console.warn("Cannot login with OAuth when already logged in"),a;if(!c.inProgress)throw new Error("Cannot login with OAuth because no OAuth flow is in progress");if(!c.popupFlow)try{return await o(c)}catch(u){throw u}finally{Hn()}},[o]);return(0,Ps.useEffect)(()=>{let c=Wa();i&&t&&c.inProgress&&c.headless&&!c.popupFlow&&s()},[i,t]),{initOAuth:l,loginWithOAuth:s,loading:n}}var eu=require("react");var Q3=()=>{let e=_e(),{initLoginWithEmail:t,loginWithCode:r}=G(),o=(0,eu.useCallback)(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=(0,eu.useCallback)(async({code:i})=>{if(e.enabled&&e.status==="error")throw new oo(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};var tu=require("react");var X3=()=>{let e=_e(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=G(),n=(0,tu.useCallback)(async({phoneNumber:a})=>{if(!a)throw new Error("SMS required to send OTP code");return t(a)},[t]),i=(0,tu.useCallback)(async({code:a})=>{if(e.enabled&&e.status!=="success")throw new oo(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:n,loginWithCode:i,state:o}};var e0=require("react");function t0(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:y,linkInstagram:f,linkTelegram:v,linkFarcaster:C}=(0,e0.useContext)(Se);return tt("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:y,linkInstagram:f,linkFarcaster:C,linkTelegram:v}}var r0=require("react");function o0(e){let{connectWallet:t}=(0,r0.useContext)(Se);return tt("connectWallet",e),{connectWallet:t}}var n0=require("react");function i0(e){let{createWallet:t}=(0,n0.useContext)(Se);return tt("createWallet",e),{createWallet:t}}var a0=()=>{let{fundWallet:e}=G();return{fundWallet:e}};var s0=require("react");function l0(e){let{sendTransaction:t}=(0,s0.useContext)(Se);return tt("sendTransaction",e),{sendTransaction:t}}var c0=require("react");function d0(e){let{setWalletPassword:t}=(0,c0.useContext)(Se);return tt("setWalletPassword",e),{setWalletPassword:t}}var p0=require("react");function u0(e){let{setWalletRecovery:t}=(0,p0.useContext)(Se);return tt("setWalletRecovery",e),{setWalletRecovery:t}}var m0=require("react");function f0(e){let{signMessage:t}=(0,m0.useContext)(Se);return tt("signMessage",e),{signMessage:t}}var h0=require("react");function y0(e){let{signTypedData:t}=(0,h0.useContext)(Se);return tt("signTypedData",e),{signTypedData:t}}var g0=require("react");var v0=()=>{let{isModalOpen:e}=(0,g0.useContext)(Se);return{isOpen:e}};var C0=require("react");function w0(e){let{getAccessToken:t}=(0,C0.useContext)(Se);return tt("accessToken",e),{getAccessToken:t}}function b0(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=G();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}function E0(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function T0(e){return e.find(r=>r.walletClientType==="privy"&&r.connectorType==="embedded"&&!r.imported)??null}0&&(module.exports={AsExternalProvider,Captcha,ConnectorManager,LoginModal,PrivyClient,PrivyProvider,PrivyProxyProvider,SUPPORTED_CHAINS,VERSION,WalletConnector,addRpcUrlOverrideToChain,errorIndicatesMaxMfaRetries,errorIndicatesMfaTimeout,errorIndicatesMfaVerificationFailed,getAccessToken,getEmbeddedConnectedWallet,useConnectWallet,useCreateWallet,useExperimentalFarcasterSigner,useFundWallet,useLinkAccount,useLogin,useLoginWithEmail,useLoginWithOAuth,useLoginWithSms,useLogout,useMfa,useMfaEnrollment,useModalStatus,usePrivy,useRegisterMfaListener,useSendTransaction,useSetWalletPassword,useSetWalletRecovery,useSignMessage,useSignTypedData,useToken,useWallets});
3043
+ `;var Rs=require("react"),$3=require("react/jsx-runtime");function o6({botUsername:e,scriptHost:t}){let r=document.createElement("script"),{origin:o}=new URL(t);return r.async=!0,r.src=`${o}/js/telegram-login.js`,r.setAttribute("data-telegram-login",e),r.setAttribute("data-request-access","write"),r.setAttribute("data-lang","en"),r}function q3(e){let t=(0,Rs.useRef)(null),r=(0,Rs.useRef)();return(0,Rs.useEffect)(()=>{r.current?.remove(),r.current=o6(e),t.current?.after(r.current)},[e]),(0,$3.jsx)("div",{ref:t,hidden:!0})}var K3=require("react"),Sa=require("react");var ld=class{constructor(){this.callbacks={}}enqueue(t,r){this.callbacks[t]=r}dequeue(t,r){let o=this.callbacks[r];if(!o)throw new Error(`cannot dequeue ${t} event: no event found for id ${r}`);switch(delete this.callbacks[r],t){case"privy:iframe:ready":return o;case"privy:wallet:create":return o;case"privy:wallet:import":return o;case"privy:wallet:connect":return o;case"privy:wallet:recover":return o;case"privy:wallet:rpc":return o;case"privy:wallet:set-recovery":return o;case"privy:mfa:verify":return o;case"privy:mfa:init-enrollment":return o;case"privy:mfa:submit-enrollment":return o;case"privy:mfa:unenroll":return o;case"privy:mfa:clear":return o;case"privy:farcaster:init-signer":return o;case"privy:farcaster:sign":return o;default:throw new Error(`invalid wallet event type ${t}`)}}};async function In(e,t,r,o,n,i=!1){let a=i,s=async u=>{if(a&&t&&t.length>0){u===(i?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new lt("missing_or_invalid_mfa","MFA verification failed, retry."));let f=await new Promise((h,v)=>{r.current={resolve:h,reject:v};let C=1e3*60*5;setTimeout(()=>{let g=new lt("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(g),v(g)},C)});return await e(f)}return await e()},l=4,c=null;for(let u=0;u<l;u++)try{c=await s(u),o.current?.resolve(void 0);break}catch(f){if(f.type==="missing_or_invalid_mfa")a=!0;else throw o.current?.resolve(void 0),f}if(c===null){let u=new lt("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(u),u}return c}var Y3=require("react/jsx-runtime"),n6=function(e){return()=>`id-${e++}`}(0);function i6(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function Tr(e){return e.error!==void 0}var sr=new ld,au=new Map,a6=(e,t)=>typeof t=="bigint"?t.toString():t,s6=(e,t)=>`${e}${JSON.stringify(t,a6)}`;function Pr(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let i=s6(e,t);if(e==="privy:wallet:create"){let s=au.get(i);if(s)return s}let a=new Promise((s,l)=>{let c=n6();sr.enqueue(c,{resolve:s,reject:l}),n.postMessage({id:c,event:e,data:t},o)}).finally(()=>{au.delete(i)});return au.set(i,a),a}function l6(e){switch(e.event){case"privy:iframe:ready":let t=sr.dequeue(e.event,e.id);return Tr(e)?t.reject(new lt(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=sr.dequeue(e.event,e.id);return Tr(e)?r.reject(new lt(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:import":let o=sr.dequeue(e.event,e.id);return Tr(e)?o.reject(new lt(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let n=sr.dequeue(e.event,e.id);return Tr(e)?n.reject(new lt(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:recover":let i=sr.dequeue(e.event,e.id);return Tr(e)?i.reject(new lt(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:rpc":let a=sr.dequeue(e.event,e.id);return Tr(e)?a.reject(new lt(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:set-recovery":let s=sr.dequeue(e.event,e.id);return Tr(e)?s.reject(new lt(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:verify":let l=sr.dequeue(e.event,e.id);return Tr(e)?l.reject(new lt(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:init-enrollment":{let c=sr.dequeue(e.event,e.id);return Tr(e)?c.reject(new lt(e.error.type,e.error.message)):c.resolve(e.data)}case"privy:mfa:submit-enrollment":{let c=sr.dequeue(e.event,e.id);return Tr(e)?c.reject(new lt(e.error.type,e.error.message)):c.resolve(e.data)}case"privy:mfa:unenroll":{let c=sr.dequeue(e.event,e.id);return Tr(e)?c.reject(new lt(e.error.type,e.error.message)):c.resolve(e.data)}case"privy:mfa:clear":{let c=sr.dequeue(e.event,e.id);return Tr(e)?c.reject(new lt(e.error.type,e.error.message)):c.resolve(e.data)}case"privy:farcaster:init-signer":{let c=sr.dequeue(e.event,e.id);return Tr(e)?c.reject(new lt(e.error.type,e.error.message)):c.resolve(e.data)}case"privy:farcaster:sign":{let c=sr.dequeue(e.event,e.id);return Tr(e)?c.reject(new lt(e.error.type,e.error.message)):c.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function j3(e){let t=(0,Sa.useRef)(null),r=(0,Sa.useRef)(e.mfaMethods),o=ql(),[n,i]=(0,K3.useState)(!1);return(0,Sa.useEffect)(()=>{r.current=e.mfaMethods},[e.mfaMethods]),(0,Sa.useEffect)(()=>{if(!n)return;let a=t.current;if(!a)return;function s(h){h&&h.origin===e.origin&&i6(h.data)&&l6(h.data)}let l={create(h){return Pr("privy:wallet:create",h,a,e.origin)},import(h){return Pr("privy:wallet:import",h,a,e.origin)},connect(h){return Pr("privy:wallet:connect",h,a,e.origin)},recover(h){return In(v=>Pr("privy:wallet:recover",{...h,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!h.recoveryMethod||h.recoveryMethod==="privy")},rpc(h){return In(v=>Pr("privy:wallet:rpc",{...h,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},setRecovery(h){return In(v=>Pr("privy:wallet:set-recovery",{...h,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(h){return In(v=>Pr("privy:mfa:verify",{...h,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(h){return In(v=>Pr("privy:mfa:init-enrollment",{...h,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(h){return In(v=>Pr("privy:mfa:submit-enrollment",{...h,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(h){return In(v=>Pr("privy:mfa:unenroll",{...h,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(h){return Pr("privy:mfa:clear",h,a,e.origin)},initFarcasterSigner(h){return Pr("privy:farcaster:init-signer",h,a,e.origin)},signFarcasterMessage(h){return Pr("privy:farcaster:sign",h,a,e.origin)}};window.addEventListener("message",s);let c=()=>e.onLoad(l),u=(...h)=>{console.warn("Privy iframe failed to load: ",...h),e.onLoadFailed()},f=new AbortController;return xa(()=>Pr("privy:iframe:ready",{},a,e.origin),{abortSignal:f.signal}).then(c,u),()=>{window.removeEventListener("message",s),f.abort()}},[n]),(0,Y3.jsx)("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>i(!0),src:Zs(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}async function cd({api:e,requesterAppId:t,providerAppId:r}){let n=(await e.get(`/api/v1/apps/${t}/cross-app/connections`)).connections.find(i=>i.provider_app_id===r);if(!n)throw new b("Invalid connected app");return{name:n.provider_app_name,logoUrl:n.provider_app_icon_url,apiUrl:n.provider_app_custom_api_url}}async function Z3({api:e,appId:t}){let r=Hn(),o=wi(),n=await bi(r);try{let{url:i}=await e.post(Gs,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:n,state_code:o});return{url:i,stateCode:o,codeVerifier:r}}catch(i){throw de(i)}}async function J3({api:e,appId:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new b("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new b("User denied confirmation during cross-app auth flow");try{return(await e.post(Vs,{authorization_code:n,state_code:r,code_verifier:o,provider:`privy:${t}`})).oauth_provider_tokens.access_token}catch(i){let a=de(i);throw a.privyErrorCode?new b(a.message||"Invalid code during cross-app auth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during cross-app auth flow"?new b("Invalid code during cross-app auth flow.",void 0,"oauth_user_denied"):new b("Invalid code during cross-app auth flow.",void 0,"unknown_auth_error")}}async function Q3({url:e,popup:t}){return t.location=e,new Promise((o,n)=>{let a=setTimeout(()=>{n(new b("Authorization request timed out after 2 minutes.")),s()},12e4);function s(){t?.close(),window.removeEventListener("message",c)}let l=setInterval(()=>{t?.closed&&(s(),clearInterval(l),clearTimeout(a),n(new b("User rejected request")))},300);function c(u){u.data&&(u.data.type==="PRIVY_OAUTH_RESPONSE"&&u.data.stateCode&&u.data.authorizationCode&&(clearTimeout(a),o(u.data),s()),u.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(a),n(new b(u.data.error)),s()))}window.addEventListener("message",c)})}var dd=({user:e,address:t,client:r,request:o,requesterAppId:n})=>{let i=e?.linkedAccounts.find(c=>!!(c.type==="cross_app"&&c.embeddedWallets.find(u=>u.address===t)));if(!e||!i)throw new b("Cannot request a signature with for this wallet address");let a=r.getProviderAccessToken(i.providerApp.id);if(!a)throw new b("Transactions require a valid token");let s=window.open(void 0,void 0,su({w:400,h:680}));if(!s)throw new b("Failed to initialize signature request");return cd({api:r.api,requesterAppId:n,providerAppId:i.providerApp.id}).then(({apiUrl:c})=>{let u=new URL(`${c}/oauth/transact`);u.searchParams.set("token",a),u.searchParams.set("request",c6(o)),s.location=u.href}),new Promise((c,u)=>{let f=()=>{s.close(),window.removeEventListener("message",g)},v=setTimeout(()=>{f(),u(new b("Request timeout"))},12e4),C=setInterval(()=>{s.closed&&(f(),clearInterval(C),clearTimeout(v),u(new b("User rejected request")))},300),g=P=>{P.data&&P.data.type==="PRIVY_CROSS_APP_ACTION_RESPONSE"&&P.data.result&&(f(),clearTimeout(v),c(P.data.result))};window.addEventListener("message",g)})},c6=e=>JSON.stringify({content:{request:{request:e}},timestamp:Date.now(),callbackUrl:window.origin}),su=({w:e,h:t})=>{let r=window.screenLeft!==void 0?window.screenLeft:window.screenX,o=window.screenTop!==void 0?window.screenTop:window.screenY,n=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,i=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,a=n/window.screen.availWidth,s=i/window.screen.availHeight,l=(n-e)/2/a+r,c=(i-t)/2/s+o;return`toolbar=0,location=0,menubar=0,height=${t},width=${e},popup=1,left=${l},top=${c}`};function pd(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some(n=>t.includes(n))}var d6="https://cdn.apple-cloudkit.com";async function lu({url:e,popup:t,provider:r}){return t.location=e,new Promise((n,i)=>{function a(){t?.close(),window.removeEventListener("message",s)}function s(l){l.data&&(l.data.type==="PRIVY_OAUTH_RESPONSE"&&l.data.stateCode&&l.data.authorizationCode&&(n(l.data),a()),l.origin===d6&&l.data.ckSession&&(n({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:l.data.ckSession}),a()),l.data.type==="PRIVY_OAUTH_ERROR"&&(i(l.data.error),a()))}window.addEventListener("message",s)})}var X3=e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type});var er=require("react/jsx-runtime"),No;function p6(e){return typeof e=="string"&&e.length===25}function Me(){if(!No){let e=ee.get(Nn);return Promise.resolve(e||null)}return No.getAccessToken()}var r0,Dm=(e,t,r)=>r0(e,t,r),o0,Um=(e,t)=>o0(e,t),n0,Fm=(e,t)=>n0(e,t),i0,Bm=()=>i0(),u6=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;ee.put(Ma,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},a0=({config:e,...t})=>{if(!p6(t.appId))throw new b("Cannot initialize the Privy provider with an invalid Privy app ID");No||(No=new Oi({appId:t.appId,appClientId:t.clientId,apiUrl:t.apiUrl||Ia}));let r=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&r.embeddedWallets?.createOnLogin===void 0&&(r.embeddedWallets||(r.embeddedWallets={}),r.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),(0,er.jsx)(gf,{client:No,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:(0,er.jsx)(m6,{...t,client:No})})},m6=e=>{let t=e.client,[r,o]=(0,se.useState)(!1),[n,i]=(0,se.useState)(!1),[a,s]=(0,se.useState)(!1),[l,c]=(0,se.useState)(null),[u,f]=(0,se.useState)([]),h=(0,se.useRef)(u),[v,C]=(0,se.useState)(!1),[g,P]=(0,se.useState)(null),[S,E]=(0,se.useState)(!1),[x,R]=(0,se.useState)({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:T}),[D,I]=(0,se.useState)({status:"initial"}),[M,V]=(0,se.useState)(null),[z,re]=(0,se.useState)(null),[L,K]=(0,se.useState)(null),O=It(),ge=Ol(),[be,Ee]=(0,se.useState)(!0),[Ne,le]=(0,se.useState)({}),[tr,_t]=(0,se.useState)(null),[lr,kt]=(0,se.useState)(null),[Dr,Ze]=(0,se.useState)(!1),[gt,Ur]=(0,se.useState)(!1),cr=(0,se.useRef)(null),ut=(0,se.useRef)(null),N=(0,se.useRef)(Of),[Mn,Fe]=(0,se.useState)(!1);t.onStoreToken=d=>{d&&F(N,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{c(null),s(!1),F(N,"accessToken","onAccessTokenRemoved")};let oe=(0,se.useRef)(null),ce=(0,se.useRef)(null),Ie=d=>{P(d),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:d}})},rt=d=>{O.embeddedWallets.createOnLogin!=="off"&&Ee(!0),Ie(d)};(0,se.useEffect)(()=>{let d=()=>{document.visibilityState==="hidden"&&t.createAnalyticsEvent({eventName:"page_hidden",options:{keepAlive:!0}})};return document.addEventListener("visibilitychange",d),()=>{document.removeEventListener("visibilitychange",d)}},[]),(0,se.useEffect)(()=>{if(!l){t.connectors?.removeEmbeddedWalletConnector();return}let d=He(l),p=Id(l);if(d||t.connectors?.removeEmbeddedWalletConnector(),p||t.connectors?.removeImportedWalletConnector(),!t.connectors){console.debug("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!L){console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized");return}d&&t.connectors.addEmbeddedWalletConnector(L,d.address,O.defaultChain,e.appId),p&&t.connectors.addImportedWalletConnector(L,p.address,O.defaultChain,e.appId)},[L,l]),(0,se.useEffect)(()=>{L&&lr?.(L)},[L]),(0,se.useEffect)(()=>{(async()=>{if(!O.customAuth?.enabled)return;Ee(!0);let{getCustomAccessToken:p,isLoading:m}=O.customAuth;if(!(!n||m))try{let w=await p();if(!w&&a){await hi.logout();return}if(!w||a)return;t.startAuthFlow(new yi(w));let{user:_,isNewUser:G}=await t.authenticate();if(!_){await hi.logout();return}c(_||null),C(G||!1),s(!0),Ur(!0)}catch(w){console.warn(w),a&&await hi.logout()}})()},[O.customAuth?.enabled,O.customAuth?.getCustomAccessToken,O.customAuth?.isLoading,n,a]),(0,se.useEffect)(()=>{gt&&L&&l&&mr(l,O.embeddedWallets.createOnLogin)&&(Ur(!1),Ws(l,Ci).catch(console.error))},[gt&&L&&l]),(0,se.useEffect)(()=>{async function d(){let p=md(),m=pi();u6();let w=(0,e0.createStore)();V(w),t.initializeConnectorManager({walletConnectCloudProjectId:O.walletConnectCloudProjectId,rpcConfig:O.rpcConfig,chains:O.chains,defaultChain:O.defaultChain,store:w,walletList:O.appearance.walletList,shouldEnforceDefaultChainOnConnect:O.shouldEnforceDefaultChainOnConnect,externalWalletConfig:O.externalWallets,appName:O.name??"Privy"});let _;t.connectors?.on("connectorInitialized",()=>{_&&clearTimeout(_);let me=t.connectors.walletConnectors.length,Xe=t.connectors.walletConnectors.reduce((_e,Bt)=>_e+(Bt.initialized?1:0),0);Xe===me?Fe(!0):_=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:Xe,expected:me}),Fe(!0)},1500)}),t.connectors?.initialize().then(()=>{Aa()});let G=await t.getAuthenticatedUser(),q=!!G;if(O.customAuth?.enabled||(s(!!G),G&&F(N,"login","onComplete",G,!1,!0,null,null),c(G)),p){ce.current=q?"link":"login";return}if(m&&!q){ce.current="login",rt("TELEGRAM_AUTH_SCREEN");return}Ce.setReadyToTrue(!!G)}!n&&ge&&d()},[t,tr,n,ge]),(0,se.useEffect)(()=>{if(!n)return;if(!l){Ze(!0);return}if(!!!l.linkedAccounts.find(m=>m.type==="wallet"&&m.walletClientType==="privy")){Ze(!0);return}let p=!!u.find(m=>m.walletClientType==="privy");Ze(p)},[n,l,u]);let md=()=>{let d=Fa();if(d.inProgress&&d.popupFlow){if(window.opener.location.origin!==window.location.origin){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."});return}if(d.authorizationCode==="error"){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"There was an issue completing the OAuth flow"});return}window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:d.stateCode,authorizationCode:d.authorizationCode});return}return!d.inProgress||d.headless?!1:(t.startAuthFlow(new wo(d)),rt("AWAITING_OAUTH_SCREEN"),!0)},pi=()=>{let d=Wm();if(!d||!O.loginMethods.telegram||!O.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let p=new Ti;return t.startAuthFlow(p),d.flowType==="login-url"&&(p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult={id:d.id,first_name:d.first_name,last_name:d.last_name,auth_date:d.auth_date,username:d.username,photo_url:d.photo_url,hash:d.hash}),d.flowType==="web-app"&&(p.meta.telegramAuthResult=void 0,p.meta.telegramWebAppData={query_id:d.query_id,user:d.user,auth_date:d.auth_date,hash:d.hash}),!0},Ms=async(d,p,m,w)=>{let _=await t.connectors?.createWalletConnector(d,p)||null;ui(_,p,m,w)};async function ui(d,p,m,w){if(d)R({status:"disconnected",connectedWallet:null,connectError:null,connector:d,connectRetry:T});else return R({status:"disconnected",connectedWallet:null,connectError:new fe("Unable to connect to wallet."),connector:null,connectRetry:T}),w?.(null,m);d instanceof To&&p&&await d.resetConnection(p),R({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>ui(d,p,m,w)});try{let _=await d.connect({showPrompt:!0});if(O.shouldEnforceDefaultChainOnConnect&&!O.chains.find(G=>G.id===Number(_?.chainId))&&!(_?.connectorType==="wallet_connect_v2"&&_?.walletClientType==="metamask")&&!(_?.connectorType==="coinbase_wallet"&&O.externalWallets.coinbaseWallet.connectionOptions!=="eoaOnly")){R(G=>({...G,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:T}));try{await _?.switchChain(O.defaultChain.id),_&&(_.chainId=vi(On(O.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${O.defaultChain.id}`)}}return R(G=>({...G,status:"connected",connectedWallet:_,connectError:null,connectRetry:T})),_&&F(N,"connectWallet","onSuccess",_),w?.(_,m)}catch(_){return _ instanceof mt?(console.warn(_.cause?_.cause:_.message),F(N,"connectWallet","onError",_.privyErrorCode||"generic_connect_wallet_error")):(console.warn(_),F(N,"connectWallet","onError","unknown_connect_wallet_error")),R(G=>({...G,status:"disconnected",connectedWallet:null,connectError:_})),w?.(null,m)}}let mi=async(d,p)=>{if(d===null)return;let m=new qn(d,p);t.startAuthFlow(m)},Aa=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_connector"),m=d.get("privy_wallet_client");if(!p||!m)return;if(m==="phantom"&&!sn()&&rt("LOGIN_FAILED_SCREEN"),!t.connectors)throw new b("Connector not initialized");Ie("AWAITING_CONNECTION");let w=new URL(window.location.href);w.searchParams.delete("privy_connector"),w.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",w),Ms(p,m,void 0,mi)};(0,se.useEffect)(()=>{n&&a&&l===null&&t.getAuthenticatedUser().then(c)},[n,a,l,t]);let ot=()=>{if(!a)throw F(N,"linkAccount","onError","must_be_authenticated"),new b("User must be authenticated before linking an account.")},vt=()=>{ot(),oe.current="siwe",ce.current="link",Ie("LINK_WALLET_SCREEN")},Ct=d=>{if(!a||!l)return!1;if(d.walletClientType==="privy")return!0;for(let p of l.linkedAccounts)if(p.type==="wallet"&&p.address===d.address&&p.walletClientType!=="privy")return!0;return!1},fi=async d=>{if(!t.connectors)throw new b("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(R(m=>({...m,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:T})),O.captchaEnabled&&!a){let m={callback:w=>mi(d,w),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};le({captchaModalData:m}),rt("CAPTCHA_SCREEN")}else await mi(d),rt("AWAITING_CONNECTION")},Wn=async(d,p)=>{if(!O.fiatOnRamp.enabled)throw new b("Fiat on-ramp is not enabled");if(!p||!p.provider||p.provider==="moonpay"){let{signedUrl:m,externalTransactionId:w}=await vg(t,d,p?.config??{},O.appearance.palette,O.fiatOnRamp.useSandbox);return{signedUrl:m,externalTransactionId:w}}else throw new b("Unsupported fund provider. Currently supported option is `moonpay`.")},Ln=()=>{f(d=>{let p=t.connectors?.wallets.map(m=>({...m,linked:Ct(m),loginOrLink:async()=>{if(!await m.isConnected())throw new b("Wallet is not connected");if(m.connectorType==="embedded"&&m.walletClientType==="privy")throw new b("Cannot link or login with embedded wallet");fi(m)},fund:async w=>{let{signedUrl:_,externalTransactionId:G}=await Wn(m.address,w);le({fiatOnRampPrompt:{signedUrl:_},fiatOnRampStatus:{externalTransactionId:G}}),Ie("FIAT_ON_RAMP_PROMPT_SCREEN")},unlink:async()=>{if(!a)throw new b("User is not authenticated.");if(m.connectorType==="embedded"&&m.walletClientType==="privy")throw new b("Cannot unlink an embedded wallet");let w=await t.unlinkWallet(m.address);c(w)}}))||[];return hl(d,p)?d:p})};(0,se.useEffect)(()=>{Ln()},[l?.linkedAccounts,a,n]),(0,se.useEffect)(()=>{if(n){if(!t.connectors)throw new b("Connector not initialized");Ln(),t.connectors.on("walletsUpdated",Ln)}},[n]);let Do=()=>{Ie(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};(0,se.useEffect)(()=>{if(!u[0])return;let d=u[0],p=h.current.find(w=>w.address===d.address),m;if(d.walletClientType==="privy"?m=l?.linkedAccounts.find(w=>w.type==="wallet"&&w.address===d.address&&w.walletClientType==="privy"):m=l?.linkedAccounts.find(w=>w.type==="wallet"&&w.address===d.address&&w.walletClientType!=="privy"),!p&&m){let w=Object.assign({},l);w.wallet=m&&{address:m.address,chainType:m.chainType,chainId:m.chainId,walletClient:m.walletClient,walletClientType:m.walletClientType,connectorType:m.connectorType,imported:m.imported},c(w)}h.current=u},[u]);let Ws=async(d,p)=>{if(He(d))throw F(N,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[w,_]=await Promise.all([Ce.initializeWalletProxy(p),Me()]);if(!w&&O.customAuth?.enabled)throw F(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!w||!_||O.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((G,q)=>{Ee(!0),le({createWallet:{onSuccess:Xe=>{F(N,"createWallet","onSuccess",Xe),G(Xe)},onFailure:Xe=>{F(N,"createWallet","onError","unknown_embedded_wallet_error"),q(Xe)},callAuthOnSuccessOnClose:!1}}),Ie("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await w.create({accessToken:_});let G=await Ce.refreshUser(),q=He(G);if(!q)throw F(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return F(N,"createWallet","onSuccess",q),q}},F0=d=>{if(!O.chains.map(p=>p.id).includes(d))throw new fe(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},pu=(d,p,m)=>new Promise(async(w,_)=>{if(!a||!l){F(N,"sendTransaction","onError","must_be_authenticated"),_(new Error("User must be authenticated before signing with a Privy wallet"));return}let G=d.from,q=G?l?.linkedAccounts.find(Be=>Be.type==="wallet"&&Be.walletClientType==="privy"&&Be.address===G):He(l);if(!q){F(N,"sendTransaction","onError","embedded_wallet_not_found"),_(new Error("Must have a Privy wallet before signing"));return}Ee(!0);let me=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,Xe=d.chainId?Number(d.chainId):me.chainId;F0(Xe);let _e=Object.assign({},d,{chainId:Xe}),Bt=async()=>{let Be=await Me();if(!Be||!L){F(N,"sendTransaction","onError","embedded_wallet_not_found"),_(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await Ce.recoverEmbeddedWallet()){F(N,"sendTransaction","onError","unknown_connect_wallet_error"),_(new Error("Unable to connect to wallet"));return}let Qr=Fo(_e.chainId,O.chains,O.rpcConfig,{appId:e.appId}),fd=await Ca(q.address,_e,Qr);if(O.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:G0}=await va(fd,Qr),{hasSufficientFunds:V0}=await Jc(q.address,fd,G0,Qr);if(!V0)throw new ct(new Sr("Wallet has insufficient funds for this transaction.",Gt.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let fu=await Zc(Be,q.address,L,fd,Qr);F(N,"sendTransaction","onSuccess",fu),w(fu)}catch(Ls){F(N,"sendTransaction","onError","transaction_failure"),_(Ls)}};if(O.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),Bt();else{let Be={transactionRequest:_e,onSuccess:Qr=>{F(N,"sendTransaction","onSuccess",Qr),w(Qr)},onFailure:Qr=>{F(N,"sendTransaction","onError","transaction_failure"),_(Qr)},uiOptions:p||{},fundWalletConfig:m},Ls={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:Qr=>{F(N,"sendTransaction","onError","unknown_connect_wallet_error"),_(Qr)}};le({connectWallet:Ls,sendTransaction:Be}),Ie("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function uu(){return new Promise(async(d,p)=>{let m=await Me();if(!m||!L)throw new Error("Must have valid access token to enroll in MFA");try{await L.verifyMfa({accessToken:m}),d()}catch(w){p(w)}})}let dr=d=>{if(d==="passkey"){if(l&&l.linkedAccounts.filter(p=>p.type==="passkey").length>=5)throw F(N,"linkAccount","onError","cannot_link_more_of_type"),new b(`User already has an account of type ${d} linked.`)}else if(l?.[d])throw F(N,"linkAccount","onError","cannot_link_more_of_type"),new b(`User already has an account of type ${d} linked.`)},B0=()=>{if(!O.loginConfig.telegramAuthConfiguration?.linkEnabled)throw F(N,"linkAccount","onError","cannot_link_more_of_type"),new b("User can't link an account because Telegram linking is disabled.")};async function mu({legacySetWalletPasswordFlow:d=!1}){P(null);let p=d?"setWalletPassword":"setWalletRecovery";if(!a||!l)throw F(N,p,"onError","must_be_authenticated"),new Error("User must be authenticated before adding recovery method to Privy wallet");let m=He(l);if(!m||!L)throw F(N,p,"onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a recovery method");try{await uu()}catch(w){throw F(N,p,"onError","missing_or_invalid_mfa"),w}return new Promise((w,_)=>{Ee(!0);let G={onSuccess:_e=>{F(N,p,"onSuccess","user-passcode",_e),w(_e)},onFailure:_e=>{F(N,p,"onError","user_exited_set_password_flow"),_(_e)},callAuthOnSuccessOnClose:!1},q=m.recoveryMethod==="user-passcode",Xe={onCompleteNavigateTo:pc({walletAction:"update",availableRecoveryMethods:O.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:d,isResettingPassword:q}),shouldForceMFA:!1,onFailure:_e=>{F(N,p,"onError","unknown_connect_wallet_error"),_(_e)}};le({setWalletPassword:G,createWallet:G,connectWallet:Xe,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:q}}),Ie("EMBEDDED_WALLET_CONNECTING_SCREEN")})}let hi={ready:n,authenticated:a,user:l,walletConnectors:t.connectors||null,connectWallet:Do,importWallet:async({privateKey:d})=>{ot();let[p,m]=await Promise.all([Ce.initializeWalletProxy(15e3),Me()]);if(p&&m){await p.import({privateKey:d,accessToken:m});let w=await Ce.refreshUser(),_=Id(w);if(!_)throw F(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to import wallet");return F(N,"createWallet","onSuccess",_),_}else throw new b("User is not authenticated")},linkWallet:vt,linkCrossAppAccount:({appId:d})=>{ot(),oe.current=`privy:${d}`,ce.current="link";let p=window.open(void 0,void 0,su({w:440,h:680}));cd({api:t.api,providerAppId:d,requesterAppId:O.id}).then(({name:m,logoUrl:w})=>{le({crossAppAuth:{appId:d,name:m,logoUrl:w,popup:p}}),rt("CROSS_APP_AUTH_SCREEN")})},linkEmail:()=>{ot(),dr("email"),oe.current="email",ce.current="link",Ie("LINK_EMAIL_SCREEN")},linkPhone:()=>{ot(),dr("phone"),oe.current="sms",ce.current="link",Ie("LINK_PHONE_SCREEN")},linkGoogle:async()=>{ot(),dr("google"),ce.current="link",await Ce.initLoginWithOAuth("google")},linkTwitter:async()=>{ot(),dr("twitter"),ce.current="link",await Ce.initLoginWithOAuth("twitter")},linkDiscord:async()=>{ot(),dr("discord"),ce.current="link",await Ce.initLoginWithOAuth("discord")},linkGithub:async()=>{ot(),dr("github"),ce.current="link",await Ce.initLoginWithOAuth("github")},linkSpotify:async()=>{ot(),dr("spotify"),ce.current="link",await Ce.initLoginWithOAuth("spotify")},linkInstagram:async()=>{ot(),dr("instagram"),ce.current="link",await Ce.initLoginWithOAuth("instagram")},linkTiktok:async()=>{ot(),dr("tiktok"),ce.current="link",await Ce.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{ot(),dr("linkedin"),ce.current="link",await Ce.initLoginWithOAuth("linkedin")},linkApple:async()=>{ot(),dr("apple"),ce.current="link",await Ce.initLoginWithOAuth("apple")},linkPasskey:async()=>{ot(),dr("passkey"),await Ce.initLinkWithPasskey(),Ie("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{ot(),dr("telegram"),B0(),ce.current="link",oe.current="telegram",await Ce.initLoginWithTelegram(),Ie("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{ot(),dr("farcaster"),await Ce.initLoginWithFarcaster(),ce.current="link",oe.current="farcaster",Ie("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(ot(),!l?.email)throw new b("User does not have an email linked to their account.");ce.current="link",oe.current="email",Ie("UPDATE_EMAIL_SCREEN")},login:async()=>{let d="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!n){let p=await new Promise(m=>{_t(w=>m.bind(w))});if(_t(null),p){console.warn(d);return}}if(a){console.warn(d);return}ce.current="login",rt("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{_t(()=>d)}),_t(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(u[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}rt("CONNECT_OR_CREATE")},logout:async()=>{if(await t.logout(),l&&L)try{await L.clearMfa({userId:l.id})}catch{}c(null),s(!1),P(null),F(N,"logout","onSuccess"),ce.current=null,oe.current=null,o(!1),ee.del(Wa)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!l||!l.wallet)return new it;let d=u.find(m=>l.wallet&&m.address===l.wallet.address),p=t.connectors?.walletConnectors.find(m=>m.wallets.find(w=>w.address===d?.address));return!d||!p?new it:p.proxyProvider},getEthersProvider:()=>{if(!l||!l.wallet)return new ud.Web3Provider(new to(new it));let d=u.find(m=>l.wallet&&m.address===l.wallet.address),p=t.connectors?.walletConnectors.find(m=>m.wallets.find(w=>w.address===d?.address));return!d||!p?new ud.Web3Provider(new to(new it)):new ud.Web3Provider(new to(p.proxyProvider))},getWeb3jsProvider:()=>{if(!l||!l.wallet)return new pn(new it);let d=u.find(m=>l.wallet&&m.address===l.wallet.address),p=t.connectors?.walletConnectors.find(m=>m.wallets.find(w=>w.address===d?.address));return!d||!p?new pn(new it):new pn(p.proxyProvider)},unlinkWallet:async d=>{let p=await t.unlinkWallet(d);return c(p),p},unlinkEmail:async d=>{let p=await t.unlinkEmail(d);return c(p),p},unlinkPhone:async d=>{let p=await t.unlinkPhone(d);return c(p),p},unlinkGoogle:async d=>{let p=await t.unlinkOAuth("google",d);return c(p),p},unlinkTwitter:async d=>{let p=await t.unlinkOAuth("twitter",d);return c(p),p},unlinkDiscord:async d=>{let p=await t.unlinkOAuth("discord",d);return c(p),p},unlinkGithub:async d=>{let p=await t.unlinkOAuth("github",d);return c(p),p},unlinkSpotify:async d=>{let p=await t.unlinkOAuth("spotify",d);return c(p),p},unlinkInstagram:async d=>{let p=await t.unlinkOAuth("instagram",d);return c(p),p},unlinkTiktok:async d=>{let p=await t.unlinkOAuth("tiktok",d);return c(p),p},unlinkLinkedIn:async d=>{let p=await t.unlinkOAuth("linkedin",d);return c(p),p},unlinkApple:async d=>{let p=await t.unlinkOAuth("apple",d);return c(p),p},unlinkFarcaster:async d=>{let p=await t.unlinkFarcaster(d);return c(p),p},unlinkTelegram:async d=>{let p=await t.unlinkTelegram(d);return c(p),p},unlinkPasskey:async d=>{let p=await t.unlinkPasskey(d);return c(p),p},setActiveWallet:async d=>{let p=u.find(w=>(0,di.getAddress)(w.address)===(0,di.getAddress)(d)),m=l?.linkedAccounts.find(w=>w.type==="wallet"&&(0,di.getAddress)(w.address)===(0,di.getAddress)(d));if(!p||!await p.isConnected())re(d),vt();else if(!p.linked)p.loginOrLink();else{let w=Object.assign({},l);w.wallet=m&&{address:m.address,chainType:m.chainType,chainId:m.chainId,walletClient:m.walletClient,walletClientType:m.walletClientType,connectorType:m.connectorType,imported:m.imported},c(w)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!l)throw F(N,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return Ws(l,15e3)},setWalletRecovery:async()=>mu({legacySetWalletPasswordFlow:!1}),setWalletPassword:async()=>mu({legacySetWalletPasswordFlow:!0}),signMessage:(d,p,m)=>new Promise(async(w,_)=>{if(!a||!l){F(N,"signMessage","onError","must_be_authenticated"),_(new Error("User must be authenticated before signing with a Privy wallet"));return}let G=m?l?.linkedAccounts.find(me=>me.type==="wallet"&&me.walletClientType==="privy"&&(0,di.getAddress)(me.address)===(0,di.getAddress)(m)):He(l);if(!G){F(N,"signMessage","onError","embedded_wallet_not_found"),_(new Error("Must have a Privy wallet before signing"));return}if(typeof d!="string"||d.length<1){F(N,"signMessage","onError","invalid_message"),_(new Error("Message must be a non-empty string"));return}Ee(!0);let q=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let me=await Me();if(!L||!me)throw new Error("Unable to connect to wallet");if(!await Ce.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:G.address}});let{response:_e}=await L.rpc({accessToken:me,address:G.address,request:{method:"personal_sign",params:[d,G.address]}}),Bt=_e.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:G.address}}),Bt};if(O.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let me=await q();F(N,"signMessage","onSuccess",me),w(me)}catch(me){F(N,"signMessage","onError","unable_to_sign"),_(me??new ct("Unable to sign message"))}}else{let _e={method:"personal_sign",data:d,confirmAndSign:q,onSuccess:Be=>{F(N,"signMessage","onSuccess",Be),w(Be)},onFailure:Be=>{F(N,"signMessage","onError","unable_to_sign"),_(Be)},uiOptions:p||{}},Bt={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Be=>{F(N,"signMessage","onError","unknown_connect_wallet_error"),_(Be)},address:G.address};le({signMessage:_e,connectWallet:Bt}),Ie("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(m,w)=>{if(!a||!l){F(N,"signTypedData","onError","must_be_authenticated"),w(new Error("User must be authenticated before signing with a Privy wallet"));return}let _=He(l);if(!_){F(N,"signTypedData","onError","embedded_wallet_not_found"),w(new Error("Must have a Privy wallet before signing"));return}Ee(!0);let G=ka(d),q=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let me=await Me();if(!L||!me)throw new Error("Unable to connect to wallet");if(!await Ce.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:_.address}});let{response:_e}=await L.rpc({accessToken:me,address:_.address,request:{method:"eth_signTypedData_v4",params:[_.address,G]}}),Bt=_e.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:_.address}}),Bt};if(O.embeddedWallets.noPromptOnSignature||(O.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let me=await q();F(N,"signTypedData","onSuccess",me),m(me)}catch(me){F(N,"signTypedData","onError","unable_to_sign"),w(me??new ct("Unable to sign message"))}}else{let _e={method:"eth_signTypedData_v4",data:G,confirmAndSign:q,onSuccess:Be=>{F(N,"signTypedData","onSuccess",Be),m(Be)},onFailure:Be=>{F(N,"signTypedData","onError","unable_to_sign"),w(Be)},uiOptions:p||{}},Bt={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Be=>{F(N,"signMessage","onError","unknown_connect_wallet_error"),w(Be)}};le({signMessage:_e,connectWallet:Bt}),Ie("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,m)=>{let _=await(await pu(d,p,m)).wait();return Qc(_)},exportWallet:()=>new Promise(async(d,p)=>{if(!a||!l){p(new Error("User must be authenticated before exporting their Privy wallet"));return}if(!He(l)){p(new Error("Must have a Privy wallet before exporting"));return}Ee(!0);let w={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p,shouldForceMFA:!0};if(le(Ne),!await Me()||!L){p(new Error("Must have valid access token to enroll in MFA"));return}if(!L){p(new Error("Must have a Privy wallet before exporting"));return}let G={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,onSuccess:d,onFailure:p};le({keyExport:G,connectWallet:w}),Ie("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:uu,async init(d){switch(d){case"sms":await t.initMfaSmsVerification();return;case"passkey":return await t.initMfaPasskeyVerification();case"totp":return;default:throw new Error(`Unsupported MFA method: ${d}`)}},async submit(d,p){switch(d){case"totp":case"sms":if(typeof p!="string")throw new b("Invalid MFA code");cr.current?.resolve({mfaMethod:d,mfaCode:p,relyingParty:window.origin}),await new Promise((G,q)=>{ut.current={resolve:G,reject:q}});break;case"passkey":if(typeof p=="string")throw new b("Invalid authenticator response");let w=await(await import("@simplewebauthn/browser")).startAuthentication(p),_=X3(w);cr.current?.resolve({mfaMethod:d,mfaCode:_,relyingParty:window.origin}),await new Promise((G,q)=>{ut.current={resolve:G,reject:q}});break;default:throw cr.current?.reject(new b("Unsupported MFA method")),new b(`Unsupported MFA method: ${d}`)}},cancel(){cr.current?.reject(new b("MFA canceled"))},async initEnrollmentWithSms(d){let p=await Me();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber})},enrollInMfa(d){return new Promise((p,m)=>{if(!d){Ce.closePrivyModal(),p();return}O.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),le({mfaEnrollmentFlow:{mfaMethods:O.mfa.methods,onSuccess:p,onFailure:m}}),Ie("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await Me();if(!d||!L)throw new Error("Must have valid access token to enroll in MFA");let p=await L.initEnrollMfa({method:"totp",accessToken:d});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(d){let p=await Me();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber,code:d.mfaCode});let m=await t.getAuthenticatedUser();c(m)},async submitEnrollmentWithTotp(d){let p=await Me();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"totp",accessToken:p,code:d.mfaCode});let m=await t.getAuthenticatedUser();c(m)},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:d}){let p=await Me();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:d});let m=await t.getAuthenticatedUser();c(m)},async unenroll(d){let p=await Me();if(!p||!L)throw new Error("Must have valid access token to remove MFA");d==="passkey"?await L.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:[]}):await L.unenrollMfa({method:d,accessToken:p});let m=await t.getAuthenticatedUser();c(m)},requestFarcasterSignerFromWarpcast:async()=>{let d=await Me(),p=l?.linkedAccounts.find(_=>_.type==="wallet"&&_.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!l?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await Ce.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");let w=await L.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:d,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(w.status==="approved"){let _=await t.getAuthenticatedUser();c(_||l||null)}le({farcasterSigner:w}),Ie("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let d=await Me(),p=l?.linkedAccounts.find(_=>_.type==="wallet"&&_.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!l?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await Ce.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");if(!l.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");return(_=>Uint8Array.from(_.match(/.{1,2}/g).map(G=>parseInt(G,16))))(l.farcaster.signerPublicKey.slice(2))},signFarcasterMessage:async d=>{let p=await Me(),m=l?.linkedAccounts.find(q=>q.type==="wallet"&&q.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!m)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!l?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await Ce.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");if(!l.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");let _=await import("@simplewebauthn/browser"),G=await L.signFarcasterMessage({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{hash:_.bufferToBase64URLString(d)},fid:BigInt(l.farcaster.fid),relyingParty:window.origin});return new Uint8Array(_.base64URLStringToBuffer(G.signature))},isHeadlessOAuthLoading:S,loginWithCode(d){return Ce.loginWithCode(d)},initLoginWithEmail(d){return Ce.initLoginWithEmail(d)},initLoginWithSms(d){return Ce.initLoginWithSms(d)},otpState:D,fundWallet(d,p){return Ce.fundWallet(d,p)},initLoginWithHeadlessOAuth(d,p){return Ce.initLoginWithHeadlessOAuth(d,p)},loginWithHeadlessOAuth(d){return Ce.loginWithHeadlessOAuth(d)},signMessageWithCrossAppWallet(d,{address:p}){return dd({user:l,client:t,address:p,requesterAppId:O.id,request:{method:"personal_sign",params:[d,p]}})},signTypedDataWithCrossAppWallet(d,{address:p}){let m=ka(d);return dd({user:l,client:t,address:p,requesterAppId:O.id,request:{method:"eth_signTypedData_v4",params:[p,m]}})},sendTransactionWithCrossAppWallet(d,{address:p}){return dd({user:l,client:t,address:p,requesterAppId:O.id,request:{method:"eth_sendTransaction",params:[d]}})},isModalOpen:r,mfaMethods:O.mfa.methods};r0=hi.signMessage,o0=hi.signTypedData,n0=async(...d)=>{let p=await pu(...d);return O.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let Ce=(()=>({isNewUserThisSession:v,linkingHint:z,pendingTransaction:null,walletConnectionStatus:x,mipdStore:M,connectors:t.connectors?.walletConnectors??[],rpcConfig:O.rpcConfig,chains:O.chains,appId:e.appId,showFiatPrices:O.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>O.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(L)return L;let p=new Promise(_=>{kt(()=>G=>_(G))}),m=new Promise(_=>setTimeout(()=>_(null),d)),w=await Promise.race([p,m]);return kt(null),w},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(d={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&l,m;p&&oe.current&&(m=l?.linkedAccounts.filter(w=>w.latestVerifiedAt!==null&&!(w.type==="wallet"&&w.walletClientType==="privy")).sort((w,_)=>_.latestVerifiedAt.getTime()-w.latestVerifiedAt.getTime())[0]),ce.current==="login"&&oe.current?d.shouldCallAuthOnSuccess&&p?(F(N,"login","onComplete",l,v,!1,oe.current,m??null),e.onSuccess?.(l,v)):F(N,"login","onError","exited_auth_flow"):ce.current==="link"&&oe.current&&m&&(d.isSuccess&&p?F(N,"linkAccount","onSuccess",l,oe.current,m):F(N,"linkAccount","onError","exited_link_flow")),re(null),ce.current=null,oe.current=null,C(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},openPrivyModal:Ie,connectWallet:ui,initLoginWithWallet:async(d,p)=>{oe.current="siwe",mi(d,p)},loginWithWallet:async()=>{if(!n)throw new Uo;if(!(t.authFlow instanceof qn))throw new b("Must initialize SIWE flow first.");let d,p;if(a)try{({user:d}=await t.link()),oe.current="siwe"}catch(m){throw F(N,"linkAccount","onError",m.privyErrorCode||"failed_to_link_account"),m}else try{({user:d,isNewUser:p}=await t.authenticate()),oe.current="siwe"}catch(m){throw F(N,"login","onError",m.privyErrorCode||"generic_connect_wallet_error"),m}c(d||l||null),C(p||!1),s(!0)},initLoginWithFarcaster:async d=>{let p=new Ra(d);t.startAuthFlow(p);try{oe.current="farcaster",await p.initializeFarcasterConnect()}catch(m){throw ce.current==="login"?F(N,"login","onError",m.privyErrorCode||"unknown_auth_error"):ce.current==="link"&&F(N,"linkAccount","onError",m.privyErrorCode||"unknown_auth_error"),m}},loginWithFarcaster:async()=>{if(!n)throw new Uo;if(!(t.authFlow instanceof Ra))throw new b("Must initialize Farcaster flow first.");let d,p;if(a)try{({user:d}=await t.link()),oe.current="farcaster"}catch(m){throw F(N,"linkAccount","onError",m.privyErrorCode||"failed_to_link_account"),m}else try{({user:d,isNewUser:p}=await t.authenticate()),oe.current="farcaster"}catch(m){throw F(N,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}c(d||null),C(p||!1),s(!0)},async crossAppAuthFlow({appId:d,popup:p}){let m=`privy:${d}`;oe.current=m;let{url:w,stateCode:_,codeVerifier:G}=await Z3({api:t.api,appId:d});if(!w)throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:d}}),new b("No authorization URL returned for cross-app auth.");try{let q=await Q3({url:w,popup:p,provider:m}),me=q.stateCode,Xe=q.authorizationCode;if(me!==_)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:m,storedStateCode:_??"",returnedStateCode:me??""}}),new b("Unexpected auth flow. This may be a phishing attempt.");let _e=await J3({api:No.api,appId:d,codeVerifier:G,stateCode:me,authorizationCode:Xe});t.storeProviderAccessToken(d,_e),await Ce.refreshUser()}catch(q){throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:q.toString(),provider:m}}),q}},async initLoginWithOAuth(d,p){if(oe.current=d,vd()){if(d==="google"&&pd(window.navigator.userAgent)){rt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{rt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}ee.del(Fn);let m=new wo({provider:d});p&&m.addCaptchaToken(p),t.startAuthFlow(m);let w=await t.authFlow.getAuthorizationUrl();w&&w.url&&(d==="twitter"&&t0.isAndroid&&(w.url=w.url.replace("x.com","twitter.com")),window.location.assign(w.url))},async initLoginWithTelegram(d){if(!n)throw new Uo;oe.current="telegram";let p=new Ti(d);t.startAuthFlow(p),p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult=await new Promise((m,w)=>{if(!O.loginConfig.telegramAuthConfiguration)return w(new b("Telegram Auth configuration is not loaded"));if(!window.Telegram)return w(new b("Telegram was not initialized"));window.Telegram.Login.auth({bot_id:O.loginConfig.telegramAuthConfiguration.botId,request_access:!0},_=>_?m(_):w(new b("Telegram auth failed or was canceled by the client")))})},async loginWithTelegram(){if(!(t.authFlow instanceof Ti))throw new b("Must initialize Telegram flow before calling loginWithTelegram");let d,p;if(a)try{({user:d}=await t.link()),oe.current="telegram"}catch(m){throw F(N,"linkAccount","onError",m.privyErrorCode||"failed_to_link_account"),m}else try{let m=await t.authenticate();d=m.user,p=m.isNewUser,oe.current="telegram"}catch(m){throw ce.current==="login"?F(N,"login","onError",m.privyErrorCode||"unknown_auth_error"):ce.current==="link"&&F(N,"linkAccount","onError",m.privyErrorCode||"failed_to_link_account"),m}c(d),C(p||!1),s(!0)},async recoveryOAuthFlow(d,p,m){let w,_;function G(q){if(!q)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:d}}),new b("Recovery OAuth failed")}switch(d){case"google-drive":{let{url:q,codeVerifier:me,stateCode:Xe}=await dp({api:No.api,provider:d});G(q);let _e,Bt;try{let Be=await lu({url:q,popup:m,provider:d});if(_e=Be.stateCode,Bt=Be.authorizationCode,_e!==Xe)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:Xe??"",returnedStateCode:_e??""}}),new b("Unexpected auth flow. This may be a phishing attempt.")}catch(Be){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:Be.toString(),provider:d}}),new b("Recovery OAuth failed")}[w,_]=await Promise.all([Me(),Gh({api:No.api,provider:d,codeVerifier:me,stateCode:_e,authorizationCode:Bt})]);break}case"icloud":{let{url:q}=await dp({api:No.api,provider:d});G(q);let{ckWebAuthToken:me}=await lu({url:q,popup:m,provider:d});_=me,w=await Me();break}}if(!L)throw new b("Cannot connect to wallet proxy");if(!w)throw new b("Unable to authorize user");switch(p){case"recover":let q=Ne.recoverWallet?.privyWallet?.address;if(!q)throw new b("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:q,recoveryMethod:d}}),await L.recover({address:q,accessToken:w,recoveryAccessToken:_,recoveryMethod:d}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:q,recoveryMethod:d}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await L.create({accessToken:w,recoveryAccessToken:_,recoveryMethod:d});let me=await Ce.refreshUser(),Xe=He(me);if(!Xe)throw F(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:Xe.address}}),F(N,"createWallet","onSuccess",Xe);break;case"set-recovery":let _e=He(l);if(!_e)throw F(N,"setWalletRecovery","onError","embedded_wallet_not_found"),new Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{recoveryMethod:d}}),await L.setRecovery({address:_e.address,accessToken:w,recoveryAccessToken:_,recoveryMethod:d});let Bt=He(await Ce.refreshUser());if(!Bt)throw F(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:_e.address,recoveryMethod:d}}),F(N,"setWalletRecovery","onSuccess",d,Bt);break;default:throw new b("Unsupported recovery action")}},async loginWithOAuth(d){if(!(t.authFlow instanceof wo))throw new b("Must initialize OAuth flow before calling loginWithOAuth");let p=ee.get(Dn),m=t.authFlow.meta.stateCode;if(p!==m)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:p??"",returnedStateCode:m??""}}),new b("Unexpected auth flow. This may be a phishing attempt.");let w,_,G;if(a)try{let q=await t.link();w=q.user,G=q.oAuthProviderTokens,oe.current=d}catch(q){throw F(N,"linkAccount","onError",q.privyErrorCode||"failed_to_link_account"),q}else try{let q=await t.authenticate();w=q.user,_=q.isNewUser,G=q.oAuthProviderTokens,oe.current=d}catch(q){throw ce.current==="login"?F(N,"login","onError",q.privyErrorCode||"unknown_auth_error"):ce.current==="link"&&F(N,"linkAccount","onError",q.privyErrorCode||"failed_to_link_account"),q}return c(w),C(_||!1),s(!0),G},async initLoginWithPasskey(d){let p=new zn(d);t.startAuthFlow(p),ce.current="login";try{oe.current="passkey",await p.initAuthenticationFlow()}catch(m){throw F(N,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}},async loginWithPasskey(){if(!n)throw new Uo;if(!(t.authFlow instanceof zn))throw new b("Must initialize Passkey flow first.");if(oe.current!=="passkey")throw new b("Must init login with Passkey flow first.");let d,p;try{oe.current="passkey",{user:d,isNewUser:p}=await t.authenticate()}catch(m){throw F(N,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}c(d),C(p||!1),s(!0)},async initLinkWithPasskey(d){let p=new zn(d);t.startAuthFlow(p),ce.current="link",oe.current="passkey";try{await p.initLinkFlow()}catch(m){throw F(N,"linkAccount","onError",m.privyErrorCode||"unknown_auth_error"),m}},async linkWithPasskey(){if(!n)throw new Uo;if(!(t.authFlow instanceof zn))throw new b("Must initialize Passkey flow first.");if(oe.current!=="passkey")throw new b("Must init login with Passkey flow first.");let d;try{oe.current="passkey",{user:d}=await t.link()}catch(p){throw F(N,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account"),p}return c(d||l||null),d},async initLoginWithHeadlessOAuth(d,p){if(vd()){if(d==="google"&&pd(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.")}else throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let m=new wo({provider:d,headless:!0});p&&m.addCaptchaToken(p);let w=await t.startAuthFlow(m).getAuthorizationUrl();w?.url&&window.location.assign(w.url)},async loginWithHeadlessOAuth(d){E(!0),t.startAuthFlow(new wo(d));let p=ee.get(Dn),m=d.stateCode;if(p!==m)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d.provider,storedStateCode:p??"",returnedStateCode:m??""}}),E(!1),new b("Unexpected auth flow. This may be a phishing attempt.");let w,_;if(a)try{({user:w}=await t.link()),oe.current=d.provider}catch(G){throw F(N,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account"),G}else try{({user:w,isNewUser:_}=await t.authenticate()),oe.current=d.provider}catch(G){throw ce.current==="login"?F(N,"login","onError",G.privyErrorCode||"unknown_auth_error"):ce.current==="link"&&F(N,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account"),G}return c(w),C(_||!1),s(!0),E(!1),w??void 0},initLoginWithEmail:async(d,p)=>{let m=new an(d,p);t.startAuthFlow(m);try{oe.current="email",await m.sendCodeEmail()}catch(w){throw ce.current==="login"?F(N,"login","onError",w.privyErrorCode||"unknown_auth_error"):ce.current==="link"&&F(N,"linkAccount","onError",w.privyErrorCode||"failed_to_link_account"),w}},initUpdateEmail:async(d,p,m)=>{let w=new qs(d,p,m);t.startAuthFlow(w),await w.sendCodeEmail()},initLoginWithSms:async(d,p)=>{I({status:"sending-code"});let m=new $n(d,p);t.startAuthFlow(m);try{oe.current="sms",await m.sendSmsCode(),I({status:"awaiting-code-input"})}catch(w){throw I({status:"error",error:w}),ce.current==="login"?F(N,"login","onError",w.privyErrorCode||"unknown_auth_error"):ce.current==="link"&&F(N,"linkAccount","onError",w.privyErrorCode||"failed_to_link_account"),w}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(I({status:"submitting-code"}),!n){let _=new Uo;throw I({status:"error",error:_}),_}if(t.authFlow instanceof an)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof $n)t.authFlow.meta.smsCode=d.trim();else{let _=new b("Must initialize a passwordless code flow first");throw I({status:"error",error:_}),_}let p=await Me(),m,w;if(p&&t.sessionHasActiveToken())try{({user:m}=await t.link())}catch(_){throw I({status:"error",error:_}),F(N,"linkAccount","onError",_.privyErrorCode||"failed_to_link_account"),_}else try{({user:m,isNewUser:w}=await t.authenticate())}catch(_){throw I({status:"error",error:_}),F(N,"login","onError",_.privyErrorCode||"unknown_auth_error"),_}c(m||l||null),C(w||!1),s(!0),I({status:"done"})},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:L,createAnalyticsEvent:({eventName:d,payload:p,timestamp:m})=>t.createAnalyticsEvent({eventName:d,payload:p,timestamp:m}),acceptTerms:async()=>{let d=await t.acceptTerms();return c(d),d},getUsdTokenPrice:d=>t.getUsdTokenPrice(d),recoverEmbeddedWallet:async()=>new Promise(async(d,p)=>{let m=l?.linkedAccounts.find(_=>_.type==="wallet"&&_.walletClientType==="privy"),w=await Me();if(!w||!L||!m){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}Ee(!0);try{await L.connect({accessToken:w,address:m.address}),d(!0)}catch(_){if(Zi(_)&&m.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:m.address}}),(await L.recover({address:m.address,accessToken:w,recoveryMethod:m.recoveryMethod})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:m.address}}),d(!0);else if(Zi(_)&&m.recoveryMethod!=="privy"){le({recoverWallet:{privyWallet:m,onFailure:p,onSuccess:()=>d(!0)},recoveryOAuthStatus:{provider:m.recoveryMethod,action:"recover"}});let G=uc(m.recoveryMethod);Ie(G)}else p(_)}}),getFiatOnRampConfig:Wn,setReadyToTrue:d=>{i(!0),tr?.(d)},updateWallets:()=>Ln(),fundWallet:async(d,p)=>{let{signedUrl:m,externalTransactionId:w}=await Wn(d,p);le({fiatOnRampPrompt:{signedUrl:m},fiatOnRampStatus:{externalTransactionId:w}}),Ie("FIAT_ON_RAMP_PROMPT_SCREEN")},requestFarcasterSignerStatus:async d=>{let p=await Me(),m=l?.linkedAccounts.find(_=>_.type==="wallet"&&_.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!m)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!l?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");let w=await t.requestFarcasterSignerStatus(d);if(w.status==="approved"){let _=await t.getAuthenticatedUser();c(_||l||null)}return w}}))();i0=Ce.recoverEmbeddedWallet;let H0=(0,se.useMemo)(()=>({wallets:u,ready:Dr&&Mn}),[u,Dr,Mn]);return(0,er.jsx)(Se.Provider,{value:hi,children:(0,er.jsx)(qd.Provider,{value:N,children:(0,er.jsx)(Yp.Provider,{value:H0,children:(0,er.jsx)(If,{...O,children:(0,er.jsxs)(zd.Provider,{value:Ce,children:[(0,er.jsxs)(wf,{data:Ne,setModalData:le,setInitialScreen:P,initialScreen:g,authenticated:a,open:r,children:[e.children,!O.headless&&O.captchaEnabled&&n&&!a&&(0,er.jsx)(Hl,{delayedExecution:!1}),(0,er.jsx)(B3,{theme:{...O.appearance.palette||{}}}),!O.render.standalone&&(0,er.jsx)(sd,{open:r})]}),be&&ge?(0,er.jsx)(j3,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:l?.mfaMethods,mfaPromise:cr,mfaSubmitPromise:ut,onLoad:K,onLoadFailed:()=>null}):null,O.loginMethods.telegram&&O.loginConfig.telegramAuthConfiguration&&(0,er.jsx)(co,{if:!0,children:(0,er.jsx)(q3,{scriptHost:e.apiUrl||Ia,botUsername:O.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};var s0=require("react");function l0(e){let{login:t}=(0,s0.useContext)(Se);return at("login",e),{login:t}}var c0=require("react");function d0(e){let{logout:t}=(0,c0.useContext)(Se);return at("logout",e),{logout:t}}var Is=require("react");function p0(){let e=Ae(),t=Ol(),{initLoginWithHeadlessOAuth:r,loginWithHeadlessOAuth:o,isHeadlessOAuthLoading:n,ready:i,user:a}=H(),s=(0,Is.useCallback)(async c=>{if(e.enabled&&e.status!=="success")throw new no(e.error,null,"captcha_failure");return r(c.provider,e.token)},[r,e]),l=(0,Is.useCallback)(async()=>{let c=Fa();if(a)return console.warn("Cannot login with OAuth when already logged in"),a;if(!c.inProgress)throw new Error("Cannot login with OAuth because no OAuth flow is in progress");if(!c.popupFlow)try{return await o(c)}catch(u){throw u}finally{Vn()}},[o]);return(0,Is.useEffect)(()=>{let c=Fa();i&&t&&c.inProgress&&c.headless&&!c.popupFlow&&l()},[i,t]),{initOAuth:s,loginWithOAuth:l,loading:n}}var cu=require("react");var u0=()=>{let e=Ae(),{initLoginWithEmail:t,loginWithCode:r}=H(),o=(0,cu.useCallback)(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=(0,cu.useCallback)(async({code:i})=>{if(e.enabled&&e.status==="error")throw new no(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};var du=require("react");var m0=()=>{let e=Ae(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=H(),n=(0,du.useCallback)(async({phoneNumber:a})=>{if(!a)throw new Error("SMS required to send OTP code");return t(a)},[t]),i=(0,du.useCallback)(async({code:a})=>{if(e.enabled&&e.status!=="success")throw new no(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:n,loginWithCode:i,state:o}};var f0=require("react");function h0(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:s,linkGithub:l,linkLinkedIn:c,linkTiktok:u,linkSpotify:f,linkInstagram:h,linkTelegram:v,linkFarcaster:C}=(0,f0.useContext)(Se);return at("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:s,linkGithub:l,linkLinkedIn:c,linkTiktok:u,linkSpotify:f,linkInstagram:h,linkFarcaster:C,linkTelegram:v}}var y0=require("react");function g0(e){let{connectWallet:t}=(0,y0.useContext)(Se);return at("connectWallet",e),{connectWallet:t}}var v0=require("react");function C0(e){let{createWallet:t}=(0,v0.useContext)(Se);return at("createWallet",e),{createWallet:t}}var w0=()=>{let{fundWallet:e}=H();return{fundWallet:e}};var b0=()=>{let{linkCrossAppAccount:e,signMessageWithCrossAppWallet:t,signTypedDataWithCrossAppWallet:r,sendTransactionWithCrossAppWallet:o}=H();return{linkCrossAppAccount:e,signMessage:t,signTypedData:r,sendTransaction:o}};var E0=require("react");function T0(e){let{sendTransaction:t}=(0,E0.useContext)(Se);return at("sendTransaction",e),{sendTransaction:t}}var P0=require("react");function _0(e){let{setWalletPassword:t}=(0,P0.useContext)(Se);return at("setWalletPassword",e),{setWalletPassword:t}}var S0=require("react");function A0(e){let{setWalletRecovery:t}=(0,S0.useContext)(Se);return at("setWalletRecovery",e),{setWalletRecovery:t}}var x0=require("react");function k0(e){let{signMessage:t}=(0,x0.useContext)(Se);return at("signMessage",e),{signMessage:t}}var R0=require("react");function I0(e){let{signTypedData:t}=(0,R0.useContext)(Se);return at("signTypedData",e),{signTypedData:t}}var M0=require("react");var W0=()=>{let{isModalOpen:e}=(0,M0.useContext)(Se);return{isOpen:e}};var L0=require("react");function O0(e){let{getAccessToken:t}=(0,L0.useContext)(Se);return at("accessToken",e),{getAccessToken:t}}function N0(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=H();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}function D0(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function U0(e){return e.find(r=>r.walletClientType==="privy"&&r.connectorType==="embedded"&&!r.imported)??null}0&&(module.exports={AsExternalProvider,Captcha,ConnectorManager,LoginModal,PrivyClient,PrivyProvider,PrivyProxyProvider,SUPPORTED_CHAINS,VERSION,WalletConnector,addRpcUrlOverrideToChain,errorIndicatesMaxMfaRetries,errorIndicatesMfaTimeout,errorIndicatesMfaVerificationFailed,getAccessToken,getEmbeddedConnectedWallet,useConnectWallet,useCreateWallet,useCrossAppAccounts,useExperimentalFarcasterSigner,useFundWallet,useLinkAccount,useLogin,useLoginWithEmail,useLoginWithOAuth,useLoginWithSms,useLogout,useMfa,useMfaEnrollment,useModalStatus,usePrivy,useRegisterMfaListener,useSendTransaction,useSetWalletPassword,useSetWalletRecovery,useSignMessage,useSignTypedData,useToken,useWallets});