@privy-io/react-auth 1.63.0-beta-20240503180813 → 1.63.0-beta-20240503183352

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.
Files changed (3) hide show
  1. package/dist/esm/index.js +232 -232
  2. package/dist/index.js +232 -232
  3. package/package.json +2 -2
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var rc=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var ap=(e,t,r)=>(rc(e,t,"read from private field"),r?r.call(e):t.get(e)),_a=(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)},oc=(e,t,r,o)=>(rc(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var sp=(e,t,r)=>(rc(e,t,"access private method"),r);import{getAddress as ec}from"@ethersproject/address";import{Web3Provider as rp}from"@ethersproject/providers";import{createStore as tE}from"mipd";import{useEffect as Pr,useMemo as rE,useRef as vi,useState as Ge}from"react";import{FetchError as H1}from"ofetch";var Ue=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}]`:""}`}},pr=class extends Ue{constructor(r,o,n,i,a){super(n,i,a);this.type=r;this.status=o}},E=class extends Ue{constructor(r,o,n){super(r,o,n);this.type="client_error"}},Aa=class extends E{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var ee=class extends Ue{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},ce=e=>{if(e instanceof Ue)return e;if(!(e instanceof H1))return dt(e);if(!e.response)return new pr("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new pr(t||"ApiError",e.response.status,r||o,e,n)},dt=e=>e instanceof Ue?e:e instanceof Error?new E(e.message,e):new E(`Internal error: ${e}`);var po=class extends E{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},gt=class extends E{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},Ra=class extends E{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var kr=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 Ia="/api/v1/sessions",Ma="/api/v1/sessions/logout",lp="/api/v1/sessions/fork",Wa="/api/v1/sessions/fork/recover",cp="/api/v1/siwe/init",dp="/api/v1/siwe/authenticate",pp="/api/v1/siwe/link",up="/api/v1/siwe/unlink",mp="/api/v1/farcaster/init",fp="/api/v1/farcaster/authenticate",hp="/api/v1/farcaster/link",yp="/api/v1/farcaster/status",gp="/api/v1/farcaster/unlink",vp="/api/v1/passwordless/init",Cp="/api/v1/passwordless/authenticate",wp="/api/v1/passwordless/link",bp="/api/v1/passwordless/unlink",Ep="/api/v1/passwordless/update",Tp="/api/v1/passwordless_sms/init",Pp="/api/v1/passwordless_sms/link",Sp="/api/v1/passwordless_sms/unlink",xp="/api/v1/passwordless_sms/authenticate",kp="/api/v1/oauth/init",_p="/api/v1/oauth/authenticate",Ap="/api/v1/oauth/link",Rp="/api/v1/oauth/unlink",Ip="/api/v1/recovery/oauth/init",Mp="/api/v1/recovery/oauth/authenticate",Wp="/api/v1/passkeys/link/init",Lp="/api/v1/passkeys/authenticate/init",Op="/api/v1/passkeys/link",Np="/api/v1/passkeys/authenticate",Dp="/api/v1/passkeys/unlink";var Fp="/api/v1/mfa/passwordless_sms/init",Up="/api/v1/mfa/passkeys/init",Bp="/api/v1/users/me/accept_terms",La="/api/v1/analytics_events",Hp="/api/v1/plugins/moonpay_on_ramp/sign",Gp="/api/v1/custom_jwt_account/authenticate";var gn=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(Gp,{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 ce(t)}}async link(){throw new Error("Unimplemented")}};var uo=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(Cp,{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 ce(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(wp,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw ce(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(vp,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw ce(o)}}},Oa=class extends uo{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(Ep,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw ce(r)}}};import{isMobile as $1,isIOS as K1}from"react-device-detect";var nc=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)}},Na=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 ic(){try{let e="privy:__session_storage__test",t="blobby",r=new Na;return r.put(e,t),r.del(e),!0}catch{return!1}}function G1(){return typeof window<"u"&&window.localStorage?new Na:new nc}var Y=G1();import{StaticJsonRpcProvider as Cn}from"@ethersproject/providers";function Vp(){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 Da=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 ac=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||Da(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!ac(r))return!1}return!0},mo=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),zp=()=>{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 qp="1.63.0-beta-20240503180813";var sc="4df5e2316331463a9130964bd6078dfa",lc="fe9c30fc-3bc5-4064-91e2-6ab5887f8f4d",$p="34357d3c125c2bcf2ce2bc3309d98715",Fa="https://auth.privy.io",Kp=2e4,Be=1400,jp=2500,cc=qp;var Uo="privy:token",dc="privy-token",Ua="privy:refresh_token",pc="privy-refresh-token",Ba="privy-session",Ei="privy:session_transfer_token",z1="privy:wallet",Ti="privy:caid",Bo="privy:state_code",Ho="privy:code_verifier",Go="privy:headless_oauth",Ha=e=>`${z1}:${e}`,uc="privy:connectors",mc="privy:connections";var Vo=12e4,Yr=1,fc="0x1",vn=3e4,Yp="https://api.moonpay.com/v1",Zp="https://api.moonpay.com/v1",Jp="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",Qp="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",Xp="0x420000000000000000000000000000000000000F",eu=["function getL1Fee(bytes memory _data) external view returns (uint256)"];var tu=(e,t)=>{let r=[],o=[];for(let[n,i]of e.entries())n<t?r.push(i):o.push(i);return[r,o]},Ga=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,}))$/),ru=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},fo=(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}`},hc=e=>new Promise(t=>setTimeout(t,e));function ou(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 nu=(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(()=>{a=!0,n()},(...s)=>{a=!0,i(...s)}),l+=1,await hc(r)}a||i(new Error("Exceeded max attempts before resolving function"))})},Va=(e,t,r={})=>{let o=new URL(t,e);for(let[n,i]of Object.entries(r))o.searchParams.set(n,i);return o.href};var iu=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),zo=e=>typeof e=="string"?e:"0x"+e.toString(16);async function au(e,t,r=3e3){let o=!1,n=window;return new Promise(i=>{n.ethereum?a():(window.addEventListener("ethereum#initialized",a,{once:!0}),setTimeout(()=>{a()},r));function a(){if(o)return;o=!0,window.removeEventListener("ethereum#initialized",a);let l=e.getProviders(),s=[];for(let c of l)t.includes("coinbase_wallet")&&c.info.rdns==="com.coinbase.wallet"||s.push({type:c.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:c});for(let c of Vp()){let u=Da(c);if(!l.some(h=>h.info.name===u)){if(ac(c,!0)&&!s.find(h=>h.type==="metamask")){s.push({type:"metamask",legacyInjectedProvider:c});continue}if(u==="Phantom"&&!s.find(h=>h.type==="phantom")){s.push({type:"phantom",legacyInjectedProvider:c});continue}if(u==="Coinbase Wallet"&&!s.find(h=>h.type==="coinbase_wallet")){s.push({type:"coinbase_wallet",legacyInjectedProvider:c});continue}s.find(h=>h.type==="unknown_browser_extension")||s.push({type:"unknown_browser_extension",legacyInjectedProvider:c})}}i(s)}})}function wn(e){return`eip155:${String(Number(e))}`}var za=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new ee(`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.infura?.http[0]?a=i.rpcUrls.infura.http[0]+"/"+sc:i.rpcUrls.blast?.http[0]?a=i.rpcUrls.blast.http[0]+"/"+lc:a=i.rpcUrls.default?.http[0];if(!a)throw new ee(`No RPC url found for ${e}`);return a},su=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new ee(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Zr=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new ee(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?a=new Cn(i.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?a=new Cn(r.rpcUrls[n]):i.rpcUrls.privy?.http[0]?a=new Cn({url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):i.rpcUrls.infura?.http[0]?a=new Cn(i.rpcUrls.infura.http[0]+"/"+sc):i.rpcUrls.blast?.http[0]?a=new Cn(i.rpcUrls.blast.http[0]+"/"+lc):a=new Cn(i.rpcUrls.default?.http[0]),!a)throw new ee(`No RPC url found for ${e}`);return a},qa=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 $a=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(Ka))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var Ka={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"}}};function q1(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function lu(e,t){let r=q1(t);if(r.deepLink)return mu(r.deepLink,e);if(r.universalLink)return fu(r.universalLink,e);throw new E(`Unsupported wallet ${t.id}`)}var cu="WALLETCONNECT_DEEPLINK_CHOICE";function du(){try{localStorage.removeItem(cu)}catch{}}function pu({href:e,name:t}){try{localStorage.setItem(cu,JSON.stringify({href:e,name:t}))}catch{}}function uu(e){return e.startsWith("http://")||e.startsWith("https://")}function mu(e,t){if(uu(e))return fu(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 fu(e,t){if(!uu(e))return mu(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function ja(e,t){window.open(e,t,"noreferrer noopener")}var Oe=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 Pi=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new Oe(this._startChannelOnce.bind(this)),this.pollForReady=new Oe(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(fp,{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 ce(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");try{return await this.api.post(hp,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw ce(t)}}async _startChannelOnce(){if(!this.api)throw new E("Auth flow has no API instance");let t=await this.api.post(mp,{token:this.captchaToken});$1&&!K1&&t.connect_uri&&ja(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(yp,{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}};import{base64url as gu}from"jose";async function hu(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function yu(e){return crypto.getRandomValues(new Uint8Array(e))}var j1="S256",Y1="S256";function Si(){return gu.encode(yu(36))}function Ya(){return Si()}async function Za(e,t=j1){if(t==Y1){let r=await hu(e);return gu.encode(r)}else return e}function vu(){let e=Y.get(Ho);if(!e)throw new E("Authentication error.");return e}function Ja(){return!!Y.get(Go)}var _r=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:Ja();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=vu();try{let r=await this.api.post(_p,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return Y.del(Ho),this.meta.headless&&Y.del(Go),{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=ce(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=Y.get(Ho);if(!t)throw new E("Authentication error.");try{let r=await this.api.post(Ap,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return Y.del(Ho),r}catch(r){throw ce(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=Si();Y.put(Ho,t);let r=Ya();Y.put(Bo,r);let o=await Za(t);this.meta.headless&&Y.put(Go,!0);try{return await this.api.post(kp,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw ce(n)}}};function yc(e){return e.charAt(0).toUpperCase()+e.slice(1)}import{jsx as Cu,jsxs as Z1}from"react/jsx-runtime";var Qa=({style:e,...t})=>Z1("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:[Cu("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"}),Cu("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"})]});import{jsx as xi,jsxs as J1}from"react/jsx-runtime";var Xa=({style:e,...t})=>J1("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:[xi("g",{clipPath:"url(#clip0)",children:xi("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"})}),xi("defs",{children:xi("clipPath",{id:"clip0",children:xi("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as wu}from"react/jsx-runtime";var es=({style:e,...t})=>wu("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:wu("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:"#171515"})});import{jsx as ts,jsxs as Q1}from"react/jsx-runtime";var rs=({style:e,...t})=>Q1("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:[ts("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"}),ts("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"}),ts("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"}),ts("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"})]});import{jsx as os}from"react/jsx-runtime";function ns({style:e,...t}){return os("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:os("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:os("g",{transform:"scale(5.12,5.12)",children:os("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"})})})})}import{jsx as bu,jsxs as X1}from"react/jsx-runtime";function is(e){return X1("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[bu("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"}),bu("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"})]})}import{jsx as gc,jsxs as e2}from"react/jsx-runtime";function as(e){return e2("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:[gc("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"}),gc("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"}),gc("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"})]})}import{jsx as Eu}from"react/jsx-runtime";var ss=({style:e,...t})=>Eu("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:Eu("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:"#000000"})});var t2={google:{name:"Google",component:rs},discord:{name:"Discord",component:Xa},github:{name:"Github",component:es},linkedin:{name:"LinkedIn",component:ns},twitter:{name:"Twitter",component:ss},spotify:{name:"Spotify",component:is},tiktok:{name:"Tiktok",component:as},apple:{name:"Apple",component:Qa}},ki=e=>t2[e];function Tu(e,t){let r={detail:"",retryable:!1},o=yc(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=ki(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=ki(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return r}function _i(){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:Ja(),popupFlow:window.opener!==null}}function qo(){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"),Y.del(Bo),window.history.replaceState({},"",e)}var $o=class{constructor(t){this.initAuthenticateOnce=new Oe(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new Oe(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(Np,{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"):ce(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(Op,{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"):ce(r)}}async _initAuthenticateOnce(){if(!this.api)throw new E("Auth flow has no API instance");return await this.api.post(Lp,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new E("Auth flow has no API instance");return await this.api.post(Wp,{})}_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 Ko=class{constructor(t,r){this.createSiweMessage=(t,r,o,n,i,a,l)=>`${o} wants you to sign in with your Ethereum account:
1
+ var rc=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var ip=(e,t,r)=>(rc(e,t,"read from private field"),r?r.call(e):t.get(e)),_a=(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)},oc=(e,t,r,o)=>(rc(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var ap=(e,t,r)=>(rc(e,t,"access private method"),r);import{getAddress as ec}from"@ethersproject/address";import{Web3Provider as rp}from"@ethersproject/providers";import{createStore as eE}from"mipd";import{useEffect as Pr,useMemo as tE,useRef as vi,useState as Ge}from"react";import{FetchError as B1}from"ofetch";var Ue=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}]`:""}`}},pr=class extends Ue{constructor(r,o,n,i,a){super(n,i,a);this.type=r;this.status=o}},E=class extends Ue{constructor(r,o,n){super(r,o,n);this.type="client_error"}},Aa=class extends E{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var ee=class extends Ue{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},ce=e=>{if(e instanceof Ue)return e;if(!(e instanceof B1))return dt(e);if(!e.response)return new pr("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new pr(t||"ApiError",e.response.status,r||o,e,n)},dt=e=>e instanceof Ue?e:e instanceof Error?new E(e.message,e):new E(`Internal error: ${e}`);var uo=class extends E{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},gt=class extends E{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},Ra=class extends E{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var kr=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 Ia="/api/v1/sessions",Ma="/api/v1/sessions/logout",sp="/api/v1/sessions/fork",Wa="/api/v1/sessions/fork/recover",lp="/api/v1/siwe/init",cp="/api/v1/siwe/authenticate",dp="/api/v1/siwe/link",pp="/api/v1/siwe/unlink",up="/api/v1/farcaster/init",mp="/api/v1/farcaster/authenticate",fp="/api/v1/farcaster/link",hp="/api/v1/farcaster/status",yp="/api/v1/farcaster/unlink",gp="/api/v1/passwordless/init",vp="/api/v1/passwordless/authenticate",Cp="/api/v1/passwordless/link",wp="/api/v1/passwordless/unlink",bp="/api/v1/passwordless/update",Ep="/api/v1/passwordless_sms/init",Tp="/api/v1/passwordless_sms/link",Pp="/api/v1/passwordless_sms/unlink",Sp="/api/v1/passwordless_sms/authenticate",xp="/api/v1/oauth/init",kp="/api/v1/oauth/authenticate",_p="/api/v1/oauth/link",Ap="/api/v1/oauth/unlink",Rp="/api/v1/recovery/oauth/init",Ip="/api/v1/recovery/oauth/authenticate",Mp="/api/v1/passkeys/link/init",Wp="/api/v1/passkeys/authenticate/init",Lp="/api/v1/passkeys/link",Op="/api/v1/passkeys/authenticate",Np="/api/v1/passkeys/unlink";var Dp="/api/v1/mfa/passwordless_sms/init",Fp="/api/v1/mfa/passkeys/init",Up="/api/v1/users/me/accept_terms",La="/api/v1/analytics_events",Bp="/api/v1/plugins/moonpay_on_ramp/sign",Hp="/api/v1/custom_jwt_account/authenticate";var gn=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(Hp,{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 ce(t)}}async link(){throw new Error("Unimplemented")}};var mo=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(vp,{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 ce(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(Cp,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw ce(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(gp,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw ce(o)}}},Oa=class extends mo{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(bp,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw ce(r)}}};import{isMobile as q1,isIOS as $1}from"react-device-detect";var nc=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)}},Na=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 ic(){try{let e="privy:__session_storage__test",t="blobby",r=new Na;return r.put(e,t),r.del(e),!0}catch{return!1}}function H1(){return typeof window<"u"&&window.localStorage?new Na:new nc}var Y=H1();import{StaticJsonRpcProvider as Cn}from"@ethersproject/providers";function Gp(){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 Da=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 ac=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||Da(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!ac(r))return!1}return!0},fo=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Vp=()=>{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 zp="1.63.0-beta-20240503183352";var sc="4df5e2316331463a9130964bd6078dfa",lc="fe9c30fc-3bc5-4064-91e2-6ab5887f8f4d",qp="34357d3c125c2bcf2ce2bc3309d98715",Fa="https://auth.privy.io",$p=2e4,Be=1400,Kp=2500,cc=zp;var Uo="privy:token",dc="privy-token",Ua="privy:refresh_token",pc="privy-refresh-token",Ba="privy-session",Ei="privy:session_transfer_token",V1="privy:wallet",Ti="privy:caid",Bo="privy:state_code",Ho="privy:code_verifier",Go="privy:headless_oauth",Ha=e=>`${V1}:${e}`,uc="privy:connectors",mc="privy:connections";var Vo=12e4,Zr=1,fc="0x1",vn=3e4,jp="https://api.moonpay.com/v1",Yp="https://api.moonpay.com/v1",Zp="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",Jp="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",Qp="0x420000000000000000000000000000000000000F",Xp=["function getL1Fee(bytes memory _data) external view returns (uint256)"];var eu=(e,t)=>{let r=[],o=[];for(let[n,i]of e.entries())n<t?r.push(i):o.push(i);return[r,o]},Ga=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,}))$/),tu=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},ho=(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}`},hc=e=>new Promise(t=>setTimeout(t,e));function ru(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 ou=(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(()=>{a=!0,n()},(...s)=>{a=!0,i(...s)}),l+=1,await hc(r)}a||i(new Error("Exceeded max attempts before resolving function"))})},Va=(e,t,r={})=>{let o=new URL(t,e);for(let[n,i]of Object.entries(r))o.searchParams.set(n,i);return o.href};var nu=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),zo=e=>typeof e=="string"?e:"0x"+e.toString(16);async function iu(e,t,r=3e3){let o=!1,n=window;return new Promise(i=>{n.ethereum?a():(window.addEventListener("ethereum#initialized",a,{once:!0}),setTimeout(()=>{a()},r));function a(){if(o)return;o=!0,window.removeEventListener("ethereum#initialized",a);let l=e.getProviders(),s=[];for(let c of l)t.includes("coinbase_wallet")&&c.info.rdns==="com.coinbase.wallet"||s.push({type:c.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:c});for(let c of Gp()){let u=Da(c);if(!l.some(h=>h.info.name===u)){if(ac(c,!0)&&!s.find(h=>h.type==="metamask")){s.push({type:"metamask",legacyInjectedProvider:c});continue}if(u==="Phantom"&&!s.find(h=>h.type==="phantom")){s.push({type:"phantom",legacyInjectedProvider:c});continue}if(u==="Coinbase Wallet"&&!s.find(h=>h.type==="coinbase_wallet")){s.push({type:"coinbase_wallet",legacyInjectedProvider:c});continue}s.find(h=>h.type==="unknown_browser_extension")||s.push({type:"unknown_browser_extension",legacyInjectedProvider:c})}}i(s)}})}function wn(e){return`eip155:${String(Number(e))}`}var za=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new ee(`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.infura?.http[0]?a=i.rpcUrls.infura.http[0]+"/"+sc:i.rpcUrls.blast?.http[0]?a=i.rpcUrls.blast.http[0]+"/"+lc:a=i.rpcUrls.default?.http[0];if(!a)throw new ee(`No RPC url found for ${e}`);return a},au=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new ee(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Jr=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new ee(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?a=new Cn(i.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?a=new Cn(r.rpcUrls[n]):i.rpcUrls.privy?.http[0]?a=new Cn({url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):i.rpcUrls.infura?.http[0]?a=new Cn(i.rpcUrls.infura.http[0]+"/"+sc):i.rpcUrls.blast?.http[0]?a=new Cn(i.rpcUrls.blast.http[0]+"/"+lc):a=new Cn(i.rpcUrls.default?.http[0]),!a)throw new ee(`No RPC url found for ${e}`);return a},qa=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 $a=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(Ka))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var Ka={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"}}};function z1(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function su(e,t){let r=z1(t);if(r.deepLink)return uu(r.deepLink,e);if(r.universalLink)return mu(r.universalLink,e);throw new E(`Unsupported wallet ${t.id}`)}var lu="WALLETCONNECT_DEEPLINK_CHOICE";function cu(){try{localStorage.removeItem(lu)}catch{}}function du({href:e,name:t}){try{localStorage.setItem(lu,JSON.stringify({href:e,name:t}))}catch{}}function pu(e){return e.startsWith("http://")||e.startsWith("https://")}function uu(e,t){if(pu(e))return mu(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 mu(e,t){if(!pu(e))return uu(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function ja(e,t){window.open(e,t,"noreferrer noopener")}var Oe=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 Pi=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new Oe(this._startChannelOnce.bind(this)),this.pollForReady=new Oe(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(mp,{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 ce(t)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");try{return await this.api.post(fp,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw ce(t)}}async _startChannelOnce(){if(!this.api)throw new E("Auth flow has no API instance");let t=await this.api.post(up,{token:this.captchaToken});q1&&!$1&&t.connect_uri&&ja(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(hp,{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}};import{base64url as yu}from"jose";async function fu(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function hu(e){return crypto.getRandomValues(new Uint8Array(e))}var K1="S256",j1="S256";function Si(){return yu.encode(hu(36))}function Ya(){return Si()}async function Za(e,t=K1){if(t==j1){let r=await fu(e);return yu.encode(r)}else return e}function gu(){let e=Y.get(Ho);if(!e)throw new E("Authentication error.");return e}function Ja(){return!!Y.get(Go)}var _r=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:Ja();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=gu();try{let r=await this.api.post(kp,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return Y.del(Ho),this.meta.headless&&Y.del(Go),{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=ce(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=Y.get(Ho);if(!t)throw new E("Authentication error.");try{let r=await this.api.post(_p,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return Y.del(Ho),r}catch(r){throw ce(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=Si();Y.put(Ho,t);let r=Ya();Y.put(Bo,r);let o=await Za(t);this.meta.headless&&Y.put(Go,!0);try{return await this.api.post(xp,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw ce(n)}}};function yc(e){return e.charAt(0).toUpperCase()+e.slice(1)}import{jsx as vu,jsxs as Y1}from"react/jsx-runtime";var Qa=({style:e,...t})=>Y1("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:[vu("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"}),vu("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"})]});import{jsx as xi,jsxs as Z1}from"react/jsx-runtime";var Xa=({style:e,...t})=>Z1("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:[xi("g",{clipPath:"url(#clip0)",children:xi("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"})}),xi("defs",{children:xi("clipPath",{id:"clip0",children:xi("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as Cu}from"react/jsx-runtime";var es=({style:e,...t})=>Cu("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:Cu("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:"#171515"})});import{jsx as ts,jsxs as J1}from"react/jsx-runtime";var rs=({style:e,...t})=>J1("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:[ts("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"}),ts("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"}),ts("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"}),ts("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"})]});import{jsx as os}from"react/jsx-runtime";function ns({style:e,...t}){return os("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:os("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:os("g",{transform:"scale(5.12,5.12)",children:os("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"})})})})}import{jsx as wu,jsxs as Q1}from"react/jsx-runtime";function is(e){return Q1("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[wu("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"}),wu("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"})]})}import{jsx as gc,jsxs as X1}from"react/jsx-runtime";function as(e){return X1("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:[gc("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"}),gc("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"}),gc("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"})]})}import{jsx as bu}from"react/jsx-runtime";var ss=({style:e,...t})=>bu("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:bu("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:"#000000"})});var e2={google:{name:"Google",component:rs},discord:{name:"Discord",component:Xa},github:{name:"Github",component:es},linkedin:{name:"LinkedIn",component:ns},twitter:{name:"Twitter",component:ss},spotify:{name:"Spotify",component:is},tiktok:{name:"Tiktok",component:as},apple:{name:"Apple",component:Qa}},ki=e=>e2[e];function Eu(e,t){let r={detail:"",retryable:!1},o=yc(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=ki(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=ki(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return r}function _i(){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:Ja(),popupFlow:window.opener!==null}}function qo(){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"),Y.del(Bo),window.history.replaceState({},"",e)}var $o=class{constructor(t){this.initAuthenticateOnce=new Oe(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new Oe(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(Op,{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"):ce(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(Lp,{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"):ce(r)}}async _initAuthenticateOnce(){if(!this.api)throw new E("Auth flow has no API instance");return await this.api.post(Wp,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new E("Auth flow has no API instance");return await this.api.post(Mp,{})}_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 Ko=class{constructor(t,r){this.createSiweMessage=(t,r,o,n,i,a,l)=>`${o} wants you to sign in with your Ethereum account:
2
2
  ${r}
3
3
 
4
4
  ${l}
@@ -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 Oe(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(dp,{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 ce(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(pp,{message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw ce(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(cp,{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 jo=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(xp,{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 ce(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(Pp,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw ce(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(Tp,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw ce(o)}}};import{v4 as q2}from"uuid";function Z(e){return e?new Date(e*1e3):null}function r2(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,verifiedAt:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(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:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)};t.push(i);break;case"phone":let a={number:r.phoneNumber,type:r.type,verifiedAt:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(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:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(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:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)};t.push(s);break;case"twitter_oauth":let c={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)};t.push(c);break;case"discord_oauth":let u={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)};t.push(u);break;case"github_oauth":let h={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)};t.push(h);break;case"tiktok_oauth":let f={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)};t.push(f);break;case"linkedin_oauth":let y={subject:r.subject,name:r.name,email:r.email,type:r.type,verifiedAt:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)};t.push(y);break;case"apple_oauth":let w={subject:r.subject,email:r.email,type:r.type,verifiedAt:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)};t.push(w);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)});break;case"farcaster":let v={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:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(v);break;case"passkey":let k={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:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)};t.push(k);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function er(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var Se=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy")||null,o2=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),tr=(e,t)=>t==="all-users"&&!Se(e)||t==="users-without-wallets"&&!o2(e)?.length;function rr(e){if(!e)return null;let t=r2(e.linked_accounts),r=er(t,"wallet"),o=er(t,"email"),n=er(t,"phone"),i=er(t,"google_oauth"),a=er(t,"twitter_oauth"),l=er(t,"discord_oauth"),s=er(t,"github_oauth"),c=er(t,"spotify_oauth"),u=er(t,"tiktok_oauth"),h=er(t,"linkedin_oauth"),f=er(t,"apple_oauth"),y=er(t,"farcaster"),w=e.mfa_methods.map(({type:k,verified_at:S})=>({type:k,verifiedAt:Z(S)}));return{id:e.id,createdAt:Z(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},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},tiktok:u&&{subject:u.subject,username:u.username,name:u.name},linkedin:h&&{subject:h.subject,name:h.name,email:h.email},apple:f&&{subject:f.subject,email:f.email},farcaster:y&&{fid:y.fid,ownerAddress:y.ownerAddress,displayName:y.displayName,username:y.username,bio:y.bio,pfp:y.pfp,url:y.url,signerPublicKey:y.signerPublicKey},mfaMethods:w.map(k=>k.type),hasAcceptedTerms:e.has_accepted_terms??!1}}import{getAddress as cm}from"@ethersproject/address";import{isHexString as B2}from"@ethersproject/bytes";import H2 from"eventemitter3";import{jsx as Pu,jsxs as n2}from"react/jsx-runtime";var ls=({style:e,...t})=>n2("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:[Pu("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),Pu("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"})]});import{getAddress as Rr}from"@ethersproject/address";import{Web3Provider as Ru}from"@ethersproject/providers";import{default as p2}from"eventemitter3";import d2 from"eventemitter3";var i2=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Su=e=>i2.includes(e);import{ErrorCode as a2}from"@ethersproject/logger";var bn=class extends ee{constructor(){super("Wallet timeout");this.type="wallet_error"}},En=class extends ee{constructor(){super("User rejected connection");this.type="wallet_error"}},ur=e=>{if(e instanceof ee)return e;if(e?.code&&e?.reason){let t=new Ne(e);return e.code===a2.ACTION_REJECTED&&(t.details=Qe.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Ne(e):new ee("Unknown connector error",e)},Nt=class extends Ue{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},Ne=class extends Nt{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(Qe).find(i=>i.eipCode===o.code);this.details=n||Qe.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=Qe.E32002_CONNECTION_ALREADY_PENDING:this.details=Qe.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=Qe.E32002_WALLET_LOCKED))}},s2={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}},l2={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}},c2={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}},Qe={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...c2,...l2},Jr={...s2,...Qe};var Ie=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 bn,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||Vo,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 ee(`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 ur(r)})}},ho=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},cs=class extends d2{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=Zr(l,this.chains,n,{appId:a}),this.rpcTimeoutDuration=Tn(n,"privy"),this.appId=a}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new ho(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await he()||!this.address)throw new ho("Disconnected",4900);return(await _u(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new ho(`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 ho(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=Zr(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];return await xu(o)}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 ku(qa(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:zo(this.chainId)};try{return await this.provider.send("eth_estimateGas",[o])}catch{return delete o.from,await this.provider.send("eth_estimateGas",[o])}}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 zo(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(Su(r.method)){let o=await he();if(await Au(),!o||!this.address)throw new ho("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 ho("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await he();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}}},Ar=class extends Ie{constructor(r){super(r,r.rpcTimeoutDuration)}},yo=class extends Ie{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 u2=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},St=class extends p2{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=wn(r),this.walletClientType==="privy"&&Y.put(Ha(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=Tn(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n){let i=async()=>!!this.wallets.find(a=>Rr(a.address)===Rr(r));return{address:Rr(r),chainId:o,meta:n,switchChain:async a=>{if(!i)throw new ee("Wallet is not currently connected.");let l=this.wallets.find(f=>Rr(f.address)===Rr(r))?.chainId;if(!l)throw new ee("Unable to determine current chainId.");let s,c;if(typeof a=="number"?(s=`0x${a.toString(16)}`,c=a):(s=a,c=Number(a)),l===wn(s))return;let u=this.chains.find(f=>f.id===c);if(!u)throw new ee(`Unsupported chainId: ${a}`);let h=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})};try{return await h()}catch(f){if(u2(f,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:s,chainName:u.name,nativeCurrency:u.nativeCurrency,rpcUrls:[u.rpcUrls.default?.http[0]??""],blockExplorerUrls:[u.blockExplorers?.default.url??""]}]}),h();throw this.walletClientType==="rainbow"&&f.message?.includes("wallet_switchEthereumChain")?new ee(`Rainbow does not support the chainId ${o}`):f}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:i,getEthereumProvider:async()=>{if(!await i())throw new ee("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await i())throw new ee("Wallet is not currently connected.");return new Ru(new Ar(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await i())throw new ee("Wallet is not currently connected.");return new yo(this.proxyProvider)},sign:async a=>{if(!await i())throw new ee("Wallet is not currently connected.");return await this.sign(a)},disconnect:()=>{this.disconnect()}}}async syncAccounts(r){let o=r;try{if(o===void 0){let c=await this.proxyProvider.request({method:"eth_accounts"});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=Rr(n),a=[],l;if(this.walletClientType==="privy"){let c=Y.get(Ha(i));this.chains.find(u=>u.id===Number(c))||(Y.del(Ha(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 this.proxyProvider.request({method:"eth_chainId"});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 ${fc}`,c),l=fc}let s=wn(l);if(!a.find(c=>Rr(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(Rr(n),s,c))}ds(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=>Rr(n)===Rr(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 Ru(new Ar(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 Pn={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{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 m2=(e,t)=>{let o=za(1,[Pn],{},t);return e.makeWeb3Provider(o,1)},ps,us=class extends St{constructor(r,o,n,i,a){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.proxyProvider=new Ie(void 0,this.rpcTimeoutDuration),this.subscribeListeners();let l=window.matchMedia("(display-mode: standalone)").matches;ps||import("@coinbase/wallet-sdk").then(s=>{ps=new s.default({appName:a,darkMode:!1,headlessMode:!1,enableMobileWalletLink:l}),this.proxyProvider.setWalletProvider(m2(ps,i))})}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){ps.disconnect(),this.onDisconnect()}get walletBranding(){return{name:"Coinbase Wallet",icon:ls,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 ee("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw ur(r)}}};import{jsx as Iu}from"react/jsx-runtime";var ms=({...e})=>Iu("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:Iu("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 fs=class extends St{constructor(r,o,n,i){super("privy",o,n,i);this.connectorType="embedded";this.proxyProvider=r,this.subscribeListeners()}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}async connect(r){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[zo(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:ms,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};import{jsx as Mu}from"react/jsx-runtime";var Sn=({style:e,...t})=>Mu("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:Mu("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"})});import{jsx as Dt,jsxs as f2}from"react/jsx-runtime";var xn=({style:e,...t})=>f2("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:[Dt("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),Dt("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),Dt("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"}),Dt("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"}),Dt("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"}),Dt("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"}),Dt("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"}),Dt("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"}),Dt("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"}),Dt("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"}),Dt("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"}),Dt("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"}),Dt("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"})]});import{jsx as Wu,jsxs as h2}from"react/jsx-runtime";var Ir=({style:e,...t})=>h2("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:[Wu("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),Wu("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 _n=class extends St{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new Ie(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let l=i.provider;this.proxyProvider.setWalletProvider(l)}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}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 ee("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw ur(r)}}},kn,An=class extends St{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";_a(this,kn,void 0);this.proxyProvider=new Ie(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?oc(this,kn,{name:"MetaMask",icon:xn,id:"io.metamask"}):a==="phantom"&&oc(this,kn,{name:"Phantom",icon:Ir,id:"phantom"})}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return ap(this,kn)??{name:"Browser Extension",icon:Sn,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 ee("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw ur(r)}}};kn=new WeakMap;import{getAddress as kT}from"@ethersproject/address";import{Web3Provider as AT}from"@ethersproject/providers";import{isMobile as y2}from"react-device-detect";var hs=class extends _n{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{y2||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 ee("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw ur(t)}}};var ys=class extends St{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new Ie(void 0,Vo);this.connectorType=r}get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.emit("initialized"),this.initialized=!0}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 gs=class extends ys{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:Ir,id:"phantom"}}};import{EthereumProvider as N2,OPTIONAL_EVENTS as D2,OPTIONAL_METHODS as F2}from"@walletconnect/ethereum-provider";import{isMobile as U2}from"react-device-detect";import{createContext as _2,useContext as A2,useEffect as bc,useRef as R2,useState as I2}from"react";import{jsx as g2}from"react/jsx-runtime";function vs({src:e,...t}){return g2("img",{src:e,...t,style:{display:"none"}})}import{useContext as nm,useEffect as om,useMemo as P2,useState as S2}from"react";import{createContext as x2}from"react";var Ft={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:$p,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},captchaEnabled:!1,_render:{inDialog:!0,inParentNodeId:null},fiatOnRamp:{useSandbox:!1}};var Lu=({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 v2=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets"]),Ou=e=>v2.has(e),Nu=(e,t,r)=>r.indexOf(e)===t,Du=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Ou).filter(Nu):e?e.filter(Ou).filter(Nu):Ft.appearance.walletList;var Cs={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{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 ws={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"],webSocket:["wss://arb-goerli.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-goerli.infura.io/v3"],webSocket:["wss://arbitrum-goerli.infura.io/ws/v3"]},default:{http:["https://goerli-rollup.arbitrum.io/rpc"]},public:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"},default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0};var bs={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 Fu={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 Uu={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 Es={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{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 Ts={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{blast:{http:["https://base-goerli.blastapi.io"],webSocket:["wss://base-goerli.blastapi.io"]},default:{http:["https://goerli.base.org"]},public:{http:["https://goerli.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://goerli.basescan.org"},default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0};var Ps={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 Bu={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 Hu={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 Gu={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 Vu={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 zu={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 qu={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 $u={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://goerli.rpc.privy.systems"]},alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"],webSocket:["wss://eth-goerli.g.alchemy.com/v2"]},infura:{http:["https://goerli.infura.io/v3"],webSocket:["wss://goerli.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/eth_goerli"]},public:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli.etherscan.io"},default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},testnet:!0};var Ku={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 ju={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-mainnet.infura.io/v3"],webSocket:["wss://linea-mainnet.infura.io/ws/v3"]},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 Yu={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 Ss={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{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 xs={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-goerli.g.alchemy.com/v2"],webSocket:["wss://opt-goerli.g.alchemy.com/v2"]},infura:{http:["https://optimism-goerli.infura.io/v3"],webSocket:["wss://optimism-goerli.infura.io/ws/v3"]},default:{http:["https://goerli.optimism.io"]},public:{http:["https://goerli.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"},default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0};var ks={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 Ai={id:137,name:"Polygon Mainnet",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{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 Ri={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{privy:{http:["https://polygon-mumbai.rpc.privy.systems"]},alchemy:{http:["https://polygon-mumbai.g.alchemy.com/v2"],webSocket:["wss://polygon-mumbai.g.alchemy.com/v2"]},infura:{http:["https://polygon-mumbai.infura.io/v3"],webSocket:["wss://polygon-mumbai.infura.io/ws/v3"]},default:{http:["https://matic-mumbai.chainstacklabs.com"]},public:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"},default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0};var Zu={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 Ju={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 Qu={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 _s={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 As={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 Rs={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 Ii=[Cs,ws,bs,$u,Qu,Pn,Ss,xs,ks,Ai,Ri,Hu,Gu,Vu,zu,Es,Ts,Ps,Bu,ju,Yu,Fu,Uu,_s,Rs,As,Ku,Zu,qu,Ju],eS=new Set(Ii.map(e=>e.id));import Yo from"tinycolor2";var Xu="#FFFFFF",C2="#000000",w2=Xu,b2="#1E1E1D";function E2(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 Qr(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return Yo({...e.toHsl(),l:r})}function em({backgroundTheme:e,accentHex:t,successHex:r="#51BA81",warnHex:o="#FFB74D",errorHex:n="#EC6351",whiteHex:i=Xu,blackHex:a=C2}){let l;switch(e){case"light":l=w2;break;case"dark":l=b2;break;default:l=e;break}let s=Yo(l),c=Yo(t),u=Yo(r),h=Yo(o),f=Yo(n),y=E2(s.getLuminance()),w=Qr(s,y==="light"?-.04:.11),v=Qr(s,y==="light"?-.88:.87),k=Qr(s,y==="light"?-.77:.75),S=Qr(s,y==="light"?-.43:.45).desaturate(y==="light"?60:20),C=Qr(s,y==="light"?-.08:.25).desaturate(y==="light"?60:20),R=Qr(c,.15),P=Qr(c,-.06),O=Qr(f,.3),_=Yo(c.getLuminance()>.5?a:i),D=Qr(u,-.16);return{colorScheme:y,background:s.toHslString(),background2:w.toHslString(),foreground:v.toHslString(),foreground2:k.toHslString(),foreground3:S.toHslString(),foreground4:C.toHslString(),accent:c.toHslString(),accentLight:R.toHslString(),accentDark:P.toHslString(),foregroundAccent:_.toHslString(),success:u.toHslString(),successDark:D.toHslString(),error:f.toHslString(),errorLight:O.toHslString(),warn:h.toHslString()}}function vc(e,t,r){let o=r?console.warn:()=>{},n=["google","twitter","discord","spotify","tiktok","linkedin","github","apple","farcaster"],i=t?.loginMethods?.filter(jt=>n.includes(jt)),a,l,s,c,u,h,f,y,w,v,k,S,C;t?.loginMethods?(a=t.loginMethods.includes("email"),l=t.loginMethods.includes("sms"),c=t.loginMethods.includes("wallet"),u=i?.includes("google"),h=i?.includes("twitter"),f=i?.includes("discord"),w=i?.includes("spotify"),y=i?.includes("tiktok"),k=i?.includes("github"),v=i?.includes("linkedin"),S=i?.includes("apple"),C=i?.includes("farcaster")):(a=e.emailAuth,l=e.smsAuth,c=e.walletAuth,u=e.googleOAuth,h=e.twitterOAuth,f=e.discordOAuth,k=e.githubOAuth,w=e.spotifyOAuth,y=e.tiktokOAuth,v=e.linkedinOAuth,S=e.appleOAuth,C=e.farcasterAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?s=!1:e.passkeyAuth&&(s=!0);let R=[a,l].filter(Boolean),P=[u,h,f,k,w,y,v,S,C].filter(Boolean),O=[c].filter(Boolean);if(R.length+P.length+O.length===0)throw new Error("You must enable at least one login method");let _=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;_&&O.length===0?(o("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),_=!1):!_&&P.length+R.length===0&&(o("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),_=!0),t?.loginMethods&&t.loginMethodsAndOrder&&o("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let D=Du({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),K=Lu({input:t?.loginMethodsAndOrder}),V=t?.intl?.defaultCountry??"US",{chains:H,defaultChain:I}=T2({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),Q=!!t?.defaultChain,U=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,pe,me=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?U?pe=t?.embeddedWallets?.noPromptOnSignature??!0:pe=t?.embeddedWallets?.noPromptOnSignature??me:pe=me,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&pe!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:ae,...Ee}=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??Ft.appearance.landingHeader,palette:em({backgroundTheme:t?.appearance?.theme??Ft.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??Ft.appearance.accentColor}),loginGroupPriority:_?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:D},loginMethods:{wallet:c,email:a,sms:l,passkey:s,google:u,twitter:h,discord:f,github:k,spotify:w,tiktok:y,linkedin:v,apple:S,farcaster:C},loginMethodsAndOrder:K,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??Ft.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??Ft.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??Ft.rpcConfig.rpcTimeouts},chains:H,defaultChain:I,intl:{defaultCountry:V},shouldEnforceDefaultChainOnConnect:Q,captchaEnabled:e.captchaEnabled??Ft.captchaEnabled,captchaSiteKey:e.captchaSiteKey,embeddedWallets:{...e.embeddedWalletConfig,...typeof ae=="boolean"?{requireUserOwnedRecoveryOnCreate:ae}:{},...U?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...Ee,noPromptOnSignature:pe},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:U?{enabled:!0,...t.customAuth}:void 0,fiatOnRamp:{enabled:e.fiatOnRampEnabled,useSandbox:t?.fiatOnRamp?.useSandbox??Ft.fiatOnRamp.useSandbox},loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1},render:{inDialog:t?._render?.inDialog??Ft._render.inDialog,inParentNodeId:t?._render?.inParentNodeId??Ft._render.inParentNodeId}}}function tm(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,...r?{...r,...r.logo&&typeof r.logo?{logo:"component"}:void 0}:void 0,legacyCreateEmbeddedWalletFlag:t}}function T2({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:Ii.find(u=>u.id===s.id)??s)}else n=Ii.concat(e??[]);let i=t?n[0]:Pn,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 rm=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)};import{jsx as k2}from"react/jsx-runtime";var im={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:""},Cc=vc(im,void 0,!1),wc=x2({appConfig:Cc,isServerConfigLoaded:!1}),am=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:o})=>{let[n,i]=S2(null),a=P2(()=>vc(n??im,o,!!n),[n,o]);return om(()=>{if(!n)return;let l=tm(o,t),s=rm(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]),om(()=>{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)}})()},[]),k2(wc.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},go=()=>{let{appConfig:e}=nm(wc);return e},Is=()=>{let{isServerConfigLoaded:e}=nm(wc);return e};var b=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};import{jsx as W2,jsxs as L2}from"react/jsx-runtime";var sm=_2({ready:!1,app:Cc,currentScreen:null,lastScreen:null,navigate:b,navigateBack:b,resetNavigation:b,setModalData:b,onUserCloseViaDialogOrKeybindRef:void 0}),M2=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],lm=e=>{let t=go(),r=e.authenticated,[o,n]=I2(e.initialScreen);bc(()=>{!r&&!M2.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=R2(null);bc(()=>{e.open||(i.current=null)},[e.open]),bc(()=>{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 L2(sm.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&W2(vs,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},x=()=>A2(sm);import{jsx as Rn,jsxs as O2}from"react/jsx-runtime";var Mi=({style:e,...t})=>{let{app:r}=x();return O2("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:[Rn("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),Rn("g",{clipPath:"url(#clip0_1765_9946)",children:Rn("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"})}),Rn("defs",{children:Rn("clipPath",{id:"clip0_1765_9946",children:Rn("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var Mr=class extends St{constructor(r,o,n,i,a,l,s){super(s||"unknown",n,i,o);this.connectorType="wallet_connect_v2";this.privyAppId=l,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new Ie(void 0,this.rpcTimeoutDuration),s&&(this.walletEntry=Ka[s],this.walletClientType=s)}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=$a(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=n?.entry,this.walletClientType=n?.walletClientType||"unknown"}this.connected=!0,await this.syncAccounts()}this.emit("initialized"),this.initialized=!0;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:xn,id:"io.metamask"}:{name:iu(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Mi,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=Ka[r],this.walletClientType=r,this.redirectUri=void 0,du(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new En)};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 ee("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=$a(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Tn(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(a=>{if(a){o(ur(a));return}o(new ee("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=za(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 N2.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:D2,optionalMethods:F2,rpcMap:r,showQrModal:!1});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),U2&&this.walletEntry){let{redirect:l,href:s}=lu(a,this.walletEntry);pu({href:s,name:this.walletEntry.displayName}),this.redirectUri=l,ja(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=$a(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 Ec=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>B2(o)).map(o=>cm(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},Tn=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||Vo:Vo,Wi=class extends H2{constructor(r,o,n,i,a,l,s,c,u){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 Ie: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.privyAppName=u,this.storedConnections=this.loadConnectionHistory()}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;Y.get(uc)&&(Y.getKeys().forEach(o=>{o.startsWith("walletconnect")&&Y.del(o)}),Y.del(uc));let r=au(this.store,this.walletList).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"),!mo()&&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")}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 cs(r,o,this.rpcConfig,this.chains,i,n.id),s=new fs(l,this.chains,n,this.rpcConfig);this.addWalletConnector(s)}}removeEmbeddedWalletConnector(){let r=this.findWalletConnector("embedded","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=this.loadConnectionHistory(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let i=this.findWalletConnector(r,o);if(i)return i instanceof Mr&&i.resetConnection(o),i;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new hs(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new An(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new An(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new An(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new _n(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new us(this.chains,this.defaultChain,this.rpcConfig,this.privyAppId,this.privyAppName):r==="phantom"?new gs(this.defaultChain):new Mr(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,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()}loadConnectionHistory(){let r=a=>a&&typeof a.address=="string"&&typeof a.connectorType=="string"&&typeof a.walletClientType=="string"&&typeof a.connectedAt=="number",o=Y.get(mc);return o&&Array.isArray(o)&&o.map(a=>r(a)).every(Boolean)?o:[]}saveConnectionHistory(){let r=this.wallets.map(o=>({address:o.address,connectorType:o.connectorType,walletClientType:o.walletClientType,connectedAt:o.connectedAt}));Y.put(mc,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=cm(r),this.emit("walletsUpdated")}};function ds(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}import{ofetch as G2}from"ofetch";var V2=[Ia,Wa,Ma,La],Ms=class{constructor(t,r,o){this.appId=t,this.clientAnalyticsId=r.clientAnalyticsId,this.sdkVersion=cc,this.client=r,this.defaults=o,this.fallbackApiUrl=r.fallbackApiUrl,this.baseFetch=G2.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:n,options:i})=>{let a=new Headers(i.headers);a.set("privy-app-id",this.appId),a.set("privy-ca-id",this.clientAnalyticsId||""),a.set("privy-client",`react-auth:${this.sdkVersion}`);let l=V2.includes(n.toString());if(!a.has("authorization")){let s=await this.client.getAccessToken({disableAutoRefresh:l});s!==null&&a.set("authorization",`Bearer ${s}`)}i.headers=a,i.retryDelay&&(i.retryDelay=i.retryDelay*3)},onRequestError:({error:n})=>{if(n instanceof DOMException&&n.name==="AbortError")throw new Aa}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw ce(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw ce(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw ce(o)}}};var dm=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});import Zo from"js-cookie";function pm(e){return e instanceof uo?"email":e instanceof jo?"sms":e instanceof Ko?"siwe":e instanceof gn?"custom_auth":e instanceof _r?e.meta.provider:null}import*as um from"jose";var Wr=class{static parse(t){try{return new Wr(t)}catch{return null}}constructor(t){this.value=t,this._decoded=um.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 z2=30,Ws=class{constructor(){this.authenticateOnce=new Oe(async t=>this._authenticate(t)),this.linkOnce=new Oe(async t=>this._link(t)),this.refreshOnce=new Oe(this._refresh.bind(this)),this.destroyOnce=new Oe(this._destroy.bind(this)),this.forkSessionOnce=new Oe(this._forkSession.bind(this))}get token(){try{let t=Y.get(Uo);return typeof t=="string"?new Wr(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=Y.get(Ua);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=Y.get(Ei);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get mightHaveServerCookies(){try{let t=Zo.get(Ba);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"}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=Wr.parse(this.token);return t!==null&&!t.isExpired(z2)}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=pm(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:rr(o),isNewUser:n,oAuthProviderTokens:a}}catch(r){throw console.warn("Error authenticating session"),dt(r)}}async _link(t){try{let r=await t.link();return rr(r)}catch(r){throw console.warn("Error linking account"),dt(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(Ia,a,{headers:i}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(Wa,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),rr(n.user)}catch(n){if(n instanceof pr&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw dt(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(Ma,{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(lp,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw dt(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=Y.get(Uo);if(Y.put(Uo,t),!this.client?.useServerCookies){let o=Wr.parse(t)?.expiration;Zo.set(dc,t,{sameSite:"Strict",secure:!0,expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else Y.del(Uo),Zo.remove(dc),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(Y.put(Ua,t),this.client?.useServerCookies||(Zo.set(Ba,"t",{sameSite:"Strict",secure:!0,expires:30}),Zo.set(pc,t,{sameSite:"Strict",secure:!0,expires:30}))):(Y.del(Ua),Zo.remove(pc),Zo.remove(Ba))}clearForkedToken(){Y.del(Ei)}};var Tc,Ls,mm,Li=class{constructor(t){_a(this,Ls);this.apiUrl=t.apiUrl||Fa,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!1,this.timeout=t.timeout||Kp,this.appId=t.appId,this.clientAnalyticsId=sp(this,Ls,mm).call(this),Tc||(Tc=new Ws),this.session=Tc,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:t,rpcConfig:r,chains:o,defaultChain:n,store:i,walletList:a,shouldEnforceDefaultChainOnConnect:l,appName:s}){this.connectors||(this.connectors=new Wi(this.appId,t,r,o,n,i,a,l,s))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new Ms(this.appId,this,{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(Fp,{action:"verify"})}catch(t){throw ce(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(Up,{});return dm(t.options)}catch(t){throw ce(t)}}async unlinkEmail(t){try{let r=await this.api.post(bp,{address:t});return rr(r)}catch(r){throw dt(r)}}async acceptTerms(){try{let t=await this.api.post(Bp,{});return rr(t)}catch(t){throw dt(t)}}async unlinkPhone(t){try{let r=await this.api.post(Sp,{phoneNumber:t});return rr(r)}catch(r){throw dt(r)}}async unlinkWallet(t){try{let r=await this.api.post(up,{address:t});return rr(r)}catch(r){throw dt(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Rp,{provider:t,subject:r});return rr(o)}catch(o){throw dt(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(gp,{fid:t});return rr(r)}catch(r){throw dt(r)}}async unlinkPasskey(t){try{let r=await this.api.post(Dp,{credential_id:t});return rr(r)}catch(r){throw dt(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(La,{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(Hp,t)}catch(r){throw dt(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?Wr.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});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,tiktokOAuth:o.tiktok_oauth,linkedinOAuth:o.linkedin_oauth,appleOAuth:o.apple_oauth,farcasterAuth:o.farcaster_auth,passkeyAuth:o.passkey_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}}catch(t){throw dt(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()}};Ls=new WeakSet,mm=function(){if(typeof window>"u")return null;try{let r=Y.get(Ti);if(typeof r=="string"&&r.length>0)return r}catch{}let t=q2();try{return Y.put(Ti,t),t}catch{return t}};import{Turnstile as J2}from"@marsidev/react-turnstile";import{useEffect as Q2,useMemo as X2}from"react";import{useMemo as $2,useRef as K2,useContext as j2,useState as Pc,createContext as Y2}from"react";import{jsx as Z2}from"react/jsx-runtime";var fm=Y2({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:b,setError:b,setExecuting:b,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:b,reset:b,execute:b}),mr=class extends Ue{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},hm=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=K2(null),[i,a]=Pc(),[l,s]=Pc(),[c,u]=Pc(!1),h=$2(()=>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 Z2(fm.Provider,{value:{...h,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 ou(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new mr("Captcha failed",null,"captcha_timeout")}}},children:e})},Ce=()=>j2(fm);import{jsx as ym}from"react/jsx-runtime";var Sc=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=Ce(),[,s]=X2(()=>r?.split("t:")||[],[r]);if(Q2(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return ym("div",{className:"hidden h-0 w-0",children:ym(J2,{...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")}}})})};import{useCallback as B7,useEffect as E1,useRef as H7,useState as G7}from"react";import V7 from"react-dom";import{createContext as ev,useContext as tv}from"react";var xc=ev({isNewUserThisSession:!1,linkingHint:null,walletConnectionStatus:null,mipdStore:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",nativeTokenSymbolForChainId:b,initializeWalletProxy:b,getAuthMeta:b,getAuthFlow:b,closePrivyModal:b,openPrivyModal:b,connectWallet:b,initLoginWithWallet:b,loginWithWallet:b,initLoginWithFarcaster:b,loginWithFarcaster:b,loginWithCode:b,initLoginWithEmail:b,initLoginWithSms:b,initUpdateEmail:b,resendEmailCode:b,resendSmsCode:b,initLoginWithHeadlessOAuth:b,loginWithHeadlessOAuth:b,initLoginWithOAuth:b,recoveryOAuthFlow:b,loginWithOAuth:b,initLoginWithPasskey:b,loginWithPasskey:b,initLinkWithPasskey:b,linkWithPasskey:b,refreshUser:b,walletProxy:null,createAnalyticsEvent:b,acceptTerms:b,getUsdTokenPrice:b,recoverEmbeddedWallet:b,getFiatOnRampConfig:b,updateWallets:b,fundWallet:b,setReadyToTrue:b,requestFarcasterSignerStatus:b}),M=()=>tv(xc);import{createContext as rv,useContext as ov}from"react";var ye=rv({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:b,login:b,connectOrCreateWallet:b,linkEmail:b,linkPhone:b,linkFarcaster:b,linkWallet:b,linkGoogle:b,linkTwitter:b,linkDiscord:b,linkGithub:b,linkSpotify:b,linkTiktok:b,linkLinkedIn:b,linkApple:b,linkPasskey:b,updateEmail:b,logout:b,getAccessToken:b,getEthereumProvider:b,getEthersProvider:b,getWeb3jsProvider:b,unlinkEmail:b,unlinkPhone:b,unlinkWallet:b,unlinkGoogle:b,unlinkTwitter:b,unlinkDiscord:b,unlinkGithub:b,unlinkSpotify:b,unlinkTiktok:b,unlinkLinkedIn:b,unlinkApple:b,unlinkFarcaster:b,unlinkPasskey:b,setActiveWallet:b,forkSession:b,createWallet:b,signMessage:b,signTypedData:b,enrollInMfa:b,initEnrollmentWithSms:b,initEnrollmentWithTotp:b,initEnrollmentWithPasskey:b,promptMfa:b,init:b,submitEnrollmentWithSms:b,submitEnrollmentWithTotp:b,submitEnrollmentWithPasskey:b,unenroll:b,submit:b,cancel:b,sendTransaction:b,exportWallet:b,setWalletPassword:b,requestFarcasterSigner:b,submitCast:b,removeCast:b,likeCast:b,recastCast:b,followUser:b,unfollowUser:b,initLoginWithEmail:b,initLoginWithSms:b,otpState:{status:"initial"},loginWithCode:b,fundWallet:b,initLoginWithHeadlessOAuth:b,loginWithHeadlessOAuth:b,isHeadlessOAuthLoading:!1,isModalOpen:!1}),B=()=>ov(ye);import{useEffect as nv,useState as iv}from"react";var gm=e=>{let[t,r]=iv("auto");return nv(()=>{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};import{createContext as av,useContext as sv,useEffect as lv}from"react";var vm={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]}},kc=av(void 0),Cm=()=>sv(kc);function De(e,t){if(!t)return;let o=Cm().current[e];return lv(()=>{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 N(e,t,r,...o){for(let n of e.current[t][r])n(...o)}function Os(){let e=Cm();return(t,r,...o)=>N(e,t,r,...o)}function _c(e){De("configureMfa",e)}import km from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import kv from"@heroicons/react/24/solid/DocumentCheckIcon";import _v from"styled-components";import Jo,{css as Mc}from"styled-components";import Rc from"styled-components";import{Fragment as dv,jsx as Ac,jsxs as pv}from"react/jsx-runtime";var xt=({success:e,fail:t})=>pv(dv,{children:[Ac(Xe,{className:e?"success":t?"fail":""}),Ac(Ic,{className:e?"success":t?"fail":""})]}),Xe=Rc.span`
12
+ - https://privy.io`;this.getNonceOnce=new Oe(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(cp,{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 ce(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(dp,{message:t,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw ce(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(lp,{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 jo=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(Sp,{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 ce(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(Tp,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw ce(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(Ep,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw ce(o)}}};import{v4 as z2}from"uuid";function Z(e){return e?new Date(e*1e3):null}function t2(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,verifiedAt:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(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:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)};t.push(i);break;case"phone":let a={number:r.phoneNumber,type:r.type,verifiedAt:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(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:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(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:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)};t.push(s);break;case"twitter_oauth":let c={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)};t.push(c);break;case"discord_oauth":let u={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)};t.push(u);break;case"github_oauth":let h={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)};t.push(h);break;case"tiktok_oauth":let f={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)};t.push(f);break;case"linkedin_oauth":let y={subject:r.subject,name:r.name,email:r.email,type:r.type,verifiedAt:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)};t.push(y);break;case"apple_oauth":let w={subject:r.subject,email:r.email,type:r.type,verifiedAt:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)};t.push(w);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)});break;case"farcaster":let v={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:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(v);break;case"passkey":let k={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:Z(r.verified_at),firstVerifiedAt:Z(r.first_verified_at),latestVerifiedAt:Z(r.latest_verified_at)};t.push(k);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function er(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var Se=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy")||null,r2=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),tr=(e,t)=>t==="all-users"&&!Se(e)||t==="users-without-wallets"&&!r2(e)?.length;function rr(e){if(!e)return null;let t=t2(e.linked_accounts),r=er(t,"wallet"),o=er(t,"email"),n=er(t,"phone"),i=er(t,"google_oauth"),a=er(t,"twitter_oauth"),l=er(t,"discord_oauth"),s=er(t,"github_oauth"),c=er(t,"spotify_oauth"),u=er(t,"tiktok_oauth"),h=er(t,"linkedin_oauth"),f=er(t,"apple_oauth"),y=er(t,"farcaster"),w=e.mfa_methods.map(({type:k,verified_at:S})=>({type:k,verifiedAt:Z(S)}));return{id:e.id,createdAt:Z(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},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},tiktok:u&&{subject:u.subject,username:u.username,name:u.name},linkedin:h&&{subject:h.subject,name:h.name,email:h.email},apple:f&&{subject:f.subject,email:f.email},farcaster:y&&{fid:y.fid,ownerAddress:y.ownerAddress,displayName:y.displayName,username:y.username,bio:y.bio,pfp:y.pfp,url:y.url,signerPublicKey:y.signerPublicKey},mfaMethods:w.map(k=>k.type),hasAcceptedTerms:e.has_accepted_terms??!1}}import{getAddress as lm}from"@ethersproject/address";import{isHexString as U2}from"@ethersproject/bytes";import B2 from"eventemitter3";import{jsx as Tu,jsxs as o2}from"react/jsx-runtime";var ls=({style:e,...t})=>o2("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:[Tu("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),Tu("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"})]});import{getAddress as Rr}from"@ethersproject/address";import{Web3Provider as Au}from"@ethersproject/providers";import{default as d2}from"eventemitter3";import c2 from"eventemitter3";var n2=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Pu=e=>n2.includes(e);import{ErrorCode as i2}from"@ethersproject/logger";var bn=class extends ee{constructor(){super("Wallet timeout");this.type="wallet_error"}},En=class extends ee{constructor(){super("User rejected connection");this.type="wallet_error"}},ur=e=>{if(e instanceof ee)return e;if(e?.code&&e?.reason){let t=new Ne(e);return e.code===i2.ACTION_REJECTED&&(t.details=Qe.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Ne(e):new ee("Unknown connector error",e)},Nt=class extends Ue{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},Ne=class extends Nt{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(Qe).find(i=>i.eipCode===o.code);this.details=n||Qe.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=Qe.E32002_CONNECTION_ALREADY_PENDING:this.details=Qe.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=Qe.E32002_WALLET_LOCKED))}},a2={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}},s2={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}},l2={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}},Qe={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},...l2,...s2},Qr={...a2,...Qe};var Ie=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 bn,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||Vo,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 ee(`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 ur(r)})}},yo=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},cs=class extends c2{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=Jr(l,this.chains,n,{appId:a}),this.rpcTimeoutDuration=Tn(n,"privy"),this.appId=a}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new yo(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await he()||!this.address)throw new yo("Disconnected",4900);return(await ku(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new yo(`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 yo(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=Jr(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];return await Su(o)}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 xu(qa(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:zo(this.chainId)};try{return await this.provider.send("eth_estimateGas",[o])}catch{return delete o.from,await this.provider.send("eth_estimateGas",[o])}}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 zo(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(Pu(r.method)){let o=await he();if(await _u(),!o||!this.address)throw new yo("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 yo("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await he();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}}},Ar=class extends Ie{constructor(r){super(r,r.rpcTimeoutDuration)}},go=class extends Ie{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 p2=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},St=class extends d2{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=wn(r),this.walletClientType==="privy"&&Y.put(Ha(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=Tn(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n){let i=async()=>!!this.wallets.find(a=>Rr(a.address)===Rr(r));return{address:Rr(r),chainId:o,meta:n,switchChain:async a=>{if(!i)throw new ee("Wallet is not currently connected.");let l=this.wallets.find(f=>Rr(f.address)===Rr(r))?.chainId;if(!l)throw new ee("Unable to determine current chainId.");let s,c;if(typeof a=="number"?(s=`0x${a.toString(16)}`,c=a):(s=a,c=Number(a)),l===wn(s))return;let u=this.chains.find(f=>f.id===c);if(!u)throw new ee(`Unsupported chainId: ${a}`);let h=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})};try{return await h()}catch(f){if(p2(f,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:s,chainName:u.name,nativeCurrency:u.nativeCurrency,rpcUrls:[u.rpcUrls.default?.http[0]??""],blockExplorerUrls:[u.blockExplorers?.default.url??""]}]}),h();throw this.walletClientType==="rainbow"&&f.message?.includes("wallet_switchEthereumChain")?new ee(`Rainbow does not support the chainId ${o}`):f}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:i,getEthereumProvider:async()=>{if(!await i())throw new ee("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await i())throw new ee("Wallet is not currently connected.");return new Au(new Ar(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await i())throw new ee("Wallet is not currently connected.");return new go(this.proxyProvider)},sign:async a=>{if(!await i())throw new ee("Wallet is not currently connected.");return await this.sign(a)},disconnect:()=>{this.disconnect()}}}async syncAccounts(r){let o=r;try{if(o===void 0){let c=await this.proxyProvider.request({method:"eth_accounts"});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=Rr(n),a=[],l;if(this.walletClientType==="privy"){let c=Y.get(Ha(i));this.chains.find(u=>u.id===Number(c))||(Y.del(Ha(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 this.proxyProvider.request({method:"eth_chainId"});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 ${fc}`,c),l=fc}let s=wn(l);if(!a.find(c=>Rr(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(Rr(n),s,c))}ds(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=>Rr(n)===Rr(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 Au(new Ar(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 Pn={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{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 u2=(e,t)=>{let o=za(1,[Pn],{},t);return e.makeWeb3Provider(o,1)},ps,us=class extends St{constructor(r,o,n,i,a){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.proxyProvider=new Ie(void 0,this.rpcTimeoutDuration),this.subscribeListeners();let l=window.matchMedia("(display-mode: standalone)").matches;ps||import("@coinbase/wallet-sdk").then(s=>{ps=new s.default({appName:a,darkMode:!1,headlessMode:!1,enableMobileWalletLink:l}),this.proxyProvider.setWalletProvider(u2(ps,i))})}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){ps.disconnect(),this.onDisconnect()}get walletBranding(){return{name:"Coinbase Wallet",icon:ls,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 ee("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw ur(r)}}};import{jsx as Ru}from"react/jsx-runtime";var ms=({...e})=>Ru("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:Ru("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 fs=class extends St{constructor(r,o,n,i){super("privy",o,n,i);this.connectorType="embedded";this.proxyProvider=r,this.subscribeListeners()}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}async connect(r){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[zo(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:ms,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};import{jsx as Iu}from"react/jsx-runtime";var Sn=({style:e,...t})=>Iu("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:Iu("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"})});import{jsx as Dt,jsxs as m2}from"react/jsx-runtime";var xn=({style:e,...t})=>m2("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:[Dt("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),Dt("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),Dt("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"}),Dt("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"}),Dt("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"}),Dt("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"}),Dt("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"}),Dt("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"}),Dt("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"}),Dt("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"}),Dt("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"}),Dt("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"}),Dt("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"})]});import{jsx as Mu,jsxs as f2}from"react/jsx-runtime";var Ir=({style:e,...t})=>f2("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:[Mu("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),Mu("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 _n=class extends St{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new Ie(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let l=i.provider;this.proxyProvider.setWalletProvider(l)}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}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 ee("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw ur(r)}}},kn,An=class extends St{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";_a(this,kn,void 0);this.proxyProvider=new Ie(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?oc(this,kn,{name:"MetaMask",icon:xn,id:"io.metamask"}):a==="phantom"&&oc(this,kn,{name:"Phantom",icon:Ir,id:"phantom"})}async initialize(){await this.syncAccounts(),this.emit("initialized"),this.initialized=!0}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return ip(this,kn)??{name:"Browser Extension",icon:Sn,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 ee("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw ur(r)}}};kn=new WeakMap;import{getAddress as xT}from"@ethersproject/address";import{Web3Provider as _T}from"@ethersproject/providers";import{isMobile as h2}from"react-device-detect";var hs=class extends _n{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{h2||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 ee("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw ur(t)}}};var ys=class extends St{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new Ie(void 0,Vo);this.connectorType=r}get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.emit("initialized"),this.initialized=!0}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 gs=class extends ys{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:Ir,id:"phantom"}}};import{EthereumProvider as O2,OPTIONAL_EVENTS as N2,OPTIONAL_METHODS as D2}from"@walletconnect/ethereum-provider";import{isMobile as F2}from"react-device-detect";import{createContext as k2,useContext as _2,useEffect as bc,useRef as A2,useState as R2}from"react";import{jsx as y2}from"react/jsx-runtime";function vs({src:e,...t}){return y2("img",{src:e,...t,style:{display:"none"}})}import{useContext as om,useEffect as rm,useMemo as T2,useState as P2}from"react";import{createContext as S2}from"react";var Ft={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:qp,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},captchaEnabled:!1,_render:{inDialog:!0,inParentNodeId:null},fiatOnRamp:{useSandbox:!1}};var Wu=({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 g2=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets"]),Lu=e=>g2.has(e),Ou=(e,t,r)=>r.indexOf(e)===t,Nu=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Lu).filter(Ou):e?e.filter(Lu).filter(Ou):Ft.appearance.walletList;var Cs={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{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 ws={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"],webSocket:["wss://arb-goerli.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-goerli.infura.io/v3"],webSocket:["wss://arbitrum-goerli.infura.io/ws/v3"]},default:{http:["https://goerli-rollup.arbitrum.io/rpc"]},public:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"},default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0};var bs={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 Du={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 Fu={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 Es={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{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 Ts={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{blast:{http:["https://base-goerli.blastapi.io"],webSocket:["wss://base-goerli.blastapi.io"]},default:{http:["https://goerli.base.org"]},public:{http:["https://goerli.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://goerli.basescan.org"},default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0};var Ps={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 Uu={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 Bu={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 Hu={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 Gu={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 Vu={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 zu={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 qu={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://goerli.rpc.privy.systems"]},alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"],webSocket:["wss://eth-goerli.g.alchemy.com/v2"]},infura:{http:["https://goerli.infura.io/v3"],webSocket:["wss://goerli.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/eth_goerli"]},public:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli.etherscan.io"},default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},testnet:!0};var $u={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 Ku={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-mainnet.infura.io/v3"],webSocket:["wss://linea-mainnet.infura.io/ws/v3"]},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 ju={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 Ss={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{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 xs={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://opt-goerli.g.alchemy.com/v2"],webSocket:["wss://opt-goerli.g.alchemy.com/v2"]},infura:{http:["https://optimism-goerli.infura.io/v3"],webSocket:["wss://optimism-goerli.infura.io/ws/v3"]},default:{http:["https://goerli.optimism.io"]},public:{http:["https://goerli.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"},default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0};var ks={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 Ai={id:137,name:"Polygon Mainnet",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{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 Ri={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{privy:{http:["https://polygon-mumbai.rpc.privy.systems"]},alchemy:{http:["https://polygon-mumbai.g.alchemy.com/v2"],webSocket:["wss://polygon-mumbai.g.alchemy.com/v2"]},infura:{http:["https://polygon-mumbai.infura.io/v3"],webSocket:["wss://polygon-mumbai.infura.io/ws/v3"]},default:{http:["https://matic-mumbai.chainstacklabs.com"]},public:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"},default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0};var Yu={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 Zu={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 Ju={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 _s={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 As={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 Rs={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 Ii=[Cs,ws,bs,qu,Ju,Pn,Ss,xs,ks,Ai,Ri,Bu,Hu,Gu,Vu,Es,Ts,Ps,Uu,Ku,ju,Du,Fu,_s,Rs,As,$u,Yu,zu,Zu],XP=new Set(Ii.map(e=>e.id));import Yo from"tinycolor2";var Qu="#FFFFFF",v2="#000000",C2=Qu,w2="#1E1E1D";function b2(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 Xr(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return Yo({...e.toHsl(),l:r})}function Xu({backgroundTheme:e,accentHex:t,successHex:r="#51BA81",warnHex:o="#FFB74D",errorHex:n="#EC6351",whiteHex:i=Qu,blackHex:a=v2}){let l;switch(e){case"light":l=C2;break;case"dark":l=w2;break;default:l=e;break}let s=Yo(l),c=Yo(t),u=Yo(r),h=Yo(o),f=Yo(n),y=b2(s.getLuminance()),w=Xr(s,y==="light"?-.04:.11),v=Xr(s,y==="light"?-.88:.87),k=Xr(s,y==="light"?-.77:.75),S=Xr(s,y==="light"?-.43:.45).desaturate(y==="light"?60:20),C=Xr(s,y==="light"?-.08:.25).desaturate(y==="light"?60:20),R=Xr(c,.15),P=Xr(c,-.06),O=Xr(f,.3),_=Yo(c.getLuminance()>.5?a:i),F=Xr(u,-.16);return{colorScheme:y,background:s.toHslString(),background2:w.toHslString(),foreground:v.toHslString(),foreground2:k.toHslString(),foreground3:S.toHslString(),foreground4:C.toHslString(),accent:c.toHslString(),accentLight:R.toHslString(),accentDark:P.toHslString(),foregroundAccent:_.toHslString(),success:u.toHslString(),successDark:F.toHslString(),error:f.toHslString(),errorLight:O.toHslString(),warn:h.toHslString()}}function vc(e,t,r){let o=r?console.warn:()=>{},n=["google","twitter","discord","spotify","tiktok","linkedin","github","apple","farcaster"],i=t?.loginMethods?.filter(jt=>n.includes(jt)),a,l,s,c,u,h,f,y,w,v,k,S,C;t?.loginMethods?(a=t.loginMethods.includes("email"),l=t.loginMethods.includes("sms"),c=t.loginMethods.includes("wallet"),u=i?.includes("google"),h=i?.includes("twitter"),f=i?.includes("discord"),w=i?.includes("spotify"),y=i?.includes("tiktok"),k=i?.includes("github"),v=i?.includes("linkedin"),S=i?.includes("apple"),C=i?.includes("farcaster")):(a=e.emailAuth,l=e.smsAuth,c=e.walletAuth,u=e.googleOAuth,h=e.twitterOAuth,f=e.discordOAuth,k=e.githubOAuth,w=e.spotifyOAuth,y=e.tiktokOAuth,v=e.linkedinOAuth,S=e.appleOAuth,C=e.farcasterAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?s=!1:e.passkeyAuth&&(s=!0);let R=[a,l].filter(Boolean),P=[u,h,f,k,w,y,v,S,C].filter(Boolean),O=[c].filter(Boolean);if(R.length+P.length+O.length===0)throw new Error("You must enable at least one login method");let _=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;_&&O.length===0?(o("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),_=!1):!_&&P.length+R.length===0&&(o("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),_=!0),t?.loginMethods&&t.loginMethodsAndOrder&&o("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let F=Nu({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),K=Wu({input:t?.loginMethodsAndOrder}),V=t?.intl?.defaultCountry??"US",{chains:H,defaultChain:I}=E2({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),Q=!!t?.defaultChain,D=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,pe,me=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?D?pe=t?.embeddedWallets?.noPromptOnSignature??!0:pe=t?.embeddedWallets?.noPromptOnSignature??me:pe=me,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&pe!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:ae,...Ee}=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??Ft.appearance.landingHeader,palette:Xu({backgroundTheme:t?.appearance?.theme??Ft.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??Ft.appearance.accentColor}),loginGroupPriority:_?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:F},loginMethods:{wallet:c,email:a,sms:l,passkey:s,google:u,twitter:h,discord:f,github:k,spotify:w,tiktok:y,linkedin:v,apple:S,farcaster:C},loginMethodsAndOrder:K,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??Ft.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??Ft.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??Ft.rpcConfig.rpcTimeouts},chains:H,defaultChain:I,intl:{defaultCountry:V},shouldEnforceDefaultChainOnConnect:Q,captchaEnabled:e.captchaEnabled??Ft.captchaEnabled,captchaSiteKey:e.captchaSiteKey,embeddedWallets:{...e.embeddedWalletConfig,...typeof ae=="boolean"?{requireUserOwnedRecoveryOnCreate:ae}:{},...D?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...Ee,noPromptOnSignature:pe},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:D?{enabled:!0,...t.customAuth}:void 0,fiatOnRamp:{enabled:e.fiatOnRampEnabled,useSandbox:t?.fiatOnRamp?.useSandbox??Ft.fiatOnRamp.useSandbox},loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1},headless:!!t?.headless,render:{inDialog:t?._render?.inDialog??Ft._render.inDialog,inParentNodeId:t?._render?.inParentNodeId??Ft._render.inParentNodeId}}}function em(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,...r?{...r,...r.logo&&typeof r.logo?{logo:"component"}:void 0}:void 0,legacyCreateEmbeddedWalletFlag:t}}function E2({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:Ii.find(u=>u.id===s.id)??s)}else n=Ii.concat(e??[]);let i=t?n[0]:Pn,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 tm=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)};import{jsx as x2}from"react/jsx-runtime";var nm={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:""},Cc=vc(nm,void 0,!1),wc=S2({appConfig:Cc,isServerConfigLoaded:!1}),im=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:o})=>{let[n,i]=P2(null),a=T2(()=>vc(n??nm,o,!!n),[n,o]);return rm(()=>{if(!n)return;let l=em(o,t),s=tm(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]),rm(()=>{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)}})()},[]),x2(wc.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},Mr=()=>{let{appConfig:e}=om(wc);return e},Is=()=>{let{isServerConfigLoaded:e}=om(wc);return e};var b=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};import{jsx as M2,jsxs as W2}from"react/jsx-runtime";var am=k2({ready:!1,app:Cc,currentScreen:null,lastScreen:null,navigate:b,navigateBack:b,resetNavigation:b,setModalData:b,onUserCloseViaDialogOrKeybindRef:void 0}),I2=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],sm=e=>{let t=Mr(),r=e.authenticated,[o,n]=R2(e.initialScreen);bc(()=>{!r&&!I2.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=A2(null);bc(()=>{e.open||(i.current=null)},[e.open]),bc(()=>{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 W2(am.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&M2(vs,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},x=()=>_2(am);import{jsx as Rn,jsxs as L2}from"react/jsx-runtime";var Mi=({style:e,...t})=>{let{app:r}=x();return L2("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:[Rn("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),Rn("g",{clipPath:"url(#clip0_1765_9946)",children:Rn("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"})}),Rn("defs",{children:Rn("clipPath",{id:"clip0_1765_9946",children:Rn("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var Wr=class extends St{constructor(r,o,n,i,a,l,s){super(s||"unknown",n,i,o);this.connectorType="wallet_connect_v2";this.privyAppId=l,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new Ie(void 0,this.rpcTimeoutDuration),s&&(this.walletEntry=Ka[s],this.walletClientType=s)}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=$a(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=n?.entry,this.walletClientType=n?.walletClientType||"unknown"}this.connected=!0,await this.syncAccounts()}this.emit("initialized"),this.initialized=!0;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:xn,id:"io.metamask"}:{name:nu(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Mi,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=Ka[r],this.walletClientType=r,this.redirectUri=void 0,cu(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new En)};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 ee("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=$a(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Tn(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(a=>{if(a){o(ur(a));return}o(new ee("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=za(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 O2.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:N2,optionalMethods:D2,rpcMap:r,showQrModal:!1});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),F2&&this.walletEntry){let{redirect:l,href:s}=su(a,this.walletEntry);du({href:s,name:this.walletEntry.displayName}),this.redirectUri=l,ja(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=$a(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 Ec=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>U2(o)).map(o=>lm(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},Tn=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||Vo:Vo,Wi=class extends B2{constructor(r,o,n,i,a,l,s,c,u){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 Ie: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.privyAppName=u,this.storedConnections=this.loadConnectionHistory()}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;Y.get(uc)&&(Y.getKeys().forEach(o=>{o.startsWith("walletconnect")&&Y.del(o)}),Y.del(uc));let r=iu(this.store,this.walletList).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"),!fo()&&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")}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 cs(r,o,this.rpcConfig,this.chains,i,n.id),s=new fs(l,this.chains,n,this.rpcConfig);this.addWalletConnector(s)}}removeEmbeddedWalletConnector(){let r=this.findWalletConnector("embedded","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=this.loadConnectionHistory(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let i=this.findWalletConnector(r,o);if(i)return i instanceof Wr&&i.resetConnection(o),i;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new hs(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new An(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new An(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new An(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new _n(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new us(this.chains,this.defaultChain,this.rpcConfig,this.privyAppId,this.privyAppName):r==="phantom"?new gs(this.defaultChain):new Wr(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,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()}loadConnectionHistory(){let r=a=>a&&typeof a.address=="string"&&typeof a.connectorType=="string"&&typeof a.walletClientType=="string"&&typeof a.connectedAt=="number",o=Y.get(mc);return o&&Array.isArray(o)&&o.map(a=>r(a)).every(Boolean)?o:[]}saveConnectionHistory(){let r=this.wallets.map(o=>({address:o.address,connectorType:o.connectorType,walletClientType:o.walletClientType,connectedAt:o.connectedAt}));Y.put(mc,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=lm(r),this.emit("walletsUpdated")}};function ds(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}import{ofetch as H2}from"ofetch";var G2=[Ia,Wa,Ma,La],Ms=class{constructor(t,r,o){this.appId=t,this.clientAnalyticsId=r.clientAnalyticsId,this.sdkVersion=cc,this.client=r,this.defaults=o,this.fallbackApiUrl=r.fallbackApiUrl,this.baseFetch=H2.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:n,options:i})=>{let a=new Headers(i.headers);a.set("privy-app-id",this.appId),a.set("privy-ca-id",this.clientAnalyticsId||""),a.set("privy-client",`react-auth:${this.sdkVersion}`);let l=G2.includes(n.toString());if(!a.has("authorization")){let s=await this.client.getAccessToken({disableAutoRefresh:l});s!==null&&a.set("authorization",`Bearer ${s}`)}i.headers=a,i.retryDelay&&(i.retryDelay=i.retryDelay*3)},onRequestError:({error:n})=>{if(n instanceof DOMException&&n.name==="AbortError")throw new Aa}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw ce(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw ce(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw ce(o)}}};var cm=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});import Zo from"js-cookie";function dm(e){return e instanceof mo?"email":e instanceof jo?"sms":e instanceof Ko?"siwe":e instanceof gn?"custom_auth":e instanceof _r?e.meta.provider:null}import*as pm from"jose";var Lr=class{static parse(t){try{return new Lr(t)}catch{return null}}constructor(t){this.value=t,this._decoded=pm.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 V2=30,Ws=class{constructor(){this.authenticateOnce=new Oe(async t=>this._authenticate(t)),this.linkOnce=new Oe(async t=>this._link(t)),this.refreshOnce=new Oe(this._refresh.bind(this)),this.destroyOnce=new Oe(this._destroy.bind(this)),this.forkSessionOnce=new Oe(this._forkSession.bind(this))}get token(){try{let t=Y.get(Uo);return typeof t=="string"?new Lr(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=Y.get(Ua);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=Y.get(Ei);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get mightHaveServerCookies(){try{let t=Zo.get(Ba);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"}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=Lr.parse(this.token);return t!==null&&!t.isExpired(V2)}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=dm(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:rr(o),isNewUser:n,oAuthProviderTokens:a}}catch(r){throw console.warn("Error authenticating session"),dt(r)}}async _link(t){try{let r=await t.link();return rr(r)}catch(r){throw console.warn("Error linking account"),dt(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(Ia,a,{headers:i}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(Wa,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),rr(n.user)}catch(n){if(n instanceof pr&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw dt(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(Ma,{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(sp,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw dt(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=Y.get(Uo);if(Y.put(Uo,t),!this.client?.useServerCookies){let o=Lr.parse(t)?.expiration;Zo.set(dc,t,{sameSite:"Strict",secure:!0,expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else Y.del(Uo),Zo.remove(dc),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(Y.put(Ua,t),this.client?.useServerCookies||(Zo.set(Ba,"t",{sameSite:"Strict",secure:!0,expires:30}),Zo.set(pc,t,{sameSite:"Strict",secure:!0,expires:30}))):(Y.del(Ua),Zo.remove(pc),Zo.remove(Ba))}clearForkedToken(){Y.del(Ei)}};var Tc,Ls,um,Li=class{constructor(t){_a(this,Ls);this.apiUrl=t.apiUrl||Fa,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!1,this.timeout=t.timeout||$p,this.appId=t.appId,this.clientAnalyticsId=ap(this,Ls,um).call(this),Tc||(Tc=new Ws),this.session=Tc,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:t,rpcConfig:r,chains:o,defaultChain:n,store:i,walletList:a,shouldEnforceDefaultChainOnConnect:l,appName:s}){this.connectors||(this.connectors=new Wi(this.appId,t,r,o,n,i,a,l,s))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new Ms(this.appId,this,{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(Dp,{action:"verify"})}catch(t){throw ce(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(Fp,{});return cm(t.options)}catch(t){throw ce(t)}}async unlinkEmail(t){try{let r=await this.api.post(wp,{address:t});return rr(r)}catch(r){throw dt(r)}}async acceptTerms(){try{let t=await this.api.post(Up,{});return rr(t)}catch(t){throw dt(t)}}async unlinkPhone(t){try{let r=await this.api.post(Pp,{phoneNumber:t});return rr(r)}catch(r){throw dt(r)}}async unlinkWallet(t){try{let r=await this.api.post(pp,{address:t});return rr(r)}catch(r){throw dt(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Ap,{provider:t,subject:r});return rr(o)}catch(o){throw dt(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(yp,{fid:t});return rr(r)}catch(r){throw dt(r)}}async unlinkPasskey(t){try{let r=await this.api.post(Np,{credential_id:t});return rr(r)}catch(r){throw dt(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(La,{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(Bp,t)}catch(r){throw dt(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?Lr.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});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,tiktokOAuth:o.tiktok_oauth,linkedinOAuth:o.linkedin_oauth,appleOAuth:o.apple_oauth,farcasterAuth:o.farcaster_auth,passkeyAuth:o.passkey_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}}catch(t){throw dt(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()}};Ls=new WeakSet,um=function(){if(typeof window>"u")return null;try{let r=Y.get(Ti);if(typeof r=="string"&&r.length>0)return r}catch{}let t=z2();try{return Y.put(Ti,t),t}catch{return t}};import{Turnstile as Z2}from"@marsidev/react-turnstile";import{useEffect as J2,useMemo as Q2}from"react";import{useMemo as q2,useRef as $2,useContext as K2,useState as Pc,createContext as j2}from"react";import{jsx as Y2}from"react/jsx-runtime";var mm=j2({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:b,setError:b,setExecuting:b,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:b,reset:b,execute:b}),mr=class extends Ue{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},fm=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=$2(null),[i,a]=Pc(),[l,s]=Pc(),[c,u]=Pc(!1),h=q2(()=>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 Y2(mm.Provider,{value:{...h,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 ru(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new mr("Captcha failed",null,"captcha_timeout")}}},children:e})},Ce=()=>K2(mm);import{jsx as hm}from"react/jsx-runtime";var Sc=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=Ce(),[,s]=Q2(()=>r?.split("t:")||[],[r]);if(J2(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return hm("div",{className:"hidden h-0 w-0",children:hm(Z2,{...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")}}})})};import{useCallback as U7,useEffect as b1,useRef as B7,useState as H7}from"react";import G7 from"react-dom";import{createContext as X2,useContext as ev}from"react";var xc=X2({isNewUserThisSession:!1,linkingHint:null,walletConnectionStatus:null,mipdStore:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",nativeTokenSymbolForChainId:b,initializeWalletProxy:b,getAuthMeta:b,getAuthFlow:b,closePrivyModal:b,openPrivyModal:b,connectWallet:b,initLoginWithWallet:b,loginWithWallet:b,initLoginWithFarcaster:b,loginWithFarcaster:b,loginWithCode:b,initLoginWithEmail:b,initLoginWithSms:b,initUpdateEmail:b,resendEmailCode:b,resendSmsCode:b,initLoginWithHeadlessOAuth:b,loginWithHeadlessOAuth:b,initLoginWithOAuth:b,recoveryOAuthFlow:b,loginWithOAuth:b,initLoginWithPasskey:b,loginWithPasskey:b,initLinkWithPasskey:b,linkWithPasskey:b,refreshUser:b,walletProxy:null,createAnalyticsEvent:b,acceptTerms:b,getUsdTokenPrice:b,recoverEmbeddedWallet:b,getFiatOnRampConfig:b,updateWallets:b,fundWallet:b,setReadyToTrue:b,requestFarcasterSignerStatus:b}),M=()=>ev(xc);import{createContext as tv,useContext as rv}from"react";var ye=tv({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:b,login:b,connectOrCreateWallet:b,linkEmail:b,linkPhone:b,linkFarcaster:b,linkWallet:b,linkGoogle:b,linkTwitter:b,linkDiscord:b,linkGithub:b,linkSpotify:b,linkTiktok:b,linkLinkedIn:b,linkApple:b,linkPasskey:b,updateEmail:b,logout:b,getAccessToken:b,getEthereumProvider:b,getEthersProvider:b,getWeb3jsProvider:b,unlinkEmail:b,unlinkPhone:b,unlinkWallet:b,unlinkGoogle:b,unlinkTwitter:b,unlinkDiscord:b,unlinkGithub:b,unlinkSpotify:b,unlinkTiktok:b,unlinkLinkedIn:b,unlinkApple:b,unlinkFarcaster:b,unlinkPasskey:b,setActiveWallet:b,forkSession:b,createWallet:b,signMessage:b,signTypedData:b,enrollInMfa:b,initEnrollmentWithSms:b,initEnrollmentWithTotp:b,initEnrollmentWithPasskey:b,promptMfa:b,init:b,submitEnrollmentWithSms:b,submitEnrollmentWithTotp:b,submitEnrollmentWithPasskey:b,unenroll:b,submit:b,cancel:b,sendTransaction:b,exportWallet:b,setWalletPassword:b,requestFarcasterSigner:b,submitCast:b,removeCast:b,likeCast:b,recastCast:b,followUser:b,unfollowUser:b,initLoginWithEmail:b,initLoginWithSms:b,otpState:{status:"initial"},loginWithCode:b,fundWallet:b,initLoginWithHeadlessOAuth:b,loginWithHeadlessOAuth:b,isHeadlessOAuthLoading:!1,isModalOpen:!1}),B=()=>rv(ye);import{useEffect as ov,useState as nv}from"react";var ym=e=>{let[t,r]=nv("auto");return ov(()=>{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};import{createContext as iv,useContext as av,useEffect as sv}from"react";var gm={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]}},kc=iv(void 0),vm=()=>av(kc);function De(e,t){if(!t)return;let o=vm().current[e];return sv(()=>{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 N(e,t,r,...o){for(let n of e.current[t][r])n(...o)}function Os(){let e=vm();return(t,r,...o)=>N(e,t,r,...o)}function _c(e){De("configureMfa",e)}import xm from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import xv from"@heroicons/react/24/solid/DocumentCheckIcon";import kv from"styled-components";import Jo,{css as Mc}from"styled-components";import Rc from"styled-components";import{Fragment as cv,jsx as Ac,jsxs as dv}from"react/jsx-runtime";var xt=({success:e,fail:t})=>dv(cv,{children:[Ac(Xe,{className:e?"success":t?"fail":""}),Ac(Ic,{className:e?"success":t?"fail":""})]}),Xe=Rc.span`
13
13
  && {
14
14
  width: 82px;
15
15
  height: 82px;
@@ -48,7 +48,7 @@ Resources:
48
48
  animation: none;
49
49
  opacity: 0.5;
50
50
  }
51
- `,Xr=e=>Ac(cv,{color:e.color||"var(--privy-color-foreground-3)"}),cv=Rc(Xe)`
51
+ `,eo=e=>Ac(lv,{color:e.color||"var(--privy-color-foreground-3)"}),lv=Rc(Xe)`
52
52
  && {
53
53
  height: 0.9rem;
54
54
  width: 0.9rem;
@@ -85,13 +85,13 @@ Resources:
85
85
  color: var(--privy-color-foreground-3);
86
86
  cursor: not-allowed;
87
87
  }
88
- `,W=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>or(wm,{disabled:t||r,...n,children:t?Us("span",{children:[or(Xr,{}),o?or("span",{children:o}):null]}):e}),fk=Jo(W)`
88
+ `,W=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>or(Cm,{disabled:t||r,...n,children:t?Us("span",{children:[or(eo,{}),o?or("span",{children:o}):null]}):e}),mk=Jo(W)`
89
89
  ${e=>e.hideAnimations&&Mc`
90
90
  && {
91
91
  transition: none;
92
92
  }
93
93
  `}
94
- `,Ds=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>or(wm,{as:"a",disabled:t||r,...n,children:t?Us("span",{children:[or(Xr,{}),o?or("span",{children:o}):null]}):e}),wm=Jo(Ns)`
94
+ `,Ds=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>or(Cm,{as:"a",disabled:t||r,...n,children:t?Us("span",{children:[or(eo,{}),o?or("span",{children:o}):null]}):e}),Cm=Jo(Ns)`
95
95
  position: relative;
96
96
 
97
97
  && {
@@ -136,7 +136,7 @@ Resources:
136
136
  opacity: 1;
137
137
  animation: fadein 200ms ease;
138
138
  }
139
- `,fr=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>or(uv,{disabled:t||r,...n,children:t?Us("span",{children:[or(Xr,{}),o?or("span",{children:o}):null]}):e}),uv=Jo(Ns)`
139
+ `,fr=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>or(pv,{disabled:t||r,...n,children:t?Us("span",{children:[or(eo,{}),o?or("span",{children:o}):null]}):e}),pv=Jo(Ns)`
140
140
  && {
141
141
  border-width: 1px;
142
142
  border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"};
@@ -196,10 +196,10 @@ Resources:
196
196
  cursor: not-allowed;
197
197
  }
198
198
  }
199
- `,hk=Jo.div`
199
+ `,fk=Jo.div`
200
200
  /* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */
201
201
  height: 44px;
202
- `,In=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>Us(mv,{isSubmitting:o,onClick:t,disabled:r,...n,children:[or("span",{children:e}),or("span",{children:or(Xr,{})})]}),mv=Jo.button`
202
+ `,In=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>Us(uv,{isSubmitting:o,onClick:t,disabled:r,...n,children:[or("span",{children:e}),or("span",{children:or(eo,{})})]}),uv=Jo.button`
203
203
  && {
204
204
  color: var(--privy-color-accent);
205
205
  font-size: 16px;
@@ -241,7 +241,7 @@ Resources:
241
241
  cursor: not-allowed;
242
242
  }
243
243
  }
244
- `;import bm from"styled-components";import{Fragment as fv,jsx as vo,jsxs as Em}from"react/jsx-runtime";var Wc=bm.div`
244
+ `;import wm from"styled-components";import{Fragment as mv,jsx as vo,jsxs as bm}from"react/jsx-runtime";var Wc=wm.div`
245
245
  margin-top: 16px;
246
246
  font-size: 13px;
247
247
  text-align: center;
@@ -250,7 +250,7 @@ Resources:
250
250
  && > a {
251
251
  color: var(--privy-color-accent);
252
252
  }
253
- `;function Mn(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:r,requireUsersAcceptTerms:o}}=e.app;if(o&&!e.alwaysShowImplicitConsent)return vo(Wc,{});if(!r&&!t)return vo(Wc,{});let n=!!(t&&r);return Em(Wc,{children:["By logging in I agree to the"," ",r&&vo("a",{href:r,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&vo("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var z=({protectedByPrivy:e})=>vo(q,{children:e?Em(fv,{children:[vo(ms,{className:"hide-on-mobile"}),vo("span",{className:"hide-on-mobile",children:vo("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})})]}):null}),q=bm.div`
253
+ `;function Mn(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:r,requireUsersAcceptTerms:o}}=e.app;if(o&&!e.alwaysShowImplicitConsent)return vo(Wc,{});if(!r&&!t)return vo(Wc,{});let n=!!(t&&r);return bm(Wc,{children:["By logging in I agree to the"," ",r&&vo("a",{href:r,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&vo("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var z=({protectedByPrivy:e})=>vo(q,{children:e?bm(mv,{children:[vo(ms,{className:"hide-on-mobile"}),vo("span",{className:"hide-on-mobile",children:vo("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})})]}):null}),q=wm.div`
254
254
  display: flex;
255
255
  align-items: center;
256
256
  justify-content: center;
@@ -277,7 +277,7 @@ Resources:
277
277
  @media all and (display-mode: standalone) {
278
278
  padding-bottom: 30px;
279
279
  }
280
- `;import hv from"@heroicons/react/24/outline/ArrowLeftIcon";import yv from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import gv from"@heroicons/react/24/outline/XMarkIcon";import Wn from"styled-components";import{jsx as kt,jsxs as Tm}from"react/jsx-runtime";var vv=({backFn:e})=>kt("div",{children:kt(Lc,{onClick:e,children:kt(hv,{height:"16px",width:"16px",strokeWidth:2})})}),Cv=({infoFn:e})=>kt("div",{children:kt(bv,{"aria-label":"info",onClick:e,children:kt(yv,{height:"22px",width:"22px",strokeWidth:2})})}),wv=e=>kt("div",{children:kt(Lc,{"aria-label":"close modal",onClick:e.onClose,children:kt(gv,{height:"16px",width:"16px",strokeWidth:2})})});var T=({backFn:e,infoFn:t,onClose:r,title:o,closeable:n=!0})=>{let{closePrivyModal:i}=M(),{app:a}=x();return Tm(Ev,{children:[Tm(Tv,{children:[e&&kt(vv,{backFn:e}),t&&kt(Cv,{infoFn:t})]}),o&&kt(Sv,{id:"privy-dialog-title",children:o}),kt(Pv,{children:a?.render.inDialog&&n&&kt(wv,{onClose:r||(()=>i())})})]})},Lc=Wn.button`
280
+ `;import fv from"@heroicons/react/24/outline/ArrowLeftIcon";import hv from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import yv from"@heroicons/react/24/outline/XMarkIcon";import Wn from"styled-components";import{jsx as kt,jsxs as Em}from"react/jsx-runtime";var gv=({backFn:e})=>kt("div",{children:kt(Lc,{onClick:e,children:kt(fv,{height:"16px",width:"16px",strokeWidth:2})})}),vv=({infoFn:e})=>kt("div",{children:kt(wv,{"aria-label":"info",onClick:e,children:kt(hv,{height:"22px",width:"22px",strokeWidth:2})})}),Cv=e=>kt("div",{children:kt(Lc,{"aria-label":"close modal",onClick:e.onClose,children:kt(yv,{height:"16px",width:"16px",strokeWidth:2})})});var T=({backFn:e,infoFn:t,onClose:r,title:o,closeable:n=!0})=>{let{closePrivyModal:i}=M(),{app:a}=x();return Em(bv,{children:[Em(Ev,{children:[e&&kt(gv,{backFn:e}),t&&kt(vv,{infoFn:t})]}),o&&kt(Pv,{id:"privy-dialog-title",children:o}),kt(Tv,{children:a?.render.inDialog&&n&&kt(Cv,{onClose:r||(()=>i())})})]})},Lc=Wn.button`
281
281
  && {
282
282
  cursor: pointer;
283
283
  display: flex;
@@ -296,11 +296,11 @@ Resources:
296
296
  opacity: 1;
297
297
  }
298
298
  }
299
- `,bv=Wn(Lc)`
299
+ `,wv=Wn(Lc)`
300
300
  && {
301
301
  background-color: transparent;
302
302
  }
303
- `,Ev=Wn.div`
303
+ `,bv=Wn.div`
304
304
  padding: 16px 0;
305
305
  display: flex;
306
306
  align-items: center;
@@ -312,23 +312,23 @@ Resources:
312
312
  font-weight: 600;
313
313
  color: var(--privy-color-foreground);
314
314
  }
315
- `,Tv=Wn.div`
315
+ `,Ev=Wn.div`
316
316
  flex: 1;
317
317
  align-items: center;
318
318
  display: flex;
319
319
  gap: 8px;
320
- `,Pv=Wn.div`
320
+ `,Tv=Wn.div`
321
321
  flex: 1;
322
322
  display: flex;
323
323
  justify-content: flex-end;
324
- `,Sv=Wn.div`
324
+ `,Pv=Wn.div`
325
325
  overflow: hidden;
326
326
  white-space: nowrap;
327
327
  max-width: 100%;
328
328
  text-overflow: ellipsis;
329
329
  text-align: center;
330
330
  color: var(--privy-color-foreground-2);
331
- `;import Ln,{css as xv}from"styled-components";var Bs=Ln.div`
331
+ `;import Ln,{css as Sv}from"styled-components";var Bs=Ln.div`
332
332
  text-align: left;
333
333
  flex-grow: 1;
334
334
  `,Hs=Ln.div`
@@ -351,7 +351,7 @@ Resources:
351
351
  &::-webkit-scrollbar {
352
352
  display: none;
353
353
  }
354
- `,Pm=xv`
354
+ `,Tm=Sv`
355
355
  && {
356
356
  width: 100%;
357
357
  font-size: 16px;
@@ -390,10 +390,10 @@ Resources:
390
390
  }
391
391
  }
392
392
  `,Ae=Ln.button`
393
- ${Pm}
393
+ ${Tm}
394
394
  `,Oc=Ln.a`
395
- ${Pm}
396
- `,eo=Ln.div`
395
+ ${Tm}
396
+ `,to=Ln.div`
397
397
  width: 100%;
398
398
  ${e=>e.if?"display: none;":""}
399
399
  `;import qe from"styled-components";var ge=qe.div`
@@ -514,7 +514,7 @@ Resources:
514
514
  width: 100%;
515
515
  display: flex;
516
516
  justify-content: space-between;
517
- `,Sm=qe.p`
517
+ `,Pm=qe.p`
518
518
  text-align: left;
519
519
  width: 100%;
520
520
  color: var(--privy-color-foreground-3) !important;
@@ -563,12 +563,12 @@ Resources:
563
563
  width: auto !important;
564
564
  color: white;
565
565
  }
566
- `,xm=qe.div`
566
+ `,Sm=qe.div`
567
567
  color: var(--privy-color-error);
568
- `;import{Fragment as Iv,jsx as Lr,jsxs as Ni}from"react/jsx-runtime";var _m=()=>{let{user:e,logout:t}=B(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:i}=x(),{acceptTerms:a,closePrivyModal:l,createAnalyticsEvent:s}=M(),c=h=>{h?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};o.current=c;let u=async h=>{h.preventDefault(),await a(),e&&tr(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 Lr(Av,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:u,onDecline:c})},Av=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>Ni(Iv,{children:[Lr(T,{closeable:!1}),Lr(kv,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),Lr(ne,{style:{marginTop:24},children:"One last step"}),Lr(se,{children:"By signing up, you agree to our terms and privacy policy."}),Ni(nr,{style:{marginTop:24},children:[e&&Ni(Oc,{target:"_blank",href:e,children:["View Terms ",Lr(km,{style:{marginLeft:"auto"}})]}),t&&Ni(Oc,{target:"_blank",href:t,children:["View Privacy Policy ",Lr(km,{style:{marginLeft:"auto"}})]})]}),Ni(Rv,{style:{marginTop:24},children:[Lr(fr,{onClick:o,children:"No thanks"}),Lr(W,{onClick:r,children:"Accept"})]}),Lr(z,{protectedByPrivy:!0})]}),Rv=_v.div`
568
+ `;import{Fragment as Rv,jsx as Or,jsxs as Ni}from"react/jsx-runtime";var km=()=>{let{user:e,logout:t}=B(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:i}=x(),{acceptTerms:a,closePrivyModal:l,createAnalyticsEvent:s}=M(),c=h=>{h?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};o.current=c;let u=async h=>{h.preventDefault(),await a(),e&&tr(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 Or(_v,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:u,onDecline:c})},_v=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>Ni(Rv,{children:[Or(T,{closeable:!1}),Or(xv,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),Or(ne,{style:{marginTop:24},children:"One last step"}),Or(se,{children:"By signing up, you agree to our terms and privacy policy."}),Ni(nr,{style:{marginTop:24},children:[e&&Ni(Oc,{target:"_blank",href:e,children:["View Terms ",Or(xm,{style:{marginLeft:"auto"}})]}),t&&Ni(Oc,{target:"_blank",href:t,children:["View Privacy Policy ",Or(xm,{style:{marginLeft:"auto"}})]})]}),Ni(Av,{style:{marginTop:24},children:[Or(fr,{onClick:o,children:"No thanks"}),Or(W,{onClick:r,children:"Accept"})]}),Or(z,{protectedByPrivy:!0})]}),Av=kv.div`
569
569
  display: flex;
570
570
  gap: 10px;
571
- `;import Rm from"styled-components";import Mv from"styled-components";var Ks=Mv.span`
571
+ `;import Am from"styled-components";import Iv from"styled-components";var Ks=Iv.span`
572
572
  && {
573
573
  width: 82px;
574
574
  height: 82px;
@@ -583,7 +583,7 @@ Resources:
583
583
  transition: border-color 800ms;
584
584
  border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
585
585
  }
586
- `;import Wv from"styled-components";var Lv=Wv.div`
586
+ `;import Mv from"styled-components";var Wv=Mv.div`
587
587
  display: flex;
588
588
  flex-direction: column;
589
589
  justify-content: center;
@@ -606,7 +606,7 @@ Resources:
606
606
  left: -19px;
607
607
  top: -19px;
608
608
  }
609
- `,Rt=Lv;import{jsx as Am}from"react/jsx-runtime";var js=({style:e,...t})=>Am("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:Am("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"})});import{Fragment as Nc,jsx as Or,jsxs as Ys}from"react/jsx-runtime";var Im=()=>{let{navigate:e,app:t}=x(),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 Ys(Nc,{children:[Or(T,{}),Ys(Ov,{children:[Or(Rt,{children:Ys("div",{children:[Or(Ks,{}),Or(js,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),Ys(Nv,{children:[typeof r=="string"?Or("h3",{children:r}):Or(Nc,{children:r}),typeof o=="string"?Or("p",{children:o}):Or(Nc,{children:o})]}),t?.allowlistConfig.errorCtaLink?Or(W,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):Or(W,{onClick:()=>{e("LANDING")},children:n})]})]})},Ov=Rm.div`
609
+ `,Rt=Wv;import{jsx as _m}from"react/jsx-runtime";var js=({style:e,...t})=>_m("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:_m("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"})});import{Fragment as Nc,jsx as Nr,jsxs as Ys}from"react/jsx-runtime";var Rm=()=>{let{navigate:e,app:t}=x(),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 Ys(Nc,{children:[Nr(T,{}),Ys(Lv,{children:[Nr(Rt,{children:Ys("div",{children:[Nr(Ks,{}),Nr(js,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),Ys(Ov,{children:[typeof r=="string"?Nr("h3",{children:r}):Nr(Nc,{children:r}),typeof o=="string"?Nr("p",{children:o}):Nr(Nc,{children:o})]}),t?.allowlistConfig.errorCtaLink?Nr(W,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):Nr(W,{onClick:()=>{e("LANDING")},children:n})]})]})},Lv=Am.div`
610
610
  display: flex;
611
611
  flex-direction: column;
612
612
  align-items: center;
@@ -614,11 +614,11 @@ Resources:
614
614
  gap: 24px;
615
615
  width: 100%;
616
616
  padding-bottom: 16px;
617
- `,Nv=Rm.div`
617
+ `,Ov=Am.div`
618
618
  display: flex;
619
619
  flex-direction: column;
620
620
  gap: 8px;
621
- `;import Uv from"@heroicons/react/24/outline/EnvelopeIcon";import Bv from"@heroicons/react/24/outline/PhoneIcon";import{useEffect as Fm,useState as Zs}from"react";import{isMobile as Hv}from"react-device-detect";import Ui from"styled-components";import Ut from"styled-components";var ar=Ut.div`
621
+ `;import Fv from"@heroicons/react/24/outline/EnvelopeIcon";import Uv from"@heroicons/react/24/outline/PhoneIcon";import{useEffect as Dm,useState as Zs}from"react";import{isMobile as Bv}from"react-device-detect";import Ui from"styled-components";import Ut from"styled-components";var ar=Ut.div`
622
622
  display: flex;
623
623
  flex-direction: column;
624
624
  align-items: flex-start;
@@ -633,7 +633,7 @@ Resources:
633
633
  justify-content: center;
634
634
  flex-grow: 1;
635
635
  width: 100%;
636
- `,Mm=Ut.div`
636
+ `,Im=Ut.div`
637
637
  display: flex;
638
638
  flex-direction: column;
639
639
  align-items: center;
@@ -650,12 +650,12 @@ Resources:
650
650
  display: flex;
651
651
  flex-direction: column;
652
652
  gap: 8px;
653
- `,d_=Ut.div`
653
+ `,c_=Ut.div`
654
654
  display: flex;
655
655
  flex-direction: column;
656
656
  justify-content: space-between;
657
657
  height: 100%;
658
- `,Wm=Ut.div`
658
+ `,Mm=Ut.div`
659
659
  display: flex;
660
660
  flex-direction: column;
661
661
  justify-content: flex-start;
@@ -682,9 +682,9 @@ Resources:
682
682
  height: 16px;
683
683
  `,ie=Ut.div`
684
684
  height: 12px;
685
- `,Lm=Ut.div`
685
+ `,Wm=Ut.div`
686
686
  position: relative;
687
- `,Om=Ut.div`
687
+ `,Lm=Ut.div`
688
688
  background-color: var(--privy-color-accent);
689
689
  display: flex;
690
690
  justify-content: center;
@@ -692,9 +692,9 @@ Resources:
692
692
  border-radius: 50%;
693
693
  border-color: white;
694
694
  border-width: 2px !important;
695
- `;import Fc from"styled-components";import{Fragment as Fv,jsx as Di,jsxs as Dm}from"react/jsx-runtime";var Fi=({title:e,description:t,children:r,...o})=>Di(Nm,{...o,children:Dm(Fv,{children:[Di("h3",{children:e}),typeof t=="string"?Di("p",{children:t}):t,r]})}),Nr=Fc(Fi)`
695
+ `;import Fc from"styled-components";import{Fragment as Dv,jsx as Di,jsxs as Nm}from"react/jsx-runtime";var Fi=({title:e,description:t,children:r,...o})=>Di(Om,{...o,children:Nm(Dv,{children:[Di("h3",{children:e}),typeof t=="string"?Di("p",{children:t}):t,r]})}),Dr=Fc(Fi)`
696
696
  margin-bottom: 24px;
697
- `,Te=({title:e,description:t,icon:r,children:o,...n})=>Dm(Dv,{...n,children:[r||null,Di("h3",{children:e}),typeof t=="string"?Di("p",{children:t}):t,o]}),Nm=Fc.div`
697
+ `,Te=({title:e,description:t,icon:r,children:o,...n})=>Nm(Nv,{...n,children:[r||null,Di("h3",{children:e}),typeof t=="string"?Di("p",{children:t}):t,o]}),Om=Fc.div`
698
698
  display: flex;
699
699
  flex-direction: column;
700
700
  justify-content: flex-start;
@@ -714,7 +714,7 @@ Resources:
714
714
  color: var(--privy-color-foreground-2);
715
715
  font-size: 14px;
716
716
  }
717
- `,Dv=Fc(Nm)`
717
+ `,Nv=Fc(Om)`
718
718
  align-items: center;
719
719
  text-align: center;
720
720
  gap: 16px;
@@ -722,7 +722,7 @@ Resources:
722
722
  h3 {
723
723
  margin-bottom: 24px;
724
724
  }
725
- `;import{Fragment as Uc,jsx as ut,jsxs as Co}from"react/jsx-runtime";var Bc=6,Um=new Array(Bc).fill(""),Gv=1400;var Hm=()=>{let{app:e,navigate:t,navigateBack:r,setModalData:o,onUserCloseViaDialogOrKeybindRef:n}=x(),{closePrivyModal:i,resendEmailCode:a,resendSmsCode:l,getAuthMeta:s,loginWithCode:c,updateWallets:u,createAnalyticsEvent:h}=M(),{authenticated:f,logout:y,user:w}=B(),[v,k]=Zs(Um),[S,C]=Zs(!1),[R,P]=Zs(null),[O,_]=Zs(null);n.current=()=>null;let D=s()?.email?0:1,K=e?.render.inDialog?Be:0,V=e?.render.inDialog?K-500:0;Fm(()=>{if(f&&S&&w){if(e?.legal.requireUsersAcceptTerms&&!w.hasAcceptedTerms){let me=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},V);return()=>clearTimeout(me)}if(tr(w,e?.embeddedWallets?.createOnLogin)){let me=setTimeout(()=>{o({createWallet:{onSuccess:()=>{},onFailure:ae=>{console.error(ae),h({eventName:"embedded_wallet_creation_failure_logout",payload:{error:ae,screen:"AwaitingPasswordlessCodeScreen"}}),y()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},V);return()=>clearTimeout(me)}else{u();let me=setTimeout(()=>i({shouldCallAuthOnSuccess:!0,isSuccess:!0}),K);return()=>clearTimeout(me)}}},[f,S,w]),Fm(()=>{if(R&&O===0){let pe=setTimeout(()=>{k(Um),P(null),document.querySelector("input[name=code-0]")?.focus()},Gv);return()=>clearTimeout(pe)}},[R]);let H=pe=>{pe.preventDefault();let me=pe.currentTarget.value.replace(" ","");if(me==="")return;if(isNaN(Number(me))){P("Code should be numeric"),_(1);return}P(null),_(null);let ae=Number(pe.currentTarget.name?.charAt(5)),Ee=[...me||[""]].slice(0,Bc-ae),J=[...v.slice(0,ae),...Ee,...v.slice(ae+Ee.length)];k(J);let jt=Ee.length,Lt=Math.min(Math.max(ae+jt,0),Bc-1);isNaN(Number(pe.currentTarget.value))||document.querySelector(`input[name=code-${Lt}]`)?.focus(),J.every(Yt=>Yt&&!isNaN(+Yt))&&(document.querySelector(`input[name=code-${Lt}]`)?.blur(),c(J.join("")).then(()=>C(!0)).catch(lt=>{if(lt?.status===422)P("Invalid or expired verification code");else if(lt instanceof pr&&lt.privyErrorCode==="cannot_link_more_of_type")P(lt.message);else if(lt instanceof pr&&lt.privyErrorCode==="max_accounts_reached"){console.error(new kr(lt).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else P("Issue verifying code");_(0)}))},I=pe=>{O===1&&(P(null),_(null));let me=[...v.slice(0,pe),"",...v.slice(pe+1)];k(me),pe>0&&document.querySelector(`input[name=code-${pe-1}]`)?.focus()},Q=D==0?ut(Uv,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):ut(Bv,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),U=D==0?Co("p",{children:["Please check ",ut(Bm,{children:s()?.email})," for an email from privy.io and enter your code below."]}):Co("p",{children:["Please check ",ut(Bm,{children:s()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return Co(Uc,{children:[ut(T,{backFn:()=>r()},"header"),Co(Vv,{children:[ut(Te,{title:"Enter confirmation code",description:U,icon:Q}),Co(Mm,{children:[Co(zv,{children:[ut(qv,{fail:!!R,success:S,children:ut("span",{children:R||(S?"Success!":"")})}),ut("div",{children:v.map((pe,me)=>ut("input",{name:`code-${me}`,type:"text",value:v[me],onChange:H,onKeyUp:ae=>{ae.key==="Backspace"&&I(me)},inputMode:"numeric",autoFocus:me===0,pattern:"[0-9]",className:`${S?"success":""} ${R?"fail":""}`,autoComplete:Hv?"one-time-code":"off"},me))})]}),ut($v,{children:D==0?Co(Uc,{children:[ut("span",{children:"Didn't get an email?"}),ut("button",{onClick:a,children:"Resend code"})]}):Co(Uc,{children:[ut("span",{children:"Didn't get a message?"}),ut("button",{onClick:l,children:"Resend code"})]})})]})]}),ut(z,{protectedByPrivy:!0})]})},Vv=Ui.div`
725
+ `;import{Fragment as Uc,jsx as ut,jsxs as Co}from"react/jsx-runtime";var Bc=6,Fm=new Array(Bc).fill(""),Hv=1400;var Bm=()=>{let{app:e,navigate:t,navigateBack:r,setModalData:o,onUserCloseViaDialogOrKeybindRef:n}=x(),{closePrivyModal:i,resendEmailCode:a,resendSmsCode:l,getAuthMeta:s,loginWithCode:c,updateWallets:u,createAnalyticsEvent:h}=M(),{authenticated:f,logout:y,user:w}=B(),[v,k]=Zs(Fm),[S,C]=Zs(!1),[R,P]=Zs(null),[O,_]=Zs(null);n.current=()=>null;let F=s()?.email?0:1,K=e?.render.inDialog?Be:0,V=e?.render.inDialog?K-500:0;Dm(()=>{if(f&&S&&w){if(e?.legal.requireUsersAcceptTerms&&!w.hasAcceptedTerms){let me=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},V);return()=>clearTimeout(me)}if(tr(w,e?.embeddedWallets?.createOnLogin)){let me=setTimeout(()=>{o({createWallet:{onSuccess:()=>{},onFailure:ae=>{console.error(ae),h({eventName:"embedded_wallet_creation_failure_logout",payload:{error:ae,screen:"AwaitingPasswordlessCodeScreen"}}),y()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},V);return()=>clearTimeout(me)}else{u();let me=setTimeout(()=>i({shouldCallAuthOnSuccess:!0,isSuccess:!0}),K);return()=>clearTimeout(me)}}},[f,S,w]),Dm(()=>{if(R&&O===0){let pe=setTimeout(()=>{k(Fm),P(null),document.querySelector("input[name=code-0]")?.focus()},Hv);return()=>clearTimeout(pe)}},[R]);let H=pe=>{pe.preventDefault();let me=pe.currentTarget.value.replace(" ","");if(me==="")return;if(isNaN(Number(me))){P("Code should be numeric"),_(1);return}P(null),_(null);let ae=Number(pe.currentTarget.name?.charAt(5)),Ee=[...me||[""]].slice(0,Bc-ae),J=[...v.slice(0,ae),...Ee,...v.slice(ae+Ee.length)];k(J);let jt=Ee.length,Lt=Math.min(Math.max(ae+jt,0),Bc-1);isNaN(Number(pe.currentTarget.value))||document.querySelector(`input[name=code-${Lt}]`)?.focus(),J.every(Yt=>Yt&&!isNaN(+Yt))&&(document.querySelector(`input[name=code-${Lt}]`)?.blur(),c(J.join("")).then(()=>C(!0)).catch(lt=>{if(lt?.status===422)P("Invalid or expired verification code");else if(lt instanceof pr&&lt.privyErrorCode==="cannot_link_more_of_type")P(lt.message);else if(lt instanceof pr&&lt.privyErrorCode==="max_accounts_reached"){console.error(new kr(lt).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else P("Issue verifying code");_(0)}))},I=pe=>{O===1&&(P(null),_(null));let me=[...v.slice(0,pe),"",...v.slice(pe+1)];k(me),pe>0&&document.querySelector(`input[name=code-${pe-1}]`)?.focus()},Q=F==0?ut(Fv,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):ut(Uv,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),D=F==0?Co("p",{children:["Please check ",ut(Um,{children:s()?.email})," for an email from privy.io and enter your code below."]}):Co("p",{children:["Please check ",ut(Um,{children:s()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return Co(Uc,{children:[ut(T,{backFn:()=>r()},"header"),Co(Gv,{children:[ut(Te,{title:"Enter confirmation code",description:D,icon:Q}),Co(Im,{children:[Co(Vv,{children:[ut(zv,{fail:!!R,success:S,children:ut("span",{children:R||(S?"Success!":"")})}),ut("div",{children:v.map((pe,me)=>ut("input",{name:`code-${me}`,type:"text",value:v[me],onChange:H,onKeyUp:ae=>{ae.key==="Backspace"&&I(me)},inputMode:"numeric",autoFocus:me===0,pattern:"[0-9]",className:`${S?"success":""} ${R?"fail":""}`,autoComplete:Bv?"one-time-code":"off"},me))})]}),ut(qv,{children:F==0?Co(Uc,{children:[ut("span",{children:"Didn't get an email?"}),ut("button",{onClick:a,children:"Resend code"})]}):Co(Uc,{children:[ut("span",{children:"Didn't get a message?"}),ut("button",{onClick:l,children:"Resend code"})]})})]})]}),ut(z,{protectedByPrivy:!0})]})},Gv=Ui.div`
726
726
  display: flex;
727
727
  flex-direction: column;
728
728
  align-items: flex-start;
@@ -730,7 +730,7 @@ Resources:
730
730
  margin: auto;
731
731
  gap: 16px;
732
732
  flex-grow: 1;
733
- `,zv=Ui.div`
733
+ `,Vv=Ui.div`
734
734
  display: flex;
735
735
  flex-direction: column;
736
736
  width: 100%;
@@ -786,7 +786,7 @@ Resources:
786
786
  transform: translate(1px, 0px);
787
787
  }
788
788
  }
789
- `,qv=Ui.div`
789
+ `,zv=Ui.div`
790
790
  line-height: 20px;
791
791
  height: 20px;
792
792
  font-size: 13px;
@@ -794,7 +794,7 @@ Resources:
794
794
  display: flex;
795
795
  justify-content: flex-end;
796
796
  width: 100%;
797
- `,$v=Ui.div`
797
+ `,qv=Ui.div`
798
798
  font-size: 13px;
799
799
  color: var(--privy-color-foreground-3);
800
800
  display: flex;
@@ -808,10 +808,10 @@ Resources:
808
808
  > button {
809
809
  text-decoration: underline;
810
810
  }
811
- `,Bm=Ui.span`
811
+ `,Um=Ui.span`
812
812
  font-weight: 500;
813
813
  word-break: break-all;
814
- `;import Jv from"@heroicons/react/24/solid/CheckCircleIcon";import Qv from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as Hc,useRef as Xv,useState as Dn}from"react";import e3 from"styled-components";import Kv from"styled-components";import{Fragment as Zv,jsx as Nn,jsxs as Yv}from"react/jsx-runtime";var Gm=({icon:e})=>{let t=e;return Nn(Zv,{children:Nn(jv,{children:Yv("div",{children:[Nn(xt,{}),typeof t=="string"?Nn("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?Nn(t,{style:{width:"38px",height:"38px"}}):Nn("span",{})]})})})},jv=Kv.div`
814
+ `;import Zv from"@heroicons/react/24/solid/CheckCircleIcon";import Jv from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as Hc,useRef as Qv,useState as Dn}from"react";import Xv from"styled-components";import $v from"styled-components";import{Fragment as Yv,jsx as Nn,jsxs as jv}from"react/jsx-runtime";var Hm=({icon:e})=>{let t=e;return Nn(Yv,{children:Nn(Kv,{children:jv("div",{children:[Nn(xt,{}),typeof t=="string"?Nn("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?Nn(t,{style:{width:"38px",height:"38px"}}):Nn("span",{})]})})})},Kv=$v.div`
815
815
  display: flex;
816
816
  flex-direction: column;
817
817
  justify-content: center;
@@ -834,14 +834,14 @@ Resources:
834
834
  left: -19px;
835
835
  top: -19px;
836
836
  }
837
- `;import{Fragment as r3,jsx as yr,jsxs as Gc}from"react/jsx-runtime";var zm=500,Vm=zm*2,qm=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:i}=x(),{status:a,token:l,waitForResult:s,reset:c,execute:u}=Ce(),h=Xv([]),f=Q=>{h.current=[Q,...h.current]},[y,w]=Dn(!0);Hc(()=>{let Q=setTimeout(w,Vm,!1);return f(Q),()=>{h.current.forEach(U=>clearTimeout(U)),h.current=[]}},[]);let[v,k]=Dn(""),[S,C]=Dn("Checking that you are a human..."),[R,P]=Dn(yr(W,{onClick:()=>{},disabled:!0,children:"Continue"})),[O,_]=Dn(!1),[D,K]=Dn(3),V=r?.captchaModalData,H=async Q=>{try{await V?.callback(Q),V?.onSuccessNavigateTo&&n(V?.onSuccessNavigateTo,!1)}catch(U){if(U instanceof mr)return;{let pe={error:U,previousScreen:e||"LANDING"};i({errorModalData:pe}),n(V?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};Hc(()=>{if(a==="success"){let Q=setTimeout(async()=>{let U=await s();!U||V?.userIntentRequired||H(U)},Vm);f(Q)}else if(a==="ready"){let Q=setTimeout(()=>{a==="ready"&&u()},zm);f(Q)}},[a]),Hc(()=>{if(!y)switch(a){case"success":k("Success!"),C("CAPTCHA passed successfully."),P(yr(W,{onClick:()=>{_(!0),H(l)},disabled:!V?.userIntentRequired,loading:O,children:V?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":k(""),C("Checking that you are a human..."),P(yr(W,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":k("Something went wrong"),D<=0?(C("If you use an adblocker or VPN, try disabling and re-attempting."),P(null)):(C("You did not pass CAPTCHA. Please try again."),P(yr(W,{onClick:I,children:"Retry"})));break;case"ready":default:break}},[a,y,O]);let I=async()=>{if(D<=0)return;K(U=>U-1),c(),u();let Q=await s();!Q||V?.userIntentRequired||H(Q)};return Gc(r3,{children:[yr(T,{backFn:!e||t===e?void 0:o}),Gc(t3,{children:[a==="success"?yr(Jv,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?yr(Qv,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):yr(Gm,{}),Gc($e,{children:[v?yr("h3",{children:v}):null,yr("p",{children:S})]}),R]}),yr(q,{})]})},t3=e3.div`
837
+ `;import{Fragment as t3,jsx as yr,jsxs as Gc}from"react/jsx-runtime";var Vm=500,Gm=Vm*2,zm=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:i}=x(),{status:a,token:l,waitForResult:s,reset:c,execute:u}=Ce(),h=Qv([]),f=Q=>{h.current=[Q,...h.current]},[y,w]=Dn(!0);Hc(()=>{let Q=setTimeout(w,Gm,!1);return f(Q),()=>{h.current.forEach(D=>clearTimeout(D)),h.current=[]}},[]);let[v,k]=Dn(""),[S,C]=Dn("Checking that you are a human..."),[R,P]=Dn(yr(W,{onClick:()=>{},disabled:!0,children:"Continue"})),[O,_]=Dn(!1),[F,K]=Dn(3),V=r?.captchaModalData,H=async Q=>{try{await V?.callback(Q),V?.onSuccessNavigateTo&&n(V?.onSuccessNavigateTo,!1)}catch(D){if(D instanceof mr)return;{let pe={error:D,previousScreen:e||"LANDING"};i({errorModalData:pe}),n(V?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};Hc(()=>{if(a==="success"){let Q=setTimeout(async()=>{let D=await s();!D||V?.userIntentRequired||H(D)},Gm);f(Q)}else if(a==="ready"){let Q=setTimeout(()=>{a==="ready"&&u()},Vm);f(Q)}},[a]),Hc(()=>{if(!y)switch(a){case"success":k("Success!"),C("CAPTCHA passed successfully."),P(yr(W,{onClick:()=>{_(!0),H(l)},disabled:!V?.userIntentRequired,loading:O,children:V?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":k(""),C("Checking that you are a human..."),P(yr(W,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":k("Something went wrong"),F<=0?(C("If you use an adblocker or VPN, try disabling and re-attempting."),P(null)):(C("You did not pass CAPTCHA. Please try again."),P(yr(W,{onClick:I,children:"Retry"})));break;case"ready":default:break}},[a,y,O]);let I=async()=>{if(F<=0)return;K(D=>D-1),c(),u();let Q=await s();!Q||V?.userIntentRequired||H(Q)};return Gc(t3,{children:[yr(T,{backFn:!e||t===e?void 0:o}),Gc(e3,{children:[a==="success"?yr(Zv,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?yr(Jv,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):yr(Hm,{}),Gc($e,{children:[v?yr("h3",{children:v}):null,yr("p",{children:S})]}),R]}),yr(q,{})]})},e3=Xv.div`
838
838
  display: flex;
839
839
  flex-direction: column;
840
840
  align-items: center;
841
841
  justify-content: center;
842
842
  gap: 24px;
843
843
  width: 100%;
844
- `;import o3 from"@heroicons/react/24/outline/WalletIcon";import{isMobile as n3}from"react-device-detect";import i3 from"styled-components";import{jsx as gr,jsxs as $m}from"react/jsx-runtime";var Km=({...e})=>$m("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[gr("defs",{children:$m("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:[gr("stop",{offset:"0",stopColor:"#f1562b"}),gr("stop",{offset:"0.3",stopColor:"#f1542b"}),gr("stop",{offset:"0.41",stopColor:"#f04d2a"}),gr("stop",{offset:"0.49",stopColor:"#ef4229"}),gr("stop",{offset:"0.5",stopColor:"#ef4029"}),gr("stop",{offset:"0.56",stopColor:"#e83e28"}),gr("stop",{offset:"0.67",stopColor:"#e13c26"}),gr("stop",{offset:"1",stopColor:"#df3c26"})]})}),gr("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"}),gr("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"})]});import{jsx as vr,jsxs as Bi}from"react/jsx-runtime";var jm=({style:e,...t})=>Bi("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:[vr("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"}),vr("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:vr("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"})}),Bi("g",{mask:"url(#mask0_16909_31415)",children:[vr("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"}),vr("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"}),vr("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"}}),vr("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"}})]}),Bi("defs",{children:[Bi("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[vr("stop",{"stop-color":"#002D72"}),vr("stop",{offset:"1","stop-color":"#002D72","stop-opacity":"0.01"})]}),Bi("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[vr("stop",{"stop-color":"#002D72","stop-opacity":"0.01"}),vr("stop",{offset:"1","stop-color":"#002D72"})]})]})]});import{jsx as te,jsxs as Bt}from"react/jsx-runtime";var Ym=({style:e,...t})=>Bt("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:[te("g",{clipPath:"url(#clip0_5_32)",children:Bt("g",{clipPath:"url(#clip1_5_32)",children:[te("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:te("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"})}),te("g",{mask:"url(#mask0_5_32)",children:te("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),te("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)"}),te("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),te("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),te("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),te("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),te("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),te("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)"}),te("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),te("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),Bt("defs",{children:[Bt("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[te("stop",{stopColor:"#174299"}),te("stop",{offset:"1",stopColor:"#001E59"})]}),Bt("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[te("stop",{offset:"0.770277",stopColor:"#FF4000"}),te("stop",{offset:"1",stopColor:"#8754C9"})]}),Bt("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[te("stop",{stopColor:"#FF4000"}),te("stop",{offset:"1",stopColor:"#8754C9"})]}),Bt("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[te("stop",{stopColor:"#8754C9"}),te("stop",{offset:"1",stopColor:"#FF4000"})]}),Bt("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[te("stop",{offset:"0.723929",stopColor:"#FFF700"}),te("stop",{offset:"1",stopColor:"#FF9901"})]}),Bt("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[te("stop",{stopColor:"#FFF700"}),te("stop",{offset:"1",stopColor:"#FF9901"})]}),Bt("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[te("stop",{stopColor:"#FFF700"}),te("stop",{offset:"1",stopColor:"#FF9901"})]}),Bt("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[te("stop",{offset:"0.59513",stopColor:"#00AAFF"}),te("stop",{offset:"1",stopColor:"#01DA40"})]}),Bt("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[te("stop",{stopColor:"#00AAFF"}),te("stop",{offset:"1",stopColor:"#01DA40"})]}),Bt("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:[te("stop",{stopColor:"#00AAFF"}),te("stop",{offset:"1",stopColor:"#01DA40"})]}),te("clipPath",{id:"clip0_5_32",children:te("rect",{width:"120",height:"120",fill:"white"})}),te("clipPath",{id:"clip1_5_32",children:te("rect",{width:"120",height:"120",fill:"white"})})]})]});import{jsx as Dr,jsxs as Zm}from"react/jsx-runtime";var Jm=({style:e,...t})=>Zm("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:[Dr("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),Zm("g",{filter:"url(#filter0_d_12393_20043)",children:[Dr("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"}),Dr("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"}),Dr("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"}),Dr("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"}),Dr("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"}),Dr("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"}),Dr("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"}),Dr("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"}),Dr("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"})]})]});import{jsx as Hi,jsxs as Qm}from"react/jsx-runtime";var Xm=({style:e,...t})=>Qm("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:[Qm("g",{clipPath:"url(#clip0_1704_1423)",children:[Hi("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"}),Hi("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"})]}),Hi("defs",{children:Hi("clipPath",{id:"clip0_1704_1423",children:Hi("rect",{width:"176",height:"176",fill:"white"})})})]});import{jsx as Fn,jsxs as d3}from"react/jsx-runtime";var Fr={coinbase_wallet:{logo:ls,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:xn,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:Ir,displayName:"Phantom"},rainbow:{logo:Ym,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Mi,displayName:"WalletConnect"},zerion:{logo:Xm,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:Km,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:jm,displayName:"Crypto.com DeFi Wallet"},uniswap:{logo:Jm,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="}},en=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:i}=x(),{connectWallet:a}=M(),l=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,s;return n.connectorType==="phantom"?s=()=>{mo()?(a(n,l),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(n3?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:s=()=>{a(n,l),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")},d3(c3,{onClick:s,children:[Fn(l3,{icon:s3(e,n.connectorType)??r,name:n.walletClientType}),Fn("span",{children:a3(e,n.connectorType)||t||n.walletClientType}),Fn("span",{id:"connect-text",children:"Connect"})]})},a3=(e,t)=>{if(Fr[e]?.displayName)return Fr[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},s3=(e,t)=>{if(Fr[e]?.logo)return Fr[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Mi},l3=({icon:e,name:t})=>typeof e=="string"?Fn("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?Fn(o3,{}):e?Fn(e,{}):null,c3=i3(Ae)`
844
+ `;import r3 from"@heroicons/react/24/outline/WalletIcon";import{isMobile as o3}from"react-device-detect";import n3 from"styled-components";import{jsx as gr,jsxs as qm}from"react/jsx-runtime";var $m=({...e})=>qm("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[gr("defs",{children:qm("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:[gr("stop",{offset:"0",stopColor:"#f1562b"}),gr("stop",{offset:"0.3",stopColor:"#f1542b"}),gr("stop",{offset:"0.41",stopColor:"#f04d2a"}),gr("stop",{offset:"0.49",stopColor:"#ef4229"}),gr("stop",{offset:"0.5",stopColor:"#ef4029"}),gr("stop",{offset:"0.56",stopColor:"#e83e28"}),gr("stop",{offset:"0.67",stopColor:"#e13c26"}),gr("stop",{offset:"1",stopColor:"#df3c26"})]})}),gr("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"}),gr("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"})]});import{jsx as vr,jsxs as Bi}from"react/jsx-runtime";var Km=({style:e,...t})=>Bi("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:[vr("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"}),vr("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:vr("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"})}),Bi("g",{mask:"url(#mask0_16909_31415)",children:[vr("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"}),vr("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"}),vr("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"}}),vr("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"}})]}),Bi("defs",{children:[Bi("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[vr("stop",{"stop-color":"#002D72"}),vr("stop",{offset:"1","stop-color":"#002D72","stop-opacity":"0.01"})]}),Bi("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[vr("stop",{"stop-color":"#002D72","stop-opacity":"0.01"}),vr("stop",{offset:"1","stop-color":"#002D72"})]})]})]});import{jsx as te,jsxs as Bt}from"react/jsx-runtime";var jm=({style:e,...t})=>Bt("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:[te("g",{clipPath:"url(#clip0_5_32)",children:Bt("g",{clipPath:"url(#clip1_5_32)",children:[te("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:te("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"})}),te("g",{mask:"url(#mask0_5_32)",children:te("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),te("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)"}),te("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),te("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),te("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),te("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),te("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),te("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)"}),te("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),te("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),Bt("defs",{children:[Bt("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[te("stop",{stopColor:"#174299"}),te("stop",{offset:"1",stopColor:"#001E59"})]}),Bt("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[te("stop",{offset:"0.770277",stopColor:"#FF4000"}),te("stop",{offset:"1",stopColor:"#8754C9"})]}),Bt("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[te("stop",{stopColor:"#FF4000"}),te("stop",{offset:"1",stopColor:"#8754C9"})]}),Bt("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[te("stop",{stopColor:"#8754C9"}),te("stop",{offset:"1",stopColor:"#FF4000"})]}),Bt("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[te("stop",{offset:"0.723929",stopColor:"#FFF700"}),te("stop",{offset:"1",stopColor:"#FF9901"})]}),Bt("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[te("stop",{stopColor:"#FFF700"}),te("stop",{offset:"1",stopColor:"#FF9901"})]}),Bt("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[te("stop",{stopColor:"#FFF700"}),te("stop",{offset:"1",stopColor:"#FF9901"})]}),Bt("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[te("stop",{offset:"0.59513",stopColor:"#00AAFF"}),te("stop",{offset:"1",stopColor:"#01DA40"})]}),Bt("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[te("stop",{stopColor:"#00AAFF"}),te("stop",{offset:"1",stopColor:"#01DA40"})]}),Bt("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:[te("stop",{stopColor:"#00AAFF"}),te("stop",{offset:"1",stopColor:"#01DA40"})]}),te("clipPath",{id:"clip0_5_32",children:te("rect",{width:"120",height:"120",fill:"white"})}),te("clipPath",{id:"clip1_5_32",children:te("rect",{width:"120",height:"120",fill:"white"})})]})]});import{jsx as Fr,jsxs as Ym}from"react/jsx-runtime";var Zm=({style:e,...t})=>Ym("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:[Fr("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),Ym("g",{filter:"url(#filter0_d_12393_20043)",children:[Fr("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"}),Fr("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"}),Fr("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"}),Fr("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"}),Fr("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"}),Fr("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"}),Fr("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"}),Fr("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"}),Fr("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"})]})]});import{jsx as Hi,jsxs as Jm}from"react/jsx-runtime";var Qm=({style:e,...t})=>Jm("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:[Jm("g",{clipPath:"url(#clip0_1704_1423)",children:[Hi("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"}),Hi("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"})]}),Hi("defs",{children:Hi("clipPath",{id:"clip0_1704_1423",children:Hi("rect",{width:"176",height:"176",fill:"white"})})})]});import{jsx as Fn,jsxs as c3}from"react/jsx-runtime";var Ur={coinbase_wallet:{logo:ls,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:xn,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:Ir,displayName:"Phantom"},rainbow:{logo:jm,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Mi,displayName:"WalletConnect"},zerion:{logo:Qm,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:$m,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:Km,displayName:"Crypto.com DeFi Wallet"},uniswap:{logo:Zm,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="}},en=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:i}=x(),{connectWallet:a}=M(),l=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,s;return n.connectorType==="phantom"?s=()=>{fo()?(a(n,l),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(o3?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:s=()=>{a(n,l),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")},c3(l3,{onClick:s,children:[Fn(s3,{icon:a3(e,n.connectorType)??r,name:n.walletClientType}),Fn("span",{children:i3(e,n.connectorType)||t||n.walletClientType}),Fn("span",{id:"connect-text",children:"Connect"})]})},i3=(e,t)=>{if(Ur[e]?.displayName)return Ur[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},a3=(e,t)=>{if(Ur[e]?.logo)return Ur[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Mi},s3=({icon:e,name:t})=>typeof e=="string"?Fn("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?Fn(r3,{}):e?Fn(e,{}):null,l3=n3(Ae)`
845
845
  /* Show "Connect" on hover */
846
846
  > #connect-text {
847
847
  font-weight: 500;
@@ -863,23 +863,23 @@ Resources:
863
863
  display: none;
864
864
  }
865
865
  }
866
- `;import{Fragment as h3,jsx as Un,jsxs as y3}from"react/jsx-runtime";var p3=["coinbase_wallet"],u3=["metamask","okx_wallet","rainbow","uniswap","zerion"],m3=["cryptocom"],f3=["phantom"],Bn=({connectOnly:e})=>{let{connectors:t}=M(),{app:r}=x(),o=Gi(r.appearance.walletList,t,e,r.appearance.walletList);return y3(h3,{children:[...o]})},Gi=(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:h})=>h==="uniswap_wallet_extension"?!o.includes("uniswap"):u==="injected"&&!o.includes(h));for(let u of c){let{walletClientType:h,walletBranding:f}=u;(h==="unknown"?i:n).push(Un(en,{connectOnly:r,provider:h,logo:f.icon,displayName:f.name,connector:u},`${s}-${h}`))}}else if(f3.includes(s)){let c=t.find(u=>u.connectorType==="injected"&&u.walletClientType===s||u.connectorType===s);c&&n.push(Un(en,{connectOnly:r,provider:s,connector:c},s))}else if(u3.includes(s)){let c=t.find(u=>s==="uniswap"?u.walletClientType==="uniswap_wallet_extension":u.connectorType==="injected"&&u.walletClientType===s)??l;c&&n.push(Un(en,{connectOnly:r,provider:s,connector:c},s))}else if(p3.includes(s)){let c=t.find(({connectorType:u})=>u===s);c&&n.push(Un(en,{connectOnly:r,provider:s,connector:c},s))}else m3.includes(s)?l&&a.push(Un(en,{connectOnly:r,provider:s,connector:l},s)):s==="wallet_connect"&&l&&a.push(Un(en,{connectOnly:r,provider:s,connector:l},s));return[...i,...n,...a]};import{Fragment as g3,jsx as Vi,jsxs as v3}from"react/jsx-runtime";var ef=()=>{let{app:e}=x(),t=`Connect a wallet to ${e?.name}`;return v3(g3,{children:[Vi(T,{},"header"),Vi(Nr,{title:"Connect your wallet",description:t}),Vi(nr,{children:Vi(Bn,{connectOnly:!0})}),Vi(z,{protectedByPrivy:!0})]})};import T3 from"styled-components";import b3 from"styled-components";import C3 from"react";import{jsx as w3}from"react/jsx-runtime";var tf=()=>{let{app:e}=x(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?w3("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?C3.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};import{jsx as rf}from"react/jsx-runtime";var Hn=e=>{let{app:t}=x();return t?.appearance.logo?rf(E3,{...e,children:rf(tf,{})}):null},E3=b3.div`
866
+ `;import{Fragment as f3,jsx as Un,jsxs as h3}from"react/jsx-runtime";var d3=["coinbase_wallet"],p3=["metamask","okx_wallet","rainbow","uniswap","zerion"],u3=["cryptocom"],m3=["phantom"],Bn=({connectOnly:e})=>{let{connectors:t}=M(),{app:r}=x(),o=Gi(r.appearance.walletList,t,e,r.appearance.walletList);return h3(f3,{children:[...o]})},Gi=(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:h})=>h==="uniswap_wallet_extension"?!o.includes("uniswap"):u==="injected"&&!o.includes(h));for(let u of c){let{walletClientType:h,walletBranding:f}=u;(h==="unknown"?i:n).push(Un(en,{connectOnly:r,provider:h,logo:f.icon,displayName:f.name,connector:u},`${s}-${h}`))}}else if(m3.includes(s)){let c=t.find(u=>u.connectorType==="injected"&&u.walletClientType===s||u.connectorType===s);c&&n.push(Un(en,{connectOnly:r,provider:s,connector:c},s))}else if(p3.includes(s)){let c=t.find(u=>s==="uniswap"?u.walletClientType==="uniswap_wallet_extension":u.connectorType==="injected"&&u.walletClientType===s)??l;c&&n.push(Un(en,{connectOnly:r,provider:s,connector:c},s))}else if(d3.includes(s)){let c=t.find(({connectorType:u})=>u===s);c&&n.push(Un(en,{connectOnly:r,provider:s,connector:c},s))}else u3.includes(s)?l&&a.push(Un(en,{connectOnly:r,provider:s,connector:l},s)):s==="wallet_connect"&&l&&a.push(Un(en,{connectOnly:r,provider:s,connector:l},s));return[...i,...n,...a]};import{Fragment as y3,jsx as Vi,jsxs as g3}from"react/jsx-runtime";var Xm=()=>{let{app:e}=x(),t=`Connect a wallet to ${e?.name}`;return g3(y3,{children:[Vi(T,{},"header"),Vi(Dr,{title:"Connect your wallet",description:t}),Vi(nr,{children:Vi(Bn,{connectOnly:!0})}),Vi(z,{protectedByPrivy:!0})]})};import E3 from"styled-components";import w3 from"styled-components";import v3 from"react";import{jsx as C3}from"react/jsx-runtime";var ef=()=>{let{app:e}=x(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?C3("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?v3.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};import{jsx as tf}from"react/jsx-runtime";var Hn=e=>{let{app:t}=x();return t?.appearance.logo?tf(b3,{...e,children:tf(ef,{})}):null},b3=w3.div`
867
867
  display: flex;
868
868
  flex-direction: column;
869
869
  align-items: center;
870
870
  padding: 24px 0;
871
871
  flex-grow: 1;
872
872
  justify-content: center;
873
- `;import{Fragment as S3,jsx as Gn,jsxs as x3}from"react/jsx-runtime";var of=()=>{let{app:e}=x();return x3(S3,{children:[Gn(T,{},"header"),Gn(P3,{}),Gn(nr,{children:Gn(Bn,{connectOnly:!0})}),e&&Gn(Mn,{app:e,alwaysShowImplicitConsent:!0}),Gn(z,{protectedByPrivy:!0})]})},P3=T3(Hn)`
873
+ `;import{Fragment as P3,jsx as Gn,jsxs as S3}from"react/jsx-runtime";var rf=()=>{let{app:e}=x();return S3(P3,{children:[Gn(T,{},"header"),Gn(T3,{}),Gn(nr,{children:Gn(Bn,{connectOnly:!0})}),e&&Gn(Mn,{app:e,alwaysShowImplicitConsent:!0}),Gn(z,{protectedByPrivy:!0})]})},T3=E3(Hn)`
874
874
  margin-bottom: 16px;
875
- `;import{useEffect as pf,useState as uf}from"react";import{isMobile as L3}from"react-device-detect";import O3 from"styled-components";import{useEffect as Vc,useState as tn}from"react";import{isMobile as Js}from"react-device-detect";import lf from"styled-components";import{useEffect as nf,useRef as k3}from"react";var _3=(e,t)=>{let r=k3(()=>{});nf(()=>{r.current=e}),nf(()=>{if(t!==null){let o=setInterval(()=>r.current(),t||0);return()=>clearInterval(o)}},[t])},af=_3;import{useState as A3,useEffect as R3,useCallback as I3}from"react";function sf(){let[e,t]=A3(!1),r=I3(()=>{document.hidden&&t(!0)},[]);return R3(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}import{Fragment as df,jsx as et,jsxs as zi}from"react/jsx-runtime";var zc=2,qc=e=>e?.privyErrorCode==="linked_to_another_user"?Jr.ERROR_USER_EXISTS:e instanceof Ne&&!e.details.default?e.details:e instanceof bn?Jr.ERROR_TIMED_OUT:e instanceof En?Jr.ERROR_USER_REJECTED_CONNECTION:Jr.ERROR_WALLET_CONNECTION,cf=()=>{let[e,t]=tn(!1),[r,o]=tn(!1),[n,i]=tn(void 0),{authenticated:a,logout:l}=B(),{app:s,navigate:c,navigateBack:u,lastScreen:h,currentScreen:f,setModalData:y}=x(),{getAuthFlow:w,walletConnectionStatus:v,closePrivyModal:k,initLoginWithWallet:S,loginWithWallet:C,updateWallets:R,createAnalyticsEvent:P}=M(),{walletConnectors:O}=B(),[_,D]=tn(0),{user:K}=B(),[V]=tn(K?.linkedAccounts.length||0),[H,I]=tn(""),[Q,U]=tn(!1),{hasTabbedAway:pe}=sf(),{enabled:me,token:ae}=Ce(),Ee=Js&&v?.connector?.connectorType==="wallet_connect_v2"||Js&&v?.connector?.connectorType==="coinbase_wallet"||Js&&v?.connector?.connectorType==="injected"&&v?.connector?.walletClientType==="phantom",J=v?.status==="connected",jt=v?.status==="switching_to_supported_chain";Vc(()=>{let G=w();if(J&&!G&&(me&&!ae&&!a?(y({captchaModalData:{callback:fe=>S(v.connectedWallet,fe).then(()=>{U(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN",!1)):S(v.connectedWallet,ae).then(()=>{U(!0)})),G&&Ee&&J&&!G.preparedMessage){G.buildSiweMessage();return}!G||Ee||!J||r||(async()=>{o(!0),i(void 0);try{v?.connector?.connectorType==="wallet_connect_v2"&&v?.connector?.walletClientType==="metamask"&&await hc(2500),await Yt()}catch(fe){console.warn("Auto-prompted signature failed",fe)}finally{o(!1)}})()},[_,J,Q]),Vc(()=>{if(K&&e){let G=s?.render.inDialog?Be:0,fe=s?.render.inDialog?G-500:0;if(s?.legal.requireUsersAcceptTerms&&!K.hasAcceptedTerms){let Do=setTimeout(()=>{c("AFFIRMATIVE_CONSENT_SCREEN")},fe);return()=>clearTimeout(Do)}if(tr(K,s?.embeddedWallets?.createOnLogin)){let Do=setTimeout(()=>{y({createWallet:{onSuccess:()=>{},onFailure:ht=>{console.error(ht),P({eventName:"embedded_wallet_creation_failure_logout",payload:{error:ht,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),c("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},fe);return()=>clearTimeout(Do)}R();let Zt=setTimeout(()=>k({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Be);return()=>clearTimeout(Zt)}},[K,e]);let Lt=G=>{if(G?.privyErrorCode==="allowlist_rejected"){c("ALLOWLIST_REJECTION_SCREEN");return}else if(G?.privyErrorCode==="max_accounts_reached"){console.error(new kr(G).toString()),c("USER_LIMIT_REACHED_SCREEN");return}i(qc(G))};async function Yt(){try{if(await C(),!s?.render.inDialog)return k({shouldCallAuthOnSuccess:!0,isSuccess:!0});t(!0)}catch(G){Lt(G)}finally{o(!1)}}Vc(()=>{v?.connectError&&Lt(v?.connectError)},[v]),af(()=>{let G=lt==="wallet_connect_v2"&&v?.connector instanceof Mr?v.connector.redirectUri:void 0;G&&I(G)},v?.connector instanceof Mr&&!H?500:null);let lt=v?.connector?.connectorType||"injected",Sr=v?.connector?.walletClientType||"unknown",Le=Fr[Sr]?.displayName||v?.connector?.walletBranding.name||"Browser Extension",hn=Fr[Sr]?.logo||v?.connector?.walletBranding.icon||(G=>et(Sn,{...G})),xr=Le==="Browser Extension"?Le.toLowerCase():Le,Pt;e?Pt=`Successfully connected with ${xr}`:n?Pt=n.message:jt?Pt="Switching networks":J?Pt=r&&Ee?"Signing":"Sign to verify":Pt=`Waiting for ${xr}`;let Fe="Don\u2019t see your wallet? Check your other browser windows.";if(e){let G=K?.linkedAccounts.length||0;V===G?Fe="Wallet was already linked.":Fe="You\u2019re good to go!"}else _>=zc&&n?Fe="Unable to connect wallet":n?Fe=n.detail:jt?Fe="Switch your wallet to the requested network.":J&&Ee?Fe="Sign the message in your wallet to verify it belongs to you.":Sr==="metamask"&&Js?Fe="Click continue to open and connect MetaMask.":Sr==="metamask"?Fe="For the best experience, connect only one wallet at a time.":lt==="wallet_connect"?Fe="Open your mobile wallet app to continue":lt==="coinbase_wallet"&&(zp()||(Ec(K)?Fe="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":Fe="Open the Coinbase app on your phone to continue."));let L=O?.walletConnectors?.find(G=>G.walletClientType==="coinbase_wallet"),oe=Sr==="coinbase_wallet"&&(Ec(K)||n===Jr.ERROR_USER_EXISTS);return zi(df,{children:[et(T,{backFn:!h||f===h?void 0:u}),zi(M3,{children:[et($c,{walletLogo:hn,success:e,fail:!!n}),zi($e,{children:[et("h3",{children:Pt}),et("p",{children:Fe}),!J&&H&&!pe?zi("p",{children:["Still here?"," ",et("a",{href:H,target:"_blank",style:{textDecoration:"underline"},children:"Try again"})]}):null]}),oe?et(W,{onClick:()=>L&&L?.disconnect(),disabled:e,children:"Use a different wallet"}):n==Jr.ERROR_USER_EXISTS&&f!==h?et(W,{onClick:u,children:"Use a different wallet"}):J&&!e&&Ee?et(W,{onClick:()=>{o(!0),Yt()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&_<zc?et(W,{onClick:()=>{D(_+1),i(void 0),J?(o(!0),Yt()):v?.connectRetry()},disabled:!e&&(!n?.retryable||_>=zc),children:"Retry"}):!e&&!n?et(W,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),et(q,{})]})},M3=lf.div`
875
+ `;import{useEffect as df,useState as pf}from"react";import{isMobile as W3}from"react-device-detect";import L3 from"styled-components";import{useEffect as Vc,useState as tn}from"react";import{isMobile as Js}from"react-device-detect";import sf from"styled-components";import{useEffect as of,useRef as x3}from"react";var k3=(e,t)=>{let r=x3(()=>{});of(()=>{r.current=e}),of(()=>{if(t!==null){let o=setInterval(()=>r.current(),t||0);return()=>clearInterval(o)}},[t])},nf=k3;import{useState as _3,useEffect as A3,useCallback as R3}from"react";function af(){let[e,t]=_3(!1),r=R3(()=>{document.hidden&&t(!0)},[]);return A3(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}import{Fragment as cf,jsx as et,jsxs as zi}from"react/jsx-runtime";var zc=2,qc=e=>e?.privyErrorCode==="linked_to_another_user"?Qr.ERROR_USER_EXISTS:e instanceof Ne&&!e.details.default?e.details:e instanceof bn?Qr.ERROR_TIMED_OUT:e instanceof En?Qr.ERROR_USER_REJECTED_CONNECTION:Qr.ERROR_WALLET_CONNECTION,lf=()=>{let[e,t]=tn(!1),[r,o]=tn(!1),[n,i]=tn(void 0),{authenticated:a,logout:l}=B(),{app:s,navigate:c,navigateBack:u,lastScreen:h,currentScreen:f,setModalData:y}=x(),{getAuthFlow:w,walletConnectionStatus:v,closePrivyModal:k,initLoginWithWallet:S,loginWithWallet:C,updateWallets:R,createAnalyticsEvent:P}=M(),{walletConnectors:O}=B(),[_,F]=tn(0),{user:K}=B(),[V]=tn(K?.linkedAccounts.length||0),[H,I]=tn(""),[Q,D]=tn(!1),{hasTabbedAway:pe}=af(),{enabled:me,token:ae}=Ce(),Ee=Js&&v?.connector?.connectorType==="wallet_connect_v2"||Js&&v?.connector?.connectorType==="coinbase_wallet"||Js&&v?.connector?.connectorType==="injected"&&v?.connector?.walletClientType==="phantom",J=v?.status==="connected",jt=v?.status==="switching_to_supported_chain";Vc(()=>{let G=w();if(J&&!G&&(me&&!ae&&!a?(y({captchaModalData:{callback:fe=>S(v.connectedWallet,fe).then(()=>{D(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN",!1)):S(v.connectedWallet,ae).then(()=>{D(!0)})),G&&Ee&&J&&!G.preparedMessage){G.buildSiweMessage();return}!G||Ee||!J||r||(async()=>{o(!0),i(void 0);try{v?.connector?.connectorType==="wallet_connect_v2"&&v?.connector?.walletClientType==="metamask"&&await hc(2500),await Yt()}catch(fe){console.warn("Auto-prompted signature failed",fe)}finally{o(!1)}})()},[_,J,Q]),Vc(()=>{if(K&&e){let G=s?.render.inDialog?Be:0,fe=s?.render.inDialog?G-500:0;if(s?.legal.requireUsersAcceptTerms&&!K.hasAcceptedTerms){let Do=setTimeout(()=>{c("AFFIRMATIVE_CONSENT_SCREEN")},fe);return()=>clearTimeout(Do)}if(tr(K,s?.embeddedWallets?.createOnLogin)){let Do=setTimeout(()=>{y({createWallet:{onSuccess:()=>{},onFailure:ht=>{console.error(ht),P({eventName:"embedded_wallet_creation_failure_logout",payload:{error:ht,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),c("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},fe);return()=>clearTimeout(Do)}R();let Zt=setTimeout(()=>k({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Be);return()=>clearTimeout(Zt)}},[K,e]);let Lt=G=>{if(G?.privyErrorCode==="allowlist_rejected"){c("ALLOWLIST_REJECTION_SCREEN");return}else if(G?.privyErrorCode==="max_accounts_reached"){console.error(new kr(G).toString()),c("USER_LIMIT_REACHED_SCREEN");return}i(qc(G))};async function Yt(){try{if(await C(),!s?.render.inDialog)return k({shouldCallAuthOnSuccess:!0,isSuccess:!0});t(!0)}catch(G){Lt(G)}finally{o(!1)}}Vc(()=>{v?.connectError&&Lt(v?.connectError)},[v]),nf(()=>{let G=lt==="wallet_connect_v2"&&v?.connector instanceof Wr?v.connector.redirectUri:void 0;G&&I(G)},v?.connector instanceof Wr&&!H?500:null);let lt=v?.connector?.connectorType||"injected",Sr=v?.connector?.walletClientType||"unknown",Le=Ur[Sr]?.displayName||v?.connector?.walletBranding.name||"Browser Extension",hn=Ur[Sr]?.logo||v?.connector?.walletBranding.icon||(G=>et(Sn,{...G})),xr=Le==="Browser Extension"?Le.toLowerCase():Le,Pt;e?Pt=`Successfully connected with ${xr}`:n?Pt=n.message:jt?Pt="Switching networks":J?Pt=r&&Ee?"Signing":"Sign to verify":Pt=`Waiting for ${xr}`;let Fe="Don\u2019t see your wallet? Check your other browser windows.";if(e){let G=K?.linkedAccounts.length||0;V===G?Fe="Wallet was already linked.":Fe="You\u2019re good to go!"}else _>=zc&&n?Fe="Unable to connect wallet":n?Fe=n.detail:jt?Fe="Switch your wallet to the requested network.":J&&Ee?Fe="Sign the message in your wallet to verify it belongs to you.":Sr==="metamask"&&Js?Fe="Click continue to open and connect MetaMask.":Sr==="metamask"?Fe="For the best experience, connect only one wallet at a time.":lt==="wallet_connect"?Fe="Open your mobile wallet app to continue":lt==="coinbase_wallet"&&(Vp()||(Ec(K)?Fe="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":Fe="Open the Coinbase app on your phone to continue."));let L=O?.walletConnectors?.find(G=>G.walletClientType==="coinbase_wallet"),oe=Sr==="coinbase_wallet"&&(Ec(K)||n===Qr.ERROR_USER_EXISTS);return zi(cf,{children:[et(T,{backFn:!h||f===h?void 0:u}),zi(I3,{children:[et($c,{walletLogo:hn,success:e,fail:!!n}),zi($e,{children:[et("h3",{children:Pt}),et("p",{children:Fe}),!J&&H&&!pe?zi("p",{children:["Still here?"," ",et("a",{href:H,target:"_blank",style:{textDecoration:"underline"},children:"Try again"})]}):null]}),oe?et(W,{onClick:()=>L&&L?.disconnect(),disabled:e,children:"Use a different wallet"}):n==Qr.ERROR_USER_EXISTS&&f!==h?et(W,{onClick:u,children:"Use a different wallet"}):J&&!e&&Ee?et(W,{onClick:()=>{o(!0),Yt()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&_<zc?et(W,{onClick:()=>{F(_+1),i(void 0),J?(o(!0),Yt()):v?.connectRetry()},disabled:!e&&(!n?.retryable||_>=zc),children:"Retry"}):!e&&!n?et(W,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),et(q,{})]})},I3=sf.div`
876
876
  display: flex;
877
877
  flex-direction: column;
878
878
  align-items: center;
879
879
  justify-content: center;
880
880
  gap: 24px;
881
881
  width: 100%;
882
- `,W3=lf.div`
882
+ `,M3=sf.div`
883
883
  display: flex;
884
884
  flex-direction: column;
885
885
  justify-content: center;
@@ -902,14 +902,14 @@ Resources:
902
902
  left: -19px;
903
903
  top: -19px;
904
904
  }
905
- `,$c=e=>{let t=e.walletLogo;return et(df,{children:et(W3,{children:zi("div",{children:[et(xt,{success:e.success,fail:e.fail}),typeof t=="string"?et("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):et(t,{style:{width:"38px",height:"38px"}})]})})})};import{Fragment as D3,jsx as to,jsxs as Kc}from"react/jsx-runtime";var Qs=2,mf=()=>{let{navigateBack:e,lastScreen:t,currentScreen:r}=x(),{walletConnectionStatus:o,closePrivyModal:n}=M(),[i,a]=uf(void 0),[l,s]=uf(0),c=o?.status==="connected",u=o?.status==="switching_to_supported_chain";pf(()=>{if(c){let R=setTimeout(n,Be);return()=>clearTimeout(R)}},[c]);let h=R=>{a(qc(R))};pf(()=>{o?.connectError&&h(o?.connectError)},[o]);let f=o?.connector?.connectorType||"injected",y=o?.connector?.walletClientType||"unknown",w=Fr[y]?.displayName||o?.connector?.walletBranding.name||"Browser Extension",v=Fr[y]?.logo||o?.connector?.walletBranding.icon||(R=>to(Sn,{...R})),k=w==="Browser Extension"?w.toLowerCase():w,S;c?S=`Successfully connected with ${k}`:i?S=i.message:u?S="Switching networks":S=`Waiting for ${k}`;let C="Don\u2019t see your wallet? Check your other browser windows.";return c?C="You\u2019re good to go!":l>=Qs&&i?C="Unable to connect wallet":i?C=i.detail:u?C="Switch your wallet to the requested network.":y==="metamask"&&L3?C="Click to continue to open and connect MetaMask.":y==="metamask"?C="For the best experience, connect only one wallet at a time.":f==="wallet_connect_v2"?C="Open your mobile wallet app to continue":f==="coinbase_wallet"&&(C="Open the Coinbase app on your phone to continue."),Kc(D3,{children:[to(T,{backFn:r===t?void 0:e}),Kc(N3,{children:[to($c,{walletLogo:v,success:c,fail:!!i}),Kc($e,{children:[to("h3",{children:S}),to("p",{children:C})]}),i==Jr.ERROR_USER_EXISTS?to(W,{onClick:e,children:"Use a different wallet"}):!c&&i?.retryable&&l<Qs?to(W,{onClick:()=>{s(l+1),a(void 0),o?.connectRetry()},disabled:!c&&(!i?.retryable||l>=Qs),children:"Retry"}):!c&&i&&l>=Qs?to(W,{onClick:e,children:"Use a different wallet"}):null]}),to(q,{})]})},N3=O3.div`
905
+ `,$c=e=>{let t=e.walletLogo;return et(cf,{children:et(M3,{children:zi("div",{children:[et(xt,{success:e.success,fail:e.fail}),typeof t=="string"?et("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):et(t,{style:{width:"38px",height:"38px"}})]})})})};import{Fragment as N3,jsx as ro,jsxs as Kc}from"react/jsx-runtime";var Qs=2,uf=()=>{let{navigateBack:e,lastScreen:t,currentScreen:r}=x(),{walletConnectionStatus:o,closePrivyModal:n}=M(),[i,a]=pf(void 0),[l,s]=pf(0),c=o?.status==="connected",u=o?.status==="switching_to_supported_chain";df(()=>{if(c){let R=setTimeout(n,Be);return()=>clearTimeout(R)}},[c]);let h=R=>{a(qc(R))};df(()=>{o?.connectError&&h(o?.connectError)},[o]);let f=o?.connector?.connectorType||"injected",y=o?.connector?.walletClientType||"unknown",w=Ur[y]?.displayName||o?.connector?.walletBranding.name||"Browser Extension",v=Ur[y]?.logo||o?.connector?.walletBranding.icon||(R=>ro(Sn,{...R})),k=w==="Browser Extension"?w.toLowerCase():w,S;c?S=`Successfully connected with ${k}`:i?S=i.message:u?S="Switching networks":S=`Waiting for ${k}`;let C="Don\u2019t see your wallet? Check your other browser windows.";return c?C="You\u2019re good to go!":l>=Qs&&i?C="Unable to connect wallet":i?C=i.detail:u?C="Switch your wallet to the requested network.":y==="metamask"&&W3?C="Click to continue to open and connect MetaMask.":y==="metamask"?C="For the best experience, connect only one wallet at a time.":f==="wallet_connect_v2"?C="Open your mobile wallet app to continue":f==="coinbase_wallet"&&(C="Open the Coinbase app on your phone to continue."),Kc(N3,{children:[ro(T,{backFn:r===t?void 0:e}),Kc(O3,{children:[ro($c,{walletLogo:v,success:c,fail:!!i}),Kc($e,{children:[ro("h3",{children:S}),ro("p",{children:C})]}),i==Qr.ERROR_USER_EXISTS?ro(W,{onClick:e,children:"Use a different wallet"}):!c&&i?.retryable&&l<Qs?ro(W,{onClick:()=>{s(l+1),a(void 0),o?.connectRetry()},disabled:!c&&(!i?.retryable||l>=Qs),children:"Retry"}):!c&&i&&l>=Qs?ro(W,{onClick:e,children:"Use a different wallet"}):null]}),ro(q,{})]})},O3=L3.div`
906
906
  display: flex;
907
907
  flex-direction: column;
908
908
  align-items: center;
909
909
  justify-content: center;
910
910
  gap: 24px;
911
911
  width: 100%;
912
- `;import z3 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as q3,useMemo as $3,useState as K3}from"react";import j3 from"styled-components";import Xs from"styled-components";import{jsx as jc,jsxs as G3}from"react/jsx-runtime";var Vn=()=>jc(F3,{children:G3(U3,{children:[jc(B3,{}),jc(H3,{})]})}),F3=Xs.div`
912
+ `;import V3 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as z3,useMemo as q3,useState as $3}from"react";import K3 from"styled-components";import Xs from"styled-components";import{jsx as jc,jsxs as H3}from"react/jsx-runtime";var Vn=()=>jc(D3,{children:H3(F3,{children:[jc(U3,{}),jc(B3,{})]})}),D3=Xs.div`
913
913
  display: flex;
914
914
  justify-content: center;
915
915
  align-items: center;
@@ -921,14 +921,14 @@ Resources:
921
921
  @media all and (display-mode: standalone) {
922
922
  margin-bottom: 30px;
923
923
  }
924
- `,U3=Xs.div`
924
+ `,F3=Xs.div`
925
925
  position: relative;
926
926
  height: 140px;
927
927
  width: 140px;
928
928
 
929
929
  opacity: 1;
930
930
  animation: fadein 200ms ease;
931
- `,B3=Xs.div`
931
+ `,U3=Xs.div`
932
932
  position: absolute;
933
933
  top: 0;
934
934
  right: 0;
@@ -941,7 +941,7 @@ Resources:
941
941
  border: 4px solid var(--privy-color-accent-light);
942
942
  border-radius: 50%;
943
943
  }
944
- `,H3=Xs.div`
944
+ `,B3=Xs.div`
945
945
  position: absolute;
946
946
  top: 0;
947
947
  right: 0;
@@ -965,20 +965,20 @@ Resources:
965
965
  transform: rotate(360deg);
966
966
  }
967
967
  }
968
- `;var ff=["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 xe=class extends Error{constructor(r,o){super(o);this.type=r}};function zn(e){let t=e.type;return typeof t=="string"&&ff.includes(t)}function V3(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function qn(e){return zn(e)&&e.type==="wallet_not_on_device"}function hf(e){return zn(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function rn(e){return!!(zn(e)&&e.type==="mfa_timeout")}function on(e){return!!(zn(e)&&e.type==="missing_or_invalid_mfa")}function Yc(e){return!!(zn(e)&&e.type==="mfa_verification_max_attempts_reached")}function el(e){return!!(zn(e)&&e.message.includes("code 429"))}function tl(e){return!!(V3(e)&&e.message==="MFA canceled")}function yf(e,t){return t.length>1?"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN":e==="create"?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function rl(e){switch(e){case"user-passcode":return"EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN";case"google-drive":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";default:throw new Error("Recovery method not supported")}}async function gf({api:e,provider:t}){let r=Si(),o=Ya(),n=await Za(r);try{return{url:(await e.post(Ip,{redirect_to:window.location.href,code_challenge:n,state_code:o,provider:t})).url,codeVerifier:r,stateCode:o}}catch(i){throw ce(i)}}async function vf({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(Mp,{authorization_code:n,state_code:r,code_verifier:o,provider:t})).access_token}catch(i){let a=ce(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")}}import{Fragment as wf,jsx as $n,jsxs as Zc}from"react/jsx-runtime";var Cf=1,bf=()=>{let{authenticated:e,user:t,getAccessToken:r}=B(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:i}=M(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:c}=x(),u=$3(()=>Date.now(),[]),[h,f]=K3(!1),{onCompleteNavigateTo:y,onFailure:w,shouldForceMFA:v}=l?.connectWallet,k=C=>{h||(f(!0),w(typeof C=="string"?new Error(C):C))};q3(()=>{let C=Se(t),R;return!e||!C?k("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let O=await r();if(!O)return k("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:O,address:C.address}),v&&await i.verifyMfa({accessToken:O});let _=(Date.now()-u)/1e3;y==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&_<Cf?R=setTimeout(()=>{a(y)},(Cf-_)*1e3):a(y)}catch(_){if(qn(_)&&C.recoveryMethod==="privy"){let D=await r();if(!D)return k("User must be authenticated and have a Privy wallet before it can be recovered");try{n({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:C.address}}),(await i?.recover({address:C.address,accessToken:D}))?.address||k(new Error("Unable to recover wallet")),y?a(y):o({shouldCallAuthOnSuccess:!1}),n({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:C.address}}),a(y)}catch{k("An error has occurred, please try again.")}}else if(qn(_)){s({...l,recoverWallet:{privyWallet:C,onCompleteNavigateTo:y,onFailure:w},recoveryOAuthStatus:{provider:"google-drive",action:"recover",isInAccountCreateFlow:!1}});let D=rl(C.recoveryMethod);a(D)}else k(_)}})(),()=>clearTimeout(R)):void 0},[e,t,i]);let S=()=>{k("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return c.current=S,Zc(wf,{children:[$n(T,{onClose:S}),h?Zc(wf,{children:[Zc(hr,{children:[$n(z3,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),$n(Te,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),$n(W,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):$n(Vn,{}),$n(Y3,{})]})},Y3=j3.div`
968
+ `;var mf=["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 xe=class extends Error{constructor(r,o){super(o);this.type=r}};function zn(e){let t=e.type;return typeof t=="string"&&mf.includes(t)}function G3(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function qn(e){return zn(e)&&e.type==="wallet_not_on_device"}function ff(e){return zn(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function rn(e){return!!(zn(e)&&e.type==="mfa_timeout")}function on(e){return!!(zn(e)&&e.type==="missing_or_invalid_mfa")}function Yc(e){return!!(zn(e)&&e.type==="mfa_verification_max_attempts_reached")}function el(e){return!!(zn(e)&&e.message.includes("code 429"))}function tl(e){return!!(G3(e)&&e.message==="MFA canceled")}function hf(e,t){return t.length>1?"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN":e==="create"?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function rl(e){switch(e){case"user-passcode":return"EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN";case"google-drive":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";default:throw new Error("Recovery method not supported")}}async function yf({api:e,provider:t}){let r=Si(),o=Ya(),n=await Za(r);try{return{url:(await e.post(Rp,{redirect_to:window.location.href,code_challenge:n,state_code:o,provider:t})).url,codeVerifier:r,stateCode:o}}catch(i){throw ce(i)}}async function gf({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(Ip,{authorization_code:n,state_code:r,code_verifier:o,provider:t})).access_token}catch(i){let a=ce(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")}}import{Fragment as Cf,jsx as $n,jsxs as Zc}from"react/jsx-runtime";var vf=1,wf=()=>{let{authenticated:e,user:t,getAccessToken:r}=B(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:i}=M(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:c}=x(),u=q3(()=>Date.now(),[]),[h,f]=$3(!1),{onCompleteNavigateTo:y,onFailure:w,shouldForceMFA:v}=l?.connectWallet,k=C=>{h||(f(!0),w(typeof C=="string"?new Error(C):C))};z3(()=>{let C=Se(t),R;return!e||!C?k("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let O=await r();if(!O)return k("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:O,address:C.address}),v&&await i.verifyMfa({accessToken:O});let _=(Date.now()-u)/1e3;y==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&_<vf?R=setTimeout(()=>{a(y)},(vf-_)*1e3):a(y)}catch(_){if(qn(_)&&C.recoveryMethod==="privy"){let F=await r();if(!F)return k("User must be authenticated and have a Privy wallet before it can be recovered");try{n({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:C.address}}),(await i?.recover({address:C.address,accessToken:F}))?.address||k(new Error("Unable to recover wallet")),y?a(y):o({shouldCallAuthOnSuccess:!1}),n({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:C.address}}),a(y)}catch{k("An error has occurred, please try again.")}}else if(qn(_)){s({...l,recoverWallet:{privyWallet:C,onCompleteNavigateTo:y,onFailure:w},recoveryOAuthStatus:{provider:"google-drive",action:"recover",isInAccountCreateFlow:!1}});let F=rl(C.recoveryMethod);a(F)}else k(_)}})(),()=>clearTimeout(R)):void 0},[e,t,i]);let S=()=>{k("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return c.current=S,Zc(Cf,{children:[$n(T,{onClose:S}),h?Zc(Cf,{children:[Zc(hr,{children:[$n(V3,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),$n(Te,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),$n(W,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):$n(Vn,{}),$n(j3,{})]})},j3=K3.div`
969
969
  height: 44px;
970
- `;import Z3 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as J3}from"react";import{Fragment as Q3,jsx as Kn,jsxs as Ef}from"react/jsx-runtime";var Tf=()=>{let{user:e}=B(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=M(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=x(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:c}=i.createWallet,u=()=>{let h=Se(e);h?(o(),l(h)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return J3(()=>{let h=setTimeout(u,jp);return()=>clearTimeout(h)},[]),a.current=u,Ef(Q3,{children:[Kn(T,{onClose:u}),Kn(X,{}),Ef(hr,{children:[Kn(Z3,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),Kn(Te,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),Kn(ie,{}),Kn(z,{protectedByPrivy:!0})]})};import X3 from"@heroicons/react/20/solid/ExclamationTriangleIcon";import e0 from"@heroicons/react/24/outline/ArrowRightOnRectangleIcon";import{useEffect as xf,useRef as t0,useState as Jc}from"react";import wo from"styled-components";import{Fragment as d0,jsx as He,jsxs as Cr}from"react/jsx-runtime";var kf=()=>{let[e,t]=Jc(null),{authenticated:r,user:o,getAccessToken:n}=B(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=M(),{data:s,onUserCloseViaDialogOrKeybindRef:c}=x(),u=Se(o)?.address,{onFailure:h,onSuccess:f,origin:y,appId:w}=s.keyExport,v=S=>{i({shouldCallAuthOnSuccess:!1}),h(typeof S=="string"?new Error(S):S)},k=()=>{i({shouldCallAuthOnSuccess:!1}),f(),a({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:u}})};return xf(()=>{let S=Se(o);if(!r||!S)return v("User must be authenticated before exporting their wallet");n().then(t,v)},[r,o]),c.current=k,Cr(d0,{children:[He(T,{onClose:k}),Cr(n0,{children:[Cr(Te,{icon:He(e0,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),title:"Transfer Wallet",children:[Cr(l0,{children:[He(o0,{style:{marginRight:6}}),fo(u)]}),He("p",{children:"You can bring your account with you to another site using an external wallet."})]}),Cr(i0,{children:[Cr(Pf,{children:[He(Sf,{children:"1"}),Cr("span",{children:[He("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."]})]}),Cr(Pf,{children:[He(Sf,{children:"2"}),He("span",{children:"Copy this key into your other wallet"})]})]}),He("div",{style:{width:"100%"},children:e&&He(r0,{origin:y,appId:w,accessToken:e,clientAnalyticsId:l,address:u,dimensions:{height:"44px"}})}),Cr(c0,{children:[Cr("div",{children:[He(X3,{viewBox:"0 0 20 18"}),He("h4",{children:"Warning"})]}),He("p",{children:"Never share your private key with anyone! It controls your account."})]})]}),He(z,{protectedByPrivy:!0})]})};function r0(e){let[t,r]=Jc(e.dimensions.width),[o,n]=Jc(void 0),i=t0(null);return xf(()=>{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")})},[]),He("div",{ref:i,children:t&&Cr(a0,{children:[He("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:Va(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{token:e.accessToken,address:e.address,width:`${t}px`,caid:e.clientAnalyticsId,...o})}),He(s0,{children:"Loading..."})]})})}function o0(e){return He("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e.style,children:He("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 n0=wo.div`
970
+ `;import Y3 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as Z3}from"react";import{Fragment as J3,jsx as Kn,jsxs as bf}from"react/jsx-runtime";var Ef=()=>{let{user:e}=B(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=M(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=x(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:c}=i.createWallet,u=()=>{let h=Se(e);h?(o(),l(h)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return Z3(()=>{let h=setTimeout(u,Kp);return()=>clearTimeout(h)},[]),a.current=u,bf(J3,{children:[Kn(T,{onClose:u}),Kn(X,{}),bf(hr,{children:[Kn(Y3,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),Kn(Te,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),Kn(ie,{}),Kn(z,{protectedByPrivy:!0})]})};import Q3 from"@heroicons/react/20/solid/ExclamationTriangleIcon";import X3 from"@heroicons/react/24/outline/ArrowRightOnRectangleIcon";import{useEffect as Sf,useRef as e0,useState as Jc}from"react";import wo from"styled-components";import{Fragment as c0,jsx as He,jsxs as Cr}from"react/jsx-runtime";var xf=()=>{let[e,t]=Jc(null),{authenticated:r,user:o,getAccessToken:n}=B(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=M(),{data:s,onUserCloseViaDialogOrKeybindRef:c}=x(),u=Se(o)?.address,{onFailure:h,onSuccess:f,origin:y,appId:w}=s.keyExport,v=S=>{i({shouldCallAuthOnSuccess:!1}),h(typeof S=="string"?new Error(S):S)},k=()=>{i({shouldCallAuthOnSuccess:!1}),f(),a({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:u}})};return Sf(()=>{let S=Se(o);if(!r||!S)return v("User must be authenticated before exporting their wallet");n().then(t,v)},[r,o]),c.current=k,Cr(c0,{children:[He(T,{onClose:k}),Cr(o0,{children:[Cr(Te,{icon:He(X3,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),title:"Transfer Wallet",children:[Cr(s0,{children:[He(r0,{style:{marginRight:6}}),ho(u)]}),He("p",{children:"You can bring your account with you to another site using an external wallet."})]}),Cr(n0,{children:[Cr(Tf,{children:[He(Pf,{children:"1"}),Cr("span",{children:[He("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."]})]}),Cr(Tf,{children:[He(Pf,{children:"2"}),He("span",{children:"Copy this key into your other wallet"})]})]}),He("div",{style:{width:"100%"},children:e&&He(t0,{origin:y,appId:w,accessToken:e,clientAnalyticsId:l,address:u,dimensions:{height:"44px"}})}),Cr(l0,{children:[Cr("div",{children:[He(Q3,{viewBox:"0 0 20 18"}),He("h4",{children:"Warning"})]}),He("p",{children:"Never share your private key with anyone! It controls your account."})]})]}),He(z,{protectedByPrivy:!0})]})};function t0(e){let[t,r]=Jc(e.dimensions.width),[o,n]=Jc(void 0),i=e0(null);return Sf(()=>{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")})},[]),He("div",{ref:i,children:t&&Cr(i0,{children:[He("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:Va(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{token:e.accessToken,address:e.address,width:`${t}px`,caid:e.clientAnalyticsId,...o})}),He(a0,{children:"Loading..."})]})})}function r0(e){return He("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e.style,children:He("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 o0=wo.div`
971
971
  display: flex;
972
972
  flex-direction: column;
973
973
  text-align: left;
974
- `,i0=wo.div`
974
+ `,n0=wo.div`
975
975
  display: flex;
976
976
  flex-direction: column;
977
977
  gap: 24px;
978
978
  padding-bottom: 16px;
979
979
  margin-left: 11px;
980
980
  border-left: 1px solid var(--privy-color-foreground-4) !important;
981
- `,Pf=wo.div`
981
+ `,Tf=wo.div`
982
982
  display: flex;
983
983
  align-items: top;
984
984
  gap: 8px;
@@ -987,7 +987,7 @@ Resources:
987
987
  color: var(--privy-color-accent);
988
988
  text-decoration: underline;
989
989
  }
990
- `,Sf=wo.div`
990
+ `,Pf=wo.div`
991
991
  display: flex;
992
992
  align-items: center;
993
993
  justify-content: center;
@@ -1001,11 +1001,11 @@ Resources:
1001
1001
  border-radius: 100%;
1002
1002
  background: var(--privy-color-background);
1003
1003
  color: var(--privy-color-accent);
1004
- `,a0=wo.div`
1004
+ `,i0=wo.div`
1005
1005
  overflow: visible;
1006
1006
  position: relative;
1007
1007
  height: 44px;
1008
- `,s0=wo.div`
1008
+ `,a0=wo.div`
1009
1009
  position: absolute;
1010
1010
  display: flex;
1011
1011
  align-items: center;
@@ -1017,7 +1017,7 @@ Resources:
1017
1017
  border-radius: var(--privy-border-radius-md);
1018
1018
  background-color: var(--privy-color-background-2);
1019
1019
  color: var(--privy-color-foreground-3);
1020
- `,l0=wo.div`
1020
+ `,s0=wo.div`
1021
1021
  display: flex;
1022
1022
  align-items: center;
1023
1023
  padding-top: 1px;
@@ -1030,7 +1030,7 @@ Resources:
1030
1030
  font-size: 12px;
1031
1031
  font-weight: 500;
1032
1032
  margin: auto;
1033
- `,c0=wo.div`
1033
+ `,l0=wo.div`
1034
1034
  border: 1px solid var(--privy-color-background-2) !important;
1035
1035
  border-radius: var(--privy-border-radius-md);
1036
1036
  padding: 16px;
@@ -1052,9 +1052,9 @@ Resources:
1052
1052
  color: var(--privy-color-error);
1053
1053
  }
1054
1054
  }
1055
- `;import m0 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as f0,useState as _f}from"react";import h0 from"styled-components";import{useCallback as p0,useRef as u0}from"react";function ol(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=M(),o=u0(!1);return{createWallet:p0(async i=>{let a=await he();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(vn);if(!l)throw new Error("walletProxy does not exist.");let s=1e4,c=new Promise((y,w)=>{setTimeout(()=>{w(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 h=await e();if(!h)throw new Error("Failed to refresh user.");let f=Se(h);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}},[])}}import{Fragment as g0,jsx as jn,jsxs as Af}from"react/jsx-runtime";var Rf=()=>{let{app:e,setModalData:t,navigate:r,data:o,onUserCloseViaDialogOrKeybindRef:n}=x(),[i,a]=_f(""),{embeddedWallets:l}=go(),{authenticated:s}=B(),{closePrivyModal:c}=M(),{onSuccess:u,onFailure:h,callAuthOnSuccessOnClose:f}=o.createWallet,y=e?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,{createWallet:w}=ol(),[v,k]=_f(null),S=new Oe(async()=>{try{let R=await w();if(!R)return;k(R),r("EMBEDDED_WALLET_CREATED_SCREEN")}catch(R){a(R.message)}});f0(()=>{if(!s){r("LANDING"),h(new Error("User must be authenticated before creating a Privy wallet"));return}if(y){t({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}});let R=yf("create",l.userOwnedRecoveryOptions);return r(R)}S.execute()},[y,s]);let C=()=>{v?(u(v),c({shouldCallAuthOnSuccess:f})):(h(new gt("User wallet creation failed")),c({shouldCallAuthOnSuccess:!1}))};return n.current=()=>null,i?Af(g0,{children:[jn(T,{closeable:!1}),Af(hr,{children:[jn(m0,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),jn(Te,{title:"Something went wrong",description:i})]}),jn(W,{onClick:C,children:"Close"}),jn(y0,{})]}):jn(Vn,{})},y0=h0.div`
1055
+ `;import u0 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as m0,useState as kf}from"react";import f0 from"styled-components";import{useCallback as d0,useRef as p0}from"react";function ol(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=M(),o=p0(!1);return{createWallet:d0(async i=>{let a=await he();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(vn);if(!l)throw new Error("walletProxy does not exist.");let s=1e4,c=new Promise((y,w)=>{setTimeout(()=>{w(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 h=await e();if(!h)throw new Error("Failed to refresh user.");let f=Se(h);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}},[])}}import{Fragment as y0,jsx as jn,jsxs as _f}from"react/jsx-runtime";var Af=()=>{let{app:e,setModalData:t,navigate:r,data:o,onUserCloseViaDialogOrKeybindRef:n}=x(),[i,a]=kf(""),{embeddedWallets:l}=Mr(),{authenticated:s}=B(),{closePrivyModal:c}=M(),{onSuccess:u,onFailure:h,callAuthOnSuccessOnClose:f}=o.createWallet,y=e?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,{createWallet:w}=ol(),[v,k]=kf(null),S=new Oe(async()=>{try{let R=await w();if(!R)return;k(R),r("EMBEDDED_WALLET_CREATED_SCREEN")}catch(R){a(R.message)}});m0(()=>{if(!s){r("LANDING"),h(new Error("User must be authenticated before creating a Privy wallet"));return}if(y){t({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}});let R=hf("create",l.userOwnedRecoveryOptions);return r(R)}S.execute()},[y,s]);let C=()=>{v?(u(v),c({shouldCallAuthOnSuccess:f})):(h(new gt("User wallet creation failed")),c({shouldCallAuthOnSuccess:!1}))};return n.current=()=>null,i?_f(y0,{children:[jn(T,{closeable:!1}),_f(hr,{children:[jn(u0,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),jn(Te,{title:"Something went wrong",description:i})]}),jn(W,{onClick:C,children:"Close"}),jn(h0,{})]}):jn(Vn,{})},h0=f0.div`
1056
1056
  height: 44px;
1057
- `;import{useEffect as dC,useState as ll}from"react";import{useCallback as nd,useEffect as cC}from"react";import E0 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useEffect as T0,useState as ed}from"react";import v0 from"@heroicons/react/24/outline/ArrowPathIcon";import C0 from"@heroicons/react/24/outline/EyeIcon";import w0 from"@heroicons/react/24/outline/EyeSlashIcon";import mt,{css as Qc}from"styled-components";var b0=Qc`
1057
+ `;import{useEffect as cC,useState as ll}from"react";import{useCallback as nd,useEffect as lC}from"react";import b0 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useEffect as E0,useState as ed}from"react";import g0 from"@heroicons/react/24/outline/ArrowPathIcon";import v0 from"@heroicons/react/24/outline/EyeIcon";import C0 from"@heroicons/react/24/outline/EyeSlashIcon";import mt,{css as Qc}from"styled-components";var w0=Qc`
1058
1058
  font-size: 14px;
1059
1059
  font-style: normal;
1060
1060
  font-weight: 400;
@@ -1063,7 +1063,7 @@ Resources:
1063
1063
  text-align: left;
1064
1064
  transition: color 0.1s ease-in;
1065
1065
  `,nl=mt.span`
1066
- ${b0}
1066
+ ${w0}
1067
1067
  transition: color 0.1s ease-in;
1068
1068
  color: ${({error:e})=>e?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
1069
1069
  text-transform: ${({error:e})=>e?"":"capitalize"};
@@ -1082,7 +1082,7 @@ Resources:
1082
1082
  transition: none;
1083
1083
  }
1084
1084
  `}
1085
- `,If=Qc`
1085
+ `,Rf=Qc`
1086
1086
  && {
1087
1087
  width: 100%;
1088
1088
  border-width: 1px;
@@ -1098,7 +1098,7 @@ Resources:
1098
1098
  line-height: 22px; /* 137.5% */
1099
1099
  }
1100
1100
  `,Yn=mt.input`
1101
- ${If}
1101
+ ${Rf}
1102
1102
 
1103
1103
  &::placeholder {
1104
1104
  color: var(--privy-color-foreground-3);
@@ -1109,8 +1109,8 @@ Resources:
1109
1109
  overflow: hidden;
1110
1110
  text-overflow: ellipsis;
1111
1111
  white-space: nowrap;
1112
- `,Mf=mt.div`
1113
- ${If}
1112
+ `,If=mt.div`
1113
+ ${Rf}
1114
1114
  `,To=mt.div`
1115
1115
  position: relative;
1116
1116
  width: 100%;
@@ -1164,7 +1164,7 @@ Resources:
1164
1164
  > :first-child {
1165
1165
  min-width: 24px;
1166
1166
  }
1167
- `,bM=mt.div`
1167
+ `,wM=mt.div`
1168
1168
  height: var(--privy-height-modal-full);
1169
1169
 
1170
1170
  @media (max-width: 440px) {
@@ -1190,7 +1190,7 @@ Resources:
1190
1190
  flex-direction: row;
1191
1191
  justify-content: space-around;
1192
1192
  align-items: center;
1193
- `,Wf=mt(v0)`
1193
+ `,Mf=mt(g0)`
1194
1194
  height: 1.25rem;
1195
1195
  width: 1.25rem;
1196
1196
  stroke: var(--privy-color-accent);
@@ -1199,7 +1199,7 @@ Resources:
1199
1199
  :active {
1200
1200
  stroke: var(--privy-color-accent-light);
1201
1201
  }
1202
- `,Jn=mt(w0)`
1202
+ `,Jn=mt(C0)`
1203
1203
  height: 1.25rem;
1204
1204
  width: 1.25rem;
1205
1205
  stroke: var(--privy-color-accent);
@@ -1208,7 +1208,7 @@ Resources:
1208
1208
  :active {
1209
1209
  stroke: var(--privy-color-accent-light);
1210
1210
  }
1211
- `,Qn=mt(C0)`
1211
+ `,Qn=mt(v0)`
1212
1212
  height: 1.25rem;
1213
1213
  width: 1.25rem;
1214
1214
  stroke: var(--privy-color-accent);
@@ -1217,7 +1217,7 @@ Resources:
1217
1217
  :active {
1218
1218
  stroke: var(--privy-color-accent-light);
1219
1219
  }
1220
- `,Lf=mt.progress`
1220
+ `,Wf=mt.progress`
1221
1221
  height: 4px;
1222
1222
  width: 100%;
1223
1223
  margin: 8px 0;
@@ -1233,7 +1233,7 @@ Resources:
1233
1233
  transition: all 0.1s ease-out;
1234
1234
  background: ${({label:e})=>e==="Strong"&&"#78dca6"||e==="Medium"&&"var(--privy-color-warn)"||"var(--privy-color-error)"};
1235
1235
  }
1236
- `;import{Fragment as P0,jsx as Ht,jsxs as il}from"react/jsx-runtime";var Of=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[i,a]=ed(!0),[l,s]=ed(!1),[c,u]=ed(""),h=r===c;return T0(()=>{c&&!l&&s(!0)},[c]),il(P0,{children:[Ht(T,{title:"Confirm Password",closeable:!1,backFn:n}),Ht(X,{}),il(bo,{children:[il(Po,{children:[Ht(E0,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),Ht("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),Ht("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),il(To,{children:[Ht(Yn,{value:c,onChange:f=>u(f.target.value),onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text",style:{paddingRight:"2.3rem"}}),Ht(Zn,{style:{right:"0.75rem"},children:i?Ht(Jn,{onClick:()=>a(!1)}):Ht(Qn,{onClick:()=>a(!0)})})]}),Ht(nl,{"aria-hidden":!l||h,error:!0,children:"Passwords do not match"})]}),Ht(Eo,{onClick:o,loading:t,disabled:!h,hideAnimations:e,children:"Continue"}),Ht(ie,{}),Ht(z,{protectedByPrivy:!0})]})};import _0 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as A0}from"react";import R0 from"styled-components";import ji from"styled-components";import{jsx as Ki,jsxs as k0}from"react/jsx-runtime";var Nf=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>Ki("label",{children:k0(S0,{className:e,children:[Ki(Ff,{checked:t,...o}),Ki(x0,{color:r,checked:t,children:Ki(Df,{viewBox:"0 0 24 24",children:Ki("polyline",{points:"20 6 9 17 4 12"})})})]})});var WM=ji.label`
1236
+ `;import{Fragment as T0,jsx as Ht,jsxs as il}from"react/jsx-runtime";var Lf=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[i,a]=ed(!0),[l,s]=ed(!1),[c,u]=ed(""),h=r===c;return E0(()=>{c&&!l&&s(!0)},[c]),il(T0,{children:[Ht(T,{title:"Confirm Password",closeable:!1,backFn:n}),Ht(X,{}),il(bo,{children:[il(Po,{children:[Ht(b0,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),Ht("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),Ht("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),il(To,{children:[Ht(Yn,{value:c,onChange:f=>u(f.target.value),onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text",style:{paddingRight:"2.3rem"}}),Ht(Zn,{style:{right:"0.75rem"},children:i?Ht(Jn,{onClick:()=>a(!1)}):Ht(Qn,{onClick:()=>a(!0)})})]}),Ht(nl,{"aria-hidden":!l||h,error:!0,children:"Passwords do not match"})]}),Ht(Eo,{onClick:o,loading:t,disabled:!h,hideAnimations:e,children:"Continue"}),Ht(ie,{}),Ht(z,{protectedByPrivy:!0})]})};import k0 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as _0}from"react";import A0 from"styled-components";import ji from"styled-components";import{jsx as Ki,jsxs as x0}from"react/jsx-runtime";var Of=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>Ki("label",{children:x0(P0,{className:e,children:[Ki(Df,{checked:t,...o}),Ki(S0,{color:r,checked:t,children:Ki(Nf,{viewBox:"0 0 24 24",children:Ki("polyline",{points:"20 6 9 17 4 12"})})})]})});var MM=ji.label`
1237
1237
  && {
1238
1238
  cursor: pointer;
1239
1239
  display: flex;
@@ -1245,14 +1245,14 @@ Resources:
1245
1245
  border: 1px solid var(--privy-color-foreground-4);
1246
1246
  width: 100%;
1247
1247
  }
1248
- `,S0=ji.div`
1248
+ `,P0=ji.div`
1249
1249
  display: inline-block;
1250
1250
  vertical-align: middle;
1251
- `,Df=ji.svg`
1251
+ `,Nf=ji.svg`
1252
1252
  fill: none;
1253
1253
  stroke: white;
1254
1254
  stroke-width: 3px;
1255
- `,Ff=ji.input.attrs({type:"checkbox"})`
1255
+ `,Df=ji.input.attrs({type:"checkbox"})`
1256
1256
  border: 0;
1257
1257
  clip: rect(0 0 0 0);
1258
1258
  clippath: inset(50%);
@@ -1263,7 +1263,7 @@ Resources:
1263
1263
  position: absolute;
1264
1264
  white-space: nowrap;
1265
1265
  width: 1px;
1266
- `,x0=ji.div`
1266
+ `,S0=ji.div`
1267
1267
  display: inline-block;
1268
1268
  width: 18px;
1269
1269
  height: 18px;
@@ -1278,28 +1278,28 @@ Resources:
1278
1278
  border-width: 1px;
1279
1279
  }
1280
1280
 
1281
- ${Ff}:focus + & {
1281
+ ${Df}:focus + & {
1282
1282
  box-shadow: 0 0 0 1px ${e=>e.color};
1283
1283
  }
1284
1284
 
1285
- ${Df} {
1285
+ ${Nf} {
1286
1286
  visibility: ${e=>e.checked?"visible":"hidden"};
1287
1287
  }
1288
- `;import{Fragment as Uf,jsx as sr,jsxs as Yi}from"react/jsx-runtime";var Bf=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[i,a]=A0(!1);return Yi(Uf,{children:[sr(T,{title:"Confirm Password",closeable:!1,backFn:o}),sr(X,{}),Yi(bo,{children:[Yi(Po,{children:[sr(_0,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),sr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),sr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),sr(qi,{children:Yi($i,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[sr(Nf,{color:"var(--privy-color-error)",checked:i}),sr(Uf,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),Yi(I0,{children:[n.initiatedBy==="user"&&sr(fr,{onClick:n.onCancel,disabled:t,children:"Cancel"}),sr(Eo,{onClick:r,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),sr(ie,{}),sr(z,{protectedByPrivy:!0})]})},I0=R0.div`
1288
+ `;import{Fragment as Ff,jsx as sr,jsxs as Yi}from"react/jsx-runtime";var Uf=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[i,a]=_0(!1);return Yi(Ff,{children:[sr(T,{title:"Confirm Password",closeable:!1,backFn:o}),sr(X,{}),Yi(bo,{children:[Yi(Po,{children:[sr(k0,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),sr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),sr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),sr(qi,{children:Yi($i,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[sr(Of,{color:"var(--privy-color-error)",checked:i}),sr(Ff,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),Yi(R0,{children:[n.initiatedBy==="user"&&sr(fr,{onClick:n.onCancel,disabled:t,children:"Cancel"}),sr(Eo,{onClick:r,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),sr(ie,{}),sr(z,{protectedByPrivy:!0})]})},R0=A0.div`
1289
1289
  display: flex;
1290
1290
  gap: 10px;
1291
- `;import K0 from"@heroicons/react/24/outline/KeyIcon";import Kf from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as jf,useMemo as td,useEffect as j0}from"react";import Yf from"styled-components";import M0 from"fast-password-entropy";import*as Hf from"secure-password-utilities";import{DEFAULT_WORDLIST as W0}from"secure-password-utilities/wordlists";var L0=95,O0=8,N0=3,D0=.3,F0=/[a-z]/,U0=/[A-Z]/,B0=/[0-9]/,H0="a-zA-Z0-9",Gf="!@#$%^&*()\\-_+.",Vf=`${H0}${Gf}`,G0=new RegExp(`[${Gf}]`),V0=new RegExp(`[${Vf}]`),zf=new RegExp(`^[${Vf}]{6,}$`),qf=(e="")=>{let t=e.split("").filter(r=>!V0.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},al=()=>Hf.generatePassphrase(4,W0);function z0(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function q0(e){if(e.length<O0)return 0;let t=0;F0.test(e)&&(t+=1),U0.test(e)&&(t+=1),B0.test(e)&&(t+=1),G0.test(e)&&(t+=1);let r=t/N0;return Math.max(0,Math.min(1,r))}function $0(e=""){let t=q0(e),r=M0(e)/L0;return(t*D0+r)/2}function $f(e=""){let t=$0(e);return{value:t,label:z0(t)}}import{Fragment as J0,jsx as tt,jsxs as ro}from"react/jsx-runtime";var Zf=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,onSubmit:n,onClose:i,onBack:a,onPasswordChange:l,onPasswordGenerate:s})=>{let[c,u]=jf(!1),[h,f]=jf(!1);j0(()=>{r&&!h&&f(!0)},[r]);let y=td(()=>h?(r?.length||0)<6?"Password must be at least 6 characters":zf.test(r||"")?null:`Invalid characters used ( ${qf(r).join(" ")} )`:null,[r,h]),w=td(()=>y?{value:0,label:"Weak"}:$f(r),[r,y]),v=td(()=>!!(!r?.length||y),[y,r]);return ro(J0,{children:[tt(T,{onClose:i,title:"Secure your account",closeable:o.initiatedBy==="user",backFn:a}),tt(X,{}),ro(bo,{children:[ro(Po,{children:[tt(K0,{height:48,width:48,stroke:"var(--privy-color-accent)"}),tt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Set your password"}),tt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),ro(To,{children:[tt(Yn,{value:r,onChange:k=>l(k.target.value),placeholder:"enter or generate a strong password",type:c?"password":"text",style:{paddingRight:"3.8rem"}}),ro(Zn,{style:{width:"3.5rem"},children:[c?tt(Jn,{onClick:()=>u(!1)}):tt(Qn,{onClick:()=>u(!0)}),tt(Wf,{onClick:s})]})]}),tt(Lf,{value:w.value===0?.01:w.value,label:w.label}),tt(nl,{error:!!y,children:y||`Password Strength: ${h?w.label:"--"}`}),ro(Z0,{children:[tt(Y0,{children:ro(qi,{children:[ro($i,{children:[tt(Kf,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),ro($i,{children:[tt(Kf,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),tt(Eo,{onClick:n,loading:t,disabled:v,hideAnimations:e,children:"Continue"})]})]}),tt(ie,{}),tt(z,{protectedByPrivy:!0})]})},Y0=Yf(qi)`
1291
+ `;import $0 from"@heroicons/react/24/outline/KeyIcon";import $f from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as Kf,useMemo as td,useEffect as K0}from"react";import jf from"styled-components";import I0 from"fast-password-entropy";import*as Bf from"secure-password-utilities";import{DEFAULT_WORDLIST as M0}from"secure-password-utilities/wordlists";var W0=95,L0=8,O0=3,N0=.3,D0=/[a-z]/,F0=/[A-Z]/,U0=/[0-9]/,B0="a-zA-Z0-9",Hf="!@#$%^&*()\\-_+.",Gf=`${B0}${Hf}`,H0=new RegExp(`[${Hf}]`),G0=new RegExp(`[${Gf}]`),Vf=new RegExp(`^[${Gf}]{6,}$`),zf=(e="")=>{let t=e.split("").filter(r=>!G0.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},al=()=>Bf.generatePassphrase(4,M0);function V0(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function z0(e){if(e.length<L0)return 0;let t=0;D0.test(e)&&(t+=1),F0.test(e)&&(t+=1),U0.test(e)&&(t+=1),H0.test(e)&&(t+=1);let r=t/O0;return Math.max(0,Math.min(1,r))}function q0(e=""){let t=z0(e),r=I0(e)/W0;return(t*N0+r)/2}function qf(e=""){let t=q0(e);return{value:t,label:V0(t)}}import{Fragment as Z0,jsx as tt,jsxs as oo}from"react/jsx-runtime";var Yf=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,onSubmit:n,onClose:i,onBack:a,onPasswordChange:l,onPasswordGenerate:s})=>{let[c,u]=Kf(!1),[h,f]=Kf(!1);K0(()=>{r&&!h&&f(!0)},[r]);let y=td(()=>h?(r?.length||0)<6?"Password must be at least 6 characters":Vf.test(r||"")?null:`Invalid characters used ( ${zf(r).join(" ")} )`:null,[r,h]),w=td(()=>y?{value:0,label:"Weak"}:qf(r),[r,y]),v=td(()=>!!(!r?.length||y),[y,r]);return oo(Z0,{children:[tt(T,{onClose:i,title:"Secure your account",closeable:o.initiatedBy==="user",backFn:a}),tt(X,{}),oo(bo,{children:[oo(Po,{children:[tt($0,{height:48,width:48,stroke:"var(--privy-color-accent)"}),tt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Set your password"}),tt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),oo(To,{children:[tt(Yn,{value:r,onChange:k=>l(k.target.value),placeholder:"enter or generate a strong password",type:c?"password":"text",style:{paddingRight:"3.8rem"}}),oo(Zn,{style:{width:"3.5rem"},children:[c?tt(Jn,{onClick:()=>u(!1)}):tt(Qn,{onClick:()=>u(!0)}),tt(Mf,{onClick:s})]})]}),tt(Wf,{value:w.value===0?.01:w.value,label:w.label}),tt(nl,{error:!!y,children:y||`Password Strength: ${h?w.label:"--"}`}),oo(Y0,{children:[tt(j0,{children:oo(qi,{children:[oo($i,{children:[tt($f,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),oo($i,{children:[tt($f,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),tt(Eo,{onClick:n,loading:t,disabled:v,hideAnimations:e,children:"Continue"})]})]}),tt(ie,{}),tt(z,{protectedByPrivy:!0})]})},j0=jf(qi)`
1292
1292
  flex: 1;
1293
1293
  padding-top: 1rem;
1294
- `,Z0=Yf.div`
1294
+ `,Y0=jf.div`
1295
1295
  display: flex;
1296
1296
  flex-direction: column;
1297
1297
  height: 100%;
1298
- `;import Q0 from"@heroicons/react/24/outline/ArrowDownTrayIcon";import X0 from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import eC from"@heroicons/react/24/outline/DocumentDuplicateIcon";import tC from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as rC,useCallback as Jf}from"react";import{Fragment as rd,jsx as It,jsxs as nn}from"react/jsx-runtime";var Qf=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:i})=>{let[a,l]=rC(!1),s=Jf(()=>{l(!0),o&&navigator.clipboard.writeText(o)},[o]),c=Jf(()=>{let u=document.createElement("a"),h=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),f=new Blob([oC(r,o)],{type:"text/plain"}),y=URL.createObjectURL(f);u.href=y,u.target="_blank",u.download=`${h}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(y)},5e3)},[o]);return nn(rd,{children:[It(T,{backFn:i,title:"Save Password",closeable:!1}),It(X,{}),nn(bo,{children:[nn(Po,{children:[It(tC,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),It("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),It("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),It(To,{centered:!0,children:It(Mf,{children:o})}),nn("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[It(Xc,{onClick:s,children:a?nn(rd,{children:[It(X0,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):nn(rd,{children:[It(eC,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),nn(Xc,{onClick:c,children:[It(Q0,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),It(Eo,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),It(ie,{}),It(z,{protectedByPrivy:!0})]})},oC=(e,t)=>`Your wallet recovery password for ${e} is
1298
+ `;import J0 from"@heroicons/react/24/outline/ArrowDownTrayIcon";import Q0 from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import X0 from"@heroicons/react/24/outline/DocumentDuplicateIcon";import eC from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as tC,useCallback as Zf}from"react";import{Fragment as rd,jsx as It,jsxs as nn}from"react/jsx-runtime";var Jf=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:i})=>{let[a,l]=tC(!1),s=Zf(()=>{l(!0),o&&navigator.clipboard.writeText(o)},[o]),c=Zf(()=>{let u=document.createElement("a"),h=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),f=new Blob([rC(r,o)],{type:"text/plain"}),y=URL.createObjectURL(f);u.href=y,u.target="_blank",u.download=`${h}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(y)},5e3)},[o]);return nn(rd,{children:[It(T,{backFn:i,title:"Save Password",closeable:!1}),It(X,{}),nn(bo,{children:[nn(Po,{children:[It(eC,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),It("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),It("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),It(To,{centered:!0,children:It(If,{children:o})}),nn("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[It(Xc,{onClick:s,children:a?nn(rd,{children:[It(Q0,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):nn(rd,{children:[It(X0,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),nn(Xc,{onClick:c,children:[It(J0,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),It(Eo,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),It(ie,{}),It(z,{protectedByPrivy:!0})]})},rC=(e,t)=>`Your wallet recovery password for ${e} is
1299
1299
 
1300
1300
  ${t}
1301
1301
 
1302
- You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;import nC from"@heroicons/react/24/solid/CheckCircleIcon";import iC from"@heroicons/react/24/solid/XCircleIcon";import{Fragment as aC,jsx as oo,jsxs as od}from"react/jsx-runtime";var Xf=({error:e,onClose:t})=>od(aC,{children:[oo(T,{closeable:!1}),oo(X,{}),e?od(hr,{children:[oo(iC,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),oo(Te,{title:"Something went wrong",description:e})]}):od(hr,{children:[oo(nC,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),oo(Te,{title:"Success"})]}),oo(W,{onClick:t,children:"Close"}),oo(ie,{}),oo(z,{protectedByPrivy:!0})]});import{useReducer as sC}from"react";var lC=(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}},eh=()=>{let[e,t]=sC(lC,"creating");return{send:t,state:e}};import{jsx as Zi}from"react/jsx-runtime";var sl=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:o}=x(),{send:n,state:i}=eh(),a=nd(async()=>{i==="finalizing"&&await e(),n("next")},[i,n,e]);cC(()=>{let c;return i==="done"&&t.config.initiatedBy==="automatic"&&(c=setTimeout(()=>t.onClose?.(),Be)),()=>{c&&clearTimeout(c)}},[i,t.config.initiatedBy,t.onClose]);let l=nd(()=>{n("back")},[n]),s=nd(()=>{o("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,o]);return i==="creating"?Zi(Zf,{...t,onSubmit:a,onBack:r==="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"?s:void 0}):i==="saving"?Zi(Qf,{...t,onSubmit:a,onBack:l}):i==="confirming"?Zi(Of,{...t,onSubmit:a,onBack:l}):i==="finalizing"?Zi(Bf,{...t,onSubmit:a,onBack:l}):i==="done"?Zi(Xf,{...t,onSubmit:a}):null};import{jsx as pC}from"react/jsx-runtime";var th=()=>{let[e,t]=ll(null),[r,o]=ll(!1),[n,i]=ll(null),[a,l]=ll(""),{authenticated:s,getAccessToken:c,user:u}=B(),{walletProxy:h,refreshUser:f,closePrivyModal:y,createAnalyticsEvent:w}=M(),{app:v,navigate:k,data:S,onUserCloseViaDialogOrKeybindRef:C}=x(),{onSuccess:R,onFailure:P}=S.createWallet,O=Se(u),_=e?.recoveryMethod==="user-passcode";dC(()=>{s||(k("LANDING"),P(new Ra("User must be authenticated before setting a password on a Privy wallet")))},[s]);let D=()=>{if(n){P(n),y({shouldCallAuthOnSuccess:!1});return}if(!_){P(new gt("Exited before password was added to wallet")),y({shouldCallAuthOnSuccess:!1});return}R(e),y({shouldCallAuthOnSuccess:!1})};C.current=D;let K=async()=>{let H=await c();if(H&&O?.address&&a&&h)try{if(w({eventName:"embedded_wallet_set_password_started",payload:{walletAddress:O.address}}),!(await h.setRecoveryPassword({accessToken:H,address:O.address,recoveryPassword:a})).address){i(new gt("Error setting password on privy wallet")),w({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:O.address,reason:"error setting password"}});return}let Q=await f(),U=Se(Q);if(!U){i(new gt("Error setting password on privy wallet")),w({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:O.address,reason:"wallet disconnected"}});return}t(U),w({eventName:"embedded_wallet_set_password_completed",payload:{walletAddress:O.address}})}catch(I){console.warn(I),i(I instanceof Error?I:new Error("Error setting password on privy wallet")),w({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:O.address,reason:I}})}},V=async()=>{_?(R(e),y({shouldCallAuthOnSuccess:!1})):(o(!0),i(null),await K(),o(!1))};return pC(sl,{appName:v?.name||"privy",config:{initiatedBy:"user",onCancel:D},error:n?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:a,onPasswordGenerate:()=>l(al()),onPasswordChange:l,onSubmit:V,onClose:D})};import uC from"@heroicons/react/24/outline/UserCircleIcon";import mC from"@heroicons/react/24/solid/LockClosedIcon";import{Fragment as fC,jsx as no,jsxs as cl}from"react/jsx-runtime";var rh=()=>{let{user:e}=B(),{closePrivyModal:t,createAnalyticsEvent:r}=M(),{data:o,setModalData:n,navigate:i,onUserCloseViaDialogOrKeybindRef:a}=x(),{onSuccess:l,onFailure:s}=o.setWalletPassword,c=()=>{s(new gt("Exited before password was added to wallet")),t({shouldCallAuthOnSuccess:!1})};return a.current=c,cl(fC,{children:[no(T,{onClose:c}),no(X,{}),cl(hr,{children:[cl(Lm,{children:[no(uC,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),no(Om,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:no(mC,{width:"12px",height:"12px",fill:"white"})})]}),cl(Te,{title:"Secure Your Account",children:["Please set a password to secure your account.",no("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),no(W,{onClick:()=>{let h=Se(e);r({eventName:"embedded_wallet_set_password_started",payload:{walletAddress:h?.address}}),n({createWallet:{onFailure:s,onSuccess:l,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),i("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),no(ie,{}),no(z,{protectedByPrivy:!0})]})};import hC from"@heroicons/react/24/outline/ExclamationTriangleIcon";import yC from"@heroicons/react/24/outline/PhoneIcon";import oh from"styled-components";import{Fragment as wC,jsx as lr,jsxs as dl}from"react/jsx-runtime";var gC=e=>{let t=lr(hC,{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 xe&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:lr(yC,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof Ue)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:lr(js,{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:lr("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:lr("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};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else return e instanceof pr&&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}}},nh=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=x();return lr(Ji,{error:r?.errorModalData?.error||new Error,backFn:!o||n===o?void 0:t,onClick:()=>e(o||"LANDING",!1)})},Ji=({error:e,backFn:t,onClick:r})=>{let{reset:o}=Ce(),n=gC(e),i=()=>{e instanceof Ue&&e.privyErrorCode==="invalid_captcha"&&o(),r?.()};return dl(wC,{children:[lr(T,{backFn:t}),dl(vC,{children:[lr(Rt,{children:dl("div",{children:[lr(Ks,{color:"var(--privy-color-error)"}),n.icon]})}),dl(CC,{children:[lr("h3",{children:n.title}),lr("p",{children:n.detail})]}),lr(W,{color:"var(--privy-color-error)",onClick:i,children:n.ctaText})]})]})},vC=oh.div`
1302
+ You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;import oC from"@heroicons/react/24/solid/CheckCircleIcon";import nC from"@heroicons/react/24/solid/XCircleIcon";import{Fragment as iC,jsx as no,jsxs as od}from"react/jsx-runtime";var Qf=({error:e,onClose:t})=>od(iC,{children:[no(T,{closeable:!1}),no(X,{}),e?od(hr,{children:[no(nC,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),no(Te,{title:"Something went wrong",description:e})]}):od(hr,{children:[no(oC,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),no(Te,{title:"Success"})]}),no(W,{onClick:t,children:"Close"}),no(ie,{}),no(z,{protectedByPrivy:!0})]});import{useReducer as aC}from"react";var sC=(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}},Xf=()=>{let[e,t]=aC(sC,"creating");return{send:t,state:e}};import{jsx as Zi}from"react/jsx-runtime";var sl=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:o}=x(),{send:n,state:i}=Xf(),a=nd(async()=>{i==="finalizing"&&await e(),n("next")},[i,n,e]);lC(()=>{let c;return i==="done"&&t.config.initiatedBy==="automatic"&&(c=setTimeout(()=>t.onClose?.(),Be)),()=>{c&&clearTimeout(c)}},[i,t.config.initiatedBy,t.onClose]);let l=nd(()=>{n("back")},[n]),s=nd(()=>{o("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,o]);return i==="creating"?Zi(Yf,{...t,onSubmit:a,onBack:r==="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"?s:void 0}):i==="saving"?Zi(Jf,{...t,onSubmit:a,onBack:l}):i==="confirming"?Zi(Lf,{...t,onSubmit:a,onBack:l}):i==="finalizing"?Zi(Uf,{...t,onSubmit:a,onBack:l}):i==="done"?Zi(Qf,{...t,onSubmit:a}):null};import{jsx as dC}from"react/jsx-runtime";var eh=()=>{let[e,t]=ll(null),[r,o]=ll(!1),[n,i]=ll(null),[a,l]=ll(""),{authenticated:s,getAccessToken:c,user:u}=B(),{walletProxy:h,refreshUser:f,closePrivyModal:y,createAnalyticsEvent:w}=M(),{app:v,navigate:k,data:S,onUserCloseViaDialogOrKeybindRef:C}=x(),{onSuccess:R,onFailure:P}=S.createWallet,O=Se(u),_=e?.recoveryMethod==="user-passcode";cC(()=>{s||(k("LANDING"),P(new Ra("User must be authenticated before setting a password on a Privy wallet")))},[s]);let F=()=>{if(n){P(n),y({shouldCallAuthOnSuccess:!1});return}if(!_){P(new gt("Exited before password was added to wallet")),y({shouldCallAuthOnSuccess:!1});return}R(e),y({shouldCallAuthOnSuccess:!1})};C.current=F;let K=async()=>{let H=await c();if(H&&O?.address&&a&&h)try{if(w({eventName:"embedded_wallet_set_password_started",payload:{walletAddress:O.address}}),!(await h.setRecoveryPassword({accessToken:H,address:O.address,recoveryPassword:a})).address){i(new gt("Error setting password on privy wallet")),w({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:O.address,reason:"error setting password"}});return}let Q=await f(),D=Se(Q);if(!D){i(new gt("Error setting password on privy wallet")),w({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:O.address,reason:"wallet disconnected"}});return}t(D),w({eventName:"embedded_wallet_set_password_completed",payload:{walletAddress:O.address}})}catch(I){console.warn(I),i(I instanceof Error?I:new Error("Error setting password on privy wallet")),w({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:O.address,reason:I}})}},V=async()=>{_?(R(e),y({shouldCallAuthOnSuccess:!1})):(o(!0),i(null),await K(),o(!1))};return dC(sl,{appName:v?.name||"privy",config:{initiatedBy:"user",onCancel:F},error:n?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:a,onPasswordGenerate:()=>l(al()),onPasswordChange:l,onSubmit:V,onClose:F})};import pC from"@heroicons/react/24/outline/UserCircleIcon";import uC from"@heroicons/react/24/solid/LockClosedIcon";import{Fragment as mC,jsx as io,jsxs as cl}from"react/jsx-runtime";var th=()=>{let{user:e}=B(),{closePrivyModal:t,createAnalyticsEvent:r}=M(),{data:o,setModalData:n,navigate:i,onUserCloseViaDialogOrKeybindRef:a}=x(),{onSuccess:l,onFailure:s}=o.setWalletPassword,c=()=>{s(new gt("Exited before password was added to wallet")),t({shouldCallAuthOnSuccess:!1})};return a.current=c,cl(mC,{children:[io(T,{onClose:c}),io(X,{}),cl(hr,{children:[cl(Wm,{children:[io(pC,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),io(Lm,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:io(uC,{width:"12px",height:"12px",fill:"white"})})]}),cl(Te,{title:"Secure Your Account",children:["Please set a password to secure your account.",io("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),io(W,{onClick:()=>{let h=Se(e);r({eventName:"embedded_wallet_set_password_started",payload:{walletAddress:h?.address}}),n({createWallet:{onFailure:s,onSuccess:l,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),i("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),io(ie,{}),io(z,{protectedByPrivy:!0})]})};import fC from"@heroicons/react/24/outline/ExclamationTriangleIcon";import hC from"@heroicons/react/24/outline/PhoneIcon";import rh from"styled-components";import{Fragment as CC,jsx as lr,jsxs as dl}from"react/jsx-runtime";var yC=e=>{let t=lr(fC,{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 xe&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:lr(hC,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof Ue)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:lr(js,{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:lr("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:lr("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};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else return e instanceof pr&&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}}},oh=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=x();return lr(Ji,{error:r?.errorModalData?.error||new Error,backFn:!o||n===o?void 0:t,onClick:()=>e(o||"LANDING",!1)})},Ji=({error:e,backFn:t,onClick:r})=>{let{reset:o}=Ce(),n=yC(e),i=()=>{e instanceof Ue&&e.privyErrorCode==="invalid_captcha"&&o(),r?.()};return dl(CC,{children:[lr(T,{backFn:t}),dl(gC,{children:[lr(Rt,{children:dl("div",{children:[lr(Ks,{color:"var(--privy-color-error)"}),n.icon]})}),dl(vC,{children:[lr("h3",{children:n.title}),lr("p",{children:n.detail})]}),lr(W,{color:"var(--privy-color-error)",onClick:i,children:n.ctaText})]})]})},gC=rh.div`
1303
1303
  display: flex;
1304
1304
  flex-direction: column;
1305
1305
  align-items: center;
@@ -1307,11 +1307,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1307
1307
  gap: 24px;
1308
1308
  width: 100%;
1309
1309
  padding-bottom: 16px;
1310
- `,CC=oh.div`
1310
+ `,vC=rh.div`
1311
1311
  display: flex;
1312
1312
  flex-direction: column;
1313
1313
  gap: 8px;
1314
- `;import{useEffect as uh,useRef as BC,useState as sd}from"react";import{isIOS as HC,isMobile as mh}from"react-device-detect";import yh from"styled-components";import{useState as bC}from"react";import EC from"styled-components";import{jsx as ih}from"react/jsx-runtime";var pl=({style:e,color:t,...r})=>ih("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:ih("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});import{jsx as id}from"react/jsx-runtime";var ah=({color:e,...t})=>id("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:id("g",{children:id("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"})})});import{jsx as sh,jsxs as PC}from"react/jsx-runtime";var So=e=>{let[t,r]=bC(!1);return PC(TC,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?sh(pl,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):sh(ah,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},TC=EC.button`
1314
+ `;import{useEffect as ph,useRef as UC,useState as sd}from"react";import{isIOS as BC,isMobile as uh}from"react-device-detect";import hh from"styled-components";import{useState as wC}from"react";import bC from"styled-components";import{jsx as nh}from"react/jsx-runtime";var pl=({style:e,color:t,...r})=>nh("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:nh("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});import{jsx as id}from"react/jsx-runtime";var ih=({color:e,...t})=>id("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:id("g",{children:id("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"})})});import{jsx as ah,jsxs as TC}from"react/jsx-runtime";var So=e=>{let[t,r]=wC(!1);return TC(EC,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?ah(pl,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):ah(ih,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},EC=bC.button`
1315
1315
  display: flex;
1316
1316
  align-items: center;
1317
1317
  gap: 6px;
@@ -1349,7 +1349,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1349
1349
  width: 14px;
1350
1350
  height: 14px;
1351
1351
  }
1352
- `;import{useState as SC}from"react";import xC from"styled-components";import{jsx as _C}from"react/jsx-runtime";var ul=e=>{let[t,r]=SC(!1);return _C(kC,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},kC=xC.a`
1352
+ `;import{useState as PC}from"react";import SC from"styled-components";import{jsx as kC}from"react/jsx-runtime";var ul=e=>{let[t,r]=PC(!1);return kC(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=SC.a`
1353
1353
  display: flex;
1354
1354
  align-items: center;
1355
1355
  gap: 6px;
@@ -1387,7 +1387,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1387
1387
  width: 14px;
1388
1388
  height: 14px;
1389
1389
  }
1390
- `;import AC from"qrcode";import RC from"react";import IC from"styled-components";import{jsx as lh}from"react/jsx-runtime";var ch=()=>lh("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:lh("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});import{Fragment as Qi,jsx as Ct,jsxs as ph}from"react/jsx-runtime";var Gt=7,ad=(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},MC=e=>{let t=AC.create(e,{errorCorrectionLevel:"high"}).modules,r=ru(Array.from(t.data),t.size);return r=ad(r,0,0,Gt,Gt),r=ad(r,r.length-Gt,0,Gt,Gt),r=ad(r,0,r.length-Gt,Gt,Gt),r},WC=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>Ct(Qi,{children:[0,1,2].map(i=>Ct("circle",{r:r*(Gt-i*2)/2,cx:e+r*Gt/2,cy:t+r*Gt/2,fill:i%2!==0?o:n},`finder-${e}-${t}-${i}`))}),LC=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-Gt)*e,0],[0,(t-Gt)*e]];return Ct(Qi,{children:n.map(([i,a])=>Ct(WC,{x:i,y:a,cellSize:e,bgColor:r,fgColor:o},`finder-${i}-${a}`))})},OC=({matrix:e,cellSize:t,color:r})=>Ct(Qi,{children:e.map((o,n)=>o.map((i,a)=>i?Ct("circle",{r:t/2.5,cx:n*t+t/2,cy:a*t+t/2,fill:r},`circle-${n}-${a}`):Ct(RC.Fragment,{},`circle-${n}-${a}`)))}),dh=(e,t)=>e-e%t,NC=({outputSize:e,cellSize:t,element:r,size:o,padding:n,bgColor:i})=>{if(!r)return Ct(Qi,{});let a=o||40,l=n||4,s=r,c=e/2-a/2-l;return ph(Qi,{children:[Ct("rect",{x:dh(c,t),y:dh(c,t),width:a+l*2+(c%t?t+.5:.5),height:a+l*2+(c%t?t+.5:.5),fill:i}),Ct(s,{x:e/2-a/2,y:e/2-a/2,height:a,width:a})]})},DC=e=>{let t=e.outputSize,r=MC(e.url),o=t/r.length;return ph("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%"},children:[Ct(OC,{matrix:r,cellSize:o,color:e.fgColor}),Ct(LC,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),Ct(NC,{outputSize:e.outputSize,cellSize:o,element:e.logo?.element,bgColor:e.bgColor})]})},FC=IC.div`
1390
+ `;import _C from"qrcode";import AC from"react";import RC from"styled-components";import{jsx as sh}from"react/jsx-runtime";var lh=()=>sh("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:sh("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});import{Fragment as Qi,jsx as Ct,jsxs as dh}from"react/jsx-runtime";var Gt=7,ad=(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},IC=e=>{let t=_C.create(e,{errorCorrectionLevel:"high"}).modules,r=tu(Array.from(t.data),t.size);return r=ad(r,0,0,Gt,Gt),r=ad(r,r.length-Gt,0,Gt,Gt),r=ad(r,0,r.length-Gt,Gt,Gt),r},MC=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>Ct(Qi,{children:[0,1,2].map(i=>Ct("circle",{r:r*(Gt-i*2)/2,cx:e+r*Gt/2,cy:t+r*Gt/2,fill:i%2!==0?o:n},`finder-${e}-${t}-${i}`))}),WC=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-Gt)*e,0],[0,(t-Gt)*e]];return Ct(Qi,{children:n.map(([i,a])=>Ct(MC,{x:i,y:a,cellSize:e,bgColor:r,fgColor:o},`finder-${i}-${a}`))})},LC=({matrix:e,cellSize:t,color:r})=>Ct(Qi,{children:e.map((o,n)=>o.map((i,a)=>i?Ct("circle",{r:t/2.5,cx:n*t+t/2,cy:a*t+t/2,fill:r},`circle-${n}-${a}`):Ct(AC.Fragment,{},`circle-${n}-${a}`)))}),ch=(e,t)=>e-e%t,OC=({outputSize:e,cellSize:t,element:r,size:o,padding:n,bgColor:i})=>{if(!r)return Ct(Qi,{});let a=o||40,l=n||4,s=r,c=e/2-a/2-l;return dh(Qi,{children:[Ct("rect",{x:ch(c,t),y:ch(c,t),width:a+l*2+(c%t?t+.5:.5),height:a+l*2+(c%t?t+.5:.5),fill:i}),Ct(s,{x:e/2-a/2,y:e/2-a/2,height:a,width:a})]})},NC=e=>{let t=e.outputSize,r=IC(e.url),o=t/r.length;return dh("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%"},children:[Ct(LC,{matrix:r,cellSize:o,color:e.fgColor}),Ct(WC,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),Ct(OC,{outputSize:e.outputSize,cellSize:o,element:e.logo?.element,bgColor:e.bgColor})]})},DC=RC.div`
1391
1391
  display: flex;
1392
1392
  justify-content: center;
1393
1393
  align-items: center;
@@ -1402,7 +1402,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1402
1402
  border-color: ${e=>e.fgColor};
1403
1403
  border-radius: var(--privy-border-radius-md);
1404
1404
  }
1405
- `,Xn=e=>{let t=e.bgColor||"#FFFFFF",r=e.fgColor||"#000000",o=e.size||160;return Ct(FC,{size:o,bgColor:t,fgColor:r,children:Ct(DC,{url:e.url,logo:{element:e.squareLogoElement??ch},outputSize:o,bgColor:t,fgColor:r})})};import{jsx as ml,jsxs as UC}from"react/jsx-runtime";var Ur=({style:e,...t})=>UC("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:[ml("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),ml("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"}),ml("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"}),ml("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"})]});import{Fragment as fl,jsx as ve,jsxs as Br}from"react/jsx-runtime";var fh="#8a63d2",gh=1e3,GC=gh*2,VC=gh*120,vh=()=>{let{authenticated:e,logout:t,ready:r,user:o}=B(),{lastScreen:n,navigate:i,navigateBack:a,setModalData:l,app:s}=x(),{getAuthFlow:c,loginWithFarcaster:u,closePrivyModal:h,createAnalyticsEvent:f}=M(),[y,w]=sd(void 0),[v,k]=sd(!1),[S,C]=sd(!1),R=BC([]),P=s?.render.inDialog?Be:0,O=c(),_=O?.meta.connectUri;return uh(()=>{let D=Date.now(),K=setInterval(async()=>{let V=await O.pollForReady.execute(),H=Date.now()-D;if(V){clearInterval(K),k(!0);try{await u(),C(!0)}catch(I){let Q={retryable:!1,message:"Authentication failed"};if(I?.privyErrorCode==="allowlist_rejected"){i("ALLOWLIST_REJECTION_SCREEN");return}else if(I?.privyErrorCode==="max_accounts_reached"){console.error(new kr(I).toString()),i("USER_LIMIT_REACHED_SCREEN");return}else I?.privyErrorCode==="linked_to_another_user"?Q.detail="This account has already been linked to another user.":I?.privyErrorCode==="invalid_credentials"?(Q.retryable=!0,Q.detail="Something went wrong. Try again."):I?.privyErrorCode==="too_many_requests"&&(Q.detail="Too many requests. Please wait before trying again.");w(Q)}}else H>VC&&(clearInterval(K),w({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},GC);return()=>{clearInterval(K),R.current.forEach(V=>clearTimeout(V))}},[]),uh(()=>{if(r&&e&&S&&o){if(s?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let K=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},P);return()=>clearTimeout(K)}S&&(tr(o,s?.embeddedWallets.createOnLogin)?R.current.push(setTimeout(()=>{l({createWallet:{onSuccess:()=>{},onFailure:K=>{console.error(K),f({eventName:"embedded_wallet_creation_failure_logout",payload:{error:K,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},P)):R.current.push(setTimeout(()=>h({shouldCallAuthOnSuccess:!0,isSuccess:!0}),P)))}},[S,r,e,o]),mh||v?Br(fl,{children:[ve(T,{backFn:n?a:void 0,onClose:h},"header"),ve(X,{}),HC?ve(fl,{children:Br(zC,{children:[ve(Rt,{children:Br("div",{children:[ve(xt,{success:S,fail:!!y}),ve(Ur,{style:{width:"38px",height:"38px"}})]})}),Br($e,{children:[ve(ne,{children:y?y.message:"Sign in with Farcaster"}),ve(se,{children:y?y.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),_&&ve(W,{onClick:D=>{D.preventDefault(),window.location.href=_},children:"Open Warpcast app"})]})}):ve(fl,{children:Br(hh,{children:[ve(Rt,{children:Br("div",{children:[ve(xt,{success:S,fail:!!y}),ve(Ur,{style:{width:"38px",height:"38px"}})]})}),Br($e,{children:[ve(ne,{children:y?y.message:"Signing in with Farcaster"}),ve(se,{children:y?y.detail:"This should only take a moment"}),ve(vt,{children:_&&mh&&ve(ul,{text:"Take me to Warpcast",url:_,color:fh})})]})]})}),ve(q,{})]}):Br(fl,{children:[ve(T,{backFn:n?a:void 0,onClose:h},"header"),ve(X,{}),ve(hh,{children:Br("div",{children:[ve(ne,{children:"Sign in with Farcaster"}),ve(se,{children:"Scan with your phone's camera to continue."}),ve(On,{children:_?ve(Xn,{url:_,size:275,squareLogoElement:Ur}):ve(Xe,{})}),Br(vt,{children:[ve(se,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),_&&ve(So,{text:_,itemName:"link",color:fh})]})]})}),ve(q,{})]})},hh=yh.div`
1405
+ `,Xn=e=>{let t=e.bgColor||"#FFFFFF",r=e.fgColor||"#000000",o=e.size||160;return Ct(DC,{size:o,bgColor:t,fgColor:r,children:Ct(NC,{url:e.url,logo:{element:e.squareLogoElement??lh},outputSize:o,bgColor:t,fgColor:r})})};import{jsx as ml,jsxs as FC}from"react/jsx-runtime";var Br=({style:e,...t})=>FC("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:[ml("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),ml("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"}),ml("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"}),ml("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"})]});import{Fragment as fl,jsx as ve,jsxs as Hr}from"react/jsx-runtime";var mh="#8a63d2",yh=1e3,HC=yh*2,GC=yh*120,gh=()=>{let{authenticated:e,logout:t,ready:r,user:o}=B(),{lastScreen:n,navigate:i,navigateBack:a,setModalData:l,app:s}=x(),{getAuthFlow:c,loginWithFarcaster:u,closePrivyModal:h,createAnalyticsEvent:f}=M(),[y,w]=sd(void 0),[v,k]=sd(!1),[S,C]=sd(!1),R=UC([]),P=s?.render.inDialog?Be:0,O=c(),_=O?.meta.connectUri;return ph(()=>{let F=Date.now(),K=setInterval(async()=>{let V=await O.pollForReady.execute(),H=Date.now()-F;if(V){clearInterval(K),k(!0);try{await u(),C(!0)}catch(I){let Q={retryable:!1,message:"Authentication failed"};if(I?.privyErrorCode==="allowlist_rejected"){i("ALLOWLIST_REJECTION_SCREEN");return}else if(I?.privyErrorCode==="max_accounts_reached"){console.error(new kr(I).toString()),i("USER_LIMIT_REACHED_SCREEN");return}else I?.privyErrorCode==="linked_to_another_user"?Q.detail="This account has already been linked to another user.":I?.privyErrorCode==="invalid_credentials"?(Q.retryable=!0,Q.detail="Something went wrong. Try again."):I?.privyErrorCode==="too_many_requests"&&(Q.detail="Too many requests. Please wait before trying again.");w(Q)}}else H>GC&&(clearInterval(K),w({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},HC);return()=>{clearInterval(K),R.current.forEach(V=>clearTimeout(V))}},[]),ph(()=>{if(r&&e&&S&&o){if(s?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let K=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},P);return()=>clearTimeout(K)}S&&(tr(o,s?.embeddedWallets.createOnLogin)?R.current.push(setTimeout(()=>{l({createWallet:{onSuccess:()=>{},onFailure:K=>{console.error(K),f({eventName:"embedded_wallet_creation_failure_logout",payload:{error:K,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},P)):R.current.push(setTimeout(()=>h({shouldCallAuthOnSuccess:!0,isSuccess:!0}),P)))}},[S,r,e,o]),uh||v?Hr(fl,{children:[ve(T,{backFn:n?a:void 0,onClose:h},"header"),ve(X,{}),BC?ve(fl,{children:Hr(VC,{children:[ve(Rt,{children:Hr("div",{children:[ve(xt,{success:S,fail:!!y}),ve(Br,{style:{width:"38px",height:"38px"}})]})}),Hr($e,{children:[ve(ne,{children:y?y.message:"Sign in with Farcaster"}),ve(se,{children:y?y.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),_&&ve(W,{onClick:F=>{F.preventDefault(),window.location.href=_},children:"Open Warpcast app"})]})}):ve(fl,{children:Hr(fh,{children:[ve(Rt,{children:Hr("div",{children:[ve(xt,{success:S,fail:!!y}),ve(Br,{style:{width:"38px",height:"38px"}})]})}),Hr($e,{children:[ve(ne,{children:y?y.message:"Signing in with Farcaster"}),ve(se,{children:y?y.detail:"This should only take a moment"}),ve(vt,{children:_&&uh&&ve(ul,{text:"Take me to Warpcast",url:_,color:mh})})]})]})}),ve(q,{})]}):Hr(fl,{children:[ve(T,{backFn:n?a:void 0,onClose:h},"header"),ve(X,{}),ve(fh,{children:Hr("div",{children:[ve(ne,{children:"Sign in with Farcaster"}),ve(se,{children:"Scan with your phone's camera to continue."}),ve(On,{children:_?ve(Xn,{url:_,size:275,squareLogoElement:Br}):ve(Xe,{})}),Hr(vt,{children:[ve(se,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),_&&ve(So,{text:_,itemName:"link",color:mh})]})]})}),ve(q,{})]})},fh=hh.div`
1406
1406
  display: flex;
1407
1407
  flex-direction: column;
1408
1408
  align-items: center;
@@ -1410,14 +1410,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
1410
1410
  margin-left: 27px;
1411
1411
  margin-right: 27px;
1412
1412
  gap: 24px;
1413
- `,zC=yh.div`
1413
+ `,VC=hh.div`
1414
1414
  display: flex;
1415
1415
  flex-direction: column;
1416
1416
  align-items: center;
1417
1417
  justify-content: center;
1418
1418
  gap: 24px;
1419
1419
  width: 100%;
1420
- `;import{useEffect as qC,useRef as $C,useState as ld}from"react";import{isIOS as KC,isMobile as Ch}from"react-device-detect";import Eh from"styled-components";import{Fragment as hl,jsx as we,jsxs as wr}from"react/jsx-runtime";var wh="#8a63d2",Th=1e3,jC=Th*2,YC=Th*300,Ph=()=>{let{lastScreen:e,navigateBack:t,data:r,app:o}=x(),{requestFarcasterSignerStatus:n,closePrivyModal:i}=M(),[a,l]=ld(void 0),[s,c]=ld(!1),[u,h]=ld(!1),f=$C([]),y=o?.render.inDialog?Be:0,w=r?.farcasterSigner;qC(()=>{let k=Date.now(),S=setInterval(async()=>{if(!w?.public_key){clearInterval(S),l({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}w.status==="approved"&&(clearInterval(S),c(!1),h(!0),f.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),y)));let C=await n(w?.public_key),R=Date.now()-k;C.status==="approved"?(clearInterval(S),c(!1),h(!0),f.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),y))):R>YC?(clearInterval(S),l({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):C.status==="revoked"&&(clearInterval(S),l({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},jC);return()=>{clearInterval(S),f.current.forEach(C=>clearTimeout(C))}},[]);let v=w?.status==="pending_approval"?w.signer_approval_url:void 0;return Ch||s?wr(hl,{children:[we(T,{backFn:e?t:void 0,onClose:i},"header"),we(X,{}),KC?we(hl,{children:wr(ZC,{children:[we(Rt,{children:wr("div",{children:[we(xt,{success:u,fail:!!a}),we(Ur,{style:{width:"38px",height:"38px"}})]})}),wr($e,{children:[we(ne,{children:a?a.message:"Add a signer to Farcaster"}),we(se,{children:a?a.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),v&&we(W,{onClick:k=>{k.preventDefault(),window.location.href=v},children:"Open Warpcast app"})]})}):we(hl,{children:wr(bh,{children:[we(Rt,{children:wr("div",{children:[we(xt,{success:u,fail:!!a}),we(Ur,{style:{width:"38px",height:"38px"}})]})}),wr($e,{children:[we(ne,{children:a?a.message:"Requesting signer from Farcaster"}),we(se,{children:a?a.detail:"This should only take a moment"}),we(vt,{children:v&&Ch&&we(ul,{text:"Take me to Warpcast",url:v,color:wh})})]})]})}),we(q,{})]}):wr(hl,{children:[we(T,{backFn:e?t:void 0,onClose:i},"header"),we(X,{}),we(bh,{children:wr("div",{children:[we(ne,{children:"Add a signer to Farcaster"}),wr(se,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),we(On,{children:w?.status==="pending_approval"?we(Xn,{url:w.signer_approval_url,size:275,squareLogoElement:Ur}):we(Xe,{})}),wr(vt,{children:[we(se,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),w?.status==="pending_approval"&&we(So,{text:w.signer_approval_url,itemName:"link",color:wh})]})]})}),we(q,{})]})},bh=Eh.div`
1420
+ `;import{useEffect as zC,useRef as qC,useState as ld}from"react";import{isIOS as $C,isMobile as vh}from"react-device-detect";import bh from"styled-components";import{Fragment as hl,jsx as we,jsxs as wr}from"react/jsx-runtime";var Ch="#8a63d2",Eh=1e3,KC=Eh*2,jC=Eh*300,Th=()=>{let{lastScreen:e,navigateBack:t,data:r,app:o}=x(),{requestFarcasterSignerStatus:n,closePrivyModal:i}=M(),[a,l]=ld(void 0),[s,c]=ld(!1),[u,h]=ld(!1),f=qC([]),y=o?.render.inDialog?Be:0,w=r?.farcasterSigner;zC(()=>{let k=Date.now(),S=setInterval(async()=>{if(!w?.public_key){clearInterval(S),l({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}w.status==="approved"&&(clearInterval(S),c(!1),h(!0),f.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),y)));let C=await n(w?.public_key),R=Date.now()-k;C.status==="approved"?(clearInterval(S),c(!1),h(!0),f.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),y))):R>jC?(clearInterval(S),l({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):C.status==="revoked"&&(clearInterval(S),l({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},KC);return()=>{clearInterval(S),f.current.forEach(C=>clearTimeout(C))}},[]);let v=w?.status==="pending_approval"?w.signer_approval_url:void 0;return vh||s?wr(hl,{children:[we(T,{backFn:e?t:void 0,onClose:i},"header"),we(X,{}),$C?we(hl,{children:wr(YC,{children:[we(Rt,{children:wr("div",{children:[we(xt,{success:u,fail:!!a}),we(Br,{style:{width:"38px",height:"38px"}})]})}),wr($e,{children:[we(ne,{children:a?a.message:"Add a signer to Farcaster"}),we(se,{children:a?a.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),v&&we(W,{onClick:k=>{k.preventDefault(),window.location.href=v},children:"Open Warpcast app"})]})}):we(hl,{children:wr(wh,{children:[we(Rt,{children:wr("div",{children:[we(xt,{success:u,fail:!!a}),we(Br,{style:{width:"38px",height:"38px"}})]})}),wr($e,{children:[we(ne,{children:a?a.message:"Requesting signer from Farcaster"}),we(se,{children:a?a.detail:"This should only take a moment"}),we(vt,{children:v&&vh&&we(ul,{text:"Take me to Warpcast",url:v,color:Ch})})]})]})}),we(q,{})]}):wr(hl,{children:[we(T,{backFn:e?t:void 0,onClose:i},"header"),we(X,{}),we(wh,{children:wr("div",{children:[we(ne,{children:"Add a signer to Farcaster"}),wr(se,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),we(On,{children:w?.status==="pending_approval"?we(Xn,{url:w.signer_approval_url,size:275,squareLogoElement:Br}):we(Xe,{})}),wr(vt,{children:[we(se,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),w?.status==="pending_approval"&&we(So,{text:w.signer_approval_url,itemName:"link",color:Ch})]})]})}),we(q,{})]})},wh=bh.div`
1421
1421
  display: flex;
1422
1422
  flex-direction: column;
1423
1423
  align-items: center;
@@ -1425,14 +1425,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
1425
1425
  margin-left: 27px;
1426
1426
  margin-right: 27px;
1427
1427
  gap: 24px;
1428
- `,ZC=Eh.div`
1428
+ `,YC=bh.div`
1429
1429
  display: flex;
1430
1430
  flex-direction: column;
1431
1431
  align-items: center;
1432
1432
  justify-content: center;
1433
1433
  gap: 24px;
1434
1434
  width: 100%;
1435
- `;import QC from"@heroicons/react/24/outline/ClockIcon";import XC from"@heroicons/react/24/outline/EyeSlashIcon";import ew from"@heroicons/react/24/outline/LinkIcon";import Hr from"styled-components";import{jsx as cd,jsxs as JC}from"react/jsx-runtime";var yl=({size:e=61,...t})=>cd("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:JC("g",{id:"moonpay_symbol_wht 2",children:[cd("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),cd("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"})]})});import{Fragment as Sh,jsx as wt,jsxs as an}from"react/jsx-runtime";var dd=({title:e,desc:t,icon:r})=>an(aw,{children:[wt(lw,{children:r}),an(sw,{children:[wt(nw,{children:e}),wt(iw,{children:t})]})]}),xh=({app:e,signedUrl:t,onContinue:r})=>an(Sh,{children:[an(rw,{children:[wt(yl,{size:"3.75rem"}),an(ow,{children:[e?.name," uses ",wt("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),an(cw,{children:[wt(dd,{icon:wt(ew,{width:"1rem"}),title:"Purchase assets to fund your account",desc:an(Sh,{children:["Connect a payment method (",wt("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),wt(dd,{icon:wt(QC,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),wt(dd,{icon:wt(XC,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),wt(dw,{className:"mobile-only"})]}),wt(tw,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),wt(Ds,{href:t,target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),tw=Hr.span`
1435
+ `;import JC from"@heroicons/react/24/outline/ClockIcon";import QC from"@heroicons/react/24/outline/EyeSlashIcon";import XC from"@heroicons/react/24/outline/LinkIcon";import Gr from"styled-components";import{jsx as cd,jsxs as ZC}from"react/jsx-runtime";var yl=({size:e=61,...t})=>cd("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:ZC("g",{id:"moonpay_symbol_wht 2",children:[cd("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),cd("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"})]})});import{Fragment as Ph,jsx as wt,jsxs as an}from"react/jsx-runtime";var dd=({title:e,desc:t,icon:r})=>an(iw,{children:[wt(sw,{children:r}),an(aw,{children:[wt(ow,{children:e}),wt(nw,{children:t})]})]}),Sh=({app:e,signedUrl:t,onContinue:r})=>an(Ph,{children:[an(tw,{children:[wt(yl,{size:"3.75rem"}),an(rw,{children:[e?.name," uses ",wt("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),an(lw,{children:[wt(dd,{icon:wt(XC,{width:"1rem"}),title:"Purchase assets to fund your account",desc:an(Ph,{children:["Connect a payment method (",wt("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),wt(dd,{icon:wt(JC,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),wt(dd,{icon:wt(QC,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),wt(cw,{className:"mobile-only"})]}),wt(ew,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),wt(Ds,{href:t,target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),ew=Gr.span`
1436
1436
  display: inline-block;
1437
1437
  color: var(--privy-color-foreground-3);
1438
1438
  text-align: center;
@@ -1441,13 +1441,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
1441
1441
  font-weight: 400;
1442
1442
  line-height: 140%; /* 0.875rem */
1443
1443
  margin-bottom: 0.25rem;
1444
- `,rw=Hr.div`
1444
+ `,tw=Gr.div`
1445
1445
  display: flex;
1446
1446
  flex-direction: column;
1447
1447
  align-items: center;
1448
1448
  justify-content: center;
1449
1449
  padding: 1.5rem 0;
1450
- `,ow=Hr.span`
1450
+ `,rw=Gr.span`
1451
1451
  color: var(--privy-color-foreground);
1452
1452
  text-align: center;
1453
1453
  font-size: 1.125rem;
@@ -1456,46 +1456,46 @@ You will need this password to access your ${e} wallet on a new device. Please k
1456
1456
  margin: 1.5rem 0;
1457
1457
  text-align: center;
1458
1458
  max-width: 19.5rem;
1459
- `,nw=Hr.span`
1459
+ `,ow=Gr.span`
1460
1460
  color: var(--privy-color-foreground);
1461
1461
  font-size: 0.875rem;
1462
1462
  font-weight: 500;
1463
1463
  line-height: 1.225rem;
1464
1464
  width: 100%;
1465
- `,iw=Hr.span`
1465
+ `,nw=Gr.span`
1466
1466
  color: var(--privy-color-foreground-2);
1467
1467
  font-size: 0.875rem;
1468
1468
  font-weight: 400;
1469
1469
  line-height: 1.225rem;
1470
- `,aw=Hr.div`
1470
+ `,iw=Gr.div`
1471
1471
  display: flex;
1472
1472
  align-items: flex-start;
1473
1473
  gap: 0.5rem;
1474
1474
  align-self: stretch;
1475
- `,sw=Hr.div`
1475
+ `,aw=Gr.div`
1476
1476
  display: flex;
1477
1477
  flex-direction: column;
1478
1478
  gap: 0.25rem;
1479
1479
  align-items: flex-start;
1480
1480
  text-align: left;
1481
1481
  flex: 1 0 0;
1482
- `,lw=Hr.div`
1482
+ `,sw=Gr.div`
1483
1483
  padding-top: 2px;
1484
- `,cw=Hr.div`
1484
+ `,lw=Gr.div`
1485
1485
  display: flex;
1486
1486
  flex-direction: column;
1487
1487
  gap: 1.25rem;
1488
1488
  margin: 0 0.5rem;
1489
- `,dw=Hr.div`
1489
+ `,cw=Gr.div`
1490
1490
  margin: 30px 0;
1491
- `;import{ofetch as pw}from"ofetch";import{useEffect as uw,useRef as mw,useState as fw}from"react";var gl="moonpay",kh="sdk_fiat_on_ramp_completed_with_status";async function _h(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 hw(e,t){let r=t?Zp:Yp,o=t?Qp:Jp;return pw(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function Ah(e,t=!1){let[r,o]=fw(null),{createAnalyticsEvent:n}=M(),i=mw(0);return uw(()=>{let a=setInterval(async()=>{if(e)try{let[l]=await hw(e,t),s=l.status==="waitingAuthorization"&&l.paymentMethod==="credit_debit_card"?"pending":l.status;o(s),["failed","completed","awaitingAuthorization"].includes(s)&&(n({eventName:kh,payload:{status:s,provider:gl,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:kh,payload:{status:"serviceFailure",provider:gl}}),clearInterval(a))}},3e3);return()=>clearInterval(a)},[e,i]),r}import{Fragment as yw,jsx as pd,jsxs as gw}from"react/jsx-runtime";var Rh=()=>{let{app:e,data:t,navigate:r}=x(),{createAnalyticsEvent:o}=M(),{signedUrl:n}=t.fiatOnRampPrompt;return!e||!n?null:gw(yw,{children:[pd(T,{title:"Fund account"},"header"),pd(xh,{app:e,signedUrl:n,onContinue:()=>{o({eventName:"sdk_fiat_on_ramp_started",payload:{provider:gl}}),r("FIAT_ON_RAMP_STATUS_SCREEN")}}),pd(z,{protectedByPrivy:!0})]})};import vw from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import Cw from"@heroicons/react/24/solid/CheckCircleIcon";import ww from"@heroicons/react/24/solid/XCircleIcon";import{useMemo as bw}from"react";import Ih from"styled-components";import{Fragment as ud,jsx as bt,jsxs as sn}from"react/jsx-runtime";var Mh=()=>{let{app:e,data:t}=x(),{closePrivyModal:r}=M(),{externalTransactionId:o}=t?.fiatOnRampStatus,n=Ah(o||null,e.fiatOnRamp.useSandbox);return sn(ud,{children:[bt(T,{title:"Fund account"},"header"),bt(Tw,{status:n,onClickCta:r}),bt(z,{protectedByPrivy:!0})]})},Ew=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:sn(ud,{children:[sn("p",{children:["It looks like there was an issue with your payment. Please contact"," ",bt("a",{href:"https://support.moonpay.com/hc/en-gb",target:"_blank",rel:"noreferrer noopener",style:{textDecoration:"underline"},children:"Moonpay support"})," ","for assistance."]}),bt("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:""}}},Tw=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=bw(()=>Ew(e),[e]);return sn(ud,{children:[sn(_w,{children:[bt(xw,{status:e}),sn($e,{children:[bt("h3",{children:r}),bt(kw,{children:o})]})]}),n&&bt(W,{onClick:t,children:n})]})},Pw=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)",Sw=e=>{switch(e){case"serviceFailure":case"failed":return ww;case"completed":return Cw;case"waitingAuthorization":return()=>bt(vw,{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}},xw=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return sn("div",{style:{position:"relative"},children:[bt(Xe,{color:o,style:{position:"absolute"}}),bt(Ic,{color:o}),bt(yl,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=Sw(e),r=Pw(e);return bt("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&bt(t,{width:"4rem",height:"4rem",color:r})})},kw=Ih.p`
1491
+ `;import{ofetch as dw}from"ofetch";import{useEffect as pw,useRef as uw,useState as mw}from"react";var gl="moonpay",xh="sdk_fiat_on_ramp_completed_with_status";async function kh(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 fw(e,t){let r=t?Yp:jp,o=t?Jp:Zp;return dw(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function _h(e,t=!1){let[r,o]=mw(null),{createAnalyticsEvent:n}=M(),i=uw(0);return pw(()=>{let a=setInterval(async()=>{if(e)try{let[l]=await fw(e,t),s=l.status==="waitingAuthorization"&&l.paymentMethod==="credit_debit_card"?"pending":l.status;o(s),["failed","completed","awaitingAuthorization"].includes(s)&&(n({eventName:xh,payload:{status:s,provider:gl,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:xh,payload:{status:"serviceFailure",provider:gl}}),clearInterval(a))}},3e3);return()=>clearInterval(a)},[e,i]),r}import{Fragment as hw,jsx as pd,jsxs as yw}from"react/jsx-runtime";var Ah=()=>{let{app:e,data:t,navigate:r}=x(),{createAnalyticsEvent:o}=M(),{signedUrl:n}=t.fiatOnRampPrompt;return!e||!n?null:yw(hw,{children:[pd(T,{title:"Fund account"},"header"),pd(Sh,{app:e,signedUrl:n,onContinue:()=>{o({eventName:"sdk_fiat_on_ramp_started",payload:{provider:gl}}),r("FIAT_ON_RAMP_STATUS_SCREEN")}}),pd(z,{protectedByPrivy:!0})]})};import gw from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import vw from"@heroicons/react/24/solid/CheckCircleIcon";import Cw from"@heroicons/react/24/solid/XCircleIcon";import{useMemo as ww}from"react";import Rh from"styled-components";import{Fragment as ud,jsx as bt,jsxs as sn}from"react/jsx-runtime";var Ih=()=>{let{app:e,data:t}=x(),{closePrivyModal:r}=M(),{externalTransactionId:o}=t?.fiatOnRampStatus,n=_h(o||null,e.fiatOnRamp.useSandbox);return sn(ud,{children:[bt(T,{title:"Fund account"},"header"),bt(Ew,{status:n,onClickCta:r}),bt(z,{protectedByPrivy:!0})]})},bw=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:sn(ud,{children:[sn("p",{children:["It looks like there was an issue with your payment. Please contact"," ",bt("a",{href:"https://support.moonpay.com/hc/en-gb",target:"_blank",rel:"noreferrer noopener",style:{textDecoration:"underline"},children:"Moonpay support"})," ","for assistance."]}),bt("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:""}}},Ew=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=ww(()=>bw(e),[e]);return sn(ud,{children:[sn(kw,{children:[bt(Sw,{status:e}),sn($e,{children:[bt("h3",{children:r}),bt(xw,{children:o})]})]}),n&&bt(W,{onClick:t,children:n})]})},Tw=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)",Pw=e=>{switch(e){case"serviceFailure":case"failed":return Cw;case"completed":return vw;case"waitingAuthorization":return()=>bt(gw,{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}},Sw=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return sn("div",{style:{position:"relative"},children:[bt(Xe,{color:o,style:{position:"absolute"}}),bt(Ic,{color:o}),bt(yl,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=Pw(e),r=Tw(e);return bt("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&bt(t,{width:"4rem",height:"4rem",color:r})})},xw=Rh.p`
1492
1492
  font-size: 1rem;
1493
1493
  color: var(--privy-color-foreground-3);
1494
1494
  margin-bottom: 1rem;
1495
1495
  display: flex;
1496
1496
  flex-direction: column;
1497
1497
  gap: 1rem;
1498
- `,_w=Ih.div`
1498
+ `,kw=Rh.div`
1499
1499
  display: flex;
1500
1500
  flex-direction: column;
1501
1501
  align-items: center;
@@ -1503,7 +1503,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1503
1503
  margin-left: 1.75rem;
1504
1504
  margin-right: 1.75rem;
1505
1505
  padding: 2rem 0;
1506
- `;import Aw from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import Rw from"styled-components";import{Fragment as Mw,jsx as xo,jsxs as Ww}from"react/jsx-runtime";var Wh=()=>{let{closePrivyModal:e}=M();return Ww(Mw,{children:[xo(T,{},"header"),xo(Iw,{children:xo(Aw,{style:{width:32,height:32}})}),xo(Nr,{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"}}),xo(ar,{children:xo(W,{onClick:()=>e(),children:"Close"})}),xo(ie,{}),xo(z,{protectedByPrivy:!0})]})},Iw=Rw.div`
1506
+ `;import _w from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import Aw from"styled-components";import{Fragment as Iw,jsx as xo,jsxs as Mw}from"react/jsx-runtime";var Mh=()=>{let{closePrivyModal:e}=M();return Mw(Iw,{children:[xo(T,{},"header"),xo(Rw,{children:xo(_w,{style:{width:32,height:32}})}),xo(Dr,{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"}}),xo(ar,{children:xo(W,{onClick:()=>e(),children:"Close"})}),xo(ie,{}),xo(z,{protectedByPrivy:!0})]})},Rw=Aw.div`
1507
1507
  border-radius: 50%;
1508
1508
  height: 68px;
1509
1509
  width: 68px;
@@ -1513,7 +1513,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1513
1513
  background-color: var(--privy-color-accent);
1514
1514
  color: white;
1515
1515
  margin: 0 auto 24px auto;
1516
- `;import*as Dh from"react-device-detect";import Dw from"styled-components";import md from"styled-components";import{jsx as Lh}from"react/jsx-runtime";var Oh=({style:e,...t})=>Lh("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:Lh("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)"})});import{jsx as Ow,jsxs as Nw}from"react/jsx-runtime";var Nh=md.div`
1516
+ `;import*as Nh from"react-device-detect";import Nw from"styled-components";import md from"styled-components";import{jsx as Wh}from"react/jsx-runtime";var Lh=({style:e,...t})=>Wh("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:Wh("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)"})});import{jsx as Lw,jsxs as Ow}from"react/jsx-runtime";var Oh=md.div`
1517
1517
  display: flex;
1518
1518
  flex-direction: column;
1519
1519
  justify-content: flex-start;
@@ -1524,7 +1524,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1524
1524
  border-left: 2px solid var(--privy-color-foreground-4);
1525
1525
  height: 12px;
1526
1526
  }
1527
- `,vl=({children:e})=>Nw(Lw,{children:[Ow(Oh,{style:{width:"16px",height:"16px"}}),e]}),Lw=md.div`
1527
+ `,vl=({children:e})=>Ow(Ww,{children:[Lw(Lh,{style:{width:"16px",height:"16px"}}),e]}),Ww=md.div`
1528
1528
  display: flex;
1529
1529
  justify-content: flex-start;
1530
1530
  justify-items: center;
@@ -1542,15 +1542,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
1542
1542
  margin-bottom: auto;
1543
1543
  }
1544
1544
  }
1545
- `;import{Fragment as Bw,jsx as rt,jsxs as Xi}from"react/jsx-runtime";var Fw=()=>Xi(Uw,{children:[rt(Fi,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),rt(vt,{children:rt(Ir,{style:{width:"152px",height:"152px"}})}),Xi(Nh,{children:[rt(vl,{children:Xi("div",{children:[rt("span",{children:"Install the "}),rt("a",{href:Dh.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"})]})}),rt(fd,{}),rt(vl,{children:"Set up your first wallet"}),rt(fd,{}),rt(vl,{children:"Store your recovery phrase in a safe place!"})]}),rt(Fs,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),Fh=()=>{let{navigateBack:e}=x();return Xi(Bw,{children:[rt(T,{backFn:e},"header"),rt(X,{}),rt(Fw,{}),rt(ie,{}),Xi(q,{children:[rt("span",{children:"Still not sure? "}),rt("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},Uw=Dw(vt)`
1545
+ `;import{Fragment as Uw,jsx as rt,jsxs as Xi}from"react/jsx-runtime";var Dw=()=>Xi(Fw,{children:[rt(Fi,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),rt(vt,{children:rt(Ir,{style:{width:"152px",height:"152px"}})}),Xi(Oh,{children:[rt(vl,{children:Xi("div",{children:[rt("span",{children:"Install the "}),rt("a",{href:Nh.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"})]})}),rt(fd,{}),rt(vl,{children:"Set up your first wallet"}),rt(fd,{}),rt(vl,{children:"Store your recovery phrase in a safe place!"})]}),rt(Fs,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),Dh=()=>{let{navigateBack:e}=x();return Xi(Uw,{children:[rt(T,{backFn:e},"header"),rt(X,{}),rt(Dw,{}),rt(ie,{}),Xi(q,{children:[rt("span",{children:"Still not sure? "}),rt("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},Fw=Nw(vt)`
1546
1546
  gap: 30px;
1547
1547
 
1548
1548
  > :first-child > svg {
1549
1549
  margin-top: 20px;
1550
1550
  }
1551
- `;import E4 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as T4,useState as Jh}from"react";import{isMobile as P4}from"react-device-detect";import S4 from"styled-components";import $w from"@heroicons/react/24/outline/EnvelopeIcon";import{useRef as Kw}from"react";import Hw from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as Gw,useState as Uh}from"react";import Hh from"styled-components";import{Fragment as qw,jsx as ea,jsxs as Bh}from"react/jsx-runtime";var Cl=Gw((e,t)=>{let[r,o]=Uh(""),[n,i]=Uh(!1),{authenticated:a}=B(),{initLoginWithEmail:l}=M(),{navigate:s,setModalData:c,currentScreen:u}=x(),{enabled:h,token:f}=Ce(),y=Ga(r),w=n,v=n||!y,k=C=>{i(!0),l(r,C).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(R=>{c({errorModalData:{error:R,previousScreen:u||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},S=()=>{h&&!f&&!a?(c({captchaModalData:{callback:C=>l(r,C),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):k(f)};return Bh(qw,{children:[ea(Vw,{children:Bh(zw,{stacked:e.stacked,children:[ea(Hw,{}),ea("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:C=>o(C.target.value),onKeyUp:C=>{C.key==="Enter"&&S()},value:r,autoComplete:"email"}),e.stacked?null:ea(In,{isSubmitting:w,onClick:S,disabled:v,children:"Submit"})]})}),e.stacked?ea(W,{loadingText:null,loading:w,disabled:v,onClick:S,children:"Submit"}):null]})}),Vw=Hh.div`
1551
+ `;import b4 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as E4,useState as Zh}from"react";import{isMobile as T4}from"react-device-detect";import P4 from"styled-components";import qw from"@heroicons/react/24/outline/EnvelopeIcon";import{useRef as $w}from"react";import Bw from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as Hw,useState as Fh}from"react";import Bh from"styled-components";import{Fragment as zw,jsx as ea,jsxs as Uh}from"react/jsx-runtime";var Cl=Hw((e,t)=>{let[r,o]=Fh(""),[n,i]=Fh(!1),{authenticated:a}=B(),{initLoginWithEmail:l}=M(),{navigate:s,setModalData:c,currentScreen:u}=x(),{enabled:h,token:f}=Ce(),y=Ga(r),w=n,v=n||!y,k=C=>{i(!0),l(r,C).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(R=>{c({errorModalData:{error:R,previousScreen:u||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},S=()=>{h&&!f&&!a?(c({captchaModalData:{callback:C=>l(r,C),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):k(f)};return Uh(zw,{children:[ea(Gw,{children:Uh(Vw,{stacked:e.stacked,children:[ea(Bw,{}),ea("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:C=>o(C.target.value),onKeyUp:C=>{C.key==="Enter"&&S()},value:r,autoComplete:"email"}),e.stacked?null:ea(In,{isSubmitting:w,onClick:S,disabled:v,children:"Submit"})]})}),e.stacked?ea(W,{loadingText:null,loading:w,disabled:v,onClick:S,children:"Submit"}):null]})}),Gw=Bh.div`
1552
1552
  width: 100%;
1553
- `,zw=Hh.label`
1553
+ `,Vw=Bh.label`
1554
1554
  display: block;
1555
1555
  position: relative;
1556
1556
  width: 100%;
@@ -1611,7 +1611,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1611
1611
  && > input::placeholder {
1612
1612
  color: var(--privy-color-foreground-3);
1613
1613
  }
1614
- `;import{Fragment as jw,jsx as wl,jsxs as Gh}from"react/jsx-runtime";var bl=({isEditable:e,setIsEditable:t})=>{let r=Kw(null);return Gh(jw,{children:[wl(eo,{if:!e,children:wl(Cl,{ref:r})}),wl(eo,{if:e,children:Gh(Ae,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[wl($w,{})," Continue with Email"]})})]})};import{useState as Yw}from"react";import{jsx as hd,jsxs as Zw}from"react/jsx-runtime";var El=()=>{let[e,t]=Yw(!1),{currentScreen:r,navigate:o,setModalData:n}=x(),{enabled:i,token:a}=Ce(),{initLoginWithFarcaster:l}=M();return Zw(Ae,{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:[hd(Ur,{})," Farcaster",e&&hd("span",{children:hd(Xr,{})})]})};import Jw,{css as Qw}from"styled-components";import{jsx as t4}from"react/jsx-runtime";var Tl=()=>{let{enabled:e,token:t}=Ce(),{navigate:r,setModalData:o}=x(),{initLoginWithPasskey:n}=M();return t4(e4,{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"})},Xw=Qw`
1614
+ `;import{Fragment as Kw,jsx as wl,jsxs as Hh}from"react/jsx-runtime";var bl=({isEditable:e,setIsEditable:t})=>{let r=$w(null);return Hh(Kw,{children:[wl(to,{if:!e,children:wl(Cl,{ref:r})}),wl(to,{if:e,children:Hh(Ae,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[wl(qw,{})," Continue with Email"]})})]})};import{useState as jw}from"react";import{jsx as hd,jsxs as Yw}from"react/jsx-runtime";var El=()=>{let[e,t]=jw(!1),{currentScreen:r,navigate:o,setModalData:n}=x(),{enabled:i,token:a}=Ce(),{initLoginWithFarcaster:l}=M();return Yw(Ae,{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:[hd(Br,{})," Farcaster",e&&hd("span",{children:hd(eo,{})})]})};import Zw,{css as Jw}from"styled-components";import{jsx as e4}from"react/jsx-runtime";var Tl=()=>{let{enabled:e,token:t}=Ce(),{navigate:r,setModalData:o}=x(),{initLoginWithPasskey:n}=M();return e4(Xw,{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"})},Qw=Jw`
1615
1615
  && {
1616
1616
  width: 100%;
1617
1617
  font-size: 0.875rem;
@@ -1636,11 +1636,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1636
1636
  box-shadow: none;
1637
1637
  }
1638
1638
  }
1639
- `,e4=Jw.button`
1640
- ${Xw}
1641
- `;import f4 from"@heroicons/react/24/outline/PhoneIcon";import{useRef as h4}from"react";import{forwardRef as d4,useState as yd}from"react";import jh from"styled-components";import r4 from"libphonenumber-js/examples.mobile.json";import{isPossiblePhoneNumber as o4,AsYouType as n4,getCountries as i4,getCountryCallingCode as Pl,getExampleNumber as a4}from"libphonenumber-js/min";import{jsx as c4,jsxs as l4}from"react/jsx-runtime";var ta=(e,t)=>o4(String(e),t),Sl=(e,t)=>`+${Pl(t)} ${e}`,Vh=e=>`*${e.replaceAll("-","").slice(-4)}`,zh=e=>new n4(e),s4=i4().map(e=>({code:e,callCode:Pl(e)})),qh=e=>{let t=a4(e,r4)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},$h=({value:e,onChange:t})=>c4("select",{value:e,onChange:t,children:s4.map(r=>l4("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))});import{Fragment as m4,jsx as ra,jsxs as Kh}from"react/jsx-runtime";var ei=d4((e,t)=>{let{app:r}=x(),[o,n]=yd(""),[i,a]=yd(r?.intl.defaultCountry??"US"),l=ta(o,i),s=zh(i),c=qh(i),u=Pl(i),h=!l,[f,y]=yd(!1),w=u.length,v=C=>{let R=C.target.value;a(R),n(""),e.onChange&&e.onChange({rawPhoneNumber:o,qualifiedPhoneNumber:Sl(o,R),countryCode:R,isValid:ta(o,i)})},k=C=>{try{let R=C.replace(/\D/g,""),P=o.replace(/\D/g,""),O=R===P?C:s.input(C);n(O),e.onChange&&e.onChange({rawPhoneNumber:O,qualifiedPhoneNumber:Sl(C,i),countryCode:i,isValid:ta(C,i)})}catch(R){console.error("Error processing phone number:",R)}},S=()=>{y(!0);let C=Sl(o,i);e.onSubmit({rawPhoneNumber:o,qualifiedPhoneNumber:C,countryCode:i,isValid:ta(o,i)}).finally(()=>y(!1))};return Kh(m4,{children:[ra(p4,{children:Kh(u4,{callingCodeLength:w,stacked:e.stacked,children:[ra($h,{value:i,onChange:v}),ra("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:c,onChange:C=>{k(C.target.value)},onKeyUp:C=>{C.key==="Enter"&&S()},value:o,autoComplete:"tel"}),!e.stacked&&!e.noIncludeSubmitButton?ra(In,{isSubmitting:f,onClick:S,disabled:h,children:"Submit"}):null]})}),e.stacked&&!e.noIncludeSubmitButton?ra(W,{loading:f,loadingText:null,onClick:S,disabled:h,children:"Submit"}):null]})}),p4=jh.div`
1639
+ `,Xw=Zw.button`
1640
+ ${Qw}
1641
+ `;import m4 from"@heroicons/react/24/outline/PhoneIcon";import{useRef as f4}from"react";import{forwardRef as c4,useState as yd}from"react";import Kh from"styled-components";import t4 from"libphonenumber-js/examples.mobile.json";import{isPossiblePhoneNumber as r4,AsYouType as o4,getCountries as n4,getCountryCallingCode as Pl,getExampleNumber as i4}from"libphonenumber-js/min";import{jsx as l4,jsxs as s4}from"react/jsx-runtime";var ta=(e,t)=>r4(String(e),t),Sl=(e,t)=>`+${Pl(t)} ${e}`,Gh=e=>`*${e.replaceAll("-","").slice(-4)}`,Vh=e=>new o4(e),a4=n4().map(e=>({code:e,callCode:Pl(e)})),zh=e=>{let t=i4(e,t4)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},qh=({value:e,onChange:t})=>l4("select",{value:e,onChange:t,children:a4.map(r=>s4("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))});import{Fragment as u4,jsx as ra,jsxs as $h}from"react/jsx-runtime";var ei=c4((e,t)=>{let{app:r}=x(),[o,n]=yd(""),[i,a]=yd(r?.intl.defaultCountry??"US"),l=ta(o,i),s=Vh(i),c=zh(i),u=Pl(i),h=!l,[f,y]=yd(!1),w=u.length,v=C=>{let R=C.target.value;a(R),n(""),e.onChange&&e.onChange({rawPhoneNumber:o,qualifiedPhoneNumber:Sl(o,R),countryCode:R,isValid:ta(o,i)})},k=C=>{try{let R=C.replace(/\D/g,""),P=o.replace(/\D/g,""),O=R===P?C:s.input(C);n(O),e.onChange&&e.onChange({rawPhoneNumber:O,qualifiedPhoneNumber:Sl(C,i),countryCode:i,isValid:ta(C,i)})}catch(R){console.error("Error processing phone number:",R)}},S=()=>{y(!0);let C=Sl(o,i);e.onSubmit({rawPhoneNumber:o,qualifiedPhoneNumber:C,countryCode:i,isValid:ta(o,i)}).finally(()=>y(!1))};return $h(u4,{children:[ra(d4,{children:$h(p4,{callingCodeLength:w,stacked:e.stacked,children:[ra(qh,{value:i,onChange:v}),ra("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:c,onChange:C=>{k(C.target.value)},onKeyUp:C=>{C.key==="Enter"&&S()},value:o,autoComplete:"tel"}),!e.stacked&&!e.noIncludeSubmitButton?ra(In,{isSubmitting:f,onClick:S,disabled:h,children:"Submit"}):null]})}),e.stacked&&!e.noIncludeSubmitButton?ra(W,{loading:f,loadingText:null,onClick:S,disabled:h,children:"Submit"}):null]})}),d4=Kh.div`
1642
1642
  width: 100%;
1643
- `,u4=jh.label`
1643
+ `,p4=Kh.label`
1644
1644
  --country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.callingCodeLength}px));
1645
1645
  --phone-input-extra-padding-left: calc(12px + calc(3 * ${e=>e.callingCodeLength}px));
1646
1646
  display: block;
@@ -1727,11 +1727,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1727
1727
  && > input::placeholder {
1728
1728
  color: var(--privy-color-foreground-3);
1729
1729
  }
1730
- `;import{Fragment as y4,jsx as xl,jsxs as Yh}from"react/jsx-runtime";var kl=({isEditable:e,setIsEditable:t})=>{let r=h4(null),{authenticated:o}=B(),{navigate:n,setModalData:i,currentScreen:a}=x(),{initLoginWithSms:l}=M(),{enabled:s,token:c}=Ce();async function u({qualifiedPhoneNumber:h}){if(s&&!c&&!o)i({captchaModalData:{callback:f=>l(h,f),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(h,c),n("AWAITING_PASSWORDLESS_CODE")}catch(f){i({errorModalData:{error:f,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return Yh(y4,{children:[xl(eo,{if:!e,children:xl(ei,{ref:r,onSubmit:u})}),xl(eo,{if:e,children:Yh(Ae,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[xl(f4,{})," Continue with SMS"]})})]})};import{useState as g4}from"react";import{jsx as ko,jsxs as C4}from"react/jsx-runtime";var v4={apple:{logo:ko(Qa,{}),displayName:"Apple"},discord:{logo:ko(Xa,{}),displayName:"Discord"},github:{logo:ko(es,{}),displayName:"GitHub"},google:{logo:ko(rs,{}),displayName:"Google"},linkedin:{logo:ko(ns,{}),displayName:"LinkedIn"},spotify:{logo:ko(is,{}),displayName:"Spotify"},twitter:{logo:ko(ss,{}),displayName:"Twitter"},tiktok:{logo:ko(as,{}),displayName:"TikTok"}},ot=({provider:e})=>{let{enabled:t,token:r}=Ce(),{navigate:o,setModalData:n}=x(),[i,a]=g4(!1),{initLoginWithOAuth:l}=M(),{displayName:s,logo:c}=v4[e];return C4(Ae,{onClick:()=>{a(!0),t&&!r?(n({captchaModalData:{callback:h=>l(e,h),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):l(e)},disabled:i,children:[c," ",s]})};import w4 from"@heroicons/react/24/outline/ChevronRightIcon";import{jsx as Zh,jsxs as b4}from"react/jsx-runtime";var _l=({onClick:e,text:t,icon:r})=>b4(Ae,{onClick:e,children:[r,Zh(Bs,{children:t}),Zh(w4,{})]});import{Fragment as gd,jsx as Ke,jsxs as Rl}from"react/jsx-runtime";var Il=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=M(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=x(),i=o.loginMethodsAndOrder?.primary??[],a=o.loginMethodsAndOrder?.overflow??[],l=[...i,...a],s=o.loginMethods.passkey,[c,u]=Jh("default"),[h,f]=Jh("email");T4(()=>{let _=l.indexOf("sms"),D=l.indexOf("email");_>-1&&_<D&&f("sms")},[i,a]);let y=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{u("default")},150)};n.current=y;let w=_=>_==="email"?Ke(bl,{isEditable:h==="email",setIsEditable:()=>{f("email")}},_):_==="sms"?Ke(kl,{isEditable:h==="sms",setIsEditable:()=>{f("sms")}},_):_==="apple"?Ke(ot,{provider:"apple"},_):_==="discord"?Ke(ot,{provider:"discord"},_):_==="farcaster"?Ke(El,{},_):_==="github"?Ke(ot,{provider:"github"},_):_==="google"?Ke(ot,{provider:"google"},_):_==="linkedin"?Ke(ot,{provider:"linkedin"},_):_==="tiktok"?Ke(ot,{provider:"tiktok"},_):_==="twitter"&&(!P4||o?.loginConfig.twitterOAuthOnMobileEnabled)?Ke(ot,{provider:"twitter"},_):Gi([_],r,e,l),v=i.map(w).flat(),k=a.map(w).flat(),S=[...v,...k],C=x4({primary:v.length,overflow:k.length}),[R,P]=tu(S,C),O=c==="default"?void 0:()=>{u("default")};return Rl(gd,{children:[Ke(T,{title:o.appearance.landingHeader,onClose:y,backFn:O}),c==="default"&&Ke(k4,{}),Ke(Hs,{style:{overflow:"hidden",padding:2},children:Rl(nr,{children:[c==="default"&&Rl(gd,{children:[...R,P.length>0&&Ke(_l,{text:"More options",icon:Ke(E4,{}),onClick:()=>u("overflow")})]}),c==="overflow"&&Rl(gd,{children:[...P]}),s&&c==="default"&&Ke(Tl,{})]})}),o&&Ke(Mn,{app:o}),Ke(z,{protectedByPrivy:!0})]})},Al=5,x4=({primary:e,overflow:t})=>e<Al?e:e===Al&&t===0?Al:Al-1,k4=S4(Hn)`
1730
+ `;import{Fragment as h4,jsx as xl,jsxs as jh}from"react/jsx-runtime";var kl=({isEditable:e,setIsEditable:t})=>{let r=f4(null),{authenticated:o}=B(),{navigate:n,setModalData:i,currentScreen:a}=x(),{initLoginWithSms:l}=M(),{enabled:s,token:c}=Ce();async function u({qualifiedPhoneNumber:h}){if(s&&!c&&!o)i({captchaModalData:{callback:f=>l(h,f),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(h,c),n("AWAITING_PASSWORDLESS_CODE")}catch(f){i({errorModalData:{error:f,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return jh(h4,{children:[xl(to,{if:!e,children:xl(ei,{ref:r,onSubmit:u})}),xl(to,{if:e,children:jh(Ae,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[xl(m4,{})," Continue with SMS"]})})]})};import{useState as y4}from"react";import{jsx as ko,jsxs as v4}from"react/jsx-runtime";var g4={apple:{logo:ko(Qa,{}),displayName:"Apple"},discord:{logo:ko(Xa,{}),displayName:"Discord"},github:{logo:ko(es,{}),displayName:"GitHub"},google:{logo:ko(rs,{}),displayName:"Google"},linkedin:{logo:ko(ns,{}),displayName:"LinkedIn"},spotify:{logo:ko(is,{}),displayName:"Spotify"},twitter:{logo:ko(ss,{}),displayName:"Twitter"},tiktok:{logo:ko(as,{}),displayName:"TikTok"}},ot=({provider:e})=>{let{enabled:t,token:r}=Ce(),{navigate:o,setModalData:n}=x(),[i,a]=y4(!1),{initLoginWithOAuth:l}=M(),{displayName:s,logo:c}=g4[e];return v4(Ae,{onClick:()=>{a(!0),t&&!r?(n({captchaModalData:{callback:h=>l(e,h),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):l(e)},disabled:i,children:[c," ",s]})};import C4 from"@heroicons/react/24/outline/ChevronRightIcon";import{jsx as Yh,jsxs as w4}from"react/jsx-runtime";var _l=({onClick:e,text:t,icon:r})=>w4(Ae,{onClick:e,children:[r,Yh(Bs,{children:t}),Yh(C4,{})]});import{Fragment as gd,jsx as Ke,jsxs as Rl}from"react/jsx-runtime";var Il=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=M(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=x(),i=o.loginMethodsAndOrder?.primary??[],a=o.loginMethodsAndOrder?.overflow??[],l=[...i,...a],s=o.loginMethods.passkey,[c,u]=Zh("default"),[h,f]=Zh("email");E4(()=>{let _=l.indexOf("sms"),F=l.indexOf("email");_>-1&&_<F&&f("sms")},[i,a]);let y=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{u("default")},150)};n.current=y;let w=_=>_==="email"?Ke(bl,{isEditable:h==="email",setIsEditable:()=>{f("email")}},_):_==="sms"?Ke(kl,{isEditable:h==="sms",setIsEditable:()=>{f("sms")}},_):_==="apple"?Ke(ot,{provider:"apple"},_):_==="discord"?Ke(ot,{provider:"discord"},_):_==="farcaster"?Ke(El,{},_):_==="github"?Ke(ot,{provider:"github"},_):_==="google"?Ke(ot,{provider:"google"},_):_==="linkedin"?Ke(ot,{provider:"linkedin"},_):_==="tiktok"?Ke(ot,{provider:"tiktok"},_):_==="twitter"&&(!T4||o?.loginConfig.twitterOAuthOnMobileEnabled)?Ke(ot,{provider:"twitter"},_):Gi([_],r,e,l),v=i.map(w).flat(),k=a.map(w).flat(),S=[...v,...k],C=S4({primary:v.length,overflow:k.length}),[R,P]=eu(S,C),O=c==="default"?void 0:()=>{u("default")};return Rl(gd,{children:[Ke(T,{title:o.appearance.landingHeader,onClose:y,backFn:O}),c==="default"&&Ke(x4,{}),Ke(Hs,{style:{overflow:"hidden",padding:2},children:Rl(nr,{children:[c==="default"&&Rl(gd,{children:[...R,P.length>0&&Ke(_l,{text:"More options",icon:Ke(b4,{}),onClick:()=>u("overflow")})]}),c==="overflow"&&Rl(gd,{children:[...P]}),s&&c==="default"&&Ke(Tl,{})]})}),o&&Ke(Mn,{app:o}),Ke(z,{protectedByPrivy:!0})]})},Al=5,S4=({primary:e,overflow:t})=>e<Al?e:e===Al&&t===0?Al:Al-1,x4=P4(Hn)`
1731
1731
  margin-bottom: 16px;
1732
- `;import I4 from"@heroicons/react/24/outline/EnvelopeIcon";import M4 from"@heroicons/react/24/outline/PhoneIcon";import W4 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as L4,useState as ty}from"react";import{isMobile as O4}from"react-device-detect";import N4 from"styled-components";import{jsx as oa,jsxs as Qh}from"react/jsx-runtime";var Xh=({...e})=>Qh("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[Qh("g",{clipPath:"url(#clip0_2856_1743)",children:[oa("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"}),oa("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"})]}),oa("defs",{children:oa("clipPath",{id:"clip0_2856_1743",children:oa("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});import _4 from"@heroicons/react/24/outline/ChevronRightIcon";import A4 from"@heroicons/react/24/outline/WalletIcon";import{jsx as vd,jsxs as R4}from"react/jsx-runtime";var ey=({onClick:e,text:t})=>R4(Ae,{onClick:e,children:[vd(A4,{}),vd(Bs,{children:t}),vd(_4,{})]});import{Fragment as na,jsx as We,jsxs as ti}from"react/jsx-runtime";var Ml=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=M(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=x(),{email:i,sms:a,google:l,twitter:s,discord:c,github:u,spotify:h,tiktok:f,linkedin:y,apple:w,wallet:v,farcaster:k,passkey:S}=o?.loginMethods??{},C=o?.appearance.loginGroupPriority||"web2-first",R=o?.appearance.hideDirectWeb2Inputs,[P,O]=ty("default"),[_,D]=ty(i?"email":"sms");L4(()=>{D(i?"email":"sms")},[i]);let K=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{O("default")},150)};n.current=K;let V=[i&&We(bl,{isEditable:_==="email",setIsEditable:()=>{D("email")}}),a&&We(kl,{isEditable:_==="sms",setIsEditable:()=>{D("sms")}})].filter(Boolean),H=[l&&We(ot,{provider:"google"}),s&&(!O4||o?.loginConfig.twitterOAuthOnMobileEnabled)&&We(ot,{provider:"twitter"}),c&&We(ot,{provider:"discord"}),u&&We(ot,{provider:"github"}),h&&We(ot,{provider:"spotify"}),f&&We(ot,{provider:"tiktok"}),y&&We(ot,{provider:"linkedin"}),w&&We(ot,{provider:"apple"}),k&&We(El,{})].filter(Boolean),I=Gi(o.appearance.walletList,r,e,o.appearance.walletList),Q=P==="default"?void 0:()=>{O("default")},U=F4({priority:C,email:i,sms:a,social:H}),pe=U4({priority:C,email:i,sms:a,social:H}),me=B4({priority:C,email:i,sms:a,social:H}),ae=We(ey,{text:me,onClick:()=>O("web3-overflow")}),Ee=We(_l,{text:U,icon:pe,onClick:()=>O("web2-overflow")}),J=R?0:1;return ti(na,{children:[We(T,{title:o.appearance.landingHeader,onClose:K,backFn:Q}),P==="default"&&We(D4,{}),We(Hs,{style:{overflow:"hidden",padding:2},children:ti(nr,{children:[P==="default"&&C==="web2-first"&&ti(na,{children:[...V,...H.length+V.length>4?H.slice(0,3-V.length):H,V.length+H.length>4&&Ee,v&&ae]}),P==="default"&&C==="web3-first"&&ti(na,{children:[v&&ti(na,{children:[...I.length>4?I.slice(0,3):I,I.length>4&&ae]}),V.length+H.length>J&&Ee,V.length+H.length===J&&V.length?V[0]:null,V.length+H.length===J&&H.length?H[0]:null]}),P==="web2-overflow"&&ti(na,{children:[...C==="web3-first"?V:[],...H]}),...P==="web3-overflow"?I:[],S&&P==="default"&&We(Tl,{})]})}),o&&We(Mn,{app:o}),We(z,{protectedByPrivy:!0})]})},D4=N4(Hn)`
1732
+ `;import R4 from"@heroicons/react/24/outline/EnvelopeIcon";import I4 from"@heroicons/react/24/outline/PhoneIcon";import M4 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as W4,useState as ey}from"react";import{isMobile as L4}from"react-device-detect";import O4 from"styled-components";import{jsx as oa,jsxs as Jh}from"react/jsx-runtime";var Qh=({...e})=>Jh("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[Jh("g",{clipPath:"url(#clip0_2856_1743)",children:[oa("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"}),oa("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"})]}),oa("defs",{children:oa("clipPath",{id:"clip0_2856_1743",children:oa("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});import k4 from"@heroicons/react/24/outline/ChevronRightIcon";import _4 from"@heroicons/react/24/outline/WalletIcon";import{jsx as vd,jsxs as A4}from"react/jsx-runtime";var Xh=({onClick:e,text:t})=>A4(Ae,{onClick:e,children:[vd(_4,{}),vd(Bs,{children:t}),vd(k4,{})]});import{Fragment as na,jsx as We,jsxs as ti}from"react/jsx-runtime";var Ml=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=M(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=x(),{email:i,sms:a,google:l,twitter:s,discord:c,github:u,spotify:h,tiktok:f,linkedin:y,apple:w,wallet:v,farcaster:k,passkey:S}=o?.loginMethods??{},C=o?.appearance.loginGroupPriority||"web2-first",R=o?.appearance.hideDirectWeb2Inputs,[P,O]=ey("default"),[_,F]=ey(i?"email":"sms");W4(()=>{F(i?"email":"sms")},[i]);let K=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{O("default")},150)};n.current=K;let V=[i&&We(bl,{isEditable:_==="email",setIsEditable:()=>{F("email")}}),a&&We(kl,{isEditable:_==="sms",setIsEditable:()=>{F("sms")}})].filter(Boolean),H=[l&&We(ot,{provider:"google"}),s&&(!L4||o?.loginConfig.twitterOAuthOnMobileEnabled)&&We(ot,{provider:"twitter"}),c&&We(ot,{provider:"discord"}),u&&We(ot,{provider:"github"}),h&&We(ot,{provider:"spotify"}),f&&We(ot,{provider:"tiktok"}),y&&We(ot,{provider:"linkedin"}),w&&We(ot,{provider:"apple"}),k&&We(El,{})].filter(Boolean),I=Gi(o.appearance.walletList,r,e,o.appearance.walletList),Q=P==="default"?void 0:()=>{O("default")},D=D4({priority:C,email:i,sms:a,social:H}),pe=F4({priority:C,email:i,sms:a,social:H}),me=U4({priority:C,email:i,sms:a,social:H}),ae=We(Xh,{text:me,onClick:()=>O("web3-overflow")}),Ee=We(_l,{text:D,icon:pe,onClick:()=>O("web2-overflow")}),J=R?0:1;return ti(na,{children:[We(T,{title:o.appearance.landingHeader,onClose:K,backFn:Q}),P==="default"&&We(N4,{}),We(Hs,{style:{overflow:"hidden",padding:2},children:ti(nr,{children:[P==="default"&&C==="web2-first"&&ti(na,{children:[...V,...H.length+V.length>4?H.slice(0,3-V.length):H,V.length+H.length>4&&Ee,v&&ae]}),P==="default"&&C==="web3-first"&&ti(na,{children:[v&&ti(na,{children:[...I.length>4?I.slice(0,3):I,I.length>4&&ae]}),V.length+H.length>J&&Ee,V.length+H.length===J&&V.length?V[0]:null,V.length+H.length===J&&H.length?H[0]:null]}),P==="web2-overflow"&&ti(na,{children:[...C==="web3-first"?V:[],...H]}),...P==="web3-overflow"?I:[],S&&P==="default"&&We(Tl,{})]})}),o&&We(Mn,{app:o}),We(z,{protectedByPrivy:!0})]})},N4=O4(Hn)`
1733
1733
  margin-bottom: 16px;
1734
- `,F4=({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",U4=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?We(W4,{}):t&&r?We(Xh,{}):t?We(I4,{}):r?We(M4,{}):null,B4=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets";import{jsx as ry}from"react/jsx-runtime";var oy=()=>{let{app:e}=x();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?ry(Il,{connectOnly:!0}):ry(Ml,{connectOnly:!0})};import{jsx as ny}from"react/jsx-runtime";var iy=()=>{let{app:e}=x();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?ny(Il,{connectOnly:!1}):ny(Ml,{connectOnly:!1})};import H4 from"@heroicons/react/24/outline/EnvelopeIcon";import{Fragment as G4,jsx as _o,jsxs as V4}from"react/jsx-runtime";var ay=()=>{let{app:e}=x();return V4(G4,{children:[_o(T,{},"header"),_o(X,{}),_o(Te,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:_o(H4,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),_o(ar,{children:_o(Cl,{stacked:!0})}),_o(ie,{}),_o(z,{protectedByPrivy:!0})]})};import z4 from"@heroicons/react/24/outline/ClockIcon";import q4 from"@heroicons/react/24/outline/TrashIcon";import $4 from"@heroicons/react/24/solid/CheckBadgeIcon";import K4 from"@heroicons/react/24/solid/CheckCircleIcon";import j4 from"@heroicons/react/24/solid/LockClosedIcon";import{useEffect as Y4,useState as ia}from"react";import cr,{css as py}from"styled-components";import{jsx as sy}from"react/jsx-runtime";var ln=({style:e,...t})=>sy("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:sy("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"})});import{jsx as Re,jsxs as ly}from"react/jsx-runtime";var io=({style:e,...t})=>ly("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:[ly("g",{clipPath:"url(#clip0_113_33841)",children:[Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"})]}),Re("defs",{children:Re("clipPath",{id:"clip0_113_33841",children:Re("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});import{Fragment as Cd,jsx as le,jsxs as Mt}from"react/jsx-runtime";var cy=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,i]=ia([]),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(h=>h!==c))};return Mt("div",{children:[le(r5,{children:"Your passkeys"}),Mt(my,{children:[e.slice(0,a).map(c=>Mt(i5,{children:[Mt("div",{children:[le(o5,{children:l(c)}),Mt(n5,{children:["Last used: ",(c.latestVerifiedAt??c.verifiedAt).toLocaleString()]})]}),le(s5,{disabled:n.includes(c.credentialId),onClick:()=>s(c.credentialId),children:n.includes(c.credentialId)?le(Xr,{}):le(q4,{height:"1.6em"})})]},c.credentialId)),e.length>2&&!t&&le(X4,{onClick:o,children:"View all"})]})]})},Z4=()=>Mt(my,{children:[Mt(At,{children:[le(_t,{children:le($4,{})}),"Log in with Touch ID, Face ID, or a security key."]}),Mt(At,{children:[le(_t,{children:le(j4,{})}),"More secure than a password."]}),Mt(At,{children:[le(_t,{children:le(z4,{})}),"Takes seconds to set up and use."]})]}),uy=()=>{let{user:e,unlinkPasskey:t}=B(),{linkWithPasskey:r,closePrivyModal:o}=M(),n=e?.linkedAccounts.filter(v=>v.type==="passkey"),[i,a]=ia(!1),[l,s]=ia(""),[c,u]=ia(!1),[h,f]=ia(!1);Y4(()=>{n.length===0&&f(!1)},[n.length]);let y=()=>{a(!0),r().then(()=>u(!0)).catch(v=>{if(v instanceof Ue){if(v.privyErrorCode==="cannot_link_more_of_type"){s("Cannot link more passkeys to account.");return}else if(v.privyErrorCode==="passkey_not_allowed"){s("Passkey request timed out or rejected by user.");return}}s("Unknown error occurred.")}).finally(()=>{a(!1)})},w=async v=>(a(!0),await t(v).then(()=>u(!0)).catch(k=>{if(k instanceof Ue&&k.privyErrorCode==="missing_or_invalid_mfa"){s("Cannot unlink a passkey enrolled in MFA");return}s("Unknown error occurred.")}).finally(()=>{a(!1)}));return c?Mt(Cd,{children:[le(T,{onClose:()=>o()},"header"),le(ge,{children:le(Me,{status:"success",children:le(K4,{})})}),le(dy,{children:"Passkey added"}),le(e5,{children:"From now on, you can use your passkey to log in."}),le(pt,{children:le(W,{onClick:()=>o(),children:"Done"})}),le(q,{})]}):h?Mt(Cd,{children:[le(T,{backFn:()=>f(!1),onClose:()=>o()},"header"),le(cy,{passkeys:n,expanded:h,onUnlink:w,onExpand:()=>f(!0)}),le(q,{})]}):Mt(Cd,{children:[le(T,{onClose:()=>o()},"header"),le(ge,{children:Mt(ri,{children:[le(ln,{}),le(io,{})]})}),le(dy,{children:"Secure your account with a passkey"}),le(t5,{}),n.length===0?le(Z4,{}):le(cy,{passkeys:n,expanded:h,onUnlink:w,onExpand:()=>f(!0)}),Mt(pt,{style:{marginTop:"12px"},children:[l&&le(J4,{fail:!0,children:l}),le(W,{onClick:y,loading:i,children:"Add new passkey"})]}),le(q,{})]})},ri=cr.div`
1734
+ `,D4=({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",F4=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?We(M4,{}):t&&r?We(Qh,{}):t?We(R4,{}):r?We(I4,{}):null,U4=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets";import{jsx as ty}from"react/jsx-runtime";var ry=()=>{let{app:e}=x();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?ty(Il,{connectOnly:!0}):ty(Ml,{connectOnly:!0})};import{jsx as oy}from"react/jsx-runtime";var ny=()=>{let{app:e}=x();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?oy(Il,{connectOnly:!1}):oy(Ml,{connectOnly:!1})};import B4 from"@heroicons/react/24/outline/EnvelopeIcon";import{Fragment as H4,jsx as _o,jsxs as G4}from"react/jsx-runtime";var iy=()=>{let{app:e}=x();return G4(H4,{children:[_o(T,{},"header"),_o(X,{}),_o(Te,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:_o(B4,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),_o(ar,{children:_o(Cl,{stacked:!0})}),_o(ie,{}),_o(z,{protectedByPrivy:!0})]})};import V4 from"@heroicons/react/24/outline/ClockIcon";import z4 from"@heroicons/react/24/outline/TrashIcon";import q4 from"@heroicons/react/24/solid/CheckBadgeIcon";import $4 from"@heroicons/react/24/solid/CheckCircleIcon";import K4 from"@heroicons/react/24/solid/LockClosedIcon";import{useEffect as j4,useState as ia}from"react";import cr,{css as dy}from"styled-components";import{jsx as ay}from"react/jsx-runtime";var ln=({style:e,...t})=>ay("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:ay("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"})});import{jsx as Re,jsxs as sy}from"react/jsx-runtime";var ao=({style:e,...t})=>sy("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:[sy("g",{clipPath:"url(#clip0_113_33841)",children:[Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"}),Re("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"})]}),Re("defs",{children:Re("clipPath",{id:"clip0_113_33841",children:Re("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});import{Fragment as Cd,jsx as le,jsxs as Mt}from"react/jsx-runtime";var ly=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,i]=ia([]),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(h=>h!==c))};return Mt("div",{children:[le(t5,{children:"Your passkeys"}),Mt(uy,{children:[e.slice(0,a).map(c=>Mt(n5,{children:[Mt("div",{children:[le(r5,{children:l(c)}),Mt(o5,{children:["Last used: ",(c.latestVerifiedAt??c.verifiedAt).toLocaleString()]})]}),le(a5,{disabled:n.includes(c.credentialId),onClick:()=>s(c.credentialId),children:n.includes(c.credentialId)?le(eo,{}):le(z4,{height:"1.6em"})})]},c.credentialId)),e.length>2&&!t&&le(Q4,{onClick:o,children:"View all"})]})]})},Y4=()=>Mt(uy,{children:[Mt(At,{children:[le(_t,{children:le(q4,{})}),"Log in with Touch ID, Face ID, or a security key."]}),Mt(At,{children:[le(_t,{children:le(K4,{})}),"More secure than a password."]}),Mt(At,{children:[le(_t,{children:le(V4,{})}),"Takes seconds to set up and use."]})]}),py=()=>{let{user:e,unlinkPasskey:t}=B(),{linkWithPasskey:r,closePrivyModal:o}=M(),n=e?.linkedAccounts.filter(v=>v.type==="passkey"),[i,a]=ia(!1),[l,s]=ia(""),[c,u]=ia(!1),[h,f]=ia(!1);j4(()=>{n.length===0&&f(!1)},[n.length]);let y=()=>{a(!0),r().then(()=>u(!0)).catch(v=>{if(v instanceof Ue){if(v.privyErrorCode==="cannot_link_more_of_type"){s("Cannot link more passkeys to account.");return}else if(v.privyErrorCode==="passkey_not_allowed"){s("Passkey request timed out or rejected by user.");return}}s("Unknown error occurred.")}).finally(()=>{a(!1)})},w=async v=>(a(!0),await t(v).then(()=>u(!0)).catch(k=>{if(k instanceof Ue&&k.privyErrorCode==="missing_or_invalid_mfa"){s("Cannot unlink a passkey enrolled in MFA");return}s("Unknown error occurred.")}).finally(()=>{a(!1)}));return c?Mt(Cd,{children:[le(T,{onClose:()=>o()},"header"),le(ge,{children:le(Me,{status:"success",children:le($4,{})})}),le(cy,{children:"Passkey added"}),le(X4,{children:"From now on, you can use your passkey to log in."}),le(pt,{children:le(W,{onClick:()=>o(),children:"Done"})}),le(q,{})]}):h?Mt(Cd,{children:[le(T,{backFn:()=>f(!1),onClose:()=>o()},"header"),le(ly,{passkeys:n,expanded:h,onUnlink:w,onExpand:()=>f(!0)}),le(q,{})]}):Mt(Cd,{children:[le(T,{onClose:()=>o()},"header"),le(ge,{children:Mt(ri,{children:[le(ln,{}),le(ao,{})]})}),le(cy,{children:"Secure your account with a passkey"}),le(e5,{}),n.length===0?le(Y4,{}):le(ly,{passkeys:n,expanded:h,onUnlink:w,onExpand:()=>f(!0)}),Mt(pt,{style:{marginTop:"12px"},children:[l&&le(Z4,{fail:!0,children:l}),le(W,{onClick:y,loading:i,children:"Add new passkey"})]}),le(q,{})]})},ri=cr.div`
1735
1735
  display: flex;
1736
1736
  align-items: center;
1737
1737
  justify-content: center;
@@ -1747,7 +1747,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1747
1747
  stroke: var(--privy-color-accent) !important;
1748
1748
  fill: var(--privy-color-accent) !important;
1749
1749
  }
1750
- `,J4=cr.div`
1750
+ `,Z4=cr.div`
1751
1751
  line-height: 20px;
1752
1752
  height: 20px;
1753
1753
  font-size: 13px;
@@ -1755,7 +1755,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1755
1755
  display: flex;
1756
1756
  justify-content: flex-beginngin;
1757
1757
  width: 100%;
1758
- `,Q4=py`
1758
+ `,J4=dy`
1759
1759
  && {
1760
1760
  width: 100%;
1761
1761
  font-size: 0.875rem;
@@ -1780,9 +1780,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
1780
1780
  box-shadow: none;
1781
1781
  }
1782
1782
  }
1783
- `,X4=cr.button`
1784
- ${Q4}
1785
- `,my=cr.div`
1783
+ `,Q4=cr.button`
1784
+ ${J4}
1785
+ `,uy=cr.div`
1786
1786
  display: flex;
1787
1787
  flex-direction: column;
1788
1788
  align-items: stretch;
@@ -1790,18 +1790,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1790
1790
  padding: 0.5rem 0rem 0rem;
1791
1791
  flex-grow: 1;
1792
1792
  width: 100%;
1793
- `,dy=cr.div`
1793
+ `,cy=cr.div`
1794
1794
  font-size: 18px;
1795
1795
  line-height: 18px;
1796
1796
  text-align: center;
1797
1797
  font-weight: 600;
1798
- `,e5=cr.div`
1798
+ `,X4=cr.div`
1799
1799
  font-size: 0.875rem;
1800
1800
  text-align: center;
1801
1801
  margin-top: 10px;
1802
- `,t5=cr.div`
1802
+ `,e5=cr.div`
1803
1803
  height: 32px;
1804
- `,r5=cr.div`
1804
+ `,t5=cr.div`
1805
1805
  line-height: 20px;
1806
1806
  height: 20px;
1807
1807
  font-size: 1em;
@@ -1809,18 +1809,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1809
1809
  display: flex;
1810
1810
  justify-content: flex-beginning;
1811
1811
  width: 100%;
1812
- `,o5=cr.div`
1812
+ `,r5=cr.div`
1813
1813
  font-size: 1em;
1814
1814
  line-height: 1.3em;
1815
1815
  font-weight: 500;
1816
1816
  color: var(--privy-color-foreground-2);
1817
1817
  padding: 0.2em 0;
1818
- `,n5=cr.div`
1818
+ `,o5=cr.div`
1819
1819
  font-size: 0.875rem;
1820
1820
  line-height: 1rem;
1821
1821
  color: #64668b;
1822
1822
  padding: 0.2em 0;
1823
- `,i5=cr.div`
1823
+ `,n5=cr.div`
1824
1824
  display: flex;
1825
1825
  align-items: center;
1826
1826
  justify-content: space-between;
@@ -1833,7 +1833,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1833
1833
  border: 1px solid #e2e3f0 !important;
1834
1834
  width: 100%;
1835
1835
  height: 5em;
1836
- `,a5=py`
1836
+ `,i5=dy`
1837
1837
  :focus,
1838
1838
  :hover,
1839
1839
  :active {
@@ -1850,9 +1850,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
1850
1850
  svg:hover {
1851
1851
  color: var(--privy-color-foreground-3);
1852
1852
  }
1853
- `,s5=cr.button`
1854
- ${a5}
1855
- `;import l5 from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as c5,jsx as Ao,jsxs as d5}from"react/jsx-runtime";var fy=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=x(),{initLoginWithSms:i}=M();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 d5(c5,{children:[Ao(T,{},"header"),Ao(X,{}),Ao(Te,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:Ao(l5,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),Ao(ar,{children:Ao(ei,{stacked:!0,onSubmit:a})}),Ao(ie,{}),Ao(z,{protectedByPrivy:!0})]})};import{Fragment as p5,jsx as aa,jsxs as u5}from"react/jsx-runtime";var hy=()=>{let{linkingHint:e}=M(),{app:t}=x(),r=e?`Select the wallet with ${fo(e)} and follow the instructions to reconnect your wallet${t?.name?` to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return u5(p5,{children:[aa(T,{},"header"),aa(Nr,{title:`${e?"Reconnect":"Connect"} your wallet`,description:r}),aa(nr,{children:aa(Bn,{connectOnly:!1})}),aa(z,{protectedByPrivy:!0})]})};import{jsx as yy,jsxs as m5}from"react/jsx-runtime";var gy=({style:e,...t})=>m5("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:[yy("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),yy("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"})]});import{Fragment as f5,jsx as Ro,jsxs as vy}from"react/jsx-runtime";var Cy=()=>{let{closePrivyModal:e}=M(),{navigate:t}=x();return vy(f5,{children:[Ro(T,{},"header"),Ro(X,{}),Ro(gy,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),Ro(Nr,{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"}}),vy(ar,{children:[Ro(W,{onClick:()=>t("LANDING"),children:"Try again"}),Ro(fr,{onClick:()=>e(),children:"Cancel"})]}),Ro(ie,{}),Ro(z,{protectedByPrivy:!0})]})};import r6 from"@heroicons/react/24/solid/CheckBadgeIcon";import o6 from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import n6 from"@heroicons/react/24/solid/IdentificationIcon";import i6 from"@heroicons/react/24/solid/PhoneIcon";import a6 from"@heroicons/react/24/solid/QuestionMarkCircleIcon";import Oy from"@heroicons/react/24/solid/ShieldCheckIcon";import{useEffect as s6,useState as Ol}from"react";import{useContext as h5}from"react";function sa(){let{promptMfa:e,init:t,submit:r,cancel:o}=h5(ye);return{promptMfa:e,init:t,submit:r,cancel:o}}import{useContext as y5}from"react";function Gr(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenroll:a,enrollInMfa:l}=y5(ye);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)}}import g5 from"styled-components";import{jsx as wy,jsxs as C5}from"react/jsx-runtime";var by=e=>C5(v5,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[wy("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),wy("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"})]}),v5=g5.svg`
1853
+ `,a5=cr.button`
1854
+ ${i5}
1855
+ `;import s5 from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as l5,jsx as Ao,jsxs as c5}from"react/jsx-runtime";var my=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=x(),{initLoginWithSms:i}=M();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 c5(l5,{children:[Ao(T,{},"header"),Ao(X,{}),Ao(Te,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:Ao(s5,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),Ao(ar,{children:Ao(ei,{stacked:!0,onSubmit:a})}),Ao(ie,{}),Ao(z,{protectedByPrivy:!0})]})};import{Fragment as d5,jsx as aa,jsxs as p5}from"react/jsx-runtime";var fy=()=>{let{linkingHint:e}=M(),{app:t}=x(),r=e?`Select the wallet with ${ho(e)} and follow the instructions to reconnect your wallet${t?.name?` to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return p5(d5,{children:[aa(T,{},"header"),aa(Dr,{title:`${e?"Reconnect":"Connect"} your wallet`,description:r}),aa(nr,{children:aa(Bn,{connectOnly:!1})}),aa(z,{protectedByPrivy:!0})]})};import{jsx as hy,jsxs as u5}from"react/jsx-runtime";var yy=({style:e,...t})=>u5("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:[hy("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),hy("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"})]});import{Fragment as m5,jsx as Ro,jsxs as gy}from"react/jsx-runtime";var vy=()=>{let{closePrivyModal:e}=M(),{navigate:t}=x();return gy(m5,{children:[Ro(T,{},"header"),Ro(X,{}),Ro(yy,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),Ro(Dr,{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"}}),gy(ar,{children:[Ro(W,{onClick:()=>t("LANDING"),children:"Try again"}),Ro(fr,{onClick:()=>e(),children:"Cancel"})]}),Ro(ie,{}),Ro(z,{protectedByPrivy:!0})]})};import t6 from"@heroicons/react/24/solid/CheckBadgeIcon";import r6 from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import o6 from"@heroicons/react/24/solid/IdentificationIcon";import n6 from"@heroicons/react/24/solid/PhoneIcon";import i6 from"@heroicons/react/24/solid/QuestionMarkCircleIcon";import Ly from"@heroicons/react/24/solid/ShieldCheckIcon";import{useEffect as a6,useState as Ol}from"react";import{useContext as f5}from"react";function sa(){let{promptMfa:e,init:t,submit:r,cancel:o}=f5(ye);return{promptMfa:e,init:t,submit:r,cancel:o}}import{useContext as h5}from"react";function Vr(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenroll:a,enrollInMfa:l}=h5(ye);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)}}import y5 from"styled-components";import{jsx as Cy,jsxs as v5}from"react/jsx-runtime";var wy=e=>v5(g5,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[Cy("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),Cy("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"})]}),g5=y5.svg`
1856
1856
  height: 90px;
1857
1857
  width: 90px;
1858
1858
 
@@ -1863,7 +1863,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1863
1863
  > path {
1864
1864
  fill: white;
1865
1865
  }
1866
- `;import wd from"@heroicons/react/20/solid/CheckIcon";import w5 from"@heroicons/react/24/outline/ChevronRightIcon";import b5 from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import E5 from"@heroicons/react/24/outline/FingerPrintIcon";import T5 from"@heroicons/react/24/outline/PhoneIcon";import bd from"@heroicons/react/24/outline/TrashIcon";import P5 from"@heroicons/react/24/solid/ShieldCheckIcon";import{Fragment as S5,jsx as be,jsxs as Wt}from"react/jsx-runtime";var Ey=({showIntro:e,userMfaMethods:t,appMfaMethods:r,userHasAuthSms:o,isTotpLoading:n,onClose:i,onBackToIntro:a,handleSelectMethod:l,setRemovingMfaMethod:s})=>{let c=t.reduce((h,f)=>({...h,[f]:!0}),{}),u=r.reduce((h,f)=>({...h,[f]:!0}),{});return Wt(S5,{children:[be(T,{backFn:e?a:void 0,onClose:i},"header"),be(ge,{children:be(Me,{children:be(P5,{})})}),be(ne,{children:"Choose a verification method"}),t.length>0?be(se,{children:"To add or delete verification methods, verification is required."}):be(se,{children:"How would you like to verify your identity? You can change this later."}),Wt(Gs,{children:[(u.totp||c.totp)&&Wt(Vs,{children:[be(Ae,{style:{justifyContent:"center"},disabled:c.totp||n,onClick:()=>l("totp"),children:n?be(Xe,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):Wt($s,{children:[Wt(qs,{children:[be(b5,{}),"Authenticator App"]}),c.totp?Wt(Xo,{children:[be(wd,{}),"Added"]}):be(Xo,{children:"Recommended"})]})}),c.totp&&be(zs,{onClick:()=>s("totp"),children:be(bd,{})})]},"totp"),(u.sms||c.sms)&&Wt(Vs,{children:[be(Ae,{disabled:c.sms||o,onClick:()=>l("sms"),children:Wt($s,{children:[Wt(qs,{children:[be(T5,{}),"SMS"]}),c.sms&&Wt(Xo,{children:[be(wd,{}),"Added"]}),o&&be(Xo,{children:"Disabled"})]})}),c.sms&&be(zs,{onClick:()=>s("sms"),children:be(bd,{})})]},"sms"),(u.passkey||c.passkey)&&Wt(Vs,{children:[be(Ae,{onClick:()=>l("passkey"),disabled:c.passkey,children:Wt($s,{children:[Wt(qs,{children:[be(E5,{}),"Passkey"]}),c.passkey?Wt(Xo,{children:[be(wd,{}),"Added"]}):be(Xo,{isAccent:!0,children:be(w5,{})})]})}),c.passkey&&be(zs,{onClick:()=>s("passkey"),children:be(bd,{})})]},"passkey")]}),be(q,{})]})};import x5 from"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import k5 from"@heroicons/react/24/outline/ClockIcon";import _5 from"@heroicons/react/24/outline/ShieldCheckIcon";import A5 from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as R5,useState as la}from"react";import Wl from"styled-components";import{Fragment as Ed,jsx as re,jsxs as dr}from"react/jsx-runtime";var Py=({onComplete:e,onClose:t,onReset:r})=>{let{user:o}=B(),{data:n}=x(),{initLinkWithPasskey:i,linkWithPasskey:a}=M(),{initEnrollmentWithPasskey:l,submitEnrollmentWithPasskey:s}=Gr(),[c,u]=la(!1),[h,f]=la(!1),[y,w]=la(!1),[v,k]=la(null),S=R5(()=>o?.linkedAccounts.filter(P=>P.type==="passkey")??[],[o]),C=()=>{n?.mfaEnrollmentFlow?.onSuccess(),e()},R=async()=>{f(!0),k(null);try{await i(),await a()}catch(P){k(P)}finally{f(!1)}};return S.length===0?re(I5,{onReset:r,onClose:t,onClick:R,isCreating:h}):y?re(W5,{onClick:C,onClose:C}):v?re(Ji,{error:v,backFn:()=>k(null),onClick:()=>k(null)}):re(M5,{passkeys:S,isSubmitting:c,isCreating:h,onReset:r,onClose:t,onSubmitEnrollment:async()=>{u(!0);try{let P=S.map(O=>O.credentialId);await l(),await s({credentialIds:P}),w(!0)}catch(P){k(P)}finally{u(!1)}},onAddPasskey:R})},I5=({onReset:e,onClose:t,onClick:r,isCreating:o})=>dr(Ed,{children:[re(T,{backFn:e,onClose:t},"header"),re(ge,{children:dr(ri,{children:[re(ln,{}),re(io,{})]})}),re(ne,{children:"Set up paskey verification"}),dr(Qo,{children:[dr(At,{children:[re(_t,{children:re(_5,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),dr(At,{children:[re(_t,{children:re(k5,{})}),"Takes seconds to set up and use"]}),dr(At,{children:[re(_t,{children:re(x5,{})}),"Use your passkey to verify transactions and login to your account"]})]}),re(W,{style:{marginTop:"2.25rem"},onClick:r,loading:o,children:"Add a new passkey"}),re(q,{})]}),M5=({onReset:e,onClose:t,onAddPasskey:r,onSubmitEnrollment:o,passkeys:n,isSubmitting:i,isCreating:a})=>{let[l,s]=la(!1),c=l?n.length:n.length>3?2:3;return dr(Ed,{children:[re(T,{backFn:l?()=>s(!1):e,onClose:t},"header"),!l&&re(ge,{children:dr(ri,{children:[re(ln,{}),re(io,{})]})}),re(ne,{children:"Enable your passkeys for verification"}),dr(Qo,{children:[n.slice(0,c).map(u=>dr(L5,{children:[re(O5,{children:D5(u)}),dr(N5,{children:["Last used: ",u.latestVerifiedAt?.toLocaleString()]})]},u.credentialId)),!l&&n.length>3&&re(Ty,{onClick:()=>s(!0),children:"View All"})]}),re(W,{style:{marginTop:"1.5rem"},onClick:o,loading:i,children:"Enable passkeys"}),n.length<5&&re(Ty,{style:{marginTop:"0.5rem"},onClick:r,disabled:a,children:a?re(Xe,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),re(q,{})]})},W5=({onClick:e,onClose:t})=>dr(Ed,{children:[re(T,{onClose:t},"header"),re(ge,{children:re(Me,{status:"success",children:re(A5,{})})}),re(ne,{children:"Passkey verification added"}),re(se,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),re(pt,{children:re(W,{onClick:e,children:"Done"})}),re(q,{})]}),L5=Wl.div`
1866
+ `;import wd from"@heroicons/react/20/solid/CheckIcon";import C5 from"@heroicons/react/24/outline/ChevronRightIcon";import w5 from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import b5 from"@heroicons/react/24/outline/FingerPrintIcon";import E5 from"@heroicons/react/24/outline/PhoneIcon";import bd from"@heroicons/react/24/outline/TrashIcon";import T5 from"@heroicons/react/24/solid/ShieldCheckIcon";import{Fragment as P5,jsx as be,jsxs as Wt}from"react/jsx-runtime";var by=({showIntro:e,userMfaMethods:t,appMfaMethods:r,userHasAuthSms:o,isTotpLoading:n,onClose:i,onBackToIntro:a,handleSelectMethod:l,setRemovingMfaMethod:s})=>{let c=t.reduce((h,f)=>({...h,[f]:!0}),{}),u=r.reduce((h,f)=>({...h,[f]:!0}),{});return Wt(P5,{children:[be(T,{backFn:e?a:void 0,onClose:i},"header"),be(ge,{children:be(Me,{children:be(T5,{})})}),be(ne,{children:"Choose a verification method"}),t.length>0?be(se,{children:"To add or delete verification methods, verification is required."}):be(se,{children:"How would you like to verify your identity? You can change this later."}),Wt(Gs,{children:[(u.totp||c.totp)&&Wt(Vs,{children:[be(Ae,{style:{justifyContent:"center"},disabled:c.totp||n,onClick:()=>l("totp"),children:n?be(Xe,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):Wt($s,{children:[Wt(qs,{children:[be(w5,{}),"Authenticator App"]}),c.totp?Wt(Xo,{children:[be(wd,{}),"Added"]}):be(Xo,{children:"Recommended"})]})}),c.totp&&be(zs,{onClick:()=>s("totp"),children:be(bd,{})})]},"totp"),(u.sms||c.sms)&&Wt(Vs,{children:[be(Ae,{disabled:c.sms||o,onClick:()=>l("sms"),children:Wt($s,{children:[Wt(qs,{children:[be(E5,{}),"SMS"]}),c.sms&&Wt(Xo,{children:[be(wd,{}),"Added"]}),o&&be(Xo,{children:"Disabled"})]})}),c.sms&&be(zs,{onClick:()=>s("sms"),children:be(bd,{})})]},"sms"),(u.passkey||c.passkey)&&Wt(Vs,{children:[be(Ae,{onClick:()=>l("passkey"),disabled:c.passkey,children:Wt($s,{children:[Wt(qs,{children:[be(b5,{}),"Passkey"]}),c.passkey?Wt(Xo,{children:[be(wd,{}),"Added"]}):be(Xo,{isAccent:!0,children:be(C5,{})})]})}),c.passkey&&be(zs,{onClick:()=>s("passkey"),children:be(bd,{})})]},"passkey")]}),be(q,{})]})};import S5 from"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import x5 from"@heroicons/react/24/outline/ClockIcon";import k5 from"@heroicons/react/24/outline/ShieldCheckIcon";import _5 from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as A5,useState as la}from"react";import Wl from"styled-components";import{Fragment as Ed,jsx as re,jsxs as dr}from"react/jsx-runtime";var Ty=({onComplete:e,onClose:t,onReset:r})=>{let{user:o}=B(),{data:n}=x(),{initLinkWithPasskey:i,linkWithPasskey:a}=M(),{initEnrollmentWithPasskey:l,submitEnrollmentWithPasskey:s}=Vr(),[c,u]=la(!1),[h,f]=la(!1),[y,w]=la(!1),[v,k]=la(null),S=A5(()=>o?.linkedAccounts.filter(P=>P.type==="passkey")??[],[o]),C=()=>{n?.mfaEnrollmentFlow?.onSuccess(),e()},R=async()=>{f(!0),k(null);try{await i(),await a()}catch(P){k(P)}finally{f(!1)}};return S.length===0?re(R5,{onReset:r,onClose:t,onClick:R,isCreating:h}):y?re(M5,{onClick:C,onClose:C}):v?re(Ji,{error:v,backFn:()=>k(null),onClick:()=>k(null)}):re(I5,{passkeys:S,isSubmitting:c,isCreating:h,onReset:r,onClose:t,onSubmitEnrollment:async()=>{u(!0);try{let P=S.map(O=>O.credentialId);await l(),await s({credentialIds:P}),w(!0)}catch(P){k(P)}finally{u(!1)}},onAddPasskey:R})},R5=({onReset:e,onClose:t,onClick:r,isCreating:o})=>dr(Ed,{children:[re(T,{backFn:e,onClose:t},"header"),re(ge,{children:dr(ri,{children:[re(ln,{}),re(ao,{})]})}),re(ne,{children:"Set up paskey verification"}),dr(Qo,{children:[dr(At,{children:[re(_t,{children:re(k5,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),dr(At,{children:[re(_t,{children:re(x5,{})}),"Takes seconds to set up and use"]}),dr(At,{children:[re(_t,{children:re(S5,{})}),"Use your passkey to verify transactions and login to your account"]})]}),re(W,{style:{marginTop:"2.25rem"},onClick:r,loading:o,children:"Add a new passkey"}),re(q,{})]}),I5=({onReset:e,onClose:t,onAddPasskey:r,onSubmitEnrollment:o,passkeys:n,isSubmitting:i,isCreating:a})=>{let[l,s]=la(!1),c=l?n.length:n.length>3?2:3;return dr(Ed,{children:[re(T,{backFn:l?()=>s(!1):e,onClose:t},"header"),!l&&re(ge,{children:dr(ri,{children:[re(ln,{}),re(ao,{})]})}),re(ne,{children:"Enable your passkeys for verification"}),dr(Qo,{children:[n.slice(0,c).map(u=>dr(W5,{children:[re(L5,{children:N5(u)}),dr(O5,{children:["Last used: ",u.latestVerifiedAt?.toLocaleString()]})]},u.credentialId)),!l&&n.length>3&&re(Ey,{onClick:()=>s(!0),children:"View All"})]}),re(W,{style:{marginTop:"1.5rem"},onClick:o,loading:i,children:"Enable passkeys"}),n.length<5&&re(Ey,{style:{marginTop:"0.5rem"},onClick:r,disabled:a,children:a?re(Xe,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),re(q,{})]})},M5=({onClick:e,onClose:t})=>dr(Ed,{children:[re(T,{onClose:t},"header"),re(ge,{children:re(Me,{status:"success",children:re(_5,{})})}),re(ne,{children:"Passkey verification added"}),re(se,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),re(pt,{children:re(W,{onClick:e,children:"Done"})}),re(q,{})]}),W5=Wl.div`
1867
1867
  && {
1868
1868
  padding: 0.75rem 1rem;
1869
1869
  text-align: left;
@@ -1871,19 +1871,19 @@ You will need this password to access your ${e} wallet on a new device. Please k
1871
1871
  border: 1px solid var(--privy-color-foreground-4);
1872
1872
  width: 100%;
1873
1873
  }
1874
- `,O5=Wl.div`
1874
+ `,L5=Wl.div`
1875
1875
  font-size: 0.875rem;
1876
1876
  line-height: 1.375rem;
1877
1877
  font-weight: 500;
1878
1878
 
1879
1879
  color: var(--privy-color-foreground-1);
1880
- `,N5=Wl.div`
1880
+ `,O5=Wl.div`
1881
1881
  font-size: 0.75rem;
1882
1882
  font-weight: 400;
1883
1883
  line-height: 1.125rem;
1884
1884
 
1885
1885
  color: var(--privy-color-foreground-2);
1886
- `,D5=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",Ty=Wl.button`
1886
+ `,N5=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",Ey=Wl.button`
1887
1887
  && {
1888
1888
  width: 100%;
1889
1889
  font-size: 0.875rem;
@@ -1908,7 +1908,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1908
1908
  box-shadow: none;
1909
1909
  }
1910
1910
  }
1911
- `;import J5 from"@heroicons/react/24/solid/CheckCircleIcon";import Ry from"@heroicons/react/24/solid/PhoneIcon";import{useState as Ll}from"react";import{useState as Sd}from"react";import{isMobile as V5}from"react-device-detect";import Ay from"styled-components";import{Dialog as Sy,Transition as Td}from"@headlessui/react";import Pd from"react";import ni from"styled-components";import{jsx as oi,jsxs as G5}from"react/jsx-runtime";var xy=({children:e,open:t,onClick:r,...o})=>oi(Td,{show:t,as:Pd.Fragment,children:G5(Sy,{onClose:r,...o,as:U5,children:[oi(Td.Child,{as:Pd.Fragment,enterFrom:"entering",leaveTo:"leaving",children:oi(F5,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),oi(B5,{children:oi(Td.Child,{as:Pd.Fragment,enterFrom:"entering",leaveTo:"leaving",children:oi(Sy.Panel,{as:H5,children:e})})})]})}),ii=ni.div`
1911
+ `;import Z5 from"@heroicons/react/24/solid/CheckCircleIcon";import Ay from"@heroicons/react/24/solid/PhoneIcon";import{useState as Ll}from"react";import{useState as Sd}from"react";import{isMobile as G5}from"react-device-detect";import _y from"styled-components";import{Dialog as Py,Transition as Td}from"@headlessui/react";import Pd from"react";import ni from"styled-components";import{jsx as oi,jsxs as H5}from"react/jsx-runtime";var Sy=({children:e,open:t,onClick:r,...o})=>oi(Td,{show:t,as:Pd.Fragment,children:H5(Py,{onClose:r,...o,as:F5,children:[oi(Td.Child,{as:Pd.Fragment,enterFrom:"entering",leaveTo:"leaving",children:oi(D5,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),oi(U5,{children:oi(Td.Child,{as:Pd.Fragment,enterFrom:"entering",leaveTo:"leaving",children:oi(Py.Panel,{as:B5,children:e})})})]})}),ii=ni.div`
1912
1912
  display: flex;
1913
1913
  flex-direction: column;
1914
1914
  text-align: center;
@@ -1931,7 +1931,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1931
1931
  box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
1932
1932
  border-radius: var(--privy-border-radius-lg);
1933
1933
  }
1934
- `,F5=ni.div`
1934
+ `,D5=ni.div`
1935
1935
  position: fixed;
1936
1936
  inset: 0;
1937
1937
 
@@ -1944,10 +1944,10 @@ You will need this password to access your ${e} wallet on a new device. Please k
1944
1944
  backdrop-filter: unset;
1945
1945
  -webkit-backdrop-filter: unset;
1946
1946
  }
1947
- `,U5=ni.div`
1947
+ `,F5=ni.div`
1948
1948
  position: relative;
1949
1949
  z-index: 999999;
1950
- `,B5=ni.div`
1950
+ `,U5=ni.div`
1951
1951
  position: fixed;
1952
1952
  inset: 0;
1953
1953
  display: flex;
@@ -1955,7 +1955,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1955
1955
  justify-content: center;
1956
1956
  width: 100vw;
1957
1957
  min-height: 100vh;
1958
- `,H5=ni.div`
1958
+ `,B5=ni.div`
1959
1959
  // reset some default dialog styles
1960
1960
  padding: 0;
1961
1961
  background: transparent;
@@ -2002,13 +2002,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
2002
2002
  box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
2003
2003
  border-radius: var(--privy-border-radius-lg);
2004
2004
  }
2005
- `,ky=ni.div`
2005
+ `,xy=ni.div`
2006
2006
  display: flex;
2007
2007
  flex-direction: column;
2008
2008
  align-items: center;
2009
2009
  justify-content: center;
2010
2010
  height: 100%;
2011
- `;import{Fragment as Z5,jsx as ca,jsxs as Y5}from"react/jsx-runtime";var da=6,z5=new Array(da).fill("");function q5(e){return e.replace(/\s+/g,"")}function xd(e){return/^[0-9]{1}$/.test(e)}function _y(e){return e.length===da&&e.every(xd)}function $5(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var cn=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,i]=Sd(z5),[a,l]=Sd(null),[s,c]=Sd(null),u=async w=>{w.preventDefault();let v=q5(w.currentTarget.value);if(v==="")return;let k=$5(n,xd),S=v.split(""),C=!S.every(xd),R=S.length+k>da;if(C){l("Passcode can only be numbers"),c(1);return}if(R){l("Passcode must be exactly 6 numbers"),c(1);return}l(null),c(null);let P=Number(w.currentTarget.name?.charAt(4)),O=[...v||[""]].slice(0,da-P),_=[...n.slice(0,P),...O,...n.slice(P+O.length)];i(_);let D=O.length,K=Math.min(Math.max(P+D,0),da-1);if(document.querySelector(`input[name=pin-${K}]`)?.focus(),_y(_))try{await e(_.join("")),document.querySelector(`input[name=pin-${K}]`)?.blur()}catch(H){c(1),l(H.message)}else try{await e(null)}catch(H){c(1),l(H.message)}},h=w=>{s===1&&(l(null),c(null));let v=[...n.slice(0,w),"",...n.slice(w+1)];i(v),w>0&&document.querySelector(`input[name=pin-${w-1}]`)?.focus(),_y(v)?e(v.join("")):e(null)},y=o?"success":!!(r||a)?"fail":"";return ca(Z5,{children:Y5(K5,{children:[ca("div",{children:n.map((w,v)=>ca("input",{name:`pin-${v}`,type:"text",value:n[v],onChange:u,onKeyUp:k=>{k.key==="Backspace"&&h(v)},inputMode:"numeric",autoFocus:v===0,pattern:"[0-9]",className:y,autoComplete:V5?"one-time-code":"off",disabled:t},v))}),ca("div",{children:ca(j5,{fail:!!r||!!a,children:r||a})})]})})},K5=Ay.div`
2011
+ `;import{Fragment as Y5,jsx as ca,jsxs as j5}from"react/jsx-runtime";var da=6,V5=new Array(da).fill("");function z5(e){return e.replace(/\s+/g,"")}function xd(e){return/^[0-9]{1}$/.test(e)}function ky(e){return e.length===da&&e.every(xd)}function q5(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var cn=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,i]=Sd(V5),[a,l]=Sd(null),[s,c]=Sd(null),u=async w=>{w.preventDefault();let v=z5(w.currentTarget.value);if(v==="")return;let k=q5(n,xd),S=v.split(""),C=!S.every(xd),R=S.length+k>da;if(C){l("Passcode can only be numbers"),c(1);return}if(R){l("Passcode must be exactly 6 numbers"),c(1);return}l(null),c(null);let P=Number(w.currentTarget.name?.charAt(4)),O=[...v||[""]].slice(0,da-P),_=[...n.slice(0,P),...O,...n.slice(P+O.length)];i(_);let F=O.length,K=Math.min(Math.max(P+F,0),da-1);if(document.querySelector(`input[name=pin-${K}]`)?.focus(),ky(_))try{await e(_.join("")),document.querySelector(`input[name=pin-${K}]`)?.blur()}catch(H){c(1),l(H.message)}else try{await e(null)}catch(H){c(1),l(H.message)}},h=w=>{s===1&&(l(null),c(null));let v=[...n.slice(0,w),"",...n.slice(w+1)];i(v),w>0&&document.querySelector(`input[name=pin-${w-1}]`)?.focus(),ky(v)?e(v.join("")):e(null)},y=o?"success":!!(r||a)?"fail":"";return ca(Y5,{children:j5($5,{children:[ca("div",{children:n.map((w,v)=>ca("input",{name:`pin-${v}`,type:"text",value:n[v],onChange:u,onKeyUp:k=>{k.key==="Backspace"&&h(v)},inputMode:"numeric",autoFocus:v===0,pattern:"[0-9]",className:y,autoComplete:G5?"one-time-code":"off",disabled:t},v))}),ca("div",{children:ca(K5,{fail:!!r||!!a,children:r||a})})]})})},$5=_y.div`
2012
2012
  display: flex;
2013
2013
  flex-direction: column;
2014
2014
  width: 100%;
@@ -2079,7 +2079,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2079
2079
  transform: translate(1px, 0px);
2080
2080
  }
2081
2081
  }
2082
- `,j5=Ay.div`
2082
+ `,K5=_y.div`
2083
2083
  line-height: 20px;
2084
2084
  font-size: 13px;
2085
2085
  display: flex;
@@ -2087,7 +2087,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2087
2087
  width: 100%;
2088
2088
 
2089
2089
  color: ${e=>e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
2090
- `;import{Fragment as kd,jsx as ke,jsxs as dn}from"react/jsx-runtime";var Iy=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=Ll(""),[i,a]=Ll(!1),[l,s]=Ll(null),[c,u]=Ll("enroll"),{initEnrollmentWithSms:h,submitEnrollmentWithSms:f}=Gr(),{app:y,data:w}=x();function v(){w?.mfaEnrollmentFlow?.onSuccess(),e()}async function k({qualifiedPhoneNumber:R}){try{await h({phoneNumber:R}),n(R),u("verify")}catch(P){s(P)}}async function S(R){try{if(!R)return;await f({phoneNumber:o,mfaCode:R}),a(!0)}catch(P){throw el(P)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):on(P)?new Error("The code you entered is not valid"):rn(P)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):tl(P)?new Error("Verification canceled"):new Error("Unknown error")}}function C(){c==="verify"?u("enroll"):t()}return l?ke(Ji,{error:l,backFn:()=>s(null),onClick:()=>s(null)}):c==="enroll"?dn(kd,{children:[ke(T,{backFn:t,onClose:r},"header"),ke(ge,{children:ke(Me,{children:ke(Ry,{})})}),ke(ne,{children:"Set up SMS verification"}),ke(se,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),dn(ir,{children:[ke(ei,{onSubmit:k}),dn(Sm,{children:["By providing your mobile number, you agree to receive text messages from ",y?.name,". Some carrier charges may apply"]})]}),ke(q,{})]}):i?dn(kd,{children:[ke(T,{onClose:v},"header"),ke(ge,{children:ke(Me,{status:"success",children:ke(J5,{})})}),ke(ne,{children:"SMS verification added"}),ke(se,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),ke(pt,{children:ke(W,{onClick:v,children:"Done"})}),ke(q,{})]}):dn(kd,{children:[ke(T,{backFn:C,onClose:r},"header"),ke(ge,{children:ke(Me,{children:ke(Ry,{})})}),ke(ne,{children:"Enter enrollment code"}),dn(ir,{children:[ke(cn,{onChange:S}),dn(se,{children:["To continue, enter the 6-digit code sent to ",ke("strong",{children:Vh(o)})]})]}),ke(q,{})]})};import e6 from"@heroicons/react/24/solid/CheckCircleIcon";import t6 from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import{useState as Wy}from"react";import Q5 from"@heroicons/react/24/solid/ShieldCheckIcon";import{jsx as X5}from"react/jsx-runtime";var My=({size:e,authUrl:t})=>X5(Xn,{url:t,squareLogoElement:Q5,size:e,fgColor:"#1F1F1F"});import{Fragment as _d,jsx as Pe,jsxs as pa}from"react/jsx-runtime";var Ly=({onComplete:e,onClose:t,onReset:r,totpInfo:o})=>{let[n,i]=Wy("enroll"),[a,l]=Wy(!1),{submitEnrollmentWithTotp:s}=Gr(),{data:c}=x();function u(){c?.mfaEnrollmentFlow?.onSuccess(),e()}function h(){i("verify")}async function f(w){try{if(!w)return;await s({mfaCode:w}),l(!0)}catch(v){throw el(v)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):on(v)?new Error("The code you entered is not valid"):rn(v)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):tl(v)?new Error("Verification canceled"):new Error("Unknown error")}}function y(){n==="verify"?i("enroll"):r()}return n==="enroll"?pa(_d,{children:[Pe(T,{backFn:r,onClose:t},"header"),Pe(ne,{children:"Scan QR code"}),Pe(se,{children:"Open your authenticator app and scan the QR code to continue."}),Pe(On,{children:Pe(My,{authUrl:o.authUrl,size:200})}),pa(pt,{children:[Pe(vt,{children:Pe(So,{itemName:"secret",text:o.secret})}),Pe(W,{onClick:h,children:"Continue"})]}),Pe(q,{})]}):a?pa(_d,{children:[Pe(T,{onClose:u},"header"),Pe(ge,{children:Pe(Me,{status:"success",children:Pe(e6,{})})}),Pe(ne,{children:"Authenticator app verification added"}),Pe(se,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),Pe(pt,{children:Pe(W,{onClick:u,children:"Done"})}),Pe(q,{})]}):pa(_d,{children:[Pe(T,{backFn:y,onClose:t},"header"),Pe(ge,{children:Pe(Me,{children:Pe(t6,{})})}),Pe(ne,{children:"Enter enrollment code"}),Pe(ir,{children:Pe(cn,{onChange:f})}),pa(se,{children:["To continue, enter the 6-digit code generated from your ",Pe("strong",{children:"authenticator app"})]}),Pe(q,{})]})};import{Fragment as ai,jsx as $,jsxs as Vt}from"react/jsx-runtime";var Ny=()=>{let{user:e,enrollInMfa:t}=B(),[r,o]=Ol(null),{unenrollWithSms:n,unenrollWithTotp:i,unenrollWithPasskey:a}=Gr(),{app:l,ready:s,data:c,onUserCloseViaDialogOrKeybindRef:u}=x(),{closePrivyModal:h}=M(),{promptMfa:f}=sa(),{initEnrollmentWithTotp:y}=Gr(),[w,v]=Ol(!1),[k,S]=Ol(null),[C,R]=Ol(null),P=()=>{h({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),S(null)},500)};u.current=P;let O=e?.mfaMethods.includes("sms"),_=!!e?.phone,D=e?.mfaMethods.includes("totp"),K=e?.mfaMethods.includes("passkey"),V=O||D||K;s6(()=>{V&&v(!0)},[V]);function H(){o(null),S(null)}function I(){v(!1)}async function Q(Ee){await f().catch(console.error),S(Ee),Ee==="totp"&&(R(null),y().then(J=>{R(J)}).catch(()=>{R(null),H()}))}if(!s||!e||!l)return Vt(ai,{children:[$(T,{onClose:P},"header"),$(ge,{children:$(by,{})}),$(ir,{children:$(Xe,{})}),$(q,{})]});async function U(){o(null);try{await n()}catch{o(null)}}async function pe(){o(null);try{await i()}catch{o(null)}}async function me(){o(null);try{await f(),await a()}catch{o(null)}}if(r==="sms")return Vt(ai,{children:[$(T,{backFn:H,onClose:P},"header"),$(ge,{children:$(Me,{children:$(i6,{})})}),$(ne,{children:"Remove SMS verification?"}),Vt(se,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),$(pt,{children:$(W,{warn:!0,onClick:U,children:"Remove SMS for MFA"})}),$(q,{})]});if(r==="totp")return Vt(ai,{children:[$(T,{backFn:H,onClose:P},"header"),$(ge,{children:$(Me,{children:$(o6,{})})}),$(ne,{children:"Remove Authenticator App verification?"}),Vt(se,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),$(pt,{children:$(W,{warn:!0,onClick:pe,children:"Remove Authenticator App for MFA"})}),$(q,{})]});if(r==="passkey")return Vt(ai,{children:[$(T,{backFn:H,onClose:P},"header"),$(ge,{children:$(Me,{children:$(a6,{})})}),$(ne,{children:"Are you sure you want to remove passkey verification?"}),$(se,{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."}),$(pt,{children:$(W,{warn:!0,onClick:me,children:"Yes, remove"})}),$(q,{})]});if(c.mfaEnrollmentFlow.mfaMethods.length===0&&!V)return Vt(ai,{children:[$(T,{onClose:P},"header"),$(ge,{children:$(Me,{children:$(Oy,{})})}),$(ne,{children:"Add more security"}),Vt(se,{children:[l?.name," does not have any verification methods enabled."]}),$(pt,{children:$(W,{onClick:P,children:"Close"})}),$(q,{})]});let ae=!V&&!w;return ae?Vt(ai,{children:[$(T,{onClose:P},"header"),$(ge,{children:$(Me,{children:$(Oy,{})})}),$(ne,{children:"Transaction Protection"}),$(se,{children:"Set up transaction protection to add an extra layer of security to your account"}),Vt(Qo,{children:[Vt(At,{children:[$(_t,{children:$(r6,{})}),"Enable 2-Step verification for your ",l?.name," wallet."]}),Vt(At,{children:[$(_t,{children:$(n6,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),Vt(pt,{children:[$(W,{onClick:()=>v(!0),children:"Continue"}),$(fr,{onClick:P,children:"Not now"})]}),$(q,{})]}):k==="sms"?$(Iy,{onComplete:P,onReset:H,onClose:P}):k==="totp"&&C?$(Ly,{onComplete:P,onClose:P,onReset:H,totpInfo:C}):k==="passkey"?$(Py,{onComplete:P,onReset:H,onClose:P}):$(Ey,{showIntro:ae,userMfaMethods:e.mfaMethods,appMfaMethods:l.mfa.methods,userHasAuthSms:_,onBackToIntro:I,handleSelectMethod:Q,isTotpLoading:k==="totp"&&!C,onClose:P,setRemovingMfaMethod:o})};import ib from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import ab from"@heroicons/react/24/outline/FingerPrintIcon";import sb from"@heroicons/react/24/outline/PhoneIcon";import lb from"@heroicons/react/24/outline/ShieldCheckIcon";import cb from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import db from"@heroicons/react/24/solid/PhoneIcon";import{useEffect as pb,useState as wa}from"react";import{useMemo as X6,useEffect as eb,useState as Tg}from"react";import tb from"styled-components";import ng from"styled-components";import Fy from"styled-components";import{jsx as Dy,jsxs as d6}from"react/jsx-runtime";var Nl=({label:e,children:t,valueStyles:r})=>d6(l6,{children:[Dy("div",{children:e}),Dy(c6,{style:{...r},children:t})]}),l6=Fy.div`
2090
+ `;import{Fragment as kd,jsx as ke,jsxs as dn}from"react/jsx-runtime";var Ry=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=Ll(""),[i,a]=Ll(!1),[l,s]=Ll(null),[c,u]=Ll("enroll"),{initEnrollmentWithSms:h,submitEnrollmentWithSms:f}=Vr(),{app:y,data:w}=x();function v(){w?.mfaEnrollmentFlow?.onSuccess(),e()}async function k({qualifiedPhoneNumber:R}){try{await h({phoneNumber:R}),n(R),u("verify")}catch(P){s(P)}}async function S(R){try{if(!R)return;await f({phoneNumber:o,mfaCode:R}),a(!0)}catch(P){throw el(P)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):on(P)?new Error("The code you entered is not valid"):rn(P)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):tl(P)?new Error("Verification canceled"):new Error("Unknown error")}}function C(){c==="verify"?u("enroll"):t()}return l?ke(Ji,{error:l,backFn:()=>s(null),onClick:()=>s(null)}):c==="enroll"?dn(kd,{children:[ke(T,{backFn:t,onClose:r},"header"),ke(ge,{children:ke(Me,{children:ke(Ay,{})})}),ke(ne,{children:"Set up SMS verification"}),ke(se,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),dn(ir,{children:[ke(ei,{onSubmit:k}),dn(Pm,{children:["By providing your mobile number, you agree to receive text messages from ",y?.name,". Some carrier charges may apply"]})]}),ke(q,{})]}):i?dn(kd,{children:[ke(T,{onClose:v},"header"),ke(ge,{children:ke(Me,{status:"success",children:ke(Z5,{})})}),ke(ne,{children:"SMS verification added"}),ke(se,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),ke(pt,{children:ke(W,{onClick:v,children:"Done"})}),ke(q,{})]}):dn(kd,{children:[ke(T,{backFn:C,onClose:r},"header"),ke(ge,{children:ke(Me,{children:ke(Ay,{})})}),ke(ne,{children:"Enter enrollment code"}),dn(ir,{children:[ke(cn,{onChange:S}),dn(se,{children:["To continue, enter the 6-digit code sent to ",ke("strong",{children:Gh(o)})]})]}),ke(q,{})]})};import X5 from"@heroicons/react/24/solid/CheckCircleIcon";import e6 from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import{useState as My}from"react";import J5 from"@heroicons/react/24/solid/ShieldCheckIcon";import{jsx as Q5}from"react/jsx-runtime";var Iy=({size:e,authUrl:t})=>Q5(Xn,{url:t,squareLogoElement:J5,size:e,fgColor:"#1F1F1F"});import{Fragment as _d,jsx as Pe,jsxs as pa}from"react/jsx-runtime";var Wy=({onComplete:e,onClose:t,onReset:r,totpInfo:o})=>{let[n,i]=My("enroll"),[a,l]=My(!1),{submitEnrollmentWithTotp:s}=Vr(),{data:c}=x();function u(){c?.mfaEnrollmentFlow?.onSuccess(),e()}function h(){i("verify")}async function f(w){try{if(!w)return;await s({mfaCode:w}),l(!0)}catch(v){throw el(v)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):on(v)?new Error("The code you entered is not valid"):rn(v)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):tl(v)?new Error("Verification canceled"):new Error("Unknown error")}}function y(){n==="verify"?i("enroll"):r()}return n==="enroll"?pa(_d,{children:[Pe(T,{backFn:r,onClose:t},"header"),Pe(ne,{children:"Scan QR code"}),Pe(se,{children:"Open your authenticator app and scan the QR code to continue."}),Pe(On,{children:Pe(Iy,{authUrl:o.authUrl,size:200})}),pa(pt,{children:[Pe(vt,{children:Pe(So,{itemName:"secret",text:o.secret})}),Pe(W,{onClick:h,children:"Continue"})]}),Pe(q,{})]}):a?pa(_d,{children:[Pe(T,{onClose:u},"header"),Pe(ge,{children:Pe(Me,{status:"success",children:Pe(X5,{})})}),Pe(ne,{children:"Authenticator app verification added"}),Pe(se,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),Pe(pt,{children:Pe(W,{onClick:u,children:"Done"})}),Pe(q,{})]}):pa(_d,{children:[Pe(T,{backFn:y,onClose:t},"header"),Pe(ge,{children:Pe(Me,{children:Pe(e6,{})})}),Pe(ne,{children:"Enter enrollment code"}),Pe(ir,{children:Pe(cn,{onChange:f})}),pa(se,{children:["To continue, enter the 6-digit code generated from your ",Pe("strong",{children:"authenticator app"})]}),Pe(q,{})]})};import{Fragment as ai,jsx as $,jsxs as Vt}from"react/jsx-runtime";var Oy=()=>{let{user:e,enrollInMfa:t}=B(),[r,o]=Ol(null),{unenrollWithSms:n,unenrollWithTotp:i,unenrollWithPasskey:a}=Vr(),{app:l,ready:s,data:c,onUserCloseViaDialogOrKeybindRef:u}=x(),{closePrivyModal:h}=M(),{promptMfa:f}=sa(),{initEnrollmentWithTotp:y}=Vr(),[w,v]=Ol(!1),[k,S]=Ol(null),[C,R]=Ol(null),P=()=>{h({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),S(null)},500)};u.current=P;let O=e?.mfaMethods.includes("sms"),_=!!e?.phone,F=e?.mfaMethods.includes("totp"),K=e?.mfaMethods.includes("passkey"),V=O||F||K;a6(()=>{V&&v(!0)},[V]);function H(){o(null),S(null)}function I(){v(!1)}async function Q(Ee){await f().catch(console.error),S(Ee),Ee==="totp"&&(R(null),y().then(J=>{R(J)}).catch(()=>{R(null),H()}))}if(!s||!e||!l)return Vt(ai,{children:[$(T,{onClose:P},"header"),$(ge,{children:$(wy,{})}),$(ir,{children:$(Xe,{})}),$(q,{})]});async function D(){o(null);try{await n()}catch{o(null)}}async function pe(){o(null);try{await i()}catch{o(null)}}async function me(){o(null);try{await f(),await a()}catch{o(null)}}if(r==="sms")return Vt(ai,{children:[$(T,{backFn:H,onClose:P},"header"),$(ge,{children:$(Me,{children:$(n6,{})})}),$(ne,{children:"Remove SMS verification?"}),Vt(se,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),$(pt,{children:$(W,{warn:!0,onClick:D,children:"Remove SMS for MFA"})}),$(q,{})]});if(r==="totp")return Vt(ai,{children:[$(T,{backFn:H,onClose:P},"header"),$(ge,{children:$(Me,{children:$(r6,{})})}),$(ne,{children:"Remove Authenticator App verification?"}),Vt(se,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),$(pt,{children:$(W,{warn:!0,onClick:pe,children:"Remove Authenticator App for MFA"})}),$(q,{})]});if(r==="passkey")return Vt(ai,{children:[$(T,{backFn:H,onClose:P},"header"),$(ge,{children:$(Me,{children:$(i6,{})})}),$(ne,{children:"Are you sure you want to remove passkey verification?"}),$(se,{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."}),$(pt,{children:$(W,{warn:!0,onClick:me,children:"Yes, remove"})}),$(q,{})]});if(c.mfaEnrollmentFlow.mfaMethods.length===0&&!V)return Vt(ai,{children:[$(T,{onClose:P},"header"),$(ge,{children:$(Me,{children:$(Ly,{})})}),$(ne,{children:"Add more security"}),Vt(se,{children:[l?.name," does not have any verification methods enabled."]}),$(pt,{children:$(W,{onClick:P,children:"Close"})}),$(q,{})]});let ae=!V&&!w;return ae?Vt(ai,{children:[$(T,{onClose:P},"header"),$(ge,{children:$(Me,{children:$(Ly,{})})}),$(ne,{children:"Transaction Protection"}),$(se,{children:"Set up transaction protection to add an extra layer of security to your account"}),Vt(Qo,{children:[Vt(At,{children:[$(_t,{children:$(t6,{})}),"Enable 2-Step verification for your ",l?.name," wallet."]}),Vt(At,{children:[$(_t,{children:$(o6,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),Vt(pt,{children:[$(W,{onClick:()=>v(!0),children:"Continue"}),$(fr,{onClick:P,children:"Not now"})]}),$(q,{})]}):k==="sms"?$(Ry,{onComplete:P,onReset:H,onClose:P}):k==="totp"&&C?$(Wy,{onComplete:P,onClose:P,onReset:H,totpInfo:C}):k==="passkey"?$(Ty,{onComplete:P,onReset:H,onClose:P}):$(by,{showIntro:ae,userMfaMethods:e.mfaMethods,appMfaMethods:l.mfa.methods,userHasAuthSms:_,onBackToIntro:I,handleSelectMethod:Q,isTotpLoading:k==="totp"&&!C,onClose:P,setRemovingMfaMethod:o})};import nb from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import ib from"@heroicons/react/24/outline/FingerPrintIcon";import ab from"@heroicons/react/24/outline/PhoneIcon";import sb from"@heroicons/react/24/outline/ShieldCheckIcon";import lb from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import cb from"@heroicons/react/24/solid/PhoneIcon";import{useEffect as db,useState as wa}from"react";import{useMemo as Q6,useEffect as X6,useState as Eg}from"react";import eb from"styled-components";import og from"styled-components";import Dy from"styled-components";import{jsx as Ny,jsxs as c6}from"react/jsx-runtime";var Nl=({label:e,children:t,valueStyles:r})=>c6(s6,{children:[Ny("div",{children:e}),Ny(l6,{style:{...r},children:t})]}),s6=Dy.div`
2091
2091
  display: flex;
2092
2092
  align-items: center;
2093
2093
  justify-content: space-between;
@@ -2102,7 +2102,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2102
2102
  color: var(--privy-color-foreground-2);
2103
2103
  text-align: right;
2104
2104
  }
2105
- `,c6=Fy.div`
2105
+ `,l6=Dy.div`
2106
2106
  font-size: 14px;
2107
2107
  line-height: 100%;
2108
2108
  display: flex;
@@ -2111,28 +2111,28 @@ You will need this password to access your ${e} wallet on a new device. Please k
2111
2111
  border-radius: var(--privy-border-radius-full);
2112
2112
  background-color: var(--privy-color-background-2);
2113
2113
  padding: 4px 8px;
2114
- `;import Fl from"styled-components";import{BigNumber as Uy}from"@ethersproject/bignumber";import{formatEther as By}from"@ethersproject/units";var ua=(e,t)=>{let r=(t*parseFloat(By(e))).toFixed(2);return r!=="0.00"?`$${r}`:"<$0.01"},Vr=(e,t,r=6,o=!1)=>{let i=parseFloat(By(e)).toFixed(r).replace(/0+$/,"").replace(/\.$/,"");return o?`${i} ${t}`:`${i==="0"?"<0.001":i} ${t}`},Ad=e=>e.map(ft).reduce((t,r)=>t.add(r),Uy.from(0)).toHexString(),Hy=(e,t)=>{let{chains:r}=M(),o=`https://etherscan.io/address/${t}`,n=`${su(e,r)}/address/${t}`;if(!n)return o;try{new URL(n)}catch{return o}return n},ft=e=>Uy.from(e);import{Fragment as f6,jsx as Dl,jsxs as Gy}from"react/jsx-runtime";var Vy=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Ad(e),n=t?ua(o,t):void 0,i=Vr(o,r);return Dl(zy,{children:n||i})},Rd=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Ad(e),n=t?ua(o,t):void 0,i=Vr(o,r);return Dl(zy,{children:n?Gy(f6,{children:[Dl(p6,{children:"USD"}),n==="<$0.01"?Gy(m6,{children:[Dl(u6,{children:"<"}),"$0.01"]}):n]}):i})},zy=Fl.span`
2114
+ `;import Fl from"styled-components";import{BigNumber as Fy}from"@ethersproject/bignumber";import{formatEther as Uy}from"@ethersproject/units";var ua=(e,t)=>{let r=(t*parseFloat(Uy(e))).toFixed(2);return r!=="0.00"?`$${r}`:"<$0.01"},zr=(e,t,r=6,o=!1)=>{let i=parseFloat(Uy(e)).toFixed(r).replace(/0+$/,"").replace(/\.$/,"");return o?`${i} ${t}`:`${i==="0"?"<0.001":i} ${t}`},Ad=e=>e.map(ft).reduce((t,r)=>t.add(r),Fy.from(0)).toHexString(),By=(e,t)=>{let{chains:r}=M(),o=`https://etherscan.io/address/${t}`,n=`${au(e,r)}/address/${t}`;if(!n)return o;try{new URL(n)}catch{return o}return n},ft=e=>Fy.from(e);import{Fragment as m6,jsx as Dl,jsxs as Hy}from"react/jsx-runtime";var Gy=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Ad(e),n=t?ua(o,t):void 0,i=zr(o,r);return Dl(Vy,{children:n||i})},Rd=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Ad(e),n=t?ua(o,t):void 0,i=zr(o,r);return Dl(Vy,{children:n?Hy(m6,{children:[Dl(d6,{children:"USD"}),n==="<$0.01"?Hy(u6,{children:[Dl(p6,{children:"<"}),"$0.01"]}):n]}):i})},Vy=Fl.span`
2115
2115
  font-size: 14px;
2116
2116
  line-height: 140%;
2117
2117
  display: flex;
2118
2118
  gap: 4px;
2119
2119
  align-items: center;
2120
- `,p6=Fl.span`
2120
+ `,d6=Fl.span`
2121
2121
  font-size: 12px;
2122
2122
  line-height: 12px;
2123
2123
  color: var(--privy-color-foreground-3);
2124
- `,u6=Fl.span`
2124
+ `,p6=Fl.span`
2125
2125
  font-size: 10px;
2126
- `,m6=Fl.span`
2126
+ `,u6=Fl.span`
2127
2127
  display: flex;
2128
2128
  align-items: center;
2129
- `;import Id from"styled-components";import{jsx as Io,jsxs as Ul}from"react/jsx-runtime";var qy=({gas:e,tokenPrice:t,tokenSymbol:r})=>Ul(Dc,{style:{paddingBottom:"12px"},children:[Ul(Ky,{children:[Io(Yy,{children:"Est. Fees"}),Io("div",{children:Io(Rd,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&Io(jy,{children:`${Vr(e,r)}`})]}),$y=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=ft(e.value||0).add(ft(t)).toHexString();return Ul(Dc,{children:[Ul(Ky,{children:[Io(Yy,{children:"Total (including fees)"}),Io("div",{children:Io(Rd,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&Io(jy,{children:Vr(n,o)})]})},Ky=Id.div`
2129
+ `;import Id from"styled-components";import{jsx as Io,jsxs as Ul}from"react/jsx-runtime";var zy=({gas:e,tokenPrice:t,tokenSymbol:r})=>Ul(Dc,{style:{paddingBottom:"12px"},children:[Ul($y,{children:[Io(jy,{children:"Est. Fees"}),Io("div",{children:Io(Rd,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&Io(Ky,{children:`${zr(e,r)}`})]}),qy=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=ft(e.value||0).add(ft(t)).toHexString();return Ul(Dc,{children:[Ul($y,{children:[Io(jy,{children:"Total (including fees)"}),Io("div",{children:Io(Rd,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&Io(Ky,{children:zr(n,o)})]})},$y=Id.div`
2130
2130
  display: flex;
2131
2131
  flex-direction: row;
2132
2132
  justify-content: space-between;
2133
2133
  align-items: center;
2134
2134
  padding-top: 4px;
2135
- `,jy=Id.div`
2135
+ `,Ky=Id.div`
2136
2136
  display: flex;
2137
2137
  flex-direction: row;
2138
2138
  height: 12px;
@@ -2141,23 +2141,23 @@ You will need this password to access your ${e} wallet on a new device. Please k
2141
2141
  line-height: 12px;
2142
2142
  color: var(--privy-color-foreground-3);
2143
2143
  font-weight: 400;
2144
- `,Yy=Id.div`
2144
+ `,jy=Id.div`
2145
2145
  font-size: 14px;
2146
2146
  line-height: 22.4px;
2147
2147
  font-weight: 400;
2148
- `;import h6 from"@heroicons/react/24/outline/ChevronDownIcon";import{useContext as pn,useState as y6}from"react";import Mo from"styled-components";import{createContext as Zy,useContext as eV}from"react";var si=Zy(void 0);var ma=Zy(void 0);import{Fragment as P6,jsx as br,jsxs as Jy}from"react/jsx-runtime";var Qy=({defaultValue:e,children:t})=>{let[r,o]=y6(e||null),n=i=>{o(r===i?null:i)};return br(si.Provider,{value:{activePanel:r,togglePanel:n},children:br(g6,{children:t})})},Xy=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=pn(si),n=r===e;return br(ma.Provider,{value:{onToggle:()=>o(e),value:e},children:br(b6,{isActive:n,"data-open":n,children:t})})},eg=({children:e})=>{let{activePanel:t}=pn(si),{onToggle:r,value:o}=pn(ma),n=t===o;return Jy(P6,{children:[Jy(v6,{onClick:r,"data-open":n,children:[br(w6,{children:e}),br(T6,{isactive:n,children:br(h6,{height:"16px",width:"16px",strokeWidth:"2"})})]}),br(C6,{})]})},tg=({children:e})=>{let{activePanel:t}=pn(si),{value:r}=pn(ma);return br(E6,{"data-open":t===r,children:br(og,{children:e})})},rg=({children:e})=>{let{activePanel:t}=pn(si),{value:r}=pn(ma);return br(og,{children:typeof e=="function"?e({isActive:t===r}):e})},g6=Mo.div`
2148
+ `;import f6 from"@heroicons/react/24/outline/ChevronDownIcon";import{useContext as pn,useState as h6}from"react";import Mo from"styled-components";import{createContext as Yy,useContext as XG}from"react";var si=Yy(void 0);var ma=Yy(void 0);import{Fragment as T6,jsx as br,jsxs as Zy}from"react/jsx-runtime";var Jy=({defaultValue:e,children:t})=>{let[r,o]=h6(e||null),n=i=>{o(r===i?null:i)};return br(si.Provider,{value:{activePanel:r,togglePanel:n},children:br(y6,{children:t})})},Qy=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=pn(si),n=r===e;return br(ma.Provider,{value:{onToggle:()=>o(e),value:e},children:br(w6,{isActive:n,"data-open":n,children:t})})},Xy=({children:e})=>{let{activePanel:t}=pn(si),{onToggle:r,value:o}=pn(ma),n=t===o;return Zy(T6,{children:[Zy(g6,{onClick:r,"data-open":n,children:[br(C6,{children:e}),br(E6,{isactive:n,children:br(f6,{height:"16px",width:"16px",strokeWidth:"2"})})]}),br(v6,{})]})},eg=({children:e})=>{let{activePanel:t}=pn(si),{value:r}=pn(ma);return br(b6,{"data-open":t===r,children:br(rg,{children:e})})},tg=({children:e})=>{let{activePanel:t}=pn(si),{value:r}=pn(ma);return br(rg,{children:typeof e=="function"?e({isActive:t===r}):e})},y6=Mo.div`
2149
2149
  display: flex;
2150
2150
  flex-direction: column;
2151
2151
  width: 100%;
2152
2152
  gap: 8px;
2153
- `,v6=Mo.div`
2153
+ `,g6=Mo.div`
2154
2154
  display: flex;
2155
2155
  justify-content: space-between;
2156
2156
  align-items: center;
2157
2157
  width: 100%;
2158
2158
  cursor: pointer;
2159
2159
  padding-bottom: 8px;
2160
- `,C6=Mo.div`
2160
+ `,v6=Mo.div`
2161
2161
  width: 100%;
2162
2162
 
2163
2163
  && {
@@ -2165,13 +2165,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
2165
2165
  border-color: var(--privy-color-foreground-4);
2166
2166
  }
2167
2167
  padding-bottom: 12px;
2168
- `,w6=Mo.div`
2168
+ `,C6=Mo.div`
2169
2169
  font-size: 14px;
2170
2170
  font-weight: 500;
2171
2171
  line-height: 19.6px;
2172
2172
  width: 100%;
2173
2173
  padding-right: 8px;
2174
- `,b6=Mo.div`
2174
+ `,w6=Mo.div`
2175
2175
  display: flex;
2176
2176
  flex-direction: column;
2177
2177
  width: 100%;
@@ -2183,7 +2183,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2183
2183
  border-color: var(--privy-color-foreground-4);
2184
2184
  border-radius: var(--privy-border-radius-md);
2185
2185
  }
2186
- `,E6=Mo.div`
2186
+ `,b6=Mo.div`
2187
2187
  position: relative;
2188
2188
  overflow: hidden;
2189
2189
  transition: max-height 25ms ease-out;
@@ -2195,38 +2195,38 @@ You will need this password to access your ${e} wallet on a new device. Please k
2195
2195
  &[data-open='false'] {
2196
2196
  max-height: 0;
2197
2197
  }
2198
- `,og=Mo.div`
2198
+ `,rg=Mo.div`
2199
2199
  display: flex;
2200
2200
  flex-direction: column;
2201
2201
  gap: 12px;
2202
2202
  flex: 1 1 auto;
2203
2203
  min-height: 1px;
2204
- `,T6=Mo.div`
2204
+ `,E6=Mo.div`
2205
2205
  transform: ${e=>e.isactive?"rotate(180deg)":"rotate(0deg)"};
2206
- `;import S6 from"styled-components";import{jsx as k6}from"react/jsx-runtime";var Md=({walletAddress:e,chainId:t=Yr})=>k6(x6,{href:Hy(t,e),target:"_blank",children:fo(e)}),x6=S6.a`
2206
+ `;import P6 from"styled-components";import{jsx as x6}from"react/jsx-runtime";var Md=({walletAddress:e,chainId:t=Zr})=>x6(S6,{href:By(t,e),target:"_blank",children:ho(e)}),S6=P6.a`
2207
2207
  &:hover {
2208
2208
  text-decoration: underline;
2209
2209
  }
2210
- `;import{jsx as zt,jsxs as Wd}from"react/jsx-runtime";var li=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=r?.value||0;return zt(Qy,{children:Wd(Xy,{value:"details",children:[zt(eg,{children:Wd(_6,{children:[zt("div",{children:o?.title||o?.actionDescription||"Details"}),zt(A6,{children:zt(Vy,{weiQuantities:[l],tokenPrice:n,tokenSymbol:a})})]})}),Wd(tg,{children:[zt(Nl,{label:"From",children:zt(Md,{walletAddress:e,chainId:r.chainId||Yr})}),zt(Nl,{label:"To",children:zt(Md,{walletAddress:t,chainId:r.chainId||Yr})}),o&&o.action&&zt(Nl,{label:"Action",children:o.action}),i&&zt(qy,{transactionData:r,gas:i,tokenPrice:n,tokenSymbol:a})]}),zt(rg,{children:({isActive:s})=>zt($y,{transactionData:r,displayFee:s,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},_6=ng.div`
2210
+ `;import{jsx as zt,jsxs as Wd}from"react/jsx-runtime";var li=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=r?.value||0;return zt(Jy,{children:Wd(Qy,{value:"details",children:[zt(Xy,{children:Wd(k6,{children:[zt("div",{children:o?.title||o?.actionDescription||"Details"}),zt(_6,{children:zt(Gy,{weiQuantities:[l],tokenPrice:n,tokenSymbol:a})})]})}),Wd(eg,{children:[zt(Nl,{label:"From",children:zt(Md,{walletAddress:e,chainId:r.chainId||Zr})}),zt(Nl,{label:"To",children:zt(Md,{walletAddress:t,chainId:r.chainId||Zr})}),o&&o.action&&zt(Nl,{label:"Action",children:o.action}),i&&zt(zy,{transactionData:r,gas:i,tokenPrice:n,tokenSymbol:a})]}),zt(tg,{children:({isActive:s})=>zt(qy,{transactionData:r,displayFee:s,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},k6=og.div`
2211
2211
  display: flex;
2212
2212
  flex-direction: row;
2213
2213
  justify-content: space-between;
2214
- `,A6=ng.div`
2214
+ `,_6=og.div`
2215
2215
  flex-shrink: 0;
2216
2216
  padding-left: 8px;
2217
- `;import ha from"styled-components";import{jsx as fa,jsxs as O6}from"react/jsx-runtime";var Ld=({description:e,contractInfo:t})=>O6(R6,{children:[t.imgUrl&&fa(I6,{size:t.imgSize||"sm",src:t.imgUrl,alt:t.imgAltText||`${t.name} image`}),t.url&&fa(M6,{children:fa("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:t.url.replace(/^(https?:\/\/)(www\.)?/,"")})}),t.name&&fa(W6,{children:t.name}),fa(L6,{children:e||t.actionText})]}),R6=ha.div`
2217
+ `;import ha from"styled-components";import{jsx as fa,jsxs as L6}from"react/jsx-runtime";var Ld=({description:e,contractInfo:t})=>L6(A6,{children:[t.imgUrl&&fa(R6,{size:t.imgSize||"sm",src:t.imgUrl,alt:t.imgAltText||`${t.name} image`}),t.url&&fa(I6,{children:fa("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",children:t.url.replace(/^(https?:\/\/)(www\.)?/,"")})}),t.name&&fa(M6,{children:t.name}),fa(W6,{children:e||t.actionText})]}),A6=ha.div`
2218
2218
  display: flex;
2219
2219
  flex-direction: column;
2220
2220
  align-items: center;
2221
2221
  margin-bottom: 8px;
2222
- `,I6=ha.img`
2222
+ `,R6=ha.img`
2223
2223
  && {
2224
2224
  height: ${e=>e.size==="sm"?"65px":"140px"};
2225
2225
  width: ${e=>e.size==="sm"?"65px":"140px"};
2226
2226
  border-radius: 16px;
2227
2227
  margin-bottom: 12px;
2228
2228
  }
2229
- `,M6=ha.div`
2229
+ `,I6=ha.div`
2230
2230
  font-size: 12px;
2231
2231
  line-height: 12px;
2232
2232
  padding: 7px;
@@ -2239,7 +2239,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2239
2239
  text-decoration: underline;
2240
2240
  }
2241
2241
  }
2242
- `,W6=ha.div`
2242
+ `,M6=ha.div`
2243
2243
  font-size: 18px;
2244
2244
  line-height: 18px;
2245
2245
  font-weight: 500;
@@ -2247,7 +2247,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2247
2247
  white-space: nowrap;
2248
2248
  max-width: 275px;
2249
2249
  text-overflow: ellipsis;
2250
- `,L6=ha.div`
2250
+ `,W6=ha.div`
2251
2251
  font-size: 16px;
2252
2252
  line-height: 140%;
2253
2253
  font-weight: 400;
@@ -2255,7 +2255,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2255
2255
  overflow: hidden;
2256
2256
  max-width: 275px;
2257
2257
  text-overflow: ellipsis;
2258
- `;import N6 from"@heroicons/react/24/outline/WalletIcon";import Nd from"styled-components";import{jsx as ig,jsxs as Od}from"react/jsx-runtime";var ag=({address:e,txn:t,balance:r,hasFunds:o})=>{let n=!!r,{nativeTokenSymbolForChainId:i}=M(),a=i(t.chainId)||"ETH";return Od(D6,{children:[Od(F6,{children:[ig(N6,{strokeWidth:"2",width:"16px",height:"16px"}),ig("div",{children:fo(e)})]}),Od(U6,{displayBalanceColor:n,hasFunds:o,children:[r?Vr(r,a,6,!0):0," available"]})]})},D6=Nd.div`
2258
+ `;import O6 from"@heroicons/react/24/outline/WalletIcon";import Nd from"styled-components";import{jsx as ng,jsxs as Od}from"react/jsx-runtime";var ig=({address:e,txn:t,balance:r,hasFunds:o})=>{let n=!!r,{nativeTokenSymbolForChainId:i}=M(),a=i(t.chainId)||"ETH";return Od(N6,{children:[Od(D6,{children:[ng(O6,{strokeWidth:"2",width:"16px",height:"16px"}),ng("div",{children:ho(e)})]}),Od(F6,{displayBalanceColor:n,hasFunds:o,children:[r?zr(r,a,6,!0):0," available"]})]})},N6=Nd.div`
2259
2259
  display: flex;
2260
2260
  flex-direction: row;
2261
2261
  justify-content: space-between;
@@ -2268,12 +2268,12 @@ You will need this password to access your ${e} wallet on a new device. Please k
2268
2268
  border: 1px solid var(--privy-color-foreground-4);
2269
2269
  border-radius: var(--privy-border-radius-md);
2270
2270
  }
2271
- `,F6=Nd.div`
2271
+ `,D6=Nd.div`
2272
2272
  display: flex;
2273
2273
  flex-direction: row;
2274
2274
  align-items: center;
2275
2275
  gap: 8px;
2276
- `,U6=Nd.div`
2276
+ `,F6=Nd.div`
2277
2277
  display: flex;
2278
2278
  align-items: center;
2279
2279
  justify-content: center;
@@ -2283,35 +2283,35 @@ You will need this password to access your ${e} wallet on a new device. Please k
2283
2283
  background-color: var(--privy-color-background-2);
2284
2284
  padding: 5px 8px;
2285
2285
  color: ${e=>e.displayBalanceColor?e.hasFunds?"var(--privy-color-success-dark)":"var(--privy-color-error)":"inherit"};
2286
- `;import Bl from"styled-components";import{Fragment as lg,jsx as ya,jsxs as cg}from"react/jsx-runtime";var dg=({description:e,txn:t,tokenSymbol:r,tokenPrice:o})=>{let n=t.value||0,i=o?ua(n,o):void 0,a=Vr(n,r);return cg(B6,{children:[i?cg(lg,{children:[ya(sg,{children:i}),ya(H6,{children:a})]}):ya(lg,{children:ya(sg,{children:a})}),ya(G6,{children:e})]})},B6=Bl.div`
2286
+ `;import Bl from"styled-components";import{Fragment as sg,jsx as ya,jsxs as lg}from"react/jsx-runtime";var cg=({description:e,txn:t,tokenSymbol:r,tokenPrice:o})=>{let n=t.value||0,i=o?ua(n,o):void 0,a=zr(n,r);return lg(U6,{children:[i?lg(sg,{children:[ya(ag,{children:i}),ya(B6,{children:a})]}):ya(sg,{children:ya(ag,{children:a})}),ya(H6,{children:e})]})},U6=Bl.div`
2287
2287
  display: flex;
2288
2288
  flex-direction: column;
2289
2289
  align-items: center;
2290
2290
  margin-bottom: 20px;
2291
- `,sg=Bl.h2`
2291
+ `,ag=Bl.h2`
2292
2292
  && {
2293
2293
  font-size: 48px;
2294
2294
  line-height: 48px;
2295
2295
  margin: 8px auto;
2296
2296
  }
2297
- `,H6=Bl.p`
2297
+ `,B6=Bl.p`
2298
2298
  margin-bottom: 12px;
2299
2299
  && {
2300
2300
  font-size: 17px;
2301
2301
  line-height: 17px;
2302
2302
  color: var(--privy-color-foreground-3);
2303
2303
  }
2304
- `,G6=Bl.div`
2304
+ `,H6=Bl.div`
2305
2305
  font-size: 16px;
2306
2306
  line-height: 22.4px;
2307
2307
  font-weight: 400;
2308
2308
  overflow: hidden;
2309
2309
  max-width: 275px;
2310
2310
  text-overflow: ellipsis;
2311
- `;import{VoidSigner as j6}from"@ethersproject/abstract-signer";import{EtherscanProvider as wz}from"@ethersproject/providers";import{BigNumber as fg}from"@ethersproject/bignumber";import{BigNumber as ci}from"@ethersproject/bignumber";import{Contract as V6}from"@ethersproject/contracts";import{serialize as z6}from"@ethersproject/transactions";var di=e=>[Es.id,Ts.id,Ps.id,Ss.id,xs.id,ks.id,_s.id,Rs.id,As.id].includes(e),pg=async(e,t)=>{if(!di(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=ci.from(r).mul(ci.from(126)).div(ci.from(100)).add(ci.from(e.maxPriorityFeePerGas));e.maxFeePerGas=ga(i)}}catch(r){throw new Error(`Failed to set gas price for OP stack transaction: ${r}.`)}return e};async function ug(e,t){if(!e.chainId||e.chainId&&!di(e.chainId))return ci.from(0);let r=ci.from(0);try{let o=new V6(Xp,eu,t),n=mg(e),i=z6(n);r=await o.getL1Fee(i)}catch{}return r}async function hg(e,t){try{return(await t.estimateGas(e)).toHexString()}catch{}let r={...e,from:void 0};return(await t.estimateGas(r)).toHexString()}var yg=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 pi(e,t){if(!e.gasLimit)throw new Ne("gasLimit was not successfully set for transaction.");let r=ft(e.gasLimit),o=fg.from(0);if(e.type==2)if(e.maxFeePerGas)o=ft(e.maxFeePerGas);else throw new Ne("maxFeePerGas was not successfully set for transaction of type 2.");else if(e.gasPrice)o=ft(e.gasPrice);else throw new Ne("gasPrice was not successfully set for transaction of type 0 or 1.");let n=r.mul(o),i=fg.from(0);if(e.chainId&&di(e.chainId))try{i=await ug(e,t),n=n.add(i)}catch{}return{totalGasEstimate:n,l1ExecutionFeeEstimate:i}}import{BigNumber as Dd}from"@ethersproject/bignumber";var Fd=e=>[Cs.id,ws.id,bs.id].includes(e),gg=async(e,t)=>{if(!Fd(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(Dd.from(120)).div(Dd.from(100));e.maxFeePerGas=ga(o),e.maxPriorityFeePerGas=ga(Dd.from(0))}}catch(r){throw new Error(`Failed to set gas price for Arbitrum transaction: ${r}.`)}return e};var Ud=e=>[56,97].includes(e),vg=async(e,t)=>{if(!Ud(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};import{parseUnits as Cg}from"@ethersproject/units";import{ofetch as q6}from"ofetch";var Bd={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 Gd=e=>[Ai.id,Ri.id,Bd.id].includes(e),Hd=e=>({maxPriorityFee:Cg(e.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:Cg(e.maxFee.toFixed(9),"gwei").toHexString()}),$6=e=>({safeLow:Hd(e.safeLow),standard:Hd(e.standard),fast:Hd(e.fast)}),K6=async e=>{let t="";switch(e){case Ai.id:t="https://gasstation.polygon.technology/v2";break;case Ri.id:t="https://gasstation-testnet.polygon.technology/v2";break;case Bd.id:t="https://gasstation-testnet.polygon.technology/amoy";break;default:throw Error(`chainId ${e} does not support polygon gas stations`)}return $6(await q6(t))};async function wg(e){if(!Gd(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 K6(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 ga(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 mg(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=ft(e.nonce).toNumber()),e.gasLimit!==void 0&&(t.gasLimit=ft(e.gasLimit)),e.gasPrice!==void 0&&(t.gasPrice=ft(e.gasPrice)),e.value!==void 0&&(t.value=ft(e.value)),e.maxFeePerGas!==void 0&&(t.maxFeePerGas=ft(e.maxFeePerGas)),e.maxPriorityFeePerGas!==void 0&&(t.maxPriorityFeePerGas=ft(e.maxPriorityFeePerGas)),t}async function ui(e,t,r){if(t.chainId=Number(t.chainId),bg(t),t.from||(t.from=e),!t.nonce){let o=new j6(e,r);t.nonce=await o.getTransactionCount("pending")}return t.gasLimit||(t.gas?(t.gasLimit=t.gas,delete t.gas):t.gasLimit=await hg(t,r)),typeof t.type=="string"&&Eg(t.type)&&(t.type=Number(t.type)),[23294,23295].includes(t.chainId)&&(t.type=0),Gd(t.chainId)?t=await wg(t):Fd(t.chainId)?t=await gg(t,r):di(t.chainId)?t=await pg(t,r):Ud(t.chainId)?t=await vg(t,r):t=await yg(t,r),t.type===0&&delete t.accessList,t.type!==2&&(delete t.maxPriorityFeePerGas,delete t.maxFeePerGas),t}async function Hl(e,t,r,o,n){o=Object.assign({chainId:Yr},o),bg(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 Gl(e,t,r,o){let n=await o.getBalance(e),i=t.value||0,l=!n.sub(ft(i)).sub(r).isNegative();return{balance:n,hasSufficientFunds:l}}function bg(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!Y6(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 Y6(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&Eg(e);return t||r||o}function Eg(e){return/^-?0x[a-f0-9]+$/i.test(e)}function Vl(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}}import{useState as Vd,useEffect as Z6}from"react";var zl=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=M(),[n,i]=Vd(!0),[a,l]=Vd(void 0),[s,c]=Vd(void 0);return Z6(()=>{let u=e.chainId||Yr,h=o.find(y=>y.id===Number(u));if(!h)throw new ee(`Unsupported chain: ${u}`);(async()=>{if(!t){i(!1);return}try{i(!0);let y=await r(h);y?c(y):l(new Error(`Unable to fetch token price on chain id ${h.id}`))}catch(y){l(y)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};import{createContext as J6,useContext as Q6}from"react";var zd=J6(null);function va(){let e=Q6(zd);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}import{jsx as Pg}from"react/jsx-runtime";var Ca=({pendingTransaction:e})=>{let{getAccessToken:t}=B(),{wallets:r}=va(),{walletProxy:o,rpcConfig:n,chains:i,appId:a,nativeTokenSymbolForChainId:l}=M(),[s,c]=Tg(null),[u,h]=Tg(e),{tokenPrice:f}=zl(u),y=l(e.chainId)||"ETH",w=X6(()=>r.find(v=>v.walletClientType==="privy"),[r]);return eb(()=>{async function v(){if(!await t()||!o||!w)return u;let S=Zr(u.chainId,i,n,{appId:a}),C=await ui(w.address,u,S),{totalGasEstimate:R}=await pi(C,S);return c(R.toHexString()),C}v().then(h).catch(console.error)},[o]),w?Pg(rb,{children:Pg(li,{from:w.address,to:u.to,txn:u,gas:s??void 0,tokenPrice:f,tokenSymbol:y})}):null},rb=tb.div`
2311
+ `;import{VoidSigner as K6}from"@ethersproject/abstract-signer";import{EtherscanProvider as Cz}from"@ethersproject/providers";import{BigNumber as mg}from"@ethersproject/bignumber";import{BigNumber as ci}from"@ethersproject/bignumber";import{Contract as G6}from"@ethersproject/contracts";import{serialize as V6}from"@ethersproject/transactions";var di=e=>[Es.id,Ts.id,Ps.id,Ss.id,xs.id,ks.id,_s.id,Rs.id,As.id].includes(e),dg=async(e,t)=>{if(!di(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=ci.from(r).mul(ci.from(126)).div(ci.from(100)).add(ci.from(e.maxPriorityFeePerGas));e.maxFeePerGas=ga(i)}}catch(r){throw new Error(`Failed to set gas price for OP stack transaction: ${r}.`)}return e};async function pg(e,t){if(!e.chainId||e.chainId&&!di(e.chainId))return ci.from(0);let r=ci.from(0);try{let o=new G6(Qp,Xp,t),n=ug(e),i=V6(n);r=await o.getL1Fee(i)}catch{}return r}async function fg(e,t){try{return(await t.estimateGas(e)).toHexString()}catch{}let r={...e,from:void 0};return(await t.estimateGas(r)).toHexString()}var hg=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 pi(e,t){if(!e.gasLimit)throw new Ne("gasLimit was not successfully set for transaction.");let r=ft(e.gasLimit),o=mg.from(0);if(e.type==2)if(e.maxFeePerGas)o=ft(e.maxFeePerGas);else throw new Ne("maxFeePerGas was not successfully set for transaction of type 2.");else if(e.gasPrice)o=ft(e.gasPrice);else throw new Ne("gasPrice was not successfully set for transaction of type 0 or 1.");let n=r.mul(o),i=mg.from(0);if(e.chainId&&di(e.chainId))try{i=await pg(e,t),n=n.add(i)}catch{}return{totalGasEstimate:n,l1ExecutionFeeEstimate:i}}import{BigNumber as Dd}from"@ethersproject/bignumber";var Fd=e=>[Cs.id,ws.id,bs.id].includes(e),yg=async(e,t)=>{if(!Fd(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(Dd.from(120)).div(Dd.from(100));e.maxFeePerGas=ga(o),e.maxPriorityFeePerGas=ga(Dd.from(0))}}catch(r){throw new Error(`Failed to set gas price for Arbitrum transaction: ${r}.`)}return e};var Ud=e=>[56,97].includes(e),gg=async(e,t)=>{if(!Ud(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};import{parseUnits as vg}from"@ethersproject/units";import{ofetch as z6}from"ofetch";var Bd={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 Gd=e=>[Ai.id,Ri.id,Bd.id].includes(e),Hd=e=>({maxPriorityFee:vg(e.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:vg(e.maxFee.toFixed(9),"gwei").toHexString()}),q6=e=>({safeLow:Hd(e.safeLow),standard:Hd(e.standard),fast:Hd(e.fast)}),$6=async e=>{let t="";switch(e){case Ai.id:t="https://gasstation.polygon.technology/v2";break;case Ri.id:t="https://gasstation-testnet.polygon.technology/v2";break;case Bd.id:t="https://gasstation-testnet.polygon.technology/amoy";break;default:throw Error(`chainId ${e} does not support polygon gas stations`)}return q6(await z6(t))};async function Cg(e){if(!Gd(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 $6(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 ga(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 ug(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=ft(e.nonce).toNumber()),e.gasLimit!==void 0&&(t.gasLimit=ft(e.gasLimit)),e.gasPrice!==void 0&&(t.gasPrice=ft(e.gasPrice)),e.value!==void 0&&(t.value=ft(e.value)),e.maxFeePerGas!==void 0&&(t.maxFeePerGas=ft(e.maxFeePerGas)),e.maxPriorityFeePerGas!==void 0&&(t.maxPriorityFeePerGas=ft(e.maxPriorityFeePerGas)),t}async function ui(e,t,r){if(t.chainId=Number(t.chainId),wg(t),t.from||(t.from=e),!t.nonce){let o=new K6(e,r);t.nonce=await o.getTransactionCount("pending")}return t.gasLimit||(t.gas?(t.gasLimit=t.gas,delete t.gas):t.gasLimit=await fg(t,r)),typeof t.type=="string"&&bg(t.type)&&(t.type=Number(t.type)),[23294,23295].includes(t.chainId)&&(t.type=0),Gd(t.chainId)?t=await Cg(t):Fd(t.chainId)?t=await yg(t,r):di(t.chainId)?t=await dg(t,r):Ud(t.chainId)?t=await gg(t,r):t=await hg(t,r),t.type===0&&delete t.accessList,t.type!==2&&(delete t.maxPriorityFeePerGas,delete t.maxFeePerGas),t}async function Hl(e,t,r,o,n){o=Object.assign({chainId:Zr},o),wg(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 Gl(e,t,r,o){let n=await o.getBalance(e),i=t.value||0,l=!n.sub(ft(i)).sub(r).isNegative();return{balance:n,hasSufficientFunds:l}}function wg(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!j6(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 j6(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&bg(e);return t||r||o}function bg(e){return/^-?0x[a-f0-9]+$/i.test(e)}function Vl(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}}import{useState as Vd,useEffect as Y6}from"react";var zl=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=M(),[n,i]=Vd(!0),[a,l]=Vd(void 0),[s,c]=Vd(void 0);return Y6(()=>{let u=e.chainId||Zr,h=o.find(y=>y.id===Number(u));if(!h)throw new ee(`Unsupported chain: ${u}`);(async()=>{if(!t){i(!1);return}try{i(!0);let y=await r(h);y?c(y):l(new Error(`Unable to fetch token price on chain id ${h.id}`))}catch(y){l(y)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};import{createContext as Z6,useContext as J6}from"react";var zd=Z6(null);function va(){let e=J6(zd);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}import{jsx as Tg}from"react/jsx-runtime";var Ca=({pendingTransaction:e})=>{let{getAccessToken:t}=B(),{wallets:r}=va(),{walletProxy:o,rpcConfig:n,chains:i,appId:a,nativeTokenSymbolForChainId:l}=M(),[s,c]=Eg(null),[u,h]=Eg(e),{tokenPrice:f}=zl(u),y=l(e.chainId)||"ETH",w=Q6(()=>r.find(v=>v.walletClientType==="privy"),[r]);return X6(()=>{async function v(){if(!await t()||!o||!w)return u;let S=Jr(u.chainId,i,n,{appId:a}),C=await ui(w.address,u,S),{totalGasEstimate:R}=await pi(C,S);return c(R.toHexString()),C}v().then(h).catch(console.error)},[o]),w?Tg(tb,{children:Tg(li,{from:w.address,to:u.to,txn:u,gas:s??void 0,tokenPrice:f,tokenSymbol:y})}):null},tb=eb.div`
2312
2312
  width: 100%;
2313
2313
  padding: 1rem 0;
2314
- `;import ob from"@heroicons/react/24/outline/CalendarIcon";import nb from"@heroicons/react/24/outline/ShieldCheckIcon";import{Fragment as Sg,jsx as Et,jsxs as mi}from"react/jsx-runtime";var xg=({hasBlockingError:e,error:t,onClose:r,onBack:o,handleSubmit:n,account:i})=>{let{pendingTransaction:a}=M();return mi(Sg,{children:[Et(T,{onClose:r},"header"),Et(ge,{children:mi(ri,{children:[Et(ln,{}),Et(io,{})]})}),Et(ne,{children:"Verifying with passkey"}),mi(Qo,{children:[mi(At,{children:[Et(_t,{children:Et(nb,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),mi(At,{children:[Et(_t,{children:Et(ob,{})}),"You last added a passkey on"," ",i?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),a&&Et(ir,{children:Et(Ca,{pendingTransaction:a})}),t&&mi(Sg,{children:[Et(xm,{style:{marginTop:"1.25rem"},children:t.message}),Et(W,{disabled:e,onClick:n,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&Et(Oi,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),Et(q,{})]})};import{Fragment as qd,jsx as de,jsxs as Er}from"react/jsx-runtime";var $d=({open:e,onClose:t})=>{let{user:r}=B(),[o,n]=wa(null),{init:i,cancel:a,submit:l}=sa(),[s,c]=wa(!1),[u,h]=wa(!1),[f,y]=wa(null),[w,v]=wa(null);pb(()=>{e&&r?.mfaMethods&&r.mfaMethods.length>0?C(r.mfaMethods[0]):n(null)},[r?.mfaMethods,e]);let k=O=>Yc(O)?(c(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):on(O)?(c(!1),new Error("The code you entered is not valid")):rn(O)?(c(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(O),c(!1),new Error("Something went wrong."));async function S(O){v(null);try{if(!O||!o)return;await l(o,O),h(!0),c(!1),t()}catch(_){throw k(_)}}async function C(O){if(O==="passkey"){try{n(O);let _=await i(O);if(!_)throw new Error("something went wrong");y(_),await l(O,_),h(!0),c(!1),t()}catch(_){v(k(_))}return}try{n(O),await i(O)}catch(_){console.error(_)}}let R=()=>{n(null),v(null),a(),t()},P=()=>{n(null),v(null)};if(!e||!r)return null;if(o==="passkey"){let O=r.linkedAccounts.filter(_=>_.type==="passkey"&&_.enrolledInMfa).sort((_,D)=>D.firstVerifiedAt.valueOf()-_.firstVerifiedAt.valueOf())[0];return de(xg,{account:O,selectedMethod:o,submitSuccess:u,hasBlockingError:s,error:w,onClose:R,onBack:P,handleSubmit:()=>S(f).catch(v)})}return o?de(ub,{submitSuccess:u,hasBlockingError:s,handleSubmitCode:S,selectedMethod:o,onClose:R,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):Er(qd,{children:[de(T,{onClose:R},"header"),de(ge,{children:de(Me,{children:de(lb,{})})}),de(ne,{children:"Verify your identity"}),de(se,{children:"Choose a verification method"}),Er(Gs,{children:[r.mfaMethods.includes("totp")&&Er(Ae,{onClick:()=>C("totp"),children:[de(ib,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&Er(Ae,{onClick:()=>C("sms"),children:[de(sb,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&Er(Ae,{onClick:()=>C("passkey"),children:[de(ab,{}),"Passkey"]},"passkey")]}),de(q,{})]})},ub=({selectedMethod:e,submitSuccess:t,hasBlockingError:r,onClose:o,onBack:n,handleSubmitCode:i})=>{let{app:a}=x(),{pendingTransaction:l}=M();switch(e){case"sms":return Er(qd,{children:[de(T,{onClose:o},"header"),de(ge,{children:de(Me,{children:de(db,{})})}),de(ne,{children:"Enter verification code"}),Er(ir,{children:[de(cn,{success:t,disabled:r,onChange:i}),Er(se,{children:["To continue, please enter the 6-digit code sent to your ",de("strong",{children:"mobile device"})]}),l&&de(Ca,{pendingTransaction:l})]}),n&&de(Oi,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),de(fr,{onClick:o,children:"Not now"}),de(q,{})]});case"totp":return Er(qd,{children:[de(T,{onClose:o},"header"),de(ge,{children:de(Me,{children:de(cb,{})})}),de(ne,{children:"Enter verification code"}),Er(ir,{children:[de(cn,{success:t,disabled:r,onChange:i}),Er(se,{children:["To continue, please enter the 6-digit code generated from your"," ",de("strong",{children:"authenticator app"})]}),l&&de(Ca,{pendingTransaction:l})]}),n&&de(Oi,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),de(fr,{onClick:o,children:"Not now"}),de(q,{})]});default:return null}};import{useEffect as kg,useState as _g}from"react";import mb from"styled-components";import{Fragment as hb,jsx as zr,jsxs as ql}from"react/jsx-runtime";var Ag=()=>{let{authenticated:e,logout:t,ready:r,user:o}=B(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=x(),{getAuthMeta:s,initLoginWithOAuth:c,loginWithOAuth:u,updateWallets:h,setReadyToTrue:f,closePrivyModal:y,createAnalyticsEvent:w}=M(),[v,k]=_g(!1),[S,C]=_g(void 0),R=s()?.provider||"google",{name:P,component:O}=ki(R),_=Os(),D=n?.render.inDialog?Be:0;kg(()=>{u(R).then(H=>{k(!0),f(!0),H&&_("login","onOAuthLoginComplete",H)}).catch(H=>{if(H?.privyErrorCode==="allowlist_rejected"){C(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(H?.privyErrorCode==="max_accounts_reached"){console.error(new kr(H).toString()),C(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}let{retryable:I,detail:Q}=Tu(H,R);C({retryable:I,detail:Q,message:"Authentication failed"}),f(!1)}).finally(()=>{qo()})},[P,R]),kg(()=>{if(r&&e&&v&&o){if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let I=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},D);return()=>clearTimeout(I)}if(tr(o,n?.embeddedWallets?.createOnLogin)){let I=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:Q=>{console.error(Q),w({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Q,provider:R,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},D);return()=>clearTimeout(I)}else{let I=setTimeout(()=>y({shouldCallAuthOnSuccess:!0,isSuccess:!0}),D);return h(),()=>clearTimeout(I)}}},[r,e,v,o]);let K=v?`Successfully connected with ${P}`:S?S.message:`Verifying connection to ${P}`,V="";return v?V="You\u2019re good to go!":S?V=S.detail:V="Just a few moments more",ql(hb,{children:[zr(T,{}),zr(X,{}),ql(fb,{children:[zr(Rt,{children:ql("div",{children:[zr(xt,{success:v,fail:!!S}),zr(O,{style:{width:"38px",height:"38px"}})]})}),ql($e,{children:[zr("h3",{children:K}),zr("p",{children:V})]}),S&&S?.retryable?zr(Fs,{onClick:()=>{qo(),c(R),C(void 0)},disabled:!v&&!S?.retryable,children:"Retry"}):null]}),zr(ie,{}),zr(q,{})]})},fb=mb.div`
2314
+ `;import rb from"@heroicons/react/24/outline/CalendarIcon";import ob from"@heroicons/react/24/outline/ShieldCheckIcon";import{Fragment as Pg,jsx as Et,jsxs as mi}from"react/jsx-runtime";var Sg=({hasBlockingError:e,error:t,onClose:r,onBack:o,handleSubmit:n,account:i})=>{let{pendingTransaction:a}=M();return mi(Pg,{children:[Et(T,{onClose:r},"header"),Et(ge,{children:mi(ri,{children:[Et(ln,{}),Et(ao,{})]})}),Et(ne,{children:"Verifying with passkey"}),mi(Qo,{children:[mi(At,{children:[Et(_t,{children:Et(ob,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),mi(At,{children:[Et(_t,{children:Et(rb,{})}),"You last added a passkey on"," ",i?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),a&&Et(ir,{children:Et(Ca,{pendingTransaction:a})}),t&&mi(Pg,{children:[Et(Sm,{style:{marginTop:"1.25rem"},children:t.message}),Et(W,{disabled:e,onClick:n,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&Et(Oi,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),Et(q,{})]})};import{Fragment as qd,jsx as de,jsxs as Er}from"react/jsx-runtime";var $d=({open:e,onClose:t})=>{let{user:r}=B(),[o,n]=wa(null),{init:i,cancel:a,submit:l}=sa(),[s,c]=wa(!1),[u,h]=wa(!1),[f,y]=wa(null),[w,v]=wa(null);db(()=>{e&&r?.mfaMethods&&r.mfaMethods.length>0?C(r.mfaMethods[0]):n(null)},[r?.mfaMethods,e]);let k=O=>Yc(O)?(c(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):on(O)?(c(!1),new Error("The code you entered is not valid")):rn(O)?(c(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(O),c(!1),new Error("Something went wrong."));async function S(O){v(null);try{if(!O||!o)return;await l(o,O),h(!0),c(!1),t()}catch(_){throw k(_)}}async function C(O){if(O==="passkey"){try{n(O);let _=await i(O);if(!_)throw new Error("something went wrong");y(_),await l(O,_),h(!0),c(!1),t()}catch(_){v(k(_))}return}try{n(O),await i(O)}catch(_){console.error(_)}}let R=()=>{n(null),v(null),a(),t()},P=()=>{n(null),v(null)};if(!e||!r)return null;if(o==="passkey"){let O=r.linkedAccounts.filter(_=>_.type==="passkey"&&_.enrolledInMfa).sort((_,F)=>F.firstVerifiedAt.valueOf()-_.firstVerifiedAt.valueOf())[0];return de(Sg,{account:O,selectedMethod:o,submitSuccess:u,hasBlockingError:s,error:w,onClose:R,onBack:P,handleSubmit:()=>S(f).catch(v)})}return o?de(pb,{submitSuccess:u,hasBlockingError:s,handleSubmitCode:S,selectedMethod:o,onClose:R,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):Er(qd,{children:[de(T,{onClose:R},"header"),de(ge,{children:de(Me,{children:de(sb,{})})}),de(ne,{children:"Verify your identity"}),de(se,{children:"Choose a verification method"}),Er(Gs,{children:[r.mfaMethods.includes("totp")&&Er(Ae,{onClick:()=>C("totp"),children:[de(nb,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&Er(Ae,{onClick:()=>C("sms"),children:[de(ab,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&Er(Ae,{onClick:()=>C("passkey"),children:[de(ib,{}),"Passkey"]},"passkey")]}),de(q,{})]})},pb=({selectedMethod:e,submitSuccess:t,hasBlockingError:r,onClose:o,onBack:n,handleSubmitCode:i})=>{let{app:a}=x(),{pendingTransaction:l}=M();switch(e){case"sms":return Er(qd,{children:[de(T,{onClose:o},"header"),de(ge,{children:de(Me,{children:de(cb,{})})}),de(ne,{children:"Enter verification code"}),Er(ir,{children:[de(cn,{success:t,disabled:r,onChange:i}),Er(se,{children:["To continue, please enter the 6-digit code sent to your ",de("strong",{children:"mobile device"})]}),l&&de(Ca,{pendingTransaction:l})]}),n&&de(Oi,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),de(fr,{onClick:o,children:"Not now"}),de(q,{})]});case"totp":return Er(qd,{children:[de(T,{onClose:o},"header"),de(ge,{children:de(Me,{children:de(lb,{})})}),de(ne,{children:"Enter verification code"}),Er(ir,{children:[de(cn,{success:t,disabled:r,onChange:i}),Er(se,{children:["To continue, please enter the 6-digit code generated from your"," ",de("strong",{children:"authenticator app"})]}),l&&de(Ca,{pendingTransaction:l})]}),n&&de(Oi,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),de(fr,{onClick:o,children:"Not now"}),de(q,{})]});default:return null}};import{useEffect as xg,useState as kg}from"react";import ub from"styled-components";import{Fragment as fb,jsx as qr,jsxs as ql}from"react/jsx-runtime";var _g=()=>{let{authenticated:e,logout:t,ready:r,user:o}=B(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=x(),{getAuthMeta:s,initLoginWithOAuth:c,loginWithOAuth:u,updateWallets:h,setReadyToTrue:f,closePrivyModal:y,createAnalyticsEvent:w}=M(),[v,k]=kg(!1),[S,C]=kg(void 0),R=s()?.provider||"google",{name:P,component:O}=ki(R),_=Os(),F=n?.render.inDialog?Be:0;xg(()=>{u(R).then(H=>{k(!0),f(!0),H&&_("login","onOAuthLoginComplete",H)}).catch(H=>{if(H?.privyErrorCode==="allowlist_rejected"){C(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(H?.privyErrorCode==="max_accounts_reached"){console.error(new kr(H).toString()),C(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}let{retryable:I,detail:Q}=Eu(H,R);C({retryable:I,detail:Q,message:"Authentication failed"}),f(!1)}).finally(()=>{qo()})},[P,R]),xg(()=>{if(r&&e&&v&&o){if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let I=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},F);return()=>clearTimeout(I)}if(tr(o,n?.embeddedWallets?.createOnLogin)){let I=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:Q=>{console.error(Q),w({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Q,provider:R,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},F);return()=>clearTimeout(I)}else{let I=setTimeout(()=>y({shouldCallAuthOnSuccess:!0,isSuccess:!0}),F);return h(),()=>clearTimeout(I)}}},[r,e,v,o]);let K=v?`Successfully connected with ${P}`:S?S.message:`Verifying connection to ${P}`,V="";return v?V="You\u2019re good to go!":S?V=S.detail:V="Just a few moments more",ql(fb,{children:[qr(T,{}),qr(X,{}),ql(mb,{children:[qr(Rt,{children:ql("div",{children:[qr(xt,{success:v,fail:!!S}),qr(O,{style:{width:"38px",height:"38px"}})]})}),ql($e,{children:[qr("h3",{children:K}),qr("p",{children:V})]}),S&&S?.retryable?qr(Fs,{onClick:()=>{qo(),c(R),C(void 0)},disabled:!v&&!S?.retryable,children:"Retry"}):null]}),qr(ie,{}),qr(q,{})]})},mb=ub.div`
2315
2315
  display: flex;
2316
2316
  flex-direction: column;
2317
2317
  align-items: center;
@@ -2319,17 +2319,17 @@ You will need this password to access your ${e} wallet on a new device. Please k
2319
2319
  margin-left: 27px;
2320
2320
  margin-right: 27px;
2321
2321
  gap: 24px;
2322
- `;import{useEffect as Kd,useRef as yb,useState as Rg}from"react";import Ig from"styled-components";import{Fragment as vb,jsx as ao,jsxs as $l}from"react/jsx-runtime";var Mg=()=>{let{app:e,lastScreen:t,currentScreen:r,navigateBack:o}=x(),{loginWithPasskey:n,closePrivyModal:i}=M(),a=e?.render.inDialog?Be:0,[l,s]=Rg("loading"),[c,u]=Rg(null),h=yb([]),f=S=>{h.current=[S,...h.current]};Kd(()=>()=>{h.current.forEach(S=>clearTimeout(S)),h.current=[]},[]);let y=()=>{switch(l){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}},w=()=>{switch(l){case"loading":return`Please follow prompts to verify your passkey.
2322
+ `;import{useEffect as Kd,useRef as hb,useState as Ag}from"react";import Rg from"styled-components";import{Fragment as gb,jsx as so,jsxs as $l}from"react/jsx-runtime";var Ig=()=>{let{app:e,lastScreen:t,currentScreen:r,navigateBack:o}=x(),{loginWithPasskey:n,closePrivyModal:i}=M(),a=e?.render.inDialog?Be:0,[l,s]=Ag("loading"),[c,u]=Ag(null),h=hb([]),f=S=>{h.current=[S,...h.current]};Kd(()=>()=>{h.current.forEach(S=>clearTimeout(S)),h.current=[]},[]);let y=()=>{switch(l){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}},w=()=>{switch(l){case"loading":return`Please follow prompts to verify your passkey.
2323
2323
  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(c instanceof Ue){if(c.privyErrorCode==="cannot_link_more_of_type")return"Cannot link more passkeys to account.";if(c.privyErrorCode==="passkey_not_allowed")return`Passkey request timed out or rejected by user.
2324
2324
  You will have to sign up with another method first to register a passkey for your account.`}return`An unknown error occurred.
2325
- You will have to sign up with another method first to register a passkey for your account.`}},v=()=>{switch(l){case"loading":case"success":return ao(W,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return ao(W,{onClick:k,disabled:!1,children:"Retry"})}},k=async()=>{s("loading");try{await n(),s("success")}catch(S){u(S),s("error")}};return Kd(()=>{l==="success"&&f(setTimeout(()=>{i({shouldCallAuthOnSuccess:!0,isSuccess:!0})},a))},[l]),Kd(()=>{k()},[]),$l(vb,{children:[ao(T,{backFn:!t||r===t?void 0:o}),$l(gb,{children:[ao(Rt,{children:$l("div",{children:[ao(xt,{success:l==="success",fail:l==="error"}),ao(io,{style:{width:"38px",height:"38px"}})]})}),$l($e,{children:[ao("h3",{children:y()}),ao("p",{style:{whiteSpace:"pre-wrap"},children:w()})]}),v()]}),ao(q,{})]})},gb=Ig.div`
2325
+ You will have to sign up with another method first to register a passkey for your account.`}},v=()=>{switch(l){case"loading":case"success":return so(W,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return so(W,{onClick:k,disabled:!1,children:"Retry"})}},k=async()=>{s("loading");try{await n(),s("success")}catch(S){u(S),s("error")}};return Kd(()=>{l==="success"&&f(setTimeout(()=>{i({shouldCallAuthOnSuccess:!0,isSuccess:!0})},a))},[l]),Kd(()=>{k()},[]),$l(gb,{children:[so(T,{backFn:!t||r===t?void 0:o}),$l(yb,{children:[so(Rt,{children:$l("div",{children:[so(xt,{success:l==="success",fail:l==="error"}),so(ao,{style:{width:"38px",height:"38px"}})]})}),$l($e,{children:[so("h3",{children:y()}),so("p",{style:{whiteSpace:"pre-wrap"},children:w()})]}),v()]}),so(q,{})]})},yb=Rg.div`
2326
2326
  display: flex;
2327
2327
  flex-direction: column;
2328
2328
  align-items: center;
2329
2329
  justify-content: center;
2330
2330
  gap: 24px;
2331
2331
  width: 100%;
2332
- `,s$=Ig.div`
2332
+ `,a$=Rg.div`
2333
2333
  display: flex;
2334
2334
  align-items: center;
2335
2335
  justify-content: center;
@@ -2345,9 +2345,9 @@ You will have to sign up with another method first to register a passkey for you
2345
2345
  stroke: var(--privy-color-accent) !important;
2346
2346
  fill: var(--privy-color-accent) !important;
2347
2347
  }
2348
- `;import{useEffect as wb,useState as Lg}from"react";import bb from"styled-components";import{isMobile as Cb}from"react-device-detect";var Wg=(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(!mo()&&Cb)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};import{Fragment as Tb,jsx as so,jsxs as Og}from"react/jsx-runtime";var Ng=()=>{let{forkSession:e,ready:t,authenticated:r}=B(),[o,n]=Lg(""),[i,a]=Lg(!1);wb(()=>{t&&r&&e().then(n)},[t,r]);let l=Wg(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."),Og(Tb,{children:[so(T,{},"header"),so(X,{}),so(Nr,{title:s.title,description:s.description}),Og(ar,{children:[so(Eb,{children:so(Ir,{style:{width:"72px",height:"72px"}})}),so(Ds,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?so("p",{children:s.footnote}):null]}),so(ie,{}),so(z,{protectedByPrivy:!0})]})},Eb=bb(vt)`
2348
+ `;import{useEffect as Cb,useState as Wg}from"react";import wb from"styled-components";import{isMobile as vb}from"react-device-detect";var Mg=(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(!fo()&&vb)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};import{Fragment as Eb,jsx as lo,jsxs as Lg}from"react/jsx-runtime";var Og=()=>{let{forkSession:e,ready:t,authenticated:r}=B(),[o,n]=Wg(""),[i,a]=Wg(!1);Cb(()=>{t&&r&&e().then(n)},[t,r]);let l=Mg(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."),Lg(Eb,{children:[lo(T,{},"header"),lo(X,{}),lo(Dr,{title:s.title,description:s.description}),Lg(ar,{children:[lo(bb,{children:lo(Ir,{style:{width:"72px",height:"72px"}})}),lo(Ds,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?lo("p",{children:s.footnote}):null]}),lo(ie,{}),lo(z,{protectedByPrivy:!0})]})},bb=wb(vt)`
2349
2349
  margin: 16px auto;
2350
- `;import Pb from"@heroicons/react/24/outline/ShieldCheckIcon";import{useEffect as Sb,useState as Kl}from"react";import jl,{css as xb}from"styled-components";import{Fragment as Ib,jsx as Tt,jsxs as un}from"react/jsx-runtime";var Dg=()=>{let[e,t]=Kl(!0),{authenticated:r,getAccessToken:o}=B(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=M(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=x(),[u,h]=Kl(void 0),[f,y]=Kl(""),[w,v]=Kl(!1),{privyWallet:k,onCompleteNavigateTo:S,onSuccess:C,onFailure:R}=s.recoverWallet,P=(D="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),R(typeof D=="string"?new gt(D):D)};c.current=P,Sb(()=>{if(!r||!k)return P("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let O=D=>{D&&h(D)};return un(Ib,{children:[Tt(T,{onClose:P}),Tt(X,{}),un(_b,{children:[un(kb,{children:[Tt(Pb,{height:48,width:48,stroke:"var(--privy-color-accent)"}),Tt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Load your account"}),Tt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),un("div",{children:[un(To,{children:[Tt(Yn,{type:e?"password":"text",onChange:D=>O(D.target.value),disabled:w,style:{paddingRight:"2.3rem"}}),Tt(Zn,{style:{right:"0.75rem"},children:e?Tt(Jn,{onClick:()=>t(!1)}):Tt(Qn,{onClick:()=>t(!0)})})]}),!!f&&Tt(Ab,{children:f})]}),un("div",{children:[un(Wm,{children:[Tt("h4",{children:"Why is this necessary?"}),Tt("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),Tt(Rb,{loading:w||!n,disabled:!u,onClick:async()=>{v(!0);let D=await o();if(D&&k&&u!==null)try{a({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:k.address}}),await n?.recover({address:k.address,accessToken:D,recoveryPin:u}),y(""),S?l(S):i({shouldCallAuthOnSuccess:!1}),C?.(k),a({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:k.address}})}catch(K){hf(K)?y("Invalid recovery password, please try again."):y("An error has occurred, please try again.")}finally{v(!1)}else return P("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!k&&w,children:"Recover your account"})]})]}),Tt(ie,{}),Tt(z,{protectedByPrivy:!0})]})},kb=jl.div`
2350
+ `;import Tb from"@heroicons/react/24/outline/ShieldCheckIcon";import{useEffect as Pb,useState as Kl}from"react";import jl,{css as Sb}from"styled-components";import{Fragment as Rb,jsx as Tt,jsxs as un}from"react/jsx-runtime";var Ng=()=>{let[e,t]=Kl(!0),{authenticated:r,getAccessToken:o}=B(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=M(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=x(),[u,h]=Kl(void 0),[f,y]=Kl(""),[w,v]=Kl(!1),{privyWallet:k,onCompleteNavigateTo:S,onSuccess:C,onFailure:R}=s.recoverWallet,P=(F="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),R(typeof F=="string"?new gt(F):F)};c.current=P,Pb(()=>{if(!r||!k)return P("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let O=F=>{F&&h(F)};return un(Rb,{children:[Tt(T,{onClose:P}),Tt(X,{}),un(kb,{children:[un(xb,{children:[Tt(Tb,{height:48,width:48,stroke:"var(--privy-color-accent)"}),Tt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Load your account"}),Tt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),un("div",{children:[un(To,{children:[Tt(Yn,{type:e?"password":"text",onChange:F=>O(F.target.value),disabled:w,style:{paddingRight:"2.3rem"}}),Tt(Zn,{style:{right:"0.75rem"},children:e?Tt(Jn,{onClick:()=>t(!1)}):Tt(Qn,{onClick:()=>t(!0)})})]}),!!f&&Tt(_b,{children:f})]}),un("div",{children:[un(Mm,{children:[Tt("h4",{children:"Why is this necessary?"}),Tt("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),Tt(Ab,{loading:w||!n,disabled:!u,onClick:async()=>{v(!0);let F=await o();if(F&&k&&u!==null)try{a({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:k.address}}),await n?.recover({address:k.address,accessToken:F,recoveryPin:u}),y(""),S?l(S):i({shouldCallAuthOnSuccess:!1}),C?.(k),a({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:k.address}})}catch(K){ff(K)?y("Invalid recovery password, please try again."):y("An error has occurred, please try again.")}finally{v(!1)}else return P("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!k&&w,children:"Recover your account"})]})]}),Tt(ie,{}),Tt(z,{protectedByPrivy:!0})]})},xb=jl.div`
2351
2351
  display: flex;
2352
2352
  flex-direction: column;
2353
2353
  align-items: center;
@@ -2369,40 +2369,40 @@ You will have to sign up with another method first to register a passkey for you
2369
2369
  font-weight: 400;
2370
2370
  line-height: 20px;
2371
2371
  }
2372
- `,_b=jl.div`
2372
+ `,kb=jl.div`
2373
2373
  display: flex;
2374
2374
  flex-direction: column;
2375
2375
  justify-content: space-between;
2376
- `,Ab=jl.div`
2376
+ `,_b=jl.div`
2377
2377
  line-height: 20px;
2378
2378
  height: 20px;
2379
2379
  font-size: 13px;
2380
2380
  color: var(--privy-color-error);
2381
2381
  text-align: left;
2382
2382
  margin-top: 0.5rem;
2383
- `,Rb=jl(W)`
2384
- ${e=>e.hideAnimations&&xb`
2383
+ `,Ab=jl(W)`
2384
+ ${e=>e.hideAnimations&&Sb`
2385
2385
  && {
2386
2386
  // Remove animations because the recoverWallet task on the iframe partially
2387
2387
  // blocks the renderer, so the animation stutters and doesn't look good
2388
2388
  transition: none;
2389
2389
  }
2390
2390
  `}
2391
- `;import{useCallback as Mb,useEffect as Hg,useState as jd}from"react";import{jsx as lo,jsxs as Fg}from"react/jsx-runtime";var Yl=({style:e,...t})=>Fg("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[Fg("g",{clipPath:"url(#clip0_2115_829)",children:[lo("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"}),lo("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"}),lo("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"}),lo("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"}),lo("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"}),lo("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"})]}),lo("defs",{children:lo("clipPath",{id:"clip0_2115_829",children:lo("rect",{width:"16",height:"14",fill:"white"})})})]});import Ug from"styled-components";var ba=Ug.div`
2391
+ `;import{useCallback as Ib,useEffect as Bg,useState as jd}from"react";import{jsx as co,jsxs as Dg}from"react/jsx-runtime";var Yl=({style:e,...t})=>Dg("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[Dg("g",{clipPath:"url(#clip0_2115_829)",children:[co("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"}),co("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"}),co("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"}),co("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"}),co("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"}),co("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"})]}),co("defs",{children:co("clipPath",{id:"clip0_2115_829",children:co("rect",{width:"16",height:"14",fill:"white"})})})]});import Fg from"styled-components";var ba=Fg.div`
2392
2392
  display: flex;
2393
2393
  flex-direction: column;
2394
2394
  gap: 12px;
2395
2395
  padding-top: 24px;
2396
2396
  padding-bottom: 24px;
2397
- `,Bg=Ug.div`
2397
+ `,Ug=Fg.div`
2398
2398
  padding-bottom: 24px;
2399
- `;import{Fragment as Vg,jsx as co,jsxs as Yd}from"react/jsx-runtime";var Gg={"google-drive":{name:"Google Drive",component:Yl}},zg=()=>{let{logout:e}=B(),{navigate:t,setModalData:r,data:o}=x(),{recoveryOAuthFlow:n,closePrivyModal:i,createAnalyticsEvent:a}=M(),[l,s]=jd(!1),{provider:c,action:u,isInAccountCreateFlow:h}=o?.recoveryOAuthStatus,[f,y]=jd(void 0),[w,v]=jd(u==="create-wallet"),k=Gg[c].name,S=Gg[c].component,C=o?.recoverWallet?.onCompleteNavigateTo,R=new Oe(async(D="create-wallet")=>(v(!0),new Promise((K,V)=>{setTimeout(async()=>{try{let H=window.open();await n(c,D,H),s(!0),K()}catch{y({message:`${D==="recover"?"Recovery":"Back up"} with ${k} unsuccessful`,detail:u==="recover"?`Please verify that you are selecting the ${k} account associated with your backup.`:"Something went wrong.",retryable:!0}),V()}},0)})));Hg(()=>{u==="create-wallet"&&R.execute("create-wallet")},[]),Hg(()=>{if(!l)return;let D=setTimeout(()=>{h?(r({createWallet:{onSuccess:()=>{},onFailure:K=>{a({eventName:"embedded_wallet_creation_failure_logout",payload:{error:K,screen:"RecoveryOAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_CREATED_SCREEN")):i({shouldCallAuthOnSuccess:!1})},Be);return()=>clearTimeout(D)},[l]);let P=Mb(async()=>{await R.execute("recover"),C?t(C):s(!0)},[]),O=l?"Success!":f?f.message:`Verifying connection to ${k}`,_="";return f?_=f.detail:l?_=`Successfully ${u==="recover"?"recovered":"backed up"} with Google.`:_=`${u==="recover"?"Recovering":"Backing up"} with Google...`,Yd(Vg,{children:[co(T,{}),w?co(Vg,{children:Yd(ba,{children:[co(Te,{title:O,icon:co(S,{style:{width:"38px",height:"38px"}}),description:_}),f&&f?.retryable?co(W,{onClick:()=>{qo(),y(void 0),u==="create-wallet"?R.execute("create-wallet"):P()},disabled:!l&&!f?.retryable,children:"Try again"}):null]})}):Yd(ba,{children:[co(Te,{title:"Confirm it's really you",icon:co(S,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to Google Drive where your account is
2400
- backed up.`}),co(W,{onClick:P,children:"Confirm with Google"})]}),co(z,{protectedByPrivy:!0})]})};import{useEffect as qg,useState as Ea}from"react";import{jsx as Wb}from"react/jsx-runtime";var $g=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=x(),[n,i]=Ea(""),[a,l]=Ea(!1),[s,c]=Ea(),[u,h]=Ea(null),{authenticated:f}=B(),{closePrivyModal:y,isNewUserThisSession:w,initializeWalletProxy:v}=M(),{onSuccess:k,onFailure:S,callAuthOnSuccessOnClose:C}=r.createWallet,{createWallet:R}=ol(),[P,O]=Ea(null),_=new Oe(async()=>{try{let V=await R(s);if(!V)return;O(V),w?t("EMBEDDED_WALLET_CREATED_SCREEN"):(k(V),y({shouldCallAuthOnSuccess:C}))}catch(V){i(V.message)}});qg(()=>{u||v(3e4).then(V=>h(V))},[u]),qg(()=>{if(!f){t("LANDING"),S(new Error("User must be authenticated before creating a Privy wallet"));return}},[f]);let D=()=>{P&&P?.recoveryMethod!=="user-passcode"?(S(new gt("User created a wallet but failed to set a password for it")),y({shouldCallAuthOnSuccess:!1})):P?(k(P),y({shouldCallAuthOnSuccess:C})):(S(new gt("User wallet creation failed")),y({shouldCallAuthOnSuccess:!1}))};o.current=()=>null;let K=async()=>{l(!0);let V=250;return _.execute().then(()=>new Promise(H=>setTimeout(H,V))).finally(()=>l(!1))};return Wb(sl,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!u,buttonLoading:a,buttonHideAnimations:!P&&a,error:n,password:s||"",onClose:D,onPasswordChange:c,onPasswordGenerate:()=>c(al()),onSubmit:K})};import Lb from"@heroicons/react/24/outline/LockClosedIcon";import Ob from"@heroicons/react/24/outline/PencilSquareIcon";import Nb from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import{useState as Db}from"react";import{Fragment as Zd,jsx as qt,jsxs as fi}from"react/jsx-runtime";var Fb=({onClose:e})=>fi(Bg,{children:[qt(Te,{title:"Why do I need to secure my account?",icon:qt(Nb,{width:48}),description:fi(Zd,{children:[qt("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),qt("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."})]})}),qt(W,{onClick:e,children:"Select backup method"})]}),Kg=()=>{let{navigate:e,setModalData:t,data:r}=x(),{user:o}=B(),{embeddedWallets:n}=go(),a=Se(o)===null,[l,s]=Db(!1);return fi(Zd,{children:[qt(T,{backFn:l?()=>s(!1):void 0,infoFn:l?void 0:()=>s(!0)},"header"),l?qt(Fb,{onClose:()=>s(!1)}):fi(Zd,{children:[qt(Te,{title:"Secure your account",icon:qt(Lb,{width:48}),description:"Select a method for logging in on new devices and recovering your account."}),qt(ba,{children:n.userOwnedRecoveryOptions.map(c=>{switch(c){case"google-drive":return fi(Ae,{onClick:async()=>{t({recoveryOAuthStatus:{provider:"google-drive",action:a?"create-wallet":"set-recovery",isInAccountCreateFlow:r?.recoverySelection?.isInAccountCreateFlow??!1}}),e("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")},children:[qt(Yl,{style:{width:18}})," Back up to Google Drive"]},c);case"user-passcode":return fi(Ae,{onClick:()=>{e(a?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:[qt(Ob,{style:{width:18}})," Set a password"]},c);default:return null}})})]}),qt(z,{protectedByPrivy:!0})]})};import{BigNumber as r1}from"@ethersproject/bignumber";import{useMemo as o1,useEffect as n1,useState as Kt}from"react";import yi from"styled-components";function jg(e){return e.to&&e.data?"CONTRACT_CALL":e.to&&e.value?"SEND":"UNKNOWN"}import{ExclamationCircleIcon as Bb,ClipboardDocumentIcon as Hb}from"@heroicons/react/24/outline";import{useState as Gb}from"react";import Tr from"styled-components";import{ErrorCode as Zl}from"@ethersproject/logger";var Ub=new Set([Zl.CALL_EXCEPTION,Zl.NONCE_EXPIRED,Zl.REPLACEMENT_UNDERPRICED,Zl.TRANSACTION_REPLACED]),Yg=e=>{let t;return e.code&&e.code!==-32e3&&Ub.has(e.code)&&(t=e.transactionHash),t},Zg=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";import{Fragment as Xb,jsx as $t,jsxs as mn}from"react/jsx-runtime";var Vb=e=>{let t=e.code?.toString().replace("_"," "),r=Yg(e),o=Zg(e);return{errorCode:t,transactionHash:r,errorMessage:o}},zb=()=>mn(jb,{children:[$t(Zb,{}),$t(Yb,{})]}),e1=({transactionError:e,chainId:t,onClose:r,onRetry:o})=>{let{chains:n}=M(),[i,a]=Gb(!1),{errorCode:l,transactionHash:s,errorMessage:c}=Vb(e),u=n.find(h=>h.id===t)?.blockExplorers?.default.url??"https://etherscan.io";return mn(Xb,{children:[$t(T,{onClose:r}),mn(qb,{children:[$t(zb,{}),$t($b,{children:l??"Something went wrong."}),$t(Kb,{children:"Please try again."}),mn(Qg,{children:[$t(Jg,{children:"Error message"}),$t(Xg,{clickable:!1,children:c})]}),s&&mn(Qg,{children:[$t(Jg,{children:"Transaction hash (click to copy)"}),mn(Xg,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(s),a(!0)},children:[s,$t(Qb,{})]})]}),i&&mn("a",{href:u,children:["Copied transaction hash. View details about the failed transaction on a"," ",$t("u",{children:"block explorer"}),"."]}),$t(Jb,{onClick:o,children:"Retry transaction"})]}),$t(q,{})]})},qb=Tr.div`
2399
+ `;import{Fragment as Gg,jsx as po,jsxs as Yd}from"react/jsx-runtime";var Hg={"google-drive":{name:"Google Drive",component:Yl}},Vg=()=>{let{logout:e}=B(),{navigate:t,setModalData:r,data:o}=x(),{recoveryOAuthFlow:n,closePrivyModal:i,createAnalyticsEvent:a}=M(),[l,s]=jd(!1),{provider:c,action:u,isInAccountCreateFlow:h}=o?.recoveryOAuthStatus,[f,y]=jd(void 0),[w,v]=jd(u==="create-wallet"),k=Hg[c].name,S=Hg[c].component,C=o?.recoverWallet?.onCompleteNavigateTo,R=new Oe(async(F="create-wallet")=>(v(!0),new Promise((K,V)=>{setTimeout(async()=>{try{let H=window.open();await n(c,F,H),s(!0),K()}catch{y({message:`${F==="recover"?"Recovery":"Back up"} with ${k} unsuccessful`,detail:u==="recover"?`Please verify that you are selecting the ${k} account associated with your backup.`:"Something went wrong.",retryable:!0}),V()}},0)})));Bg(()=>{u==="create-wallet"&&R.execute("create-wallet")},[]),Bg(()=>{if(!l)return;let F=setTimeout(()=>{h?(r({createWallet:{onSuccess:()=>{},onFailure:K=>{a({eventName:"embedded_wallet_creation_failure_logout",payload:{error:K,screen:"RecoveryOAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_CREATED_SCREEN")):i({shouldCallAuthOnSuccess:!1})},Be);return()=>clearTimeout(F)},[l]);let P=Ib(async()=>{await R.execute("recover"),C?t(C):s(!0)},[]),O=l?"Success!":f?f.message:`Verifying connection to ${k}`,_="";return f?_=f.detail:l?_=`Successfully ${u==="recover"?"recovered":"backed up"} with Google.`:_=`${u==="recover"?"Recovering":"Backing up"} with Google...`,Yd(Gg,{children:[po(T,{}),w?po(Gg,{children:Yd(ba,{children:[po(Te,{title:O,icon:po(S,{style:{width:"38px",height:"38px"}}),description:_}),f&&f?.retryable?po(W,{onClick:()=>{qo(),y(void 0),u==="create-wallet"?R.execute("create-wallet"):P()},disabled:!l&&!f?.retryable,children:"Try again"}):null]})}):Yd(ba,{children:[po(Te,{title:"Confirm it's really you",icon:po(S,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to Google Drive where your account is
2400
+ backed up.`}),po(W,{onClick:P,children:"Confirm with Google"})]}),po(z,{protectedByPrivy:!0})]})};import{useEffect as zg,useState as Ea}from"react";import{jsx as Mb}from"react/jsx-runtime";var qg=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=x(),[n,i]=Ea(""),[a,l]=Ea(!1),[s,c]=Ea(),[u,h]=Ea(null),{authenticated:f}=B(),{closePrivyModal:y,isNewUserThisSession:w,initializeWalletProxy:v}=M(),{onSuccess:k,onFailure:S,callAuthOnSuccessOnClose:C}=r.createWallet,{createWallet:R}=ol(),[P,O]=Ea(null),_=new Oe(async()=>{try{let V=await R(s);if(!V)return;O(V),w?t("EMBEDDED_WALLET_CREATED_SCREEN"):(k(V),y({shouldCallAuthOnSuccess:C}))}catch(V){i(V.message)}});zg(()=>{u||v(3e4).then(V=>h(V))},[u]),zg(()=>{if(!f){t("LANDING"),S(new Error("User must be authenticated before creating a Privy wallet"));return}},[f]);let F=()=>{P&&P?.recoveryMethod!=="user-passcode"?(S(new gt("User created a wallet but failed to set a password for it")),y({shouldCallAuthOnSuccess:!1})):P?(k(P),y({shouldCallAuthOnSuccess:C})):(S(new gt("User wallet creation failed")),y({shouldCallAuthOnSuccess:!1}))};o.current=()=>null;let K=async()=>{l(!0);let V=250;return _.execute().then(()=>new Promise(H=>setTimeout(H,V))).finally(()=>l(!1))};return Mb(sl,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!u,buttonLoading:a,buttonHideAnimations:!P&&a,error:n,password:s||"",onClose:F,onPasswordChange:c,onPasswordGenerate:()=>c(al()),onSubmit:K})};import Wb from"@heroicons/react/24/outline/LockClosedIcon";import Lb from"@heroicons/react/24/outline/PencilSquareIcon";import Ob from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import{useState as Nb}from"react";import{Fragment as Zd,jsx as qt,jsxs as fi}from"react/jsx-runtime";var Db=({onClose:e})=>fi(Ug,{children:[qt(Te,{title:"Why do I need to secure my account?",icon:qt(Ob,{width:48}),description:fi(Zd,{children:[qt("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),qt("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."})]})}),qt(W,{onClick:e,children:"Select backup method"})]}),$g=()=>{let{navigate:e,setModalData:t,data:r}=x(),{user:o}=B(),{embeddedWallets:n}=Mr(),a=Se(o)===null,[l,s]=Nb(!1);return fi(Zd,{children:[qt(T,{backFn:l?()=>s(!1):void 0,infoFn:l?void 0:()=>s(!0)},"header"),l?qt(Db,{onClose:()=>s(!1)}):fi(Zd,{children:[qt(Te,{title:"Secure your account",icon:qt(Wb,{width:48}),description:"Select a method for logging in on new devices and recovering your account."}),qt(ba,{children:n.userOwnedRecoveryOptions.map(c=>{switch(c){case"google-drive":return fi(Ae,{onClick:async()=>{t({recoveryOAuthStatus:{provider:"google-drive",action:a?"create-wallet":"set-recovery",isInAccountCreateFlow:r?.recoverySelection?.isInAccountCreateFlow??!1}}),e("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")},children:[qt(Yl,{style:{width:18}})," Back up to Google Drive"]},c);case"user-passcode":return fi(Ae,{onClick:()=>{e(a?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:[qt(Lb,{style:{width:18}})," Set a password"]},c);default:return null}})})]}),qt(z,{protectedByPrivy:!0})]})};import{BigNumber as t1}from"@ethersproject/bignumber";import{useMemo as r1,useEffect as o1,useState as Kt}from"react";import yi from"styled-components";function Kg(e){return e.to&&e.data?"CONTRACT_CALL":e.to&&e.value?"SEND":"UNKNOWN"}import{ExclamationCircleIcon as Ub,ClipboardDocumentIcon as Bb}from"@heroicons/react/24/outline";import{useState as Hb}from"react";import Tr from"styled-components";import{ErrorCode as Zl}from"@ethersproject/logger";var Fb=new Set([Zl.CALL_EXCEPTION,Zl.NONCE_EXPIRED,Zl.REPLACEMENT_UNDERPRICED,Zl.TRANSACTION_REPLACED]),jg=e=>{let t;return e.code&&e.code!==-32e3&&Fb.has(e.code)&&(t=e.transactionHash),t},Yg=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";import{Fragment as Qb,jsx as $t,jsxs as mn}from"react/jsx-runtime";var Gb=e=>{let t=e.code?.toString().replace("_"," "),r=jg(e),o=Yg(e);return{errorCode:t,transactionHash:r,errorMessage:o}},Vb=()=>mn(Kb,{children:[$t(Yb,{}),$t(jb,{})]}),Xg=({transactionError:e,chainId:t,onClose:r,onRetry:o})=>{let{chains:n}=M(),[i,a]=Hb(!1),{errorCode:l,transactionHash:s,errorMessage:c}=Gb(e),u=n.find(h=>h.id===t)?.blockExplorers?.default.url??"https://etherscan.io";return mn(Qb,{children:[$t(T,{onClose:r}),mn(zb,{children:[$t(Vb,{}),$t(qb,{children:l??"Something went wrong."}),$t($b,{children:"Please try again."}),mn(Jg,{children:[$t(Zg,{children:"Error message"}),$t(Qg,{clickable:!1,children:c})]}),s&&mn(Jg,{children:[$t(Zg,{children:"Transaction hash (click to copy)"}),mn(Qg,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(s),a(!0)},children:[s,$t(Jb,{})]})]}),i&&mn("a",{href:u,children:["Copied transaction hash. View details about the failed transaction on a"," ",$t("u",{children:"block explorer"}),"."]}),$t(Zb,{onClick:o,children:"Retry transaction"})]}),$t(q,{})]})},zb=Tr.div`
2401
2401
  display: flex;
2402
2402
  flex-direction: column;
2403
2403
  align-items: center;
2404
2404
  justify-content: center;
2405
- `,$b=Tr.span`
2405
+ `,qb=Tr.span`
2406
2406
  color: var(--privy-color-error);
2407
2407
  text-align: center;
2408
2408
  font-size: 1.125rem;
@@ -2410,7 +2410,7 @@ backed up.`}),co(W,{onClick:P,children:"Confirm with Google"})]}),co(z,{protecte
2410
2410
  line-height: 1.25rem; /* 111.111% */
2411
2411
  text-align: center;
2412
2412
  margin: 10px;
2413
- `,Kb=Tr.span`
2413
+ `,$b=Tr.span`
2414
2414
  margin-top: 4px;
2415
2415
  margin-bottom: 10px;
2416
2416
  color: var(--privy-color-foreground);
@@ -2421,7 +2421,7 @@ backed up.`}),co(W,{onClick:P,children:"Confirm with Google"})]}),co(z,{protecte
2421
2421
  font-weight: 400;
2422
2422
  line-height: 20px; /* 142.857% */
2423
2423
  letter-spacing: -0.008px;
2424
- `,jb=Tr.div`
2424
+ `,Kb=Tr.div`
2425
2425
  position: relative;
2426
2426
  width: 60px;
2427
2427
  height: 60px;
@@ -2429,37 +2429,37 @@ backed up.`}),co(W,{onClick:P,children:"Confirm with Google"})]}),co(z,{protecte
2429
2429
  display: flex;
2430
2430
  justify-content: center;
2431
2431
  align-items: center;
2432
- `,Yb=Tr(Bb)`
2432
+ `,jb=Tr(Ub)`
2433
2433
  position: absolute;
2434
2434
  width: 35px;
2435
2435
  height: 35px;
2436
2436
  color: var(--privy-color-error);
2437
- `,Zb=Tr.div`
2437
+ `,Yb=Tr.div`
2438
2438
  position: absolute;
2439
2439
  width: 60px;
2440
2440
  height: 60px;
2441
2441
  border-radius: 50%;
2442
2442
  background-color: var(--privy-color-error);
2443
2443
  opacity: 0.1;
2444
- `,Jb=Tr(W)`
2444
+ `,Zb=Tr(W)`
2445
2445
  && {
2446
2446
  margin-top: 24px;
2447
2447
  }
2448
2448
  transition: color 350ms ease, background-color 350ms ease;
2449
- `,Jg=Tr.span`
2449
+ `,Zg=Tr.span`
2450
2450
  width: 100%;
2451
2451
  text-align: left;
2452
2452
  font-size: 0.825rem;
2453
2453
  color: var(--privy-color-foreground);
2454
2454
  padding: 4px;
2455
- `,Qg=Tr.div`
2455
+ `,Jg=Tr.div`
2456
2456
  width: 100%;
2457
2457
  margin: 20px;
2458
2458
  display: flex;
2459
2459
  flex-direction: column;
2460
2460
  justify-content: center;
2461
2461
  align-items: center;
2462
- `,Xg=Tr.span`
2462
+ `,Qg=Tr.span`
2463
2463
  position: relative;
2464
2464
  width: 100%;
2465
2465
  background-color: var(--privy-color-background-2);
@@ -2477,59 +2477,59 @@ backed up.`}),co(W,{onClick:P,children:"Confirm with Google"})]}),co(z,{protecte
2477
2477
  &:hover {
2478
2478
  background-color: var(--privy-color-foreground-4);
2479
2479
  }`}
2480
- `,Qb=Tr(Hb)`
2480
+ `,Jb=Tr(Bb)`
2481
2481
  position: absolute;
2482
2482
  top: 13px;
2483
2483
  right: 13px;
2484
2484
  width: 30px;
2485
2485
  height: 30px;
2486
- `;import{BigNumber as Jd}from"@ethersproject/bignumber";import e7 from"styled-components";import{Fragment as o7,jsx as Ta,jsxs as n7}from"react/jsx-runtime";var t7=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=Jd.from(e.gasUsed),o=Jd.from(e.effectiveGasPrice),n=r.mul(o);if(t){let i=Jd.from(t);n=n.add(i)}return n.toString()}catch{return}else return},t1=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a,receiptHeader:l,receiptDescription:s})=>n7(o7,{children:[Ta(T,{onClose:o}),Ta(Fi,{title:l??"Transaction complete!",description:s??"You're all set."}),Ta(li,{tokenPrice:n,from:t.from,to:t.to,gas:t7(t,a),txn:e,transactionInfo:r,tokenSymbol:i}),Ta(r7,{loading:!1,onClick:o,children:"All Done"}),Ta(q,{})]}),r7=e7(W)`
2486
+ `;import{BigNumber as Jd}from"@ethersproject/bignumber";import Xb from"styled-components";import{Fragment as r7,jsx as Ta,jsxs as o7}from"react/jsx-runtime";var e7=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=Jd.from(e.gasUsed),o=Jd.from(e.effectiveGasPrice),n=r.mul(o);if(t){let i=Jd.from(t);n=n.add(i)}return n.toString()}catch{return}else return},e1=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a,receiptHeader:l,receiptDescription:s})=>o7(r7,{children:[Ta(T,{onClose:o}),Ta(Fi,{title:l??"Transaction complete!",description:s??"You're all set."}),Ta(li,{tokenPrice:n,from:t.from,to:t.to,gas:e7(t,a),txn:e,transactionInfo:r,tokenSymbol:i}),Ta(t7,{loading:!1,onClick:o,children:"All Done"}),Ta(q,{})]}),t7=Xb(W)`
2487
2487
  && {
2488
2488
  margin-top: 24px;
2489
2489
  }
2490
2490
  transition: color 350ms ease, background-color 350ms ease;
2491
- `;import{Fragment as Qd,jsx as nt,jsxs as hi}from"react/jsx-runtime";var i7=({txn:e,txnFamily:t,uiOptions:r,tokenSymbol:o,tokenPrice:n})=>{if(t==="CONTRACT_CALL"){if(r.transactionInfo?.contractInfo)return nt(Ld,{contractInfo:r.transactionInfo.contractInfo,description:r.description});if(r.senderInfo)return nt(Ld,{contractInfo:r.senderInfo,description:r.description||r.senderInfo.actionText})}return nt(Qd,{children:nt(dg,{description:r.description||r.transactionInfo?.description||"",txn:e,tokenSymbol:o,tokenPrice:n})})},a1=()=>{let{authenticated:e,getAccessToken:t}=B(),{wallets:r}=va(),{walletProxy:o,closePrivyModal:n,getFiatOnRampConfig:i,rpcConfig:a,chains:l,nativeTokenSymbolForChainId:s,appId:c}=M(),{app:u,navigate:h,data:f,onUserCloseViaDialogOrKeybindRef:y,setModalData:w}=x(),{transactionRequest:v,onSuccess:k,onFailure:S,uiOptions:C,fundWalletConfig:R}=f.sendTransaction,[P,O]=Kt(null),[_,D]=Kt(null),[K,V]=Kt(""),[H,I]=Kt(),[Q,U]=Kt(),[pe,me]=Kt(!1),ae=()=>{V(""),I(void 0),U(void 0)},Ee=(Ve,ct,Kr)=>{V(Ve),I(new Ne(new Nt(ct??Ve,Kr??Qe.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))},[J,jt]=Kt(!1),[Lt,Yt]=Kt(!0),[lt,Sr]=Kt(null),[Le,hn]=Kt(v),{tokenPrice:xr,isTokenPriceLoading:Pt}=zl(Le),Fe=s(v.chainId)||"ETH",[L,oe]=Kt(null),[G,fe]=Kt(null),[Zt,Do]=Kt(!0);n1(()=>{e||(h("LANDING"),S(new Error("User must be authenticated before transacting with a Privy wallet")))},[e]);let ht=o1(()=>r.find(Ve=>Ve.walletClientType==="privy"),[r]),Ci=async()=>{if(!ht)return console.warn("No privy wallet found, cannot fund wallet.");let{signedUrl:Ve,externalTransactionId:ct}=await i(ht.address,{config:R?.config||{}});w({fiatOnRampPrompt:{signedUrl:Ve},fiatOnRampStatus:{externalTransactionId:ct}}),h("FIAT_ON_RAMP_PROMPT_SCREEN")},$r=o1(()=>Zr(Le.chainId,l,a,{appId:c}),[Le.chainId,a]);async function Sa(){let Ve=Le;if(!await t()||!o||!ht)return;try{Ve=await ui(ht.address,Le,$r),hn(Ve)}catch(jr){console.error(jr),Ee("There was an error preparing your transaction. Your transaction request will likely fail.",jr.reason)}let Kr=r1.from(0),bi=r1.from(0);try{({totalGasEstimate:Kr,l1ExecutionFeeEstimate:bi}=await pi(Ve,$r)),oe(Kr.toHexString()),fe(bi.toHexString())}catch{oe(null)}try{let{balance:jr,hasSufficientFunds:ka}=await Gl(ht.address,Ve,Kr,$r);Sr(jr.toHexString()),ka||(Yt(!1),Ee("Wallet has insufficient funds for this transaction."),u?.fiatOnRamp.enabled&&me(!0))}catch(jr){console.warn(`Failed to fetch wallet balance with error: ${jr}`)}Do(!1)}n1(()=>{Sa()},[o]);let Ze=jg(Le),xa=Ze==="SEND"?`Send ${Fe}`:"Review transaction",wi={modalTitle:C.header||C.modalTitle||xa,buttonText:C.buttonText||"Submit"},Fo=()=>{J||(_?k(_):S(H||new Ne(new Nt("The user rejected the request",Qe.E4001_USER_REJECTED_REQUEST.eipCode))),n({shouldCallAuthOnSuccess:!1}))};return y.current=Fo,xr===void 0&&Pt||Zt?hi(Qd,{children:[C.transactionInfo?.contractInfo?.imgUrl&&nt(vs,{src:C.transactionInfo?.contractInfo?.imgUrl}),nt(T,{title:wi.modalTitle,onClose:Fo}),nt(i1,{children:nt(Vn,{})})]}):P!==null?nt(t1,{txn:Le,onClose:Fo,receipt:P,transactionInfo:C.transactionInfo,tokenPrice:xr,tokenSymbol:Fe,l1GasEstimate:G,receiptHeader:C.successHeader,receiptDescription:C.successDescription}):Q?nt(e1,{transactionError:Q,chainId:Le.chainId,onClose:Fo,onRetry:()=>{ae(),Sa()}}):hi(Qd,{children:[nt(T,{title:wi.modalTitle,onClose:Fo}),hi(i1,{children:[hi(c7,{children:[nt(i7,{txn:Le,txnFamily:Ze,uiOptions:C,tokenSymbol:Fe,tokenPrice:xr}),ht?nt(li,{from:ht.address,to:Le.to,txn:Le,transactionInfo:C.transactionInfo,gas:L||void 0,tokenPrice:xr,tokenSymbol:Fe}):null]}),hi(d7,{children:[nt(a7,{children:K}),nt(ag,{txn:Le,address:ht?.address??"",hasFunds:Lt,balance:lt}),hi(s7,{children:[pe&&nt(W,{onClick:Ci,children:"Add Funds"}),nt(l7,{disabled:J||!Lt,loading:!o||J,loadingText:J?"Submitting (may take a few moments)...":"Loading...",onClick:async()=>{jt(!0);let Ve=await t();if(Ve&&!J&&ht)try{let ct=await Hl(Ve,ht.address,o,Le,$r);D(ct);let Kr=await ct.wait();O(Vl(Kr)),ae()}catch(ct){console.warn({transaction:Le,error:ct}),U(ct),I(new Ne(new Nt(ct.reason??"Error processing transaction",Qe.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))}finally{jt(!1)}},children:wi.buttonText})]})]})]})]})},i1=yi.div`
2491
+ `;import{Fragment as Qd,jsx as nt,jsxs as hi}from"react/jsx-runtime";var n7=({txn:e,txnFamily:t,uiOptions:r,tokenSymbol:o,tokenPrice:n})=>{if(t==="CONTRACT_CALL"){if(r.transactionInfo?.contractInfo)return nt(Ld,{contractInfo:r.transactionInfo.contractInfo,description:r.description});if(r.senderInfo)return nt(Ld,{contractInfo:r.senderInfo,description:r.description||r.senderInfo.actionText})}return nt(Qd,{children:nt(cg,{description:r.description||r.transactionInfo?.description||"",txn:e,tokenSymbol:o,tokenPrice:n})})},i1=()=>{let{authenticated:e,getAccessToken:t}=B(),{wallets:r}=va(),{walletProxy:o,closePrivyModal:n,getFiatOnRampConfig:i,rpcConfig:a,chains:l,nativeTokenSymbolForChainId:s,appId:c}=M(),{app:u,navigate:h,data:f,onUserCloseViaDialogOrKeybindRef:y,setModalData:w}=x(),{transactionRequest:v,onSuccess:k,onFailure:S,uiOptions:C,fundWalletConfig:R}=f.sendTransaction,[P,O]=Kt(null),[_,F]=Kt(null),[K,V]=Kt(""),[H,I]=Kt(),[Q,D]=Kt(),[pe,me]=Kt(!1),ae=()=>{V(""),I(void 0),D(void 0)},Ee=(Ve,ct,jr)=>{V(Ve),I(new Ne(new Nt(ct??Ve,jr??Qe.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))},[J,jt]=Kt(!1),[Lt,Yt]=Kt(!0),[lt,Sr]=Kt(null),[Le,hn]=Kt(v),{tokenPrice:xr,isTokenPriceLoading:Pt}=zl(Le),Fe=s(v.chainId)||"ETH",[L,oe]=Kt(null),[G,fe]=Kt(null),[Zt,Do]=Kt(!0);o1(()=>{e||(h("LANDING"),S(new Error("User must be authenticated before transacting with a Privy wallet")))},[e]);let ht=r1(()=>r.find(Ve=>Ve.walletClientType==="privy"),[r]),Ci=async()=>{if(!ht)return console.warn("No privy wallet found, cannot fund wallet.");let{signedUrl:Ve,externalTransactionId:ct}=await i(ht.address,{config:R?.config||{}});w({fiatOnRampPrompt:{signedUrl:Ve},fiatOnRampStatus:{externalTransactionId:ct}}),h("FIAT_ON_RAMP_PROMPT_SCREEN")},Kr=r1(()=>Jr(Le.chainId,l,a,{appId:c}),[Le.chainId,a]);async function Sa(){let Ve=Le;if(!await t()||!o||!ht)return;try{Ve=await ui(ht.address,Le,Kr),hn(Ve)}catch(Yr){console.error(Yr),Ee("There was an error preparing your transaction. Your transaction request will likely fail.",Yr.reason)}let jr=t1.from(0),bi=t1.from(0);try{({totalGasEstimate:jr,l1ExecutionFeeEstimate:bi}=await pi(Ve,Kr)),oe(jr.toHexString()),fe(bi.toHexString())}catch{oe(null)}try{let{balance:Yr,hasSufficientFunds:ka}=await Gl(ht.address,Ve,jr,Kr);Sr(Yr.toHexString()),ka||(Yt(!1),Ee("Wallet has insufficient funds for this transaction."),u?.fiatOnRamp.enabled&&me(!0))}catch(Yr){console.warn(`Failed to fetch wallet balance with error: ${Yr}`)}Do(!1)}o1(()=>{Sa()},[o]);let Ze=Kg(Le),xa=Ze==="SEND"?`Send ${Fe}`:"Review transaction",wi={modalTitle:C.header||C.modalTitle||xa,buttonText:C.buttonText||"Submit"},Fo=()=>{J||(_?k(_):S(H||new Ne(new Nt("The user rejected the request",Qe.E4001_USER_REJECTED_REQUEST.eipCode))),n({shouldCallAuthOnSuccess:!1}))};return y.current=Fo,xr===void 0&&Pt||Zt?hi(Qd,{children:[C.transactionInfo?.contractInfo?.imgUrl&&nt(vs,{src:C.transactionInfo?.contractInfo?.imgUrl}),nt(T,{title:wi.modalTitle,onClose:Fo}),nt(n1,{children:nt(Vn,{})})]}):P!==null?nt(e1,{txn:Le,onClose:Fo,receipt:P,transactionInfo:C.transactionInfo,tokenPrice:xr,tokenSymbol:Fe,l1GasEstimate:G,receiptHeader:C.successHeader,receiptDescription:C.successDescription}):Q?nt(Xg,{transactionError:Q,chainId:Le.chainId,onClose:Fo,onRetry:()=>{ae(),Sa()}}):hi(Qd,{children:[nt(T,{title:wi.modalTitle,onClose:Fo}),hi(n1,{children:[hi(l7,{children:[nt(n7,{txn:Le,txnFamily:Ze,uiOptions:C,tokenSymbol:Fe,tokenPrice:xr}),ht?nt(li,{from:ht.address,to:Le.to,txn:Le,transactionInfo:C.transactionInfo,gas:L||void 0,tokenPrice:xr,tokenSymbol:Fe}):null]}),hi(c7,{children:[nt(i7,{children:K}),nt(ig,{txn:Le,address:ht?.address??"",hasFunds:Lt,balance:lt}),hi(a7,{children:[pe&&nt(W,{onClick:Ci,children:"Add Funds"}),nt(s7,{disabled:J||!Lt,loading:!o||J,loadingText:J?"Submitting (may take a few moments)...":"Loading...",onClick:async()=>{jt(!0);let Ve=await t();if(Ve&&!J&&ht)try{let ct=await Hl(Ve,ht.address,o,Le,Kr);F(ct);let jr=await ct.wait();O(Vl(jr)),ae()}catch(ct){console.warn({transaction:Le,error:ct}),D(ct),I(new Ne(new Nt(ct.reason??"Error processing transaction",Qe.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))}finally{jt(!1)}},children:wi.buttonText})]})]})]})]})},n1=yi.div`
2492
2492
  display: flex;
2493
2493
  flex-direction: column;
2494
2494
  justify-content: space-between;
2495
2495
  flex-grow: 1;
2496
2496
  padding-bottom: 16px;
2497
- `,a7=yi.div`
2497
+ `,i7=yi.div`
2498
2498
  font-size: 13px;
2499
2499
  color: var(--privy-color-error);
2500
2500
  width: 100%;
2501
2501
  margin-top: 16px;
2502
- `,s7=yi.div`
2502
+ `,a7=yi.div`
2503
2503
  display: flex;
2504
2504
  direction: row;
2505
2505
  justify-content: space-between;
2506
2506
  align-items: center;
2507
2507
  gap: 8px;
2508
- `,l7=yi(W)`
2508
+ `,s7=yi(W)`
2509
2509
  transition: color 350ms ease, background-color 350ms ease;
2510
- `,c7=yi.div`
2510
+ `,l7=yi.div`
2511
2511
  height: 100%;
2512
2512
  display: flex;
2513
2513
  flex-direction: column;
2514
2514
  justify-content: space-evenly;
2515
2515
  flex-grow: 1;
2516
- `,d7=yi.div`
2516
+ `,c7=yi.div`
2517
2517
  display: flex;
2518
2518
  flex-direction: column;
2519
2519
  gap: 8px;
2520
- `;import{isHexString as p7}from"@ethersproject/bytes";import{toUtf8String as u7}from"@ethersproject/strings";import{useEffect as s1,useState as Jl}from"react";import Wo,{css as m7}from"styled-components";import{Fragment as d1,jsx as je,jsxs as gi}from"react/jsx-runtime";var f7=e=>{if(!p7(e))return e;try{return u7(e)}catch{return e}},h7=e=>JSON.stringify(e,null,2),y7=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?je(b7,{children:Object.entries(r).map(([o,n])=>gi("li",{children:[gi("strong",{children:[o,":"]})," ",t(n)]},o))}):je("span",{children:String(r)});return je("div",{children:t(e)})},g7=e=>{let{types:t,primaryType:r,...o}=e.typedData;return gi(d1,{children:[je(c1,{children:je(y7,{data:o})}),je(So,{text:h7(e.typedData),itemName:"full payload to clipboard"})," "]})},l1=()=>{let{authenticated:e}=B(),{initializeWalletProxy:t,closePrivyModal:r}=M(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:i}=x(),[a,l]=Jl(!0),[s,c]=Jl(""),[u,h]=Jl(),[f,y]=Jl(null),w=f!==null;s1(()=>{e||o("LANDING")},[e]),s1(()=>{t(vn).then(D=>{l(!1),D||(c("An error has occurred, please try again."),h(new Ne(new Nt(s,Qe.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:v,data:k,confirmAndSign:S,onSuccess:C,onFailure:R,uiOptions:P}=n.signMessage,O={title:P.title||"Sign message",description:P.description||"Signing this message will not cost you any fees.",buttonText:P.buttonText||"Sign and continue"},_=D=>{D?C(D):R(u||new Ne(new Nt("The user rejected the request.",Qe.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),y(null),c(""),h(void 0)};return i.current=()=>{_(f)},gi(d1,{children:[je(T,{onClose:()=>_(f)}),je(X,{}),gi(v7,{children:[je(C7,{children:O.title}),je(w7,{children:O.description}),v==="personal_sign"&&je(c1,{children:f7(k)}),v==="eth_signTypedData_v4"&&je(g7,{typedData:k}),je(E7,{fail:!0,children:s}),je(P7,{success:w,loading:a,disabled:w,onClick:async()=>{try{let D=await S();y(D),c(""),setTimeout(()=>{_(D)},Be)}catch{c("An error has occurred, please try again."),h(new Ne(new Nt(s,Qe.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))}},children:w?gi(T7,{children:[je(pl,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",je("span",{children:"Success"})]}):O.buttonText})]}),je(ie,{}),je(z,{protectedByPrivy:!0})]})},v7=Wo.div`
2520
+ `;import{isHexString as d7}from"@ethersproject/bytes";import{toUtf8String as p7}from"@ethersproject/strings";import{useEffect as a1,useState as Jl}from"react";import Wo,{css as u7}from"styled-components";import{Fragment as c1,jsx as je,jsxs as gi}from"react/jsx-runtime";var m7=e=>{if(!d7(e))return e;try{return p7(e)}catch{return e}},f7=e=>JSON.stringify(e,null,2),h7=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?je(w7,{children:Object.entries(r).map(([o,n])=>gi("li",{children:[gi("strong",{children:[o,":"]})," ",t(n)]},o))}):je("span",{children:String(r)});return je("div",{children:t(e)})},y7=e=>{let{types:t,primaryType:r,...o}=e.typedData;return gi(c1,{children:[je(l1,{children:je(h7,{data:o})}),je(So,{text:f7(e.typedData),itemName:"full payload to clipboard"})," "]})},s1=()=>{let{authenticated:e}=B(),{initializeWalletProxy:t,closePrivyModal:r}=M(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:i}=x(),[a,l]=Jl(!0),[s,c]=Jl(""),[u,h]=Jl(),[f,y]=Jl(null),w=f!==null;a1(()=>{e||o("LANDING")},[e]),a1(()=>{t(vn).then(F=>{l(!1),F||(c("An error has occurred, please try again."),h(new Ne(new Nt(s,Qe.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:v,data:k,confirmAndSign:S,onSuccess:C,onFailure:R,uiOptions:P}=n.signMessage,O={title:P.title||"Sign message",description:P.description||"Signing this message will not cost you any fees.",buttonText:P.buttonText||"Sign and continue"},_=F=>{F?C(F):R(u||new Ne(new Nt("The user rejected the request.",Qe.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),y(null),c(""),h(void 0)};return i.current=()=>{_(f)},gi(c1,{children:[je(T,{onClose:()=>_(f)}),je(X,{}),gi(g7,{children:[je(v7,{children:O.title}),je(C7,{children:O.description}),v==="personal_sign"&&je(l1,{children:m7(k)}),v==="eth_signTypedData_v4"&&je(y7,{typedData:k}),je(b7,{fail:!0,children:s}),je(T7,{success:w,loading:a,disabled:w,onClick:async()=>{try{let F=await S();y(F),c(""),setTimeout(()=>{_(F)},Be)}catch{c("An error has occurred, please try again."),h(new Ne(new Nt(s,Qe.E32603_DEFAULT_INTERNAL_ERROR.eipCode)))}},children:w?gi(E7,{children:[je(pl,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",je("span",{children:"Success"})]}):O.buttonText})]}),je(ie,{}),je(z,{protectedByPrivy:!0})]})},g7=Wo.div`
2521
2521
  display: flex;
2522
2522
  flex-direction: column;
2523
2523
  align-items: center;
2524
2524
  justify-content: center;
2525
- `,C7=Wo.span`
2525
+ `,v7=Wo.span`
2526
2526
  color: var(--privy-color-foreground);
2527
2527
  text-align: center;
2528
2528
  font-size: 1.125rem;
2529
2529
  font-weight: 500;
2530
2530
  line-height: 1.25rem; /* 111.111% */
2531
2531
  text-align: center;
2532
- `,w7=Wo.span`
2532
+ `,C7=Wo.span`
2533
2533
  margin-top: 4px;
2534
2534
  color: var(--privy-color-foreground);
2535
2535
  text-align: center;
@@ -2539,7 +2539,7 @@ backed up.`}),co(W,{onClick:P,children:"Confirm with Google"})]}),co(z,{protecte
2539
2539
  font-weight: 400;
2540
2540
  line-height: 20px; /* 142.857% */
2541
2541
  letter-spacing: -0.008px;
2542
- `,c1=Wo.div`
2542
+ `,l1=Wo.div`
2543
2543
  margin-top: 1.5rem;
2544
2544
  background-color: var(--privy-color-background-2);
2545
2545
  border-radius: var(--privy-border-radius-md);
@@ -2558,7 +2558,7 @@ backed up.`}),co(W,{onClick:P,children:"Confirm with Google"})]}),co(z,{protecte
2558
2558
  display: none; /* Safari and Chrome */
2559
2559
  }
2560
2560
  }
2561
- `,b7=Wo.ul`
2561
+ `,w7=Wo.ul`
2562
2562
  margin-left: 12px !important;
2563
2563
  white-space: nowrap;
2564
2564
 
@@ -2570,7 +2570,7 @@ backed up.`}),co(W,{onClick:P,children:"Confirm with Google"})]}),co(z,{protecte
2570
2570
  font-weight: 500 !important;
2571
2571
  }
2572
2572
  }
2573
- `,E7=Wo.div`
2573
+ `,b7=Wo.div`
2574
2574
  line-height: 20px;
2575
2575
  height: 20px;
2576
2576
  font-size: 13px;
@@ -2580,22 +2580,22 @@ backed up.`}),co(W,{onClick:P,children:"Confirm with Google"})]}),co(z,{protecte
2580
2580
  width: 100%;
2581
2581
  margin-top: 16px;
2582
2582
  margin-bottom: 4px;
2583
- `,T7=Wo.span`
2583
+ `,E7=Wo.span`
2584
2584
  display: flex;
2585
2585
  align-items: center;
2586
2586
  gap: 8px;
2587
- `,P7=Wo(W)`
2587
+ `,T7=Wo(W)`
2588
2588
  transition: color 350ms ease, background-color 350ms ease;
2589
2589
 
2590
- ${e=>e.success&&m7`
2590
+ ${e=>e.success&&u7`
2591
2591
  &&&& {
2592
2592
  background-color: var(--privy-color-success);
2593
2593
  color: #ffffff;
2594
2594
  }
2595
2595
  `}
2596
- `;import R7 from"@heroicons/react/24/outline/EnvelopeIcon";import S7 from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as x7,useState as p1}from"react";import m1 from"styled-components";import{Fragment as A7,jsx as Pa,jsxs as u1}from"react/jsx-runtime";var f1=x7((e,t)=>{let[r,o]=p1(""),[n,i]=p1(!1),{authenticated:a,user:l}=B(),{initUpdateEmail:s}=M(),{navigate:c,setModalData:u,currentScreen:h}=x(),{enabled:f,token:y}=Ce(),w=Ga(r),v=n,k=n||!w,S=async R=>{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,R),c("AWAITING_PASSWORDLESS_CODE")}catch(P){u({errorModalData:{error:P,previousScreen:h||"LANDING"}})}i(!1)},C=()=>{f&&!y&&!a?(u({captchaModalData:{callback:R=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");return s(l.email.address,r,R)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):S(y)};return u1(A7,{children:[Pa(k7,{children:u1(_7,{children:[Pa(S7,{}),Pa("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:R=>o(R.target.value),onKeyUp:R=>{R.key==="Enter"&&C()},value:r,autoComplete:"email"}),e.stacked?null:Pa(In,{isSubmitting:v,onClick:C,disabled:k,children:"Submit"})]})}),e.stacked?Pa(W,{loadingText:null,loading:v,disabled:k,onClick:C,children:"Submit"}):null]})}),k7=m1.div`
2596
+ `;import A7 from"@heroicons/react/24/outline/EnvelopeIcon";import P7 from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as S7,useState as d1}from"react";import u1 from"styled-components";import{Fragment as _7,jsx as Pa,jsxs as p1}from"react/jsx-runtime";var m1=S7((e,t)=>{let[r,o]=d1(""),[n,i]=d1(!1),{authenticated:a,user:l}=B(),{initUpdateEmail:s}=M(),{navigate:c,setModalData:u,currentScreen:h}=x(),{enabled:f,token:y}=Ce(),w=Ga(r),v=n,k=n||!w,S=async R=>{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,R),c("AWAITING_PASSWORDLESS_CODE")}catch(P){u({errorModalData:{error:P,previousScreen:h||"LANDING"}})}i(!1)},C=()=>{f&&!y&&!a?(u({captchaModalData:{callback:R=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");return s(l.email.address,r,R)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):S(y)};return p1(_7,{children:[Pa(x7,{children:p1(k7,{children:[Pa(P7,{}),Pa("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:R=>o(R.target.value),onKeyUp:R=>{R.key==="Enter"&&C()},value:r,autoComplete:"email"}),e.stacked?null:Pa(In,{isSubmitting:v,onClick:C,disabled:k,children:"Submit"})]})}),e.stacked?Pa(W,{loadingText:null,loading:v,disabled:k,onClick:C,children:"Submit"}):null]})}),x7=u1.div`
2597
2597
  width: 100%;
2598
- `,_7=m1.label`
2598
+ `,k7=u1.label`
2599
2599
  display: block;
2600
2600
  position: relative;
2601
2601
  width: 100%;
@@ -2653,7 +2653,7 @@ backed up.`}),co(W,{onClick:P,children:"Confirm with Google"})]}),co(z,{protecte
2653
2653
  && > input::placeholder {
2654
2654
  color: var(--privy-color-foreground-3);
2655
2655
  }
2656
- `;import{Fragment as I7,jsx as Lo,jsxs as M7}from"react/jsx-runtime";var h1=()=>M7(I7,{children:[Lo(T,{},"header"),Lo(X,{}),Lo(Te,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:Lo(R7,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),Lo(ar,{children:Lo(f1,{stacked:!0})}),Lo(ie,{}),Lo(z,{protectedByPrivy:!0})]});import ep from"styled-components";import{jsx as y1}from"react/jsx-runtime";var g1=({style:e,...t})=>y1("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:y1("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"})});import{Fragment as N7,jsx as fn,jsxs as Xd}from"react/jsx-runtime";var v1=()=>{let{navigate:e}=x();return Xd(N7,{children:[fn(T,{}),Xd(W7,{children:[fn(L7,{children:fn(g1,{})}),Xd(O7,{children:[fn("h3",{children:"Unable to sign in"}),fn("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),fn(W,{onClick:()=>{e("LANDING")},children:"Go back"})]}),fn(z,{protectedByPrivy:!0})]})},W7=ep.div`
2656
+ `;import{Fragment as R7,jsx as Lo,jsxs as I7}from"react/jsx-runtime";var f1=()=>I7(R7,{children:[Lo(T,{},"header"),Lo(X,{}),Lo(Te,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:Lo(A7,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),Lo(ar,{children:Lo(m1,{stacked:!0})}),Lo(ie,{}),Lo(z,{protectedByPrivy:!0})]});import ep from"styled-components";import{jsx as h1}from"react/jsx-runtime";var y1=({style:e,...t})=>h1("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:h1("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"})});import{Fragment as O7,jsx as fn,jsxs as Xd}from"react/jsx-runtime";var g1=()=>{let{navigate:e}=x();return Xd(O7,{children:[fn(T,{}),Xd(M7,{children:[fn(W7,{children:fn(y1,{})}),Xd(L7,{children:[fn("h3",{children:"Unable to sign in"}),fn("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),fn(W,{onClick:()=>{e("LANDING")},children:"Go back"})]}),fn(z,{protectedByPrivy:!0})]})},M7=ep.div`
2657
2657
  display: flex;
2658
2658
  flex-direction: column;
2659
2659
  align-items: center;
@@ -2662,7 +2662,7 @@ backed up.`}),co(W,{onClick:P,children:"Confirm with Google"})]}),co(z,{protecte
2662
2662
  width: 100%;
2663
2663
  padding-top: 8px;
2664
2664
  padding-bottom: 32px;
2665
- `,L7=ep.div`
2665
+ `,W7=ep.div`
2666
2666
  display: flex;
2667
2667
  align-items: center;
2668
2668
  justify-content: center;
@@ -2671,11 +2671,11 @@ backed up.`}),co(W,{onClick:P,children:"Confirm with Google"})]}),co(z,{protecte
2671
2671
  color: var(--privy-color-error);
2672
2672
  background-color: var(--privy-color-error-light);
2673
2673
  border-radius: 50%;
2674
- `,O7=ep.div`
2674
+ `,L7=ep.div`
2675
2675
  display: flex;
2676
2676
  flex-direction: column;
2677
2677
  gap: 8px;
2678
- `;import F7,{createGlobalStyle as U7}from"styled-components";var D7=`
2678
+ `;import D7,{createGlobalStyle as F7}from"styled-components";var N7=`
2679
2679
  *,
2680
2680
  ::before,
2681
2681
  ::after {
@@ -2905,7 +2905,7 @@ backed up.`}),co(W,{onClick:P,children:"Confirm with Google"})]}),co(z,{protecte
2905
2905
  [hidden] {
2906
2906
  display: none;
2907
2907
  }
2908
- `,C1=D7;var w1=U7`
2908
+ `,v1=N7;var C1=F7`
2909
2909
  :root {
2910
2910
  // Borders
2911
2911
  --privy-border-radius-sm: 6px;
@@ -2938,10 +2938,10 @@ backed up.`}),co(W,{onClick:P,children:"Confirm with Google"})]}),co(z,{protecte
2938
2938
  --privy-height-modal-full: 620px;
2939
2939
  --privy-height-modal-compact: 480px;
2940
2940
  };
2941
- `,b1=F7.div`
2941
+ `,w1=D7.div`
2942
2942
  // css normalize only the privy application to avoid conflicts
2943
2943
  // with consuming application
2944
- ${C1}
2944
+ ${v1}
2945
2945
 
2946
2946
  // Privy styles
2947
2947
  color: var(--privy-color-foreground-2);
@@ -3000,4 +3000,4 @@ backed up.`}),co(W,{onClick:P,children:"Confirm with Google"})]}),co(z,{protecte
3000
3000
  opacity: 1;
3001
3001
  }
3002
3002
  }
3003
- `;import{jsx as it,jsxs as T1}from"react/jsx-runtime";var z7={["LANDING"]:iy,["CONNECT_OR_CREATE"]:oy,["AWAITING_PASSWORDLESS_CODE"]:Hm,["AWAITING_CONNECTION"]:cf,["AWAITING_CONNECT_ONLY_CONNECTION"]:mf,["AWAITING_FARCASTER_CONNECTION"]:vh,["AWAITING_FARCASTER_SIGNER"]:Ph,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:Mg,["PHANTOM_INTERSTITIAL_SCREEN"]:Ng,["LOGIN_FAILED_SCREEN"]:Cy,["AWAITING_OAUTH_SCREEN"]:Ag,["ALLOWLIST_REJECTION_SCREEN"]:Im,["USER_LIMIT_REACHED_SCREEN"]:v1,["INSTALL_PHANTOM_SCREEN"]:Fh,["LINK_EMAIL_SCREEN"]:ay,["LINK_PHONE_SCREEN"]:fy,["LINK_WALLET_SCREEN"]:hy,["LINK_PASSKEY_SCREEN"]:uy,["UPDATE_EMAIL_SCREEN"]:h1,["CONNECT_ONLY_LANDING_SCREEN"]:of,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:ef,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:Rf,["EMBEDDED_WALLET_CREATED_SCREEN"]:Tf,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:bf,["EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN"]:Dg,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:Kg,["EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN"]:zg,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:kf,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:l1,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:a1,["FIAT_ON_RAMP_PROMPT_SCREEN"]:Rh,["FIAT_ON_RAMP_STATUS_SCREEN"]:Mh,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:rh,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:th,["EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN"]:$g,["MFA_ENROLLMENT_FLOW_SCREEN"]:Ny,["CAPTCHA_SCREEN"]:qm,["ERROR_SCREEN"]:nh,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:Wh,["AFFIRMATIVE_CONSENT_SCREEN"]:_m},q7=["LANDING","AWAITING_CONNECTION"],$7=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=B(),{headless:n}=M(),{ready:i,currentScreen:a}=x(),{status:l,execute:s,reset:c,enabled:u}=Ce(),h=H7(null),f=gm(h),y=o&&a&&q7.includes(a)&&!n&&l==="ready";if(E1(()=>{y&&s()},[y]),E1(()=>{!o&&u&&c()},[o,u]),(!r||!i)&&a!=="AWAITING_OAUTH_SCREEN")return T1(ii,{id:"privy-modal-content",children:[it(T,{}),it(X,{}),it(ky,{children:it(Xe,{})}),it(ie,{}),it(q,{})]});if(!a&&e)return it(ii,{style:{height:f},id:"privy-modal-conent",children:it("div",{ref:h,children:it($d,{open:e,onClose:t})})});if(!a)return null;let w=z7[a];return it(ii,{style:{height:f},id:"privy-modal-content",children:T1("div",{ref:h,children:[it(eo,{if:!!e,children:it(w,{})}),it(eo,{if:!e,children:it($d,{open:e,onClose:t})})]})})},K7=()=>{let{closePrivyModal:e}=M(),{onUserCloseViaDialogOrKeybindRef:t}=x();return{gracefulClosePrivyModal:B7(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},P1=({open:e})=>{let{app:t}=x(),{gracefulClosePrivyModal:r}=K7(),[o,n]=G7(!1);_c({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=it(b1,{children:it($7,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})}),a=e||o,l=t?.render.inDialog?it(xy,{open:a,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:i}):i;if(typeof window<"u"&&t?.render.inParentNodeId){let s=document.getElementById(t.render.inParentNodeId);if(s)return V7.createPortal(l,s)}return l};import{useState as j7}from"react";import{useEffect as S1,useRef as x1}from"react";var Ql=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:connect":return o;case"privy:wallet:recover":return o;case"privy:wallet:rpc":return o;case"privy:wallet:set-recovery-password":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:submit-cast":return o;case"privy:farcaster:remove-cast":return o;case"privy:farcaster:react-to-cast":return o;case"privy:farcaster:submit-link":return o;case"privy:farcaster:remove-link":return o;default:throw new Error(`invalid wallet event type ${t}`)}}};async function Oo(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 xe("missing_or_invalid_mfa","MFA verification failed, retry."));let h=await new Promise((f,y)=>{r.current={resolve:f,reject:y};let w=1e3*60*5;setTimeout(()=>{let v=new xe("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(v),y(v)},w)});return await e(h)}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(h){if(h.type==="missing_or_invalid_mfa")a=!0;else throw o.current?.resolve(void 0),h}if(c===null){let u=new xe("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(u),u}return c}import{jsx as eE}from"react/jsx-runtime";var Y7=function(e){return()=>`id-${e++}`}(0);function Z7(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function at(e){return e.error!==void 0}var Ye=new Ql,tp=new Map,J7=(e,t)=>typeof t=="bigint"?t.toString():t,Q7=(e,t)=>`${e}${JSON.stringify(t,J7)}`;function st(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let i=Q7(e,t);if(e==="privy:wallet:create"){let l=tp.get(i);if(l)return l}let a=new Promise((l,s)=>{let c=Y7();Ye.enqueue(c,{resolve:l,reject:s}),n.postMessage({id:c,event:e,data:t},o)}).finally(()=>{tp.delete(i)});return tp.set(i,a),a}function X7(e){switch(e.event){case"privy:iframe:ready":let t=Ye.dequeue(e.event,e.id);return at(e)?t.reject(new xe(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=Ye.dequeue(e.event,e.id);return at(e)?r.reject(new xe(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:connect":let o=Ye.dequeue(e.event,e.id);return at(e)?o.reject(new xe(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:recover":let n=Ye.dequeue(e.event,e.id);return at(e)?n.reject(new xe(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:rpc":let i=Ye.dequeue(e.event,e.id);return at(e)?i.reject(new xe(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:set-recovery-password":let a=Ye.dequeue(e.event,e.id);return at(e)?a.reject(new xe(e.error.type,e.error.message)):a.resolve(e.data);case"privy:mfa:verify":let l=Ye.dequeue(e.event,e.id);return at(e)?l.reject(new xe(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:init-enrollment":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:submit-enrollment":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:unenroll":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:clear":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:init-signer":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:submit-cast":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:remove-cast":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:react-to-cast":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:submit-link":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:remove-link":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function k1(e){let t=x1(null),r=x1(e.mfaMethods),o=Os(),[n,i]=j7(!1);return S1(()=>{r.current=e.mfaMethods},[e.mfaMethods]),S1(()=>{if(!n)return;let a=t.current;if(!a)return;function l(f){f&&f.origin===e.origin&&Z7(f.data)&&X7(f.data)}let s={create(f){return st("privy:wallet:create",f,a,e.origin)},connect(f){return st("privy:wallet:connect",f,a,e.origin)},recover(f){return Oo(y=>st("privy:wallet:recover",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},rpc(f){return Oo(y=>st("privy:wallet:rpc",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},setRecoveryPassword(f){return Oo(y=>st("privy:wallet:set-recovery-password",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(f){return Oo(y=>st("privy:mfa:verify",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(f){return Oo(y=>st("privy:mfa:init-enrollment",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(f){return Oo(y=>st("privy:mfa:submit-enrollment",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(f){return Oo(y=>st("privy:mfa:unenroll",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(f){return st("privy:mfa:clear",f,a,e.origin)},initFarcasterSigner(f){return st("privy:farcaster:init-signer",f,a,e.origin)},submitCast(f){return st("privy:farcaster:submit-cast",f,a,e.origin)},removeCast(f){return st("privy:farcaster:remove-cast",f,a,e.origin)},reactToCast(f){return st("privy:farcaster:react-to-cast",f,a,e.origin)},submitLink(f){return st("privy:farcaster:submit-link",f,a,e.origin)},removeLink(f){return st("privy:farcaster:remove-link",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()},h=new AbortController;return nu(()=>st("privy:iframe:ready",{},a,e.origin),{abortSignal:h.signal}).then(c,u),()=>{window.removeEventListener("message",l),h.abort()}},[n]),eE("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>i(!0),src:Va(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId})})}function Xl(e){let t=e.toLowerCase();return["fbav","fban","instagram","snapchat"].some(o=>t.includes(o))}async function _1({url:e,popup:t}){return t.location=e,new Promise((o,n)=>{function i(){t?.close(),window.removeEventListener("message",a)}function a(l){l.data&&(l.data.type==="PRIVY_OAUTH_RESPONSE"?(o(l.data),i()):l.data.type==="PRIVY_OAUTH_ERROR"&&(n(l.data.error),i()))}window.addEventListener("message",a)})}var A1=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});import{jsx as qr,jsxs as R1}from"react/jsx-runtime";var No;function oE(e){return typeof e=="string"&&e.length===25}function he(){if(!No){let e=Y.get(Uo);return Promise.resolve(e||null)}return No.getAccessToken()}var I1,xu=(e,t)=>I1(e,t),M1,ku=(e,t)=>M1(e,t),W1,_u=(e,t)=>W1(e,t),L1,Au=()=>L1(),nE=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;Y.put(Ei,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},iE=({config:e,...t})=>{if(!oE(t.appId))throw new E("Cannot initialize the Privy provider with an invalid Privy app ID");No||(No=new Li({appId:t.appId,apiUrl:t.apiUrl||Fa}));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."),qr(am,{client:No,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:qr(aE,{...t,config:r,client:No})})},aE=e=>{let t=e.client,[r,o]=Ge(!1),[n,i]=Ge(!1),[a,l]=Ge(!1),[s,c]=Ge(null),[u,h]=Ge([]),f=vi(u),[y,w]=Ge(!1),[v,k]=Ge(null),[S,C]=Ge(!1),[R,P]=Ge({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:b}),[O,_]=Ge({status:"initial"}),[D,K]=Ge(null),[V,H]=Ge(null),[I,Q]=Ge(null),U=go(),pe=Is(),[me,ae]=Ge(!0),[Ee,J]=Ge({}),[jt,Lt]=Ge(null),[Yt,lt]=Ge(null),[Sr,Le]=Ge(!1),[hn,xr]=Ge(!1),Pt=vi(null),Fe=vi(null),L=vi(vm);t.onStoreToken=d=>{d&&N(L,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{c(null),l(!1),N(L,"accessToken","onAccessTokenRemoved")};let oe=vi(null),G=vi(null),fe=d=>{k(d),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:d}})},Zt=d=>{U.embeddedWallets.createOnLogin!=="off"&&ae(!0),fe(d)};Pr(()=>{let d=()=>{document.visibilityState==="hidden"&&t.createAnalyticsEvent({eventName:"page_hidden",options:{keepAlive:!0}})};return document.addEventListener("visibilitychange",d),()=>{document.removeEventListener("visibilitychange",d)}},[]),Pr(()=>{if(!s){t.connectors?.removeEmbeddedWalletConnector();return}let d=s.linkedAccounts.find(p=>p.type==="wallet"&&p.walletClientType==="privy");if(!d){t.connectors?.removeEmbeddedWalletConnector();return}if(!t.connectors){console.warn("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!I){console.warn("Failed to add embedded wallet connector: Wallet proxy not initialized");return}t.connectors.addEmbeddedWalletConnector(I,d.address,U.defaultChain,e.appId)},[I,s]),Pr(()=>{I&&Yt?.(I)},[I]),Pr(()=>{(async()=>{if(!U.customAuth?.enabled)return;ae(!0);let{getCustomAccessToken:p,isLoading:m}=U.customAuth;if(!(!n||m))try{let g=await p();if(!g&&a){await yn.logout();return}if(!g||a)return;t.startAuthFlow(new gn(g));let{user:A,isNewUser:F}=await t.authenticate();if(!A){await yn.logout();return}c(A||null),w(F||!1),l(!0),xr(!0)}catch(g){console.warn(g),a&&await yn.logout()}})()},[U.customAuth?.enabled,U.customAuth?.getCustomAccessToken,U.customAuth?.isLoading,n,a]),Pr(()=>{hn&&I&&s&&tr(s,e.config?.embeddedWallets?.createOnLogin)&&(xr(!1),bi(s,vn).catch(console.error))},[hn&&I&&s]),Pr(()=>{async function d(){let p=Do();nE();let m=tE();K(m),t.initializeConnectorManager({walletConnectCloudProjectId:U.walletConnectCloudProjectId,rpcConfig:U.rpcConfig,chains:U.chains,defaultChain:U.defaultChain,store:m,walletList:U.appearance.walletList,shouldEnforceDefaultChainOnConnect:U.shouldEnforceDefaultChainOnConnect,appName:U.name??"Privy"}),t.connectors?.initialize().then(()=>{Sa()});let g=await t.getAuthenticatedUser();e.config?.customAuth?.enabled||(l(!!g),g&&N(L,"login","onComplete",g,!1,!0,null,null),c(g)),p||ue.setReadyToTrue(!!g),p&&(g?G.current="link":G.current="login")}!n&&pe&&d()},[t,jt,n,pe]),Pr(()=>{if(!n)return;if(!s){Le(!0);return}if(!!!s.linkedAccounts.find(m=>m.type==="wallet"&&m.walletClientType==="privy")){Le(!0);return}let p=!!u.find(m=>m.walletClientType==="privy");Le(p)},[n,s,u]);let Do=()=>{let d=_i();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 _r(d)),Zt("AWAITING_OAUTH_SCREEN"),!0)},ht=async(d,p,m,g)=>{let A=await t.connectors?.createWalletConnector(d,p)||null;Ci(A,p,m,g)};async function Ci(d,p,m,g){if(d)P({status:"disconnected",connectedWallet:null,connectError:null,connector:d,connectRetry:b});else return P({status:"disconnected",connectedWallet:null,connectError:new ee("Unable to connect to wallet."),connector:null,connectRetry:b}),g?.(null,m);d instanceof Mr&&p&&await d.resetConnection(p),P({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Ci(d,p,m,g)});try{let A=await d.connect({showPrompt:!0});if(U.shouldEnforceDefaultChainOnConnect&&!U.chains.find(F=>F.id===Number(A?.chainId))&&!(A?.connectorType==="wallet_connect_v2"&&A?.walletClientType==="metamask")){P(F=>({...F,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:b}));try{await A?.switchChain(U.defaultChain.id),A&&(A.chainId=wn(zo(U.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${U.defaultChain.id}`)}}return P(F=>({...F,status:"connected",connectedWallet:A,connectError:null,connectRetry:b})),A&&!G.current&&N(L,"connectWallet","onSuccess",A),g?.(A,m)}catch(A){return A instanceof Ue?(console.warn(A.cause?A.cause:A.message),G.current||N(L,"connectWallet","onError",A.privyErrorCode||"generic_connect_wallet_error")):(console.warn(A),G.current||N(L,"connectWallet","onError","unknown_connect_wallet_error")),P(F=>({...F,status:"disconnected",connectedWallet:null,connectError:A})),g?.(null,m)}}let $r=async(d,p)=>{if(d===null)return;let m=new Ko(d,p);t.startAuthFlow(m)},Sa=()=>{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"&&!mo()&&Zt("LOGIN_FAILED_SCREEN"),!t.connectors)throw new E("Connector not initialized");fe("AWAITING_CONNECTION");let g=new URL(window.location.href);g.searchParams.delete("privy_connector"),g.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",g),ht(p,m,void 0,$r)};Pr(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let Ze=()=>{if(!a)throw N(L,"linkAccount","onError","must_be_authenticated"),new E("User must be authenticated before linking an account.")},xa=()=>{Ze(),oe.current="siwe",G.current="link",fe("LINK_WALLET_SCREEN")},wi=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},Fo=async d=>{if(!t.connectors)throw new E("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(P(m=>({...m,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:b})),U.captchaEnabled&&!a){let m={callback:g=>$r(d,g),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};J({captchaModalData:m}),Zt("CAPTCHA_SCREEN")}else await $r(d),Zt("AWAITING_CONNECTION")},Ve=async(d,p)=>{if(!U.fiatOnRamp.enabled)throw new E("Fiat on-ramp is not enabled");if(!p||!p.provider||p.provider==="moonpay"){let{signedUrl:m,externalTransactionId:g}=await _h(t,d,p?.config??{},U.appearance.palette,U.fiatOnRamp.useSandbox);return{signedUrl:m,externalTransactionId:g}}else throw new E("Unsupported fund provider. Currently supported option is `moonpay`.")},ct=()=>{h(d=>{let p=t.connectors?.wallets.map(m=>({...m,linked:wi(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");Fo(m)},fund:async g=>{let{signedUrl:A,externalTransactionId:F}=await Ve(m.address,g);J({fiatOnRampPrompt:{signedUrl:A},fiatOnRampStatus:{externalTransactionId:F}}),fe("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 g=await t.unlinkWallet(m.address);c(g)}}))||[];return ds(d,p)?d:p})};Pr(()=>{ct()},[s?.linkedAccounts,a,n]),Pr(()=>{if(n){if(!t.connectors)throw new E("Connector not initialized");ct(),t.connectors.on("walletsUpdated",ct)}},[n]);let Kr=()=>{fe(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};Pr(()=>{if(!u[0])return;let d=u[0],p=f.current.find(g=>g.address===d.address),m;if(d.walletClientType==="privy"?m=s?.linkedAccounts.find(g=>g.type==="wallet"&&g.address===d.address&&g.walletClientType==="privy"):m=s?.linkedAccounts.find(g=>g.type==="wallet"&&g.address===d.address&&g.walletClientType!=="privy"),!p&&m){let g=Object.assign({},s);g.wallet=m&&{address:m.address,chainType:m.chainType,chainId:m.chainId,walletClient:m.walletClient,walletClientType:m.walletClientType,connectorType:m.connectorType},c(g)}f.current=u},[u]);let bi=async(d,p)=>{if(Se(d))throw N(L,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[g,A]=await Promise.all([ue.initializeWalletProxy(p),he()]);if(!g&&e.config?.customAuth?.enabled)throw N(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!g||!A||U.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((F,j)=>{ae(!0),J({createWallet:{onSuccess:Je=>{N(L,"createWallet","onSuccess",Je),F(Je)},onFailure:Je=>{N(L,"createWallet","onError","unknown_embedded_wallet_error"),j(Je)},callAuthOnSuccessOnClose:!1}}),fe("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await g.create({accessToken:A});let F=await ue.refreshUser(),j=Se(F);if(!j)throw N(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return N(L,"createWallet","onSuccess",j),j}},jr=d=>{if(!U.chains.map(p=>p.id).includes(d))throw new ee(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},ka=(d,p,m)=>new Promise(async(g,A)=>{if(!a||!s){N(L,"sendTransaction","onError","must_be_authenticated"),A(new Error("User must be authenticated before signing with a Privy wallet"));return}let F=Se(s);if(!F){N(L,"sendTransaction","onError","embedded_wallet_not_found"),A(new Error("Must have a Privy wallet before signing"));return}ae(!0);let j=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,ze=d.chainId?Number(d.chainId):j.chainId;jr(ze);let Je=Object.assign({},d,{chainId:ze}),Qt=async()=>{let _e=await he();if(!_e||!I){N(L,"sendTransaction","onError","embedded_wallet_not_found"),A(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await ue.recoverEmbeddedWallet()){N(L,"sendTransaction","onError","unknown_connect_wallet_error"),A(new Error("Unable to connect to wallet"));return}let yt=Zr(Je.chainId,U.chains,U.rpcConfig,{appId:e.appId}),tc=await ui(F.address,Je,yt);if(U.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:U1}=await pi(tc,yt),{hasSufficientFunds:B1}=await Gl(F.address,tc,U1,yt);if(!B1)throw new Ne(new Nt("Wallet has insufficient funds for this transaction.",Qe.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let ip=await Hl(_e,F.address,I,tc,yt);N(L,"sendTransaction","onSuccess",ip),g(ip)}catch(Ot){N(L,"sendTransaction","onError","transaction_failure"),A(Ot)}};if(U.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),Qt();else{let _e={transactionRequest:Je,onSuccess:yt=>{N(L,"sendTransaction","onSuccess",yt),g(yt)},onFailure:yt=>{N(L,"sendTransaction","onError","transaction_failure"),A(yt)},uiOptions:p||{},fundWalletConfig:m},Ot={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:yt=>{N(L,"sendTransaction","onError","unknown_connect_wallet_error"),A(yt)}};J({connectWallet:Ot,sendTransaction:_e}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function op(){return new Promise(async(d,p)=>{let m=await he();if(!m||!I)throw new Error("Must have valid access token to enroll in MFA");try{await I.verifyMfa({accessToken:m}),d()}catch(g){p(g)}})}let Jt=d=>{if(d==="passkey"){if(s&&s.linkedAccounts.filter(p=>p.type==="passkey").length>=5)throw N(L,"linkAccount","onError","cannot_link_more_of_type"),new E(`User already has an account of type ${d} linked.`)}else if(s?.[d])throw N(L,"linkAccount","onError","cannot_link_more_of_type"),new E(`User already has an account of type ${d} linked.`)},yn={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:Kr,linkWallet:xa,linkEmail:()=>{Ze(),Jt("email"),oe.current="email",G.current="link",fe("LINK_EMAIL_SCREEN")},linkPhone:()=>{Ze(),Jt("phone"),oe.current="sms",G.current="link",fe("LINK_PHONE_SCREEN")},linkGoogle:async()=>{Ze(),Jt("google"),G.current="link",await ue.initLoginWithOAuth("google")},linkTwitter:async()=>{Ze(),Jt("twitter"),G.current="link",await ue.initLoginWithOAuth("twitter")},linkDiscord:async()=>{Ze(),Jt("discord"),G.current="link",await ue.initLoginWithOAuth("discord")},linkGithub:async()=>{Ze(),Jt("github"),G.current="link",await ue.initLoginWithOAuth("github")},linkSpotify:async()=>{Ze(),Jt("spotify"),G.current="link",await ue.initLoginWithOAuth("spotify")},linkTiktok:async()=>{Ze(),Jt("tiktok"),G.current="link",await ue.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{Ze(),Jt("linkedin"),G.current="link",await ue.initLoginWithOAuth("linkedin")},linkApple:async()=>{Ze(),Jt("apple"),G.current="link",await ue.initLoginWithOAuth("apple")},linkPasskey:async()=>{Ze(),Jt("passkey"),await ue.initLinkWithPasskey(),fe("LINK_PASSKEY_SCREEN")},linkFarcaster:async()=>{Ze(),Jt("farcaster"),await ue.initLoginWithFarcaster(),G.current="link",oe.current="farcaster",fe("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(Ze(),!s?.email)throw new E("User does not have an email linked to their account.");G.current="link",oe.current="email",fe("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=>{Lt(g=>m.bind(g))});if(Lt(null),p){console.warn(d);return}}if(a){console.warn(d);return}G.current="login",Zt("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{Lt(()=>d)}),Lt(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}Zt("CONNECT_OR_CREATE")},logout:async()=>{if(await t.logout(),s&&I)try{await I.clearMfa({userId:s.id})}catch{}c(null),l(!1),k(null),N(L,"logout","onSuccess"),G.current=null,oe.current=null,o(!1),Y.del(Ti)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new Ie;let d=u.find(m=>s.wallet&&m.address===s.wallet.address),p=t.connectors?.walletConnectors.find(m=>m.wallets.find(g=>g.address===d?.address));return!d||!p?new Ie:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new rp(new Ar(new Ie));let d=u.find(m=>s.wallet&&m.address===s.wallet.address),p=t.connectors?.walletConnectors.find(m=>m.wallets.find(g=>g.address===d?.address));return!d||!p?new rp(new Ar(new Ie)):new rp(new Ar(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new yo(new Ie);let d=u.find(m=>s.wallet&&m.address===s.wallet.address),p=t.connectors?.walletConnectors.find(m=>m.wallets.find(g=>g.address===d?.address));return!d||!p?new yo(new Ie):new yo(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},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},unlinkPasskey:async d=>{let p=await t.unlinkPasskey(d);return c(p),p},setActiveWallet:async d=>{let p=u.find(g=>ec(g.address)===ec(d)),m=s?.linkedAccounts.find(g=>g.type==="wallet"&&ec(g.address)===ec(d));if(!p||!await p.isConnected())H(d),xa();else if(!p.linked)p.loginOrLink();else{let g=Object.assign({},s);g.wallet=m&&{address:m.address,chainType:m.chainType,chainId:m.chainId,walletClient:m.walletClient,walletClientType:m.walletClientType,connectorType:m.connectorType},c(g)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw N(L,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return bi(s,15e3)},setWalletPassword:async()=>{if(!a||!s)throw N(L,"setWalletPassword","onError","must_be_authenticated"),new Error("User must be authenticated before adding password to Privy wallet");let d=Se(s);if(!d||!I)throw N(L,"setWalletPassword","onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a password");if(d.recoveryMethod==="user-passcode")throw N(L,"setWalletPassword","onError","embedded_wallet_password_already_exists"),new Error("Cannot set password. Embedded wallet already has a password.");try{await op()}catch(p){throw N(L,"setWalletPassword","onError","missing_or_invalid_mfa"),p}return new Promise((p,m)=>{ae(!0);let g={onSuccess:F=>{N(L,"setWalletPassword","onSuccess",F),p(F)},onFailure:F=>{N(L,"setWalletPassword","onError","user_exited_set_password_flow"),m(F)},callAuthOnSuccessOnClose:!1},A={onCompleteNavigateTo:"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",onFailure:F=>{N(L,"setWalletPassword","onError","unknown_connect_wallet_error"),m(F)}};J({setWalletPassword:g,connectWallet:A}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")})},signMessage:(d,p)=>new Promise(async(m,g)=>{if(!a||!s){N(L,"signMessage","onError","must_be_authenticated"),g(new Error("User must be authenticated before signing with a Privy wallet"));return}let A=Se(s);if(!A){N(L,"signMessage","onError","embedded_wallet_not_found"),g(new Error("Must have a Privy wallet before signing"));return}if(typeof d!="string"||d.length<1){N(L,"signMessage","onError","invalid_message"),g(new Error("Message must be a non-empty string"));return}ae(!0);let F=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let j=await he();if(!I||!j)throw new Error("Unable to connect to wallet");if(!await ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:A.address}});let{response:Je}=await I.rpc({accessToken:j,address:A.address,request:{method:"personal_sign",params:[d,A.address]}}),Qt=Je.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:A.address}}),Qt};if(U.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let j=await F();N(L,"signMessage","onSuccess",j),m(j)}catch(j){N(L,"signMessage","onError","unable_to_sign"),g(j??new Ne("Unable to sign message"))}}else{let Je={method:"personal_sign",data:d,confirmAndSign:F,onSuccess:_e=>{N(L,"signMessage","onSuccess",_e),m(_e)},onFailure:_e=>{N(L,"signMessage","onError","unable_to_sign"),g(_e)},uiOptions:p||{}},Qt={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:_e=>{N(L,"signMessage","onError","unknown_connect_wallet_error"),g(_e)}};J({signMessage:Je,connectWallet:Qt}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(m,g)=>{if(!a||!s){N(L,"signTypedData","onError","must_be_authenticated"),g(new Error("User must be authenticated before signing with a Privy wallet"));return}let A=Se(s);if(!A){N(L,"signTypedData","onError","embedded_wallet_not_found"),g(new Error("Must have a Privy wallet before signing"));return}ae(!0);let F=qa(d),j=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let ze=await he();if(!I||!ze)throw new Error("Unable to connect to wallet");if(!await ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:A.address}});let{response:Qt}=await I.rpc({accessToken:ze,address:A.address,request:{method:"eth_signTypedData_v4",params:[A.address,F]}}),_e=Qt.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:A.address}}),_e};if(U.embeddedWallets.noPromptOnSignature||(U.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ze=await j();N(L,"signTypedData","onSuccess",ze),m(ze)}catch(ze){N(L,"signTypedData","onError","unable_to_sign"),g(ze??new Ne("Unable to sign message"))}}else{let Qt={method:"eth_signTypedData_v4",data:F,confirmAndSign:j,onSuccess:Ot=>{N(L,"signTypedData","onSuccess",Ot),m(Ot)},onFailure:Ot=>{N(L,"signTypedData","onError","unable_to_sign"),g(Ot)},uiOptions:p||{}},_e={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Ot=>{N(L,"signMessage","onError","unknown_connect_wallet_error"),g(Ot)}};J({signMessage:Qt,connectWallet:_e}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,m)=>{let A=await(await ka(d,p,m)).wait();return Vl(A)},exportWallet:()=>new Promise(async(d,p)=>{if(!a||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}if(!Se(s)){p(new Error("Must have a Privy wallet before exporting"));return}ae(!0);let g={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p,shouldForceMFA:!0};if(J(Ee),!await he()||!I){p(new Error("Must have valid access token to enroll in MFA"));return}if(!I){p(new Error("Must have a Privy wallet before exporting"));return}let F={appId:e.appId,origin:t.apiUrl,onSuccess:d,onFailure:p};J({keyExport:F,connectWallet:g}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:op,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");Pt.current?.resolve({mfaMethod:d,mfaCode:p,relyingParty:window.origin}),await new Promise((F,j)=>{Fe.current={resolve:F,reject:j}});break;case"passkey":if(typeof p=="string")throw new E("Invalid authenticator response");let g=await(await import("@simplewebauthn/browser")).startAuthentication(p),A=A1(g);Pt.current?.resolve({mfaMethod:d,mfaCode:A,relyingParty:window.origin}),await new Promise((F,j)=>{Fe.current={resolve:F,reject:j}});break;default:throw Pt.current?.reject(new E("Unsupported MFA method")),new E(`Unsupported MFA method: ${d}`)}},cancel(){Pt.current?.reject(new E("MFA canceled"))},async initEnrollmentWithSms(d){let p=await he();if(!p||!I)throw new Error("Must have valid access token to enroll in MFA");await I.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber})},enrollInMfa(d){return new Promise((p,m)=>{if(!d){ue.closePrivyModal(),p();return}U.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."),J({mfaEnrollmentFlow:{mfaMethods:U.mfa.methods,onSuccess:p,onFailure:m}}),fe("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await he();if(!d||!I)throw new Error("Must have valid access token to enroll in MFA");let p=await I.initEnrollMfa({method:"totp",accessToken:d});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(d){let p=await he();if(!p||!I)throw new Error("Must have valid access token to enroll in MFA");await I.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber,code:d.mfaCode});let m=await t.getAuthenticatedUser();c(m)},async submitEnrollmentWithTotp(d){let p=await he();if(!p||!I)throw new Error("Must have valid access token to enroll in MFA");await I.submitEnrollMfa({method:"totp",accessToken:p,code:d.mfaCode});let m=await t.getAuthenticatedUser();c(m)},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:d}){let p=await he();if(!p||!I)throw new Error("Must have valid access token to enroll in MFA");await I.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:d});let m=await t.getAuthenticatedUser();c(m)},async unenroll(d){let p=await he();if(!p||!I)throw new Error("Must have valid access token to remove MFA");d==="passkey"?await I.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:[]}):await I.unenrollMfa({method:d,accessToken:p});let m=await t.getAuthenticatedUser();c(m)},requestFarcasterSigner:async()=>{let d=await he(),p=s?.linkedAccounts.find(A=>A.type==="wallet"&&A.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!I||!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 ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");let g=await I.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:d,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(g.status==="approved"){let A=await t.getAuthenticatedUser();c(A||s||null)}J({farcasterSigner:g}),fe("AWAITING_FARCASTER_SIGNER")},submitCast:async d=>{let p=await he(),m=s?.linkedAccounts.find(F=>F.type==="wallet"&&F.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!I||!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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await I.submitCast({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:d,fid:BigInt(s.farcaster.fid),relyingParty:window.origin})).response.hash}},removeCast:async({castHash:d})=>{let p=await he(),m=s?.linkedAccounts.find(F=>F.type==="wallet"&&F.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!I||!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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await I.removeCast({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:d,fid:BigInt(s.farcaster.fid),relyingParty:window.origin})).response.hash}},likeCast:async({castHash:d,castAuthorFid:p})=>{let m=await he(),g=s?.linkedAccounts.find(j=>j.type==="wallet"&&j.walletClientType==="privy");if(!m)throw new Error("Must have valid access token to connect with Farcaster");if(!I||!g)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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await I.reactToCast({address:g.address,hdWalletIndex:null,accessToken:m,mfaCode:null,mfaMethod:null,payload:{type:1,castId:{hash:d,fid:p}},fid:BigInt(s.farcaster.fid)})).response.hash}},recastCast:async({castHash:d,castAuthorFid:p})=>{let m=await he(),g=s?.linkedAccounts.find(j=>j.type==="wallet"&&j.walletClientType==="privy");if(!m)throw new Error("Must have valid access token to connect with Farcaster");if(!I||!g)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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await I.reactToCast({address:g.address,hdWalletIndex:null,accessToken:m,mfaCode:null,mfaMethod:null,payload:{type:2,castId:{hash:d,fid:p}},fid:BigInt(s.farcaster.fid)})).response.hash}},followUser:async({fid:d})=>{let p=await he(),m=s?.linkedAccounts.find(F=>F.type==="wallet"&&F.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!I||!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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await I.submitLink({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{type:"follow",targetFid:d},fid:BigInt(s.farcaster.fid)})).response.hash}},unfollowUser:async({fid:d})=>{let p=await he(),m=s?.linkedAccounts.find(F=>F.type==="wallet"&&F.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!I||!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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await I.removeLink({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{type:"follow",targetFid:d},fid:BigInt(s.farcaster.fid)})).response.hash}},isHeadlessOAuthLoading:S,loginWithCode(d){return ue.loginWithCode(d)},initLoginWithEmail(d){return ue.initLoginWithEmail(d)},initLoginWithSms(d){return ue.initLoginWithSms(d)},otpState:O,fundWallet(d,p){return ue.fundWallet(d,p)},initLoginWithHeadlessOAuth(d,p){return ue.initLoginWithHeadlessOAuth(d,p)},loginWithHeadlessOAuth(d){return ue.loginWithHeadlessOAuth(d)},isModalOpen:r};I1=yn.signMessage,M1=yn.signTypedData,W1=async(...d)=>{let p=await ka(...d);return U.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let np=!!e.config?.headless,ue=(()=>({headless:np,isNewUserThisSession:y,linkingHint:V,pendingTransaction:null,walletConnectionStatus:R,mipdStore:D,connectors:t.connectors?.walletConnectors??[],rpcConfig:U.rpcConfig,chains:U.chains,appId:e.appId,showFiatPrices:U.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>U.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(I)return I;let p=new Promise(A=>{lt(()=>F=>A(F))}),m=new Promise(A=>setTimeout(()=>A(null),d)),g=await Promise.race([p,m]);return lt(null),g},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(d={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s,m;p&&oe.current&&(m=s?.linkedAccounts.filter(g=>g.latestVerifiedAt!==null&&!(g.type==="wallet"&&g.walletClientType==="privy")).sort((g,A)=>A.latestVerifiedAt.getTime()-g.latestVerifiedAt.getTime())[0]),G.current==="login"&&oe.current?d.shouldCallAuthOnSuccess&&p?(N(L,"login","onComplete",s,y,!1,oe.current,m??null),e.onSuccess?.(s,y)):N(L,"login","onError","exited_auth_flow"):G.current==="link"&&oe.current&&m&&(d.isSuccess&&p?N(L,"linkAccount","onSuccess",s,oe.current,m):N(L,"linkAccount","onError","exited_link_flow")),H(null),G.current=null,oe.current=null,w(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},openPrivyModal:fe,connectWallet:Ci,initLoginWithWallet:async(d,p)=>{oe.current="siwe",$r(d,p)},loginWithWallet:async()=>{if(!n)throw new po;if(!(t.authFlow instanceof Ko))throw new E("Must initialize SIWE flow first.");let d,p;if(a)try{d=await t.link(),oe.current="siwe"}catch(m){throw N(L,"linkAccount","onError",m.privyErrorCode||"failed_to_link_account"),m}else try{({user:d,isNewUser:p}=await t.authenticate()),oe.current="siwe"}catch(m){throw N(L,"login","onError",m.privyErrorCode||"generic_connect_wallet_error"),m}c(d||s||null),w(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new Pi(d);t.startAuthFlow(p);try{oe.current="farcaster",await p.initializeFarcasterConnect()}catch(m){throw G.current==="login"?N(L,"login","onError",m.privyErrorCode||"unknown_auth_error"):G.current==="link"&&N(L,"linkAccount","onError",m.privyErrorCode||"unknown_auth_error"),m}},loginWithFarcaster:async()=>{if(!n)throw new po;if(!(t.authFlow instanceof Pi))throw new E("Must initialize Farcaster flow first.");let d,p;if(a)try{d=await t.link(),oe.current="farcaster"}catch(m){throw N(L,"linkAccount","onError",m.privyErrorCode||"failed_to_link_account"),m}else try{({user:d,isNewUser:p}=await t.authenticate()),oe.current="farcaster"}catch(m){throw N(L,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}c(d||null),w(p||!1),l(!0)},async initLoginWithOAuth(d,p){if(oe.current=d,ic()){if(d==="google"&&Xl(window.navigator.userAgent)){Zt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{Zt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}Y.del(Go);let m=new _r({provider:d});p&&m.addCaptchaToken(p),t.startAuthFlow(m);let g=await t.authFlow.getAuthorizationUrl();g&&g.url&&window.location.assign(g.url)},async recoveryOAuthFlow(d,p,m){let{url:g,codeVerifier:A,stateCode:F}=await gf({api:No.api,provider:d});if(!g)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:d}}),new E("Recovery OAuth failed");let j,ze;try{let _e=await _1({url:g,popup:m});if(j=_e.stateCode,ze=_e.authorizationCode,j!==F)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:F??"",returnedStateCode:j??""}}),new E("Unexpected auth flow. This may be a phishing attempt.")}catch(_e){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:_e.toString(),provider:d}}),new E("Recovery OAuth failed")}let[Je,Qt]=await Promise.all([he(),vf({api:No.api,provider:d,codeVerifier:A,stateCode:j,authorizationCode:ze})]);if(!I)throw new E("Cannot connect to wallet proxy");switch(p){case"recover":let _e=Ee.recoverWallet?.privyWallet?.address;if(!_e)throw new E("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:_e,recoveryMethod:d}}),await I.recover({address:_e,accessToken:Je,recoveryAccessToken:Qt,recoveryMethod:d}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:_e,recoveryMethod:d}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await I.create({accessToken:Je,recoveryAccessToken:Qt,recoveryMethod:d});let Ot=await ue.refreshUser(),yt=Se(Ot);if(!yt)throw N(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:yt.address}}),N(L,"createWallet","onSuccess",yt);break;default:throw new E("Unsupported recovery action")}},async loginWithOAuth(d){if(!(t.authFlow instanceof _r))throw new E("Must initialize OAuth flow before calling loginWithOAuth");let p=Y.get(Bo),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 g,A,F;if(a)try{g=await t.link(),oe.current=d}catch(j){throw N(L,"linkAccount","onError",j.privyErrorCode||"failed_to_link_account"),j}else try{let j=await t.authenticate();g=j.user,A=j.isNewUser,F=j.oAuthProviderTokens,oe.current=d}catch(j){throw G.current==="login"?N(L,"login","onError",j.privyErrorCode||"unknown_auth_error"):G.current==="link"&&N(L,"linkAccount","onError",j.privyErrorCode||"failed_to_link_account"),j}return c(g),w(A||!1),l(!0),F},async initLoginWithPasskey(d){let p=new $o(d);t.startAuthFlow(p),G.current="login";try{oe.current="passkey",await p.initAuthenticationFlow()}catch(m){throw N(L,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}},async loginWithPasskey(){if(!n)throw new po;if(!(t.authFlow instanceof $o))throw new E("Must initialize Passkey flow first.");if(oe.current!=="passkey")throw new E("Must init login with Passkey flow first.");let d,p;try{oe.current="passkey",{user:d,isNewUser:p}=await t.authenticate()}catch(m){throw N(L,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}c(d),w(p||!1),l(!0)},async initLinkWithPasskey(d){let p=new $o(d);t.startAuthFlow(p),G.current="link",oe.current="passkey";try{await p.initLinkFlow()}catch(m){throw N(L,"linkAccount","onError",m.privyErrorCode||"unknown_auth_error"),m}},async linkWithPasskey(){if(!n)throw new po;if(!(t.authFlow instanceof $o))throw new E("Must initialize Passkey flow first.");if(oe.current!=="passkey")throw new E("Must init login with Passkey flow first.");let d;try{oe.current="passkey",d=await t.link()}catch(p){throw N(L,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account"),p}c(d||s||null)},async initLoginWithHeadlessOAuth(d,p){if(ic()){if(d==="google"&&Xl(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 _r({provider:d,headless:!0});p&&m.addCaptchaToken(p);let g=await t.startAuthFlow(m).getAuthorizationUrl();g?.url&&window.location.assign(g.url)},async loginWithHeadlessOAuth(d){C(!0),t.startAuthFlow(new _r(d));let p=Y.get(Bo),m=d.stateCode;if(p!==m)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d.provider,storedStateCode:p??"",returnedStateCode:m??""}}),C(!1),new E("Unexpected auth flow. This may be a phishing attempt.");let g,A;if(a)try{g=await t.link(),oe.current=d.provider}catch(F){throw N(L,"linkAccount","onError",F.privyErrorCode||"failed_to_link_account"),F}else try{({user:g,isNewUser:A}=await t.authenticate()),oe.current=d.provider}catch(F){throw G.current==="login"?N(L,"login","onError",F.privyErrorCode||"unknown_auth_error"):G.current==="link"&&N(L,"linkAccount","onError",F.privyErrorCode||"failed_to_link_account"),F}return c(g),w(A||!1),l(!0),C(!1),g??void 0},initLoginWithEmail:async(d,p)=>{let m=new uo(d,p);t.startAuthFlow(m);try{oe.current="email",await m.sendCodeEmail()}catch(g){throw G.current==="login"?N(L,"login","onError",g.privyErrorCode||"unknown_auth_error"):G.current==="link"&&N(L,"linkAccount","onError",g.privyErrorCode||"failed_to_link_account"),g}},initUpdateEmail:async(d,p,m)=>{let g=new Oa(d,p,m);t.startAuthFlow(g),await g.sendCodeEmail()},initLoginWithSms:async(d,p)=>{_({status:"sending-code"});let m=new jo(d,p);t.startAuthFlow(m);try{oe.current="sms",await m.sendSmsCode(),_({status:"awaiting-code-input"})}catch(g){throw _({status:"error",error:g}),G.current==="login"?N(L,"login","onError",g.privyErrorCode||"unknown_auth_error"):G.current==="link"&&N(L,"linkAccount","onError",g.privyErrorCode||"failed_to_link_account"),g}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(_({status:"submitting-code"}),!n){let A=new po;throw _({status:"error",error:A}),A}if(t.authFlow instanceof uo)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof jo)t.authFlow.meta.smsCode=d.trim();else{let A=new E("Must initialize a passwordless code flow first");throw _({status:"error",error:A}),A}let p=await he(),m,g;if(p&&t.sessionHasActiveToken())try{m=await t.link()}catch(A){throw _({status:"error",error:A}),N(L,"linkAccount","onError",A.privyErrorCode||"failed_to_link_account"),A}else try{({user:m,isNewUser:g}=await t.authenticate())}catch(A){throw _({status:"error",error:A}),N(L,"login","onError",A.privyErrorCode||"unknown_auth_error"),A}c(m||s||null),w(g||!1),l(!0),_({status:"done"})},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:I,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(A=>A.type==="wallet"&&A.walletClientType==="privy"),g=await he();if(!g||!I||!m){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}ae(!0);try{await I.connect({accessToken:g,address:m.address}),d(!0)}catch(A){if(qn(A)&&m.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:m.address}}),(await I.recover({address:m.address,accessToken:g})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:m.address}}),d(!0);else if(qn(A)){J({recoverWallet:{privyWallet:m,onFailure:p,onSuccess:()=>d(!0)},recoveryOAuthStatus:{provider:"google-drive",action:"recover"}});let F=rl(m.recoveryMethod);fe(F)}else p(A)}}),getFiatOnRampConfig:Ve,setReadyToTrue:d=>{i(!0),jt?.(d)},updateWallets:()=>ct(),fundWallet:async(d,p)=>{let{signedUrl:m,externalTransactionId:g}=await Ve(d,p);J({fiatOnRampPrompt:{signedUrl:m},fiatOnRampStatus:{externalTransactionId:g}}),fe("FIAT_ON_RAMP_PROMPT_SCREEN")},requestFarcasterSignerStatus:async d=>{let p=await he(),m=s?.linkedAccounts.find(A=>A.type==="wallet"&&A.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!I||!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 g=await t.requestFarcasterSignerStatus(d);if(g.status==="approved"){let A=await t.getAuthenticatedUser();c(A||s||null)}return g}}))();L1=ue.recoverEmbeddedWallet;let F1=rE(()=>({wallets:u,ready:Sr}),[u,Sr]);return qr(ye.Provider,{value:yn,children:qr(kc.Provider,{value:L,children:qr(zd.Provider,{value:F1,children:R1(hm,{...U,children:[e.children,R1(xc.Provider,{value:ue,children:[!np&&U.captchaEnabled&&n&&!a&&qr(Sc,{delayedExecution:!1}),qr(w1,{theme:{...U.appearance.palette||{}}}),qr(lm,{data:Ee,setModalData:J,setInitialScreen:k,initialScreen:v,authenticated:a,open:r,children:qr(P1,{open:r})}),me&&pe?qr(k1,{appId:e.appId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:Pt,mfaSubmitPromise:Fe,onLoad:Q,onLoadFailed:()=>null}):null]})]})})})})};import{useContext as sE}from"react";function lE(e){let{login:t}=sE(ye);return De("login",e),{login:t}}import{useContext as cE}from"react";function dE(e){let{logout:t}=cE(ye);return De("logout",e),{logout:t}}import{useCallback as O1,useEffect as pE}from"react";function uE(){let e=Ce(),t=Is(),{initLoginWithHeadlessOAuth:r,loginWithHeadlessOAuth:o,isHeadlessOAuthLoading:n,ready:i,user:a}=B(),l=O1(async c=>{if(e.enabled&&e.status!=="success")throw new mr(e.error,null,"captcha_failure");return r(c.provider,e.token)},[r,e]),s=O1(async()=>{let c=_i();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{qo()}},[o]);return pE(()=>{let c=_i();i&&t&&c.inProgress&&c.headless&&!c.popupFlow&&s()},[i,t]),{initOAuth:l,loginWithOAuth:s,loading:n}}import{useCallback as N1}from"react";var mE=()=>{let e=Ce(),{initLoginWithEmail:t,loginWithCode:r}=B(),o=N1(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=N1(async({code:i})=>{if(e.enabled&&e.status==="error")throw new mr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};import{useCallback as D1}from"react";var fE=()=>{let e=Ce(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=B(),n=D1(async({phoneNumber:a})=>{if(!a)throw new Error("SMS required to send OTP code");return t(a)},[t]),i=D1(async({code:a})=>{if(e.enabled&&e.status!=="success")throw new mr(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:n,loginWithCode:i,state:o}};import{useContext as hE}from"react";function yE(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:h,linkFarcaster:f}=hE(ye);return De("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:h,linkFarcaster:f}}import{useContext as gE}from"react";function vE(e){let{connectWallet:t}=gE(ye);return De("connectWallet",e),{connectWallet:t}}import{useContext as CE}from"react";function wE(e){let{createWallet:t}=CE(ye);return De("createWallet",e),{createWallet:t}}var bE=()=>{let{fundWallet:e}=B();return{fundWallet:e}};import{useContext as EE}from"react";function TE(e){let{sendTransaction:t}=EE(ye);return De("sendTransaction",e),{sendTransaction:t}}import{useContext as PE}from"react";function SE(e){let{setWalletPassword:t}=PE(ye);return De("setWalletPassword",e),{setWalletPassword:t}}import{useContext as xE}from"react";function kE(e){let{signMessage:t}=xE(ye);return De("signMessage",e),{signMessage:t}}import{useContext as _E}from"react";function AE(e){let{signTypedData:t}=_E(ye);return De("signTypedData",e),{signTypedData:t}}import{useContext as RE}from"react";var IE=()=>{let{isModalOpen:e}=RE(ye);return{isOpen:e}};import{useContext as ME}from"react";function WE(e){let{getAccessToken:t}=ME(ye);return De("accessToken",e),{getAccessToken:t}}function LE(){let{submitCast:e,removeCast:t,likeCast:r,recastCast:o,followUser:n,unfollowUser:i,requestFarcasterSigner:a}=B();return{followUser:n,unfollowUser:i,submitCast:e,removeCast:t,likeCast:r,recastCast:o,requestFarcasterSigner:a}}function OE(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}export{Ar as AsExternalProvider,Sc as Captcha,Wi as ConnectorManager,Li as PrivyClient,iE as PrivyProvider,Ie as PrivyProxyProvider,Ii as SUPPORTED_CHAINS,cc as VERSION,St as WalletConnector,OE as addRpcUrlOverrideToChain,Yc as errorIndicatesMaxMfaRetries,rn as errorIndicatesMfaTimeout,on as errorIndicatesMfaVerificationFailed,he as getAccessToken,vE as useConnectWallet,wE as useCreateWallet,LE as useExperimentalFarcasterSigner,bE as useFundWallet,yE as useLinkAccount,lE as useLogin,mE as useLoginWithEmail,uE as useLoginWithOAuth,fE as useLoginWithSms,dE as useLogout,sa as useMfa,Gr as useMfaEnrollment,IE as useModalStatus,B as usePrivy,_c as useRegisterMfaListener,TE as useSendTransaction,SE as useSetWalletPassword,kE as useSignMessage,AE as useSignTypedData,WE as useToken,va as useWallets};
3003
+ `;import{jsx as it,jsxs as E1}from"react/jsx-runtime";var V7={["LANDING"]:ny,["CONNECT_OR_CREATE"]:ry,["AWAITING_PASSWORDLESS_CODE"]:Bm,["AWAITING_CONNECTION"]:lf,["AWAITING_CONNECT_ONLY_CONNECTION"]:uf,["AWAITING_FARCASTER_CONNECTION"]:gh,["AWAITING_FARCASTER_SIGNER"]:Th,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:Ig,["PHANTOM_INTERSTITIAL_SCREEN"]:Og,["LOGIN_FAILED_SCREEN"]:vy,["AWAITING_OAUTH_SCREEN"]:_g,["ALLOWLIST_REJECTION_SCREEN"]:Rm,["USER_LIMIT_REACHED_SCREEN"]:g1,["INSTALL_PHANTOM_SCREEN"]:Dh,["LINK_EMAIL_SCREEN"]:iy,["LINK_PHONE_SCREEN"]:my,["LINK_WALLET_SCREEN"]:fy,["LINK_PASSKEY_SCREEN"]:py,["UPDATE_EMAIL_SCREEN"]:f1,["CONNECT_ONLY_LANDING_SCREEN"]:rf,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:Xm,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:Af,["EMBEDDED_WALLET_CREATED_SCREEN"]:Ef,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:wf,["EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN"]:Ng,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:$g,["EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN"]:Vg,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:xf,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:s1,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:i1,["FIAT_ON_RAMP_PROMPT_SCREEN"]:Ah,["FIAT_ON_RAMP_STATUS_SCREEN"]:Ih,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:th,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:eh,["EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN"]:qg,["MFA_ENROLLMENT_FLOW_SCREEN"]:Oy,["CAPTCHA_SCREEN"]:zm,["ERROR_SCREEN"]:oh,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:Mh,["AFFIRMATIVE_CONSENT_SCREEN"]:km},z7=["LANDING","AWAITING_CONNECTION"],q7=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=B(),{headless:n}=Mr(),{ready:i,currentScreen:a}=x(),{status:l,execute:s,reset:c,enabled:u}=Ce(),h=B7(null),f=ym(h),y=o&&a&&z7.includes(a)&&!n&&l==="ready";if(b1(()=>{y&&s()},[y]),b1(()=>{!o&&u&&c()},[o,u]),(!r||!i)&&a!=="AWAITING_OAUTH_SCREEN")return E1(ii,{id:"privy-modal-content",children:[it(T,{}),it(X,{}),it(xy,{children:it(Xe,{})}),it(ie,{}),it(q,{})]});if(!a&&e)return it(ii,{style:{height:f},id:"privy-modal-conent",children:it("div",{ref:h,children:it($d,{open:e,onClose:t})})});if(!a)return null;let w=V7[a];return it(ii,{style:{height:f},id:"privy-modal-content",children:E1("div",{ref:h,children:[it(to,{if:!!e,children:it(w,{})}),it(to,{if:!e,children:it($d,{open:e,onClose:t})})]})})},$7=()=>{let{closePrivyModal:e}=M(),{onUserCloseViaDialogOrKeybindRef:t}=x();return{gracefulClosePrivyModal:U7(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},T1=({open:e})=>{let{app:t}=x(),{gracefulClosePrivyModal:r}=$7(),[o,n]=H7(!1);_c({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=it(w1,{children:it(q7,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})}),a=e||o,l=t?.render.inDialog?it(Sy,{open:a,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:i}):i;if(typeof window<"u"&&t?.render.inParentNodeId){let s=document.getElementById(t.render.inParentNodeId);if(s)return G7.createPortal(l,s)}return l};import{useState as K7}from"react";import{useEffect as P1,useRef as S1}from"react";var Ql=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:connect":return o;case"privy:wallet:recover":return o;case"privy:wallet:rpc":return o;case"privy:wallet:set-recovery-password":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:submit-cast":return o;case"privy:farcaster:remove-cast":return o;case"privy:farcaster:react-to-cast":return o;case"privy:farcaster:submit-link":return o;case"privy:farcaster:remove-link":return o;default:throw new Error(`invalid wallet event type ${t}`)}}};async function Oo(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 xe("missing_or_invalid_mfa","MFA verification failed, retry."));let h=await new Promise((f,y)=>{r.current={resolve:f,reject:y};let w=1e3*60*5;setTimeout(()=>{let v=new xe("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(v),y(v)},w)});return await e(h)}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(h){if(h.type==="missing_or_invalid_mfa")a=!0;else throw o.current?.resolve(void 0),h}if(c===null){let u=new xe("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(u),u}return c}import{jsx as X7}from"react/jsx-runtime";var j7=function(e){return()=>`id-${e++}`}(0);function Y7(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function at(e){return e.error!==void 0}var Ye=new Ql,tp=new Map,Z7=(e,t)=>typeof t=="bigint"?t.toString():t,J7=(e,t)=>`${e}${JSON.stringify(t,Z7)}`;function st(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let i=J7(e,t);if(e==="privy:wallet:create"){let l=tp.get(i);if(l)return l}let a=new Promise((l,s)=>{let c=j7();Ye.enqueue(c,{resolve:l,reject:s}),n.postMessage({id:c,event:e,data:t},o)}).finally(()=>{tp.delete(i)});return tp.set(i,a),a}function Q7(e){switch(e.event){case"privy:iframe:ready":let t=Ye.dequeue(e.event,e.id);return at(e)?t.reject(new xe(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=Ye.dequeue(e.event,e.id);return at(e)?r.reject(new xe(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:connect":let o=Ye.dequeue(e.event,e.id);return at(e)?o.reject(new xe(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:recover":let n=Ye.dequeue(e.event,e.id);return at(e)?n.reject(new xe(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:rpc":let i=Ye.dequeue(e.event,e.id);return at(e)?i.reject(new xe(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:set-recovery-password":let a=Ye.dequeue(e.event,e.id);return at(e)?a.reject(new xe(e.error.type,e.error.message)):a.resolve(e.data);case"privy:mfa:verify":let l=Ye.dequeue(e.event,e.id);return at(e)?l.reject(new xe(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:init-enrollment":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:submit-enrollment":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:unenroll":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:mfa:clear":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:init-signer":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:submit-cast":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:remove-cast":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:react-to-cast":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:submit-link":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}case"privy:farcaster:remove-link":{let s=Ye.dequeue(e.event,e.id);return at(e)?s.reject(new xe(e.error.type,e.error.message)):s.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function x1(e){let t=S1(null),r=S1(e.mfaMethods),o=Os(),[n,i]=K7(!1);return P1(()=>{r.current=e.mfaMethods},[e.mfaMethods]),P1(()=>{if(!n)return;let a=t.current;if(!a)return;function l(f){f&&f.origin===e.origin&&Y7(f.data)&&Q7(f.data)}let s={create(f){return st("privy:wallet:create",f,a,e.origin)},connect(f){return st("privy:wallet:connect",f,a,e.origin)},recover(f){return Oo(y=>st("privy:wallet:recover",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},rpc(f){return Oo(y=>st("privy:wallet:rpc",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},setRecoveryPassword(f){return Oo(y=>st("privy:wallet:set-recovery-password",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(f){return Oo(y=>st("privy:mfa:verify",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(f){return Oo(y=>st("privy:mfa:init-enrollment",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(f){return Oo(y=>st("privy:mfa:submit-enrollment",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(f){return Oo(y=>st("privy:mfa:unenroll",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(f){return st("privy:mfa:clear",f,a,e.origin)},initFarcasterSigner(f){return st("privy:farcaster:init-signer",f,a,e.origin)},submitCast(f){return st("privy:farcaster:submit-cast",f,a,e.origin)},removeCast(f){return st("privy:farcaster:remove-cast",f,a,e.origin)},reactToCast(f){return st("privy:farcaster:react-to-cast",f,a,e.origin)},submitLink(f){return st("privy:farcaster:submit-link",f,a,e.origin)},removeLink(f){return st("privy:farcaster:remove-link",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()},h=new AbortController;return ou(()=>st("privy:iframe:ready",{},a,e.origin),{abortSignal:h.signal}).then(c,u),()=>{window.removeEventListener("message",l),h.abort()}},[n]),X7("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>i(!0),src:Va(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId})})}function Xl(e){let t=e.toLowerCase();return["fbav","fban","instagram","snapchat"].some(o=>t.includes(o))}async function k1({url:e,popup:t}){return t.location=e,new Promise((o,n)=>{function i(){t?.close(),window.removeEventListener("message",a)}function a(l){l.data&&(l.data.type==="PRIVY_OAUTH_RESPONSE"?(o(l.data),i()):l.data.type==="PRIVY_OAUTH_ERROR"&&(n(l.data.error),i()))}window.addEventListener("message",a)})}var _1=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});import{jsx as $r,jsxs as A1}from"react/jsx-runtime";var No;function rE(e){return typeof e=="string"&&e.length===25}function he(){if(!No){let e=Y.get(Uo);return Promise.resolve(e||null)}return No.getAccessToken()}var R1,Su=(e,t)=>R1(e,t),I1,xu=(e,t)=>I1(e,t),M1,ku=(e,t)=>M1(e,t),W1,_u=()=>W1(),oE=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;Y.put(Ei,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},nE=({config:e,...t})=>{if(!rE(t.appId))throw new E("Cannot initialize the Privy provider with an invalid Privy app ID");No||(No=new Li({appId:t.appId,apiUrl:t.apiUrl||Fa}));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."),$r(im,{client:No,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:$r(iE,{...t,client:No})})},iE=e=>{let t=e.client,[r,o]=Ge(!1),[n,i]=Ge(!1),[a,l]=Ge(!1),[s,c]=Ge(null),[u,h]=Ge([]),f=vi(u),[y,w]=Ge(!1),[v,k]=Ge(null),[S,C]=Ge(!1),[R,P]=Ge({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:b}),[O,_]=Ge({status:"initial"}),[F,K]=Ge(null),[V,H]=Ge(null),[I,Q]=Ge(null),D=Mr(),pe=Is(),[me,ae]=Ge(!0),[Ee,J]=Ge({}),[jt,Lt]=Ge(null),[Yt,lt]=Ge(null),[Sr,Le]=Ge(!1),[hn,xr]=Ge(!1),Pt=vi(null),Fe=vi(null),L=vi(gm);t.onStoreToken=d=>{d&&N(L,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{c(null),l(!1),N(L,"accessToken","onAccessTokenRemoved")};let oe=vi(null),G=vi(null),fe=d=>{k(d),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:d}})},Zt=d=>{D.embeddedWallets.createOnLogin!=="off"&&ae(!0),fe(d)};Pr(()=>{let d=()=>{document.visibilityState==="hidden"&&t.createAnalyticsEvent({eventName:"page_hidden",options:{keepAlive:!0}})};return document.addEventListener("visibilitychange",d),()=>{document.removeEventListener("visibilitychange",d)}},[]),Pr(()=>{if(!s){t.connectors?.removeEmbeddedWalletConnector();return}let d=s.linkedAccounts.find(p=>p.type==="wallet"&&p.walletClientType==="privy");if(!d){t.connectors?.removeEmbeddedWalletConnector();return}if(!t.connectors){console.warn("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!I){console.warn("Failed to add embedded wallet connector: Wallet proxy not initialized");return}t.connectors.addEmbeddedWalletConnector(I,d.address,D.defaultChain,e.appId)},[I,s]),Pr(()=>{I&&Yt?.(I)},[I]),Pr(()=>{(async()=>{if(!D.customAuth?.enabled)return;ae(!0);let{getCustomAccessToken:p,isLoading:m}=D.customAuth;if(!(!n||m))try{let g=await p();if(!g&&a){await yn.logout();return}if(!g||a)return;t.startAuthFlow(new gn(g));let{user:A,isNewUser:U}=await t.authenticate();if(!A){await yn.logout();return}c(A||null),w(U||!1),l(!0),xr(!0)}catch(g){console.warn(g),a&&await yn.logout()}})()},[D.customAuth?.enabled,D.customAuth?.getCustomAccessToken,D.customAuth?.isLoading,n,a]),Pr(()=>{hn&&I&&s&&tr(s,D.embeddedWallets.createOnLogin)&&(xr(!1),bi(s,vn).catch(console.error))},[hn&&I&&s]),Pr(()=>{async function d(){let p=Do();oE();let m=eE();K(m),t.initializeConnectorManager({walletConnectCloudProjectId:D.walletConnectCloudProjectId,rpcConfig:D.rpcConfig,chains:D.chains,defaultChain:D.defaultChain,store:m,walletList:D.appearance.walletList,shouldEnforceDefaultChainOnConnect:D.shouldEnforceDefaultChainOnConnect,appName:D.name??"Privy"}),t.connectors?.initialize().then(()=>{Sa()});let g=await t.getAuthenticatedUser();D.customAuth?.enabled||(l(!!g),g&&N(L,"login","onComplete",g,!1,!0,null,null),c(g)),p||ue.setReadyToTrue(!!g),p&&(g?G.current="link":G.current="login")}!n&&pe&&d()},[t,jt,n,pe]),Pr(()=>{if(!n)return;if(!s){Le(!0);return}if(!!!s.linkedAccounts.find(m=>m.type==="wallet"&&m.walletClientType==="privy")){Le(!0);return}let p=!!u.find(m=>m.walletClientType==="privy");Le(p)},[n,s,u]);let Do=()=>{let d=_i();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 _r(d)),Zt("AWAITING_OAUTH_SCREEN"),!0)},ht=async(d,p,m,g)=>{let A=await t.connectors?.createWalletConnector(d,p)||null;Ci(A,p,m,g)};async function Ci(d,p,m,g){if(d)P({status:"disconnected",connectedWallet:null,connectError:null,connector:d,connectRetry:b});else return P({status:"disconnected",connectedWallet:null,connectError:new ee("Unable to connect to wallet."),connector:null,connectRetry:b}),g?.(null,m);d instanceof Wr&&p&&await d.resetConnection(p),P({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Ci(d,p,m,g)});try{let A=await d.connect({showPrompt:!0});if(D.shouldEnforceDefaultChainOnConnect&&!D.chains.find(U=>U.id===Number(A?.chainId))&&!(A?.connectorType==="wallet_connect_v2"&&A?.walletClientType==="metamask")){P(U=>({...U,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:b}));try{await A?.switchChain(D.defaultChain.id),A&&(A.chainId=wn(zo(D.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${D.defaultChain.id}`)}}return P(U=>({...U,status:"connected",connectedWallet:A,connectError:null,connectRetry:b})),A&&!G.current&&N(L,"connectWallet","onSuccess",A),g?.(A,m)}catch(A){return A instanceof Ue?(console.warn(A.cause?A.cause:A.message),G.current||N(L,"connectWallet","onError",A.privyErrorCode||"generic_connect_wallet_error")):(console.warn(A),G.current||N(L,"connectWallet","onError","unknown_connect_wallet_error")),P(U=>({...U,status:"disconnected",connectedWallet:null,connectError:A})),g?.(null,m)}}let Kr=async(d,p)=>{if(d===null)return;let m=new Ko(d,p);t.startAuthFlow(m)},Sa=()=>{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"&&!fo()&&Zt("LOGIN_FAILED_SCREEN"),!t.connectors)throw new E("Connector not initialized");fe("AWAITING_CONNECTION");let g=new URL(window.location.href);g.searchParams.delete("privy_connector"),g.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",g),ht(p,m,void 0,Kr)};Pr(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let Ze=()=>{if(!a)throw N(L,"linkAccount","onError","must_be_authenticated"),new E("User must be authenticated before linking an account.")},xa=()=>{Ze(),oe.current="siwe",G.current="link",fe("LINK_WALLET_SCREEN")},wi=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},Fo=async d=>{if(!t.connectors)throw new E("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(P(m=>({...m,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:b})),D.captchaEnabled&&!a){let m={callback:g=>Kr(d,g),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};J({captchaModalData:m}),Zt("CAPTCHA_SCREEN")}else await Kr(d),Zt("AWAITING_CONNECTION")},Ve=async(d,p)=>{if(!D.fiatOnRamp.enabled)throw new E("Fiat on-ramp is not enabled");if(!p||!p.provider||p.provider==="moonpay"){let{signedUrl:m,externalTransactionId:g}=await kh(t,d,p?.config??{},D.appearance.palette,D.fiatOnRamp.useSandbox);return{signedUrl:m,externalTransactionId:g}}else throw new E("Unsupported fund provider. Currently supported option is `moonpay`.")},ct=()=>{h(d=>{let p=t.connectors?.wallets.map(m=>({...m,linked:wi(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");Fo(m)},fund:async g=>{let{signedUrl:A,externalTransactionId:U}=await Ve(m.address,g);J({fiatOnRampPrompt:{signedUrl:A},fiatOnRampStatus:{externalTransactionId:U}}),fe("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 g=await t.unlinkWallet(m.address);c(g)}}))||[];return ds(d,p)?d:p})};Pr(()=>{ct()},[s?.linkedAccounts,a,n]),Pr(()=>{if(n){if(!t.connectors)throw new E("Connector not initialized");ct(),t.connectors.on("walletsUpdated",ct)}},[n]);let jr=()=>{fe(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};Pr(()=>{if(!u[0])return;let d=u[0],p=f.current.find(g=>g.address===d.address),m;if(d.walletClientType==="privy"?m=s?.linkedAccounts.find(g=>g.type==="wallet"&&g.address===d.address&&g.walletClientType==="privy"):m=s?.linkedAccounts.find(g=>g.type==="wallet"&&g.address===d.address&&g.walletClientType!=="privy"),!p&&m){let g=Object.assign({},s);g.wallet=m&&{address:m.address,chainType:m.chainType,chainId:m.chainId,walletClient:m.walletClient,walletClientType:m.walletClientType,connectorType:m.connectorType},c(g)}f.current=u},[u]);let bi=async(d,p)=>{if(Se(d))throw N(L,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[g,A]=await Promise.all([ue.initializeWalletProxy(p),he()]);if(!g&&D.customAuth?.enabled)throw N(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!g||!A||D.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((U,j)=>{ae(!0),J({createWallet:{onSuccess:Je=>{N(L,"createWallet","onSuccess",Je),U(Je)},onFailure:Je=>{N(L,"createWallet","onError","unknown_embedded_wallet_error"),j(Je)},callAuthOnSuccessOnClose:!1}}),fe("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await g.create({accessToken:A});let U=await ue.refreshUser(),j=Se(U);if(!j)throw N(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return N(L,"createWallet","onSuccess",j),j}},Yr=d=>{if(!D.chains.map(p=>p.id).includes(d))throw new ee(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},ka=(d,p,m)=>new Promise(async(g,A)=>{if(!a||!s){N(L,"sendTransaction","onError","must_be_authenticated"),A(new Error("User must be authenticated before signing with a Privy wallet"));return}let U=Se(s);if(!U){N(L,"sendTransaction","onError","embedded_wallet_not_found"),A(new Error("Must have a Privy wallet before signing"));return}ae(!0);let j=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,ze=d.chainId?Number(d.chainId):j.chainId;Yr(ze);let Je=Object.assign({},d,{chainId:ze}),Qt=async()=>{let _e=await he();if(!_e||!I){N(L,"sendTransaction","onError","embedded_wallet_not_found"),A(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await ue.recoverEmbeddedWallet()){N(L,"sendTransaction","onError","unknown_connect_wallet_error"),A(new Error("Unable to connect to wallet"));return}let yt=Jr(Je.chainId,D.chains,D.rpcConfig,{appId:e.appId}),tc=await ui(U.address,Je,yt);if(D.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:F1}=await pi(tc,yt),{hasSufficientFunds:U1}=await Gl(U.address,tc,F1,yt);if(!U1)throw new Ne(new Nt("Wallet has insufficient funds for this transaction.",Qe.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let np=await Hl(_e,U.address,I,tc,yt);N(L,"sendTransaction","onSuccess",np),g(np)}catch(Ot){N(L,"sendTransaction","onError","transaction_failure"),A(Ot)}};if(D.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),Qt();else{let _e={transactionRequest:Je,onSuccess:yt=>{N(L,"sendTransaction","onSuccess",yt),g(yt)},onFailure:yt=>{N(L,"sendTransaction","onError","transaction_failure"),A(yt)},uiOptions:p||{},fundWalletConfig:m},Ot={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:yt=>{N(L,"sendTransaction","onError","unknown_connect_wallet_error"),A(yt)}};J({connectWallet:Ot,sendTransaction:_e}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function op(){return new Promise(async(d,p)=>{let m=await he();if(!m||!I)throw new Error("Must have valid access token to enroll in MFA");try{await I.verifyMfa({accessToken:m}),d()}catch(g){p(g)}})}let Jt=d=>{if(d==="passkey"){if(s&&s.linkedAccounts.filter(p=>p.type==="passkey").length>=5)throw N(L,"linkAccount","onError","cannot_link_more_of_type"),new E(`User already has an account of type ${d} linked.`)}else if(s?.[d])throw N(L,"linkAccount","onError","cannot_link_more_of_type"),new E(`User already has an account of type ${d} linked.`)},yn={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:jr,linkWallet:xa,linkEmail:()=>{Ze(),Jt("email"),oe.current="email",G.current="link",fe("LINK_EMAIL_SCREEN")},linkPhone:()=>{Ze(),Jt("phone"),oe.current="sms",G.current="link",fe("LINK_PHONE_SCREEN")},linkGoogle:async()=>{Ze(),Jt("google"),G.current="link",await ue.initLoginWithOAuth("google")},linkTwitter:async()=>{Ze(),Jt("twitter"),G.current="link",await ue.initLoginWithOAuth("twitter")},linkDiscord:async()=>{Ze(),Jt("discord"),G.current="link",await ue.initLoginWithOAuth("discord")},linkGithub:async()=>{Ze(),Jt("github"),G.current="link",await ue.initLoginWithOAuth("github")},linkSpotify:async()=>{Ze(),Jt("spotify"),G.current="link",await ue.initLoginWithOAuth("spotify")},linkTiktok:async()=>{Ze(),Jt("tiktok"),G.current="link",await ue.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{Ze(),Jt("linkedin"),G.current="link",await ue.initLoginWithOAuth("linkedin")},linkApple:async()=>{Ze(),Jt("apple"),G.current="link",await ue.initLoginWithOAuth("apple")},linkPasskey:async()=>{Ze(),Jt("passkey"),await ue.initLinkWithPasskey(),fe("LINK_PASSKEY_SCREEN")},linkFarcaster:async()=>{Ze(),Jt("farcaster"),await ue.initLoginWithFarcaster(),G.current="link",oe.current="farcaster",fe("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(Ze(),!s?.email)throw new E("User does not have an email linked to their account.");G.current="link",oe.current="email",fe("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=>{Lt(g=>m.bind(g))});if(Lt(null),p){console.warn(d);return}}if(a){console.warn(d);return}G.current="login",Zt("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{Lt(()=>d)}),Lt(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}Zt("CONNECT_OR_CREATE")},logout:async()=>{if(await t.logout(),s&&I)try{await I.clearMfa({userId:s.id})}catch{}c(null),l(!1),k(null),N(L,"logout","onSuccess"),G.current=null,oe.current=null,o(!1),Y.del(Ti)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new Ie;let d=u.find(m=>s.wallet&&m.address===s.wallet.address),p=t.connectors?.walletConnectors.find(m=>m.wallets.find(g=>g.address===d?.address));return!d||!p?new Ie:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new rp(new Ar(new Ie));let d=u.find(m=>s.wallet&&m.address===s.wallet.address),p=t.connectors?.walletConnectors.find(m=>m.wallets.find(g=>g.address===d?.address));return!d||!p?new rp(new Ar(new Ie)):new rp(new Ar(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new go(new Ie);let d=u.find(m=>s.wallet&&m.address===s.wallet.address),p=t.connectors?.walletConnectors.find(m=>m.wallets.find(g=>g.address===d?.address));return!d||!p?new go(new Ie):new go(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},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},unlinkPasskey:async d=>{let p=await t.unlinkPasskey(d);return c(p),p},setActiveWallet:async d=>{let p=u.find(g=>ec(g.address)===ec(d)),m=s?.linkedAccounts.find(g=>g.type==="wallet"&&ec(g.address)===ec(d));if(!p||!await p.isConnected())H(d),xa();else if(!p.linked)p.loginOrLink();else{let g=Object.assign({},s);g.wallet=m&&{address:m.address,chainType:m.chainType,chainId:m.chainId,walletClient:m.walletClient,walletClientType:m.walletClientType,connectorType:m.connectorType},c(g)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw N(L,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return bi(s,15e3)},setWalletPassword:async()=>{if(!a||!s)throw N(L,"setWalletPassword","onError","must_be_authenticated"),new Error("User must be authenticated before adding password to Privy wallet");let d=Se(s);if(!d||!I)throw N(L,"setWalletPassword","onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a password");if(d.recoveryMethod==="user-passcode")throw N(L,"setWalletPassword","onError","embedded_wallet_password_already_exists"),new Error("Cannot set password. Embedded wallet already has a password.");try{await op()}catch(p){throw N(L,"setWalletPassword","onError","missing_or_invalid_mfa"),p}return new Promise((p,m)=>{ae(!0);let g={onSuccess:U=>{N(L,"setWalletPassword","onSuccess",U),p(U)},onFailure:U=>{N(L,"setWalletPassword","onError","user_exited_set_password_flow"),m(U)},callAuthOnSuccessOnClose:!1},A={onCompleteNavigateTo:"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",onFailure:U=>{N(L,"setWalletPassword","onError","unknown_connect_wallet_error"),m(U)}};J({setWalletPassword:g,connectWallet:A}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")})},signMessage:(d,p)=>new Promise(async(m,g)=>{if(!a||!s){N(L,"signMessage","onError","must_be_authenticated"),g(new Error("User must be authenticated before signing with a Privy wallet"));return}let A=Se(s);if(!A){N(L,"signMessage","onError","embedded_wallet_not_found"),g(new Error("Must have a Privy wallet before signing"));return}if(typeof d!="string"||d.length<1){N(L,"signMessage","onError","invalid_message"),g(new Error("Message must be a non-empty string"));return}ae(!0);let U=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let j=await he();if(!I||!j)throw new Error("Unable to connect to wallet");if(!await ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:A.address}});let{response:Je}=await I.rpc({accessToken:j,address:A.address,request:{method:"personal_sign",params:[d,A.address]}}),Qt=Je.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:A.address}}),Qt};if(D.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let j=await U();N(L,"signMessage","onSuccess",j),m(j)}catch(j){N(L,"signMessage","onError","unable_to_sign"),g(j??new Ne("Unable to sign message"))}}else{let Je={method:"personal_sign",data:d,confirmAndSign:U,onSuccess:_e=>{N(L,"signMessage","onSuccess",_e),m(_e)},onFailure:_e=>{N(L,"signMessage","onError","unable_to_sign"),g(_e)},uiOptions:p||{}},Qt={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:_e=>{N(L,"signMessage","onError","unknown_connect_wallet_error"),g(_e)}};J({signMessage:Je,connectWallet:Qt}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(m,g)=>{if(!a||!s){N(L,"signTypedData","onError","must_be_authenticated"),g(new Error("User must be authenticated before signing with a Privy wallet"));return}let A=Se(s);if(!A){N(L,"signTypedData","onError","embedded_wallet_not_found"),g(new Error("Must have a Privy wallet before signing"));return}ae(!0);let U=qa(d),j=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let ze=await he();if(!I||!ze)throw new Error("Unable to connect to wallet");if(!await ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:A.address}});let{response:Qt}=await I.rpc({accessToken:ze,address:A.address,request:{method:"eth_signTypedData_v4",params:[A.address,U]}}),_e=Qt.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:A.address}}),_e};if(D.embeddedWallets.noPromptOnSignature||(D.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ze=await j();N(L,"signTypedData","onSuccess",ze),m(ze)}catch(ze){N(L,"signTypedData","onError","unable_to_sign"),g(ze??new Ne("Unable to sign message"))}}else{let Qt={method:"eth_signTypedData_v4",data:U,confirmAndSign:j,onSuccess:Ot=>{N(L,"signTypedData","onSuccess",Ot),m(Ot)},onFailure:Ot=>{N(L,"signTypedData","onError","unable_to_sign"),g(Ot)},uiOptions:p||{}},_e={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Ot=>{N(L,"signMessage","onError","unknown_connect_wallet_error"),g(Ot)}};J({signMessage:Qt,connectWallet:_e}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,m)=>{let A=await(await ka(d,p,m)).wait();return Vl(A)},exportWallet:()=>new Promise(async(d,p)=>{if(!a||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}if(!Se(s)){p(new Error("Must have a Privy wallet before exporting"));return}ae(!0);let g={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p,shouldForceMFA:!0};if(J(Ee),!await he()||!I){p(new Error("Must have valid access token to enroll in MFA"));return}if(!I){p(new Error("Must have a Privy wallet before exporting"));return}let U={appId:e.appId,origin:t.apiUrl,onSuccess:d,onFailure:p};J({keyExport:U,connectWallet:g}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:op,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");Pt.current?.resolve({mfaMethod:d,mfaCode:p,relyingParty:window.origin}),await new Promise((U,j)=>{Fe.current={resolve:U,reject:j}});break;case"passkey":if(typeof p=="string")throw new E("Invalid authenticator response");let g=await(await import("@simplewebauthn/browser")).startAuthentication(p),A=_1(g);Pt.current?.resolve({mfaMethod:d,mfaCode:A,relyingParty:window.origin}),await new Promise((U,j)=>{Fe.current={resolve:U,reject:j}});break;default:throw Pt.current?.reject(new E("Unsupported MFA method")),new E(`Unsupported MFA method: ${d}`)}},cancel(){Pt.current?.reject(new E("MFA canceled"))},async initEnrollmentWithSms(d){let p=await he();if(!p||!I)throw new Error("Must have valid access token to enroll in MFA");await I.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber})},enrollInMfa(d){return new Promise((p,m)=>{if(!d){ue.closePrivyModal(),p();return}D.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."),J({mfaEnrollmentFlow:{mfaMethods:D.mfa.methods,onSuccess:p,onFailure:m}}),fe("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await he();if(!d||!I)throw new Error("Must have valid access token to enroll in MFA");let p=await I.initEnrollMfa({method:"totp",accessToken:d});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(d){let p=await he();if(!p||!I)throw new Error("Must have valid access token to enroll in MFA");await I.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber,code:d.mfaCode});let m=await t.getAuthenticatedUser();c(m)},async submitEnrollmentWithTotp(d){let p=await he();if(!p||!I)throw new Error("Must have valid access token to enroll in MFA");await I.submitEnrollMfa({method:"totp",accessToken:p,code:d.mfaCode});let m=await t.getAuthenticatedUser();c(m)},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:d}){let p=await he();if(!p||!I)throw new Error("Must have valid access token to enroll in MFA");await I.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:d});let m=await t.getAuthenticatedUser();c(m)},async unenroll(d){let p=await he();if(!p||!I)throw new Error("Must have valid access token to remove MFA");d==="passkey"?await I.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:[]}):await I.unenrollMfa({method:d,accessToken:p});let m=await t.getAuthenticatedUser();c(m)},requestFarcasterSigner:async()=>{let d=await he(),p=s?.linkedAccounts.find(A=>A.type==="wallet"&&A.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!I||!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 ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");let g=await I.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:d,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(g.status==="approved"){let A=await t.getAuthenticatedUser();c(A||s||null)}J({farcasterSigner:g}),fe("AWAITING_FARCASTER_SIGNER")},submitCast:async d=>{let p=await he(),m=s?.linkedAccounts.find(U=>U.type==="wallet"&&U.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!I||!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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await I.submitCast({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:d,fid:BigInt(s.farcaster.fid),relyingParty:window.origin})).response.hash}},removeCast:async({castHash:d})=>{let p=await he(),m=s?.linkedAccounts.find(U=>U.type==="wallet"&&U.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!I||!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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await I.removeCast({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:d,fid:BigInt(s.farcaster.fid),relyingParty:window.origin})).response.hash}},likeCast:async({castHash:d,castAuthorFid:p})=>{let m=await he(),g=s?.linkedAccounts.find(j=>j.type==="wallet"&&j.walletClientType==="privy");if(!m)throw new Error("Must have valid access token to connect with Farcaster");if(!I||!g)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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await I.reactToCast({address:g.address,hdWalletIndex:null,accessToken:m,mfaCode:null,mfaMethod:null,payload:{type:1,castId:{hash:d,fid:p}},fid:BigInt(s.farcaster.fid)})).response.hash}},recastCast:async({castHash:d,castAuthorFid:p})=>{let m=await he(),g=s?.linkedAccounts.find(j=>j.type==="wallet"&&j.walletClientType==="privy");if(!m)throw new Error("Must have valid access token to connect with Farcaster");if(!I||!g)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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await I.reactToCast({address:g.address,hdWalletIndex:null,accessToken:m,mfaCode:null,mfaMethod:null,payload:{type:2,castId:{hash:d,fid:p}},fid:BigInt(s.farcaster.fid)})).response.hash}},followUser:async({fid:d})=>{let p=await he(),m=s?.linkedAccounts.find(U=>U.type==="wallet"&&U.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!I||!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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await I.submitLink({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{type:"follow",targetFid:d},fid:BigInt(s.farcaster.fid)})).response.hash}},unfollowUser:async({fid:d})=>{let p=await he(),m=s?.linkedAccounts.find(U=>U.type==="wallet"&&U.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!I||!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(!s?.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster embedded signer write to Farcaster");if(!await ue.recoverEmbeddedWallet())throw new Error("Unable to connect to wallet");return{hash:(await I.removeLink({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{type:"follow",targetFid:d},fid:BigInt(s.farcaster.fid)})).response.hash}},isHeadlessOAuthLoading:S,loginWithCode(d){return ue.loginWithCode(d)},initLoginWithEmail(d){return ue.initLoginWithEmail(d)},initLoginWithSms(d){return ue.initLoginWithSms(d)},otpState:O,fundWallet(d,p){return ue.fundWallet(d,p)},initLoginWithHeadlessOAuth(d,p){return ue.initLoginWithHeadlessOAuth(d,p)},loginWithHeadlessOAuth(d){return ue.loginWithHeadlessOAuth(d)},isModalOpen:r};R1=yn.signMessage,I1=yn.signTypedData,M1=async(...d)=>{let p=await ka(...d);return D.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let ue=(()=>({isNewUserThisSession:y,linkingHint:V,pendingTransaction:null,walletConnectionStatus:R,mipdStore:F,connectors:t.connectors?.walletConnectors??[],rpcConfig:D.rpcConfig,chains:D.chains,appId:e.appId,showFiatPrices:D.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>D.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(I)return I;let p=new Promise(A=>{lt(()=>U=>A(U))}),m=new Promise(A=>setTimeout(()=>A(null),d)),g=await Promise.race([p,m]);return lt(null),g},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(d={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s,m;p&&oe.current&&(m=s?.linkedAccounts.filter(g=>g.latestVerifiedAt!==null&&!(g.type==="wallet"&&g.walletClientType==="privy")).sort((g,A)=>A.latestVerifiedAt.getTime()-g.latestVerifiedAt.getTime())[0]),G.current==="login"&&oe.current?d.shouldCallAuthOnSuccess&&p?(N(L,"login","onComplete",s,y,!1,oe.current,m??null),e.onSuccess?.(s,y)):N(L,"login","onError","exited_auth_flow"):G.current==="link"&&oe.current&&m&&(d.isSuccess&&p?N(L,"linkAccount","onSuccess",s,oe.current,m):N(L,"linkAccount","onError","exited_link_flow")),H(null),G.current=null,oe.current=null,w(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},openPrivyModal:fe,connectWallet:Ci,initLoginWithWallet:async(d,p)=>{oe.current="siwe",Kr(d,p)},loginWithWallet:async()=>{if(!n)throw new uo;if(!(t.authFlow instanceof Ko))throw new E("Must initialize SIWE flow first.");let d,p;if(a)try{d=await t.link(),oe.current="siwe"}catch(m){throw N(L,"linkAccount","onError",m.privyErrorCode||"failed_to_link_account"),m}else try{({user:d,isNewUser:p}=await t.authenticate()),oe.current="siwe"}catch(m){throw N(L,"login","onError",m.privyErrorCode||"generic_connect_wallet_error"),m}c(d||s||null),w(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new Pi(d);t.startAuthFlow(p);try{oe.current="farcaster",await p.initializeFarcasterConnect()}catch(m){throw G.current==="login"?N(L,"login","onError",m.privyErrorCode||"unknown_auth_error"):G.current==="link"&&N(L,"linkAccount","onError",m.privyErrorCode||"unknown_auth_error"),m}},loginWithFarcaster:async()=>{if(!n)throw new uo;if(!(t.authFlow instanceof Pi))throw new E("Must initialize Farcaster flow first.");let d,p;if(a)try{d=await t.link(),oe.current="farcaster"}catch(m){throw N(L,"linkAccount","onError",m.privyErrorCode||"failed_to_link_account"),m}else try{({user:d,isNewUser:p}=await t.authenticate()),oe.current="farcaster"}catch(m){throw N(L,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}c(d||null),w(p||!1),l(!0)},async initLoginWithOAuth(d,p){if(oe.current=d,ic()){if(d==="google"&&Xl(window.navigator.userAgent)){Zt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{Zt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}Y.del(Go);let m=new _r({provider:d});p&&m.addCaptchaToken(p),t.startAuthFlow(m);let g=await t.authFlow.getAuthorizationUrl();g&&g.url&&window.location.assign(g.url)},async recoveryOAuthFlow(d,p,m){let{url:g,codeVerifier:A,stateCode:U}=await yf({api:No.api,provider:d});if(!g)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:d}}),new E("Recovery OAuth failed");let j,ze;try{let _e=await k1({url:g,popup:m});if(j=_e.stateCode,ze=_e.authorizationCode,j!==U)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:U??"",returnedStateCode:j??""}}),new E("Unexpected auth flow. This may be a phishing attempt.")}catch(_e){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:_e.toString(),provider:d}}),new E("Recovery OAuth failed")}let[Je,Qt]=await Promise.all([he(),gf({api:No.api,provider:d,codeVerifier:A,stateCode:j,authorizationCode:ze})]);if(!I)throw new E("Cannot connect to wallet proxy");switch(p){case"recover":let _e=Ee.recoverWallet?.privyWallet?.address;if(!_e)throw new E("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:_e,recoveryMethod:d}}),await I.recover({address:_e,accessToken:Je,recoveryAccessToken:Qt,recoveryMethod:d}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:_e,recoveryMethod:d}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await I.create({accessToken:Je,recoveryAccessToken:Qt,recoveryMethod:d});let Ot=await ue.refreshUser(),yt=Se(Ot);if(!yt)throw N(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:yt.address}}),N(L,"createWallet","onSuccess",yt);break;default:throw new E("Unsupported recovery action")}},async loginWithOAuth(d){if(!(t.authFlow instanceof _r))throw new E("Must initialize OAuth flow before calling loginWithOAuth");let p=Y.get(Bo),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 g,A,U;if(a)try{g=await t.link(),oe.current=d}catch(j){throw N(L,"linkAccount","onError",j.privyErrorCode||"failed_to_link_account"),j}else try{let j=await t.authenticate();g=j.user,A=j.isNewUser,U=j.oAuthProviderTokens,oe.current=d}catch(j){throw G.current==="login"?N(L,"login","onError",j.privyErrorCode||"unknown_auth_error"):G.current==="link"&&N(L,"linkAccount","onError",j.privyErrorCode||"failed_to_link_account"),j}return c(g),w(A||!1),l(!0),U},async initLoginWithPasskey(d){let p=new $o(d);t.startAuthFlow(p),G.current="login";try{oe.current="passkey",await p.initAuthenticationFlow()}catch(m){throw N(L,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}},async loginWithPasskey(){if(!n)throw new uo;if(!(t.authFlow instanceof $o))throw new E("Must initialize Passkey flow first.");if(oe.current!=="passkey")throw new E("Must init login with Passkey flow first.");let d,p;try{oe.current="passkey",{user:d,isNewUser:p}=await t.authenticate()}catch(m){throw N(L,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}c(d),w(p||!1),l(!0)},async initLinkWithPasskey(d){let p=new $o(d);t.startAuthFlow(p),G.current="link",oe.current="passkey";try{await p.initLinkFlow()}catch(m){throw N(L,"linkAccount","onError",m.privyErrorCode||"unknown_auth_error"),m}},async linkWithPasskey(){if(!n)throw new uo;if(!(t.authFlow instanceof $o))throw new E("Must initialize Passkey flow first.");if(oe.current!=="passkey")throw new E("Must init login with Passkey flow first.");let d;try{oe.current="passkey",d=await t.link()}catch(p){throw N(L,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account"),p}c(d||s||null)},async initLoginWithHeadlessOAuth(d,p){if(ic()){if(d==="google"&&Xl(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 _r({provider:d,headless:!0});p&&m.addCaptchaToken(p);let g=await t.startAuthFlow(m).getAuthorizationUrl();g?.url&&window.location.assign(g.url)},async loginWithHeadlessOAuth(d){C(!0),t.startAuthFlow(new _r(d));let p=Y.get(Bo),m=d.stateCode;if(p!==m)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d.provider,storedStateCode:p??"",returnedStateCode:m??""}}),C(!1),new E("Unexpected auth flow. This may be a phishing attempt.");let g,A;if(a)try{g=await t.link(),oe.current=d.provider}catch(U){throw N(L,"linkAccount","onError",U.privyErrorCode||"failed_to_link_account"),U}else try{({user:g,isNewUser:A}=await t.authenticate()),oe.current=d.provider}catch(U){throw G.current==="login"?N(L,"login","onError",U.privyErrorCode||"unknown_auth_error"):G.current==="link"&&N(L,"linkAccount","onError",U.privyErrorCode||"failed_to_link_account"),U}return c(g),w(A||!1),l(!0),C(!1),g??void 0},initLoginWithEmail:async(d,p)=>{let m=new mo(d,p);t.startAuthFlow(m);try{oe.current="email",await m.sendCodeEmail()}catch(g){throw G.current==="login"?N(L,"login","onError",g.privyErrorCode||"unknown_auth_error"):G.current==="link"&&N(L,"linkAccount","onError",g.privyErrorCode||"failed_to_link_account"),g}},initUpdateEmail:async(d,p,m)=>{let g=new Oa(d,p,m);t.startAuthFlow(g),await g.sendCodeEmail()},initLoginWithSms:async(d,p)=>{_({status:"sending-code"});let m=new jo(d,p);t.startAuthFlow(m);try{oe.current="sms",await m.sendSmsCode(),_({status:"awaiting-code-input"})}catch(g){throw _({status:"error",error:g}),G.current==="login"?N(L,"login","onError",g.privyErrorCode||"unknown_auth_error"):G.current==="link"&&N(L,"linkAccount","onError",g.privyErrorCode||"failed_to_link_account"),g}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(_({status:"submitting-code"}),!n){let A=new uo;throw _({status:"error",error:A}),A}if(t.authFlow instanceof mo)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof jo)t.authFlow.meta.smsCode=d.trim();else{let A=new E("Must initialize a passwordless code flow first");throw _({status:"error",error:A}),A}let p=await he(),m,g;if(p&&t.sessionHasActiveToken())try{m=await t.link()}catch(A){throw _({status:"error",error:A}),N(L,"linkAccount","onError",A.privyErrorCode||"failed_to_link_account"),A}else try{({user:m,isNewUser:g}=await t.authenticate())}catch(A){throw _({status:"error",error:A}),N(L,"login","onError",A.privyErrorCode||"unknown_auth_error"),A}c(m||s||null),w(g||!1),l(!0),_({status:"done"})},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:I,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(A=>A.type==="wallet"&&A.walletClientType==="privy"),g=await he();if(!g||!I||!m){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}ae(!0);try{await I.connect({accessToken:g,address:m.address}),d(!0)}catch(A){if(qn(A)&&m.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:m.address}}),(await I.recover({address:m.address,accessToken:g})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:m.address}}),d(!0);else if(qn(A)){J({recoverWallet:{privyWallet:m,onFailure:p,onSuccess:()=>d(!0)},recoveryOAuthStatus:{provider:"google-drive",action:"recover"}});let U=rl(m.recoveryMethod);fe(U)}else p(A)}}),getFiatOnRampConfig:Ve,setReadyToTrue:d=>{i(!0),jt?.(d)},updateWallets:()=>ct(),fundWallet:async(d,p)=>{let{signedUrl:m,externalTransactionId:g}=await Ve(d,p);J({fiatOnRampPrompt:{signedUrl:m},fiatOnRampStatus:{externalTransactionId:g}}),fe("FIAT_ON_RAMP_PROMPT_SCREEN")},requestFarcasterSignerStatus:async d=>{let p=await he(),m=s?.linkedAccounts.find(A=>A.type==="wallet"&&A.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!I||!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 g=await t.requestFarcasterSignerStatus(d);if(g.status==="approved"){let A=await t.getAuthenticatedUser();c(A||s||null)}return g}}))();W1=ue.recoverEmbeddedWallet;let D1=tE(()=>({wallets:u,ready:Sr}),[u,Sr]);return $r(ye.Provider,{value:yn,children:$r(kc.Provider,{value:L,children:$r(zd.Provider,{value:D1,children:A1(fm,{...D,children:[e.children,A1(xc.Provider,{value:ue,children:[!D.headless&&D.captchaEnabled&&n&&!a&&$r(Sc,{delayedExecution:!1}),$r(C1,{theme:{...D.appearance.palette||{}}}),$r(sm,{data:Ee,setModalData:J,setInitialScreen:k,initialScreen:v,authenticated:a,open:r,children:$r(T1,{open:r})}),me&&pe?$r(x1,{appId:e.appId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:Pt,mfaSubmitPromise:Fe,onLoad:Q,onLoadFailed:()=>null}):null]})]})})})})};import{useContext as aE}from"react";function sE(e){let{login:t}=aE(ye);return De("login",e),{login:t}}import{useContext as lE}from"react";function cE(e){let{logout:t}=lE(ye);return De("logout",e),{logout:t}}import{useCallback as L1,useEffect as dE}from"react";function pE(){let e=Ce(),t=Is(),{initLoginWithHeadlessOAuth:r,loginWithHeadlessOAuth:o,isHeadlessOAuthLoading:n,ready:i,user:a}=B(),l=L1(async c=>{if(e.enabled&&e.status!=="success")throw new mr(e.error,null,"captcha_failure");return r(c.provider,e.token)},[r,e]),s=L1(async()=>{let c=_i();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{qo()}},[o]);return dE(()=>{let c=_i();i&&t&&c.inProgress&&c.headless&&!c.popupFlow&&s()},[i,t]),{initOAuth:l,loginWithOAuth:s,loading:n}}import{useCallback as O1}from"react";var uE=()=>{let e=Ce(),{initLoginWithEmail:t,loginWithCode:r}=B(),o=O1(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=O1(async({code:i})=>{if(e.enabled&&e.status==="error")throw new mr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};import{useCallback as N1}from"react";var mE=()=>{let e=Ce(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=B(),n=N1(async({phoneNumber:a})=>{if(!a)throw new Error("SMS required to send OTP code");return t(a)},[t]),i=N1(async({code:a})=>{if(e.enabled&&e.status!=="success")throw new mr(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:n,loginWithCode:i,state:o}};import{useContext as fE}from"react";function hE(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:h,linkFarcaster:f}=fE(ye);return De("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:u,linkSpotify:h,linkFarcaster:f}}import{useContext as yE}from"react";function gE(e){let{connectWallet:t}=yE(ye);return De("connectWallet",e),{connectWallet:t}}import{useContext as vE}from"react";function CE(e){let{createWallet:t}=vE(ye);return De("createWallet",e),{createWallet:t}}var wE=()=>{let{fundWallet:e}=B();return{fundWallet:e}};import{useContext as bE}from"react";function EE(e){let{sendTransaction:t}=bE(ye);return De("sendTransaction",e),{sendTransaction:t}}import{useContext as TE}from"react";function PE(e){let{setWalletPassword:t}=TE(ye);return De("setWalletPassword",e),{setWalletPassword:t}}import{useContext as SE}from"react";function xE(e){let{signMessage:t}=SE(ye);return De("signMessage",e),{signMessage:t}}import{useContext as kE}from"react";function _E(e){let{signTypedData:t}=kE(ye);return De("signTypedData",e),{signTypedData:t}}import{useContext as AE}from"react";var RE=()=>{let{isModalOpen:e}=AE(ye);return{isOpen:e}};import{useContext as IE}from"react";function ME(e){let{getAccessToken:t}=IE(ye);return De("accessToken",e),{getAccessToken:t}}function WE(){let{submitCast:e,removeCast:t,likeCast:r,recastCast:o,followUser:n,unfollowUser:i,requestFarcasterSigner:a}=B();return{followUser:n,unfollowUser:i,submitCast:e,removeCast:t,likeCast:r,recastCast:o,requestFarcasterSigner:a}}function LE(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}export{Ar as AsExternalProvider,Sc as Captcha,Wi as ConnectorManager,Li as PrivyClient,nE as PrivyProvider,Ie as PrivyProxyProvider,Ii as SUPPORTED_CHAINS,cc as VERSION,St as WalletConnector,LE as addRpcUrlOverrideToChain,Yc as errorIndicatesMaxMfaRetries,rn as errorIndicatesMfaTimeout,on as errorIndicatesMfaVerificationFailed,he as getAccessToken,gE as useConnectWallet,CE as useCreateWallet,WE as useExperimentalFarcasterSigner,wE as useFundWallet,hE as useLinkAccount,sE as useLogin,uE as useLoginWithEmail,pE as useLoginWithOAuth,mE as useLoginWithSms,cE as useLogout,sa as useMfa,Vr as useMfaEnrollment,RE as useModalStatus,B as usePrivy,_c as useRegisterMfaListener,EE as useSendTransaction,PE as useSetWalletPassword,xE as useSignMessage,_E as useSignTypedData,ME as useToken,va as useWallets};