@privy-io/react-auth 1.75.1 → 1.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +387 -312
- package/dist/index.d.ts +26 -4
- package/dist/index.js +389 -314
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var B0=Object.create;var ol=Object.defineProperty;var H0=Object.getOwnPropertyDescriptor;var V0=Object.getOwnPropertyNames;var G0=Object.getPrototypeOf,q0=Object.prototype.hasOwnProperty;var z0=(e,t)=>{for(var r in t)ol(e,r,{get:t[r],enumerable:!0})},em=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of V0(t))!q0.call(e,n)&&n!==r&&ol(e,n,{get:()=>t[n],enumerable:!(o=H0(t,n))||o.enumerable});return e};var y=(e,t,r)=>(r=e!=null?B0(G0(e)):{},em(t||!e||!e.__esModule?ol(r,"default",{value:e,enumerable:!0}):r,e)),$0=e=>em(ol({},"__esModule",{value:!0}),e);var jd=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var tm=(e,t,r)=>(jd(e,t,"read from private field"),r?r.call(e):t.get(e)),nl=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Yd=(e,t,r,o)=>(jd(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var rm=(e,t,r)=>(jd(e,t,"access private method"),r);var T7={};z0(T7,{AsExternalProvider:()=>go,Captcha:()=>Xl,ConnectorManager:()=>ra,LoginModal:()=>Hd,PrivyClient:()=>oa,PrivyProvider:()=>KC,PrivyProxyProvider:()=>dt,SUPPORTED_CHAINS:()=>ea,VERSION:()=>_l,WalletConnector:()=>ur,addRpcUrlOverrideToChain:()=>x0,errorIndicatesMaxMfaRetries:()=>_c,errorIndicatesMfaTimeout:()=>Nn,errorIndicatesMfaVerificationFailed:()=>Dn,getAccessToken:()=>Re,getEmbeddedConnectedWallet:()=>A0,useConnectWallet:()=>i0,useCreateWallet:()=>s0,useCrossAppAccounts:()=>d0,useExperimentalFarcasterSigner:()=>P0,useFarcasterSigner:()=>zu,useFundWallet:()=>l0,useLinkAccount:()=>o0,useLinkWithSiwe:()=>t0,useLogin:()=>YC,useLoginWithEmail:()=>XC,useLoginWithOAuth:()=>JC,useLoginWithSms:()=>e0,useLogout:()=>QC,useMfa:()=>Ha,useMfaEnrollment:()=>uo,useModalStatus:()=>E0,useOAuthTokens:()=>_0,usePrivy:()=>$,useRegisterMfaListener:()=>oc,useSendTransaction:()=>u0,useSetWalletPassword:()=>f0,useSetWalletRecovery:()=>y0,useSignMessage:()=>v0,useSignTypedData:()=>w0,useSolanaWallets:()=>c0,useToken:()=>S0,useWallets:()=>co});module.exports=$0(T7);var tn=require("@ethersproject/address"),$d=require("@ethersproject/providers"),BC=require("mipd"),ve=require("react"),HC=require("react-device-detect"),Za=require("@privy-io/js-sdk-core");var om=require("ofetch"),wt=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}]`:""}`}},dr=class extends wt{constructor(r,o,n,i,a){super(n,i,a);this.type=r;this.status=o}},w=class extends wt{constructor(r,o,n){super(r,o,n);this.type="client_error"}},il=class extends w{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var we=class extends wt{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},Ce=e=>{if(e instanceof wt)return e;if(!(e instanceof om.FetchError))return Rt(e);if(!e.response)return new dr("api_error",null,e.message,e);let{type:t,message:r,error:o,code:n}=e.data;return new dr(t||"ApiError",e.response.status,r||o,e,n)},Rt=e=>e instanceof wt?e:e instanceof Error?new w(e.message,e):new w(`Internal error: ${e}`);var on=class extends w{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},pr=class extends w{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},al=class extends w{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var eo=class extends w{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 sl="/api/v1/sessions",ll="/api/v1/sessions/logout",nm="/api/v1/sessions/fork",cl="/api/v1/sessions/fork/recover",im="/api/v1/siwe/init",am="/api/v1/siwe/authenticate",sm="/api/v1/siwe/link",lm="/api/v1/siwe/unlink",cm="/api/v1/farcaster/init",dm="/api/v1/farcaster/authenticate",pm="/api/v1/farcaster/link",um="/api/v1/farcaster/status",mm="/api/v1/farcaster/unlink",fm="/api/v1/passwordless/init",hm="/api/v1/passwordless/authenticate",ym="/api/v1/passwordless/link",gm="/api/v1/passwordless/unlink",vm="/api/v1/passwordless/update",Cm="/api/v1/passwordless_sms/init",wm="/api/v1/passwordless_sms/link",bm="/api/v1/passwordless_sms/unlink",Em="/api/v1/passwordless_sms/authenticate",dl="/api/v1/oauth/init",Tm="/api/v1/oauth/authenticate",pl="/api/v1/oauth/link",Sm="/api/v1/oauth/unlink",_m="/api/v1/recovery/oauth/init",Pm="/api/v1/recovery/oauth/init_icloud",xm="/api/v1/recovery/oauth/authenticate",Am="/api/v1/passkeys/link/init",km="/api/v1/passkeys/authenticate/init",Rm="/api/v1/passkeys/link",Mm="/api/v1/passkeys/authenticate",Im="/api/v1/passkeys/unlink",Wm="/api/v1/telegram/authenticate",Lm="/api/v1/telegram/link",Om="/api/v1/telegram/unlink";var Nm="/api/v1/mfa/passwordless_sms/init",Dm="/api/v1/mfa/passkeys/init",Um="/api/v1/users/me/accept_terms",ul="/api/v1/analytics_events",Fm="/api/v1/plugins/moonpay_on_ramp/sign",Bm="/api/v1/custom_jwt_account/authenticate";var Ui=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(Bm,{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 Tn=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(hm,{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 w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new w("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(ym,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw Ce(t)}}async sendCodeEmail(t,r){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new w("Email must be set when initialzing authentication.");try{return await this.api.post(fm,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw Ce(o)}}},ml=class extends Tn{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new w("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(vm,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw Ce(r)}}};var El=require("react-device-detect");var Zd=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)}},fl=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 Qd(){try{let e="privy:__session_storage__test",t="blobby",r=new fl;return r.put(e,t),r.del(e),!0}catch{return!1}}function K0(){return typeof window<"u"&&window.localStorage?new fl:new Zd}var X=K0();var Fi=require("@ethersproject/providers");function Hm(){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 hl=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 Jd=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||hl(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!Jd(r))return!1}return!0},Sn=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),yl=()=>{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 Vm=(e,t)=>{let r=[],o=[];for(let[n,i]of e.entries())n<t?r.push(i):o.push(i);return[r,o]},gl=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,}))$/),Gm=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},yt=(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}`},Xd=e=>new Promise(t=>setTimeout(t,e));function qm(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 Ja=(e,t={})=>{let r=t.delayMs||150,o=t.maxAttempts||270;return new Promise(async(n,i)=>{let a=!1,l=0;for(;!a&&l<o;){if(t.abortSignal?.aborted)return;e().then(s=>{a=!0,n(s)},(...s)=>{a=!0,i(...s)}),l+=1,await Xd(r)}a||i(new Error("Exceeded max attempts before resolving function"))})},vl=(e,t,r={},o={})=>{let n=new URL(t,e);for(let[a,l]of Object.entries(r))l!==void 0&&n.searchParams.set(a,l);let i=Object.entries(o);if(i.length>0){let a=new URLSearchParams;for(let[l,s]of i)a.append(l,s);n.hash=a.toString()}return n.href};var zm=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),ei=e=>typeof e=="string"?e:"0x"+e.toString(16);async function $m(e,t,r,o=3e3){let n=!1,i=window;return new Promise(a=>{i.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout(()=>{l()},o));function l(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",l);let s=e.getProviders(),c=[];for(let m of s)t.includes("coinbase_wallet")&&m.info.rdns==="com.coinbase.wallet"||c.push({type:m.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:m});for(let m of Hm()){let f=hl(m);if(!s.some(u=>u.info.name===f)){if(Jd(m,!0)&&!c.find(u=>u.type==="metamask")){c.push({type:"metamask",legacyInjectedProvider:m});continue}if(f==="Phantom"&&!c.find(u=>u.type==="phantom")){c.push({type:"phantom",legacyInjectedProvider:m});continue}if(f==="Coinbase Wallet"&&!c.find(u=>u.type==="coinbase_wallet"&&r?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){c.push({type:"coinbase_wallet",legacyInjectedProvider:m});continue}c.find(u=>u.type==="unknown_browser_extension")||c.push({type:"unknown_browser_extension",legacyInjectedProvider:m})}}a(c)}})}function Bi(e){return`eip155:${String(Number(e))}`}var Km=(e,t,r,o)=>{let n=Number(e),i=t.find(a=>a.id===n);if(!i)throw new we(`Unsupported chainId ${e}`,4901);return ep(i,r,o)},ep=(e,t,r)=>{let o=e.id,n=Number(e.id),i;if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])i=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[n])i=t.rpcUrls[n];else if(e.rpcUrls.privy?.http[0]){let a=new URL(e.rpcUrls.privy.http[0]);a.searchParams.append("privyAppId",r),i=a.toString()}else e.rpcUrls.public?.http[0]?i=e.rpcUrls.public.http[0]:i=e.rpcUrls.default?.http[0];if(!i)throw new we(`No RPC url found for ${o}`);return i},jm=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new we(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Wr=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new we(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?a=new Fi.StaticJsonRpcProvider(i.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?a=new Fi.StaticJsonRpcProvider(r.rpcUrls[n]):i.rpcUrls.privy?.http[0]?a=new Fi.StaticJsonRpcProvider({url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):i.rpcUrls.public?.http[0]?a=new Fi.StaticJsonRpcProvider(i.rpcUrls.public.http[0]):a=new Fi.StaticJsonRpcProvider(i.rpcUrls.default?.http[0]),!a)throw new we(`No RPC url found for ${e}`);return a},Xa=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 Cl=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(wl))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var wl={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function Ym(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function Zm(e,t){let r=Ym(t);if(r.deepLink)return rf(r.deepLink,e);if(r.universalLink)return tp(r.universalLink,e);throw new w(`Unsupported wallet ${t.id}`)}function Qm(e,t){let r=Ym(t);if(r.universalLink)return tp(r.universalLink,e)}var Jm="WALLETCONNECT_DEEPLINK_CHOICE";function Xm(){try{localStorage.removeItem(Jm)}catch{}}function ef({href:e,name:t}){try{localStorage.setItem(Jm,JSON.stringify({href:e,name:t}))}catch{}}function tf(e){return e.startsWith("http://")||e.startsWith("https://")}function rf(e,t){if(tf(e))return tp(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 tp(e,t){if(!tf(e))return rf(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function bl(e,t){window.open(e,t,"noreferrer noopener")}var rt=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 es=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new rt(this._startChannelOnce.bind(this)),this.pollForReady=new rt(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.channelToken)throw new w("Auth flow must be initialized first");try{let t=await this.api.post(dm,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new w("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 w("Auth flow has no API instance");try{return await this.api.post(pm,{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 w("Auth flow has no API instance");let t=await this.api.post(cm,{token:this.captchaToken});El.isMobile&&!El.isIOS&&t.connect_uri&&bl(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new w("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.channelToken)throw new w("Auth flow must be initialized first");let t=await this.api.get(um,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var of="1.75.1";var nf="34357d3c125c2bcf2ce2bc3309d98715",Tl="https://auth.privy.io",af=2e4,ot=1400,Sl=2500,_l=of;var ti="privy:token",rp="privy-token",Pl="privy:refresh_token",sf="privy-refresh-token",xl="privy-session",ts="privy:session_transfer_token",Y0="privy:wallet",rs="privy:caid",os=e=>`privy:cross-app:${e}`,ri="privy:state_code",oi="privy:code_verifier",ni="privy:headless_oauth",Al=e=>`${Y0}:${e}`,op="privy:connectors",np="privy:connections";var ii=12e4,nn=1,ip="0x1",Hi=3e4,lf="https://api.moonpay.com/v1",cf="https://api.moonpay.com/v1",df="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",pf="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var uf="deprecated";var ap=require("jose");async function mf(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function ff(e){return crypto.getRandomValues(new Uint8Array(e))}var Z0="S256",Q0="S256";function ai(){return ap.base64url.encode(ff(36))}function Vi(){return ai()}async function Gi(e,t=Z0){if(t==Q0){let r=await mf(e);return ap.base64url.encode(r)}else return e}function hf(){let e=X.get(oi);if(!e)throw new w("Authentication error.");return e}function kl(){return!!X.get(ni)}var Oo=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:kl();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 w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");let t=hf();try{let r=await this.api.post(Tm,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(oi),this.meta.headless&&X.del(ni),{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user,oauth_tokens:r.oauth_tokens}}catch(r){let o=Ce(r);throw o.privyErrorCode?new w(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new w("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new w("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new w("User denied confirmation during OAuth flow");let t=X.get(oi);if(!t)throw new w("Authentication error.");try{let r=await this.api.post(pl,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(oi),r}catch(r){throw Ce(r)}}async getAuthorizationUrl(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.provider)throw new w("Provider must be set when initializing OAuth authentication.");let t=ai();X.put(oi,t);let r=Vi();X.put(ri,r);let o=await Gi(t);this.meta.headless&&X.put(ni,!0);try{return await this.api.post(dl,{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 sp(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ns=require("react/jsx-runtime"),Rl=({style:e,...t})=>(0,ns.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[(0,ns.jsx)("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),(0,ns.jsx)("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});var _n=require("react/jsx-runtime"),Ml=({style:e,...t})=>(0,_n.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[(0,_n.jsx)("g",{clipPath:"url(#clip0)",children:(0,_n.jsx)("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),(0,_n.jsx)("defs",{children:(0,_n.jsx)("clipPath",{id:"clip0",children:(0,_n.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var lp=require("react/jsx-runtime"),Il=({style:e,...t})=>(0,lp.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:(0,lp.jsx)("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});var yf=require("@heroicons/react/24/outline"),vf=require("react/jsx-runtime"),gf=({style:e})=>(0,vf.jsx)(yf.GlobeAltIcon,{style:{color:"var(--privy-color-error)",...e}});var si=require("react/jsx-runtime"),Wl=({style:e,...t})=>(0,si.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,si.jsx)("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),(0,si.jsx)("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),(0,si.jsx)("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),(0,si.jsx)("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});var Nt=require("react/jsx-runtime");function Ll(e){return(0,Nt.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...e,children:[(0,Nt.jsxs)("defs",{children:[(0,Nt.jsxs)("linearGradient",{id:"b",children:[(0,Nt.jsx)("stop",{offset:"0",stopColor:"#3771c8"}),(0,Nt.jsx)("stop",{stopColor:"#3771c8",offset:".128"}),(0,Nt.jsx)("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),(0,Nt.jsxs)("linearGradient",{id:"a",children:[(0,Nt.jsx)("stop",{offset:"0",stopColor:"#fd5"}),(0,Nt.jsx)("stop",{offset:".1",stopColor:"#fd5"}),(0,Nt.jsx)("stop",{offset:".5",stopColor:"#ff543e"}),(0,Nt.jsx)("stop",{offset:"1",stopColor:"#c837ab"})]}),(0,Nt.jsx)("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),(0,Nt.jsx)("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),(0,Nt.jsx)("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Nt.jsx)("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Nt.jsx)("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}var is=require("react/jsx-runtime");function Ol({style:e,...t}){return(0,is.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:(0,is.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,is.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,is.jsx)("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}var as=require("react/jsx-runtime");function Nl(e){return(0,as.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,as.jsx)("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),(0,as.jsx)("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}var qi=require("react/jsx-runtime");function Dl(e){return(0,qi.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[(0,qi.jsx)("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),(0,qi.jsx)("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),(0,qi.jsx)("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}var cp=require("react/jsx-runtime"),Ul=({style:e,...t})=>(0,cp.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:(0,cp.jsx)("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});var Cf={google:{name:"Google",component:Wl},discord:{name:"Discord",component:Ml},github:{name:"Github",component:Il},linkedin:{name:"LinkedIn",component:Ol},twitter:{name:"Twitter",component:Ul},spotify:{name:"Spotify",component:Nl},instagram:{name:"Instagram",component:Ll},tiktok:{name:"Tiktok",component:Dl},apple:{name:"Apple",component:Rl}},ss=e=>e in Cf?Cf[e]:{name:"Unknown",component:gf};function wf(e,t){let r={detail:"",retryable:!1},o=sp(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=ss(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=ss(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return e?.privyErrorCode==="cannot_link_more_of_type"&&(r.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode==="oauth_unexpected"&&t.startsWith("privy:")&&(r.detail="Something went wrong. Please try again."),r}function ls(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),o=e.get("privy_oauth_provider");if(!t||!r||!o)return{inProgress:!1};let n=!1;try{n=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:o,headless:kl(),popupFlow:window.opener!==null&&n}}function li(){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"),X.del(ri),window.history.replaceState({},"",e)}var ci=class{constructor(t){this.initAuthenticateOnce=new rt(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new rt(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new w("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new w("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 w("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new w("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(Mm,{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 w("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 w("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new w("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(Rm,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new w("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):Ce(r)}}async _initAuthenticateOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(km,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(Am,{})}_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 Fl=({address:e,chainId:t,nonce:r})=>{let o=window.location.host,n=window.location.origin,i="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",a=new Date().toISOString();return`${o} wants you to sign in with your Ethereum account:
|
|
1
|
+
"use strict";var mw=Object.create;var dl=Object.defineProperty;var fw=Object.getOwnPropertyDescriptor;var hw=Object.getOwnPropertyNames;var yw=Object.getPrototypeOf,gw=Object.prototype.hasOwnProperty;var vw=(e,t)=>{for(var r in t)dl(e,r,{get:t[r],enumerable:!0})},pm=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of hw(t))!gw.call(e,n)&&n!==r&&dl(e,n,{get:()=>t[n],enumerable:!(o=fw(t,n))||o.enumerable});return e};var y=(e,t,r)=>(r=e!=null?mw(yw(e)):{},pm(t||!e||!e.__esModule?dl(r,"default",{value:e,enumerable:!0}):r,e)),Cw=e=>pm(dl({},"__esModule",{value:!0}),e);var rp=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var um=(e,t,r)=>(rp(e,t,"read from private field"),r?r.call(e):t.get(e)),pl=(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)},op=(e,t,r,o)=>(rp(e,t,"write to private field"),o?o.call(e,r):t.set(e,r),r);var mm=(e,t,r)=>(rp(e,t,"access private method"),r);var s7={};vw(s7,{AsExternalProvider:()=>wo,Captcha:()=>ac,ConnectorManager:()=>sa,LoginModal:()=>Qd,PrivyClient:()=>la,PrivyProvider:()=>w0,PrivyProxyProvider:()=>ct,SUPPORTED_CHAINS:()=>ia,VERSION:()=>Ml,WalletConnector:()=>mr,addRpcUrlOverrideToChain:()=>ew,errorIndicatesMaxMfaRetries:()=>Mc,errorIndicatesMfaTimeout:()=>Bn,errorIndicatesMfaVerificationFailed:()=>Hn,getAccessToken:()=>Re,getEmbeddedConnectedWallet:()=>tw,useConnectWallet:()=>M0,useCreateWallet:()=>O0,useCrossAppAccounts:()=>D0,useExperimentalFarcasterSigner:()=>X0,useFarcasterSigner:()=>rm,useFundWallet:()=>L0,useLinkAccount:()=>R0,useLinkWithSiwe:()=>x0,useLogin:()=>E0,useLoginWithEmail:()=>P0,useLoginWithOAuth:()=>_0,useLoginWithSms:()=>A0,useLogout:()=>S0,useMfa:()=>$a,useMfaEnrollment:()=>ho,useModalStatus:()=>Y0,useOAuthTokens:()=>J0,usePrivy:()=>$,useRegisterMfaListener:()=>dc,useSendTransaction:()=>F0,useSetWalletPassword:()=>H0,useSetWalletRecovery:()=>V0,useSignMessage:()=>z0,useSignTypedData:()=>K0,useSolanaWallets:()=>N0,useToken:()=>Q0,useWallets:()=>mo});module.exports=Cw(s7);var rn=require("@ethersproject/address"),ep=require("@ethersproject/providers"),m0=require("mipd"),ve=require("react"),f0=require("react-device-detect"),ts=require("@privy-io/js-sdk-core");var fm=require("ofetch"),wt=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 wt{constructor(r,o,n,i,a){super(n,i,a);this.type=r;this.status=o}},b=class extends wt{constructor(r,o,n){super(r,o,n);this.type="client_error"}},ul=class extends b{constructor(){super("Request timed out",void 0,"client_request_timeout")}};var we=class extends wt{constructor(r,o,n){super(r,o,n);this.type="connector_error"}},Ce=e=>{if(e instanceof wt)return e;if(!(e instanceof fm.FetchError))return bt(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)},bt=e=>e instanceof wt?e:e instanceof Error?new b(e.message,e):new b(`Internal error: ${e}`);var nn=class extends b{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},ur=class extends b{constructor(t="Embedded wallet error",r){super(t,r,"unknown_embedded_wallet_error")}},ml=class extends b{constructor(t="User must be authenticated"){super(t,void 0,"must_be_authenticated")}};var ro=class extends b{constructor(t){super("This application is in development mode and must be upgraded to production to log in new users.",t,"max_accounts_reached")}};var fl="/api/v1/sessions",hl="/api/v1/sessions/logout",hm="/api/v1/sessions/fork",yl="/api/v1/sessions/fork/recover",ym="/api/v1/siwe/init",gm="/api/v1/siwe/authenticate",vm="/api/v1/siwe/link",Cm="/api/v1/siwe/unlink",wm="/api/v1/farcaster/init",bm="/api/v1/farcaster/authenticate",Em="/api/v1/farcaster/link",Tm="/api/v1/farcaster/status",Sm="/api/v1/farcaster/unlink",_m="/api/v1/passwordless/init",Pm="/api/v1/passwordless/authenticate",Am="/api/v1/passwordless/link",xm="/api/v1/passwordless/unlink",km="/api/v1/passwordless/update",Rm="/api/v1/passwordless_sms/init",Im="/api/v1/passwordless_sms/link",Mm="/api/v1/passwordless_sms/unlink",Wm="/api/v1/passwordless_sms/authenticate",gl="/api/v1/oauth/init",Om="/api/v1/oauth/authenticate",vl="/api/v1/oauth/link",Lm="/api/v1/oauth/unlink",Nm="/api/v1/recovery/oauth/init",Dm="/api/v1/recovery/oauth/init_icloud",Um="/api/v1/recovery/oauth/authenticate",Fm="/api/v1/passkeys/link/init",Bm="/api/v1/passkeys/authenticate/init",Hm="/api/v1/passkeys/link",Gm="/api/v1/passkeys/authenticate",Vm="/api/v1/passkeys/unlink",qm="/api/v1/telegram/authenticate",zm="/api/v1/telegram/link",$m="/api/v1/telegram/unlink";var Km="/api/v1/mfa/passwordless_sms/init",jm="/api/v1/mfa/passkeys/init",Ym="/api/v1/users/me/accept_terms",Cl="/api/v1/analytics_events",Zm="/api/v1/custom_jwt_account/authenticate",Qm="/api/v1/plugins/moonpay_on_ramp/sign",Jm="/api/v1/funding/coinbase_on_ramp/init",Xm="/api/v1/funding/coinbase_on_ramp/status";var Vi=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");try{let t=await this.api.post(Zm,{token:this.meta.token});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){throw new Error("Unimplemented")}};var Pn=class{constructor(t,r){this.meta={email:t,captchaToken:r}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new b("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(Pm,{email:this.meta.email,code:this.meta.emailCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new b("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(Am,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw Ce(t)}}async sendCodeEmail(t,r){if(!this.api)throw new b("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new b("Email must be set when initialzing authentication.");try{return await this.api.post(_m,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw Ce(o)}}},wl=class extends Pn{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new b("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(km,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw Ce(r)}}};var kl=require("react-device-detect");var np=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)}},bl=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 ip(){try{let e="privy:__session_storage__test",t="blobby",r=new bl;return r.put(e,t),r.del(e),!0}catch{return!1}}function ww(){return typeof window<"u"&&window.localStorage?new bl:new np}var X=ww();var qi=require("@ethersproject/providers");function ef(){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 El=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 ap=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||El(e)!=="MetaMask")return!1;if(e.providers){for(let r of e.providers)if(!ap(r))return!1}return!0},An=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),Tl=()=>{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 tf=(e,t)=>{let r=[],o=[];for(let[n,i]of e.entries())n<t?r.push(i):o.push(i);return[r,o]},Sl=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,}))$/),rf=(e,t)=>{let r=e.slice(0),o=[];for(;r.length;)o.push(r.splice(0,t));return o},Mt=(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}`},sp=e=>new Promise(t=>setTimeout(t,e));function of(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 os=(e,t={})=>{let r=t.delayMs||150,o=t.maxAttempts||270;return new Promise(async(n,i)=>{let a=!1,l=0;for(;!a&&l<o;){if(t.abortSignal?.aborted)return;e().then(s=>{a=!0,n(s)},(...s)=>{a=!0,i(...s)}),l+=1,await sp(r)}a||i(new Error("Exceeded max attempts before resolving function"))})},_l=(e,t,r={},o={})=>{let n=new URL(t,e);for(let[a,l]of Object.entries(r))l!==void 0&&n.searchParams.set(a,l);let i=Object.entries(o);if(i.length>0){let a=new URLSearchParams;for(let[l,s]of i)a.append(l,s);n.hash=a.toString()}return n.href};var nf=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),ii=e=>typeof e=="string"?e:"0x"+e.toString(16);async function af(e,t,r,o=3e3){let n=!1,i=window;return new Promise(a=>{i.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout(()=>{l()},o));function l(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",l);let s=e.getProviders(),c=[];for(let m of s)t.includes("coinbase_wallet")&&m.info.rdns==="com.coinbase.wallet"||c.push({type:m.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:m});for(let m of ef()){let f=El(m);if(!s.some(u=>u.info.name===f)){if(ap(m,!0)&&!c.find(u=>u.type==="metamask")){c.push({type:"metamask",legacyInjectedProvider:m});continue}if(f==="Phantom"&&!c.find(u=>u.type==="phantom")){c.push({type:"phantom",legacyInjectedProvider:m});continue}if(f==="Coinbase Wallet"&&!c.find(u=>u.type==="coinbase_wallet"&&r?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){c.push({type:"coinbase_wallet",legacyInjectedProvider:m});continue}c.find(u=>u.type==="unknown_browser_extension")||c.push({type:"unknown_browser_extension",legacyInjectedProvider:m})}}a(c)}})}function zi(e){return`eip155:${String(Number(e))}`}var sf=(e,t,r,o)=>{let n=Number(e),i=t.find(a=>a.id===n);if(!i)throw new we(`Unsupported chainId ${e}`,4901);return lp(i,r,o)},lp=(e,t,r)=>{let o=e.id,n=Number(e.id),i;if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])i=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[n])i=t.rpcUrls[n];else if(e.rpcUrls.privy?.http[0]){let a=new URL(e.rpcUrls.privy.http[0]);a.searchParams.append("privyAppId",r),i=a.toString()}else e.rpcUrls.public?.http[0]?i=e.rpcUrls.public.http[0]:i=e.rpcUrls.default?.http[0];if(!i)throw new we(`No RPC url found for ${o}`);return i},lf=(e,t)=>{let r=Number(e),o=t.find(n=>n.id===r);if(!o)throw new we(`Unsupported chainId ${e}`,4901);return o.blockExplorers?.default.url},Er=(e,t,r,o)=>{let n=Number(e),i=t.find(l=>l.id===n);if(!i)throw new we(`Unsupported chainId ${e}`,4901);let a;if(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?a=new qi.StaticJsonRpcProvider(i.rpcUrls.privyWalletOverride.http[0]):r.rpcUrls&&r.rpcUrls[n]?a=new qi.StaticJsonRpcProvider(r.rpcUrls[n]):i.rpcUrls.privy?.http[0]?a=new qi.StaticJsonRpcProvider({url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}):i.rpcUrls.public?.http[0]?a=new qi.StaticJsonRpcProvider(i.rpcUrls.public.http[0]):a=new qi.StaticJsonRpcProvider(i.rpcUrls.default?.http[0]),!a)throw new we(`No RPC url found for ${e}`);return a},ns=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 Pl=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(Al))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var Al={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function cf(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function df(e,t){let r=cf(t);if(r.deepLink)return yf(r.deepLink,e);if(r.universalLink)return cp(r.universalLink,e);throw new b(`Unsupported wallet ${t.id}`)}function pf(e,t){let r=cf(t);if(r.universalLink)return cp(r.universalLink,e)}var uf="WALLETCONNECT_DEEPLINK_CHOICE";function mf(){try{localStorage.removeItem(uf)}catch{}}function ff({href:e,name:t}){try{localStorage.setItem(uf,JSON.stringify({href:e,name:t}))}catch{}}function hf(e){return e.startsWith("http://")||e.startsWith("https://")}function yf(e,t){if(hf(e))return cp(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 cp(e,t){if(!hf(e))return yf(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function xl(e,t){window.open(e,t,"noreferrer noopener")}var rt=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 is=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new rt(this._startChannelOnce.bind(this)),this.pollForReady=new rt(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.channelToken)throw new b("Auth flow must be initialized first");try{let t=await this.api.post(bm,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new b("No response from authentication");return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");try{return await this.api.post(Em,{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 b("Auth flow has no API instance");let t=await this.api.post(wm,{token:this.captchaToken});kl.isMobile&&!kl.isIOS&&t.connect_uri&&xl(t.connect_uri,"_blank"),this._meta={connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new b("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.channelToken)throw new b("Auth flow must be initialized first");let t=await this.api.get(Tm,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var gf="1.76.0";var vf="34357d3c125c2bcf2ce2bc3309d98715",Rl="https://auth.privy.io",Cf=2e4,ot=1400,Il=2500,Ml=gf;var ai="privy:token",dp="privy-token",Wl="privy:refresh_token",wf="privy-refresh-token",pp="privy:id_token",up="privy-id-token",Ol="privy-session",as="privy:session_transfer_token",Ew="privy:wallet",ss="privy:caid",ls=e=>`privy:cross-app:${e}`,si="privy:state_code",li="privy:code_verifier",ci="privy:headless_oauth",Ll=e=>`${Ew}:${e}`,mp="privy:connectors",fp="privy:connections";var di=12e4,an=1,hp="0x1",$i=3e4,bf="https://api.moonpay.com/v1",Ef="https://api.moonpay.com/v1",Tf="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",Sf="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI";var _f="deprecated";var yp=require("jose");async function Pf(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function Af(e){return crypto.getRandomValues(new Uint8Array(e))}var Tw="S256",Sw="S256";function pi(){return yp.base64url.encode(Af(36))}function Ki(){return pi()}async function ji(e,t=Tw){if(t==Sw){let r=await Pf(e);return yp.base64url.encode(r)}else return e}function xf(){let e=X.get(li);if(!e)throw new b("Authentication error.");return e}function Nl(){return!!X.get(ci)}var Do=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:Nl();this.meta={...t,headless:r}}addCaptchaToken(t){this.meta.captchaToken=t}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new b("User denied confirmation during OAuth flow");let t=xf();try{let r=await this.api.post(Om,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(li),this.meta.headless&&X.del(ci),{user:r.user,token:r.token,refresh_token:r.refresh_token,identity_token:r.identity_token,is_new_user:r.is_new_user,oauth_tokens:r.oauth_tokens}}catch(r){let o=Ce(r);throw o.privyErrorCode?new b(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new b("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new b("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new b("User denied confirmation during OAuth flow");let t=X.get(li);if(!t)throw new b("Authentication error.");try{let r=await this.api.post(vl,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(li),r}catch(r){throw Ce(r)}}async getAuthorizationUrl(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.provider)throw new b("Provider must be set when initializing OAuth authentication.");let t=pi();X.put(li,t);let r=Ki();X.put(si,r);let o=await ji(t);this.meta.headless&&X.put(ci,!0);try{return await this.api.post(gl,{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 gp(e){return e.charAt(0).toUpperCase()+e.slice(1)}var cs=require("react/jsx-runtime"),Dl=({style:e,...t})=>(0,cs.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[(0,cs.jsx)("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),(0,cs.jsx)("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});var xn=require("react/jsx-runtime"),Ul=({style:e,...t})=>(0,xn.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[(0,xn.jsx)("g",{clipPath:"url(#clip0)",children:(0,xn.jsx)("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),(0,xn.jsx)("defs",{children:(0,xn.jsx)("clipPath",{id:"clip0",children:(0,xn.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]});var vp=require("react/jsx-runtime"),Fl=({style:e,...t})=>(0,vp.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:(0,vp.jsx)("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});var kf=require("@heroicons/react/24/outline"),If=require("react/jsx-runtime"),Rf=({style:e})=>(0,If.jsx)(kf.GlobeAltIcon,{style:{color:"var(--privy-color-error)",...e}});var ui=require("react/jsx-runtime"),Bl=({style:e,...t})=>(0,ui.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,ui.jsx)("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),(0,ui.jsx)("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),(0,ui.jsx)("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),(0,ui.jsx)("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});var Ut=require("react/jsx-runtime");function Hl(e){return(0,Ut.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...e,children:[(0,Ut.jsxs)("defs",{children:[(0,Ut.jsxs)("linearGradient",{id:"b",children:[(0,Ut.jsx)("stop",{offset:"0",stopColor:"#3771c8"}),(0,Ut.jsx)("stop",{stopColor:"#3771c8",offset:".128"}),(0,Ut.jsx)("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),(0,Ut.jsxs)("linearGradient",{id:"a",children:[(0,Ut.jsx)("stop",{offset:"0",stopColor:"#fd5"}),(0,Ut.jsx)("stop",{offset:".1",stopColor:"#fd5"}),(0,Ut.jsx)("stop",{offset:".5",stopColor:"#ff543e"}),(0,Ut.jsx)("stop",{offset:"1",stopColor:"#c837ab"})]}),(0,Ut.jsx)("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),(0,Ut.jsx)("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),(0,Ut.jsx)("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Ut.jsx)("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,Ut.jsx)("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}var ds=require("react/jsx-runtime");function Gl({style:e,...t}){return(0,ds.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:(0,ds.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,ds.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,ds.jsx)("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}var ps=require("react/jsx-runtime");function Vl(e){return(0,ps.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,ps.jsx)("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),(0,ps.jsx)("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}var Yi=require("react/jsx-runtime");function ql(e){return(0,Yi.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[(0,Yi.jsx)("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),(0,Yi.jsx)("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),(0,Yi.jsx)("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}var Cp=require("react/jsx-runtime"),zl=({style:e,...t})=>(0,Cp.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:(0,Cp.jsx)("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});var Mf={google:{name:"Google",component:Bl},discord:{name:"Discord",component:Ul},github:{name:"Github",component:Fl},linkedin:{name:"LinkedIn",component:Gl},twitter:{name:"Twitter",component:zl},spotify:{name:"Spotify",component:Vl},instagram:{name:"Instagram",component:Hl},tiktok:{name:"Tiktok",component:ql},apple:{name:"Apple",component:Dl}},us=e=>e in Mf?Mf[e]:{name:"Unknown",component:Rf};function Wf(e,t){let r={detail:"",retryable:!1},o=gp(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=us(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=us(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return e?.privyErrorCode==="cannot_link_more_of_type"&&(r.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode==="oauth_unexpected"&&t.startsWith("privy:")&&(r.detail="Something went wrong. Please try again."),r}function ms(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),o=e.get("privy_oauth_provider");if(!t||!r||!o)return{inProgress:!1};let n=!1;try{n=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:o,headless:Nl(),popupFlow:window.opener!==null&&n}}function mi(){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"),X.del(si),window.history.replaceState({},"",e)}var fi=class{constructor(t){this.initAuthenticateOnce=new rt(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new rt(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new b("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new b("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new b("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new b("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let r=await t.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options)),o=await this.api.post(Gm,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(r)});return{user:o.user,token:o.token,refresh_token:o.refresh_token,is_new_user:o.is_new_user}}catch(r){throw r.name==="NotAllowedError"?new b("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):Ce(r)}}async link(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new b("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new b("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let r=this.meta.initLinkResponse.options,o=await t.startRegistration(this._transformInitLinkOptionsToCamelCase(r));return await this.api.post(Hm,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new b("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):Ce(r)}}async _initAuthenticateOnce(){if(!this.api)throw new b("Auth flow has no API instance");return await this.api.post(Bm,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new b("Auth flow has no API instance");return await this.api.post(Fm,{})}_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 $l=({address:e,chainId:t,nonce:r})=>{let o=window.location.host,n=window.location.origin,i="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",a=new Date().toISOString();return`${o} wants you to sign in with your Ethereum account:
|
|
2
2
|
${e}
|
|
3
3
|
|
|
4
4
|
${i}
|
|
@@ -9,7 +9,7 @@ Chain ID: ${t}
|
|
|
9
9
|
Nonce: ${r}
|
|
10
10
|
Issued At: ${a}
|
|
11
11
|
Resources:
|
|
12
|
-
- https://privy.io`};var an=class{constructor(t,r,o){this.getNonceOnce=new rt(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=o,this.client=r}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.client)throw new w("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign(),o=await this.client.authenticateWithSiweInternal({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.client)throw new w("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign();return await this.client.linkWithSiweInternal({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.client)throw new w("SiweFlow has no client instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new w("Could not prepare SIWE message");let t=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async _getNonceOnce(){if(!this.client)throw new w("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildSiweMessage(){if(!this.client)throw new w("SiweFlow has no client instance");let t=this.wallet.address,r=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=Fl({address:t,chainId:r,nonce:this.nonce}),this.preparedMessage}};var di=class{constructor(t,r){this.meta={phoneNumber:t,captchaToken:r}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(Em,{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 w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new w("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(wm,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw Ce(t)}}async sendSmsCode(t,r){if(!this.api)throw new w("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new w("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(Cm,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw Ce(o)}}};var zi=class{constructor(t){this.meta={captchaToken:t}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(Wm,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData});return{user:t.user,token:t.token,refresh_token:t.refresh_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(Lm,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw Ce(t)}}};function dp(e){let t={detail:"",retryable:!1};return e?.privyErrorCode==="linked_to_another_user"&&(t.detail="This account has already been linked to another user."),e?.privyErrorCode==="disallowed_login_method"&&(t.detail="Login with Telegram not allowed."),e?.privyErrorCode==="invalid_data"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="cannot_link_more_of_type"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="invalid_credentials"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="too_many_requests"&&(t.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("rate limit")&&(t.detail="Request limit reached for Telegram. Please wait a moment and try again."),t}function Ef(){let e;if(e=J0(),e)return bf(),{...e,flowType:"login-url"};if(e=X0(),e)return bf(),{...e,flowType:"web-app"}}function J0(){let e=new URLSearchParams(window.location.search),t=Number(e.get("id")||""),r=e.get("hash"),o=Number(e.get("auth_date")||""),n=e.get("first_name"),i=e.get("last_name")||void 0,a=e.get("username")||void 0,l=e.get("photo_url")||void 0;if(!(!t||!n||!o||!r))return{id:t,first_name:n,last_name:i,username:a,photo_url:l,auth_date:o,hash:r}}function X0(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id"),o=t.get("user"),n=Number(t.get("auth_date")||""),i=t.get("hash");if(!(!r||!o||!n||!i))return{query_id:r,user:o,auth_date:n,hash:i}}function bf(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),window.history.replaceState({},"",e)}var Mh=require("uuid");function re(e){return e?new Date(e*1e3):null}function ew(e){let t=[];for(let r of e){let o=r.type;switch(r.type){case"wallet":let n={address:r.address,type:r.type,imported:r.imported,verifiedAt:re(r.verified_at),firstVerifiedAt:re(r.first_verified_at),latestVerifiedAt:re(r.latest_verified_at),chainType:r.chain_type,chainId:r.chain_id,walletClient:r.wallet_client_type==="privy"?"privy":"unknown",walletClientType:r.wallet_client_type,connectorType:r.connector_type,recoveryMethod:r.recovery_method};t.push(n);break;case"cross_app":let i={type:r.type,subject:r.subject,embeddedWallets:r.embedded_wallets,smartWallets:r.smart_wallets,providerApp:{id:r.provider_app_id},verifiedAt:re(r.verified_at),firstVerifiedAt:re(r.first_verified_at),latestVerifiedAt:re(r.latest_verified_at)};t.push(i);break;case"email":let a={address:r.address,type:r.type,verifiedAt:re(r.verified_at),firstVerifiedAt:re(r.first_verified_at),latestVerifiedAt:re(r.latest_verified_at)};t.push(a);break;case"phone":let l={number:r.phoneNumber,type:r.type,verifiedAt:re(r.verified_at),firstVerifiedAt:re(r.first_verified_at),latestVerifiedAt:re(r.latest_verified_at)};t.push(l);break;case"google_oauth":let s={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:re(r.verified_at),firstVerifiedAt:re(r.first_verified_at),latestVerifiedAt:re(r.latest_verified_at)};t.push(s);break;case"spotify_oauth":let c={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:re(r.verified_at),firstVerifiedAt:re(r.first_verified_at),latestVerifiedAt:re(r.latest_verified_at)};t.push(c);break;case"instagram_oauth":let m={subject:r.subject,username:r.username,type:r.type,verifiedAt:re(r.verified_at),firstVerifiedAt:re(r.first_verified_at),latestVerifiedAt:re(r.latest_verified_at)};t.push(m);break;case"twitter_oauth":let f={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:re(r.verified_at),firstVerifiedAt:re(r.first_verified_at),latestVerifiedAt:re(r.latest_verified_at)};t.push(f);break;case"discord_oauth":let u={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:re(r.verified_at),firstVerifiedAt:re(r.first_verified_at),latestVerifiedAt:re(r.latest_verified_at)};t.push(u);break;case"github_oauth":let v={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:re(r.verified_at),firstVerifiedAt:re(r.first_verified_at),latestVerifiedAt:re(r.latest_verified_at)};t.push(v);break;case"tiktok_oauth":let b={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:re(r.verified_at),firstVerifiedAt:re(r.first_verified_at),latestVerifiedAt:re(r.latest_verified_at)};t.push(b);break;case"linkedin_oauth":let g={subject:r.subject,name:r.name,email:r.email,vanityName:r.vanity_name,type:r.type,verifiedAt:re(r.verified_at),firstVerifiedAt:re(r.first_verified_at),latestVerifiedAt:re(r.latest_verified_at)};t.push(g);break;case"apple_oauth":let E={subject:r.subject,email:r.email,type:r.type,verifiedAt:re(r.verified_at),firstVerifiedAt:re(r.first_verified_at),latestVerifiedAt:re(r.latest_verified_at)};t.push(E);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:re(r.verified_at),firstVerifiedAt:re(r.first_verified_at),latestVerifiedAt:re(r.latest_verified_at)});break;case"farcaster":let x={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:re(r.verified_at),firstVerifiedAt:re(r.first_verified_at),latestVerifiedAt:re(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(x);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:re(r.verified_at),firstVerifiedAt:re(r.first_verified_at),latestVerifiedAt:re(r.latest_verified_at)};t.push(k);break;case"telegram":let S={type:r.type,telegramUserId:r.telegram_user_id,firstName:r.first_name,lastName:r.last_name,username:r.username,photoUrl:r.photo_url,verifiedAt:re(r.first_verified_at),firstVerifiedAt:re(r.first_verified_at),latestVerifiedAt:re(r.latest_verified_at)};t.push(S);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function wr(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var xe=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum")||null,pi=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="solana")||null,Bl=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported&&t.chainType==="ethereum")||null,tw=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),br=(e,t)=>xe(e)||pi(e)?!1:t==="all-users"||t==="users-without-wallets"&&!tw(e)?.length;function Er(e){if(!e)return null;let t=ew(e.linked_accounts),r=wr(t,"wallet"),o=wr(t,"email"),n=wr(t,"phone"),i=wr(t,"google_oauth"),a=wr(t,"twitter_oauth"),l=wr(t,"discord_oauth"),s=wr(t,"github_oauth"),c=wr(t,"spotify_oauth"),m=wr(t,"instagram_oauth"),f=wr(t,"tiktok_oauth"),u=wr(t,"linkedin_oauth"),v=wr(t,"apple_oauth"),b=wr(t,"farcaster"),g=wr(t,"telegram"),E=e.mfa_methods.map(({type:k,verified_at:S})=>({type:k,verifiedAt:re(S)}));return{id:e.id,createdAt:re(e.created_at),linkedAccounts:t,email:o&&{address:o?.address},phone:n&&{number:n?.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported},google:i&&{subject:i.subject,email:i.email,name:i.name},twitter:a&&{subject:a.subject,username:a.username,name:a.name,profilePictureUrl:a.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:s&&{subject:s.subject,username:s.username,name:s.name,email:s.email},spotify:c&&{subject:c.subject,email:c.email,name:c.name},instagram:m&&{subject:m.subject,username:m.username},tiktok:f&&{subject:f.subject,username:f.username,name:f.name},linkedin:u&&{subject:u.subject,name:u.name,email:u.email,vanityName:u.vanityName},apple:v&&{subject:v.subject,email:v.email},farcaster:b&&{fid:b.fid,ownerAddress:b.ownerAddress,displayName:b.displayName,username:b.username,bio:b.bio,pfp:b.pfp,url:b.url,signerPublicKey:b.signerPublicKey},telegram:g&&{telegramUserId:g.telegramUserId,firstName:g.firstName,lastName:g.lastName,username:g.username,photoUrl:g.photoUrl},mfaMethods:E.map(k=>k.type),hasAcceptedTerms:e.has_accepted_terms??!1}}var Cp=require("@ethersproject/address"),_h=require("@ethersproject/bytes"),Ph=y(require("eventemitter3"));var Mf=y(require("@coinbase/wallet-sdk"));var cs=require("react/jsx-runtime"),ui=({style:e,...t})=>(0,cs.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,cs.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,cs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});var vo=require("@ethersproject/address"),pp=require("@ethersproject/providers"),Rf=y(require("eventemitter3"));var _f=y(require("eventemitter3"));var rw=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Tf=e=>rw.includes(e);var Sf=require("@ethersproject/logger"),Pn=require("@privy-io/js-sdk-core");var $i=class extends we{constructor(){super("Wallet timeout");this.type="wallet_error"}},Ki=class extends we{constructor(){super("User rejected connection");this.type="wallet_error"}},yo=e=>{if(e instanceof we)return e;if(e?.code&&e?.reason){let t=new $t(e);return e.code===Sf.ErrorCode.ACTION_REJECTED&&(t.details=Pn.ProviderErrors.E4001_USER_REJECTED_REQUEST),t}return e?.code?new $t(e):new we("Unknown connector error",e)},to=class extends wt{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},$t=class extends to{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(Pn.ProviderErrors).find(i=>i.eipCode===o.code);this.details=n||Pn.ProviderErrors.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=Pn.ProviderErrors.E32002_CONNECTION_ALREADY_PENDING:this.details=Pn.ProviderErrors.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=Pn.ProviderErrors.E32002_WALLET_LOCKED))}},ow={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}},sn={...ow,...Pn.ProviderErrors};var dt=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 $i,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||ii,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 we(`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 yo(r)})}},xn=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},ds=class extends _f.default{constructor(r,o,n,i,a,l=1){super();this.walletProxy=r,this.address=o,this.chainId=l,this.rpcConfig=n,this.chains=i,this.provider=Wr(l,this.chains,n,{appId:a}),this.rpcTimeoutDuration=ji(n,"privy"),this.appId=a}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new xn(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await Re()||!this.address)throw new xn("Disconnected",4900);return(await Af(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new xn(`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 xn(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=Wr(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",o)}async handlePersonalSign(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for personal_sign");let o=r.params[0],n=r.params[1];return await Pf(o,void 0,n)}async handleSignedTypedData(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_signTypedData_v4");let o=typeof r.params[1]=="string"?JSON.parse(r.params[1]):r.params[1];return await xf(Xa(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:ei(this.chainId)};try{return await this.provider.send("eth_estimateGas",[o])}catch(n){console.warn(`Gas estimation failed with error: ${n}. Retrying gas estimation by omitting the 'from' address`);try{return delete o.from,await this.provider.send("eth_estimateGas",[o])}catch(i){throw console.warn(`Gas estimation failed with error: ${i} when omitting the 'from' address`),n}}}async request(r){switch(console.debug("Embedded1193Provider.request() called with args",r),r.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return ei(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(Tf(r.method)){let o=await Re();if(await kf(),!o||!this.address)throw new xn("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 xn("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await Re();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}}},go=class extends dt{constructor(r){super(r,r.rpcTimeoutDuration)}},An=class extends dt{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 nw=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},ur=class extends Rf.default{constructor(r,o,n,i){super();this.onAccountsChanged=r=>{r.length===0?this.onDisconnect():this.syncAccounts(r)};this.onChainChanged=r=>{this.wallets.forEach(o=>{o.chainId=Bi(r),this.walletClientType==="privy"&&X.put(Al(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=ji(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,i){let a=async()=>!!this.wallets.find(l=>(0,vo.getAddress)(l.address)===(0,vo.getAddress)(r));return{address:(0,vo.getAddress)(r),chainId:o,meta:n,imported:i,switchChain:async l=>{if(!a)throw new we("Wallet is not currently connected.");let s=this.wallets.find(v=>(0,vo.getAddress)(v.address)===(0,vo.getAddress)(r))?.chainId;if(!s)throw new we("Unable to determine current chainId.");let c,m;if(typeof l=="number"?(c=`0x${l.toString(16)}`,m=l):(c=l,m=Number(l)),s===Bi(c))return;let f=this.chains.find(v=>v.id===m);if(!f)throw new we(`Unsupported chainId: ${l}`);let u=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:c}]})};try{return await u()}catch(v){if(nw(v,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:c,chainName:f.name,nativeCurrency:f.nativeCurrency,rpcUrls:[f.rpcUrls.default?.http[0]??""],blockExplorerUrls:[f.blockExplorers?.default.url??""]}]}),u();throw this.walletClientType==="rainbow"&&v.message?.includes("wallet_switchEthereumChain")?new we(`Rainbow does not support the chainId ${o}`):v}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new we("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new we("Wallet is not currently connected.");return new pp.Web3Provider(new go(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new we("Wallet is not currently connected.");return new An(this.proxyProvider)},sign:async l=>{if(!await a())throw new we("Wallet is not currently connected.");return await this.sign(l)},disconnect:()=>{this.disconnect()}}}async syncAccounts(r){let o=r;try{if(o===void 0){let c=await Ja(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});Array.isArray(c)&&(o=c)}}catch(c){console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",c)}if(!o||!Array.isArray(o)||o.length<=0||!o[0])return;let n=o[0],i=(0,vo.getAddress)(n),a=[],l;if(this.walletClientType==="privy"){let c=X.get(Al(i));this.chains.find(m=>m.id===Number(c))||(X.del(Al(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 Ja(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(typeof c=="string")l=c;else if(typeof c=="number")l=`0x${c.toString(16)}`;else throw new Error("Invalid chainId returned from provider")}catch(c){console.warn(`Failed to get chainId from provider, defaulting to ${ip}`,c),l=ip}let s=Bi(l);if(!a.find(c=>(0,vo.getAddress)(c.address)===i)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet((0,vo.getAddress)(n),s,c,this.connectorType==="embedded_imported"))}Hl(a,this.wallets)||(this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let r=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((o,n)=>n.connectedAt-o.connectedAt).find(o=>r.find(n=>(0,vo.getAddress)(n)===(0,vo.getAddress)(o.address)))||null}async isConnected(){let r=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(r)&&r.length>0}async sign(r){return await this.connect({showPrompt:!1}),new pp.Web3Provider(new go(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 iw=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],aw=(e,t)=>e.makeWeb3Provider({options:t}),up,Vl=class extends ur{constructor(r,o,n,i,a,l){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.displayName="Coinbase Wallet";if(this.proxyProvider=new dt(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=i.coinbaseWallet.connectionOptions??"all",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!up){let s=[o.id].concat(r.map(m=>m.id)),c=this.connectionOptions!=="eoaOnly"?s.filter(m=>!iw.includes(m)):[];c.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${c.join(", ")}`),up=new Mf.default({appName:a,appLogoUrl:l,appChainIds:s})}this.proxyProvider.setWalletProvider(aw(up,this.connectionOptions))}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:ui,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 we("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw yo(r)}}};var mp=require("react/jsx-runtime"),kn=({...e})=>(0,mp.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,mp.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})});var ps=class extends ur{constructor(r,o,n,i,a=!1){super("privy",o,n,i);this.connectorType="embedded";this.proxyProvider=r,a&&(this.connectorType="embedded_imported"),this.subscribeListeners()}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[ei(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:kn,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var fp=require("react/jsx-runtime"),Yi=({style:e,...t})=>(0,fp.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:(0,fp.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});var rr=require("react/jsx-runtime"),Zi=({style:e,...t})=>(0,rr.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...e},...t,children:[(0,rr.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,rr.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,rr.jsx)("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),(0,rr.jsx)("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),(0,rr.jsx)("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),(0,rr.jsx)("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),(0,rr.jsx)("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),(0,rr.jsx)("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),(0,rr.jsx)("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),(0,rr.jsx)("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),(0,rr.jsx)("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),(0,rr.jsx)("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),(0,rr.jsx)("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});var us=require("react/jsx-runtime"),No=({style:e,...t})=>(0,us.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...e},...t,children:[(0,us.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,us.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});var Ji=class extends ur{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new dt(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let l=i.provider;this.proxyProvider.setWalletProvider(l)}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new we("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw yo(r)}}},Qi,Xi=class extends ur{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";nl(this,Qi,void 0);this.proxyProvider=new dt(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?Yd(this,Qi,{name:"MetaMask",icon:Zi,id:"io.metamask"}):a==="phantom"&&Yd(this,Qi,{name:"Phantom",icon:No,id:"phantom"})}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return tm(this,Qi)??{name:"Browser Extension",icon:Yi,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 we("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw yo(r)}}};Qi=new WeakMap;var sw=require("@ethersproject/address"),lw=require("@ethersproject/providers"),If=require("react-device-detect");var Gl=class extends Ji{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{If.isMobile||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let t=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!t||t.length===0||!t[0])throw new we("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw yo(t)}}};var ql=class extends ur{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new dt(void 0,ii);this.connectorType=r}get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw new Error("connect called for an uninstalled wallet via the NullConnector")}disconnect(){throw new Error("disconnect called for an uninstalled wallet via the NullConnector")}promptConnection(r){throw new Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${r}`)}};var zl=class extends ql{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:No,id:"phantom"}}};var ta=require("@walletconnect/ethereum-provider"),Sh=require("react-device-detect");var ro=require("react");var Lf=require("react/jsx-runtime");function Wf({src:e,...t}){return(0,Lf.jsx)("img",{src:e,...t,style:{display:"none"}})}var Do=require("react"),vh=require("react");var mr={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:nf,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};var Of=({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 cw=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet"]),Nf=e=>cw.has(e),Df=(e,t,r)=>r.indexOf(e)===t,Uf=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Nf).filter(Df):e?e.filter(Nf).filter(Df):mr.appearance.walletList;var Ff={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}};var Bf={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0};var Hf={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 Vf={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 Gf={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 qf={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}},testnet:!0};var zf={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0};var $f={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 Kf={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 jf={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 Yf={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 Zf={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 Qf={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 Jf={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 Xf={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},testnet:!0};var eh={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 th={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1};var rh={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 $l={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}};var oh={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}};var nh={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0};var ih={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 ah={id:137,name:"Polygon Mainnet",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}};var sh={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0};var lh={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 ch={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 dh={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 ph={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 uh={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 mh={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 ea=[Ff,Bf,Hf,Xf,dh,$l,oh,nh,ih,ah,sh,jf,Yf,Zf,Qf,qf,zf,$f,Kf,th,rh,Vf,Gf,ph,mh,uh,eh,lh,Jf,ch],C9=new Set(ea.map(e=>e.id));var Rn=y(require("tinycolor2")),fh="#FFFFFF",dw="#040217",pw=fh,uw="#1E1E1D";function mw(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 Co(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,Rn.default)({...e.toHsl(),l:r})}var fw="#51BA81",hw="#FFB74D",yw="#EC6351",gw=fh,vw=dw;function hh({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=pw;break;case"dark":r=uw;break;default:r=e;break}let o=(0,Rn.default)(r),n=(0,Rn.default)(t),i=(0,Rn.default)(fw),a=(0,Rn.default)(hw),l=(0,Rn.default)(yw),s=mw(o.getLuminance()),c=Co(o,s==="light"?-.04:.11),m=Co(o,s==="light"?-.88:.87),f=Co(o,s==="light"?-.7:.75),u=Co(o,s==="light"?-.43:.45).desaturate(s==="light"?60:20),v=Co(o,s==="light"?-.08:.25).desaturate(s==="light"?60:20),b=Co(n,.15),g=Co(n,-.06),E=Co(l,.3),x=Co(a,.3),k=(0,Rn.default)(n.getLuminance()>.5?vw:gw),S=Co(i,-.16),A=Co(i,.4);return{colorScheme:s,background:o.toHslString(),background2:c.toHslString(),foreground:m.toHslString(),foreground2:f.toHslString(),foreground3:u.toHslString(),foreground4:v.toHslString(),accent:n.toHslString(),accentLight:b.toHslString(),accentDark:g.toHslString(),foregroundAccent:k.toHslString(),success:i.toHslString(),successDark:S.toHslString(),successLight:A.toHslString(),error:l.toHslString(),errorLight:E.toHslString(),warn:a.toHslString(),warnLight:x.toHslString()}}function hp(e,t,r){let o=r?console.warn:()=>{},n,i,a,l,s,c,m,f,u,v,b,g,E,x,k;t?.loginMethods?(n=t.loginMethods.includes("email"),i=t.loginMethods.includes("sms"),l=t.loginMethods.includes("wallet"),s=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),m=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),v=t.loginMethods.includes("instagram"),f=t.loginMethods.includes("tiktok"),g=t.loginMethods.includes("github"),b=t.loginMethods.includes("linkedin"),E=t.loginMethods.includes("apple"),x=t.loginMethods.includes("farcaster"),k=t.loginMethods.includes("telegram")):(n=e.emailAuth,i=e.smsAuth,l=e.walletAuth,s=e.googleOAuth,c=e.twitterOAuth,m=e.discordOAuth,g=e.githubOAuth,u=e.spotifyOAuth,v=e.instagramOAuth,f=e.tiktokOAuth,b=e.linkedinOAuth,E=e.appleOAuth,x=e.farcasterAuth,k=e.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?a=!1:e.passkeyAuth&&(a=!0);let S=[n,i].filter(Boolean),A=[s,c,m,g,u,v,f,b,E,x,k].filter(Boolean),M=[l].filter(Boolean);if(S.length+A.length+M.length===0)throw new Error("You must enable at least one login method");let I=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;I&&M.length===0?(o("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),I=!1):!I&&A.length+S.length===0&&(o("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),I=!0);let U=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&o("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let H=Uf({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),Y=Of({input:t?.loginMethodsAndOrder}),Z=t?.intl?.defaultCountry??"US",{chains:O,defaultChain:D}=Cw({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),L=!!t?.defaultChain,Me=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,je,Q=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?Me?je=t?.embeddedWallets?.noPromptOnSignature??!0:je=t?.embeddedWallets?.noPromptOnSignature??Q:je=Q,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&je!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:ae,...ie}=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??mr.appearance.landingHeader,loginMessage:typeof t?.appearance?.loginMessage=="string"?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:hh({backgroundTheme:t?.appearance?.theme??mr.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??mr.appearance.accentColor}),loginGroupPriority:I?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:H},loginMethods:{wallet:l,email:n,sms:i,passkey:a,google:s,twitter:c,discord:m,github:g,spotify:u,instagram:v,tiktok:f,linkedin:b,apple:E,farcaster:x,telegram:k},loginMethodsAndOrder:Y,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??mr.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??mr.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??mr.rpcConfig.rpcTimeouts},chains:O,defaultChain:D,intl:{defaultCountry:Z},shouldEnforceDefaultChainOnConnect:L,captchaEnabled:e.captchaEnabled??mr.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??mr.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:U}},embeddedWallets:{...e.embeddedWalletConfig,...typeof ae=="boolean"?{requireUserOwnedRecoveryOnCreate:ae}:{},...Me?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...ie,noPromptOnSignature:je},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:Me?{enabled:!0,...t.customAuth}:void 0,loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1,telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??mr._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??mr.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??mr.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??mr.fundingMethodConfig.moonpay.useSandbox}}}}function yh(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:n,defaultChain:i,...a}=e;return{...a,...o?{additionalChains:o.map(s=>s.id)}:void 0,...n?{supportedChains:n.map(s=>s.id)}:void 0,...i?{defaultChain:i.id}:void 0,legacyCreateEmbeddedWalletFlag:t}}function Cw({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:ea.find(m=>m.id===s.id)??s)}else n=ea.concat(e??[]);let i=t?n[0]:$l,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 gh=function(e,t=0){let r=3735928559^t,o=1103547991^t;for(let n=0,i;n<e.length;n++)i=e.charCodeAt(n),r=Math.imul(r^i,2654435761),o=Math.imul(o^i,1597334677);return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(o^o>>>13,3266489909),o=Math.imul(o^o>>>16,2246822507),o^=Math.imul(r^r>>>13,3266489909),4294967296*(2097151&o)+(r>>>0)};var bh=require("react/jsx-runtime"),Ch={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:""},yp=hp(Ch,void 0,!1),gp=(0,vh.createContext)({appConfig:yp,isServerConfigLoaded:!1}),wh=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:o})=>{let[n,i]=(0,Do.useState)(null),a=(0,Do.useMemo)(()=>hp(n??Ch,o,!!n),[n,o]);return(0,Do.useEffect)(()=>{if(!n)return;let l=yh(o,t),s=gh(JSON.stringify(l)).toString(),c=`privy:sent:${n.id}:${s}`;localStorage.getItem(c)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:l}),localStorage.setItem(c,"t"))},[o,t,n]),(0,Do.useEffect)(()=>{n||(async()=>{try{let s=await r.getServerConfig();s.customApiUrl&&r.updateApiUrl(s.customApiUrl),i(s)}catch(s){console.warn("Error generating app config: ",s)}})()},[]),(0,bh.jsx)(gp.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},pt=()=>{let{appConfig:e}=(0,Do.useContext)(gp);return e},Kl=()=>{let{isServerConfigLoaded:e}=(0,Do.useContext)(gp);return e};var T=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var jl=require("react/jsx-runtime"),Eh=(0,ro.createContext)({ready:!1,app:yp,currentScreen:null,lastScreen:null,navigate:T,navigateBack:T,resetNavigation:T,setModalData:T,onUserCloseViaDialogOrKeybindRef:void 0}),ww=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],Th=e=>{let t=pt(),r=e.authenticated,[o,n]=(0,ro.useState)(e.initialScreen);(0,ro.useEffect)(()=>{!r&&!ww.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=(0,ro.useRef)(null);(0,ro.useEffect)(()=>{e.open||(i.current=null)},[e.open]),(0,ro.useEffect)(()=>{i.current=null},[e.initialScreen]);let a={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:o,navigate:(l,s=!0)=>{e.setInitialScreen(l),s&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(o)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:i};return(0,jl.jsxs)(Eh.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&(0,jl.jsx)(Wf,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},_=()=>(0,ro.useContext)(Eh);var ln=require("react/jsx-runtime"),ms=({style:e,...t})=>{let{app:r}=_();return(0,ln.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,ln.jsx)("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,ln.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,ln.jsx)("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),(0,ln.jsx)("defs",{children:(0,ln.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,ln.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var wo=class extends ur{constructor(r,o,n,i,a,l,s,c){super(c||"unknown",n,i,o);this.connectorType="wallet_connect_v2";this.privyAppId=l,this.privyAppName=s,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new dt(void 0,this.rpcTimeoutDuration),c&&(this.walletEntry=wl[c],this.walletClientType=c)}async initialize(){let r=await this.createProvider();if(this.provider=r,this.proxyProvider.setWalletProvider(r),this.subscribeListeners(),r.session){if(this.walletProvider?.session?.peer.metadata.url){let n=Cl(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=n?.entry,this.walletClientType=n?.walletClientType||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:o}=await import("@walletconnect/modal");this.modal=new o({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(n=>{!n.open&&!this.walletProvider?.session&&this.onQrModalClosed&&this.onQrModalClosed()})}async connect(r){return r.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){return this.walletClientType==="metamask"?{name:"MetaMask",icon:Zi,id:"io.metamask"}:{name:zm(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||ms,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=wl[r],this.walletClientType=r,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,Xm(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new Ki)};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 we("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=Cl(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=ji(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(a=>{if(a){o(yo(a));return}o(new we("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=Km(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 ta.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:ta.OPTIONAL_EVENTS,optionalMethods:ta.OPTIONAL_METHODS,rpcMap:r,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),Sh.isMobile&&this.walletEntry){let{redirect:l,href:s}=Zm(a,this.walletEntry);ef({href:s,name:this.walletEntry.displayName}),this.redirectUri=l;let c=Qm(a,this.walletEntry);c?.redirect&&(this.fallbackUniversalRedirectUri=c.redirect),bl(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=Cl(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 wp=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>(0,_h.isHexString)(o)).map(o=>(0,Cp.getAddress)(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},ji=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||ii:ii,ra=class extends Ph.default{constructor(r,o,n,i,a,l,s,c,m,f,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 dt:o.proxyProvider};this.privyAppId=r,this.walletConnectCloudProjectId=o,this.rpcConfig=n,this.chains=i,this.defaultChain=a,this.walletConnectors=[],this.initialized=!1,this.store=l,this.walletList=s,this.shouldEnforceDefaultChainOnConnect=c,this.externalWalletConfig=m,this.privyAppName=f,this.privyAppLogo=u,this.storedConnections=vp()}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;X.get(op)&&(X.getKeys().forEach(o=>{o.startsWith("walletconnect")&&X.del(o)}),X.del(op));let r=$m(this.store,this.walletList,this.externalWalletConfig).then(o=>{o.forEach(({type:n,eip6963InjectedProvider:i,legacyInjectedProvider:a})=>{this.createWalletConnector("injected",n,{eip6963InjectedProvider:i,legacyInjectedProvider:a})})});this.walletList.includes("coinbase_wallet")&&this.createWalletConnector("coinbase_wallet","coinbase_wallet"),!Sn()&&this.walletList.includes("phantom")&&this.createWalletConnector("phantom","phantom"),this.externalWalletConfig.walletConnect.enabled&&this.createWalletConnector("wallet_connect_v2","unknown"),await r,this.initialized=!0}findWalletConnector(r,o){return r==="wallet_connect_v2"?this.walletConnectors.find(n=>n.connectorType===r)??null:this.walletConnectors.find(n=>n.connectorType===r&&n.walletClientType===o)??null}onInitialized(r){r.wallets.forEach(o=>{let n=this.storedConnections.find(i=>i.address===o.address&&i.connectorType===o.connectorType&&i.walletClientType===o.walletClientType);n&&(o.connectedAt=n.connectedAt)}),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(r){r.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new ds(r,o,this.rpcConfig,this.chains,i,n.id),s=new ps(l,this.chains,n,this.rpcConfig);this.addWalletConnector(s)}}addImportedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded_imported","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new ds(r,o,this.rpcConfig,this.chains,i,n.id),s=!0,c=new ps(l,this.chains,n,this.rpcConfig,s);this.addWalletConnector(c)}}removeEmbeddedWalletConnector(){let r=this.findWalletConnector("embedded","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=vp(),this.emit("walletsUpdated")}}removeImportedWalletConnector(){let r=this.findWalletConnector("embedded_imported","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=vp(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let i=this.findWalletConnector(r,o);if(i)return i instanceof wo&&i.resetConnection(o),i;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new Gl(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new Xi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new Xi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new Xi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Ji(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new Vl(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new zl(this.defaultChain):new wo(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,o)})();return l&&this.addWalletConnector(l),l||null}addWalletConnector(r){this.walletConnectors.push(r),r.on("initialized",()=>this.onInitialized(r)),r.on("walletsUpdated",()=>this.onWalletsUpdated(r)),r.initialize().catch(o=>{console.debug("Failed to initialize connector",o)})}saveConnectionHistory(){let r=this.wallets.map(o=>({address:o.address,connectorType:o.connectorType,walletClientType:o.walletClientType,connectedAt:o.connectedAt}));X.put(np,r)}async activeWalletSign(r){let o=this.wallets,n=o.length>0?o[0]:null;return n?n.sign(r):null}setActiveWallet(r){this.activeWallet=(0,Cp.getAddress)(r),this.emit("walletsUpdated")}};function Hl(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let o=e[r],n=t[r];if(o?.address!==n?.address||o?.chainId!==n?.chainId||o?.connectorType!==n?.connectorType||o?.connectedAt!==n?.connectedAt||o?.walletClientType!==n?.walletClientType||o?.isConnected!==n?.isConnected||o?.linked!==n?.linked)return!1}return!0}var bw=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",vp=()=>{let e=X.get(np);return e&&Array.isArray(e)&&e.map(o=>bw(o)).every(Boolean)?e:[]};var xh=require("ofetch");var Ew=[sl,cl,ll,ul],Yl=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=_l,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=xh.ofetch.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:i,options:a})=>{let l=new Headers(a.headers);l.set("privy-app-id",this.appId),this.appClientId&&l.set("privy-client-id",this.appClientId),l.set("privy-ca-id",this.clientAnalyticsId||""),l.set("privy-client",`react-auth:${this.sdkVersion}`);let s=Ew.includes(i.toString());if(!l.has("authorization")){let c=await this.client.getAccessToken({disableAutoRefresh:s});c!==null&&l.set("authorization",`Bearer ${c}`)}a.headers=l,a.retryDelay&&(a.retryDelay=a.retryDelay*3)},onRequestError:({error:i})=>{if(i instanceof DOMException&&i.name==="AbortError")throw new il}})}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 Ah=e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map(t=>({id:t.id,type:t.type,transports:t.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification});var mi=y(require("js-cookie"));function kh(e){return e instanceof Tn?"email":e instanceof di?"sms":e instanceof an?"siwe":e instanceof Ui?"custom_auth":e instanceof Oo?e.meta.provider:null}var Rh=y(require("jose")),bo=class{static parse(t){try{return new bo(t)}catch{return null}}constructor(t){this.value=t,this._decoded=Rh.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 Tw=30,Zl=class{constructor(){this.authenticateOnce=new rt(async t=>this._authenticate(t)),this.linkOnce=new rt(async t=>this._link(t)),this.refreshOnce=new rt(this._refresh.bind(this)),this.destroyOnce=new rt(this._destroy.bind(this)),this.forkSessionOnce=new rt(this._forkSession.bind(this))}get token(){try{let t=X.get(ti);return typeof t=="string"?new bo(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=X.get(Pl);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=X.get(ts);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=X.get(os(t));if(typeof r=="string"){let o=new bo(r);return o.isExpired()?(X.del(os(t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=mi.default.get(xl);return t!==void 0&&t.length>0}catch(t){console.error(t)}return!1}hasRefreshCredentials(){return this.mightHaveServerCookies||typeof this.token=="string"&&typeof this.refreshToken=="string"&&this.refreshToken!==uf}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=bo.parse(this.token);return t!==null&&!t.isExpired(Tw)}authenticate(t){return this.authenticateOnce.execute(t)}link(t){return this.linkOnce.execute(t)}refresh(){return this.refreshOnce.execute()}forkSession(){return this.forkSessionOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(t,r){typeof r=="string"?X.put(os(t),r):X.del(os(t))}async _authenticate(t){try{let r=await t.authenticate(),{user:o,is_new_user:n,oauth_tokens:i}=r;this.handleTokenResponse(r);let a=i,l=a?{provider:a.provider,accessToken:a.access_token,accessTokenExpiresInSeconds:a.access_token_expires_in_seconds,refreshToken:a.refresh_token,refreshTokenExpiresInSeconds:i.refresh_token_expires_in_seconds,scopes:a.scopes}:void 0,s=kh(t);return s&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:s,isNewUser:n}}),s==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}}),{user:Er(o),isNewUser:n,oAuthTokens:l}}catch(r){throw console.warn("Error authenticating session"),Rt(r)}}async _link(t){try{let r=await t.link(),o=r.oauth_tokens,n=o?{provider:o.provider,accessToken:o.access_token,accessTokenExpiresInSeconds:o.access_token_expires_in_seconds,refreshToken:o.refresh_token,refreshTokenExpiresInSeconds:o.refresh_token_expires_in_seconds,scopes:o.scopes}:void 0;return{user:Er(r),oAuthTokens:n}}catch(r){throw console.warn("Error linking account"),Rt(r)}}async _refresh(){if(!this.api)throw new w("Session has no API instance");if(!this.client)throw new w("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let t=this.token,r=this.refreshToken,o=this.forkedToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;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(sl,a,{headers:i}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(cl,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),Er(n.user)}catch(n){if(n instanceof dr&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw Rt(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(ll,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new w("Session has no API instance");let t=this.refreshToken;try{let r=await this.api.post(nm,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw Rt(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=X.get(ti);if(X.put(ti,t),!this.client?.useServerCookies){let o=bo.parse(t)?.expiration;mi.default.set(rp,t,{sameSite:"Strict",secure:!0,expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else X.del(ti),mi.default.remove(rp),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(X.put(Pl,t),this.client?.useServerCookies||mi.default.set(xl,"t",{sameSite:"Strict",secure:!0,expires:30})):(X.del(Pl),mi.default.remove(sf),mi.default.remove(xl))}clearForkedToken(){X.del(ts)}};var bp,Ql,Ih,oa=class{constructor(t){nl(this,Ql);this.apiUrl=t.apiUrl||Tl,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!t.apiUrl&&t.apiUrl.startsWith("https://privy."),this.timeout=t.timeout||af,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=rm(this,Ql,Ih).call(this),bp||(bp=new Zl),this.session=bp,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:t,rpcConfig:r,chains:o,defaultChain:n,store:i,walletList:a,shouldEnforceDefaultChainOnConnect:l,externalWalletConfig:s,appName:c}){this.connectors||(this.connectors=new ra(this.appId,t,r,o,n,i,a,l,s,c))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new Yl({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=t,t}updateApiUrl(t){this.apiUrl=t||this.fallbackApiUrl,this.api=this.generateApi(),t&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new w("No auth flow in progress.");return this.session.authenticate(this.authFlow)}link(){if(!this.authFlow)throw new w("No auth flow in progress.");return this.session.link(this.authFlow)}storeProviderAccessToken(t,r){this.session.storeProviderAccessToken(t,r)}getProviderAccessToken(t){return this.session.getProviderAccessToken(t)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(t){t.linkedAccounts.filter(o=>o.type==="cross_app").forEach(o=>{this.storeProviderAccessToken(o.providerApp.id,null)})}startAuthFlow(t){return t.api=this.api,this.authFlow=t,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(Nm,{action:"verify"})}catch(t){throw Ce(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(Dm,{});return Ah(t.options)}catch(t){throw Ce(t)}}async unlinkEmail(t){try{let r=await this.api.post(gm,{address:t});return Er(r)}catch(r){throw Rt(r)}}async acceptTerms(){try{let t=await this.api.post(Um,{});return Er(t)}catch(t){throw Rt(t)}}async unlinkPhone(t){try{let r=await this.api.post(bm,{phoneNumber:t});return Er(r)}catch(r){throw Rt(r)}}async unlinkWallet(t){try{let r=await this.api.post(lm,{address:t});return Er(r)}catch(r){throw Rt(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Sm,{provider:t,subject:r});return Er(o)}catch(o){throw Rt(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(mm,{fid:t});return Er(r)}catch(r){throw Rt(r)}}async unlinkTelegram(t){try{let r=await this.api.post(Om,{telegram_user_id:t});return Er(r)}catch(r){throw Rt(r)}}async unlinkPasskey(t){try{let r=await this.api.post(Im,{credential_id:t});return Er(r)}catch(r){throw Rt(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(ul,{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(Fm,t)}catch(r){throw Rt(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?bo.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:!t?.disableAutoRefresh&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getServerConfig(){try{let t={},r=this.session.token;r&&(t.authorization=`Bearer ${r}`);let o=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:t}),n=o.telegram_auth_config?{botId:o.telegram_auth_config.bot_id,botName:o.telegram_auth_config.bot_name,linkEnabled:o.telegram_auth_config.link_enabled,seamlessAuthEnabled:o.telegram_auth_config.seamless_auth_enabled}:void 0,i=o.funding_config?{methods:o.funding_config.methods,defaultRecommendedAmount:o.funding_config.default_recommended_amount,defaultRecommendedCurrency:o.funding_config.default_recommended_currency,promptFundingOnWalletCreation:o.funding_config.prompt_funding_on_wallet_creation}:void 0;return{id:o.id,name:o.name,verificationKey:o.verification_key,logoUrl:o.logo_url||void 0,accentColor:o.accent_color||void 0,showWalletLoginFirst:o.show_wallet_login_first,allowlistConfig:{errorTitle:o.allowlist_config.error_title,errorDetail:o.allowlist_config.error_detail,errorCtaText:o.allowlist_config.cta_text,errorCtaLink:o.allowlist_config.cta_link},walletAuth:o.wallet_auth,emailAuth:o.email_auth,smsAuth:o.sms_auth,googleOAuth:o.google_oauth,twitterOAuth:o.twitter_oauth,discordOAuth:o.discord_oauth,githubOAuth:o.github_oauth,spotifyOAuth:o.spotify_oauth,instagramOAuth:o.instagram_oauth,tiktokOAuth:o.tiktok_oauth,linkedinOAuth:o.linkedin_oauth,appleOAuth:o.apple_oauth,farcasterAuth:o.farcaster_auth,passkeyAuth:o.passkey_auth,telegramAuth:o.telegram_auth,termsAndConditionsUrl:o.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:o.embedded_wallet_config?.create_on_login,userOwnedRecoveryOptions:o.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:o.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:o.privacy_policy_url,requireUsersAcceptTerms:o.require_users_accept_terms,customApiUrl:o.custom_api_url,walletConnectCloudProjectId:o.wallet_connect_cloud_project_id,fiatOnRampEnabled:o.fiat_on_ramp_enabled,captchaEnabled:o.captcha_enabled,captchaSiteKey:o.captcha_site_key,twitterOAuthOnMobileEnabled:o.twitter_oauth_on_mobile_enabled,createdAt:new Date(o.created_at*1e3),updatedAt:new Date(o.updated_at*1e3),mfaMethods:o.mfa_methods,enforceWalletUis:o.enforce_wallet_uis,legacyWalletUiConfig:o.legacy_wallet_ui_config,telegramAuthConfiguration:n,fundingConfig:i}}catch(t){throw Rt(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()}async generateSiweNonce({address:t,captchaToken:r}){try{return(await this.api.post(im,{address:t,token:r})).nonce}catch(o){throw Rt(o)}}async authenticateWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(am,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i})}async linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(sm,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i})}async linkWithSiwe({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){try{let a=await this.linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i});return Er(a)}catch(a){throw Rt(a)}}};Ql=new WeakSet,Ih=function(){if(typeof window>"u")return null;try{let r=X.get(rs);if(typeof r=="string"&&r.length>0)return r}catch{}let t=(0,Mh.v4)();try{return X.put(rs,t),t}catch{return t}};var Nh=require("@marsidev/react-turnstile"),Jl=require("react");var oo=require("react");var Oh=require("react/jsx-runtime"),Wh=(0,oo.createContext)({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:T,setError:T,setExecuting:T,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:T,reset:T,execute:T}),Lr=class extends wt{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},Lh=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=(0,oo.useRef)(null),[i,a]=(0,oo.useState)(),[l,s]=(0,oo.useState)(),[c,m]=(0,oo.useState)(!1),f=(0,oo.useMemo)(()=>o?!c&&!i&&!l?{status:"ready"}:c&&!i&&!l?{status:"loading"}:i&&!l?{status:"success",token:i}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[o,i,l,c]);return(0,Oh.jsx)(Wh.Provider,{value:{...f,ref:n,enabled:o,siteKey:r,appId:t,setToken:a,setError:s,setExecuting:m,remove(){o&&(n.current?.remove(),m(!1),s(void 0),a(void 0))},reset(){o&&(n.current?.reset(),m(!1),s(void 0),a(void 0))},execute(){o&&(m(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await qm(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new Lr("Captcha failed",null,"captcha_timeout")}}},children:e})},We=()=>(0,oo.useContext)(Wh);var Ep=require("react/jsx-runtime"),Xl=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=We(),[,s]=(0,Jl.useMemo)(()=>r?.split("t:")||[],[r]);if((0,Jl.useEffect)(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return(0,Ep.jsx)("div",{className:"hidden h-0 w-0",children:(0,Ep.jsx)(Nh.Turnstile,{...e,ref:l,siteKey:s,options:{action:o,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),n("Captcha failed"),a(!1)},onSuccess:c=>{e.onSuccess?.(c),i(c),a(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};var En=require("react"),Uu=y(require("styled-components"));var ec=require("react");var Tp=(0,ec.createContext)({isNewUserThisSession:!1,linkingOrConnectingHint:null,walletConnectionStatus:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",nativeTokenSymbolForChainId:T,initializeWalletProxy:T,getAuthMeta:T,getAuthFlow:T,closePrivyModal:T,openPrivyModal:T,connectWallet:T,initLoginWithWallet:T,loginWithWallet:T,initLoginWithFarcaster:T,loginWithFarcaster:T,loginWithCode:T,initLoginWithEmail:T,initLoginWithSms:T,initUpdateEmail:T,resendEmailCode:T,resendSmsCode:T,initLoginWithHeadlessOAuth:T,loginWithHeadlessOAuth:T,crossAppAuthFlow:T,initLoginWithOAuth:T,recoveryOAuthFlow:T,loginWithOAuth:T,initLoginWithPasskey:T,loginWithPasskey:T,initLinkWithPasskey:T,linkWithPasskey:T,refreshUser:T,walletProxy:null,createAnalyticsEvent:T,acceptTerms:T,getUsdTokenPrice:T,recoverEmbeddedEthereumWallet:T,getMoonpaySignedUrl:T,updateWallets:T,fundWallet:T,setReadyToTrue:T,requestFarcasterSignerStatus:T,initLoginWithTelegram:T,loginWithTelegram:T,generateSiweMessage:T,linkWithSiwe:T,embeddedSolanaWallet:null,createEmbeddedSolanaWallet:T,recoverEmbeddedSolanaWallet:T}),W=()=>(0,ec.useContext)(Tp);var tc=require("react");var De=(0,tc.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:T,login:T,connectOrCreateWallet:T,linkEmail:T,linkPhone:T,linkFarcaster:T,linkWallet:T,linkCrossAppAccount:T,linkGoogle:T,linkTwitter:T,linkDiscord:T,linkGithub:T,linkSpotify:T,linkInstagram:T,linkTelegram:T,linkTiktok:T,linkLinkedIn:T,linkApple:T,linkPasskey:T,updateEmail:T,logout:T,getAccessToken:T,getEthereumProvider:T,getEthersProvider:T,getWeb3jsProvider:T,unlinkEmail:T,unlinkPhone:T,unlinkWallet:T,unlinkGoogle:T,unlinkTwitter:T,unlinkDiscord:T,unlinkGithub:T,unlinkSpotify:T,unlinkInstagram:T,unlinkTiktok:T,unlinkLinkedIn:T,unlinkApple:T,unlinkCrossAppAccount:T,unlinkFarcaster:T,unlinkTelegram:T,unlinkPasskey:T,setActiveWallet:T,forkSession:T,createWallet:T,importWallet:T,signMessage:T,signTypedData:T,enrollInMfa:T,initEnrollmentWithSms:T,initEnrollmentWithTotp:T,initEnrollmentWithPasskey:T,promptMfa:T,init:T,submitEnrollmentWithSms:T,submitEnrollmentWithTotp:T,submitEnrollmentWithPasskey:T,unenroll:T,submit:T,cancel:T,sendTransaction:T,exportWallet:T,setWalletPassword:T,setWalletRecovery:T,requestFarcasterSignerFromWarpcast:T,getFarcasterSignerPublicKey:T,signFarcasterMessage:T,initLoginWithEmail:T,initLoginWithSms:T,otpState:{status:"initial"},loginWithCode:T,fundWallet:T,initLoginWithHeadlessOAuth:T,loginWithHeadlessOAuth:T,generateSiweMessage:T,linkWithSiwe:T,signMessageWithCrossAppWallet:T,signTypedDataWithCrossAppWallet:T,sendTransactionWithCrossAppWallet:T,isHeadlessOAuthLoading:!1,isModalOpen:!1,mfaMethods:[]}),$=()=>(0,tc.useContext)(De);var rc=require("react"),Dh=e=>{let[t,r]=(0,rc.useState)("auto");return(0,rc.useEffect)(()=>{let o=new ResizeObserver(n=>{r(n[0]?.contentRect.height??"auto")});return e.current&&o.observe(e.current),()=>{e.current&&o.unobserve(e.current)}},[e.current]),t};var na=require("react"),Uh={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]}},Sp=(0,na.createContext)(void 0),Fh=()=>(0,na.useContext)(Sp);function ze(e,t){if(!t)return;let o=Fh().current[e];return(0,na.useEffect)(()=>{for(let[n,i]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]?.push(i);return()=>{for(let[n,i]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]=o[n]?.filter(a=>a!==i)}},[t])}function F(e,t,r,...o){for(let n of e.current[t][r])n(...o)}function ia(){let e=Fh();return(t,r,...o)=>F(e,t,r,...o)}function oc(e){ze("configureMfa",e)}var Yh=require("@heroicons/react/24/outline"),Ap=y(require("styled-components"));var Eo=y(require("styled-components"));var nc=y(require("styled-components")),Mn=require("react/jsx-runtime"),_t=({success:e,fail:t})=>(0,Mn.jsxs)(Mn.Fragment,{children:[(0,Mn.jsx)(Dt,{className:e?"success":t?"fail":""}),(0,Mn.jsx)(_p,{className:e?"success":t?"fail":""})]}),Dt=nc.default.span`
|
|
12
|
+
- https://privy.io`};var sn=class{constructor(t,r,o){this.getNonceOnce=new rt(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=o,this.client=r}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.client)throw new b("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign(),o=await this.client.authenticateWithSiweInternal({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,identity_token:o.identity_token,is_new_user:o.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.client)throw new b("SiweFlow has no client instance");try{let{message:t,signature:r}=await this.sign();return await this.client.linkWithSiweInternal({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.client)throw new b("SiweFlow has no client instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new b("Could not prepare SIWE message");let t=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:t}}async _getNonceOnce(){if(!this.client)throw new b("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildSiweMessage(){if(!this.client)throw new b("SiweFlow has no client instance");let t=this.wallet.address,r=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=$l({address:t,chainId:r,nonce:this.nonce}),this.preparedMessage}};var hi=class{constructor(t,r){this.meta={phoneNumber:t,captchaToken:r}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new b("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(Wm,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new b("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(Im,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw Ce(t)}}async sendSmsCode(t,r){if(!this.api)throw new b("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new b("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(Rm,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw Ce(o)}}};var Zi=class{constructor(t){this.meta={captchaToken:t}}async authenticate(){if(!this.api)throw new b("Auth flow has no API instance");try{let t=await this.api.post(qm,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData});return{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw Ce(t)}}async link(){if(!this.api)throw new b("Auth flow has no API instance");try{return await this.api.post(zm,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw Ce(t)}}};function wp(e){let t={detail:"",retryable:!1};return e?.privyErrorCode==="linked_to_another_user"&&(t.detail="This account has already been linked to another user."),e?.privyErrorCode==="disallowed_login_method"&&(t.detail="Login with Telegram not allowed."),e?.privyErrorCode==="invalid_data"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="cannot_link_more_of_type"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="invalid_credentials"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="too_many_requests"&&(t.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("rate limit")&&(t.detail="Request limit reached for Telegram. Please wait a moment and try again."),t}function Lf(){let e;if(e=_w(),e)return Of(),{...e,flowType:"login-url"};if(e=Pw(),e)return Of(),{...e,flowType:"web-app"}}function _w(){let e=new URLSearchParams(window.location.search),t=Number(e.get("id")||""),r=e.get("hash"),o=Number(e.get("auth_date")||""),n=e.get("first_name"),i=e.get("last_name")||void 0,a=e.get("username")||void 0,l=e.get("photo_url")||void 0;if(!(!t||!n||!o||!r))return{id:t,first_name:n,last_name:i,username:a,photo_url:l,auth_date:o,hash:r}}function Pw(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id"),o=t.get("user"),n=Number(t.get("auth_date")||""),i=t.get("hash");if(!(!r||!o||!n||!i))return{query_id:r,user:o,auth_date:n,hash:i}}function Of(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),window.history.replaceState({},"",e)}var qh=require("uuid");function oe(e){return e?new Date(e*1e3):null}function Aw(e){let t=[];for(let r of e){let o=r.type;switch(r.type){case"wallet":let n={address:r.address,type:r.type,imported:r.imported,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at),chainType:r.chain_type,chainId:r.chain_id,walletClient:r.wallet_client_type==="privy"?"privy":"unknown",walletClientType:r.wallet_client_type,connectorType:r.connector_type,recoveryMethod:r.recovery_method};t.push(n);break;case"cross_app":let i={type:r.type,subject:r.subject,embeddedWallets:r.embedded_wallets,smartWallets:r.smart_wallets,providerApp:{id:r.provider_app_id},verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(i);break;case"email":let a={address:r.address,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(a);break;case"phone":let l={number:r.phoneNumber,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(l);break;case"google_oauth":let s={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(s);break;case"spotify_oauth":let c={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(c);break;case"instagram_oauth":let m={subject:r.subject,username:r.username,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(m);break;case"twitter_oauth":let f={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(f);break;case"discord_oauth":let u={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(u);break;case"github_oauth":let C={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(C);break;case"tiktok_oauth":let v={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(v);break;case"linkedin_oauth":let g={subject:r.subject,name:r.name,email:r.email,vanityName:r.vanity_name,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(g);break;case"apple_oauth":let E={subject:r.subject,email:r.email,type:r.type,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(E);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)});break;case"farcaster":let S={type:r.type,fid:r.fid,ownerAddress:r.owner_address,displayName:r.display_name,username:r.username,bio:r.bio,pfp:r.profile_picture_url,url:r.homepage_url,verifiedAt:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(S);break;case"passkey":let R={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:oe(r.verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(R);break;case"telegram":let T={type:r.type,telegramUserId:r.telegram_user_id,firstName:r.first_name,lastName:r.last_name,username:r.username,photoUrl:r.photo_url,verifiedAt:oe(r.first_verified_at),firstVerifiedAt:oe(r.first_verified_at),latestVerifiedAt:oe(r.latest_verified_at)};t.push(T);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function Tr(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var Ae=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum")||null,yi=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="solana")||null,Kl=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported&&t.chainType==="ethereum")||null,xw=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Sr=(e,t)=>Ae(e)||yi(e)?!1:t==="all-users"||t==="users-without-wallets"&&!xw(e)?.length;function _r(e){if(!e)return null;let t=Aw(e.linked_accounts),r=Tr(t,"wallet"),o=Tr(t,"email"),n=Tr(t,"phone"),i=Tr(t,"google_oauth"),a=Tr(t,"twitter_oauth"),l=Tr(t,"discord_oauth"),s=Tr(t,"github_oauth"),c=Tr(t,"spotify_oauth"),m=Tr(t,"instagram_oauth"),f=Tr(t,"tiktok_oauth"),u=Tr(t,"linkedin_oauth"),C=Tr(t,"apple_oauth"),v=Tr(t,"farcaster"),g=Tr(t,"telegram"),E=e.mfa_methods.map(({type:R,verified_at:T})=>({type:R,verifiedAt:oe(T)}));return{id:e.id,createdAt:oe(e.created_at),linkedAccounts:t,email:o&&{address:o?.address},phone:n&&{number:n?.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported},google:i&&{subject:i.subject,email:i.email,name:i.name},twitter:a&&{subject:a.subject,username:a.username,name:a.name,profilePictureUrl:a.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:s&&{subject:s.subject,username:s.username,name:s.name,email:s.email},spotify:c&&{subject:c.subject,email:c.email,name:c.name},instagram:m&&{subject:m.subject,username:m.username},tiktok:f&&{subject:f.subject,username:f.username,name:f.name},linkedin:u&&{subject:u.subject,name:u.name,email:u.email,vanityName:u.vanityName},apple:C&&{subject:C.subject,email:C.email},farcaster:v&&{fid:v.fid,ownerAddress:v.ownerAddress,displayName:v.displayName,username:v.username,bio:v.bio,pfp:v.pfp,url:v.url,signerPublicKey:v.signerPublicKey},telegram:g&&{telegramUserId:g.telegramUserId,firstName:g.firstName,lastName:g.lastName,username:g.username,photoUrl:g.photoUrl},mfaMethods:E.map(R=>R.type),hasAcceptedTerms:e.has_accepted_terms??!1}}var kp=require("@ethersproject/address"),Uh=require("@ethersproject/bytes"),Fh=y(require("eventemitter3"));var qf=y(require("@coinbase/wallet-sdk"));var fs=require("react/jsx-runtime"),ln=({style:e,...t})=>(0,fs.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,fs.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,fs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});var bo=require("@ethersproject/address"),bp=require("@ethersproject/providers"),Vf=y(require("eventemitter3"));var Uf=y(require("eventemitter3"));var kw=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],Nf=e=>kw.includes(e);var Df=require("@ethersproject/logger"),kn=require("@privy-io/js-sdk-core");var Qi=class extends we{constructor(){super("Wallet timeout");this.type="wallet_error"}},Ji=class extends we{constructor(){super("User rejected connection");this.type="wallet_error"}},Co=e=>{if(e instanceof we)return e;if(e?.code&&e?.reason){let t=new Kt(e);return e.code===Df.ErrorCode.ACTION_REJECTED&&(t.details=kn.ProviderErrors.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Kt(e):new we("Unknown connector error",e)},oo=class extends wt{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},Kt=class extends oo{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(kn.ProviderErrors).find(i=>i.eipCode===o.code);this.details=n||kn.ProviderErrors.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=kn.ProviderErrors.E32002_CONNECTION_ALREADY_PENDING:this.details=kn.ProviderErrors.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=kn.ProviderErrors.E32002_WALLET_LOCKED))}},Rw={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}},cn={...Rw,...kn.ProviderErrors};var ct=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 Qi,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||di,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 we(`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 Co(r)})}},Rn=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},hs=class extends Uf.default{constructor(r,o,n,i,a,l=1){super();this.walletProxy=r,this.address=o,this.chainId=l,this.rpcConfig=n,this.chains=i,this.provider=Er(l,this.chains,n,{appId:a}),this.rpcTimeoutDuration=Xi(n,"privy"),this.appId=a}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new Rn(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await Re()||!this.address)throw new Rn("Disconnected",4900);return(await Hf(o)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new Rn(`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 Rn(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=Er(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",o)}async handlePersonalSign(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for personal_sign");let o=r.params[0],n=r.params[1];return await Ff(o,void 0,n)}async handleSignedTypedData(r){if(!r.params||!Array.isArray(r.params))throw new Error("Invalid params for eth_signTypedData_v4");let o=typeof r.params[1]=="string"?JSON.parse(r.params[1]):r.params[1];return await Bf(ns(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:ii(this.chainId)};try{return await this.provider.send("eth_estimateGas",[o])}catch(n){console.warn(`Gas estimation failed with error: ${n}. Retrying gas estimation by omitting the 'from' address`);try{return delete o.from,await this.provider.send("eth_estimateGas",[o])}catch(i){throw console.warn(`Gas estimation failed with error: ${i} when omitting the 'from' address`),n}}}async request(r){switch(console.debug("Embedded1193Provider.request() called with args",r),r.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return ii(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(Nf(r.method)){let o=await Re();if(await Gf(),!o||!this.address)throw new Rn("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 Rn("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await Re();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}}},wo=class extends ct{constructor(r){super(r,r.rpcTimeoutDuration)}},In=class extends ct{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 Iw=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},mr=class extends Vf.default{constructor(r,o,n,i){super();this.onAccountsChanged=r=>{r.length===0?this.onDisconnect():this.syncAccounts(r)};this.onChainChanged=r=>{this.wallets.forEach(o=>{o.chainId=zi(r),this.walletClientType==="privy"&&X.put(Ll(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=Xi(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,i){let a=async()=>!!this.wallets.find(l=>(0,bo.getAddress)(l.address)===(0,bo.getAddress)(r));return{address:(0,bo.getAddress)(r),chainId:o,meta:n,imported:i,switchChain:async l=>{if(!a)throw new we("Wallet is not currently connected.");let s=this.wallets.find(C=>(0,bo.getAddress)(C.address)===(0,bo.getAddress)(r))?.chainId;if(!s)throw new we("Unable to determine current chainId.");let c,m;if(typeof l=="number"?(c=`0x${l.toString(16)}`,m=l):(c=l,m=Number(l)),s===zi(c))return;let f=this.chains.find(C=>C.id===m);if(!f)throw new we(`Unsupported chainId: ${l}`);let u=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:c}]})};try{return await u()}catch(C){if(Iw(C,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:c,chainName:f.name,nativeCurrency:f.nativeCurrency,rpcUrls:[f.rpcUrls.default?.http[0]??""],blockExplorerUrls:[f.blockExplorers?.default.url??""]}]}),u();throw this.walletClientType==="rainbow"&&C.message?.includes("wallet_switchEthereumChain")?new we(`Rainbow does not support the chainId ${o}`):C}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new we("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new we("Wallet is not currently connected.");return new bp.Web3Provider(new wo(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new we("Wallet is not currently connected.");return new In(this.proxyProvider)},sign:async l=>{if(!await a())throw new we("Wallet is not currently connected.");return await this.sign(l)},disconnect:()=>{this.disconnect()}}}async syncAccounts(r){let o=r;try{if(o===void 0){let c=await os(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});Array.isArray(c)&&(o=c)}}catch(c){console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",c)}if(!o||!Array.isArray(o)||o.length<=0||!o[0])return;let n=o[0],i=(0,bo.getAddress)(n),a=[],l;if(this.walletClientType==="privy"){let c=X.get(Ll(i));this.chains.find(m=>m.id===Number(c))||(X.del(Ll(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 os(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(typeof c=="string")l=c;else if(typeof c=="number")l=`0x${c.toString(16)}`;else throw new Error("Invalid chainId returned from provider")}catch(c){console.warn(`Failed to get chainId from provider, defaulting to ${hp}`,c),l=hp}let s=zi(l);if(!a.find(c=>(0,bo.getAddress)(c.address)===i)){let c={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet((0,bo.getAddress)(n),s,c,this.connectorType==="embedded_imported"))}jl(a,this.wallets)||(this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let r=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((o,n)=>n.connectedAt-o.connectedAt).find(o=>r.find(n=>(0,bo.getAddress)(n)===(0,bo.getAddress)(o.address)))||null}async isConnected(){let r=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(r)&&r.length>0}async sign(r){return await this.connect({showPrompt:!1}),new bp.Web3Provider(new wo(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 Mw=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],Ww=(e,t)=>e.makeWeb3Provider({options:t}),Ep,Yl=class extends mr{constructor(r,o,n,i,a,l){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.displayName="Coinbase Wallet";if(this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=i.coinbaseWallet.connectionOptions??"all",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!Ep){let s=[o.id].concat(r.map(m=>m.id)),c=this.connectionOptions!=="eoaOnly"?s.filter(m=>!Mw.includes(m)):[];c.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${c.join(", ")}`),Ep=new qf.default({appName:a,appLogoUrl:l,appChainIds:s})}this.proxyProvider.setWalletProvider(Ww(Ep,this.connectionOptions))}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:ln,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 we("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw Co(r)}}};var Tp=require("react/jsx-runtime"),Mn=({...e})=>(0,Tp.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,Tp.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})});var ys=class extends mr{constructor(r,o,n,i,a=!1){super("privy",o,n,i);this.connectorType="embedded";this.proxyProvider=r,a&&(this.connectorType="embedded_imported"),this.subscribeListeners()}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[ii(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Mn,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var Sp=require("react/jsx-runtime"),ea=({style:e,...t})=>(0,Sp.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:(0,Sp.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});var or=require("react/jsx-runtime"),ta=({style:e,...t})=>(0,or.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...e},...t,children:[(0,or.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,or.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,or.jsx)("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),(0,or.jsx)("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),(0,or.jsx)("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),(0,or.jsx)("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),(0,or.jsx)("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),(0,or.jsx)("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),(0,or.jsx)("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),(0,or.jsx)("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),(0,or.jsx)("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),(0,or.jsx)("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),(0,or.jsx)("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});var gs=require("react/jsx-runtime"),Uo=({style:e,...t})=>(0,gs.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...e},...t,children:[(0,gs.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,gs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});var oa=class extends mr{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=i;let l=i.provider;this.proxyProvider.setWalletProvider(l)}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new we("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Co(r)}}},ra,na=class extends mr{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";pl(this,ra,void 0);this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?op(this,ra,{name:"MetaMask",icon:ta,id:"io.metamask"}):a==="phantom"&&op(this,ra,{name:"Phantom",icon:Uo,id:"phantom"})}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return um(this,ra)??{name:"Browser Extension",icon:ea,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 we("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Co(r)}}};ra=new WeakMap;var Ow=require("@ethersproject/address"),Lw=require("@ethersproject/providers"),zf=require("react-device-detect");var Zl=class extends oa{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{zf.isMobile||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let t=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!t||t.length===0||!t[0])throw new we("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw Co(t)}}};var Ql=class extends mr{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new ct(void 0,di);this.connectorType=r}get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw new Error("connect called for an uninstalled wallet via the NullConnector")}disconnect(){throw new Error("disconnect called for an uninstalled wallet via the NullConnector")}promptConnection(r){throw new Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${r}`)}};var Jl=class extends Ql{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:Uo,id:"phantom"}}};var aa=require("@walletconnect/ethereum-provider"),Dh=require("react-device-detect");var no=require("react");var Kf=require("react/jsx-runtime");function $f({src:e,...t}){return(0,Kf.jsx)("img",{src:e,...t,style:{display:"none"}})}var Fo=require("react"),Ih=require("react");var fr={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:vf,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};var jf=({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 Nw=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet"]),Yf=e=>Nw.has(e),Zf=(e,t,r)=>r.indexOf(e)===t,Qf=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Yf).filter(Zf):e?e.filter(Yf).filter(Zf):fr.appearance.walletList;var Jf={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}};var Xf={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0};var eh={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 th={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 rh={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 oh={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}},testnet:!0};var nh={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0};var ih={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 ah={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 sh={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 lh={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 ch={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 dh={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 ph={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 uh={id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},testnet:!0};var mh={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 fh={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1};var hh={id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0};var Xl={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}};var yh={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}};var gh={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0};var vh={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 Ch={id:137,name:"Polygon Mainnet",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}};var wh={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0};var bh={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 Eh={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 Th={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 Sh={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 _h={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 Ph={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 ia=[Jf,Xf,eh,uh,Th,Xl,yh,gh,vh,Ch,wh,sh,lh,ch,dh,oh,nh,ih,ah,fh,hh,th,rh,Sh,Ph,_h,mh,bh,ph,Eh],oS=new Set(ia.map(e=>e.id));var Wn=y(require("tinycolor2")),Ah="#FFFFFF",Dw="#040217",Uw=Ah,Fw="#1E1E1D";function Bw(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 Eo(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,Wn.default)({...e.toHsl(),l:r})}var Hw="#51BA81",Gw="#FFB74D",Vw="#EC6351",qw=Ah,zw=Dw;function xh({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=Uw;break;case"dark":r=Fw;break;default:r=e;break}let o=(0,Wn.default)(r),n=(0,Wn.default)(t),i=(0,Wn.default)(Hw),a=(0,Wn.default)(Gw),l=(0,Wn.default)(Vw),s=Bw(o.getLuminance()),c=Eo(o,s==="light"?-.04:.11),m=Eo(o,s==="light"?-.88:.87),f=Eo(o,s==="light"?-.7:.75),u=Eo(o,s==="light"?-.43:.45).desaturate(s==="light"?60:20),C=Eo(o,s==="light"?-.08:.25).desaturate(s==="light"?60:20),v=Eo(n,.15),g=Eo(n,-.06),E=Eo(l,.3),S=Eo(a,.3),R=(0,Wn.default)(n.getLuminance()>.5?zw:qw),T=Eo(i,-.16),A=Eo(i,.4);return{colorScheme:s,background:o.toHslString(),background2:c.toHslString(),foreground:m.toHslString(),foreground2:f.toHslString(),foreground3:u.toHslString(),foreground4:C.toHslString(),accent:n.toHslString(),accentLight:v.toHslString(),accentDark:g.toHslString(),foregroundAccent:R.toHslString(),success:i.toHslString(),successDark:T.toHslString(),successLight:A.toHslString(),error:l.toHslString(),errorLight:E.toHslString(),warn:a.toHslString(),warnLight:S.toHslString()}}function _p(e,t,r){let o=r?console.warn:()=>{},n,i,a,l,s,c,m,f,u,C,v,g,E,S,R;t?.loginMethods?(n=t.loginMethods.includes("email"),i=t.loginMethods.includes("sms"),l=t.loginMethods.includes("wallet"),s=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),m=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),C=t.loginMethods.includes("instagram"),f=t.loginMethods.includes("tiktok"),g=t.loginMethods.includes("github"),v=t.loginMethods.includes("linkedin"),E=t.loginMethods.includes("apple"),S=t.loginMethods.includes("farcaster"),R=t.loginMethods.includes("telegram")):(n=e.emailAuth,i=e.smsAuth,l=e.walletAuth,s=e.googleOAuth,c=e.twitterOAuth,m=e.discordOAuth,g=e.githubOAuth,u=e.spotifyOAuth,C=e.instagramOAuth,f=e.tiktokOAuth,v=e.linkedinOAuth,E=e.appleOAuth,S=e.farcasterAuth,R=e.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?a=!1:e.passkeyAuth&&(a=!0);let T=[n,i].filter(Boolean),A=[s,c,m,g,u,C,f,v,E,S,R].filter(Boolean),k=[l].filter(Boolean);if(T.length+A.length+k.length===0)throw new Error("You must enable at least one login method");let M=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;M&&k.length===0?(o("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),M=!1):!M&&A.length+T.length===0&&(o("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),M=!0);let D=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&o("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let G=Qf({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),Y=jf({input:t?.loginMethodsAndOrder}),Z=t?.intl?.defaultCountry??"US",{chains:L,defaultChain:U}=$w({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),O=!!t?.defaultChain,Ie=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,je,Q=!(e.enforceWalletUis??!0);if(e.legacyWalletUiConfig??!0?Ie?je=t?.embeddedWallets?.noPromptOnSignature??!0:je=t?.embeddedWallets?.noPromptOnSignature??Q:je=Q,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&je!==!0)throw new Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:re,...ae}=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??fr.appearance.landingHeader,loginMessage:typeof t?.appearance?.loginMessage=="string"?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:xh({backgroundTheme:t?.appearance?.theme??fr.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??fr.appearance.accentColor}),loginGroupPriority:M?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:G},loginMethods:{wallet:l,email:n,sms:i,passkey:a,google:s,twitter:c,discord:m,github:g,spotify:u,instagram:C,tiktok:f,linkedin:v,apple:E,farcaster:S,telegram:R},loginMethodsAndOrder:Y,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??fr.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??fr.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??fr.rpcConfig.rpcTimeouts},chains:L,defaultChain:U,intl:{defaultCountry:Z},shouldEnforceDefaultChainOnConnect:O,captchaEnabled:e.captchaEnabled??fr.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??fr.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:D}},embeddedWallets:{...e.embeddedWalletConfig,...typeof re=="boolean"?{requireUserOwnedRecoveryOnCreate:re}:{},...Ie?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...ae,noPromptOnSignature:je},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:Ie?{enabled:!0,...t.customAuth}:void 0,loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1,telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??fr._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??fr.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??fr.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??fr.fundingMethodConfig.moonpay.useSandbox}}}}function kh(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:n,defaultChain:i,...a}=e;return{...a,...o?{additionalChains:o.map(s=>s.id)}:void 0,...n?{supportedChains:n.map(s=>s.id)}:void 0,...i?{defaultChain:i.id}:void 0,legacyCreateEmbeddedWalletFlag:t}}function $w({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:ia.find(m=>m.id===s.id)??s)}else n=ia.concat(e??[]);let i=t?n[0]:Xl,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 Rh=function(e,t=0){let r=3735928559^t,o=1103547991^t;for(let n=0,i;n<e.length;n++)i=e.charCodeAt(n),r=Math.imul(r^i,2654435761),o=Math.imul(o^i,1597334677);return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(o^o>>>13,3266489909),o=Math.imul(o^o>>>16,2246822507),o^=Math.imul(r^r>>>13,3266489909),4294967296*(2097151&o)+(r>>>0)};var Oh=require("react/jsx-runtime"),Mh={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:""},Pp=_p(Mh,void 0,!1),Ap=(0,Ih.createContext)({appConfig:Pp,isServerConfigLoaded:!1}),Wh=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:o})=>{let[n,i]=(0,Fo.useState)(null),a=(0,Fo.useMemo)(()=>_p(n??Mh,o,!!n),[n,o]);return(0,Fo.useEffect)(()=>{if(!n)return;let l=kh(o,t),s=Rh(JSON.stringify(l)).toString(),c=`privy:sent:${n.id}:${s}`;localStorage.getItem(c)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:l}),localStorage.setItem(c,"t"))},[o,t,n]),(0,Fo.useEffect)(()=>{n||(async()=>{try{let s=await r.getServerConfig();s.customApiUrl&&r.updateApiUrl(s.customApiUrl),i(s)}catch(s){console.warn("Error generating app config: ",s)}})()},[]),(0,Oh.jsx)(Ap.Provider,{value:{appConfig:a,isServerConfigLoaded:!!n},children:e})},dt=()=>{let{appConfig:e}=(0,Fo.useContext)(Ap);return e},ec=()=>{let{isServerConfigLoaded:e}=(0,Fo.useContext)(Ap);return e};var _=()=>{throw new Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")};var tc=require("react/jsx-runtime"),Lh=(0,no.createContext)({ready:!1,app:Pp,currentScreen:null,lastScreen:null,navigate:_,navigateBack:_,resetNavigation:_,setModalData:_,onUserCloseViaDialogOrKeybindRef:void 0}),Kw=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],Nh=e=>{let t=dt(),r=e.authenticated,[o,n]=(0,no.useState)(e.initialScreen);(0,no.useEffect)(()=>{!r&&!Kw.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=(0,no.useRef)(null);(0,no.useEffect)(()=>{e.open||(i.current=null)},[e.open]),(0,no.useEffect)(()=>{i.current=null},[e.initialScreen]);let a={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:o,navigate:(l,s=!0)=>{e.setInitialScreen(l),s&&n(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(o)},resetNavigation:()=>{e.setInitialScreen(null),n(null)},onUserCloseViaDialogOrKeybindRef:i};return(0,tc.jsxs)(Lh.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&(0,tc.jsx)($f,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},P=()=>(0,no.useContext)(Lh);var dn=require("react/jsx-runtime"),vs=({style:e,...t})=>{let{app:r}=P();return(0,dn.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,dn.jsx)("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,dn.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,dn.jsx)("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),(0,dn.jsx)("defs",{children:(0,dn.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,dn.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var To=class extends mr{constructor(r,o,n,i,a,l,s,c){super(c||"unknown",n,i,o);this.connectorType="wallet_connect_v2";this.privyAppId=l,this.privyAppName=s,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new ct(void 0,this.rpcTimeoutDuration),c&&(this.walletEntry=Al[c],this.walletClientType=c)}async initialize(){let r=await this.createProvider();if(this.provider=r,this.proxyProvider.setWalletProvider(r),this.subscribeListeners(),r.session){if(this.walletProvider?.session?.peer.metadata.url){let n=Pl(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=n?.entry,this.walletClientType=n?.walletClientType||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:o}=await import("@walletconnect/modal");this.modal=new o({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(n=>{!n.open&&!this.walletProvider?.session&&this.onQrModalClosed&&this.onQrModalClosed()})}async connect(r){return r.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){return this.walletClientType==="metamask"?{name:"MetaMask",icon:ta,id:"io.metamask"}:{name:nf(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||vs,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=Al[r],this.walletClientType=r,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,mf(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new Ji)};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 we("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=Pl(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Xi(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(a=>{if(a){o(Co(a));return}o(new we("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=sf(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 aa.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:aa.OPTIONAL_EVENTS,optionalMethods:aa.OPTIONAL_METHODS,rpcMap:r,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return i.on("display_uri",a=>{if(i.signer.abortPairingAttempt(),Dh.isMobile&&this.walletEntry){let{redirect:l,href:s}=df(a,this.walletEntry);ff({href:s,name:this.walletEntry.displayName}),this.redirectUri=l;let c=pf(a,this.walletEntry);c?.redirect&&(this.fallbackUniversalRedirectUri=c.redirect),xl(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=Pl(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 Rp=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>(0,Uh.isHexString)(o)).map(o=>(0,kp.getAddress)(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},Xi=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||di:di,sa=class extends Fh.default{constructor(r,o,n,i,a,l,s,c,m,f,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 ct:o.proxyProvider};this.privyAppId=r,this.walletConnectCloudProjectId=o,this.rpcConfig=n,this.chains=i,this.defaultChain=a,this.walletConnectors=[],this.initialized=!1,this.store=l,this.walletList=s,this.shouldEnforceDefaultChainOnConnect=c,this.externalWalletConfig=m,this.privyAppName=f,this.privyAppLogo=u,this.storedConnections=xp()}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;X.get(mp)&&(X.getKeys().forEach(o=>{o.startsWith("walletconnect")&&X.del(o)}),X.del(mp));let r=af(this.store,this.walletList,this.externalWalletConfig).then(o=>{o.forEach(({type:n,eip6963InjectedProvider:i,legacyInjectedProvider:a})=>{this.createWalletConnector("injected",n,{eip6963InjectedProvider:i,legacyInjectedProvider:a})})});this.walletList.includes("coinbase_wallet")&&this.createWalletConnector("coinbase_wallet","coinbase_wallet"),!An()&&this.walletList.includes("phantom")&&this.createWalletConnector("phantom","phantom"),this.externalWalletConfig.walletConnect.enabled&&this.createWalletConnector("wallet_connect_v2","unknown"),await r,this.initialized=!0}findWalletConnector(r,o){return r==="wallet_connect_v2"?this.walletConnectors.find(n=>n.connectorType===r)??null:this.walletConnectors.find(n=>n.connectorType===r&&n.walletClientType===o)??null}onInitialized(r){r.wallets.forEach(o=>{let n=this.storedConnections.find(i=>i.address===o.address&&i.connectorType===o.connectorType&&i.walletClientType===o.walletClientType);n&&(o.connectedAt=n.connectedAt)}),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(r){r.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new hs(r,o,this.rpcConfig,this.chains,i,n.id),s=new ys(l,this.chains,n,this.rpcConfig);this.addWalletConnector(s)}}addImportedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded_imported","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new hs(r,o,this.rpcConfig,this.chains,i,n.id),s=!0,c=new ys(l,this.chains,n,this.rpcConfig,s);this.addWalletConnector(c)}}removeEmbeddedWalletConnector(){let r=this.findWalletConnector("embedded","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=xp(),this.emit("walletsUpdated")}}removeImportedWalletConnector(){let r=this.findWalletConnector("embedded_imported","privy");if(r){let o=this.walletConnectors.indexOf(r);this.walletConnectors.splice(o,1),this.saveConnectionHistory(),this.storedConnections=xp(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let i=this.findWalletConnector(r,o);if(i)return i instanceof To&&i.resetConnection(o),i;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new Zl(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new na(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new na(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new na(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new oa(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new Yl(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new Jl(this.defaultChain):new To(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,o)})();return l&&this.addWalletConnector(l),l||null}addWalletConnector(r){this.walletConnectors.push(r),r.on("initialized",()=>this.onInitialized(r)),r.on("walletsUpdated",()=>this.onWalletsUpdated(r)),r.initialize().catch(o=>{console.debug("Failed to initialize connector",o)})}saveConnectionHistory(){let r=this.wallets.map(o=>({address:o.address,connectorType:o.connectorType,walletClientType:o.walletClientType,connectedAt:o.connectedAt}));X.put(fp,r)}async activeWalletSign(r){let o=this.wallets,n=o.length>0?o[0]:null;return n?n.sign(r):null}setActiveWallet(r){this.activeWallet=(0,kp.getAddress)(r),this.emit("walletsUpdated")}};function jl(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let o=e[r],n=t[r];if(o?.address!==n?.address||o?.chainId!==n?.chainId||o?.connectorType!==n?.connectorType||o?.connectedAt!==n?.connectedAt||o?.walletClientType!==n?.walletClientType||o?.isConnected!==n?.isConnected||o?.linked!==n?.linked)return!1}return!0}var jw=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",xp=()=>{let e=X.get(fp);return e&&Array.isArray(e)&&e.map(o=>jw(o)).every(Boolean)?e:[]};var Bh=require("ofetch");var Yw=[fl,yl,hl,Cl],rc=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=Ml,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=Bh.ofetch.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:i,options:a})=>{let l=new Headers(a.headers);l.set("privy-app-id",this.appId),this.appClientId&&l.set("privy-client-id",this.appClientId),l.set("privy-ca-id",this.clientAnalyticsId||""),l.set("privy-client",`react-auth:${this.sdkVersion}`);let s=Yw.includes(i.toString());if(!l.has("authorization")){let c=await this.client.getAccessToken({disableAutoRefresh:s});c!==null&&l.set("authorization",`Bearer ${c}`)}a.headers=l,a.retryDelay&&(a.retryDelay=a.retryDelay*3)},onRequestError:({error:i})=>{if(i instanceof DOMException&&i.name==="AbortError")throw new ul}})}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 Hh=e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map(t=>({id:t.id,type:t.type,transports:t.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification});var pn=y(require("js-cookie"));function Gh(e){return e instanceof Pn?"email":e instanceof hi?"sms":e instanceof sn?"siwe":e instanceof Vi?"custom_auth":e instanceof Do?e.meta.provider:null}var Vh=y(require("jose")),io=class{static parse(t){try{return new io(t)}catch{return null}}constructor(t){this.value=t,this._decoded=Vh.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 Zw=30,oc=class{constructor(){this.authenticateOnce=new rt(async t=>this._authenticate(t)),this.linkOnce=new rt(async t=>this._link(t)),this.refreshOnce=new rt(this._refresh.bind(this)),this.destroyOnce=new rt(this._destroy.bind(this)),this.forkSessionOnce=new rt(this._forkSession.bind(this))}get token(){try{let t=X.get(ai);return typeof t=="string"?new io(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=X.get(Wl);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=X.get(as);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=X.get(ls(t));if(typeof r=="string"){let o=new io(r);return o.isExpired()?(X.del(ls(t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=pn.default.get(Ol);return t!==void 0&&t.length>0}catch(t){console.error(t)}return!1}hasRefreshCredentials(){return this.mightHaveServerCookies||typeof this.token=="string"&&typeof this.refreshToken=="string"&&this.refreshToken!==_f}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=io.parse(this.token);return t!==null&&!t.isExpired(Zw)}authenticate(t){return this.authenticateOnce.execute(t)}link(t){return this.linkOnce.execute(t)}refresh(){return this.refreshOnce.execute()}forkSession(){return this.forkSessionOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(t,r){typeof r=="string"?X.put(ls(t),r):X.del(ls(t))}async _authenticate(t){try{let r=await t.authenticate(),{user:o,is_new_user:n,oauth_tokens:i}=r;this.handleTokenResponse(r);let a=i,l=a?{provider:a.provider,accessToken:a.access_token,accessTokenExpiresInSeconds:a.access_token_expires_in_seconds,refreshToken:a.refresh_token,refreshTokenExpiresInSeconds:i.refresh_token_expires_in_seconds,scopes:a.scopes}:void 0,s=Gh(t);return s&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:s,isNewUser:n}}),s==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}}),{user:_r(o),isNewUser:n,oAuthTokens:l}}catch(r){throw console.warn("Error authenticating session"),bt(r)}}async _link(t){try{let r=await t.link(),o=r.oauth_tokens,n=o?{provider:o.provider,accessToken:o.access_token,accessTokenExpiresInSeconds:o.access_token_expires_in_seconds,refreshToken:o.refresh_token,refreshTokenExpiresInSeconds:o.refresh_token_expires_in_seconds,scopes:o.scopes}:void 0;return{user:_r(r),oAuthTokens:n}}catch(r){throw console.warn("Error linking account"),bt(r)}}async _refresh(){if(!this.api)throw new b("Session has no API instance");if(!this.client)throw new b("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let t=this.token,r=this.refreshToken,o=this.forkedToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;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(fl,a,{headers:i}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(yl,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),_r(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 bt(n)}}handleTokenResponse(t){t.session_update_action?t.session_update_action==="set"?(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token)):t.session_update_action==="clear"?this.destroyLocalState():t.session_update_action==="ignore"&&t.token&&(this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token)):(this.storeRefreshToken(t.refresh_token),this.storeToken(t.token),t.identity_token&&this.storeIdentityToken(t.identity_token))}async _destroy(){try{await this.api?.post(hl,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new b("Session has no API instance");let t=this.refreshToken;try{let r=await this.api.post(hm,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw bt(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=X.get(ai);if(X.put(ai,t),!this.client?.useServerCookies){let o=io.parse(t)?.expiration;pn.default.set(dp,t,{sameSite:"Strict",secure:!0,expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else X.del(ai),pn.default.remove(dp),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(X.put(Wl,t),this.client?.useServerCookies||pn.default.set(Ol,"t",{sameSite:"Strict",secure:!0,expires:30})):(X.del(Wl),pn.default.remove(wf),pn.default.remove(Ol))}storeIdentityToken(t){if(this.client?.useServerCookies)return;X.put(pp,t);let r=io.parse(t)?.expiration;pn.default.set(up,t,{sameSite:"Strict",secure:!0,expires:r?new Date(r*1e3):void 0})}clearIdentityToken(){X.del(pp),pn.default.remove(up)}clearForkedToken(){X.del(as)}};var Ip,nc,zh,la=class{constructor(t){pl(this,nc);this.apiUrl=t.apiUrl||Rl,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!t.apiUrl&&t.apiUrl.startsWith("https://privy."),this.timeout=t.timeout||Cf,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=mm(this,nc,zh).call(this),Ip||(Ip=new oc),this.session=Ip,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:t,rpcConfig:r,chains:o,defaultChain:n,store:i,walletList:a,shouldEnforceDefaultChainOnConnect:l,externalWalletConfig:s,appName:c}){this.connectors||(this.connectors=new sa(this.appId,t,r,o,n,i,a,l,s,c))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new rc({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=t,t}updateApiUrl(t){this.apiUrl=t||this.fallbackApiUrl,this.api=this.generateApi(),t&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new b("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new b("No auth flow in progress.");let{oAuthTokens:t}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:t}}storeProviderAccessToken(t,r){this.session.storeProviderAccessToken(t,r)}getProviderAccessToken(t){return this.session.getProviderAccessToken(t)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(t){t.linkedAccounts.filter(o=>o.type==="cross_app").forEach(o=>{this.storeProviderAccessToken(o.providerApp.id,null)})}startAuthFlow(t){return t.api=this.api,this.authFlow=t,this.authFlow}async initMfaSmsVerification(){try{await this.api.post(Km,{action:"verify"})}catch(t){throw Ce(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(jm,{});return Hh(t.options)}catch(t){throw Ce(t)}}async acceptTerms(){try{let t=await this.api.post(Ym,{});return _r(t)}catch(t){throw bt(t)}}async unlinkEmail(t){try{let r=await this.api.post(xm,{address:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkPhone(t){try{let r=await this.api.post(Mm,{phoneNumber:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkWallet(t){try{let r=await this.api.post(Cm,{address:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Lm,{provider:t,subject:r});return await this.getAuthenticatedUser()??_r(o)}catch(o){throw bt(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(Sm,{fid:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkTelegram(t){try{let r=await this.api.post($m,{telegram_user_id:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async unlinkPasskey(t){try{let r=await this.api.post(Vm,{credential_id:t});return await this.getAuthenticatedUser()??_r(r)}catch(r){throw bt(r)}}async createAnalyticsEvent({eventName:t,payload:r,timestamp:o,options:n}){if(!(typeof window>"u"))try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(Cl,{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(Qm,t)}catch(r){throw bt(r)}}async initCoinbaseOnRamp(t){try{return this.api.post(Jm,t)}catch(r){throw bt(r)}}async getCoinbaseOnRampStatus({partnerUserId:t}){try{return this.api.get(`${Xm}?partnerUserId=${t}`)}catch(r){throw bt(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?io.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:!t?.disableAutoRefresh&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getServerConfig(){try{let t={},r=this.session.token;r&&(t.authorization=`Bearer ${r}`);let o=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:t}),n=o.telegram_auth_config?{botId:o.telegram_auth_config.bot_id,botName:o.telegram_auth_config.bot_name,linkEnabled:o.telegram_auth_config.link_enabled,seamlessAuthEnabled:o.telegram_auth_config.seamless_auth_enabled}:void 0,i=o.funding_config?{methods:o.funding_config.methods,defaultRecommendedAmount:o.funding_config.default_recommended_amount,defaultRecommendedCurrency:o.funding_config.default_recommended_currency,promptFundingOnWalletCreation:o.funding_config.prompt_funding_on_wallet_creation}:void 0;return{id:o.id,name:o.name,verificationKey:o.verification_key,logoUrl:o.logo_url||void 0,accentColor:o.accent_color||void 0,showWalletLoginFirst:o.show_wallet_login_first,allowlistConfig:{errorTitle:o.allowlist_config.error_title,errorDetail:o.allowlist_config.error_detail,errorCtaText:o.allowlist_config.cta_text,errorCtaLink:o.allowlist_config.cta_link},walletAuth:o.wallet_auth,emailAuth:o.email_auth,smsAuth:o.sms_auth,googleOAuth:o.google_oauth,twitterOAuth:o.twitter_oauth,discordOAuth:o.discord_oauth,githubOAuth:o.github_oauth,spotifyOAuth:o.spotify_oauth,instagramOAuth:o.instagram_oauth,tiktokOAuth:o.tiktok_oauth,linkedinOAuth:o.linkedin_oauth,appleOAuth:o.apple_oauth,farcasterAuth:o.farcaster_auth,passkeyAuth:o.passkey_auth,telegramAuth:o.telegram_auth,termsAndConditionsUrl:o.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:o.embedded_wallet_config?.create_on_login,userOwnedRecoveryOptions:o.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:o.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:o.privacy_policy_url,requireUsersAcceptTerms:o.require_users_accept_terms,customApiUrl:o.custom_api_url,walletConnectCloudProjectId:o.wallet_connect_cloud_project_id,fiatOnRampEnabled:o.fiat_on_ramp_enabled,captchaEnabled:o.captcha_enabled,captchaSiteKey:o.captcha_site_key,twitterOAuthOnMobileEnabled:o.twitter_oauth_on_mobile_enabled,createdAt:new Date(o.created_at*1e3),updatedAt:new Date(o.updated_at*1e3),mfaMethods:o.mfa_methods,enforceWalletUis:o.enforce_wallet_uis,legacyWalletUiConfig:o.legacy_wallet_ui_config,telegramAuthConfiguration:n,fundingConfig:i}}catch(t){throw bt(t)}}async getUsdTokenPrice(t){try{return(await this.api.get(`/api/v1/token_price?chainId=${t.id}&tokenSymbol=${t.nativeCurrency.symbol}`)).usd}catch{console.error(`Unable to fetch token price for chain with id ${t.id}`);return}}async requestFarcasterSignerStatus(t){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:t})}catch(r){throw console.error("Unable to fetch Farcaster signer status"),r}}async forkSession(){return await this.session.forkSession()}async generateSiweNonce({address:t,captchaToken:r}){try{return(await this.api.post(ym,{address:t,token:r})).nonce}catch(o){throw bt(o)}}async authenticateWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(gm,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i})}async linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(vm,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i})}async linkWithSiwe({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){try{let a=await this.linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i});return _r(a)}catch(a){throw bt(a)}}};nc=new WeakSet,zh=function(){if(typeof window>"u")return null;try{let r=X.get(ss);if(typeof r=="string"&&r.length>0)return r}catch{}let t=(0,qh.v4)();try{return X.put(ss,t),t}catch{return t}};var Yh=require("@marsidev/react-turnstile"),ic=require("react");var ao=require("react");var jh=require("react/jsx-runtime"),$h=(0,ao.createContext)({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:_,setError:_,setExecuting:_,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:_,reset:_,execute:_}),Nr=class extends wt{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},Kh=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=(0,ao.useRef)(null),[i,a]=(0,ao.useState)(),[l,s]=(0,ao.useState)(),[c,m]=(0,ao.useState)(!1),f=(0,ao.useMemo)(()=>o?!c&&!i&&!l?{status:"ready"}:c&&!i&&!l?{status:"loading"}:i&&!l?{status:"success",token:i}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[o,i,l,c]);return(0,jh.jsx)($h.Provider,{value:{...f,ref:n,enabled:o,siteKey:r,appId:t,setToken:a,setError:s,setExecuting:m,remove(){o&&(n.current?.remove(),m(!1),s(void 0),a(void 0))},reset(){o&&(n.current?.reset(),m(!1),s(void 0),a(void 0))},execute(){o&&(m(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await of(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new Nr("Captcha failed",null,"captcha_timeout")}}},children:e})},We=()=>(0,ao.useContext)($h);var Mp=require("react/jsx-runtime"),ac=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=We(),[,s]=(0,ic.useMemo)(()=>r?.split("t:")||[],[r]);if((0,ic.useEffect)(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return(0,Mp.jsx)("div",{className:"hidden h-0 w-0",children:(0,Mp.jsx)(Yh.Turnstile,{...e,ref:l,siteKey:s,options:{action:o,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),n("Captcha failed"),a(!1)},onSuccess:c=>{e.onSuccess?.(c),i(c),a(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};var _n=require("react"),Zu=y(require("styled-components"));var sc=require("react");var Wp=(0,sc.createContext)({isNewUserThisSession:!1,linkingOrConnectingHint:null,walletConnectionStatus:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",nativeTokenSymbolForChainId:_,initializeWalletProxy:_,getAuthMeta:_,getAuthFlow:_,closePrivyModal:_,openPrivyModal:_,connectWallet:_,initLoginWithWallet:_,loginWithWallet:_,initLoginWithFarcaster:_,loginWithFarcaster:_,loginWithCode:_,initLoginWithEmail:_,initLoginWithSms:_,initUpdateEmail:_,resendEmailCode:_,resendSmsCode:_,initLoginWithHeadlessOAuth:_,loginWithHeadlessOAuth:_,crossAppAuthFlow:_,initLoginWithOAuth:_,recoveryOAuthFlow:_,loginWithOAuth:_,initLoginWithPasskey:_,loginWithPasskey:_,initLinkWithPasskey:_,linkWithPasskey:_,refreshUser:_,walletProxy:null,createAnalyticsEvent:_,acceptTerms:_,getUsdTokenPrice:_,recoverEmbeddedEthereumWallet:_,getMoonpaySignedUrl:_,initCoinbaseOnRamp:_,getCoinbaseOnRampStatus:_,updateWallets:_,fundWallet:_,setReadyToTrue:_,requestFarcasterSignerStatus:_,initLoginWithTelegram:_,loginWithTelegram:_,generateSiweMessage:_,linkWithSiwe:_,embeddedSolanaWallet:null,createEmbeddedSolanaWallet:_,recoverEmbeddedSolanaWallet:_}),W=()=>(0,sc.useContext)(Wp);var lc=require("react");var De=(0,lc.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:_,login:_,connectOrCreateWallet:_,linkEmail:_,linkPhone:_,linkFarcaster:_,linkWallet:_,linkCrossAppAccount:_,linkGoogle:_,linkTwitter:_,linkDiscord:_,linkGithub:_,linkSpotify:_,linkInstagram:_,linkTelegram:_,linkTiktok:_,linkLinkedIn:_,linkApple:_,linkPasskey:_,updateEmail:_,logout:_,getAccessToken:_,getEthereumProvider:_,getEthersProvider:_,getWeb3jsProvider:_,unlinkEmail:_,unlinkPhone:_,unlinkWallet:_,unlinkGoogle:_,unlinkTwitter:_,unlinkDiscord:_,unlinkGithub:_,unlinkSpotify:_,unlinkInstagram:_,unlinkTiktok:_,unlinkLinkedIn:_,unlinkApple:_,unlinkCrossAppAccount:_,unlinkFarcaster:_,unlinkTelegram:_,unlinkPasskey:_,setActiveWallet:_,forkSession:_,createWallet:_,importWallet:_,signMessage:_,signTypedData:_,enrollInMfa:_,initEnrollmentWithSms:_,initEnrollmentWithTotp:_,initEnrollmentWithPasskey:_,promptMfa:_,init:_,submitEnrollmentWithSms:_,submitEnrollmentWithTotp:_,submitEnrollmentWithPasskey:_,unenroll:_,submit:_,cancel:_,sendTransaction:_,exportWallet:_,setWalletPassword:_,setWalletRecovery:_,requestFarcasterSignerFromWarpcast:_,getFarcasterSignerPublicKey:_,signFarcasterMessage:_,initLoginWithEmail:_,initLoginWithSms:_,otpState:{status:"initial"},loginWithCode:_,fundWallet:_,initLoginWithHeadlessOAuth:_,loginWithHeadlessOAuth:_,generateSiweMessage:_,linkWithSiwe:_,signMessageWithCrossAppWallet:_,signTypedDataWithCrossAppWallet:_,sendTransactionWithCrossAppWallet:_,isHeadlessOAuthLoading:!1,isModalOpen:!1,mfaMethods:[]}),$=()=>(0,lc.useContext)(De);var cc=require("react"),Zh=e=>{let[t,r]=(0,cc.useState)("auto");return(0,cc.useEffect)(()=>{let o=new ResizeObserver(n=>{r(n[0]?.contentRect.height??"auto")});return e.current&&o.observe(e.current),()=>{e.current&&o.unobserve(e.current)}},[e.current]),t};var ca=require("react"),Qh={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]}},Op=(0,ca.createContext)(void 0),Jh=()=>(0,ca.useContext)(Op);function He(e,t){if(!t)return;let o=Jh().current[e];return(0,ca.useEffect)(()=>{for(let[n,i]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]?.push(i);return()=>{for(let[n,i]of Object.entries(t))o.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),o[n]=o[n]?.filter(a=>a!==i)}},[t])}function B(e,t,r,...o){for(let n of e.current[t][r])n(...o)}function da(){let e=Jh();return(t,r,...o)=>B(e,t,r,...o)}function dc(e){He("configureMfa",e)}var ly=require("@heroicons/react/24/outline"),Dp=y(require("styled-components"));var So=y(require("styled-components"));var pc=y(require("styled-components")),On=require("react/jsx-runtime"),Pt=({success:e,fail:t})=>(0,On.jsxs)(On.Fragment,{children:[(0,On.jsx)(At,{className:e?"success":t?"fail":""}),(0,On.jsx)(Cs,{className:e?"success":t?"fail":""})]}),At=pc.default.span`
|
|
13
13
|
&& {
|
|
14
14
|
width: 82px;
|
|
15
15
|
height: 82px;
|
|
@@ -42,13 +42,13 @@ Resources:
|
|
|
42
42
|
border-color: var(--privy-color-error);
|
|
43
43
|
border-bottom-color: var(--privy-color-error);
|
|
44
44
|
}
|
|
45
|
-
`,
|
|
45
|
+
`,Cs=(0,pc.default)(At)`
|
|
46
46
|
&& {
|
|
47
47
|
border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
|
|
48
48
|
animation: none;
|
|
49
49
|
opacity: 0.5;
|
|
50
50
|
}
|
|
51
|
-
`,
|
|
51
|
+
`,Bo=e=>(0,On.jsx)(Qw,{color:e.color||"var(--privy-color-foreground-3)"}),Qw=(0,pc.default)(At)`
|
|
52
52
|
&& {
|
|
53
53
|
height: 1rem;
|
|
54
54
|
width: 1rem;
|
|
@@ -58,7 +58,7 @@ Resources:
|
|
|
58
58
|
/* Override default Loader to match button transitions */
|
|
59
59
|
transition: border-color 200ms ease;
|
|
60
60
|
}
|
|
61
|
-
`;var
|
|
61
|
+
`;var xt=require("react/jsx-runtime"),ws=So.default.button`
|
|
62
62
|
display: flex;
|
|
63
63
|
flex-direction: row;
|
|
64
64
|
align-items: center;
|
|
@@ -80,7 +80,7 @@ Resources:
|
|
|
80
80
|
&& {
|
|
81
81
|
padding: 12px 16px;
|
|
82
82
|
}
|
|
83
|
-
`,
|
|
83
|
+
`,H=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,xt.jsx)(Xh,{disabled:t||r,...n,children:t?(0,xt.jsxs)("span",{children:[(0,xt.jsx)(Bo,{}),o?(0,xt.jsx)("span",{children:o}):null]}):e}),uc=({children:e,loading:t,disabled:r,...o})=>(0,xt.jsx)(Jw,{disabled:r,...o,children:t?(0,xt.jsx)(Bo,{color:"var(--privy-color-foreground-accent)"}):e}),Jw=(0,So.default)(ws)`
|
|
84
84
|
position: relative;
|
|
85
85
|
|
|
86
86
|
&& {
|
|
@@ -106,7 +106,7 @@ Resources:
|
|
|
106
106
|
color: var(--privy-color-foreground-accent);
|
|
107
107
|
background-color: var(--privy-color-accent-dark);
|
|
108
108
|
}
|
|
109
|
-
`,
|
|
109
|
+
`,mc=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,xt.jsx)(Xh,{as:"a",disabled:t||r,...n,children:t?(0,xt.jsxs)("span",{children:[(0,xt.jsx)(Bo,{}),o?(0,xt.jsx)("span",{children:o}):null]}):e}),Xh=(0,So.default)(ws)`
|
|
110
110
|
position: relative;
|
|
111
111
|
|
|
112
112
|
&& {
|
|
@@ -132,7 +132,7 @@ Resources:
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
/* If an anchor tag, :disabled isn't a thing, so manually set state */
|
|
135
|
-
${e=>e.disabled?
|
|
135
|
+
${e=>e.disabled?So.css`
|
|
136
136
|
&&&,
|
|
137
137
|
&&&:hover,
|
|
138
138
|
&&&:active {
|
|
@@ -151,7 +151,7 @@ Resources:
|
|
|
151
151
|
opacity: 1;
|
|
152
152
|
animation: fadein 200ms ease;
|
|
153
153
|
}
|
|
154
|
-
`,
|
|
154
|
+
`,_o=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>(0,xt.jsx)(Xw,{disabled:t||r,...n,children:t?(0,xt.jsxs)("span",{children:[(0,xt.jsx)(Bo,{}),o?(0,xt.jsx)("span",{children:o}):null]}):e}),Xw=(0,So.default)(ws)`
|
|
155
155
|
&& {
|
|
156
156
|
border-width: 1px;
|
|
157
157
|
border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"};
|
|
@@ -180,7 +180,7 @@ Resources:
|
|
|
180
180
|
opacity: 1;
|
|
181
181
|
animation: fadein 200ms ease;
|
|
182
182
|
}
|
|
183
|
-
`,
|
|
183
|
+
`,Ln=So.default.button`
|
|
184
184
|
&& {
|
|
185
185
|
padding: 12px 16px;
|
|
186
186
|
font-weight: 500;
|
|
@@ -193,7 +193,7 @@ Resources:
|
|
|
193
193
|
transition: opacity 200ms ease, background-color 200ms ease, color 200ms ease;
|
|
194
194
|
user-select: none;
|
|
195
195
|
|
|
196
|
-
${e=>e.invisible&&
|
|
196
|
+
${e=>e.invisible&&So.css`
|
|
197
197
|
pointer-events: none;
|
|
198
198
|
`}
|
|
199
199
|
|
|
@@ -211,10 +211,10 @@ Resources:
|
|
|
211
211
|
cursor: not-allowed;
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
`,
|
|
214
|
+
`,q_=So.default.div`
|
|
215
215
|
/* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */
|
|
216
216
|
height: 44px;
|
|
217
|
-
`,
|
|
217
|
+
`,pa=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>(0,xt.jsxs)(e4,{isSubmitting:o,onClick:t,disabled:r,...n,children:[(0,xt.jsx)("span",{children:e}),(0,xt.jsx)("span",{children:(0,xt.jsx)(Bo,{})})]}),e4=So.default.button`
|
|
218
218
|
&& {
|
|
219
219
|
color: var(--privy-color-accent);
|
|
220
220
|
font-size: 16px;
|
|
@@ -256,7 +256,7 @@ Resources:
|
|
|
256
256
|
cursor: not-allowed;
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
|
-
`;var
|
|
259
|
+
`;var ey=y(require("styled-components")),ty=ey.default.span`
|
|
260
260
|
&& {
|
|
261
261
|
width: 82px;
|
|
262
262
|
height: 82px;
|
|
@@ -268,7 +268,7 @@ Resources:
|
|
|
268
268
|
display: inline-block;
|
|
269
269
|
box-sizing: border-box;
|
|
270
270
|
}
|
|
271
|
-
`;var
|
|
271
|
+
`;var ry=y(require("@heroicons/react/24/outline/ArrowLeftIcon")),oy=y(require("@heroicons/react/24/outline/QuestionMarkCircleIcon")),ny=y(require("@heroicons/react/24/outline/XMarkIcon")),gi=y(require("styled-components"));var Ft=require("react/jsx-runtime"),t4=({backFn:e})=>(0,Ft.jsx)("div",{children:(0,Ft.jsx)(Lp,{onClick:e,children:(0,Ft.jsx)(ry.default,{height:"16px",width:"16px",strokeWidth:2})})}),r4=({infoFn:e})=>(0,Ft.jsx)("div",{children:(0,Ft.jsx)(n4,{"aria-label":"info",onClick:e,children:(0,Ft.jsx)(oy.default,{height:"22px",width:"22px",strokeWidth:2})})}),o4=e=>(0,Ft.jsx)("div",{children:(0,Ft.jsx)(Lp,{"aria-label":"close modal",onClick:e.onClose,children:(0,Ft.jsx)(ny.default,{height:"16px",width:"16px",strokeWidth:2})})});var x=({backFn:e,infoFn:t,onClose:r,title:o,closeable:n=!0})=>{let{closePrivyModal:i}=W(),a=dt();return(0,Ft.jsxs)(i4,{children:[(0,Ft.jsxs)(a4,{children:[e&&(0,Ft.jsx)(t4,{backFn:e}),t&&(0,Ft.jsx)(r4,{infoFn:t})]}),o&&(0,Ft.jsx)(l4,{id:"privy-dialog-title",children:o}),(0,Ft.jsx)(s4,{children:!a.render.standalone&&n&&(0,Ft.jsx)(o4,{onClose:r||(()=>i())})})]})},Lp=gi.default.button`
|
|
272
272
|
&& {
|
|
273
273
|
cursor: pointer;
|
|
274
274
|
display: flex;
|
|
@@ -287,11 +287,11 @@ Resources:
|
|
|
287
287
|
opacity: 1;
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
-
`,
|
|
290
|
+
`,n4=(0,gi.default)(Lp)`
|
|
291
291
|
&& {
|
|
292
292
|
background-color: transparent;
|
|
293
293
|
}
|
|
294
|
-
`,
|
|
294
|
+
`,i4=gi.default.div`
|
|
295
295
|
padding: 16px 0;
|
|
296
296
|
display: flex;
|
|
297
297
|
align-items: center;
|
|
@@ -303,23 +303,23 @@ Resources:
|
|
|
303
303
|
font-weight: 600;
|
|
304
304
|
color: var(--privy-color-foreground);
|
|
305
305
|
}
|
|
306
|
-
`,
|
|
306
|
+
`,a4=gi.default.div`
|
|
307
307
|
flex: 1;
|
|
308
308
|
align-items: center;
|
|
309
309
|
display: flex;
|
|
310
310
|
gap: 8px;
|
|
311
|
-
`,
|
|
311
|
+
`,s4=gi.default.div`
|
|
312
312
|
flex: 1;
|
|
313
313
|
display: flex;
|
|
314
314
|
justify-content: flex-end;
|
|
315
|
-
`,
|
|
315
|
+
`,l4=gi.default.div`
|
|
316
316
|
overflow: hidden;
|
|
317
317
|
white-space: nowrap;
|
|
318
318
|
max-width: 100%;
|
|
319
319
|
text-overflow: ellipsis;
|
|
320
320
|
text-align: center;
|
|
321
321
|
color: var(--privy-color-foreground-2);
|
|
322
|
-
`;var
|
|
322
|
+
`;var iy=y(require("styled-components")),c4=iy.default.div`
|
|
323
323
|
display: flex;
|
|
324
324
|
flex-direction: column;
|
|
325
325
|
justify-content: center;
|
|
@@ -342,15 +342,15 @@ Resources:
|
|
|
342
342
|
left: -19px;
|
|
343
343
|
top: -19px;
|
|
344
344
|
}
|
|
345
|
-
`,
|
|
345
|
+
`,vt=c4;var Po=y(require("styled-components")),Ho=Po.default.div`
|
|
346
346
|
text-align: left;
|
|
347
347
|
flex-grow: 1;
|
|
348
|
-
`,
|
|
348
|
+
`,fc=Po.default.div`
|
|
349
349
|
display: flex;
|
|
350
350
|
flex-direction: column;
|
|
351
351
|
justify-content: flex-end;
|
|
352
352
|
flex-grow: 1;
|
|
353
|
-
`,
|
|
353
|
+
`,Pr=Po.default.div`
|
|
354
354
|
display: flex;
|
|
355
355
|
flex-direction: column;
|
|
356
356
|
gap: 12px;
|
|
@@ -365,13 +365,13 @@ Resources:
|
|
|
365
365
|
&::-webkit-scrollbar {
|
|
366
366
|
display: none;
|
|
367
367
|
}
|
|
368
|
-
`,
|
|
368
|
+
`,ay=(0,Po.default)(Pr)`
|
|
369
369
|
${e=>{if(e.colorScheme==="light")return"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;";if(e.colorScheme==="dark")return"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;"}}
|
|
370
370
|
|
|
371
371
|
background-repeat: no-repeat;
|
|
372
372
|
background-size: 100% 32px, 100% 16px;
|
|
373
373
|
background-attachment: local, scroll;
|
|
374
|
-
`,
|
|
374
|
+
`,sy=Po.css`
|
|
375
375
|
&& {
|
|
376
376
|
width: 100%;
|
|
377
377
|
font-size: 16px;
|
|
@@ -408,22 +408,22 @@ Resources:
|
|
|
408
408
|
max-width: 24px;
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
|
-
`,
|
|
411
|
+
`,hc=Po.default.div`
|
|
412
412
|
text-align: center;
|
|
413
413
|
font-size: 14px;
|
|
414
414
|
margin-bottom: 24px;
|
|
415
|
-
`,
|
|
416
|
-
${
|
|
417
|
-
`,
|
|
418
|
-
${
|
|
419
|
-
`,
|
|
415
|
+
`,Oe=Po.default.button`
|
|
416
|
+
${sy}
|
|
417
|
+
`,Np=Po.default.a`
|
|
418
|
+
${sy}
|
|
419
|
+
`,Ao=Po.default.div`
|
|
420
420
|
width: 100%;
|
|
421
421
|
height: 100%;
|
|
422
422
|
min-height: inherit;
|
|
423
423
|
display: flex;
|
|
424
424
|
flex-direction: column;
|
|
425
425
|
${e=>e.if?"display: none;":""}
|
|
426
|
-
`;var
|
|
426
|
+
`;var nr=require("react/jsx-runtime"),cy=()=>{let{navigate:e,app:t}=P();return(0,nr.jsxs)(nr.Fragment,{children:[(0,nr.jsx)(x,{}),(0,nr.jsxs)(d4,{children:[(0,nr.jsx)(vt,{children:(0,nr.jsxs)("div",{children:[(0,nr.jsx)(ty,{color:"var(--privy-color-warn-light)"}),(0,nr.jsx)(ly.QuestionMarkCircleIcon,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),(0,nr.jsxs)(p4,{children:[(0,nr.jsx)("h3",{children:"Account not found"}),(0,nr.jsxs)("p",{children:["Please try logging in again or go to ",t.name," to create an account."]})]}),(0,nr.jsx)(Ho,{}),(0,nr.jsx)(H,{onClick:()=>e("LANDING"),children:"Try logging in again"})]})]})},d4=Dp.default.div`
|
|
427
427
|
display: flex;
|
|
428
428
|
flex-direction: column;
|
|
429
429
|
align-items: center;
|
|
@@ -432,11 +432,11 @@ Resources:
|
|
|
432
432
|
width: 100%;
|
|
433
433
|
padding-bottom: 16px;
|
|
434
434
|
margin-top: 24px;
|
|
435
|
-
`,
|
|
435
|
+
`,p4=Dp.default.div`
|
|
436
436
|
display: flex;
|
|
437
437
|
flex-direction: column;
|
|
438
438
|
gap: 8px;
|
|
439
|
-
`;var
|
|
439
|
+
`;var Bp=y(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),py=y(require("@heroicons/react/24/solid/DocumentCheckIcon")),uy=y(require("styled-components"));var Fp=y(require("styled-components"));var Go=require("react/jsx-runtime"),Up=Fp.default.div`
|
|
440
440
|
margin-top: 16px;
|
|
441
441
|
font-size: 13px;
|
|
442
442
|
text-align: center;
|
|
@@ -445,7 +445,7 @@ Resources:
|
|
|
445
445
|
&& > a {
|
|
446
446
|
color: var(--privy-color-accent);
|
|
447
447
|
}
|
|
448
|
-
`;function
|
|
448
|
+
`;function ua(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:r,requireUsersAcceptTerms:o}}=e.app;if(o&&!e.alwaysShowImplicitConsent)return(0,Go.jsx)(Up,{});if(!r&&!t)return(0,Go.jsx)(Up,{});let n=!!(t&&r);return(0,Go.jsxs)(Up,{children:["By logging in I agree to the"," ",r&&(0,Go.jsx)("a",{href:r,target:"_blank",children:n?"Terms":"Terms of Service"}),n&&" & ",t&&(0,Go.jsx)("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var K=()=>(0,Go.jsxs)(J,{children:[(0,Go.jsx)(Mn,{}),(0,Go.jsx)("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})]}),J=Fp.default.div`
|
|
449
449
|
display: flex;
|
|
450
450
|
align-items: center;
|
|
451
451
|
justify-content: center;
|
|
@@ -472,7 +472,7 @@ Resources:
|
|
|
472
472
|
@media all and (display-mode: standalone) {
|
|
473
473
|
padding-bottom: 30px;
|
|
474
474
|
}
|
|
475
|
-
`;var
|
|
475
|
+
`;var Wt=y(require("styled-components")),Ye=Wt.default.div`
|
|
476
476
|
display: flex;
|
|
477
477
|
flex-direction: column;
|
|
478
478
|
align-items: center;
|
|
@@ -480,17 +480,17 @@ Resources:
|
|
|
480
480
|
@media (max-width: 440px) {
|
|
481
481
|
padding: 10px 10px 20px;
|
|
482
482
|
}
|
|
483
|
-
`,Te=
|
|
483
|
+
`,Te=Wt.default.div`
|
|
484
484
|
font-size: 18px;
|
|
485
485
|
line-height: 30px;
|
|
486
486
|
text-align: center;
|
|
487
487
|
font-weight: 600;
|
|
488
488
|
margin-bottom: 10px;
|
|
489
|
-
`,Pe=
|
|
489
|
+
`,Pe=Wt.default.div`
|
|
490
490
|
font-size: 0.875rem;
|
|
491
491
|
|
|
492
492
|
text-align: center;
|
|
493
|
-
`,
|
|
493
|
+
`,so=Wt.default.div`
|
|
494
494
|
display: flex;
|
|
495
495
|
flex-direction: column;
|
|
496
496
|
align-items: center;
|
|
@@ -500,7 +500,7 @@ Resources:
|
|
|
500
500
|
@media (max-width: 440px) {
|
|
501
501
|
padding: 10px 10px 20px;
|
|
502
502
|
}
|
|
503
|
-
`,
|
|
503
|
+
`,vi=Wt.default.div`
|
|
504
504
|
display: flex;
|
|
505
505
|
flex-direction: column;
|
|
506
506
|
align-items: stretch;
|
|
@@ -508,7 +508,7 @@ Resources:
|
|
|
508
508
|
padding: 1rem 0rem 0rem;
|
|
509
509
|
flex-grow: 1;
|
|
510
510
|
width: 100%;
|
|
511
|
-
`,
|
|
511
|
+
`,Ar=Wt.default.div`
|
|
512
512
|
width: 25px;
|
|
513
513
|
display: flex;
|
|
514
514
|
align-items: center;
|
|
@@ -520,19 +520,19 @@ Resources:
|
|
|
520
520
|
width: 25px !important;
|
|
521
521
|
color: var(--privy-color-accent);
|
|
522
522
|
}
|
|
523
|
-
`,
|
|
523
|
+
`,xr=Wt.default.div`
|
|
524
524
|
display: flex;
|
|
525
525
|
align-items: center;
|
|
526
526
|
gap: 10px;
|
|
527
527
|
font-size: 0.875rem;
|
|
528
528
|
line-height: 1rem;
|
|
529
529
|
text-align: left;
|
|
530
|
-
`,
|
|
530
|
+
`,ir=Wt.default.div`
|
|
531
531
|
display: flex;
|
|
532
532
|
flex-direction: column;
|
|
533
533
|
gap: 10px;
|
|
534
534
|
padding-top: 20px;
|
|
535
|
-
`,
|
|
535
|
+
`,yc=Wt.default.div`
|
|
536
536
|
display: flex;
|
|
537
537
|
flex-direction: column;
|
|
538
538
|
align-items: stretch;
|
|
@@ -540,11 +540,11 @@ Resources:
|
|
|
540
540
|
padding: 1rem 0rem 0rem;
|
|
541
541
|
flex-grow: 1;
|
|
542
542
|
width: 100%;
|
|
543
|
-
`,
|
|
543
|
+
`,gc=Wt.default.div`
|
|
544
544
|
display: flex;
|
|
545
545
|
gap: 5px;
|
|
546
546
|
width: 100%;
|
|
547
|
-
`,
|
|
547
|
+
`,vc=Wt.default.button`
|
|
548
548
|
&& {
|
|
549
549
|
background-color: transparent;
|
|
550
550
|
color: var(--privy-color-foreground-3);
|
|
@@ -562,7 +562,7 @@ Resources:
|
|
|
562
562
|
&&:hover {
|
|
563
563
|
color: var(--privy-color-error);
|
|
564
564
|
}
|
|
565
|
-
`,
|
|
565
|
+
`,Cc=Wt.default.div`
|
|
566
566
|
display: flex;
|
|
567
567
|
align-items: center;
|
|
568
568
|
gap: 0.5rem;
|
|
@@ -572,7 +572,7 @@ Resources:
|
|
|
572
572
|
height: 20px !important;
|
|
573
573
|
width: 20px !important;
|
|
574
574
|
}
|
|
575
|
-
`,
|
|
575
|
+
`,Ci=Wt.default.div`
|
|
576
576
|
display: flex;
|
|
577
577
|
align-items: center;
|
|
578
578
|
gap: 6px;
|
|
@@ -586,15 +586,15 @@ Resources:
|
|
|
586
586
|
display: flex !important;
|
|
587
587
|
align-items: flex-end;
|
|
588
588
|
}
|
|
589
|
-
`,
|
|
589
|
+
`,wc=Wt.default.div`
|
|
590
590
|
width: 100%;
|
|
591
591
|
display: flex;
|
|
592
592
|
justify-content: space-between;
|
|
593
|
-
`,
|
|
593
|
+
`,dy=Wt.default.p`
|
|
594
594
|
text-align: left;
|
|
595
595
|
width: 100%;
|
|
596
596
|
color: var(--privy-color-foreground-3) !important;
|
|
597
|
-
`,
|
|
597
|
+
`,bs=Wt.default.button`
|
|
598
598
|
display: flex;
|
|
599
599
|
flex-direction: row;
|
|
600
600
|
align-items: center;
|
|
@@ -624,7 +624,7 @@ Resources:
|
|
|
624
624
|
&:hover {
|
|
625
625
|
text-decoration: underline;
|
|
626
626
|
}
|
|
627
|
-
`,mt=
|
|
627
|
+
`,mt=Wt.default.div`
|
|
628
628
|
display: flex;
|
|
629
629
|
align-items: center;
|
|
630
630
|
justify-content: center;
|
|
@@ -639,12 +639,12 @@ Resources:
|
|
|
639
639
|
width: auto !important;
|
|
640
640
|
color: white;
|
|
641
641
|
}
|
|
642
|
-
`,
|
|
642
|
+
`,bc=Wt.default.div`
|
|
643
643
|
color: var(--privy-color-error);
|
|
644
|
-
`;var
|
|
644
|
+
`;var Ot=require("react/jsx-runtime"),my=()=>{let{user:e,logout:t}=$(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:i}=P(),{acceptTerms:a,closePrivyModal:l,createAnalyticsEvent:s}=W(),c=f=>{f?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};o.current=c;let m=async f=>{f.preventDefault(),await a(),e&&Sr(e,r?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:u=>{console.error(u),s({eventName:"embedded_wallet_creation_failure_logout",payload:{error:u,screen:"AffirmativeConsentScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):l()};return(0,Ot.jsx)(u4,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:m,onDecline:c})},u4=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>(0,Ot.jsxs)(Ot.Fragment,{children:[(0,Ot.jsx)(x,{closeable:!1}),(0,Ot.jsx)(py.default,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),(0,Ot.jsx)(Te,{style:{marginTop:24},children:"One last step"}),(0,Ot.jsx)(Pe,{children:"By signing up, you agree to our terms and privacy policy."}),(0,Ot.jsxs)(Pr,{style:{marginTop:24},children:[e&&(0,Ot.jsxs)(Np,{target:"_blank",href:e,children:["View Terms ",(0,Ot.jsx)(Bp.default,{style:{marginLeft:"auto"}})]}),t&&(0,Ot.jsxs)(Np,{target:"_blank",href:t,children:["View Privacy Policy ",(0,Ot.jsx)(Bp.default,{style:{marginLeft:"auto"}})]})]}),(0,Ot.jsxs)(m4,{style:{marginTop:24},children:[(0,Ot.jsx)(_o,{onClick:o,children:"No thanks"}),(0,Ot.jsx)(H,{onClick:r,children:"Accept"})]}),(0,Ot.jsx)(K,{})]}),m4=uy.default.div`
|
|
645
645
|
display: flex;
|
|
646
646
|
gap: 10px;
|
|
647
|
-
`;var
|
|
647
|
+
`;var Gp=y(require("styled-components"));var fy=y(require("styled-components")),Ec=fy.default.span`
|
|
648
648
|
&& {
|
|
649
649
|
width: 82px;
|
|
650
650
|
height: 82px;
|
|
@@ -659,7 +659,7 @@ Resources:
|
|
|
659
659
|
transition: border-color 800ms;
|
|
660
660
|
border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
|
|
661
661
|
}
|
|
662
|
-
`;var
|
|
662
|
+
`;var Hp=require("react/jsx-runtime"),Tc=({style:e,...t})=>(0,Hp.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...t,children:(0,Hp.jsx)("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})});var kt=require("react/jsx-runtime"),hy=()=>{let{navigate:e,app:t}=P(),r=t?.allowlistConfig.errorTitle||"You don't have access to this app",o=t?.allowlistConfig.errorDetail||"Have you been invited?",n=t?.allowlistConfig.errorCtaText||"Try another account";return(0,kt.jsxs)(kt.Fragment,{children:[(0,kt.jsx)(x,{}),(0,kt.jsxs)(f4,{children:[(0,kt.jsx)(vt,{children:(0,kt.jsxs)("div",{children:[(0,kt.jsx)(Ec,{}),(0,kt.jsx)(Tc,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),(0,kt.jsxs)(h4,{children:[typeof r=="string"?(0,kt.jsx)("h3",{children:r}):(0,kt.jsx)(kt.Fragment,{children:r}),typeof o=="string"?(0,kt.jsx)("p",{children:o}):(0,kt.jsx)(kt.Fragment,{children:o})]}),t?.allowlistConfig.errorCtaLink?(0,kt.jsx)(H,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):(0,kt.jsx)(H,{onClick:()=>{e("LANDING")},children:n})]})]})},f4=Gp.default.div`
|
|
663
663
|
display: flex;
|
|
664
664
|
flex-direction: column;
|
|
665
665
|
align-items: center;
|
|
@@ -667,11 +667,11 @@ Resources:
|
|
|
667
667
|
gap: 24px;
|
|
668
668
|
width: 100%;
|
|
669
669
|
padding-bottom: 16px;
|
|
670
|
-
`,
|
|
670
|
+
`,h4=Gp.default.div`
|
|
671
671
|
display: flex;
|
|
672
672
|
flex-direction: column;
|
|
673
673
|
gap: 8px;
|
|
674
|
-
`;var
|
|
674
|
+
`;var Ty=y(require("@heroicons/react/20/solid/CheckIcon")),Sy=y(require("@heroicons/react/24/outline/EnvelopeIcon")),_y=y(require("@heroicons/react/24/outline/PhoneIcon")),qo=require("react"),Py=require("react-device-detect"),Dn=y(require("styled-components"));var hr=y(require("styled-components")),lo=hr.default.div`
|
|
675
675
|
display: flex;
|
|
676
676
|
flex-direction: column;
|
|
677
677
|
align-items: flex-start;
|
|
@@ -679,36 +679,36 @@ Resources:
|
|
|
679
679
|
margin-top: auto;
|
|
680
680
|
gap: 16px;
|
|
681
681
|
flex-grow: 100;
|
|
682
|
-
`,
|
|
682
|
+
`,jt=hr.default.div`
|
|
683
683
|
display: flex;
|
|
684
684
|
flex-direction: column;
|
|
685
685
|
align-items: center;
|
|
686
686
|
justify-content: center;
|
|
687
687
|
flex-grow: 1;
|
|
688
688
|
width: 100%;
|
|
689
|
-
`,
|
|
689
|
+
`,yy=hr.default.div`
|
|
690
690
|
display: flex;
|
|
691
691
|
flex-direction: column;
|
|
692
692
|
align-items: center;
|
|
693
693
|
width: 100%;
|
|
694
|
-
`,
|
|
694
|
+
`,ma=(0,hr.default)(jt)`
|
|
695
695
|
padding: 20px 0;
|
|
696
|
-
`,
|
|
696
|
+
`,Dr=(0,hr.default)(jt)`
|
|
697
697
|
gap: 16px;
|
|
698
|
-
`,
|
|
698
|
+
`,Nn=hr.default.div`
|
|
699
699
|
display: flex;
|
|
700
700
|
flex-direction: column;
|
|
701
701
|
width: 100%;
|
|
702
|
-
`,
|
|
702
|
+
`,pt=hr.default.div`
|
|
703
703
|
display: flex;
|
|
704
704
|
flex-direction: column;
|
|
705
705
|
gap: 8px;
|
|
706
|
-
`,
|
|
706
|
+
`,AP=hr.default.div`
|
|
707
707
|
display: flex;
|
|
708
708
|
flex-direction: column;
|
|
709
709
|
justify-content: space-between;
|
|
710
710
|
height: 100%;
|
|
711
|
-
`,
|
|
711
|
+
`,gy=hr.default.div`
|
|
712
712
|
display: flex;
|
|
713
713
|
flex-direction: column;
|
|
714
714
|
justify-content: flex-start;
|
|
@@ -731,15 +731,15 @@ Resources:
|
|
|
731
731
|
color: var(--privy-color-foreground-3);
|
|
732
732
|
font-size: 14px;
|
|
733
733
|
}
|
|
734
|
-
`,
|
|
734
|
+
`,de=hr.default.div`
|
|
735
735
|
height: 16px;
|
|
736
|
-
`,
|
|
736
|
+
`,me=hr.default.div`
|
|
737
737
|
height: 12px;
|
|
738
|
-
`,
|
|
738
|
+
`,vy=hr.default.div`
|
|
739
739
|
position: relative;
|
|
740
|
-
`,
|
|
740
|
+
`,fa=hr.default.div`
|
|
741
741
|
height: ${e=>e.height??"12"}px;
|
|
742
|
-
`,
|
|
742
|
+
`,Cy=hr.default.div`
|
|
743
743
|
background-color: var(--privy-color-accent);
|
|
744
744
|
display: flex;
|
|
745
745
|
justify-content: center;
|
|
@@ -747,9 +747,9 @@ Resources:
|
|
|
747
747
|
border-radius: 50%;
|
|
748
748
|
border-color: white;
|
|
749
749
|
border-width: 2px !important;
|
|
750
|
-
`;var
|
|
750
|
+
`;var Sc=y(require("styled-components")),xo=require("react/jsx-runtime"),wi=({title:e,description:t,children:r,...o})=>(0,xo.jsx)(wy,{...o,children:(0,xo.jsxs)(xo.Fragment,{children:[(0,xo.jsx)("h3",{children:e}),typeof t=="string"?(0,xo.jsx)("p",{children:t}):t,r]})}),Vo=(0,Sc.default)(wi)`
|
|
751
751
|
margin-bottom: 24px;
|
|
752
|
-
`,
|
|
752
|
+
`,xe=({title:e,description:t,icon:r,children:o,...n})=>(0,xo.jsxs)(y4,{...n,children:[r||null,(0,xo.jsx)("h3",{children:e}),t&&typeof t=="string"?(0,xo.jsx)("p",{children:t}):t,o]}),wy=Sc.default.div`
|
|
753
753
|
display: flex;
|
|
754
754
|
flex-direction: column;
|
|
755
755
|
justify-content: flex-start;
|
|
@@ -769,7 +769,7 @@ Resources:
|
|
|
769
769
|
color: var(--privy-color-foreground-2);
|
|
770
770
|
font-size: 14px;
|
|
771
771
|
}
|
|
772
|
-
`,
|
|
772
|
+
`,y4=(0,Sc.default)(wy)`
|
|
773
773
|
align-items: center;
|
|
774
774
|
text-align: center;
|
|
775
775
|
gap: 16px;
|
|
@@ -777,7 +777,7 @@ Resources:
|
|
|
777
777
|
h3 {
|
|
778
778
|
margin-bottom: 24px;
|
|
779
779
|
}
|
|
780
|
-
`;var $e=require("react/jsx-runtime"),
|
|
780
|
+
`;var $e=require("react/jsx-runtime"),Vp=6,by=new Array(Vp).fill(""),g4=1400,v4=30;var Ay=()=>{let{app:e,navigate:t,lastScreen:r,navigateBack:o,setModalData:n,onUserCloseViaDialogOrKeybindRef:i}=P(),{closePrivyModal:a,resendEmailCode:l,resendSmsCode:s,getAuthMeta:c,loginWithCode:m,updateWallets:f,createAnalyticsEvent:u}=W(),{authenticated:C,logout:v,user:g}=$(),[E,S]=(0,qo.useState)(by),[R,T]=(0,qo.useState)(!1),[A,k]=(0,qo.useState)(null),[M,D]=(0,qo.useState)(null),[G,Y]=(0,qo.useState)(0);i.current=()=>null;let Z=c()?.email?0:1,L=ot,U=L-500;(0,qo.useEffect)(()=>{if(G){let re=setTimeout(()=>{Y(G-1)},1e3);return()=>clearTimeout(re)}},[G]),(0,qo.useEffect)(()=>{if(C&&R&&g){if(e?.legal.requireUsersAcceptTerms&&!g.hasAcceptedTerms){let ae=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},U);return()=>clearTimeout(ae)}if(Sr(g,e?.embeddedWallets?.createOnLogin)){let ae=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:Fe=>{console.error(Fe),u({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Fe,screen:"AwaitingPasswordlessCodeScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},U);return()=>clearTimeout(ae)}else{f();let ae=setTimeout(()=>a({shouldCallAuthOnSuccess:!0,isSuccess:!0}),L);return()=>clearTimeout(ae)}}},[C,R,g]),(0,qo.useEffect)(()=>{if(A&&M===0){let re=setTimeout(()=>{S(by),k(null),document.querySelector("input[name=code-0]")?.focus()},g4);return()=>clearTimeout(re)}},[A]);let O=re=>{re.preventDefault();let ae=re.currentTarget.value.replace(" ","");if(ae==="")return;if(isNaN(Number(ae))){k("Code should be numeric"),D(1);return}k(null),D(null);let Fe=Number(re.currentTarget.name?.charAt(5)),Ne=[...ae||[""]].slice(0,Vp-Fe),ut=[...E.slice(0,Fe),...Ne,...E.slice(Fe+Ne.length)];S(ut);let lt=Ne.length,Nt=Math.min(Math.max(Fe+lt,0),Vp-1);isNaN(Number(re.currentTarget.value))||document.querySelector(`input[name=code-${Nt}]`)?.focus(),ut.every(at=>at&&!isNaN(+at))&&(document.querySelector(`input[name=code-${Nt}]`)?.blur(),m(ut.join("")).then(()=>T(!0)).catch(ge=>{if(ge?.status===422)k("Invalid or expired verification code");else if(ge instanceof pr&&ge.privyErrorCode==="cannot_link_more_of_type")k(ge.message);else if(ge instanceof pr&&ge.privyErrorCode==="max_accounts_reached"){console.error(new ro(ge).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else if(ge instanceof pr&&ge.privyErrorCode==="user_does_not_exist"){t("ACCOUNT_NOT_FOUND_SCREEN");return}else if(ge instanceof pr&&ge.privyErrorCode==="linked_to_another_user"){n({errorModalData:{error:ge,previousScreen:r??"AWAITING_PASSWORDLESS_CODE"}}),t("ERROR_SCREEN",!1);return}else k("Issue verifying code");D(0)}))},Ie=re=>{M===1&&(k(null),D(null));let ae=[...E.slice(0,re),"",...E.slice(re+1)];S(ae),re>0&&document.querySelector(`input[name=code-${re-1}]`)?.focus()},je=Z==0?(0,$e.jsx)(Sy.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):(0,$e.jsx)(_y.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),Q=Z==0?(0,$e.jsxs)("p",{children:["Please check ",(0,$e.jsx)(Ey,{children:c()?.email})," for an email from privy.io and enter your code below."]}):(0,$e.jsxs)("p",{children:["Please check ",(0,$e.jsx)(Ey,{children:c()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return(0,$e.jsxs)($e.Fragment,{children:[(0,$e.jsx)(x,{backFn:()=>o()},"header"),(0,$e.jsxs)(C4,{children:[(0,$e.jsx)(xe,{title:"Enter confirmation code",description:Q,icon:je}),(0,$e.jsxs)(yy,{children:[(0,$e.jsxs)(w4,{children:[(0,$e.jsx)(b4,{fail:!!A,success:R,children:(0,$e.jsx)("span",{children:A||(R?"Success!":"")})}),(0,$e.jsx)("div",{children:E.map((re,ae)=>(0,$e.jsx)("input",{name:`code-${ae}`,type:"text",value:E[ae],onChange:O,onKeyUp:Fe=>{Fe.key==="Backspace"&&Ie(ae)},inputMode:"numeric",autoFocus:ae===0,pattern:"[0-9]",className:`${R?"success":""} ${A?"fail":""}`,autoComplete:Py.isMobile?"one-time-code":"off"},ae))})]}),(0,$e.jsxs)(E4,{children:[(0,$e.jsxs)("span",{children:["Didn't get ",Z==0?"an email":"a message","?"]}),G?(0,$e.jsxs)(S4,{children:[(0,$e.jsx)(Ty.default,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),(0,$e.jsx)("span",{children:"Code sent"})]}):(0,$e.jsx)(T4,{children:(0,$e.jsx)("button",{onClick:async()=>{Y(v4),Z==0?await l():await s()},children:"Resend code"})})]})]})]}),(0,$e.jsx)(K,{})]})},C4=Dn.default.div`
|
|
781
781
|
display: flex;
|
|
782
782
|
flex-direction: column;
|
|
783
783
|
align-items: flex-start;
|
|
@@ -785,7 +785,7 @@ Resources:
|
|
|
785
785
|
margin: auto;
|
|
786
786
|
gap: 16px;
|
|
787
787
|
flex-grow: 1;
|
|
788
|
-
`,
|
|
788
|
+
`,w4=Dn.default.div`
|
|
789
789
|
display: flex;
|
|
790
790
|
flex-direction: column;
|
|
791
791
|
width: 100%;
|
|
@@ -842,7 +842,7 @@ Resources:
|
|
|
842
842
|
transform: translate(1px, 0px);
|
|
843
843
|
}
|
|
844
844
|
}
|
|
845
|
-
`,
|
|
845
|
+
`,b4=Dn.default.div`
|
|
846
846
|
line-height: 20px;
|
|
847
847
|
height: 20px;
|
|
848
848
|
font-size: 13px;
|
|
@@ -850,7 +850,7 @@ Resources:
|
|
|
850
850
|
display: flex;
|
|
851
851
|
justify-content: flex-end;
|
|
852
852
|
width: 100%;
|
|
853
|
-
`,
|
|
853
|
+
`,E4=Dn.default.div`
|
|
854
854
|
font-size: 13px;
|
|
855
855
|
color: var(--privy-color-foreground);
|
|
856
856
|
display: flex;
|
|
@@ -861,13 +861,13 @@ Resources:
|
|
|
861
861
|
// Equal opposing size buffer to account for auto margining when the
|
|
862
862
|
// success/fail text does not show up
|
|
863
863
|
padding-bottom: 32px;
|
|
864
|
-
`,
|
|
864
|
+
`,T4=Dn.default.div`
|
|
865
865
|
color: var(--privy-color-accent);
|
|
866
866
|
padding: 2px 0;
|
|
867
867
|
> button {
|
|
868
868
|
text-decoration: underline;
|
|
869
869
|
}
|
|
870
|
-
`,
|
|
870
|
+
`,S4=Dn.default.div`
|
|
871
871
|
display: flex;
|
|
872
872
|
align-items: center;
|
|
873
873
|
justify-content: center;
|
|
@@ -876,10 +876,10 @@ Resources:
|
|
|
876
876
|
gap: 4px;
|
|
877
877
|
background: var(--privy-color-background-2);
|
|
878
878
|
color: var(--privy-color-foreground-2);
|
|
879
|
-
`,
|
|
879
|
+
`,Ey=Dn.default.span`
|
|
880
880
|
font-weight: 500;
|
|
881
881
|
word-break: break-all;
|
|
882
|
-
`;var
|
|
882
|
+
`;var Iy=y(require("@heroicons/react/24/solid/CheckCircleIcon")),My=y(require("@heroicons/react/24/solid/XCircleIcon")),Ur=require("react"),Wy=y(require("styled-components"));var xy=y(require("styled-components"));var ko=require("react/jsx-runtime"),ky=({icon:e})=>{let t=e;return(0,ko.jsx)(ko.Fragment,{children:(0,ko.jsx)(_4,{children:(0,ko.jsxs)("div",{children:[(0,ko.jsx)(Pt,{}),typeof t=="string"?(0,ko.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?(0,ko.jsx)(t,{style:{width:"38px",height:"38px"}}):(0,ko.jsx)("span",{})]})})})},_4=xy.default.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
|
-
`;var
|
|
905
|
+
`;var Bt=require("react/jsx-runtime"),Oy=500,Ry=Oy*2,Ly=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:i}=P(),{status:a,token:l,waitForResult:s,reset:c,execute:m}=We(),f=(0,Ur.useRef)([]),u=U=>{f.current=[U,...f.current]},[C,v]=(0,Ur.useState)(!0);(0,Ur.useEffect)(()=>{let U=setTimeout(v,Ry,!1);return u(U),()=>{f.current.forEach(O=>clearTimeout(O)),f.current=[]}},[]);let[g,E]=(0,Ur.useState)(""),[S,R]=(0,Ur.useState)("Checking that you are a human..."),[T,A]=(0,Ur.useState)((0,Bt.jsx)(H,{onClick:()=>{},disabled:!0,children:"Continue"})),[k,M]=(0,Ur.useState)(!1),[D,G]=(0,Ur.useState)(3),Y=r?.captchaModalData,Z=async U=>{try{await Y?.callback(U),Y?.onSuccessNavigateTo&&n(Y?.onSuccessNavigateTo,!1)}catch(O){if(O instanceof Nr)return;{let Ie={error:O,previousScreen:e||"LANDING"};i({errorModalData:Ie}),n(Y?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};(0,Ur.useEffect)(()=>{if(a==="success"){let U=setTimeout(async()=>{let O=await s();!O||Y?.userIntentRequired||Z(O)},Ry);u(U)}else if(a==="ready"){let U=setTimeout(()=>{a==="ready"&&m()},Oy);u(U)}},[a]),(0,Ur.useEffect)(()=>{if(!C)switch(a){case"success":E("Success!"),R("CAPTCHA passed successfully."),A((0,Bt.jsx)(H,{onClick:()=>{M(!0),Z(l)},disabled:!Y?.userIntentRequired,loading:k,children:Y?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":E(""),R("Checking that you are a human..."),A((0,Bt.jsx)(H,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":E("Something went wrong"),D<=0?(R("If you use an adblocker or VPN, try disabling and re-attempting."),A(null)):(R("You did not pass CAPTCHA. Please try again."),A((0,Bt.jsx)(H,{onClick:L,children:"Retry"})));break;case"ready":default:break}},[a,C,k]);let L=async()=>{if(D<=0)return;G(O=>O-1),c(),m();let U=await s();!U||Y?.userIntentRequired||Z(U)};return(0,Bt.jsxs)(Bt.Fragment,{children:[(0,Bt.jsx)(x,{backFn:!e||t===e?void 0:o}),(0,Bt.jsxs)(P4,{children:[a==="success"?(0,Bt.jsx)(Iy.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?(0,Bt.jsx)(My.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):(0,Bt.jsx)(ky,{}),(0,Bt.jsxs)(pt,{children:[g?(0,Bt.jsx)("h3",{children:g}):null,(0,Bt.jsx)("p",{children:S})]}),T]}),(0,Bt.jsx)(J,{})]})},P4=Wy.default.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
|
-
`;var
|
|
912
|
+
`;var $p=require("react-device-detect"),Kp=y(require("styled-components"));var Ny=y(require("@heroicons/react/24/outline/WalletIcon")),_c=require("react/jsx-runtime"),Pc=({icon:e,name:t})=>typeof e=="string"?(0,_c.jsx)("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?(0,_c.jsx)(Ny.default,{}):e?(0,_c.jsx)(e,{}):null;var bi=y(require("styled-components"));var Es=require("styled-components"),A4=Es.keyframes`
|
|
913
913
|
from, to {
|
|
914
914
|
background: var(--privy-color-foreground-4);
|
|
915
915
|
color: var(--privy-color-foreground-4);
|
|
@@ -919,23 +919,37 @@ Resources:
|
|
|
919
919
|
background: var(--privy-color-foreground-accent);
|
|
920
920
|
color: var(--privy-color-foreground-accent);
|
|
921
921
|
}
|
|
922
|
-
`,
|
|
923
|
-
${e=>e.$isLoading?
|
|
922
|
+
`,Ac=Es.css`
|
|
923
|
+
${e=>e.$isLoading?Es.css`
|
|
924
924
|
width: 35%;
|
|
925
|
-
animation: ${
|
|
925
|
+
animation: ${A4} 2s linear infinite;
|
|
926
926
|
border-radius: var(--privy-border-radius-sm);
|
|
927
927
|
`:""}
|
|
928
|
-
`;var
|
|
928
|
+
`;var Dy=require("react/jsx-runtime"),kr=({children:e,color:t,isLoading:r,isPulsing:o,className:n})=>(0,Dy.jsx)(x4,{$color:t,$isLoading:r,$isPulsing:o,className:n,children:e}),x4=bi.default.span`
|
|
929
929
|
padding: 0.125rem 0.5rem;
|
|
930
930
|
font-size: 0.75rem;
|
|
931
931
|
font-weight: 500;
|
|
932
932
|
line-height: 1.125rem; /* 150% */
|
|
933
933
|
border-radius: var(--privy-border-radius-sm);
|
|
934
934
|
|
|
935
|
-
${e=>e.$color==="green"
|
|
935
|
+
${e=>{let t,r;e.$color==="green"&&(t="var(--privy-color-success-dark)",r="var(--privy-color-success-light)"),e.$color==="red"&&(t="var(--privy-color-error)",r="var(--privy-color-error-light)"),e.$color==="gray"&&(t="var(--privy-color-foreground-2)",r="var(--privy-color-background-2)");let o=bi.keyframes`
|
|
936
|
+
from, to {
|
|
937
|
+
background-color: ${r};
|
|
938
|
+
}
|
|
936
939
|
|
|
937
|
-
|
|
938
|
-
`;var Wy=require("@heroicons/react/24/outline");var hr=require("react/jsx-runtime"),Py=({...e})=>(0,hr.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[(0,hr.jsx)("defs",{children:(0,hr.jsxs)("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[(0,hr.jsx)("stop",{offset:"0",stopColor:"#f1562b"}),(0,hr.jsx)("stop",{offset:"0.3",stopColor:"#f1542b"}),(0,hr.jsx)("stop",{offset:"0.41",stopColor:"#f04d2a"}),(0,hr.jsx)("stop",{offset:"0.49",stopColor:"#ef4229"}),(0,hr.jsx)("stop",{offset:"0.5",stopColor:"#ef4029"}),(0,hr.jsx)("stop",{offset:"0.56",stopColor:"#e83e28"}),(0,hr.jsx)("stop",{offset:"0.67",stopColor:"#e13c26"}),(0,hr.jsx)("stop",{offset:"1",stopColor:"#df3c26"})]})}),(0,hr.jsx)("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),(0,hr.jsx)("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});var gs=require("react/jsx-runtime"),xy=({...e})=>(0,gs.jsxs)("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,gs.jsx)("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),(0,gs.jsx)("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]});var Bt=require("react/jsx-runtime"),Ay=({style:e,...t})=>(0,Bt.jsxs)("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,Bt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),(0,Bt.jsx)("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:(0,Bt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),(0,Bt.jsxs)("g",{mask:"url(#mask0_16909_31415)",children:[(0,Bt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),(0,Bt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),(0,Bt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),(0,Bt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),(0,Bt.jsxs)("defs",{children:[(0,Bt.jsxs)("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Bt.jsx)("stop",{stopColor:"#002D72"}),(0,Bt.jsx)("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),(0,Bt.jsxs)("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Bt.jsx)("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),(0,Bt.jsx)("stop",{offset:"1",stopColor:"#002D72"})]})]})]});var bt=require("react/jsx-runtime"),ky=e=>(0,bt.jsxs)("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,bt.jsx)("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),(0,bt.jsx)("path",{d:"M43.6781 28.2954C45.1053 25.0988 38.0498 16.168 31.3094 12.4472C27.0608 9.56481 22.6337 9.96081 21.737 11.2264C19.7693 14.0039 28.2527 16.3574 33.9263 19.1037C32.7067 19.6348 31.5574 20.5879 30.8816 21.8067C28.7664 19.4915 24.1239 17.4977 18.6765 19.1037C15.0056 20.186 11.9547 22.7374 10.7756 26.5911C10.4891 26.4635 10.1719 26.3925 9.83814 26.3925C8.56192 26.3925 7.52734 27.4298 7.52734 28.7094C7.52734 29.989 8.56192 31.0263 9.83814 31.0263C10.0747 31.0263 10.8143 30.8672 10.8143 30.8672L22.6337 30.953C17.9068 38.4713 14.1713 39.5704 14.1713 40.8729C14.1713 42.1754 17.7455 41.8224 19.0876 41.3369C25.5121 39.0127 32.4123 31.7692 33.5964 29.6841C38.5688 30.3061 42.7476 30.3796 43.6781 28.2954Z",fill:"url(#paint0_linear_81034_11443)"}),(0,bt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.8741 19.076C33.8926 19.084 33.911 19.092 33.9294 19.1001C34.1923 18.9962 34.1498 18.6068 34.0776 18.301C33.9116 17.5981 31.0479 14.7629 28.3588 13.493C24.6934 11.762 21.9946 11.8518 21.5972 12.65C22.3407 14.1849 25.8031 15.6258 29.4193 17.1308C30.9407 17.7639 32.4893 18.4084 33.8741 19.076Z",fill:"url(#paint1_linear_81034_11443)"}),(0,bt.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.272 34.5374C28.5323 34.2543 27.697 33.9945 26.7477 33.7587C27.7625 31.9382 27.9754 29.2432 27.0171 27.5392C25.6721 25.1478 23.9838 23.875 20.0605 23.875C17.9027 23.875 12.093 24.6037 11.9899 29.4663C11.9791 29.9743 11.9895 30.44 12.026 30.8685L22.6335 30.9456C21.2017 33.2229 19.8609 34.9113 18.6873 36.1947C20.0979 36.5571 21.2615 36.8612 22.3297 37.1404C23.3394 37.4043 24.2638 37.646 25.2309 37.8934C26.6941 36.8249 28.0698 35.6597 29.272 34.5374Z",fill:"url(#paint2_linear_81034_11443)"}),(0,bt.jsx)("path",{d:"M10.6324 30.3712C11.0658 34.065 13.1596 35.5127 17.4381 35.9411C21.7166 36.3695 24.1708 36.0821 27.4381 36.3801C30.167 36.6291 32.6036 38.0233 33.5075 37.5415C34.321 37.1079 33.8659 35.5412 32.7774 34.5361C31.3663 33.2333 29.4135 32.3274 25.9773 32.006C26.6621 30.1261 26.4702 27.4903 25.4067 26.0562C23.8689 23.9827 21.0305 23.0453 17.4381 23.4549C13.6848 23.8828 10.0885 25.7354 10.6324 30.3712Z",fill:"url(#paint3_linear_81034_11443)"}),(0,bt.jsxs)("defs",{children:[(0,bt.jsxs)("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[(0,bt.jsx)("stop",{stopColor:"white"}),(0,bt.jsx)("stop",{offset:"1",stopColor:"white"})]}),(0,bt.jsxs)("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[(0,bt.jsx)("stop",{stopColor:"#8697FF"}),(0,bt.jsx)("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),(0,bt.jsxs)("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[(0,bt.jsx)("stop",{stopColor:"#8697FF"}),(0,bt.jsx)("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),(0,bt.jsxs)("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[(0,bt.jsx)("stop",{stopColor:"white"}),(0,bt.jsx)("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]});var oe=require("react/jsx-runtime"),Ry=({style:e,...t})=>(0,oe.jsxs)("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,oe.jsx)("g",{clipPath:"url(#clip0_5_32)",children:(0,oe.jsxs)("g",{clipPath:"url(#clip1_5_32)",children:[(0,oe.jsx)("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:(0,oe.jsx)("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),(0,oe.jsx)("g",{mask:"url(#mask0_5_32)",children:(0,oe.jsx)("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),(0,oe.jsx)("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),(0,oe.jsx)("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),(0,oe.jsx)("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),(0,oe.jsx)("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),(0,oe.jsx)("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),(0,oe.jsx)("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),(0,oe.jsx)("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),(0,oe.jsx)("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),(0,oe.jsx)("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),(0,oe.jsxs)("defs",{children:[(0,oe.jsxs)("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[(0,oe.jsx)("stop",{stopColor:"#174299"}),(0,oe.jsx)("stop",{offset:"1",stopColor:"#001E59"})]}),(0,oe.jsxs)("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[(0,oe.jsx)("stop",{offset:"0.770277",stopColor:"#FF4000"}),(0,oe.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,oe.jsxs)("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,oe.jsx)("stop",{stopColor:"#FF4000"}),(0,oe.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,oe.jsxs)("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[(0,oe.jsx)("stop",{stopColor:"#8754C9"}),(0,oe.jsx)("stop",{offset:"1",stopColor:"#FF4000"})]}),(0,oe.jsxs)("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[(0,oe.jsx)("stop",{offset:"0.723929",stopColor:"#FFF700"}),(0,oe.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,oe.jsxs)("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,oe.jsx)("stop",{stopColor:"#FFF700"}),(0,oe.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,oe.jsxs)("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[(0,oe.jsx)("stop",{stopColor:"#FFF700"}),(0,oe.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,oe.jsxs)("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[(0,oe.jsx)("stop",{offset:"0.59513",stopColor:"#00AAFF"}),(0,oe.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,oe.jsxs)("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[(0,oe.jsx)("stop",{stopColor:"#00AAFF"}),(0,oe.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,oe.jsxs)("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[(0,oe.jsx)("stop",{stopColor:"#00AAFF"}),(0,oe.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,oe.jsx)("clipPath",{id:"clip0_5_32",children:(0,oe.jsx)("rect",{width:"120",height:"120",fill:"white"})}),(0,oe.jsx)("clipPath",{id:"clip1_5_32",children:(0,oe.jsx)("rect",{width:"120",height:"120",fill:"white"})})]})]});var xr=require("react/jsx-runtime"),My=({style:e,...t})=>(0,xr.jsxs)("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,xr.jsx)("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),(0,xr.jsxs)("g",{filter:"url(#filter0_d_12393_20043)",children:[(0,xr.jsx)("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),(0,xr.jsx)("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),(0,xr.jsx)("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),(0,xr.jsx)("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),(0,xr.jsx)("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),(0,xr.jsx)("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),(0,xr.jsx)("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),(0,xr.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),(0,xr.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});var cn=require("react/jsx-runtime"),Iy=({style:e,...t})=>(0,cn.jsxs)("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,cn.jsxs)("g",{clipPath:"url(#clip0_1704_1423)",children:[(0,cn.jsx)("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),(0,cn.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),(0,cn.jsx)("defs",{children:(0,cn.jsx)("clipPath",{id:"clip0_1704_1423",children:(0,cn.jsx)("rect",{width:"176",height:"176",fill:"white"})})})]});var Op=require("react/jsx-runtime"),ao={coinbase_wallet:{logo:ui,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:ui,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:Zi,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:No,displayName:"Phantom"},rainbow:{logo:Ry,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:ms,displayName:"WalletConnect"},zerion:{logo:Iy,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:Py,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:Ay,displayName:"Crypto.com DeFi Wallet",rdns:"com.crypto.wallet"},uniswap:{logo:My,displayName:"Uniswap Wallet",rdns:"org.uniswap.app"},okx_wallet:{displayName:"OKX Wallet",rdns:"com.okex.wallet",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII="},rabby_wallet:{logo:ky,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"}},Ln=(e,t,r)=>{if(ao[e]?.displayName)return e==="coinbase_wallet"?ao[r].displayName:ao[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},bc=(e,t,r)=>{if(ao[e]?.logo)return e==="coinbase_wallet"?ao[r].logo:ao[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return ms},Ec=(e,t)=>{let r=t?.height||16,o=t?.width||16;switch(e){case 8453:return(0,Op.jsx)(xy,{height:r,width:o});default:return(0,Op.jsx)(Wy.GlobeAltIcon,{height:r,width:o})}};function pa(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some(n=>t.includes(n))}var ua=require("react"),Oy=require("react");var Uy=require("react/jsx-runtime"),Ny=(0,Oy.createContext)({}),Dy=({children:e})=>{let t=pt(),[r,o]=(0,ua.useState)({});return ze("login",{onComplete:(n,i,a,l,s)=>{!s||s.type==="passkey"||s.type==="cross_app"||s.type==="wallet"&&s.walletClientType==="privy"||(X.put(Ly(t.id),s.type),s.type==="wallet"?(X.put(Np(t.id),s.walletClientType),o({accountType:s.type,walletClientType:s.walletClientType})):(X.del(Np(t.id)),o({accountType:s.type})))}}),(0,ua.useEffect)(()=>{if(!t.id)return;let n=X.get(Ly(t.id)),i=X.get(Np(t.id));n&&o(n==="wallet"?{accountType:n,walletClientType:i}:{accountType:n})},[t.id]),(0,Uy.jsx)(Ny.Provider,{value:r,children:e})},Ly=e=>`privy:${e}:recent-login-method`,Np=e=>`privy:${e}:recent-login-wallet-client`,ir=()=>(0,ua.useContext)(Ny);var vi=require("react/jsx-runtime"),Ci=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:i}=_(),{connectWallet:a}=W(),l=ir(),s=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,c=window.matchMedia("(display-mode: standalone)").matches,m;return n.connectorType==="phantom"?m=()=>{Sn()?(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(Dp.isMobile?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:n.connectorType==="coinbase_wallet"&&n.connectionOptions==="eoaOnly"&&Dp.isMobile&&!c&&!yl()?m=()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`}:m=()=>{pa(window.navigator.userAgent)&&!event?.isTrusted||(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION"))},(0,vi.jsxs)(r4,{onClick:m,children:[(0,vi.jsx)(Cc,{icon:bc(e,n.connectorType,n.walletClientType)??r,name:n.walletClientType}),(0,vi.jsx)("span",{children:Ln(e,n.connectorType,n.walletClientType)||t||n.walletClientType}),l?.walletClientType===s?(0,vi.jsx)(o4,{color:"gray",children:"Recent"}):(0,vi.jsx)("span",{id:"connect-text",children:"Connect"})]})},r4=(0,Up.default)(Le)`
|
|
940
|
+
50% {
|
|
941
|
+
background-color: rgba(${r}, 0.8);
|
|
942
|
+
}
|
|
943
|
+
`;return bi.css`
|
|
944
|
+
color: ${t};
|
|
945
|
+
background-color: ${r};
|
|
946
|
+
${e.$isPulsing&&bi.css`
|
|
947
|
+
animation: ${o} 3s linear infinite;
|
|
948
|
+
`};
|
|
949
|
+
`}}
|
|
950
|
+
|
|
951
|
+
${Ac}
|
|
952
|
+
`;var zy=require("@heroicons/react/24/outline");var yr=require("react/jsx-runtime"),Uy=({...e})=>(0,yr.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[(0,yr.jsx)("defs",{children:(0,yr.jsxs)("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[(0,yr.jsx)("stop",{offset:"0",stopColor:"#f1562b"}),(0,yr.jsx)("stop",{offset:"0.3",stopColor:"#f1542b"}),(0,yr.jsx)("stop",{offset:"0.41",stopColor:"#f04d2a"}),(0,yr.jsx)("stop",{offset:"0.49",stopColor:"#ef4229"}),(0,yr.jsx)("stop",{offset:"0.5",stopColor:"#ef4029"}),(0,yr.jsx)("stop",{offset:"0.56",stopColor:"#e83e28"}),(0,yr.jsx)("stop",{offset:"0.67",stopColor:"#e13c26"}),(0,yr.jsx)("stop",{offset:"1",stopColor:"#df3c26"})]})}),(0,yr.jsx)("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),(0,yr.jsx)("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});var Ts=require("react/jsx-runtime"),Fy=({...e})=>(0,Ts.jsxs)("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,Ts.jsx)("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),(0,Ts.jsx)("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]});var Ht=require("react/jsx-runtime"),By=({style:e,...t})=>(0,Ht.jsxs)("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),(0,Ht.jsx)("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),(0,Ht.jsxs)("g",{mask:"url(#mask0_16909_31415)",children:[(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),(0,Ht.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),(0,Ht.jsxs)("defs",{children:[(0,Ht.jsxs)("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Ht.jsx)("stop",{stopColor:"#002D72"}),(0,Ht.jsx)("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),(0,Ht.jsxs)("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,Ht.jsx)("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),(0,Ht.jsx)("stop",{offset:"1",stopColor:"#002D72"})]})]})]});var Et=require("react/jsx-runtime"),Hy=e=>(0,Et.jsxs)("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,Et.jsx)("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),(0,Et.jsx)("path",{d:"M43.6781 28.2954C45.1053 25.0988 38.0498 16.168 31.3094 12.4472C27.0608 9.56481 22.6337 9.96081 21.737 11.2264C19.7693 14.0039 28.2527 16.3574 33.9263 19.1037C32.7067 19.6348 31.5574 20.5879 30.8816 21.8067C28.7664 19.4915 24.1239 17.4977 18.6765 19.1037C15.0056 20.186 11.9547 22.7374 10.7756 26.5911C10.4891 26.4635 10.1719 26.3925 9.83814 26.3925C8.56192 26.3925 7.52734 27.4298 7.52734 28.7094C7.52734 29.989 8.56192 31.0263 9.83814 31.0263C10.0747 31.0263 10.8143 30.8672 10.8143 30.8672L22.6337 30.953C17.9068 38.4713 14.1713 39.5704 14.1713 40.8729C14.1713 42.1754 17.7455 41.8224 19.0876 41.3369C25.5121 39.0127 32.4123 31.7692 33.5964 29.6841C38.5688 30.3061 42.7476 30.3796 43.6781 28.2954Z",fill:"url(#paint0_linear_81034_11443)"}),(0,Et.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.8741 19.076C33.8926 19.084 33.911 19.092 33.9294 19.1001C34.1923 18.9962 34.1498 18.6068 34.0776 18.301C33.9116 17.5981 31.0479 14.7629 28.3588 13.493C24.6934 11.762 21.9946 11.8518 21.5972 12.65C22.3407 14.1849 25.8031 15.6258 29.4193 17.1308C30.9407 17.7639 32.4893 18.4084 33.8741 19.076Z",fill:"url(#paint1_linear_81034_11443)"}),(0,Et.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.272 34.5374C28.5323 34.2543 27.697 33.9945 26.7477 33.7587C27.7625 31.9382 27.9754 29.2432 27.0171 27.5392C25.6721 25.1478 23.9838 23.875 20.0605 23.875C17.9027 23.875 12.093 24.6037 11.9899 29.4663C11.9791 29.9743 11.9895 30.44 12.026 30.8685L22.6335 30.9456C21.2017 33.2229 19.8609 34.9113 18.6873 36.1947C20.0979 36.5571 21.2615 36.8612 22.3297 37.1404C23.3394 37.4043 24.2638 37.646 25.2309 37.8934C26.6941 36.8249 28.0698 35.6597 29.272 34.5374Z",fill:"url(#paint2_linear_81034_11443)"}),(0,Et.jsx)("path",{d:"M10.6324 30.3712C11.0658 34.065 13.1596 35.5127 17.4381 35.9411C21.7166 36.3695 24.1708 36.0821 27.4381 36.3801C30.167 36.6291 32.6036 38.0233 33.5075 37.5415C34.321 37.1079 33.8659 35.5412 32.7774 34.5361C31.3663 33.2333 29.4135 32.3274 25.9773 32.006C26.6621 30.1261 26.4702 27.4903 25.4067 26.0562C23.8689 23.9827 21.0305 23.0453 17.4381 23.4549C13.6848 23.8828 10.0885 25.7354 10.6324 30.3712Z",fill:"url(#paint3_linear_81034_11443)"}),(0,Et.jsxs)("defs",{children:[(0,Et.jsxs)("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[(0,Et.jsx)("stop",{stopColor:"white"}),(0,Et.jsx)("stop",{offset:"1",stopColor:"white"})]}),(0,Et.jsxs)("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[(0,Et.jsx)("stop",{stopColor:"#8697FF"}),(0,Et.jsx)("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),(0,Et.jsxs)("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[(0,Et.jsx)("stop",{stopColor:"#8697FF"}),(0,Et.jsx)("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),(0,Et.jsxs)("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[(0,Et.jsx)("stop",{stopColor:"white"}),(0,Et.jsx)("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]});var ne=require("react/jsx-runtime"),Gy=({style:e,...t})=>(0,ne.jsxs)("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,ne.jsx)("g",{clipPath:"url(#clip0_5_32)",children:(0,ne.jsxs)("g",{clipPath:"url(#clip1_5_32)",children:[(0,ne.jsx)("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:(0,ne.jsx)("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),(0,ne.jsx)("g",{mask:"url(#mask0_5_32)",children:(0,ne.jsx)("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),(0,ne.jsx)("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),(0,ne.jsx)("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),(0,ne.jsx)("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),(0,ne.jsx)("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),(0,ne.jsx)("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),(0,ne.jsx)("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),(0,ne.jsx)("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),(0,ne.jsx)("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),(0,ne.jsx)("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),(0,ne.jsxs)("defs",{children:[(0,ne.jsxs)("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[(0,ne.jsx)("stop",{stopColor:"#174299"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#001E59"})]}),(0,ne.jsxs)("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[(0,ne.jsx)("stop",{offset:"0.770277",stopColor:"#FF4000"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,ne.jsxs)("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,ne.jsx)("stop",{stopColor:"#FF4000"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,ne.jsxs)("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[(0,ne.jsx)("stop",{stopColor:"#8754C9"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#FF4000"})]}),(0,ne.jsxs)("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[(0,ne.jsx)("stop",{offset:"0.723929",stopColor:"#FFF700"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,ne.jsxs)("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,ne.jsx)("stop",{stopColor:"#FFF700"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,ne.jsxs)("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[(0,ne.jsx)("stop",{stopColor:"#FFF700"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,ne.jsxs)("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[(0,ne.jsx)("stop",{offset:"0.59513",stopColor:"#00AAFF"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,ne.jsxs)("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[(0,ne.jsx)("stop",{stopColor:"#00AAFF"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,ne.jsxs)("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[(0,ne.jsx)("stop",{stopColor:"#00AAFF"}),(0,ne.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,ne.jsx)("clipPath",{id:"clip0_5_32",children:(0,ne.jsx)("rect",{width:"120",height:"120",fill:"white"})}),(0,ne.jsx)("clipPath",{id:"clip1_5_32",children:(0,ne.jsx)("rect",{width:"120",height:"120",fill:"white"})})]})]});var Rr=require("react/jsx-runtime"),Vy=({style:e,...t})=>(0,Rr.jsxs)("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,Rr.jsx)("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),(0,Rr.jsxs)("g",{filter:"url(#filter0_d_12393_20043)",children:[(0,Rr.jsx)("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),(0,Rr.jsx)("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),(0,Rr.jsx)("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),(0,Rr.jsx)("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),(0,Rr.jsx)("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),(0,Rr.jsx)("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),(0,Rr.jsx)("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),(0,Rr.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),(0,Rr.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});var un=require("react/jsx-runtime"),qy=({style:e,...t})=>(0,un.jsxs)("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,un.jsxs)("g",{clipPath:"url(#clip0_1704_1423)",children:[(0,un.jsx)("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),(0,un.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),(0,un.jsx)("defs",{children:(0,un.jsx)("clipPath",{id:"clip0_1704_1423",children:(0,un.jsx)("rect",{width:"176",height:"176",fill:"white"})})})]});var qp=require("react/jsx-runtime"),co={coinbase_wallet:{logo:ln,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:ln,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:ta,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:Uo,displayName:"Phantom"},rainbow:{logo:Gy,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:vs,displayName:"WalletConnect"},zerion:{logo:qy,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:Uy,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:By,displayName:"Crypto.com DeFi Wallet",rdns:"com.crypto.wallet"},uniswap:{logo:Vy,displayName:"Uniswap Wallet",rdns:"org.uniswap.app"},okx_wallet:{displayName:"OKX Wallet",rdns:"com.okex.wallet",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII="},rabby_wallet:{logo:Hy,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"}},Un=(e,t,r)=>{if(co[e]?.displayName)return e==="coinbase_wallet"?co[r].displayName:co[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},xc=(e,t,r)=>{if(co[e]?.logo)return e==="coinbase_wallet"?co[r].logo:co[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return vs},kc=(e,t)=>{let r=t?.height||16,o=t?.width||16;switch(e){case 8453:return(0,qp.jsx)(Fy,{height:r,width:o});default:return(0,qp.jsx)(zy.GlobeAltIcon,{height:r,width:o})}};function ha(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some(n=>t.includes(n))}var ya=require("react"),Ky=require("react");var Zy=require("react/jsx-runtime"),jy=(0,Ky.createContext)({}),Yy=({children:e})=>{let t=dt(),[r,o]=(0,ya.useState)({});return He("login",{onComplete:(n,i,a,l,s)=>{!s||s.type==="passkey"||s.type==="cross_app"||s.type==="wallet"&&s.walletClientType==="privy"||(X.put($y(t.id),s.type),s.type==="wallet"?(X.put(zp(t.id),s.walletClientType),o({accountType:s.type,walletClientType:s.walletClientType})):(X.del(zp(t.id)),o({accountType:s.type})))}}),(0,ya.useEffect)(()=>{if(!t.id)return;let n=X.get($y(t.id)),i=X.get(zp(t.id));n&&o(n==="wallet"?{accountType:n,walletClientType:i}:{accountType:n})},[t.id]),(0,Zy.jsx)(jy.Provider,{value:r,children:e})},$y=e=>`privy:${e}:recent-login-method`,zp=e=>`privy:${e}:recent-login-wallet-client`,ar=()=>(0,ya.useContext)(jy);var Ei=require("react/jsx-runtime"),Ti=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:i}=P(),{connectWallet:a}=W(),l=ar(),s=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,c=window.matchMedia("(display-mode: standalone)").matches,m;return n.connectorType==="phantom"?m=()=>{An()?(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i($p.isMobile?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:n.connectorType==="coinbase_wallet"&&n.connectionOptions==="eoaOnly"&&$p.isMobile&&!c&&!Tl()?m=()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`}:m=()=>{ha(window.navigator.userAgent)&&!event?.isTrusted||(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION"))},(0,Ei.jsxs)(k4,{onClick:m,children:[(0,Ei.jsx)(Pc,{icon:xc(e,n.connectorType,n.walletClientType)??r,name:n.walletClientType}),(0,Ei.jsx)("span",{children:Un(e,n.connectorType,n.walletClientType)||t||n.walletClientType}),l?.walletClientType===s?(0,Ei.jsx)(R4,{color:"gray",children:"Recent"}):(0,Ei.jsx)("span",{id:"connect-text",children:"Connect"})]})},k4=(0,Kp.default)(Oe)`
|
|
939
953
|
/* Show "Connect" on hover */
|
|
940
954
|
> #connect-text {
|
|
941
955
|
font-weight: 500;
|
|
@@ -957,16 +971,16 @@ Resources:
|
|
|
957
971
|
display: none;
|
|
958
972
|
}
|
|
959
973
|
}
|
|
960
|
-
`,
|
|
974
|
+
`,R4=(0,Kp.default)(kr)`
|
|
961
975
|
margin-left: auto;
|
|
962
|
-
`;var
|
|
976
|
+
`;var Ro=require("react/jsx-runtime"),I4=["coinbase_wallet"],M4=["metamask","okx_wallet","rainbow","uniswap","zerion","rabby_wallet","cryptocom"],W4=[],O4=["phantom"],ga=({connectOnly:e})=>{let{connectors:t}=W(),{app:r}=P(),o=Fn(r.appearance.walletList,t,e,r.appearance.walletList,r.externalWallets.walletConnect.enabled);return(0,Ro.jsxs)(Ro.Fragment,{children:[...o]})},Fn=(e,t,r,o,n)=>{let i=[],a=[],l=[],s=t.find(c=>c.connectorType==="wallet_connect_v2");for(let c of e)if(c==="detected_wallets"){let m=t.filter(({connectorType:f,walletClientType:u})=>u==="uniswap_wallet_extension"?!o.includes("uniswap"):u==="crypto.com_wallet_extension"?!o.includes("cryptocom"):f==="injected"&&!o.includes(u));for(let f of m){let{walletClientType:u,walletBranding:C}=f;(u==="unknown"?a:i).push((0,Ro.jsx)(Ti,{connectOnly:r,provider:u,logo:C.icon,displayName:C.name,connector:f},`${c}-${u}`))}}else if(O4.includes(c)){let m=t.find(f=>f.connectorType==="injected"&&f.walletClientType===c||f.connectorType===c);m&&i.push((0,Ro.jsx)(Ti,{connectOnly:r,provider:c,connector:m},c))}else if(M4.includes(c)){let m=t.find(f=>c==="uniswap"?f.walletClientType==="uniswap_wallet_extension":c==="cryptocom"?f.walletClientType==="crypto.com_wallet_extension":f.connectorType==="injected"&&f.walletClientType===c);n&&!m&&(m=s),m&&i.push((0,Ro.jsx)(Ti,{connectOnly:r,provider:c,connector:m},c))}else if(I4.includes(c)){let m=t.find(({connectorType:f})=>f===c);m&&i.push((0,Ro.jsx)(Ti,{connectOnly:r,provider:c,connector:m},c))}else W4.includes(c)?s&&l.push((0,Ro.jsx)(Ti,{connectOnly:r,provider:c,connector:s},c)):c==="wallet_connect"&&s&&l.push((0,Ro.jsx)(Ti,{connectOnly:r,provider:c,connector:s},c));return[...a,...i,...l]};var zo=require("react/jsx-runtime"),Qy=()=>{let{app:e}=P(),{linkingOrConnectingHint:t}=W(),r=t?`Connect the wallet with address ${Mt(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return(0,zo.jsxs)(zo.Fragment,{children:[(0,zo.jsx)(x,{},"header"),(0,zo.jsx)(Vo,{title:"Connect your wallet",description:r}),(0,zo.jsx)(Pr,{children:(0,zo.jsx)(ga,{connectOnly:!0})}),(0,zo.jsx)(K,{})]})};var Io=require("react/jsx-runtime"),Jy=()=>{let{app:e}=P(),{linkingOrConnectingHint:t}=W(),r=t?`Connect the wallet with address ${Mt(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return(0,Io.jsxs)(Io.Fragment,{children:[(0,Io.jsx)(x,{},"header"),(0,Io.jsx)(wi,{title:"Connect your wallet",description:r}),(0,Io.jsx)(Pr,{children:(0,Io.jsx)(ga,{connectOnly:!0})}),e&&(0,Io.jsx)(ua,{app:e,alwaysShowImplicitConsent:!0}),(0,Io.jsx)(K,{})]})};var Ca=require("react"),rg=require("react-device-detect"),og=y(require("styled-components"));var Fr=require("react"),_s=require("react-device-detect"),Yp=y(require("styled-components"));var Ss=require("react"),L4=(e,t)=>{let r=(0,Ss.useRef)(()=>{});(0,Ss.useEffect)(()=>{r.current=e}),(0,Ss.useEffect)(()=>{if(t!==null){let o=setInterval(()=>r.current(),t||0);return()=>clearInterval(o)}},[t])},Xy=L4;var va=require("react");function eg(){let[e,t]=(0,va.useState)(!1),r=(0,va.useCallback)(()=>{document.hidden&&t(!0)},[]);return(0,va.useEffect)(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}var Ge=require("react/jsx-runtime"),jp=2,Zp=e=>e?.privyErrorCode==="linked_to_another_user"?cn.ERROR_USER_EXISTS:e instanceof Kt&&!e.details.default?e.details:e instanceof Qi?cn.ERROR_TIMED_OUT:e instanceof Ji?cn.ERROR_USER_REJECTED_CONNECTION:cn.ERROR_WALLET_CONNECTION,tg=()=>{let[e,t]=(0,Fr.useState)(!1),[r,o]=(0,Fr.useState)(!1),[n,i]=(0,Fr.useState)(void 0),{authenticated:a,logout:l}=$(),{app:s,navigate:c,navigateBack:m,lastScreen:f,currentScreen:u,setModalData:C}=P(),{getAuthFlow:v,walletConnectionStatus:g,closePrivyModal:E,initLoginWithWallet:S,loginWithWallet:R,updateWallets:T,createAnalyticsEvent:A}=W(),{walletConnectors:k}=$(),[M,D]=(0,Fr.useState)(0),{user:G}=$(),[Y]=(0,Fr.useState)(G?.linkedAccounts.length||0),[Z,L]=(0,Fr.useState)(""),[U,O]=(0,Fr.useState)(""),[Ie,je]=(0,Fr.useState)(!1),{hasTabbedAway:Q}=eg(),{enabled:re,token:ae}=We(),Fe=_s.isMobile&&g?.connector?.connectorType==="wallet_connect_v2"||_s.isMobile&&g?.connector?.connectorType==="coinbase_wallet"||_s.isMobile&&g?.connector?.connectorType==="injected"&&g?.connector?.walletClientType==="phantom",Ne=g?.status==="connected",ut=g?.status==="switching_to_supported_chain";(0,Fr.useEffect)(()=>{let q=v(),fe=q instanceof sn?q:void 0;if(Ne&&!fe&&(re&&!ae&&!a?(C({captchaModalData:{callback:Dt=>S(g.connectedWallet,Dt).then(()=>{je(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN",!1)):S(g.connectedWallet,ae).then(()=>{je(!0)})),fe&&Fe&&Ne&&!fe.preparedMessage){fe.buildSiweMessage();return}!fe||Fe||!Ne||r||(async()=>{o(!0),i(void 0);try{g?.connector?.connectorType==="wallet_connect_v2"&&g?.connector?.walletClientType==="metamask"&&await sp(2500),await Nt()}catch(Dt){console.warn("Auto-prompted signature failed",Dt)}finally{o(!1)}})()},[M,Ne,Ie]),(0,Fr.useEffect)(()=>{if(G&&e){let fe=ot-500;if(s?.legal.requireUsersAcceptTerms&&!G.hasAcceptedTerms){let rs=setTimeout(()=>{c("AFFIRMATIVE_CONSENT_SCREEN")},fe);return()=>clearTimeout(rs)}if(Sr(G,s?.embeddedWallets?.createOnLogin)){let rs=setTimeout(()=>{C({createWallet:{onSuccess:()=>{},onFailure:il=>{console.error(il),A({eventName:"embedded_wallet_creation_failure_logout",payload:{error:il,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),c("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},fe);return()=>clearTimeout(rs)}T();let Dt=setTimeout(()=>E({shouldCallAuthOnSuccess:!0,isSuccess:!0}),ot);return()=>clearTimeout(Dt)}},[G,e]);let lt=q=>{if(q?.privyErrorCode==="allowlist_rejected"){c("ALLOWLIST_REJECTION_SCREEN");return}else if(q?.privyErrorCode==="max_accounts_reached"){console.error(new ro(q).toString()),c("USER_LIMIT_REACHED_SCREEN");return}else if(q?.privyErrorCode==="user_does_not_exist"){c("ACCOUNT_NOT_FOUND_SCREEN");return}i(Zp(q))};async function Nt(){try{await R(),t(!0)}catch(q){lt(q)}finally{o(!1)}}(0,Fr.useEffect)(()=>{g?.connectError&<(g?.connectError)},[g]),Xy(()=>{let q=at==="wallet_connect_v2"&&g?.connector instanceof To?g.connector.redirectUri:void 0;q&&L(q);let fe=at==="wallet_connect_v2"&&g?.connector instanceof To?g.connector.fallbackUniversalRedirectUri:void 0;fe&&O(fe)},g?.connector instanceof To&&!Z?500:null);let at=g?.connector?.connectorType||"injected",ge=g?.connector?.walletClientType||"unknown",Cr=co[ge]?.displayName||g?.connector?.walletBranding.name||"Browser Extension",go=co[ge]?.logo||g?.connector?.walletBranding.icon||(q=>(0,Ge.jsx)(ea,{...q})),Lo=Cr==="Browser Extension"?Cr.toLowerCase():Cr,N;e?N=`Successfully connected with ${Lo}`:n?N=n.message:ut?N="Switching networks":Ne?N=r&&Fe?"Signing":"Sign to verify":N=`Waiting for ${Lo}`;let _t="Don\u2019t see your wallet? Check your other browser windows.";if(e){let q=G?.linkedAccounts.length||0;Y===q?_t="Wallet was already linked.":_t="You\u2019re good to go!"}else M>=jp&&n?_t="Unable to connect wallet":n?_t=n.detail:ut?_t="Switch your wallet to the requested network.":Ne&&Fe?_t="Sign the message in your wallet to verify it belongs to you.":ge==="metamask"&&_s.isMobile?_t="Click continue to open and connect MetaMask.":ge==="metamask"?_t="For the best experience, connect only one wallet at a time.":at==="wallet_connect"?_t="Open your mobile wallet app to continue":at==="coinbase_wallet"&&(Tl()||(Rp(G)?_t="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":_t="Open the Coinbase app on your phone to continue."));let vo=k?.walletConnectors?.find(q=>q.walletClientType==="coinbase_wallet"),V=ge==="coinbase_wallet"&&(Rp(G)||n===cn.ERROR_USER_EXISTS);return(0,Ge.jsxs)(Ge.Fragment,{children:[(0,Ge.jsx)(x,{backFn:!f||u===f?void 0:m}),(0,Ge.jsxs)(N4,{children:[(0,Ge.jsx)(Qp,{walletLogo:go,success:e,fail:!!n}),(0,Ge.jsxs)(pt,{children:[(0,Ge.jsx)("h3",{children:N}),(0,Ge.jsx)("p",{children:_t}),!Ne&&Z&&!Q?(0,Ge.jsxs)("p",{children:["Still here?"," ",(0,Ge.jsx)("a",{href:Z,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),U&&(0,Ge.jsxs)(Ge.Fragment,{children:[" ","or"," ",(0,Ge.jsx)("a",{href:U,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]}):null]}),V?(0,Ge.jsx)(H,{onClick:()=>vo&&vo?.disconnect(),disabled:e,children:"Use a different wallet"}):n==cn.ERROR_USER_EXISTS&&u!==f?(0,Ge.jsx)(H,{onClick:m,children:"Use a different wallet"}):Ne&&!e&&Fe?(0,Ge.jsx)(H,{onClick:()=>{o(!0),Nt()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&M<jp?(0,Ge.jsx)(H,{onClick:()=>{D(M+1),i(void 0),Ne?(o(!0),Nt()):g?.connectRetry()},disabled:!e&&(!n?.retryable||M>=jp),children:"Retry"}):!e&&!n?(0,Ge.jsx)(H,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),(0,Ge.jsx)(J,{})]})},N4=Yp.default.div`
|
|
963
977
|
display: flex;
|
|
964
978
|
flex-direction: column;
|
|
965
979
|
align-items: center;
|
|
966
980
|
justify-content: center;
|
|
967
981
|
gap: 24px;
|
|
968
982
|
width: 100%;
|
|
969
|
-
`,
|
|
983
|
+
`,D4=Yp.default.div`
|
|
970
984
|
display: flex;
|
|
971
985
|
flex-direction: column;
|
|
972
986
|
justify-content: center;
|
|
@@ -989,14 +1003,14 @@ Resources:
|
|
|
989
1003
|
left: -19px;
|
|
990
1004
|
top: -19px;
|
|
991
1005
|
}
|
|
992
|
-
`,
|
|
1006
|
+
`,Qp=e=>{let t=e.walletLogo;return(0,Ge.jsx)(Ge.Fragment,{children:(0,Ge.jsx)(D4,{children:(0,Ge.jsxs)("div",{children:[(0,Ge.jsx)(Pt,{success:e.success,fail:e.fail}),typeof t=="string"?(0,Ge.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):(0,Ge.jsx)(t,{style:{width:"38px",height:"38px"}})]})})})};var sr=require("react/jsx-runtime"),Rc=2,ng=()=>{let{navigateBack:e,navigate:t,lastScreen:r,currentScreen:o,data:n}=P(),{walletConnectionStatus:i,closePrivyModal:a}=W(),[l,s]=(0,Ca.useState)(void 0),[c,m]=(0,Ca.useState)(0),f=i?.status==="connected",u=i?.status==="switching_to_supported_chain";(0,Ca.useEffect)(()=>{if(f){let k;if(n?.externalConnectWallet?.onCompleteNavigateTo){let M=n.externalConnectWallet.onCompleteNavigateTo;k=setTimeout(()=>{t(M)},ot)}else k=setTimeout(a,ot);return()=>clearTimeout(k)}},[f]);let C=k=>{s(Zp(k))};(0,Ca.useEffect)(()=>{i?.connectError&&C(i?.connectError)},[i]);let v=i?.connector?.connectorType||"injected",g=i?.connector?.walletClientType||"unknown",E=co[g]?.displayName||i?.connector?.walletBranding.name||"Browser Extension",S=co[g]?.logo||i?.connector?.walletBranding.icon||(k=>(0,sr.jsx)(ea,{...k})),R=E==="Browser Extension"?E.toLowerCase():E,T;f?T=`Successfully connected with ${R}`:l?T=l.message:u?T="Switching networks":T=`Waiting for ${R}`;let A="Don\u2019t see your wallet? Check your other browser windows.";return f?A="You\u2019re good to go!":c>=Rc&&l?A="Unable to connect wallet":l?A=l.detail:u?A="Switch your wallet to the requested network.":g==="metamask"&&rg.isMobile?A="Click to continue to open and connect MetaMask.":g==="metamask"?A="For the best experience, connect only one wallet at a time.":v==="wallet_connect_v2"?A="Open your mobile wallet app to continue":v==="coinbase_wallet"&&(A="Open the Coinbase app on your phone to continue."),(0,sr.jsxs)(sr.Fragment,{children:[(0,sr.jsx)(x,{backFn:o===r?void 0:e}),(0,sr.jsxs)(U4,{children:[(0,sr.jsx)(Qp,{walletLogo:S,success:f,fail:!!l}),(0,sr.jsxs)(pt,{children:[(0,sr.jsx)("h3",{children:T}),(0,sr.jsx)("p",{children:A})]}),l==cn.ERROR_USER_EXISTS?(0,sr.jsx)(H,{onClick:e,children:"Use a different wallet"}):!f&&l?.retryable&&c<Rc?(0,sr.jsx)(H,{onClick:()=>{m(c+1),s(void 0),i?.connectRetry()},disabled:!f&&(!l?.retryable||c>=Rc),children:"Retry"}):!f&&l&&c>=Rc?(0,sr.jsx)(H,{onClick:e,children:"Use a different wallet"}):null]}),(0,sr.jsx)(J,{})]})},U4=og.default.div`
|
|
993
1007
|
display: flex;
|
|
994
1008
|
flex-direction: column;
|
|
995
1009
|
align-items: center;
|
|
996
1010
|
justify-content: center;
|
|
997
1011
|
gap: 24px;
|
|
998
1012
|
width: 100%;
|
|
999
|
-
`;var
|
|
1013
|
+
`;var Si=require("react"),ag=y(require("styled-components"));var Jp=require("react/jsx-runtime"),ig=({name:e,logoUrl:t})=>{let r=`${e??"Provider app"} logo`;return typeof t=="string"?(0,Jp.jsx)("img",{src:t,alt:r,style:{width:"38px",height:"38px",maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):(0,Jp.jsx)("span",{})};var Yt=require("react/jsx-runtime"),sg=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t}=P(),{crossAppAuthFlow:r,updateWallets:o,closePrivyModal:n}=W(),[i,a]=(0,Si.useState)({}),l={id:e?.crossAppAuth?.appId??"",name:e?.crossAppAuth?.name??"app",logoUrl:e?.crossAppAuth?.logoUrl},s=ot,c=new b(`There was an issue connecting your ${l.name} account. Please try again.`),m=new rt(async v=>{if(!e?.crossAppAuth?.popup){a({error:c});return}try{let g=await r({appId:v,popup:e.crossAppAuth.popup});a({data:g})}catch(g){g instanceof b?a({error:g}):g instanceof pr?(e?.crossAppAuth?.popup&&e.crossAppAuth.popup.close(),a({error:c})):a({error:c})}}),f=()=>{i.data&&(o(),e?.crossAppAuth?.onSuccess(i.data),n({shouldCallAuthOnSuccess:!0,isSuccess:!0})),e?.crossAppAuth?.onError(i.error??new b("User canceled flow")),n({shouldCallAuthOnSuccess:!1,isSuccess:!1})};t.current=f,(0,Si.useEffect)(()=>{l.id.length&&m.execute(l.id)},[l.id]),(0,Si.useEffect)(()=>{if(!i.data)return;let v=setTimeout(f,s);return()=>clearTimeout(v)},[i.data]);let{title:u,subtitle:C}=(0,Si.useMemo)(()=>i.data?{title:`Successfully connected with ${l.name}`,subtitle:"You're good to go!"}:i.error?{title:"Authentication failed",subtitle:i.error.message}:{title:`Connecting to ${l.name}`,subtitle:`Please check the pop-up from ${l.name} to continue`},[i,l.name]);return(0,Yt.jsxs)(Yt.Fragment,{children:[(0,Yt.jsx)(x,{onClose:f}),(0,Yt.jsx)(de,{}),(0,Yt.jsxs)(F4,{children:[(0,Yt.jsx)(vt,{children:(0,Yt.jsxs)("div",{children:[(0,Yt.jsx)(Pt,{success:!!i.data,fail:!!i.error}),(0,Yt.jsx)(ig,{name:l.name,logoUrl:l.logoUrl})]})}),(0,Yt.jsxs)(pt,{children:[(0,Yt.jsx)("h3",{children:u}),(0,Yt.jsx)("p",{children:C})]})]}),(0,Yt.jsx)(me,{}),(0,Yt.jsx)(J,{})]})},F4=ag.default.div`
|
|
1000
1014
|
display: flex;
|
|
1001
1015
|
flex-direction: column;
|
|
1002
1016
|
align-items: center;
|
|
@@ -1004,7 +1018,7 @@ Resources:
|
|
|
1004
1018
|
margin-left: 27px;
|
|
1005
1019
|
margin-right: 27px;
|
|
1006
1020
|
gap: 24px;
|
|
1007
|
-
`;var
|
|
1021
|
+
`;var ug=y(require("@heroicons/react/24/solid/XCircleIcon")),Ea=require("react"),mg=y(require("styled-components"));var Ps=y(require("styled-components")),wa=require("react/jsx-runtime"),Ic=()=>(0,wa.jsx)(B4,{children:(0,wa.jsxs)(H4,{children:[(0,wa.jsx)(G4,{}),(0,wa.jsx)(V4,{})]})}),B4=Ps.default.div`
|
|
1008
1022
|
display: flex;
|
|
1009
1023
|
justify-content: center;
|
|
1010
1024
|
align-items: center;
|
|
@@ -1016,14 +1030,14 @@ Resources:
|
|
|
1016
1030
|
@media all and (display-mode: standalone) {
|
|
1017
1031
|
margin-bottom: 30px;
|
|
1018
1032
|
}
|
|
1019
|
-
`,
|
|
1033
|
+
`,H4=Ps.default.div`
|
|
1020
1034
|
position: relative;
|
|
1021
1035
|
height: 140px;
|
|
1022
1036
|
width: 140px;
|
|
1023
1037
|
|
|
1024
1038
|
opacity: 1;
|
|
1025
1039
|
animation: fadein 200ms ease;
|
|
1026
|
-
`,
|
|
1040
|
+
`,G4=Ps.default.div`
|
|
1027
1041
|
position: absolute;
|
|
1028
1042
|
top: 0;
|
|
1029
1043
|
right: 0;
|
|
@@ -1036,7 +1050,7 @@ Resources:
|
|
|
1036
1050
|
border: 4px solid var(--privy-color-accent-light);
|
|
1037
1051
|
border-radius: 50%;
|
|
1038
1052
|
}
|
|
1039
|
-
`,
|
|
1053
|
+
`,V4=Ps.default.div`
|
|
1040
1054
|
position: absolute;
|
|
1041
1055
|
top: 0;
|
|
1042
1056
|
right: 0;
|
|
@@ -1060,20 +1074,20 @@ Resources:
|
|
|
1060
1074
|
transform: rotate(360deg);
|
|
1061
1075
|
}
|
|
1062
1076
|
}
|
|
1063
|
-
`;var
|
|
1077
|
+
`;var lg=["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 Ze=class extends Error{constructor(r,o){super(o);this.type=r}};function ba(e){let t=e.type;return typeof t=="string"&&lg.includes(t)}function q4(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function _i(e){return ba(e)&&e.type==="wallet_not_on_device"}function cg(e){return ba(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function Bn(e){return!!(ba(e)&&e.type==="mfa_timeout")}function Hn(e){return!!(ba(e)&&e.type==="missing_or_invalid_mfa")}function Mc(e){return!!(ba(e)&&e.type==="mfa_verification_max_attempts_reached")}function Wc(e){return!!(ba(e)&&e.message.includes("code 429"))}function Oc(e){return!!(q4(e)&&e.message==="MFA canceled")}function Xp({isCreatingWallet:e,skipSplashScreen:t}){return e?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":t?"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function Lc({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r=!1,isResettingPassword:o=!1}){return r||t.length===1?Xp({isCreatingWallet:e==="create",skipSplashScreen:o}):"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"}function Nc(e){switch(e){case"user-passcode":return"EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN";case"google-drive":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";case"icloud":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";default:throw new Error("Recovery method not supported")}}async function eu({api:e,provider:t}){let r=pi(),o=Ki(),n=await ji(r);try{return t==="icloud"?{url:(await e.post(Dm,{client_type:"web"})).url}:{url:(await e.post(Nm,{redirect_to:window.location.href,code_challenge:n,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(i){throw Ce(i)}}async function dg({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new b("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new b("User denied confirmation during OAuth flow");try{return(await e.post(Um,{authorization_code:n,state_code:r,code_verifier:o,provider:t})).access_token}catch(i){let a=Ce(i);throw a.privyErrorCode?new b(a.message||"Invalid code during OAuth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during OAuth flow"?new b("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new b("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}var Ir=require("react/jsx-runtime"),pg=1,fg=()=>{let{authenticated:e,user:t,getAccessToken:r}=$(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:i}=W(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:c}=P(),m=(0,Ea.useMemo)(()=>Date.now(),[]),[f,u]=(0,Ea.useState)(!1),{onCompleteNavigateTo:C,onFailure:v,shouldForceMFA:g,address:E}=l?.connectWallet,S=T=>{f||(u(!0),v(typeof T=="string"?new Error(T):T))};(0,Ea.useEffect)(()=>{let T=E?t?.linkedAccounts.find(M=>M.type==="wallet"&&M.walletClientType==="privy"&&M.address===E):Ae(t),A;return!e||!T?S("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let M=await r();if(!M)return S("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:M,address:T.address}),g&&await i.verifyMfa({accessToken:M});let D=(Date.now()-m)/1e3;C==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&D<pg?A=setTimeout(()=>{a(C)},(pg-D)*1e3):a(C)}catch(D){if(_i(D)&&T.recoveryMethod==="privy"){let G=await r();if(!G)return S("User must be authenticated and have a Privy wallet before it can be recovered");try{n({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:T.address}}),(await i?.recover({address:T.address,accessToken:G,recoveryMethod:T.recoveryMethod}))?.address||S(new Error("Unable to recover wallet")),C?a(C):o({shouldCallAuthOnSuccess:!1}),n({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:T.address}}),a(C)}catch{S("An error has occurred, please try again.")}}else if(_i(D)&&T.recoveryMethod!=="privy"){s({...l,recoverWallet:{privyWallet:T,onCompleteNavigateTo:C,onFailure:v},recoveryOAuthStatus:{provider:T.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}});let G=Nc(T.recoveryMethod);a(G)}else S(D)}})(),()=>clearTimeout(A)):void 0},[e,t,i]);let R=()=>{S("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return c.current=R,(0,Ir.jsxs)(Ir.Fragment,{children:[(0,Ir.jsx)(x,{onClose:R}),f?(0,Ir.jsxs)(Ir.Fragment,{children:[(0,Ir.jsxs)(Dr,{children:[(0,Ir.jsx)(ug.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,Ir.jsx)(xe,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),(0,Ir.jsx)(H,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):(0,Ir.jsx)(Ic,{}),(0,Ir.jsx)(z4,{})]})},z4=mg.default.div`
|
|
1064
1078
|
height: 44px;
|
|
1065
|
-
`;var
|
|
1079
|
+
`;var hg=y(require("@heroicons/react/24/solid/CheckCircleIcon")),yg=require("react");var po=require("react/jsx-runtime"),gg=()=>{let{user:e}=$(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=W(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=P(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:c}=i.createWallet,m=()=>{let f=Ae(e);f?(o(),l(f)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:c})};return(0,yg.useEffect)(()=>{let f=setTimeout(m,Il);return()=>clearTimeout(f)},[]),a.current=m,(0,po.jsxs)(po.Fragment,{children:[(0,po.jsx)(x,{onClose:m}),(0,po.jsx)(de,{}),(0,po.jsxs)(Dr,{children:[(0,po.jsx)(hg.default,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,po.jsx)(xe,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),(0,po.jsx)(me,{}),(0,po.jsx)(K,{})]})};var wg=y(require("@heroicons/react/20/solid/ExclamationTriangleIcon")),bg=y(require("@heroicons/react/24/outline/ArrowRightOnRectangleIcon")),mn=require("react"),fn=y(require("styled-components"));var ke=require("react/jsx-runtime"),Eg=()=>{let[e,t]=(0,mn.useState)(null),{authenticated:r,user:o,getAccessToken:n}=$(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=W(),{data:s,onUserCloseViaDialogOrKeybindRef:c}=P(),m=Ae(o)?.address,{onFailure:f,onSuccess:u,origin:C,appId:v,appClientId:g}=s.keyExport,E=R=>{i({shouldCallAuthOnSuccess:!1}),f(typeof R=="string"?new Error(R):R)},S=()=>{i({shouldCallAuthOnSuccess:!1}),u(),a({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:m}})};return(0,mn.useEffect)(()=>{let R=Ae(o);if(!r||!R)return E("User must be authenticated before exporting their wallet");n().then(t,E)},[r,o]),c.current=S,(0,ke.jsxs)(ke.Fragment,{children:[(0,ke.jsx)(x,{onClose:S}),(0,ke.jsxs)(j4,{children:[(0,ke.jsxs)(xe,{icon:(0,ke.jsx)(bg.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),title:"Transfer Wallet",children:[(0,ke.jsxs)(J4,{children:[(0,ke.jsx)(K4,{style:{marginRight:6}}),Mt(m)]}),(0,ke.jsx)("p",{children:"You can bring your account with you to another site using an external wallet."})]}),(0,ke.jsxs)(Y4,{children:[(0,ke.jsxs)(vg,{children:[(0,ke.jsx)(Cg,{children:"1"}),(0,ke.jsxs)("span",{children:[(0,ke.jsx)("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Follow the guide"})," ","to transfer your account to your wallet of choice."]})]}),(0,ke.jsxs)(vg,{children:[(0,ke.jsx)(Cg,{children:"2"}),(0,ke.jsx)("span",{children:"Copy this key into your other wallet"})]})]}),(0,ke.jsx)("div",{style:{width:"100%"},children:e&&(0,ke.jsx)($4,{origin:C,appId:v,appClientId:g,accessToken:e,clientAnalyticsId:l,address:m,dimensions:{height:"44px"}})}),(0,ke.jsxs)(X4,{children:[(0,ke.jsxs)("div",{children:[(0,ke.jsx)(wg.default,{viewBox:"0 0 20 18"}),(0,ke.jsx)("h4",{children:"Warning"})]}),(0,ke.jsx)("p",{children:"Never share your private key with anyone! It controls your account."})]})]}),(0,ke.jsx)(K,{})]})};function $4(e){let[t,r]=(0,mn.useState)(e.dimensions.width),[o,n]=(0,mn.useState)(void 0),i=(0,mn.useRef)(null);return(0,mn.useEffect)(()=>{if(i.current&&t===void 0){let{width:l}=i.current.getBoundingClientRect();r(l)}let a=getComputedStyle(document.documentElement);n({background2:a.getPropertyValue("--privy-color-background-2"),foreground3:a.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:a.getPropertyValue("--privy-color-foreground-accent"),accent:a.getPropertyValue("--privy-color-accent"),accentDark:a.getPropertyValue("--privy-color-accent-dark"),success:a.getPropertyValue("--privy-color-success")})},[]),(0,ke.jsx)("div",{ref:i,children:t&&(0,ke.jsxs)(Z4,{children:[(0,ke.jsx)("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:_l(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{client_id:e.appClientId,address:e.address,width:`${t}px`,caid:e.clientAnalyticsId,...o},{token:e.accessToken})}),(0,ke.jsx)(Q4,{children:"Loading..."})]})})}function K4(e){return(0,ke.jsx)("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:e.style,children:(0,ke.jsx)("path",{d:"M14 8.81335C14 7.98493 13.3284 7.31335 12.5 7.31335H10C10 8.41792 9.10457 9.31335 8 9.31335C6.89543 9.31335 6 8.41792 6 7.31335H3.5C2.67157 7.31335 2 7.98493 2 8.81335M14 8.81335V12.8134C14 13.6418 13.3284 14.3134 12.5 14.3134H3.5C2.67157 14.3134 2 13.6418 2 12.8134V8.81335M14 8.81335V6.81335M2 8.81335V6.81335M14 6.81335C14 5.98493 13.3284 5.31335 12.5 5.31335H3.5C2.67157 5.31335 2 5.98493 2 6.81335M14 6.81335V4.81335C14 3.98493 13.3284 3.31335 12.5 3.31335H3.5C2.67157 3.31335 2 3.98493 2 4.81335V6.81335",stroke:"var(--privy-color-foreground-3)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}var j4=fn.default.div`
|
|
1066
1080
|
display: flex;
|
|
1067
1081
|
flex-direction: column;
|
|
1068
1082
|
text-align: left;
|
|
1069
|
-
`,
|
|
1083
|
+
`,Y4=fn.default.div`
|
|
1070
1084
|
display: flex;
|
|
1071
1085
|
flex-direction: column;
|
|
1072
1086
|
gap: 24px;
|
|
1073
1087
|
padding-bottom: 16px;
|
|
1074
1088
|
margin-left: 11px;
|
|
1075
1089
|
border-left: 1px solid var(--privy-color-foreground-4) !important;
|
|
1076
|
-
`,
|
|
1090
|
+
`,vg=fn.default.div`
|
|
1077
1091
|
display: flex;
|
|
1078
1092
|
align-items: top;
|
|
1079
1093
|
gap: 8px;
|
|
@@ -1082,7 +1096,7 @@ Resources:
|
|
|
1082
1096
|
color: var(--privy-color-accent);
|
|
1083
1097
|
text-decoration: underline;
|
|
1084
1098
|
}
|
|
1085
|
-
`,
|
|
1099
|
+
`,Cg=fn.default.div`
|
|
1086
1100
|
display: flex;
|
|
1087
1101
|
align-items: center;
|
|
1088
1102
|
justify-content: center;
|
|
@@ -1096,11 +1110,11 @@ Resources:
|
|
|
1096
1110
|
border-radius: 100%;
|
|
1097
1111
|
background: var(--privy-color-background);
|
|
1098
1112
|
color: var(--privy-color-accent);
|
|
1099
|
-
`,
|
|
1113
|
+
`,Z4=fn.default.div`
|
|
1100
1114
|
overflow: visible;
|
|
1101
1115
|
position: relative;
|
|
1102
1116
|
height: 44px;
|
|
1103
|
-
`,
|
|
1117
|
+
`,Q4=fn.default.div`
|
|
1104
1118
|
position: absolute;
|
|
1105
1119
|
display: flex;
|
|
1106
1120
|
align-items: center;
|
|
@@ -1112,7 +1126,7 @@ Resources:
|
|
|
1112
1126
|
border-radius: var(--privy-border-radius-md);
|
|
1113
1127
|
background-color: var(--privy-color-background-2);
|
|
1114
1128
|
color: var(--privy-color-foreground-3);
|
|
1115
|
-
`,
|
|
1129
|
+
`,J4=fn.default.div`
|
|
1116
1130
|
display: flex;
|
|
1117
1131
|
align-items: center;
|
|
1118
1132
|
padding-top: 1px;
|
|
@@ -1125,7 +1139,7 @@ Resources:
|
|
|
1125
1139
|
font-size: 12px;
|
|
1126
1140
|
font-weight: 500;
|
|
1127
1141
|
margin: auto;
|
|
1128
|
-
`,
|
|
1142
|
+
`,X4=fn.default.div`
|
|
1129
1143
|
border: 1px solid var(--privy-color-background-2) !important;
|
|
1130
1144
|
border-radius: var(--privy-border-radius-md);
|
|
1131
1145
|
padding: 16px;
|
|
@@ -1147,9 +1161,9 @@ Resources:
|
|
|
1147
1161
|
color: var(--privy-color-error);
|
|
1148
1162
|
}
|
|
1149
1163
|
}
|
|
1150
|
-
`;var
|
|
1164
|
+
`;var Tg=y(require("@heroicons/react/24/solid/XCircleIcon")),As=require("react"),Sg=y(require("styled-components"));var Dc=require("react");function Uc(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=W(),o=(0,Dc.useRef)(!1);return{createWallet:(0,Dc.useCallback)(async i=>{let a=await Re();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($i);if(!l)throw new Error("walletProxy does not exist.");let s=2e4,c=new Promise((C,v)=>{setTimeout(()=>{v(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 f=await e();if(!f)throw new Error("Failed to refresh user.");let u=Ae(f);if(!u)throw new Error("Updated user is missing embedded wallet.");return t({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:u.address}}),o.current=!0,u}catch(l){if(o.current)return;throw t({eventName:"embedded_wallet_creation_failed",payload:{error:l.toString()}}),console.warn(l),l}},[])}}var uo=require("react/jsx-runtime"),_g=()=>{let{app:e,setModalData:t,navigate:r,data:o,onUserCloseViaDialogOrKeybindRef:n}=P(),[i,a]=(0,As.useState)(""),{embeddedWallets:l}=dt(),{authenticated:s}=$(),{closePrivyModal:c}=W(),{onSuccess:m,onFailure:f,callAuthOnSuccessOnClose:u}=o.createWallet,C=e?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,{createWallet:v}=Uc(),[g,E]=(0,As.useState)(null),S=new rt(async()=>{try{let T=await v();if(!T)return;E(T),r("EMBEDDED_WALLET_CREATED_SCREEN")}catch(T){a(T.message)}});(0,As.useEffect)(()=>{if(!s){r("LANDING"),f(new Error("User must be authenticated before creating a Privy wallet"));return}if(C){t({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}});let T=Lc({walletAction:"create",availableRecoveryMethods:l.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1});return r(T)}S.execute()},[C,s]);let R=()=>{g?(m(g),c({shouldCallAuthOnSuccess:u})):(f(new ur("User wallet creation failed")),c({shouldCallAuthOnSuccess:!1}))};return n.current=()=>null,i?(0,uo.jsxs)(uo.Fragment,{children:[(0,uo.jsx)(x,{closeable:!1}),(0,uo.jsxs)(Dr,{children:[(0,uo.jsx)(Tg.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,uo.jsx)(xe,{title:"Something went wrong",description:i})]}),(0,uo.jsx)(H,{onClick:R,children:"Close"}),(0,uo.jsx)(e5,{})]}):(0,uo.jsx)(Ic,{})},e5=Sg.default.div`
|
|
1151
1165
|
height: 44px;
|
|
1152
|
-
`;var
|
|
1166
|
+
`;var Pi=require("react");var Ra=require("react");var Wg=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Aa=require("react");var Pg=y(require("@heroicons/react/24/outline/ArrowPathIcon")),Ag=y(require("@heroicons/react/24/outline/EyeIcon")),xg=y(require("@heroicons/react/24/outline/EyeSlashIcon")),Tt=y(require("styled-components"));var t5=Tt.css`
|
|
1153
1167
|
font-size: 14px;
|
|
1154
1168
|
font-style: normal;
|
|
1155
1169
|
font-weight: 400;
|
|
@@ -1157,8 +1171,8 @@ Resources:
|
|
|
1157
1171
|
letter-spacing: -0.008px;
|
|
1158
1172
|
text-align: left;
|
|
1159
1173
|
transition: color 0.1s ease-in;
|
|
1160
|
-
`,
|
|
1161
|
-
${
|
|
1174
|
+
`,Fc=Tt.default.span`
|
|
1175
|
+
${t5}
|
|
1162
1176
|
transition: color 0.1s ease-in;
|
|
1163
1177
|
color: ${({error:e})=>e?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
|
|
1164
1178
|
text-transform: ${({error:e})=>e?"":"capitalize"};
|
|
@@ -1166,18 +1180,18 @@ Resources:
|
|
|
1166
1180
|
&[aria-hidden='true'] {
|
|
1167
1181
|
visibility: hidden;
|
|
1168
1182
|
}
|
|
1169
|
-
`,
|
|
1183
|
+
`,Gn=Tt.default.div`
|
|
1170
1184
|
display: flex;
|
|
1171
1185
|
flex-direction: column;
|
|
1172
1186
|
justify-content: center;
|
|
1173
1187
|
flex-grow: 1;
|
|
1174
|
-
`,
|
|
1175
|
-
${e=>e.hideAnimations&&
|
|
1188
|
+
`,Vn=(0,Tt.default)(H)`
|
|
1189
|
+
${e=>e.hideAnimations&&Tt.css`
|
|
1176
1190
|
&& {
|
|
1177
1191
|
transition: none;
|
|
1178
1192
|
}
|
|
1179
1193
|
`}
|
|
1180
|
-
`,
|
|
1194
|
+
`,kg=Tt.css`
|
|
1181
1195
|
&& {
|
|
1182
1196
|
width: 100%;
|
|
1183
1197
|
border-width: 1px;
|
|
@@ -1192,8 +1206,8 @@ Resources:
|
|
|
1192
1206
|
font-weight: 300;
|
|
1193
1207
|
line-height: 22px; /* 137.5% */
|
|
1194
1208
|
}
|
|
1195
|
-
`,
|
|
1196
|
-
${
|
|
1209
|
+
`,Ta=Tt.default.input`
|
|
1210
|
+
${kg}
|
|
1197
1211
|
|
|
1198
1212
|
&::placeholder {
|
|
1199
1213
|
color: var(--privy-color-foreground-3);
|
|
@@ -1204,15 +1218,15 @@ Resources:
|
|
|
1204
1218
|
overflow: hidden;
|
|
1205
1219
|
text-overflow: ellipsis;
|
|
1206
1220
|
white-space: nowrap;
|
|
1207
|
-
`,
|
|
1208
|
-
${
|
|
1209
|
-
`,
|
|
1221
|
+
`,Rg=Tt.default.div`
|
|
1222
|
+
${kg}
|
|
1223
|
+
`,qn=Tt.default.div`
|
|
1210
1224
|
position: relative;
|
|
1211
1225
|
width: 100%;
|
|
1212
1226
|
display: flex;
|
|
1213
1227
|
align-items: center;
|
|
1214
1228
|
justify-content: ${({centered:e})=>e?"center":"space-between"};
|
|
1215
|
-
`,
|
|
1229
|
+
`,zn=Tt.default.div`
|
|
1216
1230
|
display: flex;
|
|
1217
1231
|
flex-direction: column;
|
|
1218
1232
|
align-items: center;
|
|
@@ -1234,12 +1248,12 @@ Resources:
|
|
|
1234
1248
|
font-weight: 400;
|
|
1235
1249
|
line-height: 20px;
|
|
1236
1250
|
}
|
|
1237
|
-
`,
|
|
1251
|
+
`,xs=Tt.default.div`
|
|
1238
1252
|
display: flex;
|
|
1239
1253
|
flex-direction: column;
|
|
1240
1254
|
gap: 10px;
|
|
1241
1255
|
padding-bottom: 1rem;
|
|
1242
|
-
`,
|
|
1256
|
+
`,ks=Tt.default.div`
|
|
1243
1257
|
display: flex;
|
|
1244
1258
|
text-align: left;
|
|
1245
1259
|
align-items: center;
|
|
@@ -1259,13 +1273,13 @@ Resources:
|
|
|
1259
1273
|
> :first-child {
|
|
1260
1274
|
min-width: 24px;
|
|
1261
1275
|
}
|
|
1262
|
-
`,
|
|
1276
|
+
`,aR=Tt.default.div`
|
|
1263
1277
|
height: var(--privy-height-modal-full);
|
|
1264
1278
|
|
|
1265
1279
|
@media (max-width: 440px) {
|
|
1266
1280
|
height: var(--privy-height-modal-compact);
|
|
1267
1281
|
}
|
|
1268
|
-
|
|
1282
|
+
`,tu=(0,Tt.default)(ws)`
|
|
1269
1283
|
display: flex;
|
|
1270
1284
|
flex: 1;
|
|
1271
1285
|
gap: 4px;
|
|
@@ -1277,7 +1291,7 @@ Resources:
|
|
|
1277
1291
|
border-color: var(--privy-color-foreground-3);
|
|
1278
1292
|
border-width: 1px;
|
|
1279
1293
|
}
|
|
1280
|
-
`,
|
|
1294
|
+
`,Sa=Tt.default.div`
|
|
1281
1295
|
position: absolute;
|
|
1282
1296
|
right: 0.5rem;
|
|
1283
1297
|
|
|
@@ -1285,7 +1299,7 @@ Resources:
|
|
|
1285
1299
|
flex-direction: row;
|
|
1286
1300
|
justify-content: space-around;
|
|
1287
1301
|
align-items: center;
|
|
1288
|
-
`,
|
|
1302
|
+
`,Ig=(0,Tt.default)(Pg.default)`
|
|
1289
1303
|
height: 1.25rem;
|
|
1290
1304
|
width: 1.25rem;
|
|
1291
1305
|
stroke: var(--privy-color-accent);
|
|
@@ -1294,7 +1308,7 @@ Resources:
|
|
|
1294
1308
|
:active {
|
|
1295
1309
|
stroke: var(--privy-color-accent-light);
|
|
1296
1310
|
}
|
|
1297
|
-
`,
|
|
1311
|
+
`,_a=(0,Tt.default)(xg.default)`
|
|
1298
1312
|
height: 1.25rem;
|
|
1299
1313
|
width: 1.25rem;
|
|
1300
1314
|
stroke: var(--privy-color-accent);
|
|
@@ -1303,7 +1317,7 @@ Resources:
|
|
|
1303
1317
|
:active {
|
|
1304
1318
|
stroke: var(--privy-color-accent-light);
|
|
1305
1319
|
}
|
|
1306
|
-
`,
|
|
1320
|
+
`,Pa=(0,Tt.default)(Ag.default)`
|
|
1307
1321
|
height: 1.25rem;
|
|
1308
1322
|
width: 1.25rem;
|
|
1309
1323
|
stroke: var(--privy-color-accent);
|
|
@@ -1312,7 +1326,7 @@ Resources:
|
|
|
1312
1326
|
:active {
|
|
1313
1327
|
stroke: var(--privy-color-accent-light);
|
|
1314
1328
|
}
|
|
1315
|
-
`,
|
|
1329
|
+
`,Mg=Tt.default.progress`
|
|
1316
1330
|
height: 4px;
|
|
1317
1331
|
width: 100%;
|
|
1318
1332
|
margin: 8px 0;
|
|
@@ -1328,7 +1342,7 @@ Resources:
|
|
|
1328
1342
|
transition: all 0.1s ease-out;
|
|
1329
1343
|
background: ${({label:e})=>e==="Strong"&&"#78dca6"||e==="Medium"&&"var(--privy-color-warn)"||"var(--privy-color-error)"};
|
|
1330
1344
|
}
|
|
1331
|
-
`;var
|
|
1345
|
+
`;var St=require("react/jsx-runtime"),Og=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[i,a]=(0,Aa.useState)(!0),[l,s]=(0,Aa.useState)(!1),[c,m]=(0,Aa.useState)(""),f=r===c;return(0,Aa.useEffect)(()=>{c&&!l&&s(!0)},[c]),(0,St.jsxs)(St.Fragment,{children:[(0,St.jsx)(x,{closeable:!1,backFn:n}),(0,St.jsx)(de,{}),(0,St.jsxs)(Gn,{children:[(0,St.jsxs)(zn,{children:[(0,St.jsx)(Wg.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,St.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),(0,St.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),(0,St.jsxs)(qn,{children:[(0,St.jsx)(Ta,{value:c,onChange:u=>m(u.target.value),onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text",style:{paddingRight:"2.3rem"}}),(0,St.jsx)(Sa,{style:{right:"0.75rem"},children:i?(0,St.jsx)(_a,{onClick:()=>a(!1)}):(0,St.jsx)(Pa,{onClick:()=>a(!0)})})]}),(0,St.jsx)(Fc,{"aria-hidden":!l||f,error:!0,children:"Passwords do not match"})]}),(0,St.jsx)(Vn,{onClick:o,loading:t,disabled:!f,hideAnimations:e,children:"Continue"}),(0,St.jsx)(me,{}),(0,St.jsx)(K,{})]})};var Ug=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Fg=require("react"),Bg=y(require("styled-components"));var xa=y(require("styled-components")),$n=require("react/jsx-runtime"),Lg=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>(0,$n.jsx)("label",{children:(0,$n.jsxs)(r5,{className:e,children:[(0,$n.jsx)(Dg,{checked:t,...o}),(0,$n.jsx)(o5,{color:r,checked:t,children:(0,$n.jsx)(Ng,{viewBox:"0 0 24 24",children:(0,$n.jsx)("polyline",{points:"20 6 9 17 4 12"})})})]})});var fR=xa.default.label`
|
|
1332
1346
|
&& {
|
|
1333
1347
|
cursor: pointer;
|
|
1334
1348
|
display: flex;
|
|
@@ -1340,14 +1354,14 @@ Resources:
|
|
|
1340
1354
|
border: 1px solid var(--privy-color-foreground-4);
|
|
1341
1355
|
width: 100%;
|
|
1342
1356
|
}
|
|
1343
|
-
`,
|
|
1357
|
+
`,r5=xa.default.div`
|
|
1344
1358
|
display: inline-block;
|
|
1345
1359
|
vertical-align: middle;
|
|
1346
|
-
`,
|
|
1360
|
+
`,Ng=xa.default.svg`
|
|
1347
1361
|
fill: none;
|
|
1348
1362
|
stroke: white;
|
|
1349
1363
|
stroke-width: 3px;
|
|
1350
|
-
`,
|
|
1364
|
+
`,Dg=xa.default.input.attrs({type:"checkbox"})`
|
|
1351
1365
|
border: 0;
|
|
1352
1366
|
clip: rect(0 0 0 0);
|
|
1353
1367
|
clippath: inset(50%);
|
|
@@ -1358,7 +1372,7 @@ Resources:
|
|
|
1358
1372
|
position: absolute;
|
|
1359
1373
|
white-space: nowrap;
|
|
1360
1374
|
width: 1px;
|
|
1361
|
-
`,
|
|
1375
|
+
`,o5=xa.default.div`
|
|
1362
1376
|
display: inline-block;
|
|
1363
1377
|
width: 18px;
|
|
1364
1378
|
height: 18px;
|
|
@@ -1373,28 +1387,28 @@ Resources:
|
|
|
1373
1387
|
border-width: 1px;
|
|
1374
1388
|
}
|
|
1375
1389
|
|
|
1376
|
-
${
|
|
1390
|
+
${Dg}:focus + & {
|
|
1377
1391
|
box-shadow: 0 0 0 1px ${e=>e.color};
|
|
1378
1392
|
}
|
|
1379
1393
|
|
|
1380
|
-
${
|
|
1394
|
+
${Ng} {
|
|
1381
1395
|
visibility: ${e=>e.checked?"visible":"hidden"};
|
|
1382
1396
|
}
|
|
1383
|
-
`;var Ct=require("react/jsx-runtime"),
|
|
1397
|
+
`;var Ct=require("react/jsx-runtime"),Hg=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[i,a]=(0,Fg.useState)(!1);return(0,Ct.jsxs)(Ct.Fragment,{children:[(0,Ct.jsx)(x,{closeable:!1,backFn:o}),(0,Ct.jsx)(de,{}),(0,Ct.jsxs)(Gn,{children:[(0,Ct.jsxs)(zn,{children:[(0,Ct.jsx)(Ug.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),(0,Ct.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),(0,Ct.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),(0,Ct.jsx)(xs,{children:(0,Ct.jsxs)(ks,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[(0,Ct.jsx)(Lg,{color:"var(--privy-color-error)",readOnly:!0,checked:i}),(0,Ct.jsx)(Ct.Fragment,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),(0,Ct.jsxs)(n5,{children:[n.initiatedBy==="user"&&(0,Ct.jsx)(_o,{onClick:n.onCancel,disabled:t,children:"Cancel"}),(0,Ct.jsx)(Vn,{onClick:r,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),(0,Ct.jsx)(me,{}),(0,Ct.jsx)(K,{})]})},n5=Bg.default.div`
|
|
1384
1398
|
display: flex;
|
|
1385
1399
|
gap: 10px;
|
|
1386
|
-
`;var
|
|
1400
|
+
`;var Zg=y(require("@heroicons/react/24/outline/KeyIcon")),ru=y(require("@heroicons/react/24/solid/CheckCircleIcon")),hn=require("react"),ou=y(require("styled-components"));var Gg=y(require("fast-password-entropy")),Vg=y(require("secure-password-utilities")),qg=require("secure-password-utilities/wordlists"),i5=95,a5=8,s5=3,l5=.3,c5=/[a-z]/,d5=/[A-Z]/,p5=/[0-9]/,u5="a-zA-Z0-9",zg="!@#$%^&*()\\-_+.",$g=`${u5}${zg}`,m5=new RegExp(`[${zg}]`),f5=new RegExp(`[${$g}]`),Kg=new RegExp(`^[${$g}]{6,}$`),jg=(e="")=>{let t=e.split("").filter(r=>!f5.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},Bc=()=>Vg.generatePassphrase(4,qg.DEFAULT_WORDLIST);function h5(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function y5(e){if(e.length<a5)return 0;let t=0;c5.test(e)&&(t+=1),d5.test(e)&&(t+=1),p5.test(e)&&(t+=1),m5.test(e)&&(t+=1);let r=t/s5;return Math.max(0,Math.min(1,r))}function g5(e=""){let t=y5(e),r=(0,Gg.default)(e)/i5;return(t*l5+r)/2}function Yg(e=""){let t=g5(e);return{value:t,label:h5(t)}}var Ve=require("react/jsx-runtime"),Qg=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,isResettingPassword:n,onSubmit:i,onClose:a,onBack:l,onPasswordChange:s,onPasswordGenerate:c})=>{let[m,f]=(0,hn.useState)(!1),[u,C]=(0,hn.useState)(!1);(0,hn.useEffect)(()=>{r&&!u&&C(!0)},[r]);let v=(0,hn.useMemo)(()=>u?(r?.length||0)<6?"Password must be at least 6 characters":Kg.test(r||"")?null:`Invalid characters used ( ${jg(r).join(" ")} )`:null,[r,u]),g=(0,hn.useMemo)(()=>v?{value:0,label:"Weak"}:Yg(r),[r,v]),E=(0,hn.useMemo)(()=>!!(!r?.length||v),[v,r]);return(0,Ve.jsxs)(Ve.Fragment,{children:[(0,Ve.jsx)(x,{onClose:a,closeable:o.initiatedBy==="user",backFn:l}),(0,Ve.jsx)(de,{}),(0,Ve.jsxs)(Gn,{children:[(0,Ve.jsxs)(zn,{children:[(0,Ve.jsx)(Zg.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,Ve.jsxs)("h3",{style:{color:"var(--privy-color-foreground)"},children:[n?"Reset":"Set"," your password"]}),(0,Ve.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),(0,Ve.jsxs)(qn,{children:[(0,Ve.jsx)(Ta,{value:r,onChange:S=>s(S.target.value),placeholder:"enter or generate a strong password",type:m?"password":"text",style:{paddingRight:"3.8rem"}}),(0,Ve.jsxs)(Sa,{style:{width:"3.5rem"},children:[m?(0,Ve.jsx)(_a,{onClick:()=>f(!1)}):(0,Ve.jsx)(Pa,{onClick:()=>f(!0)}),(0,Ve.jsx)(Ig,{onClick:c})]})]}),(0,Ve.jsx)(Mg,{value:g.value===0?.01:g.value,label:g.label}),(0,Ve.jsx)(Fc,{error:!!v,children:v||`Password Strength: ${u?g.label:"--"}`}),(0,Ve.jsxs)(C5,{children:[(0,Ve.jsx)(v5,{children:(0,Ve.jsxs)(xs,{children:[(0,Ve.jsxs)(ks,{children:[(0,Ve.jsx)(ru.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),(0,Ve.jsxs)(ks,{children:[(0,Ve.jsx)(ru.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),(0,Ve.jsx)(Vn,{onClick:i,loading:t,disabled:E,hideAnimations:e,children:"Continue"})]})]}),(0,Ve.jsx)(me,{}),(0,Ve.jsx)(K,{})]})},v5=(0,ou.default)(xs)`
|
|
1387
1401
|
flex: 1;
|
|
1388
1402
|
padding-top: 1rem;
|
|
1389
|
-
|
|
1403
|
+
`,C5=ou.default.div`
|
|
1390
1404
|
display: flex;
|
|
1391
1405
|
flex-direction: column;
|
|
1392
1406
|
height: 100%;
|
|
1393
|
-
`;var
|
|
1407
|
+
`;var Jg=y(require("@heroicons/react/24/outline/ArrowDownTrayIcon")),Xg=y(require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon")),e1=y(require("@heroicons/react/24/outline/DocumentDuplicateIcon")),t1=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),Rs=require("react");var Qe=require("react/jsx-runtime"),r1=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:i})=>{let[a,l]=(0,Rs.useState)(!1),s=(0,Rs.useCallback)(()=>{l(!0),o&&navigator.clipboard.writeText(o)},[o]),c=(0,Rs.useCallback)(()=>{let m=document.createElement("a"),f=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),u=new Blob([w5(r,o)],{type:"text/plain"}),C=URL.createObjectURL(u);m.href=C,m.target="_blank",m.download=`${f}-privy-wallet-recovery.txt`,document.body.appendChild(m),m.click(),setTimeout(()=>{m.remove(),URL.revokeObjectURL(C)},5e3)},[o]);return(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(x,{backFn:i,closeable:!1}),(0,Qe.jsx)(de,{}),(0,Qe.jsxs)(Gn,{children:[(0,Qe.jsxs)(zn,{children:[(0,Qe.jsx)(t1.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,Qe.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),(0,Qe.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),(0,Qe.jsx)(qn,{centered:!0,children:(0,Qe.jsx)(Rg,{children:o})}),(0,Qe.jsxs)("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[(0,Qe.jsx)(tu,{onClick:s,children:a?(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(Xg.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)(e1.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),(0,Qe.jsxs)(tu,{onClick:c,children:[(0,Qe.jsx)(Jg.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),(0,Qe.jsx)(Vn,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),(0,Qe.jsx)(me,{}),(0,Qe.jsx)(K,{})]})},w5=(e,t)=>`Your wallet recovery password for ${e} is
|
|
1394
1408
|
|
|
1395
1409
|
${t}
|
|
1396
1410
|
|
|
1397
|
-
You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;var
|
|
1411
|
+
You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;var o1=y(require("@heroicons/react/24/solid/CheckCircleIcon")),n1=y(require("@heroicons/react/24/solid/XCircleIcon"));var lr=require("react/jsx-runtime"),i1=({error:e,onClose:t})=>(0,lr.jsxs)(lr.Fragment,{children:[(0,lr.jsx)(x,{closeable:!1}),(0,lr.jsx)(de,{}),e?(0,lr.jsxs)(Dr,{children:[(0,lr.jsx)(n1.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,lr.jsx)(xe,{title:"Something went wrong",description:e})]}):(0,lr.jsxs)(Dr,{children:[(0,lr.jsx)(o1.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,lr.jsx)(xe,{title:"Success"})]}),(0,lr.jsx)(H,{onClick:t,children:"Close"}),(0,lr.jsx)(me,{}),(0,lr.jsx)(K,{})]});var a1=require("react"),b5=(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}},s1=()=>{let[e,t]=(0,a1.useReducer)(b5,"creating");return{send:t,state:e}};var ka=require("react/jsx-runtime"),Hc=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:o}=P(),{send:n,state:i}=s1(),a=(0,Ra.useCallback)(async()=>{i==="finalizing"&&await e(),n("next")},[i,n,e]);(0,Ra.useEffect)(()=>{let c;return i==="done"&&t.config.initiatedBy==="automatic"&&(c=setTimeout(()=>t.onClose?.(),ot)),()=>{c&&clearTimeout(c)}},[i,t.config.initiatedBy,t.onClose]);let l=(0,Ra.useCallback)(()=>{n("back")},[n]),s=(0,Ra.useCallback)(()=>{o("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,o]);return i==="creating"?(0,ka.jsx)(Qg,{...t,onSubmit:a,onBack:r==="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"?s:void 0}):i==="saving"?(0,ka.jsx)(r1,{...t,onSubmit:a,onBack:l}):i==="confirming"?(0,ka.jsx)(Og,{...t,onSubmit:a,onBack:l}):i==="finalizing"?(0,ka.jsx)(Hg,{...t,onSubmit:a,onBack:l}):i==="done"?(0,ka.jsx)(i1,{...t,onSubmit:a}):null};var c1=require("react/jsx-runtime"),l1=()=>{let[e,t]=(0,Pi.useState)(null),[r,o]=(0,Pi.useState)(!1),[n,i]=(0,Pi.useState)(null),[a,l]=(0,Pi.useState)(""),{authenticated:s,getAccessToken:c,user:m}=$(),{walletProxy:f,refreshUser:u,closePrivyModal:C,createAnalyticsEvent:v}=W(),{app:g,navigate:E,data:S,onUserCloseViaDialogOrKeybindRef:R}=P(),{onSuccess:T,onFailure:A}=S.createWallet,k=Ae(m),M=e?.recoveryMethod==="user-passcode",D=k?.recoveryMethod==="user-passcode";(0,Pi.useEffect)(()=>{s||(E("LANDING"),A(new ml("User must be authenticated before setting a password on a Privy wallet")))},[s]);let G=()=>{if(n){A(n),C({shouldCallAuthOnSuccess:!1});return}if(!M){A(new ur("Exited before password was added to wallet")),C({shouldCallAuthOnSuccess:!1});return}T(e),C({shouldCallAuthOnSuccess:!1})};R.current=G;let Y=async()=>{let L=await c();if(L&&k?.address&&a&&f)try{if(v({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:k.address,recoveryMethod:"user-passcode",isResettingPassword:D}}),!(await f.setRecovery({accessToken:L,address:k.address,recoveryPassword:a,recoveryMethod:"user-passcode"})).address){i(new ur("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:k.address,recoveryMethod:"user-passcode",isResettingPassword:D,reason:"error setting password"}});return}let O=await u(),Ie=Ae(O);if(!Ie){i(new ur("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:k.address,recoveryMethod:"user-passcode",isResettingPassword:D,reason:"wallet disconnected"}});return}t(Ie),v({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:k.address,recoveryMethod:"user-passcode",isResettingPassword:D}})}catch(U){console.warn(U),i(U instanceof Error?U:new Error("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:k.address,reason:U}})}},Z=async()=>{M?(T(e),C({shouldCallAuthOnSuccess:!1})):(o(!0),i(null),await Y(),o(!1))};return(0,c1.jsx)(Hc,{appName:g?.name||"privy",config:{initiatedBy:"user",onCancel:G},error:n?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:a,isResettingPassword:D,onPasswordGenerate:()=>l(Bc()),onPasswordChange:l,onSubmit:Z,onClose:G})};var d1=y(require("@heroicons/react/24/outline/UserCircleIcon")),p1=y(require("@heroicons/react/24/solid/LockClosedIcon"));var Zt=require("react/jsx-runtime"),u1=()=>{let{closePrivyModal:e}=W(),{data:t,setModalData:r,navigate:o,onUserCloseViaDialogOrKeybindRef:n}=P(),{onSuccess:i,onFailure:a}=t.setWalletPassword,l=()=>{a(new ur("Exited before password was added to wallet")),e({shouldCallAuthOnSuccess:!1})};return n.current=l,(0,Zt.jsxs)(Zt.Fragment,{children:[(0,Zt.jsx)(x,{onClose:l}),(0,Zt.jsx)(de,{}),(0,Zt.jsxs)(Dr,{children:[(0,Zt.jsxs)(vy,{children:[(0,Zt.jsx)(d1.default,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,Zt.jsx)(Cy,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:(0,Zt.jsx)(p1.default,{width:"12px",height:"12px",fill:"white"})})]}),(0,Zt.jsxs)(xe,{title:"Secure Your Account",children:["Please set a password to secure your account.",(0,Zt.jsx)("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),(0,Zt.jsx)(H,{onClick:()=>{r({createWallet:{onFailure:a,onSuccess:i,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),o("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),(0,Zt.jsx)(me,{}),(0,Zt.jsx)(K,{})]})};var m1=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),f1=y(require("@heroicons/react/24/outline/PhoneIcon")),nu=y(require("styled-components"));var Rt=require("react/jsx-runtime"),E5=e=>{let t=(0,Rt.jsx)(m1.default,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof b)switch(e.privyErrorCode){case"client_request_timeout":return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:t};case"insufficient_balance":return{title:"Insufficient balance",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 Ze&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:(0,Rt.jsx)(f1.default,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof wt)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:t};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:t};case"allowlist_rejected":return{title:"You don't have access to this app",detail:"Have you been invited?",ctaText:"Try another account",icon:(0,Rt.jsx)(Tc,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case"captcha_failure":return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:(0,Rt.jsx)("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:(0,Rt.jsx)("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:t};case"not_supported":return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:t};case"too_many_requests":return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else return e instanceof 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}}},h1=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=P(),i=r?.errorModalData?.previousScreen||(o===n?void 0:o);return(0,Rt.jsx)(Ai,{error:r?.errorModalData?.error||new Error,backFn:()=>i?e(i,!1):t(),onClick:()=>e(i||"LANDING",!1)})},Ai=({error:e,backFn:t,onClick:r})=>{let{reset:o}=We(),n=E5(e),i=()=>{e instanceof wt&&e.privyErrorCode==="invalid_captcha"&&o(),r?.()};return(0,Rt.jsxs)(Rt.Fragment,{children:[(0,Rt.jsx)(x,{backFn:t}),(0,Rt.jsxs)(T5,{children:[(0,Rt.jsx)(vt,{children:(0,Rt.jsxs)("div",{children:[(0,Rt.jsx)(Ec,{color:"var(--privy-color-error)"}),n.icon]})}),(0,Rt.jsxs)(S5,{children:[(0,Rt.jsx)("h3",{children:n.title}),(0,Rt.jsx)("p",{children:n.detail})]}),(0,Rt.jsx)(H,{color:"var(--privy-color-error)",onClick:i,children:n.ctaText})]})]})},T5=nu.default.div`
|
|
1398
1412
|
display: flex;
|
|
1399
1413
|
flex-direction: column;
|
|
1400
1414
|
align-items: center;
|
|
@@ -1402,11 +1416,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1402
1416
|
gap: 24px;
|
|
1403
1417
|
width: 100%;
|
|
1404
1418
|
padding-bottom: 16px;
|
|
1405
|
-
`,
|
|
1419
|
+
`,S5=nu.default.div`
|
|
1406
1420
|
display: flex;
|
|
1407
1421
|
flex-direction: column;
|
|
1408
1422
|
gap: 8px;
|
|
1409
|
-
`;var
|
|
1423
|
+
`;var yn=require("react"),Ms=require("react-device-detect"),lu=y(require("styled-components"));var g1=require("react"),v1=y(require("styled-components"));var iu=require("react/jsx-runtime"),Ia=({style:e,color:t,...r})=>(0,iu.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:t||"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...r,children:(0,iu.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});var Gc=require("react/jsx-runtime"),y1=({color:e,...t})=>(0,Gc.jsx)("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...t,children:(0,Gc.jsx)("g",{children:(0,Gc.jsx)("path",{fill:e||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});var Is=require("react/jsx-runtime"),Kn=e=>{let[t,r]=(0,g1.useState)(!1);return(0,Is.jsxs)(_5,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?(0,Is.jsx)(Ia,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):(0,Is.jsx)(y1,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},_5=v1.default.button`
|
|
1410
1424
|
display: flex;
|
|
1411
1425
|
align-items: center;
|
|
1412
1426
|
gap: 6px;
|
|
@@ -1444,7 +1458,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1444
1458
|
width: 14px;
|
|
1445
1459
|
height: 14px;
|
|
1446
1460
|
}
|
|
1447
|
-
`;var
|
|
1461
|
+
`;var C1=require("react"),w1=y(require("styled-components")),b1=require("react/jsx-runtime"),Vc=e=>{let[t,r]=(0,C1.useState)(!1);return(0,b1.jsx)(P5,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},P5=w1.default.a`
|
|
1448
1462
|
display: flex;
|
|
1449
1463
|
align-items: center;
|
|
1450
1464
|
gap: 6px;
|
|
@@ -1482,7 +1496,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1482
1496
|
width: 14px;
|
|
1483
1497
|
height: 14px;
|
|
1484
1498
|
}
|
|
1485
|
-
`;var
|
|
1499
|
+
`;var T1=y(require("qrcode")),S1=y(require("react")),_1=y(require("styled-components"));var au=require("react/jsx-runtime"),E1=()=>(0,au.jsx)("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:(0,au.jsx)("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});var st=require("react/jsx-runtime"),Br=7,su=(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},A5=e=>{let t=T1.default.create(e,{errorCorrectionLevel:"high"}).modules,r=rf(Array.from(t.data),t.size);return r=su(r,0,0,Br,Br),r=su(r,r.length-Br,0,Br,Br),r=su(r,0,r.length-Br,Br,Br),r},x5=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>(0,st.jsx)(st.Fragment,{children:[0,1,2].map(i=>(0,st.jsx)("circle",{r:r*(Br-i*2)/2,cx:e+r*Br/2,cy:t+r*Br/2,fill:i%2!==0?o:n},`finder-${e}-${t}-${i}`))}),k5=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-Br)*e,0],[0,(t-Br)*e]];return(0,st.jsx)(st.Fragment,{children:n.map(([i,a])=>(0,st.jsx)(x5,{x:i,y:a,cellSize:e,bgColor:r,fgColor:o},`finder-${i}-${a}`))})},R5=({matrix:e,cellSize:t,color:r})=>(0,st.jsx)(st.Fragment,{children:e.map((i,a)=>i.map((l,s)=>l?(0,st.jsx)("rect",{height:t-.2*2,width:t-.2*2,x:a*t+t*(.2/2),y:s*t+t*(.2/2),rx:t*.5,ry:t*.5,fill:r},`cell-${a}-${s}`):(0,st.jsx)(S1.default.Fragment,{},`circle-${a}-${s}`)))}),I5=({cellSize:e,matrixSize:t,element:r,sizePercentage:o,bgColor:n})=>{if(!r)return(0,st.jsx)(st.Fragment,{});let i=t*(o||.15),a=Math.floor(t/2-i/2),l=Math.floor(t/2+i/2);(l-a)%2!==t%2&&(l+=1);let s=(l-a)*e,c=.1,m=s-s*c*2,f=r,u=a*e;return(0,st.jsxs)(st.Fragment,{children:[(0,st.jsx)("rect",{x:a*e,y:a*e,width:s,height:s,fill:n}),(0,st.jsx)(f,{x:u+s*c,y:u+s*c,height:m,width:m})]})},M5=e=>{let t=e.outputSize,r=A5(e.url),o=t/r.length;return(0,st.jsxs)("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%"},children:[(0,st.jsx)(R5,{matrix:r,cellSize:o,color:e.fgColor}),(0,st.jsx)(k5,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),(0,st.jsx)(I5,{cellSize:o,element:e.logo?.element,bgColor:e.bgColor,matrixSize:r.length})]})},W5=_1.default.div`
|
|
1486
1500
|
display: flex;
|
|
1487
1501
|
justify-content: center;
|
|
1488
1502
|
align-items: center;
|
|
@@ -1497,7 +1511,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1497
1511
|
border-color: ${e=>e.borderColor};
|
|
1498
1512
|
border-radius: var(--privy-border-radius-md);
|
|
1499
1513
|
}
|
|
1500
|
-
`,
|
|
1514
|
+
`,jn=e=>{let{appearance:t}=dt(),r=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",n=e.size||160,i=t.palette.colorScheme==="dark"?r:o;return(0,st.jsx)(W5,{size:n,bgColor:r,fgColor:o,borderColor:i,children:(0,st.jsx)(M5,{url:e.url,logo:{element:e.squareLogoElement??E1},outputSize:n,bgColor:r,fgColor:o})})};var xi=require("react/jsx-runtime"),$o=({style:e,...t})=>(0,xi.jsxs)("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...e},...t,children:[(0,xi.jsx)("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),(0,xi.jsx)("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),(0,xi.jsx)("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),(0,xi.jsx)("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});var pe=require("react/jsx-runtime"),P1="#8a63d2",x1=1e3,O5=x1*2,L5=x1*120,k1=()=>{let{authenticated:e,logout:t,ready:r,user:o}=$(),{lastScreen:n,navigate:i,navigateBack:a,setModalData:l,app:s}=P(),{getAuthFlow:c,loginWithFarcaster:m,closePrivyModal:f,createAnalyticsEvent:u}=W(),[C,v]=(0,yn.useState)(void 0),[g,E]=(0,yn.useState)(!1),[S,R]=(0,yn.useState)(!1),T=(0,yn.useRef)([]),A=ot,k=c(),M=k?.meta.connectUri;return(0,yn.useEffect)(()=>{let D=Date.now(),G=setInterval(async()=>{let Y=await k.pollForReady.execute(),Z=Date.now()-D;if(Y){clearInterval(G),E(!0);try{await m(),R(!0)}catch(L){let U={retryable:!1,message:"Authentication failed"};if(L?.privyErrorCode==="allowlist_rejected"){i("ALLOWLIST_REJECTION_SCREEN");return}else if(L?.privyErrorCode==="max_accounts_reached"){console.error(new ro(L).toString()),i("USER_LIMIT_REACHED_SCREEN");return}else if(L?.privyErrorCode==="user_does_not_exist"){i("ACCOUNT_NOT_FOUND_SCREEN");return}else L?.privyErrorCode==="linked_to_another_user"?U.detail="This account has already been linked to another user.":L?.privyErrorCode==="invalid_credentials"?(U.retryable=!0,U.detail="Something went wrong. Try again."):L?.privyErrorCode==="too_many_requests"&&(U.detail="Too many requests. Please wait before trying again.");v(U)}}else Z>L5&&(clearInterval(G),v({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},O5);return()=>{clearInterval(G),T.current.forEach(Y=>clearTimeout(Y))}},[]),(0,yn.useEffect)(()=>{if(r&&e&&S&&o){if(s?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let G=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},A);return()=>clearTimeout(G)}S&&(Sr(o,s?.embeddedWallets.createOnLogin)?T.current.push(setTimeout(()=>{l({createWallet:{onSuccess:()=>{},onFailure:G=>{console.error(G),u({eventName:"embedded_wallet_creation_failure_logout",payload:{error:G,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},A)):T.current.push(setTimeout(()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0}),A)))}},[S,r,e,o]),Ms.isMobile||g?(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(x,{backFn:n?a:void 0,onClose:f},"header"),(0,pe.jsx)(de,{}),Ms.isIOS?(0,pe.jsx)(pe.Fragment,{children:(0,pe.jsxs)(N5,{children:[(0,pe.jsx)(vt,{children:(0,pe.jsxs)("div",{children:[(0,pe.jsx)(Pt,{success:S,fail:!!C}),(0,pe.jsx)($o,{style:{width:"38px",height:"38px"}})]})}),(0,pe.jsxs)(pt,{children:[(0,pe.jsx)(Te,{children:C?C.message:"Sign in with Farcaster"}),(0,pe.jsx)(Pe,{children:C?C.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),M&&(0,pe.jsx)(H,{onClick:D=>{D.preventDefault(),window.location.href=M},children:"Open Warpcast app"})]})}):(0,pe.jsx)(pe.Fragment,{children:(0,pe.jsxs)(A1,{children:[(0,pe.jsx)(vt,{children:(0,pe.jsxs)("div",{children:[(0,pe.jsx)(Pt,{success:S,fail:!!C}),(0,pe.jsx)($o,{style:{width:"38px",height:"38px"}})]})}),(0,pe.jsxs)(pt,{children:[(0,pe.jsx)(Te,{children:C?C.message:"Signing in with Farcaster"}),(0,pe.jsx)(Pe,{children:C?C.detail:"This should only take a moment"}),(0,pe.jsx)(jt,{children:M&&Ms.isMobile&&(0,pe.jsx)(Vc,{text:"Take me to Warpcast",url:M,color:P1})})]})]})}),(0,pe.jsx)(J,{})]}):(0,pe.jsxs)(pe.Fragment,{children:[(0,pe.jsx)(x,{backFn:n?a:void 0,onClose:f},"header"),(0,pe.jsx)(de,{}),(0,pe.jsx)(A1,{children:(0,pe.jsxs)("div",{children:[(0,pe.jsx)(Te,{children:"Sign in with Farcaster"}),(0,pe.jsx)(Pe,{children:"Scan with your phone's camera to continue."}),(0,pe.jsx)(ma,{children:M?(0,pe.jsx)(jn,{url:M,size:275,squareLogoElement:$o}):(0,pe.jsx)(At,{})}),(0,pe.jsxs)(jt,{children:[(0,pe.jsx)(Pe,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),M&&(0,pe.jsx)(Kn,{text:M,itemName:"link",color:P1})]})]})}),(0,pe.jsx)(J,{})]})},A1=lu.default.div`
|
|
1501
1515
|
display: flex;
|
|
1502
1516
|
flex-direction: column;
|
|
1503
1517
|
align-items: center;
|
|
@@ -1505,14 +1519,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1505
1519
|
margin-left: 27px;
|
|
1506
1520
|
margin-right: 27px;
|
|
1507
1521
|
gap: 24px;
|
|
1508
|
-
`,
|
|
1522
|
+
`,N5=lu.default.div`
|
|
1509
1523
|
display: flex;
|
|
1510
1524
|
flex-direction: column;
|
|
1511
1525
|
align-items: center;
|
|
1512
1526
|
justify-content: center;
|
|
1513
1527
|
gap: 24px;
|
|
1514
1528
|
width: 100%;
|
|
1515
|
-
`;var
|
|
1529
|
+
`;var Yn=require("react"),Ws=require("react-device-detect"),cu=y(require("styled-components"));var ue=require("react/jsx-runtime"),R1="#8a63d2",M1=1e3,D5=M1*2,U5=M1*300,W1=()=>{let{lastScreen:e,navigateBack:t,data:r,app:o}=P(),{requestFarcasterSignerStatus:n,closePrivyModal:i}=W(),[a,l]=(0,Yn.useState)(void 0),[s,c]=(0,Yn.useState)(!1),[m,f]=(0,Yn.useState)(!1),u=(0,Yn.useRef)([]),C=ot,v=r?.farcasterSigner;(0,Yn.useEffect)(()=>{let E=Date.now(),S=setInterval(async()=>{if(!v?.public_key){clearInterval(S),l({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}v.status==="approved"&&(clearInterval(S),c(!1),f(!0),u.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),C)));let R=await n(v?.public_key),T=Date.now()-E;R.status==="approved"?(clearInterval(S),c(!1),f(!0),u.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),C))):T>U5?(clearInterval(S),l({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):R.status==="revoked"&&(clearInterval(S),l({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},D5);return()=>{clearInterval(S),u.current.forEach(R=>clearTimeout(R))}},[]);let g=v?.status==="pending_approval"?v.signer_approval_url:void 0;return Ws.isMobile||s?(0,ue.jsxs)(ue.Fragment,{children:[(0,ue.jsx)(x,{backFn:e?t:void 0,onClose:i},"header"),(0,ue.jsx)(de,{}),Ws.isIOS?(0,ue.jsx)(ue.Fragment,{children:(0,ue.jsxs)(F5,{children:[(0,ue.jsx)(vt,{children:(0,ue.jsxs)("div",{children:[(0,ue.jsx)(Pt,{success:m,fail:!!a}),(0,ue.jsx)($o,{style:{width:"38px",height:"38px"}})]})}),(0,ue.jsxs)(pt,{children:[(0,ue.jsx)(Te,{children:a?a.message:"Add a signer to Farcaster"}),(0,ue.jsx)(Pe,{children:a?a.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),g&&(0,ue.jsx)(H,{onClick:E=>{E.preventDefault(),window.location.href=g},children:"Open Warpcast app"})]})}):(0,ue.jsx)(ue.Fragment,{children:(0,ue.jsxs)(I1,{children:[(0,ue.jsx)(vt,{children:(0,ue.jsxs)("div",{children:[(0,ue.jsx)(Pt,{success:m,fail:!!a}),(0,ue.jsx)($o,{style:{width:"38px",height:"38px"}})]})}),(0,ue.jsxs)(pt,{children:[(0,ue.jsx)(Te,{children:a?a.message:"Requesting signer from Farcaster"}),(0,ue.jsx)(Pe,{children:a?a.detail:"This should only take a moment"}),(0,ue.jsx)(jt,{children:g&&Ws.isMobile&&(0,ue.jsx)(Vc,{text:"Take me to Warpcast",url:g,color:R1})})]})]})}),(0,ue.jsx)(J,{})]}):(0,ue.jsxs)(ue.Fragment,{children:[(0,ue.jsx)(x,{backFn:e?t:void 0,onClose:i},"header"),(0,ue.jsx)(de,{}),(0,ue.jsx)(I1,{children:(0,ue.jsxs)("div",{children:[(0,ue.jsx)(Te,{children:"Add a signer to Farcaster"}),(0,ue.jsxs)(Pe,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),(0,ue.jsx)(ma,{children:v?.status==="pending_approval"?(0,ue.jsx)(jn,{url:v.signer_approval_url,size:275,squareLogoElement:$o}):(0,ue.jsx)(At,{})}),(0,ue.jsxs)(jt,{children:[(0,ue.jsx)(Pe,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),v?.status==="pending_approval"&&(0,ue.jsx)(Kn,{text:v.signer_approval_url,itemName:"link",color:R1})]})]})}),(0,ue.jsx)(J,{})]})},I1=cu.default.div`
|
|
1516
1530
|
display: flex;
|
|
1517
1531
|
flex-direction: column;
|
|
1518
1532
|
align-items: center;
|
|
@@ -1520,14 +1534,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1520
1534
|
margin-left: 27px;
|
|
1521
1535
|
margin-right: 27px;
|
|
1522
1536
|
gap: 24px;
|
|
1523
|
-
`,
|
|
1537
|
+
`,F5=cu.default.div`
|
|
1524
1538
|
display: flex;
|
|
1525
1539
|
flex-direction: column;
|
|
1526
1540
|
align-items: center;
|
|
1527
1541
|
justify-content: center;
|
|
1528
1542
|
gap: 24px;
|
|
1529
1543
|
width: 100%;
|
|
1530
|
-
`;var
|
|
1544
|
+
`;var fu=require("@ethersproject/address"),Yc=require("@ethersproject/units"),G1=require("@heroicons/react/24/outline"),Yo=require("react"),V1=y(require("styled-components")),Zc=require("@privy-io/js-sdk-core");var O1=require("react/jsx-runtime");function Hr({title:e}){let{currentScreen:t,navigateBack:r,navigate:o,data:n}=P(),i;return t==="FUNDING_MANUAL_TRANSFER_SCREEN"?i=r:t===n?.funding?.methodScreen?n.funding.comingFromSendTransactionScreen?i=()=>o("EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"):i=void 0:i=n?.funding?.methodScreen?()=>o(n.funding.methodScreen):void 0,(0,O1.jsx)(x,{title:e,backFn:i})}var Os=y(require("styled-components")),Ma=require("react/jsx-runtime"),du=()=>(0,Ma.jsx)(B5,{children:(0,Ma.jsxs)(H5,{children:[(0,Ma.jsx)(G5,{}),(0,Ma.jsx)(V5,{})]})}),B5=Os.default.div`
|
|
1531
1545
|
display: flex;
|
|
1532
1546
|
justify-content: center;
|
|
1533
1547
|
align-items: center;
|
|
@@ -1536,14 +1550,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1536
1550
|
@media all and (display-mode: standalone) {
|
|
1537
1551
|
margin-bottom: 30px;
|
|
1538
1552
|
}
|
|
1539
|
-
`,
|
|
1553
|
+
`,H5=Os.default.div`
|
|
1540
1554
|
position: relative;
|
|
1541
1555
|
height: 96px;
|
|
1542
1556
|
width: 96px;
|
|
1543
1557
|
|
|
1544
1558
|
opacity: 1;
|
|
1545
1559
|
animation: fadein 200ms ease;
|
|
1546
|
-
`,
|
|
1560
|
+
`,G5=Os.default.div`
|
|
1547
1561
|
position: absolute;
|
|
1548
1562
|
top: 0;
|
|
1549
1563
|
right: 0;
|
|
@@ -1556,7 +1570,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1556
1570
|
border: 4px solid #f1f2f9;
|
|
1557
1571
|
border-radius: 50%;
|
|
1558
1572
|
}
|
|
1559
|
-
`,
|
|
1573
|
+
`,V5=Os.default.div`
|
|
1560
1574
|
position: absolute;
|
|
1561
1575
|
top: 0;
|
|
1562
1576
|
right: 0;
|
|
@@ -1580,33 +1594,67 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1580
1594
|
transform: rotate(360deg);
|
|
1581
1595
|
}
|
|
1582
1596
|
}
|
|
1583
|
-
`;var
|
|
1597
|
+
`;var pu=y(require("styled-components")),qc=pu.default.span`
|
|
1584
1598
|
display: flex;
|
|
1585
1599
|
flex-direction: column;
|
|
1586
1600
|
gap: 0.35rem;
|
|
1587
1601
|
width: 100%;
|
|
1588
|
-
`,
|
|
1602
|
+
`,Gr=pu.default.span`
|
|
1589
1603
|
display: flex;
|
|
1590
1604
|
width: 100%;
|
|
1591
1605
|
justify-content: space-between;
|
|
1592
|
-
`;var
|
|
1606
|
+
`;var L1=y(require("styled-components")),Vr=L1.default.span`
|
|
1593
1607
|
color: var(--privy-color-foreground-3);
|
|
1594
1608
|
font-size: 0.875rem;
|
|
1595
1609
|
font-weight: 400;
|
|
1596
1610
|
line-height: 1.375rem; /* 157.143% */
|
|
1597
|
-
`;var
|
|
1611
|
+
`;var N1=y(require("styled-components"));var qr=N1.default.span`
|
|
1598
1612
|
color: var(--privy-color-foreground);
|
|
1599
1613
|
font-size: 0.875rem;
|
|
1600
1614
|
font-weight: 500;
|
|
1601
1615
|
line-height: 1.375rem; /* 157.143% */
|
|
1602
1616
|
|
|
1603
|
-
${
|
|
1604
|
-
`;var
|
|
1617
|
+
${Ac}
|
|
1618
|
+
`;var q5=require("@ethersproject/providers"),D1=require("@privy-io/js-sdk-core");async function zc(e,t,r,o,n,i){o=Object.assign({chainId:an},o),z5(o);let l=(await r.rpc({address:t,accessToken:e,requesterAppId:i,request:{method:"eth_signTransaction",params:[o]}})).response.data;return await n.sendTransaction(l)}async function Wa(e,t,r,o){let n=await o.getBalance(e),i=t.value||0,l=!n.sub((0,D1.QuantityToBigNumber)(i)).sub(r).isNegative();return{balance:n,hasSufficientFunds:l}}function z5(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!$5(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 $5(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&K5(e);return t||r||o}function K5(e){return/^-?0x[a-f0-9]+$/i.test(e)}function $c(e){return{to:e.to,from:e.from,contractAddress:e.contractAddress,transactionIndex:e.transactionIndex,root:e.root,logsBloom:e.logsBloom,blockHash:e.blockHash,transactionHash:e.transactionHash,logs:e.logs,blockNumber:e.blockNumber,confirmations:e.confirmations,byzantium:e.byzantium,type:e.type,status:e.status,gasUsed:e.gasUsed.toHexString(),cumulativeGasUsed:e.cumulativeGasUsed.toHexString(),effectiveGasPrice:e.effectiveGasPrice?e.effectiveGasPrice.toHexString():void 0}}var Oa=require("react");var Ko=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=W(),[n,i]=(0,Oa.useState)(!0),[a,l]=(0,Oa.useState)(void 0),[s,c]=(0,Oa.useState)(void 0);return(0,Oa.useEffect)(()=>{let m=e.chainId||an,f=o.find(C=>C.id===Number(m));if(!f)throw new we(`Unsupported chain: ${m}`);(async()=>{if(!t){i(!1);return}try{i(!0);let C=await r(f);C?c(C):l(new Error(`Unable to fetch token price on chain id ${f.id}`))}catch(C){l(C)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};var Kc=require("react"),uu=(0,Kc.createContext)(null);function mo(){let e=(0,Kc.useContext)(uu);if(e===null)throw new Error("`useWallets` was called outside the PrivyProvider component");return e}function La(e){let r=new RegExp(/^eip155:(?<chainId>\d+)$/gm).exec(e)?.groups?.chainId;if(r)return parseInt(r);throw new Error("Chain ID not compatible with CAIP-2 format.")}var U1=require("@ethersproject/bignumber"),mu=require("@ethersproject/units"),F1=require("@privy-io/js-sdk-core");var j5=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),B1=e=>j5.format(e),jc=(e,t)=>{let r=B1(t*parseFloat(e));return r!=="$0.00"?r:"<$0.01"},jo=(e,t)=>{let r=B1(t*parseFloat((0,mu.formatEther)(e)));return r==="$0.00"?"<$0.01":r},zr=(e,t,r=6,o=!1)=>{let i=parseFloat((0,mu.formatEther)(e)).toFixed(r).replace(/0+$/,"").replace(/\.$/,"");return o?`${i} ${t}`:`${i==="0"?"<0.001":i} ${t}`},Ls=e=>e.map(F1.QuantityToBigNumber).reduce((t,r)=>t.add(r),U1.BigNumber.from(0)).toHexString(),H1=(e,t)=>{let{chains:r}=W(),o=`https://etherscan.io/address/${t}`,n=`${lf(e,r)}/address/${t}`;if(!n)return o;try{new URL(n)}catch{return o}return n};var ye=require("react/jsx-runtime"),q1=()=>{let{chains:e,rpcConfig:t,appId:r,closePrivyModal:o}=W(),{navigate:n,setModalData:i,app:a,data:l}=P(),[s,c]=(0,Yo.useState)(null),[m,f]=(0,Yo.useState)(null),[u,C]=(0,Yo.useState)(null),[v,g]=(0,Yo.useState)(null),[E,S]=(0,Yo.useState)(!1),R=l?.funding&&(0,Yc.parseUnits)(l.funding.amount,"ether").toHexString(),T=l?.funding&&l.funding.chain.id,{wallets:A}=mo(),{tokenPrice:k,isTokenPriceLoading:M}=Ko({chainId:s?.chainId&&La(s.chainId)?La(s.chainId):void 0}),D=async Q=>{for(let re of Q)T&&La(re.chainId)!==T&&await re.switchChain(T)},G=new rt(async()=>{let Q=A[0];if(!Q){console.error("Connected wallet wasn't found."),n("ERROR_SCREEN",!1);return}c(Q);let re=A.find(at=>(0,fu.getAddress)(at.address)===(0,fu.getAddress)(l?.funding?.address??""));if(!re){console.error("Connected wallet wasn't found."),n("ERROR_SCREEN",!1);return}if(f(re),!T){console.error(`Chain ID not found for input ${l?.funding?.chain.id}.`),n("ERROR_SCREEN",!1);return}let ae=Er(T,e,t,{appId:r}),Fe={from:Q.address,to:re.address,value:R,chainId:T},Ne=await(0,Zc.populateTransactionRequest)(Q.address,Fe,ae),{totalGasEstimate:ut}=await(0,Zc.calculateTotalGasEstimate)(Ne,ae),{balance:lt,hasSufficientFunds:Nt}=await Wa(Q.address,Ne,ut,ae);if(g({gas:ut.toHexString(),balance:lt.toHexString()}),!Nt){C(new b(`Wallet ${Mt(Q.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}await D([Q,re]);try{let ge=await(await Q.getEthersProvider()).getSigner(),{wait:Cr}=await ge.sendTransaction(Ne);await Cr(1),S(!0)}catch(at){C(at)}});(0,Yo.useEffect)(()=>{G.execute()},[]),(0,Yo.useEffect)(()=>{if(!u)return;let Q={error:u,previousScreen:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};i({funding:l?.funding,sendTransaction:l?.sendTransaction,errorModalData:Q}),n("ERROR_SCREEN",!1)},[u]);let Y=s?Un(s.walletClientType,s.connectorType,s.walletClientType)||"wallet":null,Z=!s||!v||M||!l?.funding||!R,L=Z?void 0:Ls([v.gas,R]),U=L&&k?jo(L,k):void 0,O=L?zr(L,"ETH"):void 0,Ie=v&&k?jo(v.gas,k):void 0,je=v?zr(v.gas,"ETH"):void 0;return(0,Yo.useEffect)(()=>{if(!E)return;let Q=setTimeout(o,Il);return()=>clearTimeout(Q)},[E]),Z?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(Hr,{}),(0,ye.jsx)(du,{}),(0,ye.jsx)("div",{style:{marginTop:"1rem"}}),(0,ye.jsx)(K,{})]}):E?(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(Hr,{}),(0,ye.jsx)(de,{}),(0,ye.jsxs)(Dr,{children:[(0,ye.jsx)(G1.CheckCircleIcon,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,ye.jsx)(xe,{title:"Success!",description:`You\u2019ve successfully added ${(0,Yc.formatUnits)(R,"ether")} ETH to your ${a.name} wallet. It may take a minute before the funds are available to use.`})]}),(0,ye.jsx)(me,{}),(0,ye.jsx)(K,{})]}):(0,ye.jsxs)(ye.Fragment,{children:[(0,ye.jsx)(Hr,{}),(0,ye.jsx)(du,{}),(0,ye.jsx)(jt,{style:{marginTop:"16px"},children:(0,ye.jsx)(Pc,{icon:xc(s.walletClientType,s.connectorType,s.walletClientType),name:s.walletClientType})}),(0,ye.jsx)(xe,{style:{marginTop:"8px",marginBottom:"12px"},title:`Confirming with ${Y}`}),v&&(0,ye.jsx)(ye.Fragment,{children:(0,ye.jsxs)(qc,{children:[(0,ye.jsxs)(Gr,{children:[(0,ye.jsx)(Vr,{children:"Total"}),(0,ye.jsx)(qr,{children:U||O})]}),(0,ye.jsxs)(Gr,{children:[(0,ye.jsx)(Vr,{children:"To"}),(0,ye.jsx)(qr,{children:Mt(m?.address)})]}),(0,ye.jsxs)(Gr,{children:[(0,ye.jsx)(Vr,{children:"Network"}),(0,ye.jsx)(qr,{children:(0,ye.jsxs)(Y5,{children:[kc(l.funding.chain.id)," ",l.funding.chain.name]})})]}),(0,ye.jsxs)(Gr,{children:[(0,ye.jsx)(Vr,{children:"Estimated fee"}),(0,ye.jsx)(qr,{children:Ie||je})]})]})}),(0,ye.jsx)(fa,{height:24}),(0,ye.jsx)(K,{})]})},Y5=V1.default.div`
|
|
1605
1619
|
display: flex;
|
|
1606
1620
|
flex-direction: row;
|
|
1607
1621
|
align-items: center;
|
|
1608
1622
|
gap: 4px;
|
|
1609
|
-
`;var q1=require("@heroicons/react/24/outline");var Ia=require("react/jsx-runtime"),Wa=({size:e=61,...t})=>(0,Ia.jsx)("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,Ia.jsxs)("g",{id:"moonpay_symbol_wht 2",children:[(0,Ia.jsx)("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),(0,Ia.jsx)("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});var jo=y(require("styled-components"));var L1=y(require("@heroicons/react/24/outline/ClockIcon")),O1=y(require("@heroicons/react/24/outline/TrashIcon")),N1=y(require("@heroicons/react/24/solid/CheckBadgeIcon")),D1=y(require("@heroicons/react/24/solid/CheckCircleIcon")),U1=y(require("@heroicons/react/24/solid/LockClosedIcon")),$n=require("react"),lr=y(require("styled-components"));var iu=require("react/jsx-runtime"),_i=({style:e,...t})=>(0,iu.jsx)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,iu.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})});var qe=require("react/jsx-runtime"),Pi=({style:e,...t})=>(0,qe.jsxs)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,qe.jsxs)("g",{clipPath:"url(#clip0_113_33841)",children:[(0,qe.jsx)("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),(0,qe.jsx)("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),(0,qe.jsx)("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),(0,qe.jsx)("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),(0,qe.jsx)("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),(0,qe.jsx)("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),(0,qe.jsx)("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),(0,qe.jsx)("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),(0,qe.jsx)("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),(0,qe.jsx)("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),(0,qe.jsx)("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),(0,qe.jsx)("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),(0,qe.jsx)("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),(0,qe.jsx)("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),(0,qe.jsx)("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),(0,qe.jsx)("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),(0,qe.jsx)("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),(0,qe.jsx)("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.4301C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),(0,qe.jsx)("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),(0,qe.jsx)("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),(0,qe.jsx)("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),(0,qe.jsx)("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),(0,qe.jsx)("defs",{children:(0,qe.jsx)("clipPath",{id:"clip0_113_33841",children:(0,qe.jsx)("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});var ee=require("react/jsx-runtime"),I1=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,i]=(0,$n.useState)([]),a=t?e.length:2,l=c=>c.authenticatorName?c.createdWithBrowser?`${c.authenticatorName} on ${c.createdWithBrowser}`:c.authenticatorName:c.createdWithBrowser?c.createdWithOs?`${c.createdWithBrowser} on ${c.createdWithOs}`:`${c.createdWithBrowser}`:"Unknown device",s=async c=>{i(m=>m.concat([c])),await r(c),i(m=>m.filter(f=>f!==c))};return(0,ee.jsxs)("div",{children:[(0,ee.jsx)(k5,{children:"Your passkeys"}),(0,ee.jsxs)(B1,{children:[e.slice(0,a).map(c=>(0,ee.jsxs)(I5,{children:[(0,ee.jsxs)("div",{children:[(0,ee.jsx)(R5,{children:l(c)}),(0,ee.jsxs)(M5,{children:["Last used: ",(c.latestVerifiedAt??c.verifiedAt).toLocaleString()]})]}),(0,ee.jsx)(L5,{disabled:n.includes(c.credentialId),onClick:()=>s(c.credentialId),children:n.includes(c.credentialId)?(0,ee.jsx)(Uo,{}):(0,ee.jsx)(O1.default,{height:"1.6em"})})]},c.credentialId)),e.length>2&&!t&&(0,ee.jsx)(au,{onClick:o,children:"View all"})]})]})},S5=()=>(0,ee.jsxs)(B1,{children:[(0,ee.jsxs)(_r,{children:[(0,ee.jsx)(Sr,{children:(0,ee.jsx)(N1.default,{})}),"Log in with Touch ID, Face ID, or a security key."]}),(0,ee.jsxs)(_r,{children:[(0,ee.jsx)(Sr,{children:(0,ee.jsx)(U1.default,{})}),"More secure than a password."]}),(0,ee.jsxs)(_r,{children:[(0,ee.jsx)(Sr,{children:(0,ee.jsx)(L1.default,{})}),"Takes seconds to set up and use."]})]}),F1=()=>{let{user:e,unlinkPasskey:t}=$(),{linkWithPasskey:r,closePrivyModal:o}=W(),n=e?.linkedAccounts.filter(g=>g.type==="passkey"),[i,a]=(0,$n.useState)(!1),[l,s]=(0,$n.useState)(""),[c,m]=(0,$n.useState)(!1),[f,u]=(0,$n.useState)(!1);(0,$n.useEffect)(()=>{n.length===0&&u(!1)},[n.length]);let v=()=>{a(!0),r().then(()=>m(!0)).catch(g=>{if(g instanceof wt){if(g.privyErrorCode==="cannot_link_more_of_type"){s("Cannot link more passkeys to account.");return}else if(g.privyErrorCode==="passkey_not_allowed"){s("Passkey request timed out or rejected by user.");return}}s("Unknown error occurred.")}).finally(()=>{a(!1)})},b=async g=>(a(!0),await t(g).then(()=>m(!0)).catch(E=>{if(E instanceof wt&&E.privyErrorCode==="missing_or_invalid_mfa"){s("Cannot unlink a passkey enrolled in MFA");return}s("Unknown error occurred.")}).finally(()=>{a(!1)}));return c?(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(P,{onClose:()=>o()},"header"),(0,ee.jsx)(Ye,{children:(0,ee.jsx)(mt,{status:"success",children:(0,ee.jsx)(D1.default,{})})}),(0,ee.jsx)(W1,{children:"Passkey added"}),(0,ee.jsx)(x5,{children:"From now on, you can use your passkey to log in."}),(0,ee.jsx)(nr,{children:(0,ee.jsx)(B,{onClick:()=>o(),children:"Done"})}),(0,ee.jsx)(J,{})]}):f?(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(P,{backFn:()=>u(!1),onClose:()=>o()},"header"),(0,ee.jsx)(I1,{passkeys:n,expanded:f,onUnlink:b,onExpand:()=>u(!0)}),(0,ee.jsx)(J,{})]}):(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(P,{onClose:()=>o()},"header"),(0,ee.jsx)(Ye,{children:(0,ee.jsxs)(qc,{children:[(0,ee.jsx)(_i,{}),(0,ee.jsx)(Pi,{})]})}),(0,ee.jsx)(W1,{children:"Secure your account with a passkey"}),(0,ee.jsx)(A5,{}),n.length===0?(0,ee.jsx)(S5,{}):(0,ee.jsx)(I1,{passkeys:n,expanded:f,onUnlink:b,onExpand:()=>u(!0)}),(0,ee.jsxs)(nr,{style:{marginTop:"12px"},children:[l&&(0,ee.jsx)(_5,{fail:!0,children:l}),(0,ee.jsx)(B,{onClick:v,loading:i,children:"Add new passkey"})]}),(0,ee.jsx)(J,{})]})},qc=lr.default.div`
|
|
1623
|
+
`;var Q1=y(require("@heroicons/react/24/solid/ArrowsRightLeftIcon")),J1=y(require("@heroicons/react/24/solid/CheckCircleIcon")),ki=require("react"),hu=y(require("styled-components"));async function Qc({api:e,requesterAppId:t,providerAppId:r}){let n=(await e.get(`/api/v1/apps/${t}/cross-app/connections`)).connections.find(i=>i.provider_app_id===r);if(!n)throw new b("Invalid connected app");return{name:n.provider_app_name,logoUrl:n.provider_app_icon_url||void 0,apiUrl:n.provider_app_custom_api_url,readOnly:n.read_only}}async function z1({api:e,appId:t}){let r=pi(),o=Ki(),n=await ji(r);try{let{url:i}=await e.post(gl,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:n,state_code:o});return{url:i,stateCode:o,codeVerifier:r}}catch(i){throw Ce(i)}}async function $1({api:e,appId:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new b("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new b("User denied confirmation during cross-app auth flow");try{return(await e.post(vl,{authorization_code:n,state_code:r,code_verifier:o,provider:`privy:${t}`})).oauth_tokens?.access_token}catch(i){let a=Ce(i);throw a.privyErrorCode?new b(a.message||"Invalid code during cross-app auth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during cross-app auth flow"?new b("Invalid code during cross-app auth flow.",void 0,"oauth_user_denied"):new b("Invalid code during cross-app auth flow.",void 0,"unknown_auth_error")}}var Jc=async({user:e,address:t,client:r,request:o,requesterAppId:n,reconnect:i})=>{r.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:t,method:o.method}});let a=e?.linkedAccounts.find(u=>!!(u.type==="cross_app"&&u.embeddedWallets.find(C=>C.address===t)));if(!e||!a)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Cannot request a signature with this wallet address",address:t}}),new b("Cannot request a signature with this wallet address");let l=r.getProviderAccessToken(a.providerApp.id),s=await Qc({api:r.api,requesterAppId:n,providerAppId:a.providerApp.id});if(!l){if(s.readOnly)throw console.error("cannot transact against a read-only provider app"),new b("Cannot transact against a read-only provider app");await i({appId:a.providerApp.id})&&(l=r.getProviderAccessToken(a.providerApp.id))}if(!l)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Transactions require a valid token",address:t}}),new b("Transactions require a valid token");let c=window.open(void 0,void 0,Ns({w:400,h:680}));if(!c)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:t}}),new b("Failed to initialize signature request");let m=new URL(`${s.apiUrl}/oauth/transact`);return m.searchParams.set("token",l||""),m.searchParams.set("request",Z5(o)),c.location=m.href,new Promise((u,C)=>{let g=setTimeout(()=>{R(),C(new b("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})},12e4),E=setInterval(()=>{c.closed&&(R(),C(new b("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))},300),S=T=>{T.data&&(T.data.token?.action==="set"&&T.data.token?.value!==void 0?r.storeProviderAccessToken(a.providerApp.id,T.data.token.value):T.data.token?.action==="clear"&&r.storeProviderAccessToken(a.providerApp.id,null),T.data.type==="PRIVY_CROSS_APP_ACTION_RESPONSE"&&T.data.result&&(R(),u(T.data.result),r.createAnalyticsEvent({eventName:"cross_app_request_success",payload:{address:t,method:o.method}})),T.data.type==="PRIVY_CROSS_APP_ACTION_ERROR"&&T.data.error&&(R(),C(T.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:T.data.error,address:t}})))};window.addEventListener("message",S);let R=()=>{c.close(),clearInterval(E),clearTimeout(g),window.removeEventListener("message",S)}})},Z5=e=>JSON.stringify({content:{request:{request:e}},timestamp:Date.now(),callbackUrl:window.origin}),Ns=({w:e,h:t})=>{let r=window.screenLeft!==void 0?window.screenLeft:window.screenX,o=window.screenTop!==void 0?window.screenTop:window.screenY,n=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,i=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,a=n/window.screen.availWidth,l=i/window.screen.availHeight,s=(n-e)/2/a+r,c=(i-t)/2/l+o;return`toolbar=0,location=0,menubar=0,height=${t},width=${e},popup=1,left=${s},top=${c}`};var Na="sdk_fiat_on_ramp_completed_with_status";var K1={1:"ethereum",8453:"base",10:"optimism",137:"polygon",42161:"arbitrum"},j1=e=>!!K1[e];function Y1(e){let t=K1[e];if(!t)throw new b(`Unsupported chainId: ${e} for Coinbase Onramp`);return t}var Z1=({input:e,amount:t,blockchain:r})=>{let o=new URL("https://pay.coinbase.com/buy/select-asset");return o.searchParams.set("appId",e.app_id),o.searchParams.set("sessionToken",e.session_token),o.searchParams.set("defaultExperience","buy"),o.searchParams.set("presetCryptoAmount",t),o.searchParams.set("defaultNetwork",r),o.searchParams.set("partnerUserId",e.partner_user_id),{url:o}};var ft=require("react/jsx-runtime"),Q5=240,X1=1500,J5=Math.floor(Q5*1e3/X1),e2=()=>{let{data:e,setModalData:t,navigate:r}=P(),{closePrivyModal:o,createAnalyticsEvent:n,initCoinbaseOnRamp:i,getCoinbaseOnRampStatus:a}=W(),l=e?.funding,[s,c]=(0,ki.useState)(!1),[m,f]=(0,ki.useState)(!1);return(0,ki.useEffect)(()=>{if(s)return;c(!0);let u=async()=>{try{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp"}});let v=window.open(void 0,void 0,Ns({w:440,h:680})),g=Y1(l.chain.id),E=await i({addresses:[{address:l.address,blockchains:[g]}]}),{url:S}=Z1({input:E,amount:l.amount,blockchain:g});if(!v)throw new Error("Unable to initiate Coinbase Onramp flow.");v.location=S.toString();let R=0,T=!1;for(;R<J5;){R++;let{status:A}=await a({partnerUserId:E.partner_user_id});if(A==="success"){T=!0;break}if(A==="failure")throw new Error("There was an error completing Coinbase Onramp flow.");if(v.closed)throw new Error("User exited Coinbase Onramp flow before transaction response.");await new Promise(k=>setTimeout(k,X1))}if(!T)throw new Error("Timed out waiting for transaction response from Coinbase Onramp.");n({eventName:Na,payload:{status:"success",provider:"coinbase-onramp"}}),f(!0)}catch(v){console.error(v),n({eventName:Na,payload:{status:"failure",provider:"coinbase-onramp",error:v.message}}),t({funding:{...l,errorMessage:"Something went wrong adding funds from Coinbase Onramp. Please try again or use another method to fund your wallet."}}),r("FUNDING_METHOD_SELECTION_SCREEN")}finally{c(!1)}},C=setTimeout(()=>void u(),500);return()=>clearTimeout(C)},[]),(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsx)(x,{title:"Fund account"},"header"),(0,ft.jsx)(e6,{isSucccess:m,onClickCta:o}),(0,ft.jsx)(K,{})]})},X5=e=>e?{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"}:{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""},e6=({isSucccess:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=(0,ki.useMemo)(()=>X5(e),[e]);return(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsxs)(i6,{children:[(0,ft.jsx)(o6,{isSucccess:e}),(0,ft.jsxs)(pt,{children:[(0,ft.jsx)("h3",{children:r}),(0,ft.jsx)(n6,{children:o})]})]}),n&&(0,ft.jsx)(H,{onClick:t,children:n})]})},t6=e=>e?"var(--privy-color-success)":"var(--privy-color-foreground-4)",r6=e=>e?J1.default:()=>(0,ft.jsx)(Q1.default,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),o6=({isSucccess:e})=>{if(!e){let o="var(--privy-color-foreground-4)";return(0,ft.jsxs)("div",{style:{position:"relative"},children:[(0,ft.jsx)(At,{color:o,style:{position:"absolute"}}),(0,ft.jsx)(Cs,{color:o}),(0,ft.jsx)(ln,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let t=r6(e),r=t6(e);return(0,ft.jsx)("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&(0,ft.jsx)(t,{width:"4rem",height:"4rem",color:r})})},n6=hu.default.p`
|
|
1624
|
+
font-size: 1rem;
|
|
1625
|
+
color: var(--privy-color-foreground-3);
|
|
1626
|
+
margin-bottom: 1rem;
|
|
1627
|
+
display: flex;
|
|
1628
|
+
flex-direction: column;
|
|
1629
|
+
gap: 1rem;
|
|
1630
|
+
`,i6=hu.default.div`
|
|
1631
|
+
display: flex;
|
|
1632
|
+
flex-direction: column;
|
|
1633
|
+
align-items: center;
|
|
1634
|
+
justify-content: center;
|
|
1635
|
+
margin-left: 1.75rem;
|
|
1636
|
+
margin-right: 1.75rem;
|
|
1637
|
+
padding: 2rem 0;
|
|
1638
|
+
`;var vu=require("@ethersproject/address"),ad=require("@heroicons/react/24/outline"),Fa=require("react");var t2=require("@heroicons/react/24/outline"),r2=y(require("styled-components")),Xc=require("react/jsx-runtime"),o2=({children:e})=>(0,Xc.jsxs)(a6,{children:[(0,Xc.jsx)(t2.ExclamationTriangleIcon,{width:"3rem",color:"var(--privy-color-error)"}),e]}),a6=r2.default.div`
|
|
1639
|
+
display: flex;
|
|
1640
|
+
gap: 0.5rem;
|
|
1641
|
+
background-color: var(--privy-color-error-light);
|
|
1642
|
+
|
|
1643
|
+
align-items: flex-start;
|
|
1644
|
+
text-align: left;
|
|
1645
|
+
padding: 0.5rem 0.75rem;
|
|
1646
|
+
|
|
1647
|
+
font-size: 0.75rem;
|
|
1648
|
+
font-weight: 400;
|
|
1649
|
+
line-height: 1.125rem; /* 150% */
|
|
1650
|
+
|
|
1651
|
+
padding: 0.5rem 0.75rem;
|
|
1652
|
+
|
|
1653
|
+
&& {
|
|
1654
|
+
border: 1px solid var(--privy-color-error);
|
|
1655
|
+
border-radius: var(--privy-border-radius-sm);
|
|
1656
|
+
}
|
|
1657
|
+
`;var Da=require("react/jsx-runtime"),Ua=({size:e=61,...t})=>(0,Da.jsx)("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,Da.jsxs)("g",{id:"moonpay_symbol_wht 2",children:[(0,Da.jsx)("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),(0,Da.jsx)("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});var gr=y(require("styled-components"));var a2=y(require("@heroicons/react/24/outline/ClockIcon")),s2=y(require("@heroicons/react/24/outline/TrashIcon")),l2=y(require("@heroicons/react/24/solid/CheckBadgeIcon")),c2=y(require("@heroicons/react/24/solid/CheckCircleIcon")),d2=y(require("@heroicons/react/24/solid/LockClosedIcon")),Zn=require("react"),cr=y(require("styled-components"));var yu=require("react/jsx-runtime"),Ri=({style:e,...t})=>(0,yu.jsx)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,yu.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})});var ze=require("react/jsx-runtime"),Ii=({style:e,...t})=>(0,ze.jsxs)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,ze.jsxs)("g",{clipPath:"url(#clip0_113_33841)",children:[(0,ze.jsx)("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),(0,ze.jsx)("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),(0,ze.jsx)("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),(0,ze.jsx)("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),(0,ze.jsx)("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),(0,ze.jsx)("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),(0,ze.jsx)("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),(0,ze.jsx)("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),(0,ze.jsx)("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),(0,ze.jsx)("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),(0,ze.jsx)("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),(0,ze.jsx)("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),(0,ze.jsx)("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),(0,ze.jsx)("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),(0,ze.jsx)("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),(0,ze.jsx)("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),(0,ze.jsx)("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),(0,ze.jsx)("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.4301C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),(0,ze.jsx)("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),(0,ze.jsx)("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),(0,ze.jsx)("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),(0,ze.jsx)("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),(0,ze.jsx)("defs",{children:(0,ze.jsx)("clipPath",{id:"clip0_113_33841",children:(0,ze.jsx)("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});var ee=require("react/jsx-runtime"),n2=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,i]=(0,Zn.useState)([]),a=t?e.length:2,l=c=>c.authenticatorName?c.createdWithBrowser?`${c.authenticatorName} on ${c.createdWithBrowser}`:c.authenticatorName:c.createdWithBrowser?c.createdWithOs?`${c.createdWithBrowser} on ${c.createdWithOs}`:`${c.createdWithBrowser}`:"Unknown device",s=async c=>{i(m=>m.concat([c])),await r(c),i(m=>m.filter(f=>f!==c))};return(0,ee.jsxs)("div",{children:[(0,ee.jsx)(u6,{children:"Your passkeys"}),(0,ee.jsxs)(u2,{children:[e.slice(0,a).map(c=>(0,ee.jsxs)(h6,{children:[(0,ee.jsxs)("div",{children:[(0,ee.jsx)(m6,{children:l(c)}),(0,ee.jsxs)(f6,{children:["Last used: ",(c.latestVerifiedAt??c.verifiedAt).toLocaleString()]})]}),(0,ee.jsx)(g6,{disabled:n.includes(c.credentialId),onClick:()=>s(c.credentialId),children:n.includes(c.credentialId)?(0,ee.jsx)(Bo,{}):(0,ee.jsx)(s2.default,{height:"1.6em"})})]},c.credentialId)),e.length>2&&!t&&(0,ee.jsx)(gu,{onClick:o,children:"View all"})]})]})},s6=()=>(0,ee.jsxs)(u2,{children:[(0,ee.jsxs)(xr,{children:[(0,ee.jsx)(Ar,{children:(0,ee.jsx)(l2.default,{})}),"Log in with Touch ID, Face ID, or a security key."]}),(0,ee.jsxs)(xr,{children:[(0,ee.jsx)(Ar,{children:(0,ee.jsx)(d2.default,{})}),"More secure than a password."]}),(0,ee.jsxs)(xr,{children:[(0,ee.jsx)(Ar,{children:(0,ee.jsx)(a2.default,{})}),"Takes seconds to set up and use."]})]}),p2=()=>{let{user:e,unlinkPasskey:t}=$(),{linkWithPasskey:r,closePrivyModal:o}=W(),n=e?.linkedAccounts.filter(g=>g.type==="passkey"),[i,a]=(0,Zn.useState)(!1),[l,s]=(0,Zn.useState)(""),[c,m]=(0,Zn.useState)(!1),[f,u]=(0,Zn.useState)(!1);(0,Zn.useEffect)(()=>{n.length===0&&u(!1)},[n.length]);let C=()=>{a(!0),r().then(()=>m(!0)).catch(g=>{if(g instanceof wt){if(g.privyErrorCode==="cannot_link_more_of_type"){s("Cannot link more passkeys to account.");return}else if(g.privyErrorCode==="passkey_not_allowed"){s("Passkey request timed out or rejected by user.");return}}s("Unknown error occurred.")}).finally(()=>{a(!1)})},v=async g=>(a(!0),await t(g).then(()=>m(!0)).catch(E=>{if(E instanceof wt&&E.privyErrorCode==="missing_or_invalid_mfa"){s("Cannot unlink a passkey enrolled in MFA");return}s("Unknown error occurred.")}).finally(()=>{a(!1)}));return c?(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(x,{onClose:()=>o()},"header"),(0,ee.jsx)(Ye,{children:(0,ee.jsx)(mt,{status:"success",children:(0,ee.jsx)(c2.default,{})})}),(0,ee.jsx)(i2,{children:"Passkey added"}),(0,ee.jsx)(d6,{children:"From now on, you can use your passkey to log in."}),(0,ee.jsx)(ir,{children:(0,ee.jsx)(H,{onClick:()=>o(),children:"Done"})}),(0,ee.jsx)(J,{})]}):f?(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(x,{backFn:()=>u(!1),onClose:()=>o()},"header"),(0,ee.jsx)(n2,{passkeys:n,expanded:f,onUnlink:v,onExpand:()=>u(!0)}),(0,ee.jsx)(J,{})]}):(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsx)(x,{onClose:()=>o()},"header"),(0,ee.jsx)(Ye,{children:(0,ee.jsxs)(ed,{children:[(0,ee.jsx)(Ri,{}),(0,ee.jsx)(Ii,{})]})}),(0,ee.jsx)(i2,{children:"Secure your account with a passkey"}),(0,ee.jsx)(p6,{}),n.length===0?(0,ee.jsx)(s6,{}):(0,ee.jsx)(n2,{passkeys:n,expanded:f,onUnlink:v,onExpand:()=>u(!0)}),(0,ee.jsxs)(ir,{style:{marginTop:"12px"},children:[l&&(0,ee.jsx)(l6,{fail:!0,children:l}),(0,ee.jsx)(H,{onClick:C,loading:i,children:"Add new passkey"})]}),(0,ee.jsx)(J,{})]})},ed=cr.default.div`
|
|
1610
1658
|
display: flex;
|
|
1611
1659
|
align-items: center;
|
|
1612
1660
|
justify-content: center;
|
|
@@ -1622,7 +1670,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1622
1670
|
stroke: var(--privy-color-accent) !important;
|
|
1623
1671
|
fill: var(--privy-color-accent) !important;
|
|
1624
1672
|
}
|
|
1625
|
-
`,
|
|
1673
|
+
`,l6=cr.default.div`
|
|
1626
1674
|
line-height: 20px;
|
|
1627
1675
|
height: 20px;
|
|
1628
1676
|
font-size: 13px;
|
|
@@ -1630,7 +1678,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1630
1678
|
display: flex;
|
|
1631
1679
|
justify-content: flex-beginngin;
|
|
1632
1680
|
width: 100%;
|
|
1633
|
-
`,
|
|
1681
|
+
`,c6=cr.css`
|
|
1634
1682
|
&& {
|
|
1635
1683
|
width: 100%;
|
|
1636
1684
|
font-size: 0.875rem;
|
|
@@ -1655,9 +1703,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1655
1703
|
box-shadow: none;
|
|
1656
1704
|
}
|
|
1657
1705
|
}
|
|
1658
|
-
`,
|
|
1659
|
-
${
|
|
1660
|
-
`,
|
|
1706
|
+
`,gu=cr.default.button`
|
|
1707
|
+
${c6}
|
|
1708
|
+
`,u2=cr.default.div`
|
|
1661
1709
|
display: flex;
|
|
1662
1710
|
flex-direction: column;
|
|
1663
1711
|
align-items: stretch;
|
|
@@ -1665,18 +1713,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1665
1713
|
padding: 0.5rem 0rem 0rem;
|
|
1666
1714
|
flex-grow: 1;
|
|
1667
1715
|
width: 100%;
|
|
1668
|
-
`,
|
|
1716
|
+
`,i2=cr.default.div`
|
|
1669
1717
|
font-size: 18px;
|
|
1670
1718
|
line-height: 18px;
|
|
1671
1719
|
text-align: center;
|
|
1672
1720
|
font-weight: 600;
|
|
1673
|
-
`,
|
|
1721
|
+
`,d6=cr.default.div`
|
|
1674
1722
|
font-size: 0.875rem;
|
|
1675
1723
|
text-align: center;
|
|
1676
1724
|
margin-top: 10px;
|
|
1677
|
-
`,
|
|
1725
|
+
`,p6=cr.default.div`
|
|
1678
1726
|
height: 32px;
|
|
1679
|
-
`,
|
|
1727
|
+
`,u6=cr.default.div`
|
|
1680
1728
|
line-height: 20px;
|
|
1681
1729
|
height: 20px;
|
|
1682
1730
|
font-size: 1em;
|
|
@@ -1684,18 +1732,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1684
1732
|
display: flex;
|
|
1685
1733
|
justify-content: flex-beginning;
|
|
1686
1734
|
width: 100%;
|
|
1687
|
-
`,
|
|
1735
|
+
`,m6=cr.default.div`
|
|
1688
1736
|
font-size: 1em;
|
|
1689
1737
|
line-height: 1.3em;
|
|
1690
1738
|
font-weight: 500;
|
|
1691
1739
|
color: var(--privy-color-foreground-2);
|
|
1692
1740
|
padding: 0.2em 0;
|
|
1693
|
-
`,
|
|
1741
|
+
`,f6=cr.default.div`
|
|
1694
1742
|
font-size: 0.875rem;
|
|
1695
1743
|
line-height: 1rem;
|
|
1696
1744
|
color: #64668b;
|
|
1697
1745
|
padding: 0.2em 0;
|
|
1698
|
-
`,
|
|
1746
|
+
`,h6=cr.default.div`
|
|
1699
1747
|
display: flex;
|
|
1700
1748
|
align-items: center;
|
|
1701
1749
|
justify-content: space-between;
|
|
@@ -1708,7 +1756,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1708
1756
|
border: 1px solid #e2e3f0 !important;
|
|
1709
1757
|
width: 100%;
|
|
1710
1758
|
height: 5em;
|
|
1711
|
-
`,
|
|
1759
|
+
`,y6=cr.css`
|
|
1712
1760
|
:focus,
|
|
1713
1761
|
:hover,
|
|
1714
1762
|
:active {
|
|
@@ -1725,40 +1773,57 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1725
1773
|
svg:hover {
|
|
1726
1774
|
color: var(--privy-color-foreground-3);
|
|
1727
1775
|
}
|
|
1728
|
-
`,
|
|
1729
|
-
${
|
|
1730
|
-
`;var
|
|
1776
|
+
`,g6=cr.default.button`
|
|
1777
|
+
${y6}
|
|
1778
|
+
`;var m2=gr.default.div`
|
|
1731
1779
|
display: flex;
|
|
1732
1780
|
flex-direction: column;
|
|
1733
1781
|
gap: 12px;
|
|
1734
1782
|
padding-top: 24px;
|
|
1735
1783
|
padding-bottom: 24px;
|
|
1736
|
-
`,
|
|
1784
|
+
`,td=gr.default.div`
|
|
1737
1785
|
width: 24px;
|
|
1738
1786
|
height: 24px;
|
|
1739
1787
|
display: flex;
|
|
1740
1788
|
justify-content: center;
|
|
1741
1789
|
align-items: center;
|
|
1742
|
-
|
|
1790
|
+
`,rd=gr.default.div`
|
|
1743
1791
|
display: flex;
|
|
1744
1792
|
flex-direction: column;
|
|
1745
1793
|
justify-content: center;
|
|
1746
1794
|
align-items: center;
|
|
1747
1795
|
gap: 8px;
|
|
1748
|
-
`,
|
|
1796
|
+
`,od=gr.default.div`
|
|
1749
1797
|
display: flex;
|
|
1750
1798
|
align-items: baseline;
|
|
1751
1799
|
gap: 4px;
|
|
1752
|
-
`,
|
|
1753
|
-
font-size: 42px;
|
|
1754
|
-
`,
|
|
1800
|
+
`,f2=gr.default.div`
|
|
1801
|
+
font-size: 42px !important;
|
|
1802
|
+
`,h2=gr.default.input`
|
|
1803
|
+
font-size: 42px !important;
|
|
1804
|
+
text-align: right;
|
|
1805
|
+
|
|
1806
|
+
// HACK: The only way this is centerable is to set a content-based width.
|
|
1807
|
+
// The --funding-input-length is updated via the component.
|
|
1808
|
+
// Note that 'ch' has 98.25% global browser adoption
|
|
1809
|
+
width: calc(1ch * var(--funding-input-length));
|
|
1810
|
+
|
|
1811
|
+
&:focus {
|
|
1812
|
+
outline: none !important;
|
|
1813
|
+
border: none !important;
|
|
1814
|
+
box-shadow: none !important;
|
|
1815
|
+
}
|
|
1816
|
+
`,y2=gr.default.div`
|
|
1817
|
+
cursor: pointer;
|
|
1818
|
+
padding-left: 4px;
|
|
1819
|
+
`,nd=gr.default.div`
|
|
1755
1820
|
font-size: 18px;
|
|
1756
|
-
`,
|
|
1821
|
+
`,id=gr.default.div`
|
|
1757
1822
|
font-size: 12px;
|
|
1758
1823
|
color: var(--privy-color-foreground-3);
|
|
1759
1824
|
// we need this container to maintain a static height if there's no content
|
|
1760
1825
|
height: 20px;
|
|
1761
|
-
`,
|
|
1826
|
+
`,g2=gr.default.div`
|
|
1762
1827
|
display: flex;
|
|
1763
1828
|
flex-direction: row;
|
|
1764
1829
|
line-height: 22px;
|
|
@@ -1768,24 +1833,34 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1768
1833
|
margin-right: 6px;
|
|
1769
1834
|
margin: auto;
|
|
1770
1835
|
}
|
|
1771
|
-
`,
|
|
1836
|
+
`,v2=(0,gr.default)(gu)`
|
|
1772
1837
|
margin-top: 16px;
|
|
1773
|
-
|
|
1838
|
+
`,v6=gr.keyframes`
|
|
1839
|
+
from {
|
|
1840
|
+
opacity: 0;
|
|
1841
|
+
}
|
|
1842
|
+
to {
|
|
1843
|
+
opacity: 1;
|
|
1844
|
+
}
|
|
1845
|
+
`,C2=(0,gr.default)(Ln)`
|
|
1846
|
+
border-radius: var(--privy-border-radius-md) !important;
|
|
1847
|
+
animation: ${v6} 0.3s ease-in-out;
|
|
1848
|
+
`;var Ke=require("react/jsx-runtime"),w2=()=>{let{wallets:e}=mo(),{app:t,navigate:r,data:o,setModalData:n}=P(),i=o?.funding,a=(0,Fa.useRef)(null),[l,s]=(0,Fa.useState)(!1);(0,Fa.useEffect)(()=>{a.current&&a.current.style.setProperty("--funding-input-length",Math.max(i.amount.length,1).toString())},[i.amount]);let c=t.fundingConfig?.methods.slice()??[],{tokenPrice:m}=Ko({chainId:i.chain.id}),f=m?jc(i.amount,m):void 0,u=e.find(E=>(0,vu.getAddress)(E.address)===(0,vu.getAddress)(i.address)),C=u&&u.walletClientType!=="privy"?Un(u.walletClientType,u.connectorType,u.walletClientType):t.name,v=parseFloat(i.amount),g=!isNaN(v)&&v>0;return(0,Ke.jsxs)(Ke.Fragment,{children:[(0,Ke.jsx)(Hr,{}),(0,Ke.jsxs)("h3",{children:["Add funds to your"," ",C?.toLowerCase().endsWith("wallet")?C:C+" wallet"]}),(0,Ke.jsx)(Nn,{style:{marginTop:"32px"},children:(0,Ke.jsxs)(rd,{children:[(0,Ke.jsxs)(od,{onClick:()=>a.current?.focus(),children:[(0,Ke.jsx)(h2,{ref:a,value:i.amount,onFocus:()=>s(!0),onBlur:()=>s(!1),onChange:E=>{let S=E.target.value;/^[0-9.]*$/.test(S)&&S.split(".").length-1<=1&&n({...o,funding:{...i,amount:S}})}}),(0,Ke.jsx)(nd,{children:i.chain.nativeCurrency.symbol}),!l&&(0,Ke.jsx)(y2,{children:(0,Ke.jsx)(ad.PencilIcon,{width:12,height:12})})]}),(0,Ke.jsx)(id,{children:f&&g?f:""})]})}),(0,Ke.jsxs)(m2,{children:[i.errorMessage&&(0,Ke.jsx)(o2,{children:i.errorMessage}),c.sort().map(E=>{switch(E){case"moonpay":return(0,Ke.jsxs)(Oe,{disabled:!g,onClick:()=>{r("MOONPAY_PROMPT_SCREEN")},children:[(0,Ke.jsx)(td,{children:(0,Ke.jsx)(Ua,{style:{width:24}})}),"Moonpay"]},E);case"coinbase-onramp":return j1(Number(i.chain.id))?(0,Ke.jsxs)(Oe,{disabled:!g,onClick:()=>{r("COINBASE_ONRAMP_STATUS_SCREEN")},children:[(0,Ke.jsx)(td,{children:(0,Ke.jsx)(ln,{style:{width:24}})}),"Coinbase Onramp"]},E):null;case"external":return(0,Ke.jsxs)(Oe,{disabled:!g,onClick:()=>{r("FUNDING_TRANSFER_FROM_WALLET_SCREEN")},children:[(0,Ke.jsx)(td,{children:(0,Ke.jsx)(ad.WalletIcon,{style:{width:24}})}),"Transfer from wallet"]},E)}}),(0,Ke.jsx)(v2,{disabled:!g,onClick:()=>r("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),(0,Ke.jsx)(K,{})]})};var k2=require("@ethersproject/units"),Ba=require("@heroicons/react/24/outline"),Qn=require("react"),Mi=y(require("styled-components"));var x2=y(require("styled-components"));var b2=y(require("styled-components")),E2=b2.default.div`
|
|
1774
1849
|
display: flex;
|
|
1775
1850
|
flex-direction: column;
|
|
1776
|
-
`;var
|
|
1851
|
+
`;var T2=y(require("styled-components")),Ds=T2.default.span`
|
|
1777
1852
|
text-align: left;
|
|
1778
1853
|
font-size: 0.75rem;
|
|
1779
1854
|
font-weight: 500;
|
|
1780
1855
|
line-height: 1.125rem; /* 150% */
|
|
1781
1856
|
|
|
1782
1857
|
color: var(--privy-color-error);
|
|
1783
|
-
`;var
|
|
1858
|
+
`;var S2=y(require("styled-components")),_2=S2.default.span`
|
|
1784
1859
|
color: var(--privy-color-foreground-3);
|
|
1785
1860
|
font-size: 0.75rem;
|
|
1786
1861
|
font-weight: 500;
|
|
1787
1862
|
line-height: 1.125rem; /* 150% */
|
|
1788
|
-
`;var
|
|
1863
|
+
`;var P2=y(require("@heroicons/react/24/outline/Square2StackIcon")),A2=y(require("styled-components"));var Us=require("react/jsx-runtime"),Fs=({address:e,showCopyIcon:t,url:r,className:o})=>r?(0,Us.jsx)("a",{title:e,className:o,href:`${r}/address/${e}`,target:"_blank",children:Mt(e)}):(0,Us.jsxs)("button",{title:e,className:o,onClick:()=>navigator.clipboard.writeText(e).catch(console.error),children:[Mt(e),t&&(0,Us.jsx)(C6,{})]}),C6=(0,A2.default)(P2.default)`
|
|
1789
1864
|
&& {
|
|
1790
1865
|
display: inline;
|
|
1791
1866
|
}
|
|
@@ -1794,7 +1869,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1794
1869
|
width: 0.875rem;
|
|
1795
1870
|
margin-left: 0.125rem;
|
|
1796
1871
|
color: var(--privy-color-foreground-3);
|
|
1797
|
-
`;var
|
|
1872
|
+
`;var Mo=require("react/jsx-runtime"),sd=({errMsg:e,balance:t,address:r,isLoading:o,className:n,title:i,isPulsing:a,statusColor:l="green"})=>{let s;return l?s=l:e?s="red":s="green",(0,Mo.jsxs)(Mo.Fragment,{children:[(0,Mo.jsxs)(w6,{className:n,$state:e?"error":void 0,children:[(0,Mo.jsxs)(E2,{children:[(0,Mo.jsx)(_2,{children:i||"Pay with"}),(0,Mo.jsx)(Fs,{address:r,showCopyIcon:!!e})]}),(0,Mo.jsx)(kr,{isLoading:o,isPulsing:a,color:s,children:t})]}),e&&(0,Mo.jsx)(Ds,{style:{marginTop:"0.25rem"},children:e})]})},w6=x2.default.div`
|
|
1798
1873
|
&& {
|
|
1799
1874
|
border-width: 1px;
|
|
1800
1875
|
}
|
|
@@ -1808,11 +1883,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1808
1883
|
align-items: center;
|
|
1809
1884
|
|
|
1810
1885
|
${e=>e.$state==="error"?"border-color: var(--privy-color-error);":""}
|
|
1811
|
-
`;var
|
|
1886
|
+
`;var ce=require("react/jsx-runtime"),b6=2e3,R2=()=>{let{wallets:e}=mo(),{app:t,data:r,setModalData:o,navigate:n,lastScreen:i}=P(),{chains:a,rpcConfig:l,appId:s,closePrivyModal:c}=W(),[m,f]=(0,Qn.useState)("default"),[u,C]=(0,Qn.useState)(void 0),v=r?.funding,{tokenPrice:g}=Ko({chainId:v.chain.id}),E=g?jc(v.amount,g):void 0,S=e.find(k=>Mt(k.address)===Mt(v.address)),R=S&&S.walletClientType!=="privy"?Un(S.walletClientType,S.connectorType,S.walletClientType):t.name;if(!v)return o({errorModalData:{error:new Error("Couldn't find funding config"),previousScreen:i||"FUNDING_METHOD_SELECTION_SCREEN"},funding:r?.funding,sendTransaction:r?.sendTransaction}),n("ERROR_SCREEN"),(0,ce.jsx)(ce.Fragment,{});(0,Qn.useEffect)(()=>{let k=Er(v.chain.id,a,l,{appId:s});function M(){k.getBalance(v.address).then(G=>C(parseFloat((0,k2.formatUnits)(G,"ether")))).catch(()=>C(void 0))}let D=setInterval(M,b6);return M(),()=>clearInterval(D)},[]);let T=(0,Qn.useMemo)(()=>u!==void 0?u>=parseFloat(v.amount):!1,[u,v.amount]),A=(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(sd,{title:"Your wallet",errMsg:void 0,isLoading:!v||u===void 0,isPulsing:!T,balance:`${u!==void 0?u.toPrecision(2):""} ETH`,address:v.address,statusColor:T?"green":"gray"}),T&&(0,ce.jsx)(C2,{onClick:()=>c(),children:"Close"})]});return m==="qr-code"?(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(x,{backFn:()=>f("default")}),(0,ce.jsxs)(Nn,{style:{gap:"24px",marginBottom:"24px"},children:[(0,ce.jsxs)("div",{children:[(0,ce.jsx)(Te,{children:"Scan QR code"}),(0,ce.jsxs)(Pe,{children:["Scan this code using your mobile wallet to send funds to your ",R," ","wallet."]})]}),(0,ce.jsx)(jn,{url:v.address,size:200,squareLogoElement:E6}),A]}),(0,ce.jsx)(K,{})]}):(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(Hr,{}),(0,ce.jsx)(xe,{title:"Send funds",description:"Send funds directly to your wallet by copying your wallet address or scanning a QR code."}),(0,ce.jsxs)(Nn,{style:{gap:"16px"},children:[(0,ce.jsxs)(_6,{children:[(0,ce.jsx)(Ba.InformationCircleIcon,{height:"20px",width:"20px",color:"#4f46e5"}),(0,ce.jsxs)(P6,{children:["Make sure to send on ",v.chain.name,"."]})]}),(0,ce.jsxs)(A6,{children:[(0,ce.jsx)(fa,{height:16}),(0,ce.jsxs)(rd,{children:[(0,ce.jsxs)(od,{children:[(0,ce.jsx)(f2,{children:v.amount}),(0,ce.jsx)(nd,{children:v.chain.nativeCurrency.symbol})]}),(0,ce.jsx)(id,{children:E?`${E} USD`:"..."}),(0,ce.jsxs)(g2,{children:[kc(v.chain.id),v.chain.name]})]}),(0,ce.jsx)(fa,{height:8}),(0,ce.jsxs)(S6,{children:[(0,ce.jsx)(T6,{text:v.address}),(0,ce.jsx)(M2,{onClick:()=>f("qr-code"),children:(0,ce.jsxs)(I2,{children:[(0,ce.jsx)(Ba.QrCodeIcon,{height:"16px",width:"16px"}),"Scan code"]})})]})]}),A]}),(0,ce.jsx)(fa,{height:16}),(0,ce.jsx)(K,{})]})},E6=({...e})=>(0,ce.jsx)(Mn,{color:"black",...e}),T6=e=>{let[t,r]=(0,Qn.useState)(!1);return(0,ce.jsx)(M2,{onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},children:(0,ce.jsxs)(I2,{children:[t?(0,ce.jsx)(Ia,{style:{height:"16px",width:"16px"},strokeWidth:"2"}):(0,ce.jsx)(Ba.DocumentDuplicateIcon,{style:{height:"16px",width:"16px"}}),t?"Copied":"Copy address"]})})},S6=Mi.default.div`
|
|
1812
1887
|
display: flex;
|
|
1813
1888
|
flex-direction: row;
|
|
1814
1889
|
gap: 8px;
|
|
1815
|
-
`,
|
|
1890
|
+
`,_6=Mi.default.div`
|
|
1816
1891
|
display: flex;
|
|
1817
1892
|
flex-direction: row;
|
|
1818
1893
|
padding: 8px;
|
|
@@ -1821,11 +1896,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1821
1896
|
svg {
|
|
1822
1897
|
margin-right: 12px;
|
|
1823
1898
|
}
|
|
1824
|
-
`,
|
|
1899
|
+
`,P6=Mi.default.div`
|
|
1825
1900
|
line-height: 20px;
|
|
1826
1901
|
font-size: 18px
|
|
1827
1902
|
text-align: center;
|
|
1828
|
-
`,
|
|
1903
|
+
`,A6=Mi.default.div`
|
|
1829
1904
|
display: flex;
|
|
1830
1905
|
flex-direction: column;
|
|
1831
1906
|
background-color: #f1f2f9;
|
|
@@ -1835,11 +1910,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1835
1910
|
}
|
|
1836
1911
|
padding: 16px;
|
|
1837
1912
|
gap: 8px;
|
|
1838
|
-
`,
|
|
1913
|
+
`,I2=Mi.default.span`
|
|
1839
1914
|
display: flex;
|
|
1840
1915
|
align-items: center;
|
|
1841
1916
|
margin: auto;
|
|
1842
|
-
`,
|
|
1917
|
+
`,M2=Mi.default.button`
|
|
1843
1918
|
display: flex;
|
|
1844
1919
|
align-items: center;
|
|
1845
1920
|
width: 100%;
|
|
@@ -1875,7 +1950,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1875
1950
|
width: 18px;
|
|
1876
1951
|
height: 18px;
|
|
1877
1952
|
}
|
|
1878
|
-
`;var
|
|
1953
|
+
`;var dd=require("react");var W2=y(require("@heroicons/react/24/outline/ClockIcon")),O2=y(require("@heroicons/react/24/outline/EyeSlashIcon")),L2=y(require("@heroicons/react/24/outline/LinkIcon")),Wo=y(require("styled-components"));var Je=require("react/jsx-runtime"),Cu=({title:e,desc:t,icon:r})=>(0,Je.jsxs)(W6,{children:[(0,Je.jsx)(L6,{children:r}),(0,Je.jsxs)(O6,{children:[(0,Je.jsx)(I6,{children:e}),(0,Je.jsx)(M6,{children:t})]})]}),N2=({app:e,signedUrl:t,onContinue:r})=>(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)(k6,{children:[(0,Je.jsx)(Ua,{size:"3.75rem"}),(0,Je.jsxs)(R6,{children:[e?.name," uses ",(0,Je.jsx)("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),(0,Je.jsxs)(N6,{children:[(0,Je.jsx)(Cu,{icon:(0,Je.jsx)(L2.default,{width:"1rem"}),title:"Purchase assets to fund your account",desc:(0,Je.jsxs)(Je.Fragment,{children:["Connect a payment method (",(0,Je.jsx)("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),(0,Je.jsx)(Cu,{icon:(0,Je.jsx)(W2.default,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),(0,Je.jsx)(Cu,{icon:(0,Je.jsx)(O2.default,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),(0,Je.jsx)(D6,{className:"mobile-only"})]}),(0,Je.jsx)(x6,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),(0,Je.jsx)(mc,{disabled:!t,href:t??"#",target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),x6=Wo.default.span`
|
|
1879
1954
|
display: inline-block;
|
|
1880
1955
|
color: var(--privy-color-foreground-3);
|
|
1881
1956
|
text-align: center;
|
|
@@ -1884,13 +1959,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1884
1959
|
font-weight: 400;
|
|
1885
1960
|
line-height: 140%; /* 0.875rem */
|
|
1886
1961
|
margin-bottom: 0.25rem;
|
|
1887
|
-
`,
|
|
1962
|
+
`,k6=Wo.default.div`
|
|
1888
1963
|
display: flex;
|
|
1889
1964
|
flex-direction: column;
|
|
1890
1965
|
align-items: center;
|
|
1891
1966
|
justify-content: center;
|
|
1892
1967
|
padding: 1.5rem 0;
|
|
1893
|
-
`,
|
|
1968
|
+
`,R6=Wo.default.span`
|
|
1894
1969
|
color: var(--privy-color-foreground);
|
|
1895
1970
|
text-align: center;
|
|
1896
1971
|
font-size: 1.125rem;
|
|
@@ -1899,46 +1974,46 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1899
1974
|
margin: 1.5rem 0;
|
|
1900
1975
|
text-align: center;
|
|
1901
1976
|
max-width: 19.5rem;
|
|
1902
|
-
|
|
1977
|
+
`,I6=Wo.default.span`
|
|
1903
1978
|
color: var(--privy-color-foreground);
|
|
1904
1979
|
font-size: 0.875rem;
|
|
1905
1980
|
font-weight: 500;
|
|
1906
1981
|
line-height: 1.225rem;
|
|
1907
1982
|
width: 100%;
|
|
1908
|
-
`,
|
|
1983
|
+
`,M6=Wo.default.span`
|
|
1909
1984
|
color: var(--privy-color-foreground-2);
|
|
1910
1985
|
font-size: 0.875rem;
|
|
1911
1986
|
font-weight: 400;
|
|
1912
1987
|
line-height: 1.225rem;
|
|
1913
|
-
`,
|
|
1988
|
+
`,W6=Wo.default.div`
|
|
1914
1989
|
display: flex;
|
|
1915
1990
|
align-items: flex-start;
|
|
1916
1991
|
gap: 0.5rem;
|
|
1917
1992
|
align-self: stretch;
|
|
1918
|
-
`,
|
|
1993
|
+
`,O6=Wo.default.div`
|
|
1919
1994
|
display: flex;
|
|
1920
1995
|
flex-direction: column;
|
|
1921
1996
|
gap: 0.25rem;
|
|
1922
1997
|
align-items: flex-start;
|
|
1923
1998
|
text-align: left;
|
|
1924
1999
|
flex: 1 0 0;
|
|
1925
|
-
`,
|
|
2000
|
+
`,L6=Wo.default.div`
|
|
1926
2001
|
padding-top: 2px;
|
|
1927
|
-
`,
|
|
2002
|
+
`,N6=Wo.default.div`
|
|
1928
2003
|
display: flex;
|
|
1929
2004
|
flex-direction: column;
|
|
1930
2005
|
gap: 1.25rem;
|
|
1931
2006
|
margin: 0 0.5rem;
|
|
1932
|
-
`,
|
|
2007
|
+
`,D6=Wo.default.div`
|
|
1933
2008
|
margin: 30px 0;
|
|
1934
|
-
`;var
|
|
2009
|
+
`;var D2=require("ofetch"),Ha=require("react");var ld="moonpay";function U2(e){switch(e){case"eip155:42161":return"ETH_ARBITRUM";case"eip155:43114":return"AVAX_CCHAIN";case"eip155:8453":return"ETH_BASE";case"eip155:42220":return"CELO_CELO";case"eip155:137":return"MATIC_POLYGON";case"eip155:1":return"ETH_ETHEREUM";default:return console.warn(`Chain ${e} not supported by Moonpay, defaulting to Ethereum mainnet`),"ETH_ETHEREUM"}}function F2(e){return parseFloat(e)}function B2(e){return!!e&&e.config!==void 0&&e.provider!==void 0}function cd(e){return!!e&&(e.chain!==void 0||e.amount!==void 0)}async function H2(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 U6(e,t){let r=t?Ef:bf,o=t?Sf:Tf;return(0,D2.ofetch)(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function G2(e,t=!1){let[r,o]=(0,Ha.useState)(null),{createAnalyticsEvent:n}=W(),{data:i,navigate:a,setModalData:l}=P(),s=i?.funding,c=(0,Ha.useRef)(0);return(0,Ha.useEffect)(()=>{let m=setInterval(async()=>{if(e)try{let[f]=await U6(e,t),u=f.status==="waitingAuthorization"&&f.paymentMethod==="credit_debit_card"?"pending":f.status;if(["failed","completed","awaitingAuthorization"].includes(u)&&(n({eventName:Na,payload:{status:u,provider:ld,paymentMethod:f.paymentMethod,cardPaymentType:f.cardPaymentType,currency:f.currency?.code,baseCurrencyAmount:f.baseCurrencyAmount,quoteCurrencyAmount:f.quoteCurrencyAmount,feeAmount:f.feeAmount,extraFeeAmount:f.extraFeeAmount,networkFeeAmount:f.networkFeeAmount}}),clearInterval(m)),u==="failed"||u==="serviceFailure"){l({funding:{...s,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),a("FUNDING_METHOD_SELECTION_SCREEN");return}o(u)}catch(f){f.response?.status!==404&&(c.current+=1),c.current>=3&&(n({eventName:Na,payload:{status:"serviceFailure",provider:ld}}),clearInterval(m),l({funding:{...s,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),a("FUNDING_METHOD_SELECTION_SCREEN"))}},3e3);return()=>clearInterval(m)},[e,c]),r}var Jn=require("react/jsx-runtime"),V2=()=>{let{app:e,data:t,navigate:r,setModalData:o}=P(),{createAnalyticsEvent:n,getMoonpaySignedUrl:i}=W(),[a,l]=(0,dd.useState)(null),s=t?.funding;return(0,dd.useEffect)(()=>{if(a||!s)return;async function c(){if(!e.fundingConfig)return;let{signedUrl:m,externalTransactionId:f}=await i(s.address,{...e.fundingMethodConfig.moonpay,...s.moonpayConfigOverride,currencyCode:s.moonpayConfigOverride?.currencyCode??U2(`eip155:${s.chain.id}`),quoteCurrencyAmount:s.moonpayConfigOverride?.quoteCurrencyAmount??F2(s.amount)});l(m),o({moonpayStatus:{externalTransactionId:f},funding:t?.funding})}c()},[a,s]),(0,Jn.jsxs)(Jn.Fragment,{children:[(0,Jn.jsx)(Hr,{}),(0,Jn.jsx)(N2,{app:e,signedUrl:a,onContinue:()=>{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:ld}}),r("MOONPAY_STATUS_SCREEN")}}),(0,Jn.jsx)(K,{})]})};var q2=y(require("@heroicons/react/24/solid/ArrowsRightLeftIcon")),z2=y(require("@heroicons/react/24/solid/CheckCircleIcon")),$2=require("react"),wu=y(require("styled-components"));var ht=require("react/jsx-runtime"),K2=()=>{let{app:e,data:t}=P(),{closePrivyModal:r}=W(),{externalTransactionId:o}=t?.moonpayStatus,n=G2(o||null,e.fundingMethodConfig.moonpay.useSandbox??!1);return(0,ht.jsxs)(ht.Fragment,{children:[(0,ht.jsx)(x,{title:"Fund account"},"header"),(0,ht.jsx)(B6,{status:n,onClickCta:r}),(0,ht.jsx)(K,{})]})},F6=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"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:""}}},B6=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=(0,$2.useMemo)(()=>F6(e),[e]);return(0,ht.jsxs)(ht.Fragment,{children:[(0,ht.jsxs)(z6,{children:[(0,ht.jsx)(V6,{status:e}),(0,ht.jsxs)(pt,{children:[(0,ht.jsx)("h3",{children:r}),(0,ht.jsx)(q6,{children:o})]})]}),n&&(0,ht.jsx)(H,{onClick:t,children:n})]})},H6=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)",G6=e=>{switch(e){case"completed":return z2.default;case"waitingAuthorization":return()=>(0,ht.jsx)(q2.default,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}},V6=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return(0,ht.jsxs)("div",{style:{position:"relative"},children:[(0,ht.jsx)(At,{color:o,style:{position:"absolute"}}),(0,ht.jsx)(Cs,{color:o}),(0,ht.jsx)(Ua,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=G6(e),r=H6(e);return(0,ht.jsx)("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&(0,ht.jsx)(t,{width:"4rem",height:"4rem",color:r})})},q6=wu.default.p`
|
|
1935
2010
|
font-size: 1rem;
|
|
1936
2011
|
color: var(--privy-color-foreground-3);
|
|
1937
2012
|
margin-bottom: 1rem;
|
|
1938
2013
|
display: flex;
|
|
1939
2014
|
flex-direction: column;
|
|
1940
2015
|
gap: 1rem;
|
|
1941
|
-
`,
|
|
2016
|
+
`,z6=wu.default.div`
|
|
1942
2017
|
display: flex;
|
|
1943
2018
|
flex-direction: column;
|
|
1944
2019
|
align-items: center;
|
|
@@ -1946,7 +2021,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1946
2021
|
margin-left: 1.75rem;
|
|
1947
2022
|
margin-right: 1.75rem;
|
|
1948
2023
|
padding: 2rem 0;
|
|
1949
|
-
`;var
|
|
2024
|
+
`;var fd=require("react");var j2=y(require("styled-components")),Ga=j2.default.span`
|
|
1950
2025
|
margin-top: 4px;
|
|
1951
2026
|
color: var(--privy-color-foreground);
|
|
1952
2027
|
text-align: center;
|
|
@@ -1954,7 +2029,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1954
2029
|
font-size: 0.875rem;
|
|
1955
2030
|
font-weight: 400;
|
|
1956
2031
|
line-height: 1.375rem; /* 157.143% */
|
|
1957
|
-
`;var
|
|
2032
|
+
`;var pd=y(require("styled-components"));var Y2=require("react/jsx-runtime"),ud=()=>{let{enabled:e,token:t}=We(),{navigate:r,setModalData:o}=P(),{initLoginWithPasskey:n}=W();return(0,Y2.jsx)(bu,{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"})},$6=pd.css`
|
|
1958
2033
|
&& {
|
|
1959
2034
|
width: 100%;
|
|
1960
2035
|
font-size: 0.875rem;
|
|
@@ -1979,9 +2054,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1979
2054
|
box-shadow: none;
|
|
1980
2055
|
}
|
|
1981
2056
|
}
|
|
1982
|
-
`,
|
|
1983
|
-
${
|
|
1984
|
-
`;var
|
|
2057
|
+
`,bu=pd.default.button`
|
|
2058
|
+
${$6}
|
|
2059
|
+
`;var Z2=y(require("@heroicons/react/24/outline/ChevronRightIcon")),Q2=y(require("@heroicons/react/24/outline/WalletIcon"));var Va=require("react/jsx-runtime"),md=({onClick:e,text:t})=>(0,Va.jsxs)(Oe,{onClick:e,children:[(0,Va.jsx)(Q2.default,{}),(0,Va.jsx)(Ho,{children:t}),(0,Va.jsx)(Z2.default,{})]});var Qt=require("react/jsx-runtime"),J2=()=>{let{connectors:e}=W(),{app:t,setModalData:r,data:o,navigate:n}=P(),[i,a]=(0,fd.useState)("default"),l=Fn(t.appearance.walletList,e,!0,t.appearance.walletList,t.externalWallets.walletConnect.enabled),s=(0,Qt.jsx)(md,{text:"More wallets",onClick:()=>a("overflow")});return(0,fd.useEffect)(()=>{r({...o,externalConnectWallet:{onCompleteNavigateTo:"FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"}})},[]),i==="overflow"?(0,Qt.jsxs)(Qt.Fragment,{children:[(0,Qt.jsx)(x,{backFn:()=>a("default")},"header"),(0,Qt.jsxs)(Pr,{children:[(0,Qt.jsx)(Ga,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),l]}),(0,Qt.jsx)(K,{})]}):(0,Qt.jsxs)(Qt.Fragment,{children:[(0,Qt.jsx)(Hr,{}),(0,Qt.jsx)(xe,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),(0,Qt.jsxs)(Pr,{children:[...l.length>3?l.slice(0,2):l,l.length>3&&s,(0,Qt.jsx)(bu,{onClick:()=>n("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),(0,Qt.jsx)(K,{})]})};var X2=y(require("@heroicons/react/24/outline/ArrowTopRightOnSquareIcon")),ev=y(require("styled-components"));var $r=require("react/jsx-runtime"),tv=()=>{let{closePrivyModal:e}=W();return(0,$r.jsxs)($r.Fragment,{children:[(0,$r.jsx)(x,{},"header"),(0,$r.jsx)(K6,{children:(0,$r.jsx)(X2.default,{style:{width:32,height:32}})}),(0,$r.jsx)(Vo,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,$r.jsx)(lo,{children:(0,$r.jsx)(H,{onClick:()=>e(),children:"Close"})}),(0,$r.jsx)(me,{}),(0,$r.jsx)(K,{})]})},K6=ev.default.div`
|
|
1985
2060
|
border-radius: 50%;
|
|
1986
2061
|
height: 68px;
|
|
1987
2062
|
width: 68px;
|
|
@@ -1991,18 +2066,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
1991
2066
|
background-color: var(--privy-color-accent);
|
|
1992
2067
|
color: white;
|
|
1993
2068
|
margin: 0 auto 24px auto;
|
|
1994
|
-
`;var
|
|
2069
|
+
`;var nv=y(require("react-device-detect")),iv=y(require("styled-components"));var hd=y(require("styled-components"));var Eu=require("react/jsx-runtime"),rv=({style:e,...t})=>(0,Eu.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"17",height:"17",viewBox:"0 0 17 17",style:{height:"1.25rem",width:"1.25rem",...e},...t,children:(0,Eu.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})});var gd=require("react/jsx-runtime"),ov=hd.default.div`
|
|
1995
2070
|
display: flex;
|
|
1996
2071
|
flex-direction: column;
|
|
1997
2072
|
justify-content: flex-start;
|
|
1998
2073
|
gap: 4px;
|
|
1999
|
-
`,
|
|
2074
|
+
`,Tu=hd.default.div`
|
|
2000
2075
|
&&& {
|
|
2001
2076
|
margin-left: 7px; /* TODO: This is a total hack */
|
|
2002
2077
|
border-left: 2px solid var(--privy-color-foreground-4);
|
|
2003
2078
|
height: 12px;
|
|
2004
2079
|
}
|
|
2005
|
-
`,
|
|
2080
|
+
`,yd=({children:e})=>(0,gd.jsxs)(j6,{children:[(0,gd.jsx)(rv,{style:{width:"16px",height:"16px"}}),e]}),j6=hd.default.div`
|
|
2006
2081
|
display: flex;
|
|
2007
2082
|
justify-content: flex-start;
|
|
2008
2083
|
justify-items: center;
|
|
@@ -2020,22 +2095,22 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2020
2095
|
margin-bottom: auto;
|
|
2021
2096
|
}
|
|
2022
2097
|
}
|
|
2023
|
-
`;var nt=require("react/jsx-runtime"),
|
|
2098
|
+
`;var nt=require("react/jsx-runtime"),Y6=()=>(0,nt.jsxs)(Z6,{children:[(0,nt.jsx)(wi,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),(0,nt.jsx)(jt,{children:(0,nt.jsx)(Uo,{style:{width:"152px",height:"152px"}})}),(0,nt.jsxs)(ov,{children:[(0,nt.jsx)(yd,{children:(0,nt.jsxs)("div",{children:[(0,nt.jsx)("span",{children:"Install the "}),(0,nt.jsx)("a",{href:nv.isFirefox?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",target:"_blank",children:"Phantom browser extension"})]})}),(0,nt.jsx)(Tu,{}),(0,nt.jsx)(yd,{children:"Set up your first wallet"}),(0,nt.jsx)(Tu,{}),(0,nt.jsx)(yd,{children:"Store your recovery phrase in a safe place!"})]}),(0,nt.jsx)(Ln,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),av=()=>{let{navigateBack:e}=P();return(0,nt.jsxs)(nt.Fragment,{children:[(0,nt.jsx)(x,{backFn:e},"header"),(0,nt.jsx)(de,{}),(0,nt.jsx)(Y6,{}),(0,nt.jsx)(me,{}),(0,nt.jsxs)(J,{children:[(0,nt.jsx)("span",{children:"Still not sure? "}),(0,nt.jsx)("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},Z6=(0,iv.default)(jt)`
|
|
2024
2099
|
gap: 30px;
|
|
2025
2100
|
|
|
2026
2101
|
> :first-child > svg {
|
|
2027
2102
|
margin-top: 20px;
|
|
2028
2103
|
}
|
|
2029
|
-
`;var
|
|
2104
|
+
`;var xv=y(require("@heroicons/react/24/outline/UserCircleIcon")),Vs=require("react"),kv=require("react-device-detect"),Rv=y(require("styled-components"));var Q6={apple_oauth:"apple",custom_auth:"custom",discord_oauth:"discord",email:"email",farcaster:"farcaster",github_oauth:"github",google_oauth:"google",instagram_oauth:"instagram",linkedin_oauth:"linkedin",passkey:"passkey",phone:"sms",spotify_oauth:"spotify",telegram:"telegram",tiktok_oauth:"tiktok",twitter_oauth:"twitter",wallet:"siwe",cross_app:"privy:"},Xn=e=>{let t=Q6[e];return e==="wallet"||e==="phone"?{displayName:e,loginMethod:t}:{displayName:t,loginMethod:t}};var dv=y(require("styled-components"));var sv=y(require("react"));var cv=require("react/jsx-runtime"),lv=()=>{let{app:e}=P(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?(0,cv.jsx)("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?sv.default.cloneElement(t,{alt:r,style:o}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};var Su=require("react/jsx-runtime"),vd=e=>{let{app:t}=P();return t?.appearance.logo?(0,Su.jsx)(J6,{...e,children:(0,Su.jsx)(lv,{})}):null},J6=dv.default.div`
|
|
2030
2105
|
display: flex;
|
|
2031
2106
|
flex-direction: column;
|
|
2032
2107
|
align-items: center;
|
|
2033
2108
|
padding: 24px 0;
|
|
2034
2109
|
flex-grow: 1;
|
|
2035
2110
|
justify-content: center;
|
|
2036
|
-
`;var
|
|
2111
|
+
`;var uv=y(require("@heroicons/react/24/outline/EnvelopeIcon")),mv=require("react");var pv=y(require("@heroicons/react/24/outline/EnvelopeIcon")),qa=require("react"),_u=y(require("styled-components"));var Kr=require("react/jsx-runtime"),Cd=(0,qa.forwardRef)((e,t)=>{let[r,o]=(0,qa.useState)(""),[n,i]=(0,qa.useState)(!1),{authenticated:a}=$(),{initLoginWithEmail:l}=W(),{navigate:s,setModalData:c,currentScreen:m}=P(),{enabled:f,token:u}=We(),[C,v]=(0,qa.useState)(!1),{accountType:g}=ar(),E=Sl(r),S=n,R=n||!E,T=k=>{i(!0),l(r,k).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(M=>{c({errorModalData:{error:M,previousScreen:m||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},A=()=>{f&&!u&&!a?(c({captchaModalData:{callback:k=>l(r,k),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):T(u)};return(0,Kr.jsxs)(Kr.Fragment,{children:[(0,Kr.jsx)(X6,{children:(0,Kr.jsxs)(eb,{stacked:e.stacked,children:[(0,Kr.jsx)(pv.default,{}),(0,Kr.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onFocus:()=>v(!0),onChange:k=>o(k.target.value),onKeyUp:k=>{k.key==="Enter"&&A()},value:r,autoComplete:"email"}),g==="email"&&!C?(0,Kr.jsx)(kr,{color:"gray",children:"Recent"}):e.stacked?(0,Kr.jsx)("span",{}):(0,Kr.jsx)(pa,{isSubmitting:S,onClick:A,disabled:R,children:"Submit"})]})}),e.stacked?(0,Kr.jsx)(H,{loadingText:null,loading:S,disabled:R,onClick:A,children:"Submit"}):null]})}),X6=_u.default.div`
|
|
2037
2112
|
width: 100%;
|
|
2038
|
-
`,
|
|
2113
|
+
`,eb=_u.default.label`
|
|
2039
2114
|
display: block;
|
|
2040
2115
|
position: relative;
|
|
2041
2116
|
width: 100%;
|
|
@@ -2102,11 +2177,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2102
2177
|
&& > input::placeholder {
|
|
2103
2178
|
color: var(--privy-color-foreground-3);
|
|
2104
2179
|
}
|
|
2105
|
-
`;var
|
|
2180
|
+
`;var Zo=require("react/jsx-runtime"),wd=({isEditable:e,setIsEditable:t})=>{let r=(0,mv.useRef)(null);return(0,Zo.jsxs)(Zo.Fragment,{children:[(0,Zo.jsx)(Ao,{if:!e,children:(0,Zo.jsx)(Cd,{ref:r})}),(0,Zo.jsx)(Ao,{if:e,children:(0,Zo.jsxs)(Oe,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,Zo.jsx)(uv.default,{})," Continue with Email"]})})]})};var fv=require("react"),hv=y(require("styled-components"));var Wi=require("react/jsx-runtime"),bd=()=>{let[e,t]=(0,fv.useState)(!1),{currentScreen:r,navigate:o,setModalData:n}=P(),{enabled:i,token:a}=We(),{initLoginWithFarcaster:l}=W(),{accountType:s}=ar();return(0,Wi.jsxs)(Oe,{onClick:async()=>{t(!0);try{i&&!a?(n({captchaModalData:{callback:m=>l(m),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):(await l(a),o("AWAITING_FARCASTER_CONNECTION"))}catch(m){n({errorModalData:{error:m,previousScreen:r||"LANDING"}}),o("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[(0,Wi.jsx)($o,{})," Farcaster",e&&(0,Wi.jsx)("span",{children:(0,Wi.jsx)(Bo,{})}),s==="farcaster"&&(0,Wi.jsx)(tb,{color:"gray",children:"Recent"})]})},tb=(0,hv.default)(kr)`
|
|
2106
2181
|
margin-left: auto;
|
|
2107
|
-
`;var
|
|
2182
|
+
`;var bv=y(require("@heroicons/react/24/outline/PhoneIcon")),Ev=require("react");var Oi=require("react"),Pu=y(require("styled-components"));var yv=y(require("libphonenumber-js/examples.mobile.json")),jr=require("libphonenumber-js/min"),Td=require("react/jsx-runtime");var Bs=(e,t)=>(0,jr.isPossiblePhoneNumber)(String(e),t),Ed=(e,t)=>`+${(0,jr.getCountryCallingCode)(t)} ${e}`,gv=e=>`*${e.replaceAll("-","").slice(-4)}`,vv=e=>new jr.AsYouType(e),rb=(0,jr.getCountries)().map(e=>({code:e,callCode:(0,jr.getCountryCallingCode)(e)})),Cv=e=>{let t=(0,jr.getExampleNumber)(e,yv.default)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},wv=({value:e,onChange:t})=>(0,Td.jsx)("select",{value:e,onChange:t,children:rb.map(r=>(0,Td.jsxs)("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))});var Yr=require("react/jsx-runtime"),za=(0,Oi.forwardRef)((e,t)=>{let{app:r}=P(),[o,n]=(0,Oi.useState)(!1),{accountType:i}=ar(),[a,l]=(0,Oi.useState)(""),[s,c]=(0,Oi.useState)(r?.intl.defaultCountry??"US"),m=Bs(a,s),f=vv(s),u=Cv(s),C=(0,jr.getCountryCallingCode)(s),v=!m,[g,E]=(0,Oi.useState)(!1),S=C.length,R=k=>{let M=k.target.value;c(M),l(""),e.onChange&&e.onChange({rawPhoneNumber:a,qualifiedPhoneNumber:Ed(a,M),countryCode:M,isValid:Bs(a,s)})},T=k=>{try{let M=k.replace(/\D/g,""),D=a.replace(/\D/g,""),G=M===D?k:f.input(k);l(G),e.onChange&&e.onChange({rawPhoneNumber:G,qualifiedPhoneNumber:Ed(k,s),countryCode:s,isValid:Bs(k,s)})}catch(M){console.error("Error processing phone number:",M)}},A=()=>{E(!0);let k=Ed(a,s);e.onSubmit({rawPhoneNumber:a,qualifiedPhoneNumber:k,countryCode:s,isValid:Bs(a,s)}).finally(()=>E(!1))};return(0,Yr.jsxs)(Yr.Fragment,{children:[(0,Yr.jsx)(ob,{children:(0,Yr.jsxs)(nb,{callingCodeLength:S,stacked:e.stacked,children:[(0,Yr.jsx)(wv,{value:s,onChange:R}),(0,Yr.jsx)("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:u,onFocus:()=>n(!0),onChange:k=>{T(k.target.value)},onKeyUp:k=>{k.key==="Enter"&&A()},value:a,autoComplete:"tel"}),i==="phone"&&!o?(0,Yr.jsx)(kr,{color:"gray",children:"Recent"}):!e.stacked&&!e.noIncludeSubmitButton?(0,Yr.jsx)(pa,{isSubmitting:g,onClick:A,disabled:v,children:"Submit"}):(0,Yr.jsx)("span",{})]})}),e.stacked&&!e.noIncludeSubmitButton?(0,Yr.jsx)(H,{loading:g,loadingText:null,onClick:A,disabled:v,children:"Submit"}):null]})}),ob=Pu.default.div`
|
|
2108
2183
|
width: 100%;
|
|
2109
|
-
`,
|
|
2184
|
+
`,nb=Pu.default.label`
|
|
2110
2185
|
--country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.callingCodeLength}px));
|
|
2111
2186
|
--phone-input-extra-padding-left: calc(12px + calc(3 * ${e=>e.callingCodeLength}px));
|
|
2112
2187
|
display: block;
|
|
@@ -2199,15 +2274,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2199
2274
|
&& > input::placeholder {
|
|
2200
2275
|
color: var(--privy-color-foreground-3);
|
|
2201
2276
|
}
|
|
2202
|
-
`;var
|
|
2277
|
+
`;var Qo=require("react/jsx-runtime"),Sd=({isEditable:e,setIsEditable:t})=>{let r=(0,Ev.useRef)(null),{authenticated:o}=$(),{navigate:n,setModalData:i,currentScreen:a}=P(),{initLoginWithSms:l}=W(),{enabled:s,token:c}=We();async function m({qualifiedPhoneNumber:f}){if(s&&!c&&!o)i({captchaModalData:{callback:u=>l(f,u),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN");else try{await l(f,c),n("AWAITING_PASSWORDLESS_CODE")}catch(u){i({errorModalData:{error:u,previousScreen:a||"LANDING"}}),n("ERROR_SCREEN")}}return(0,Qo.jsxs)(Qo.Fragment,{children:[(0,Qo.jsx)(Ao,{if:!e,children:(0,Qo.jsx)(za,{ref:r,onSubmit:m})}),(0,Qo.jsx)(Ao,{if:e,children:(0,Qo.jsxs)(Oe,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,Qo.jsx)(bv.default,{})," Continue with SMS"]})})]})};var Tv=require("react"),Sv=y(require("styled-components"));var Zr=require("react/jsx-runtime"),ib={apple:{logo:(0,Zr.jsx)(Dl,{}),displayName:"Apple"},discord:{logo:(0,Zr.jsx)(Ul,{}),displayName:"Discord"},github:{logo:(0,Zr.jsx)(Fl,{}),displayName:"GitHub"},google:{logo:(0,Zr.jsx)(Bl,{}),displayName:"Google"},linkedin:{logo:(0,Zr.jsx)(Gl,{}),displayName:"LinkedIn"},spotify:{logo:(0,Zr.jsx)(Vl,{}),displayName:"Spotify"},instagram:{logo:(0,Zr.jsx)(Hl,{}),displayName:"Instagram"},twitter:{logo:(0,Zr.jsx)(zl,{}),displayName:"Twitter"},tiktok:{logo:(0,Zr.jsx)(ql,{}),displayName:"TikTok"}},dr=({provider:e})=>{let{enabled:t,token:r}=We(),{navigate:o,setModalData:n}=P(),[i,a]=(0,Tv.useState)(!1),{initLoginWithOAuth:l}=W(),{accountType:s}=ar(),c=s?Xn(s):null,{displayName:m,logo:f}=ib[e];return(0,Zr.jsxs)(Oe,{onClick:()=>{a(!0),t&&!r?(n({captchaModalData:{callback:C=>l(e,C),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):l(e)},disabled:i,children:[f," ",m,c?.loginMethod===e&&(0,Zr.jsx)(ab,{color:"gray",children:"Recent"})]})},ab=(0,Sv.default)(kr)`
|
|
2203
2278
|
margin-left: auto;
|
|
2204
|
-
`;var
|
|
2279
|
+
`;var _v=require("react"),Pv=y(require("styled-components"));var fo=require("react/jsx-runtime");function _d(e){return(0,fo.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...e,children:[(0,fo.jsx)("defs",{children:(0,fo.jsxs)("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[(0,fo.jsx)("stop",{offset:"0",stopColor:"#1d93d2"}),(0,fo.jsx)("stop",{offset:"1",stopColor:"#38b0e3"})]})}),(0,fo.jsx)("title",{children:"Telegram_logo"}),(0,fo.jsx)("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),(0,fo.jsx)("path",{d:"M81.229,128.772l14.237,39.406s1.78,3.687,3.686,3.687,30.255-29.492,30.255-29.492l31.525-60.89L81.737,118.6Z",fill:"#c8daea"}),(0,fo.jsx)("path",{d:"M100.106,138.878l-2.733,29.046s-1.144,8.9,7.754,0,17.415-15.763,17.415-15.763",fill:"#a9c6d8"}),(0,fo.jsx)("path",{d:"M81.486,130.178,52.2,120.636s-3.5-1.42-2.373-4.64c.232-.664.7-1.229,2.1-2.2,6.489-4.523,120.106-45.36,120.106-45.36s3.208-1.081,5.1-.362a2.766,2.766,0,0,1,1.885,2.055,9.357,9.357,0,0,1,.254,2.585c-.009.752-.1,1.449-.169,2.542-.692,11.165-21.4,94.493-21.4,94.493s-1.239,4.876-5.678,5.043A8.13,8.13,0,0,1,146.1,172.5c-8.711-7.493-38.819-27.727-45.472-32.177a1.27,1.27,0,0,1-.546-.9c-.093-.469.417-1.05.417-1.05s52.426-46.6,53.821-51.492c.108-.379-.3-.566-.848-.4-3.482,1.281-63.844,39.4-70.506,43.607A3.21,3.21,0,0,1,81.486,130.178Z",fill:"#fff"})]})}var Hs=require("react/jsx-runtime"),Pd=()=>{let{enabled:e,token:t}=We(),{navigate:r,setModalData:o}=P(),[n,i]=(0,_v.useState)(!1),{initLoginWithTelegram:a}=W(),{accountType:l}=ar();async function s(m){try{await a(m),r("TELEGRAM_AUTH_SCREEN")}catch(f){console.error(f),i(!1)}}async function c(){if(i(!0),e&&!t){o({captchaModalData:{callback:s,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN");return}await s()}return(0,Hs.jsxs)(Oe,{onClick:c,disabled:n,children:[(0,Hs.jsx)(_d,{}),"Telegram",l==="telegram"&&(0,Hs.jsx)(sb,{color:"gray",children:"Recent"})]})},sb=(0,Pv.default)(kr)`
|
|
2205
2280
|
margin-left: auto;
|
|
2206
|
-
`;var
|
|
2281
|
+
`;var Av=y(require("@heroicons/react/24/outline/ChevronRightIcon"));var Gs=require("react/jsx-runtime"),Ad=({onClick:e,text:t,icon:r})=>(0,Gs.jsxs)(Oe,{onClick:e,children:[r,(0,Gs.jsx)(Ho,{children:t}),(0,Gs.jsx)(Av.default,{})]});var qe=require("react/jsx-runtime"),kd=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=W(),{app:o,onUserCloseViaDialogOrKeybindRef:n}=P(),{appearance:{palette:{colorScheme:i}}}=dt(),{accountType:a,walletClientType:l}=ar(),s=a?Xn(a):null,c=o.loginMethodsAndOrder?.primary??[],m=o.loginMethodsAndOrder?.overflow??[],f=[...c,...m],u=o.loginMethods.passkey,C=[];l&&f.includes(l)?C.push(l):a&&f.includes(s?.loginMethod)&&C.push(s?.loginMethod);let[v,g]=(0,Vs.useState)("default"),[E,S]=(0,Vs.useState)(a==="phone"?"sms":"email");(0,Vs.useEffect)(()=>{a==="phone"&&S("sms");let U=f.indexOf("sms"),O=f.indexOf("email");U>-1&&U<O&&S("sms")},[a,c,m]);let R=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{g("default")},150)};n.current=R;let T=U=>U==="email"?(0,qe.jsx)(wd,{isEditable:E==="email",setIsEditable:()=>{S("email")}},U):U==="sms"?(0,qe.jsx)(Sd,{isEditable:E==="sms",setIsEditable:()=>{S("sms")}},U):U==="apple"?(0,qe.jsx)(dr,{provider:"apple"},U):U==="discord"?(0,qe.jsx)(dr,{provider:"discord"},U):U==="farcaster"?(0,qe.jsx)(bd,{},U):U==="github"?(0,qe.jsx)(dr,{provider:"github"},U):U==="google"?(0,qe.jsx)(dr,{provider:"google"},U):U==="linkedin"?(0,qe.jsx)(dr,{provider:"linkedin"},U):U==="tiktok"?(0,qe.jsx)(dr,{provider:"tiktok"},U):U==="twitter"&&(!kv.isMobile||o?.loginConfig.twitterOAuthOnMobileEnabled)?(0,qe.jsx)(dr,{provider:"twitter"},U):U==="telegram"?(0,qe.jsx)(Pd,{},U):Fn([U],r,e,f,o.externalWallets.walletConnect.enabled),A=C.flatMap(T),k=c.filter(U=>U!==l&&U!==s?.loginMethod).flatMap(T),M=m.filter(U=>U!==l&&U!==s?.loginMethod).flatMap(T),D=[...A,...k,...M],G=lb({primary:k.length+A.length,overflow:M.length}),[Y,Z]=tf(D,G),L=v==="default"?void 0:()=>{g("default")};return(0,qe.jsxs)(qe.Fragment,{children:[(0,qe.jsx)(x,{title:o.appearance.landingHeader,onClose:R,backFn:L}),v==="default"&&(0,qe.jsx)(cb,{}),v==="default"&&(typeof o.appearance.loginMessage=="string"?(0,qe.jsx)(hc,{children:o.appearance.loginMessage}):o.appearance.loginMessage),(0,qe.jsx)(fc,{style:{overflow:"hidden"},children:(0,qe.jsxs)(ay,{colorScheme:i,style:{maxHeight:400,overflowY:"scroll",padding:2},children:[v==="default"&&(0,qe.jsxs)(qe.Fragment,{children:[...Y,Z.length>0&&(0,qe.jsx)(Ad,{text:"More options",icon:(0,qe.jsx)(xv.default,{}),onClick:()=>g("overflow")})]}),v==="overflow"&&(0,qe.jsxs)(qe.Fragment,{children:[...Z]}),u&&v==="default"&&(0,qe.jsx)(ud,{})]})}),o&&(0,qe.jsx)(ua,{app:o}),(0,qe.jsx)(K,{})]})},xd=5,lb=({primary:e,overflow:t})=>e<xd?e:e===xd&&t===0?xd:xd-1,cb=(0,Rv.default)(vd)`
|
|
2207
2282
|
margin-bottom: 16px;
|
|
2208
|
-
`;var
|
|
2283
|
+
`;var Wv=y(require("@heroicons/react/24/outline/EnvelopeIcon")),Ov=y(require("@heroicons/react/24/outline/PhoneIcon")),Lv=y(require("@heroicons/react/24/outline/UserCircleIcon")),ei=require("react"),Nv=require("react-device-detect"),Dv=y(require("styled-components")),Uv=require("@privy-io/js-sdk-core");var gn=require("react/jsx-runtime"),Iv=({...e})=>(0,gn.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[(0,gn.jsxs)("g",{clipPath:"url(#clip0_2856_1743)",children:[(0,gn.jsx)("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,gn.jsx)("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,gn.jsx)("defs",{children:(0,gn.jsx)("clipPath",{id:"clip0_2856_1743",children:(0,gn.jsx)("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});var Se=require("react/jsx-runtime"),Rd=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=W(),{data:o,onUserCloseViaDialogOrKeybindRef:n}=P(),i=dt(),{accountType:a,walletClientType:l}=ar(),s=a?Xn(a):null,c=o?.login,m=(0,ei.useMemo)(()=>c?.loginMethods?(0,Uv.toObjectKeys)(c.loginMethods,!0):null,[c]),{email:f,sms:u,google:C,twitter:v,discord:g,github:E,spotify:S,instagram:R,tiktok:T,linkedin:A,apple:k,wallet:M,farcaster:D,telegram:G}=m??i.loginMethods,{passkey:Y}=i.loginMethods,Z=[f&&"email",u&&"sms",C&&"google",v&&"twitter",g&&"discord",E&&"github",S&&"spotify",R&&"instagram",T&&"tiktok",A&&"linkedin",k&&"apple",D&&"farcaster",G&&"telegram"].filter(V=>!!V),L=Z.length>0,U=(0,ei.useMemo)(()=>M&&!L?"web3-first":M&&i?.appearance.loginGroupPriority||"web2-first",[M,L,i?.appearance.loginGroupPriority]),O=i?.appearance.hideDirectWeb2Inputs,[Ie,je]=(0,ei.useState)("default"),[Q,re]=(0,ei.useState)(Mv({accountType:a,sms:u,email:f}));(0,ei.useEffect)(()=>{re(Mv({accountType:a,sms:u,email:f}))},[f,u,a]);let ae=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{je("default")},150)};n.current=ae;let Fe=[];l&&M?Fe.push(l):s?.loginMethod&&Z.includes(s.loginMethod)&&Fe.push(s.loginMethod);let Ne=V=>V==="email"?(0,Se.jsx)(wd,{isEditable:Q==="email",setIsEditable:()=>{re("email")}},V):V==="sms"?(0,Se.jsx)(Sd,{isEditable:Q==="sms",setIsEditable:()=>{re("sms")}},V):V==="apple"?(0,Se.jsx)(dr,{provider:"apple"},V):V==="discord"?(0,Se.jsx)(dr,{provider:"discord"},V):V==="farcaster"?(0,Se.jsx)(bd,{},V):V==="github"?(0,Se.jsx)(dr,{provider:"github"},V):V==="google"?(0,Se.jsx)(dr,{provider:"google"},V):V==="linkedin"?(0,Se.jsx)(dr,{provider:"linkedin"},V):V==="tiktok"?(0,Se.jsx)(dr,{provider:"tiktok"},V):V==="twitter"&&(!Nv.isMobile||i?.loginConfig.twitterOAuthOnMobileEnabled)?(0,Se.jsx)(dr,{provider:"twitter"},V):V==="telegram"?(0,Se.jsx)(Pd,{},V):Fn([V],r,e,[],i.externalWallets.walletConnect.enabled),ut=Fn(i.appearance.walletList.filter(V=>V!==l),r,e,[...i.appearance.walletList,l],i.externalWallets.walletConnect.enabled),lt=Z.filter(V=>V!==s?.loginMethod).flatMap(Ne),Nt=Fe.flatMap(Ne);U==="web3-first"&&Ie==="default"?ut.unshift(...Nt):U==="web2-first"&<.unshift(...Nt);let at=Ie==="default"?void 0:()=>{je("default")},ge=Z.filter(V=>V!=="email"&&V!=="sms"),Cr=pb({priority:U,email:f,sms:u,social:ge}),go=ub({priority:U,email:f,sms:u,social:ge}),Lo=mb({priority:U}),N=(0,Se.jsx)(md,{text:Lo,onClick:()=>je("web3-overflow")}),_t=(0,Se.jsx)(Ad,{text:Cr,icon:go,onClick:()=>je("web2-overflow")}),vo=O?0:1;return(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)(x,{title:i.appearance.landingHeader,onClose:ae,backFn:at}),Ie==="default"&&(0,Se.jsx)(db,{}),Ie==="default"&&(typeof i.appearance.loginMessage=="string"?(0,Se.jsx)(hc,{children:i.appearance.loginMessage}):i.appearance.loginMessage),(0,Se.jsx)(fc,{style:{overflow:"hidden",padding:2},children:(0,Se.jsxs)(Pr,{children:[Ie==="default"&&U==="web2-first"&&(0,Se.jsxs)(Se.Fragment,{children:[...lt.length>4?lt.slice(0,3):lt,lt.length>4&&_t,M&&N]}),Ie==="default"&&U==="web3-first"&&(0,Se.jsxs)(Se.Fragment,{children:[M&&(0,Se.jsxs)(Se.Fragment,{children:[...ut.length>4?ut.slice(0,3):ut,ut.length>4&&N]}),lt.length>vo&&_t,lt.length===vo&<[0]]}),Ie==="web2-overflow"&&(0,Se.jsxs)(Se.Fragment,{children:[...U==="web3-first"?lt:lt.slice(3)]}),...Ie==="web3-overflow"?ut:[],Y&&Ie==="default"&&(0,Se.jsx)(ud,{})]})}),i&&(0,Se.jsx)(ua,{app:i}),(0,Se.jsx)(K,{})]})},db=(0,Dv.default)(vd)`
|
|
2209
2284
|
margin-bottom: 16px;
|
|
2210
|
-
`,
|
|
2285
|
+
`,pb=({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",ub=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?(0,Se.jsx)(Lv.default,{}):t&&r?(0,Se.jsx)(Iv,{}):t?(0,Se.jsx)(Wv.default,{}):r?(0,Se.jsx)(Ov.default,{}):null,mb=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets",Mv=({accountType:e,sms:t,email:r})=>e==="email"&&r?"email":e==="phone"&&t||t&&!r?"sms":"email";var Au=require("react/jsx-runtime"),Fv=()=>{let{app:e}=P();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,Au.jsx)(kd,{connectOnly:!0}):(0,Au.jsx)(Rd,{connectOnly:!0})};var xu=require("react/jsx-runtime"),Bv=()=>{let{app:e}=P();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,xu.jsx)(kd,{connectOnly:!1}):(0,xu.jsx)(Rd,{connectOnly:!1})};var Hv=y(require("@heroicons/react/24/outline/EnvelopeIcon"));var Qr=require("react/jsx-runtime"),Gv=()=>{let{app:e}=P();return(0,Qr.jsxs)(Qr.Fragment,{children:[(0,Qr.jsx)(x,{},"header"),(0,Qr.jsx)(de,{}),(0,Qr.jsx)(xe,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:(0,Qr.jsx)(Hv.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,Qr.jsx)(lo,{children:(0,Qr.jsx)(Cd,{stacked:!0})}),(0,Qr.jsx)(me,{}),(0,Qr.jsx)(K,{})]})};var Vv=y(require("@heroicons/react/24/outline/PhoneIcon"));var Jr=require("react/jsx-runtime"),qv=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=P(),{initLoginWithSms:i}=W();async function a({qualifiedPhoneNumber:l}){try{await i(l),o("AWAITING_PASSWORDLESS_CODE")}catch(s){n({errorModalData:{error:s,previousScreen:r?.errorModalData?.previousScreen||t||"LINK_PHONE_SCREEN"}}),o("ERROR_SCREEN")}}return(0,Jr.jsxs)(Jr.Fragment,{children:[(0,Jr.jsx)(x,{},"header"),(0,Jr.jsx)(de,{}),(0,Jr.jsx)(xe,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:(0,Jr.jsx)(Vv.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),(0,Jr.jsx)(lo,{children:(0,Jr.jsx)(za,{stacked:!0,onSubmit:a})}),(0,Jr.jsx)(me,{}),(0,Jr.jsx)(K,{})]})};var Jo=require("react/jsx-runtime"),zv=()=>{let{linkingOrConnectingHint:e}=W(),{app:t}=P(),r=e?`Link the wallet with address ${Mt(e)} ${t?.name?`to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return(0,Jo.jsxs)(Jo.Fragment,{children:[(0,Jo.jsx)(x,{},"header"),(0,Jo.jsx)(Vo,{title:"Link your wallet",description:r}),(0,Jo.jsx)(Pr,{children:(0,Jo.jsx)(ga,{connectOnly:!1})}),(0,Jo.jsx)(K,{})]})};var qs=require("react/jsx-runtime"),$v=({style:e,...t})=>(0,qs.jsxs)("svg",{width:"164",height:"164",viewBox:"0 0 164 164",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,qs.jsx)("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),(0,qs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});var Mr=require("react/jsx-runtime"),Kv=()=>{let{closePrivyModal:e}=W(),{navigate:t}=P();return(0,Mr.jsxs)(Mr.Fragment,{children:[(0,Mr.jsx)(x,{},"header"),(0,Mr.jsx)(de,{}),(0,Mr.jsx)($v,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),(0,Mr.jsx)(Vo,{title:"Could not connect with wallet",description:"Please check that Phantom multichain is enabled and try again.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,Mr.jsxs)(lo,{children:[(0,Mr.jsx)(H,{onClick:()=>t("LANDING"),children:"Try again"}),(0,Mr.jsx)(_o,{onClick:()=>e(),children:"Cancel"})]}),(0,Mr.jsx)(me,{}),(0,Mr.jsx)(K,{})]})};var wC=y(require("@heroicons/react/24/solid/CheckBadgeIcon")),bC=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),EC=y(require("@heroicons/react/24/solid/IdentificationIcon")),TC=y(require("@heroicons/react/24/solid/PhoneIcon")),SC=y(require("@heroicons/react/24/solid/QuestionMarkCircleIcon")),Wu=y(require("@heroicons/react/24/solid/ShieldCheckIcon")),vn=require("react");var jv=require("react");function $a(){let{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}=(0,jv.useContext)(De);return{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}}var Yv=require("react");function ho(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenroll:a,enrollInMfa:l}=(0,Yv.useContext)(De);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenrollWithSms:()=>a("sms"),unenrollWithTotp:()=>a("totp"),unenrollWithPasskey:()=>a("passkey"),showMfaEnrollmentModal:()=>l(!0),closeMfaEnrollmentModal:()=>l(!1)}}var Zv=y(require("styled-components")),zs=require("react/jsx-runtime"),Qv=e=>(0,zs.jsxs)(fb,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[(0,zs.jsx)("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),(0,zs.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]}),fb=Zv.default.svg`
|
|
2211
2286
|
height: 90px;
|
|
2212
2287
|
width: 90px;
|
|
2213
2288
|
|
|
@@ -2218,7 +2293,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2218
2293
|
> path {
|
|
2219
2294
|
fill: white;
|
|
2220
2295
|
}
|
|
2221
|
-
`;var
|
|
2296
|
+
`;var Id=y(require("@heroicons/react/20/solid/CheckIcon")),Jv=y(require("@heroicons/react/24/outline/ChevronRightIcon")),Xv=y(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),eC=y(require("@heroicons/react/24/outline/FingerPrintIcon")),tC=y(require("@heroicons/react/24/outline/PhoneIcon")),Md=y(require("@heroicons/react/24/outline/TrashIcon")),rC=y(require("@heroicons/react/24/solid/ShieldCheckIcon"));var se=require("react/jsx-runtime"),oC=({showIntro:e,userMfaMethods:t,appMfaMethods:r,userHasAuthSms:o,isTotpLoading:n,isPasskeyLoading:i,error:a,onClose:l,onBackToIntro:s,handleSelectMethod:c,setRemovingMfaMethod:m})=>{let f=t.reduce((C,v)=>({...C,[v]:!0}),{}),u=r.reduce((C,v)=>({...C,[v]:!0}),{});return(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)(x,{backFn:e?s:void 0,onClose:l},"header"),(0,se.jsx)(Ye,{children:(0,se.jsx)(mt,{children:(0,se.jsx)(rC.default,{})})}),(0,se.jsx)(Te,{children:"Choose a verification method"}),t.length>0?(0,se.jsx)(Pe,{children:"To add or delete verification methods, verification is required."}):(0,se.jsx)(Pe,{children:"How would you like to verify your identity? You can change this later."}),a&&(0,se.jsx)(bc,{style:{marginTop:"1.25rem"},children:a.message}),(0,se.jsxs)(yc,{children:[(u.totp||f.totp)&&(0,se.jsxs)(gc,{children:[(0,se.jsx)(Oe,{style:{justifyContent:"center"},disabled:f.totp||n,onClick:()=>c("totp"),children:n?(0,se.jsx)(At,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):(0,se.jsxs)(wc,{children:[(0,se.jsxs)(Cc,{children:[(0,se.jsx)(Xv.default,{}),"Authenticator App"]}),f.totp?(0,se.jsxs)(Ci,{children:[(0,se.jsx)(Id.default,{}),"Added"]}):(0,se.jsx)(Ci,{children:"Recommended"})]})}),f.totp&&(0,se.jsx)(vc,{onClick:()=>m("totp"),children:(0,se.jsx)(Md.default,{})})]},"totp"),(u.sms||f.sms)&&(0,se.jsxs)(gc,{children:[(0,se.jsx)(Oe,{disabled:f.sms||o,onClick:()=>c("sms"),children:(0,se.jsxs)(wc,{children:[(0,se.jsxs)(Cc,{children:[(0,se.jsx)(tC.default,{}),"SMS"]}),f.sms&&(0,se.jsxs)(Ci,{children:[(0,se.jsx)(Id.default,{}),"Added"]}),o&&(0,se.jsx)(Ci,{children:"Disabled"})]})}),f.sms&&(0,se.jsx)(vc,{onClick:()=>m("sms"),children:(0,se.jsx)(Md.default,{})})]},"sms"),(u.passkey||f.passkey)&&(0,se.jsxs)(gc,{children:[(0,se.jsx)(Oe,{style:{justifyContent:"center"},onClick:()=>c("passkey"),disabled:f.passkey||i,children:i?(0,se.jsx)(At,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):(0,se.jsxs)(wc,{children:[(0,se.jsxs)(Cc,{children:[(0,se.jsx)(eC.default,{}),"Passkey"]}),f.passkey?(0,se.jsxs)(Ci,{children:[(0,se.jsx)(Id.default,{}),"Added"]}):(0,se.jsx)(Ci,{isAccent:!0,children:(0,se.jsx)(Jv.default,{})})]})}),f.passkey&&(0,se.jsx)(vc,{onClick:()=>m("passkey"),children:(0,se.jsx)(Md.default,{})})]},"passkey")]}),(0,se.jsx)(J,{})]})};var iC=y(require("@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon")),aC=y(require("@heroicons/react/24/outline/ClockIcon")),sC=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),lC=y(require("@heroicons/react/24/solid/CheckCircleIcon")),ti=require("react"),$s=y(require("styled-components"));var te=require("react/jsx-runtime"),cC=({onComplete:e,onClose:t,onReset:r})=>{let{user:o}=$(),{data:n}=P(),{initLinkWithPasskey:i,linkWithPasskey:a}=W(),{initEnrollmentWithPasskey:l,submitEnrollmentWithPasskey:s}=ho(),[c,m]=(0,ti.useState)(!1),[f,u]=(0,ti.useState)(!1),[C,v]=(0,ti.useState)(!1),[g,E]=(0,ti.useState)(null),S=(0,ti.useMemo)(()=>o?.linkedAccounts.filter(k=>k.type==="passkey")??[],[o]),R=()=>{n?.mfaEnrollmentFlow?.onSuccess(),e()},T=async k=>{m(!0);try{await l(),await s({credentialIds:k}),v(!0)}catch(M){E(M)}finally{m(!1)}},A=async()=>{u(!0),E(null);try{await i();let M=(await a())?.linkedAccounts.filter(D=>D.type==="passkey").map(D=>D.credentialId)??[];await T(M)}catch(k){E(k)}finally{u(!1)}};return S.length===0||f?(0,te.jsx)(hb,{onReset:r,onClose:t,onClick:A,isCreating:f}):C?(0,te.jsx)(gb,{onClick:R,onClose:R}):g?(0,te.jsx)(Ai,{error:g,backFn:()=>E(null),onClick:()=>E(null)}):(0,te.jsx)(yb,{passkeys:S,isSubmitting:c,isCreating:f,onReset:r,onClose:t,onSubmitEnrollment:()=>T(S.map(k=>k.credentialId)),onAddPasskey:A})},hb=({onReset:e,onClose:t,onClick:r,isCreating:o})=>(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(x,{backFn:e,onClose:t},"header"),(0,te.jsx)(Ye,{children:(0,te.jsxs)(ed,{children:[(0,te.jsx)(Ri,{}),(0,te.jsx)(Ii,{})]})}),(0,te.jsx)(Te,{children:"Set up passkey verification"}),(0,te.jsxs)(vi,{children:[(0,te.jsxs)(xr,{children:[(0,te.jsx)(Ar,{children:(0,te.jsx)(sC.default,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),(0,te.jsxs)(xr,{children:[(0,te.jsx)(Ar,{children:(0,te.jsx)(aC.default,{})}),"Takes seconds to set up and use"]}),(0,te.jsxs)(xr,{children:[(0,te.jsx)(Ar,{children:(0,te.jsx)(iC.default,{})}),"Use your passkey to verify transactions and login to your account"]})]}),(0,te.jsx)(H,{style:{marginTop:"2.25rem"},onClick:r,loading:o,children:"Add a new passkey"}),(0,te.jsx)(J,{})]}),yb=({onReset:e,onClose:t,onAddPasskey:r,onSubmitEnrollment:o,passkeys:n,isSubmitting:i,isCreating:a})=>{let[l,s]=(0,ti.useState)(!1),c=l?n.length:n.length>3?2:3;return(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(x,{backFn:l?()=>s(!1):e,onClose:t},"header"),!l&&(0,te.jsx)(Ye,{children:(0,te.jsxs)(ed,{children:[(0,te.jsx)(Ri,{}),(0,te.jsx)(Ii,{})]})}),(0,te.jsx)(Te,{children:"Enable your passkeys for verification"}),(0,te.jsxs)(vi,{children:[n.slice(0,c).map(m=>(0,te.jsxs)(vb,{children:[(0,te.jsx)(Cb,{children:bb(m)}),(0,te.jsxs)(wb,{children:["Last used: ",m.latestVerifiedAt?.toLocaleString()]})]},m.credentialId)),!l&&n.length>3&&(0,te.jsx)(nC,{onClick:()=>s(!0),children:"View All"})]}),(0,te.jsx)(H,{style:{marginTop:"1.5rem"},onClick:o,loading:i,children:"Enable passkeys"}),n.length<5&&(0,te.jsx)(nC,{style:{marginTop:"0.5rem"},onClick:r,disabled:a,children:a?(0,te.jsx)(At,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),(0,te.jsx)(J,{})]})},gb=({onClick:e,onClose:t})=>(0,te.jsxs)(te.Fragment,{children:[(0,te.jsx)(x,{onClose:t},"header"),(0,te.jsx)(Ye,{children:(0,te.jsx)(mt,{status:"success",children:(0,te.jsx)(lC.default,{})})}),(0,te.jsx)(Te,{children:"Passkey verification added"}),(0,te.jsx)(Pe,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),(0,te.jsx)(ir,{children:(0,te.jsx)(H,{onClick:e,children:"Done"})}),(0,te.jsx)(J,{})]}),vb=$s.default.div`
|
|
2222
2297
|
&& {
|
|
2223
2298
|
padding: 0.75rem 1rem;
|
|
2224
2299
|
text-align: left;
|
|
@@ -2226,19 +2301,19 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2226
2301
|
border: 1px solid var(--privy-color-foreground-4);
|
|
2227
2302
|
width: 100%;
|
|
2228
2303
|
}
|
|
2229
|
-
`,
|
|
2304
|
+
`,Cb=$s.default.div`
|
|
2230
2305
|
font-size: 0.875rem;
|
|
2231
2306
|
line-height: 1.375rem;
|
|
2232
2307
|
font-weight: 500;
|
|
2233
2308
|
|
|
2234
2309
|
color: var(--privy-color-foreground-1);
|
|
2235
|
-
`,
|
|
2310
|
+
`,wb=$s.default.div`
|
|
2236
2311
|
font-size: 0.75rem;
|
|
2237
2312
|
font-weight: 400;
|
|
2238
2313
|
line-height: 1.125rem;
|
|
2239
2314
|
|
|
2240
2315
|
color: var(--privy-color-foreground-2);
|
|
2241
|
-
`,
|
|
2316
|
+
`,bb=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",nC=$s.default.button`
|
|
2242
2317
|
&& {
|
|
2243
2318
|
width: 100%;
|
|
2244
2319
|
font-size: 0.875rem;
|
|
@@ -2263,7 +2338,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2263
2338
|
box-shadow: none;
|
|
2264
2339
|
}
|
|
2265
2340
|
}
|
|
2266
|
-
`;var
|
|
2341
|
+
`;var uC=y(require("@heroicons/react/24/solid/CheckCircleIcon")),Iu=y(require("@heroicons/react/24/solid/PhoneIcon")),js=require("react");var Wd=require("react"),pC=require("react-device-detect"),Ru=y(require("styled-components")),Xo=require("react/jsx-runtime"),Ks=6,Eb=new Array(Ks).fill("");function Tb(e){return e.replace(/\s+/g,"")}function ku(e){return/^[0-9]{1}$/.test(e)}function dC(e){return e.length===Ks&&e.every(ku)}function Sb(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var Li=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,i]=(0,Wd.useState)(Eb),[a,l]=(0,Wd.useState)(null),[s,c]=(0,Wd.useState)(null),m=async v=>{v.preventDefault();let g=Tb(v.currentTarget.value);if(g==="")return;let E=Sb(n,ku),S=g.split(""),R=!S.every(ku),T=S.length+E>Ks;if(R){l("Passcode can only be numbers"),c(1);return}if(T){l("Passcode must be exactly 6 numbers"),c(1);return}l(null),c(null);let A=Number(v.currentTarget.name?.charAt(4)),k=[...g||[""]].slice(0,Ks-A),M=[...n.slice(0,A),...k,...n.slice(A+k.length)];i(M);let D=k.length,G=Math.min(Math.max(A+D,0),Ks-1);if(document.querySelector(`input[name=pin-${G}]`)?.focus(),dC(M))try{await e(M.join("")),document.querySelector(`input[name=pin-${G}]`)?.blur()}catch(Z){c(1),l(Z.message)}else try{await e(null)}catch(Z){c(1),l(Z.message)}},f=v=>{s===1&&(l(null),c(null));let g=[...n.slice(0,v),"",...n.slice(v+1)];i(g),v>0&&document.querySelector(`input[name=pin-${v-1}]`)?.focus(),dC(g)?e(g.join("")):e(null)},C=o?"success":!!(r||a)?"fail":"";return(0,Xo.jsx)(Xo.Fragment,{children:(0,Xo.jsxs)(_b,{children:[(0,Xo.jsx)("div",{children:n.map((v,g)=>(0,Xo.jsx)("input",{name:`pin-${g}`,type:"text",value:n[g],onChange:m,onKeyUp:E=>{E.key==="Backspace"&&f(g)},inputMode:"numeric",autoFocus:g===0,pattern:"[0-9]",className:C,autoComplete:pC.isMobile?"one-time-code":"off",disabled:t},g))}),(0,Xo.jsx)("div",{children:(0,Xo.jsx)(Pb,{fail:!!r||!!a,children:r||a})})]})})},_b=Ru.default.div`
|
|
2267
2342
|
display: flex;
|
|
2268
2343
|
flex-direction: column;
|
|
2269
2344
|
width: 100%;
|
|
@@ -2331,7 +2406,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2331
2406
|
transform: translate(1px, 0px);
|
|
2332
2407
|
}
|
|
2333
2408
|
}
|
|
2334
|
-
`,
|
|
2409
|
+
`,Pb=Ru.default.div`
|
|
2335
2410
|
line-height: 20px;
|
|
2336
2411
|
font-size: 13px;
|
|
2337
2412
|
display: flex;
|
|
@@ -2339,7 +2414,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2339
2414
|
width: 100%;
|
|
2340
2415
|
|
|
2341
2416
|
color: ${e=>e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
|
|
2342
|
-
`;var be=require("react/jsx-runtime"),Bv=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=(0,Hs.useState)(""),[i,a]=(0,Hs.useState)(!1),[l,s]=(0,Hs.useState)(null),[c,m]=(0,Hs.useState)("enroll"),{initEnrollmentWithSms:f,submitEnrollmentWithSms:u}=uo(),{app:v,data:b}=_();function g(){b?.mfaEnrollmentFlow?.onSuccess(),e()}async function E({qualifiedPhoneNumber:S}){try{await f({phoneNumber:S}),n(S),m("verify")}catch(A){s(A)}}async function x(S){try{if(!S)return;await u({phoneNumber:o,mfaCode:S}),a(!0)}catch(A){throw Pc(A)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Dn(A)?new Error("The code you entered is not valid"):Nn(A)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):xc(A)?new Error("Verification canceled"):new Error("Unknown error")}}function k(){c==="verify"?m("enroll"):t()}return l?(0,be.jsx)(Ti,{error:l,backFn:()=>s(null),onClick:()=>s(null)}):c==="enroll"?(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(P,{backFn:t,onClose:r},"header"),(0,be.jsx)(Ye,{children:(0,be.jsx)(mt,{children:(0,be.jsx)(Cu.default,{})})}),(0,be.jsx)(Te,{children:"Set up SMS verification"}),(0,be.jsx)(Pe,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),(0,be.jsxs)(no,{children:[(0,be.jsx)(Ba,{onSubmit:E}),(0,be.jsxs)(Qh,{children:["By providing your mobile number, you agree to receive text messages from ",v?.name,". Some carrier charges may apply"]})]}),(0,be.jsx)(J,{})]}):i?(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(P,{onClose:g},"header"),(0,be.jsx)(Ye,{children:(0,be.jsx)(mt,{status:"success",children:(0,be.jsx)(Fv.default,{})})}),(0,be.jsx)(Te,{children:"SMS verification added"}),(0,be.jsx)(Pe,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),(0,be.jsx)(nr,{children:(0,be.jsx)(B,{onClick:g,children:"Done"})}),(0,be.jsx)(J,{})]}):(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(P,{backFn:k,onClose:r},"header"),(0,be.jsx)(Ye,{children:(0,be.jsx)(mt,{children:(0,be.jsx)(Cu.default,{})})}),(0,be.jsx)(Te,{children:"Enter enrollment code"}),(0,be.jsxs)(no,{children:[(0,be.jsx)(Ri,{onChange:x}),(0,be.jsxs)(Pe,{children:["To continue, enter the 6-digit code sent to ",(0,be.jsx)("strong",{children:q2(o)})]})]}),(0,be.jsx)(J,{})]})};var qv=y(require("@heroicons/react/24/solid/CheckCircleIcon")),zv=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),wu=require("react");var Hv=y(require("@heroicons/react/24/solid/ShieldCheckIcon"));var Gv=require("react/jsx-runtime");var Vv=({size:e,authUrl:t})=>(0,Gv.jsx)(qn,{url:t,squareLogoElement:Hv.default,size:e,fgColor:"#1F1F1F"});var _e=require("react/jsx-runtime"),$v=({onComplete:e,onClose:t,onReset:r,totpInfo:o})=>{let[n,i]=(0,wu.useState)("enroll"),[a,l]=(0,wu.useState)(!1),{submitEnrollmentWithTotp:s}=uo(),{data:c}=_();function m(){c?.mfaEnrollmentFlow?.onSuccess(),e()}function f(){i("verify")}async function u(b){try{if(!b)return;await s({mfaCode:b}),l(!0)}catch(g){throw Pc(g)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Dn(g)?new Error("The code you entered is not valid"):Nn(g)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):xc(g)?new Error("Verification canceled"):new Error("Unknown error")}}function v(){n==="verify"?i("enroll"):r()}return n==="enroll"?(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(P,{backFn:r,onClose:t},"header"),(0,_e.jsx)(Te,{children:"Scan QR code"}),(0,_e.jsx)(Pe,{children:"Open your authenticator app and scan the QR code to continue."}),(0,_e.jsx)(ca,{children:(0,_e.jsx)(Vv,{authUrl:o.authUrl,size:200})}),(0,_e.jsxs)(nr,{children:[(0,_e.jsx)(Kt,{children:(0,_e.jsx)(Gn,{itemName:"secret",text:o.secret})}),(0,_e.jsx)(B,{onClick:f,children:"Continue"})]}),(0,_e.jsx)(J,{})]}):a?(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(P,{onClose:m},"header"),(0,_e.jsx)(Ye,{children:(0,_e.jsx)(mt,{status:"success",children:(0,_e.jsx)(qv.default,{})})}),(0,_e.jsx)(Te,{children:"Authenticator app verification added"}),(0,_e.jsx)(Pe,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),(0,_e.jsx)(nr,{children:(0,_e.jsx)(B,{onClick:m,children:"Done"})}),(0,_e.jsx)(J,{})]}):(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(P,{backFn:v,onClose:t},"header"),(0,_e.jsx)(Ye,{children:(0,_e.jsx)(mt,{children:(0,_e.jsx)(zv.default,{})})}),(0,_e.jsx)(Te,{children:"Enter enrollment code"}),(0,_e.jsx)(no,{children:(0,_e.jsx)(Ri,{onChange:u})}),(0,_e.jsxs)(Pe,{children:["To continue, enter the 6-digit code generated from your ",(0,_e.jsx)("strong",{children:"authenticator app"})]}),(0,_e.jsx)(J,{})]})};var z=require("react/jsx-runtime"),Jv=()=>{let{user:e,enrollInMfa:t}=$(),[r,o]=(0,hn.useState)(null),{unenrollWithSms:n,unenrollWithTotp:i,unenrollWithPasskey:a}=uo(),{app:l,ready:s,data:c,onUserCloseViaDialogOrKeybindRef:m}=_(),{closePrivyModal:f}=W(),{promptMfa:u}=Ha(),{initEnrollmentWithTotp:v}=uo(),[b,g]=(0,hn.useState)(!1),[E,x]=(0,hn.useState)(null),[k,S]=(0,hn.useState)(null),A=()=>{f({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),x(null)},500)},{initEnrollmentWithPasskey:M,submitEnrollmentWithPasskey:I}=uo(),[U,H]=(0,hn.useState)(!1),[Y,Z]=(0,hn.useState)(null);m.current=A;let O=e?.mfaMethods.includes("sms"),D=!!e?.phone,L=e?.mfaMethods.includes("totp"),Me=e?.mfaMethods.includes("passkey"),je=O||L||Me,Q=e?.linkedAccounts.filter(ye=>ye.type==="passkey").map(ye=>ye.credentialId)??[];(0,hn.useEffect)(()=>{je&&g(!0)},[je]);function ae(){o(null),x(null)}function ie(){g(!1)}async function Fe(){H(!0);try{await M(),await I({credentialIds:Q})}catch(ye){Z(ye)}finally{H(!1)}}async function Ne(ye){if(await u().catch(Z),ye==="totp"){x(ye),S(null),v().then(gr=>{S(gr)}).catch(()=>{S(null),ae()});return}if(ye==="passkey"&&Q.length===1)return await Fe();x(ye)}if(!s||!e||!l)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(P,{onClose:A},"header"),(0,z.jsx)(Ye,{children:(0,z.jsx)(Sv,{})}),(0,z.jsx)(no,{children:(0,z.jsx)(Dt,{})}),(0,z.jsx)(J,{})]});async function ut(){o(null);try{await n()}catch{o(null)}}async function ct(){o(null);try{await i()}catch{o(null)}}async function Lt(){o(null);try{await u(),await a()}catch{o(null)}}if(r==="sms")return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(P,{backFn:ae,onClose:A},"header"),(0,z.jsx)(Ye,{children:(0,z.jsx)(mt,{children:(0,z.jsx)(Zv.default,{})})}),(0,z.jsx)(Te,{children:"Remove SMS verification?"}),(0,z.jsxs)(Pe,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),(0,z.jsx)(nr,{children:(0,z.jsx)(B,{warn:!0,onClick:ut,children:"Remove SMS for MFA"})}),(0,z.jsx)(J,{})]});if(r==="totp")return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(P,{backFn:ae,onClose:A},"header"),(0,z.jsx)(Ye,{children:(0,z.jsx)(mt,{children:(0,z.jsx)(jv.default,{})})}),(0,z.jsx)(Te,{children:"Remove Authenticator App verification?"}),(0,z.jsxs)(Pe,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),(0,z.jsx)(nr,{children:(0,z.jsx)(B,{warn:!0,onClick:ct,children:"Remove Authenticator App for MFA"})}),(0,z.jsx)(J,{})]});if(r==="passkey")return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(P,{backFn:ae,onClose:A},"header"),(0,z.jsx)(Ye,{children:(0,z.jsx)(mt,{children:(0,z.jsx)(Qv.default,{})})}),(0,z.jsx)(Te,{children:"Are you sure you want to remove passkey verification?"}),(0,z.jsx)(Pe,{children:"This will disable any passkeys you have set up for verification. You\u2019ll still be able to login with your passkeys if you\u2019ve set up passkey login."}),(0,z.jsx)(nr,{children:(0,z.jsx)(B,{warn:!0,onClick:Lt,children:"Yes, remove"})}),(0,z.jsx)(J,{})]});if(c.mfaEnrollmentFlow.mfaMethods.length===0&&!je)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(P,{onClose:A},"header"),(0,z.jsx)(Ye,{children:(0,z.jsx)(mt,{children:(0,z.jsx)(bu.default,{})})}),(0,z.jsx)(Te,{children:"Add more security"}),(0,z.jsxs)(Pe,{children:[l?.name," does not have any verification methods enabled."]}),(0,z.jsx)(nr,{children:(0,z.jsx)(B,{onClick:A,children:"Close"})}),(0,z.jsx)(J,{})]});let at=!je&&!b;return at?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(P,{onClose:A},"header"),(0,z.jsx)(Ye,{children:(0,z.jsx)(mt,{children:(0,z.jsx)(bu.default,{})})}),(0,z.jsx)(Te,{children:"Transaction Protection"}),(0,z.jsx)(Pe,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,z.jsxs)(hi,{children:[(0,z.jsxs)(_r,{children:[(0,z.jsx)(Sr,{children:(0,z.jsx)(Kv.default,{})}),"Enable 2-Step verification for your ",l?.name," wallet."]}),(0,z.jsxs)(_r,{children:[(0,z.jsx)(Sr,{children:(0,z.jsx)(Yv.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,z.jsxs)(nr,{children:[(0,z.jsx)(B,{onClick:()=>g(!0),children:"Continue"}),(0,z.jsx)(To,{onClick:A,children:"Not now"})]}),(0,z.jsx)(J,{})]}):E==="sms"?(0,z.jsx)(Bv,{onComplete:A,onReset:ae,onClose:A}):E==="totp"&&k?(0,z.jsx)($v,{onComplete:A,onClose:A,onReset:ae,totpInfo:k}):E==="passkey"?(0,z.jsx)(Nv,{onComplete:A,onReset:ae,onClose:A}):(0,z.jsx)(Rv,{showIntro:at,userMfaMethods:e.mfaMethods,appMfaMethods:l.mfa.methods,userHasAuthSms:D,onBackToIntro:ie,handleSelectMethod:Ne,isTotpLoading:E==="totp"&&!k,isPasskeyLoading:U,error:Y,onClose:A,setRemovingMfaMethod:o})};var E3=y(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),T3=y(require("@heroicons/react/24/outline/FingerPrintIcon")),S3=y(require("@heroicons/react/24/outline/PhoneIcon")),_3=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),P3=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),x3=y(require("@heroicons/react/24/solid/PhoneIcon")),Qn=require("react");var Mi=require("react"),g3=y(require("styled-components")),Ad=require("@privy-io/js-sdk-core");var Pu=y(require("styled-components"));var Eu=y(require("styled-components")),Vs=require("react/jsx-runtime"),Sd=({label:e,children:t,valueStyles:r})=>(0,Vs.jsxs)(V6,{children:[(0,Vs.jsx)("div",{children:e}),(0,Vs.jsx)(G6,{style:{...r},children:t})]}),V6=Eu.default.div`
|
|
2417
|
+
`;var be=require("react/jsx-runtime"),mC=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=(0,js.useState)(""),[i,a]=(0,js.useState)(!1),[l,s]=(0,js.useState)(null),[c,m]=(0,js.useState)("enroll"),{initEnrollmentWithSms:f,submitEnrollmentWithSms:u}=ho(),{app:C,data:v}=P();function g(){v?.mfaEnrollmentFlow?.onSuccess(),e()}async function E({qualifiedPhoneNumber:T}){try{await f({phoneNumber:T}),n(T),m("verify")}catch(A){s(A)}}async function S(T){try{if(!T)return;await u({phoneNumber:o,mfaCode:T}),a(!0)}catch(A){throw Wc(A)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Hn(A)?new Error("The code you entered is not valid"):Bn(A)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):Oc(A)?new Error("Verification canceled"):new Error("Unknown error")}}function R(){c==="verify"?m("enroll"):t()}return l?(0,be.jsx)(Ai,{error:l,backFn:()=>s(null),onClick:()=>s(null)}):c==="enroll"?(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(x,{backFn:t,onClose:r},"header"),(0,be.jsx)(Ye,{children:(0,be.jsx)(mt,{children:(0,be.jsx)(Iu.default,{})})}),(0,be.jsx)(Te,{children:"Set up SMS verification"}),(0,be.jsx)(Pe,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),(0,be.jsxs)(so,{children:[(0,be.jsx)(za,{onSubmit:E}),(0,be.jsxs)(dy,{children:["By providing your mobile number, you agree to receive text messages from ",C?.name,". Some carrier charges may apply"]})]}),(0,be.jsx)(J,{})]}):i?(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(x,{onClose:g},"header"),(0,be.jsx)(Ye,{children:(0,be.jsx)(mt,{status:"success",children:(0,be.jsx)(uC.default,{})})}),(0,be.jsx)(Te,{children:"SMS verification added"}),(0,be.jsx)(Pe,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),(0,be.jsx)(ir,{children:(0,be.jsx)(H,{onClick:g,children:"Done"})}),(0,be.jsx)(J,{})]}):(0,be.jsxs)(be.Fragment,{children:[(0,be.jsx)(x,{backFn:R,onClose:r},"header"),(0,be.jsx)(Ye,{children:(0,be.jsx)(mt,{children:(0,be.jsx)(Iu.default,{})})}),(0,be.jsx)(Te,{children:"Enter enrollment code"}),(0,be.jsxs)(so,{children:[(0,be.jsx)(Li,{onChange:S}),(0,be.jsxs)(Pe,{children:["To continue, enter the 6-digit code sent to ",(0,be.jsx)("strong",{children:gv(o)})]})]}),(0,be.jsx)(J,{})]})};var gC=y(require("@heroicons/react/24/solid/CheckCircleIcon")),vC=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),Mu=require("react");var fC=y(require("@heroicons/react/24/solid/ShieldCheckIcon"));var yC=require("react/jsx-runtime");var hC=({size:e,authUrl:t})=>(0,yC.jsx)(jn,{url:t,squareLogoElement:fC.default,size:e,fgColor:"#1F1F1F"});var _e=require("react/jsx-runtime"),CC=({onComplete:e,onClose:t,onReset:r,totpInfo:o})=>{let[n,i]=(0,Mu.useState)("enroll"),[a,l]=(0,Mu.useState)(!1),{submitEnrollmentWithTotp:s}=ho(),{data:c}=P();function m(){c?.mfaEnrollmentFlow?.onSuccess(),e()}function f(){i("verify")}async function u(v){try{if(!v)return;await s({mfaCode:v}),l(!0)}catch(g){throw Wc(g)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):Hn(g)?new Error("The code you entered is not valid"):Bn(g)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):Oc(g)?new Error("Verification canceled"):new Error("Unknown error")}}function C(){n==="verify"?i("enroll"):r()}return n==="enroll"?(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(x,{backFn:r,onClose:t},"header"),(0,_e.jsx)(Te,{children:"Scan QR code"}),(0,_e.jsx)(Pe,{children:"Open your authenticator app and scan the QR code to continue."}),(0,_e.jsx)(ma,{children:(0,_e.jsx)(hC,{authUrl:o.authUrl,size:200})}),(0,_e.jsxs)(ir,{children:[(0,_e.jsx)(jt,{children:(0,_e.jsx)(Kn,{itemName:"secret",text:o.secret})}),(0,_e.jsx)(H,{onClick:f,children:"Continue"})]}),(0,_e.jsx)(J,{})]}):a?(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(x,{onClose:m},"header"),(0,_e.jsx)(Ye,{children:(0,_e.jsx)(mt,{status:"success",children:(0,_e.jsx)(gC.default,{})})}),(0,_e.jsx)(Te,{children:"Authenticator app verification added"}),(0,_e.jsx)(Pe,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),(0,_e.jsx)(ir,{children:(0,_e.jsx)(H,{onClick:m,children:"Done"})}),(0,_e.jsx)(J,{})]}):(0,_e.jsxs)(_e.Fragment,{children:[(0,_e.jsx)(x,{backFn:C,onClose:t},"header"),(0,_e.jsx)(Ye,{children:(0,_e.jsx)(mt,{children:(0,_e.jsx)(vC.default,{})})}),(0,_e.jsx)(Te,{children:"Enter enrollment code"}),(0,_e.jsx)(so,{children:(0,_e.jsx)(Li,{onChange:u})}),(0,_e.jsxs)(Pe,{children:["To continue, enter the 6-digit code generated from your ",(0,_e.jsx)("strong",{children:"authenticator app"})]}),(0,_e.jsx)(J,{})]})};var z=require("react/jsx-runtime"),_C=()=>{let{user:e,enrollInMfa:t}=$(),[r,o]=(0,vn.useState)(null),{unenrollWithSms:n,unenrollWithTotp:i,unenrollWithPasskey:a}=ho(),{app:l,ready:s,data:c,onUserCloseViaDialogOrKeybindRef:m}=P(),{closePrivyModal:f}=W(),{promptMfa:u}=$a(),{initEnrollmentWithTotp:C}=ho(),[v,g]=(0,vn.useState)(!1),[E,S]=(0,vn.useState)(null),[R,T]=(0,vn.useState)(null),A=()=>{f({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),S(null)},500)},{initEnrollmentWithPasskey:k,submitEnrollmentWithPasskey:M}=ho(),[D,G]=(0,vn.useState)(!1),[Y,Z]=(0,vn.useState)(null);m.current=A;let L=e?.mfaMethods.includes("sms"),U=!!e?.phone,O=e?.mfaMethods.includes("totp"),Ie=e?.mfaMethods.includes("passkey"),je=L||O||Ie,Q=e?.linkedAccounts.filter(ge=>ge.type==="passkey").map(ge=>ge.credentialId)??[];(0,vn.useEffect)(()=>{je&&g(!0)},[je]);function re(){o(null),S(null)}function ae(){g(!1)}async function Fe(){G(!0);try{await k(),await M({credentialIds:Q})}catch(ge){Z(ge)}finally{G(!1)}}async function Ne(ge){if(await u().catch(Z),ge==="totp"){S(ge),T(null),C().then(Cr=>{T(Cr)}).catch(()=>{T(null),re()});return}if(ge==="passkey"&&Q.length===1)return await Fe();S(ge)}if(!s||!e||!l)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(x,{onClose:A},"header"),(0,z.jsx)(Ye,{children:(0,z.jsx)(Qv,{})}),(0,z.jsx)(so,{children:(0,z.jsx)(At,{})}),(0,z.jsx)(J,{})]});async function ut(){o(null);try{await n()}catch{o(null)}}async function lt(){o(null);try{await i()}catch{o(null)}}async function Nt(){o(null);try{await u(),await a()}catch{o(null)}}if(r==="sms")return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(x,{backFn:re,onClose:A},"header"),(0,z.jsx)(Ye,{children:(0,z.jsx)(mt,{children:(0,z.jsx)(TC.default,{})})}),(0,z.jsx)(Te,{children:"Remove SMS verification?"}),(0,z.jsxs)(Pe,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),(0,z.jsx)(ir,{children:(0,z.jsx)(H,{warn:!0,onClick:ut,children:"Remove SMS for MFA"})}),(0,z.jsx)(J,{})]});if(r==="totp")return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(x,{backFn:re,onClose:A},"header"),(0,z.jsx)(Ye,{children:(0,z.jsx)(mt,{children:(0,z.jsx)(bC.default,{})})}),(0,z.jsx)(Te,{children:"Remove Authenticator App verification?"}),(0,z.jsxs)(Pe,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),(0,z.jsx)(ir,{children:(0,z.jsx)(H,{warn:!0,onClick:lt,children:"Remove Authenticator App for MFA"})}),(0,z.jsx)(J,{})]});if(r==="passkey")return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(x,{backFn:re,onClose:A},"header"),(0,z.jsx)(Ye,{children:(0,z.jsx)(mt,{children:(0,z.jsx)(SC.default,{})})}),(0,z.jsx)(Te,{children:"Are you sure you want to remove passkey verification?"}),(0,z.jsx)(Pe,{children:"This will disable any passkeys you have set up for verification. You\u2019ll still be able to login with your passkeys if you\u2019ve set up passkey login."}),(0,z.jsx)(ir,{children:(0,z.jsx)(H,{warn:!0,onClick:Nt,children:"Yes, remove"})}),(0,z.jsx)(J,{})]});if(c.mfaEnrollmentFlow.mfaMethods.length===0&&!je)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(x,{onClose:A},"header"),(0,z.jsx)(Ye,{children:(0,z.jsx)(mt,{children:(0,z.jsx)(Wu.default,{})})}),(0,z.jsx)(Te,{children:"Add more security"}),(0,z.jsxs)(Pe,{children:[l?.name," does not have any verification methods enabled."]}),(0,z.jsx)(ir,{children:(0,z.jsx)(H,{onClick:A,children:"Close"})}),(0,z.jsx)(J,{})]});let at=!je&&!v;return at?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(x,{onClose:A},"header"),(0,z.jsx)(Ye,{children:(0,z.jsx)(mt,{children:(0,z.jsx)(Wu.default,{})})}),(0,z.jsx)(Te,{children:"Transaction Protection"}),(0,z.jsx)(Pe,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,z.jsxs)(vi,{children:[(0,z.jsxs)(xr,{children:[(0,z.jsx)(Ar,{children:(0,z.jsx)(wC.default,{})}),"Enable 2-Step verification for your ",l?.name," wallet."]}),(0,z.jsxs)(xr,{children:[(0,z.jsx)(Ar,{children:(0,z.jsx)(EC.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,z.jsxs)(ir,{children:[(0,z.jsx)(H,{onClick:()=>g(!0),children:"Continue"}),(0,z.jsx)(_o,{onClick:A,children:"Not now"})]}),(0,z.jsx)(J,{})]}):E==="sms"?(0,z.jsx)(mC,{onComplete:A,onReset:re,onClose:A}):E==="totp"&&R?(0,z.jsx)(CC,{onComplete:A,onClose:A,onReset:re,totpInfo:R}):E==="passkey"?(0,z.jsx)(cC,{onComplete:A,onReset:re,onClose:A}):(0,z.jsx)(oC,{showIntro:at,userMfaMethods:e.mfaMethods,appMfaMethods:l.mfa.methods,userHasAuthSms:U,onBackToIntro:ae,handleSelectMethod:Ne,isTotpLoading:E==="totp"&&!R,isPasskeyLoading:D,error:Y,onClose:A,setRemovingMfaMethod:o})};var YC=y(require("@heroicons/react/24/outline/DevicePhoneMobileIcon")),ZC=y(require("@heroicons/react/24/outline/FingerPrintIcon")),QC=y(require("@heroicons/react/24/outline/PhoneIcon")),JC=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),XC=y(require("@heroicons/react/24/solid/DevicePhoneMobileIcon")),e3=y(require("@heroicons/react/24/solid/PhoneIcon")),ri=require("react");var Ni=require("react"),qC=y(require("styled-components")),Ud=require("@privy-io/js-sdk-core");var Uu=y(require("styled-components"));var Ou=y(require("styled-components")),Ys=require("react/jsx-runtime"),Od=({label:e,children:t,valueStyles:r})=>(0,Ys.jsxs)(Ab,{children:[(0,Ys.jsx)("div",{children:e}),(0,Ys.jsx)(xb,{style:{...r},children:t})]}),Ab=Ou.default.div`
|
|
2343
2418
|
display: flex;
|
|
2344
2419
|
align-items: center;
|
|
2345
2420
|
justify-content: space-between;
|
|
@@ -2354,7 +2429,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2354
2429
|
color: var(--privy-color-foreground-2);
|
|
2355
2430
|
text-align: right;
|
|
2356
2431
|
}
|
|
2357
|
-
`,
|
|
2432
|
+
`,xb=Ou.default.div`
|
|
2358
2433
|
font-size: 14px;
|
|
2359
2434
|
line-height: 100%;
|
|
2360
2435
|
display: flex;
|
|
@@ -2363,28 +2438,28 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2363
2438
|
border-radius: var(--privy-border-radius-full);
|
|
2364
2439
|
background-color: var(--privy-color-background-2);
|
|
2365
2440
|
padding: 4px 8px;
|
|
2366
|
-
`;var
|
|
2441
|
+
`;var Zs=y(require("styled-components"));var en=require("react/jsx-runtime"),PC=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Ls(e),n=t?jo(o,t):void 0,i=zr(o,r);return(0,en.jsx)(AC,{children:n||i})},Lu=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Ls(e),n=t?jo(o,t):void 0,i=zr(o,r);return(0,en.jsx)(AC,{children:n?(0,en.jsxs)(en.Fragment,{children:[(0,en.jsx)(kb,{children:"USD"}),n==="<$0.01"?(0,en.jsxs)(Ib,{children:[(0,en.jsx)(Rb,{children:"<"}),"$0.01"]}):n]}):i})},AC=Zs.default.span`
|
|
2367
2442
|
font-size: 14px;
|
|
2368
2443
|
line-height: 140%;
|
|
2369
2444
|
display: flex;
|
|
2370
2445
|
gap: 4px;
|
|
2371
2446
|
align-items: center;
|
|
2372
|
-
`,
|
|
2447
|
+
`,kb=Zs.default.span`
|
|
2373
2448
|
font-size: 12px;
|
|
2374
2449
|
line-height: 12px;
|
|
2375
2450
|
color: var(--privy-color-foreground-3);
|
|
2376
|
-
`,
|
|
2451
|
+
`,Rb=Zs.default.span`
|
|
2377
2452
|
font-size: 10px;
|
|
2378
|
-
|
|
2453
|
+
`,Ib=Zs.default.span`
|
|
2379
2454
|
display: flex;
|
|
2380
2455
|
align-items: center;
|
|
2381
|
-
`;var
|
|
2456
|
+
`;var Ld=y(require("styled-components")),Nu=require("@privy-io/js-sdk-core");var Wr=require("react/jsx-runtime"),xC=({gas:e,tokenPrice:t,tokenSymbol:r})=>(0,Wr.jsxs)(Nn,{style:{paddingBottom:"12px"},children:[(0,Wr.jsxs)(RC,{children:[(0,Wr.jsx)(MC,{children:"Est. Fees"}),(0,Wr.jsx)("div",{children:(0,Wr.jsx)(Lu,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&(0,Wr.jsx)(IC,{children:`${zr(e,r)}`})]}),kC=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=(0,Nu.QuantityToBigNumber)(e.value||0).add((0,Nu.QuantityToBigNumber)(t)).toHexString();return(0,Wr.jsxs)(Nn,{children:[(0,Wr.jsxs)(RC,{children:[(0,Wr.jsx)(MC,{children:"Total (including fees)"}),(0,Wr.jsx)("div",{children:(0,Wr.jsx)(Lu,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&(0,Wr.jsx)(IC,{children:zr(n,o)})]})},RC=Ld.default.div`
|
|
2382
2457
|
display: flex;
|
|
2383
2458
|
flex-direction: row;
|
|
2384
2459
|
justify-content: space-between;
|
|
2385
2460
|
align-items: center;
|
|
2386
2461
|
padding-top: 4px;
|
|
2387
|
-
`,
|
|
2462
|
+
`,IC=Ld.default.div`
|
|
2388
2463
|
display: flex;
|
|
2389
2464
|
flex-direction: row;
|
|
2390
2465
|
height: 12px;
|
|
@@ -2393,23 +2468,23 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2393
2468
|
line-height: 12px;
|
|
2394
2469
|
color: var(--privy-color-foreground-3);
|
|
2395
2470
|
font-weight: 400;
|
|
2396
|
-
`,
|
|
2471
|
+
`,MC=Ld.default.div`
|
|
2397
2472
|
font-size: 14px;
|
|
2398
2473
|
line-height: 22.4px;
|
|
2399
2474
|
font-weight: 400;
|
|
2400
|
-
`;var
|
|
2475
|
+
`;var WC=y(require("@heroicons/react/24/outline/ChevronDownIcon")),tn=require("react"),Cn=y(require("styled-components"));var Nd=require("react"),Ka=(0,Nd.createContext)(void 0);var Qs=(0,Nd.createContext)(void 0);var Jt=require("react/jsx-runtime"),OC=({defaultValue:e,children:t})=>{let[r,o]=(0,tn.useState)(e||null),n=i=>{o(r===i?null:i)};return(0,Jt.jsx)(Ka.Provider,{value:{activePanel:r,togglePanel:n},children:(0,Jt.jsx)(Mb,{children:t})})},LC=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=(0,tn.useContext)(Ka),n=r===e;return(0,Jt.jsx)(Qs.Provider,{value:{onToggle:()=>o(e),value:e},children:(0,Jt.jsx)(Nb,{isActive:n,"data-open":n,children:t})})},NC=({children:e})=>{let{activePanel:t}=(0,tn.useContext)(Ka),{onToggle:r,value:o}=(0,tn.useContext)(Qs),n=t===o;return(0,Jt.jsxs)(Jt.Fragment,{children:[(0,Jt.jsxs)(Wb,{onClick:r,"data-open":n,children:[(0,Jt.jsx)(Lb,{children:e}),(0,Jt.jsx)(Ub,{isactive:n,children:(0,Jt.jsx)(WC.default,{height:"16px",width:"16px",strokeWidth:"2"})})]}),(0,Jt.jsx)(Ob,{})]})},DC=({children:e})=>{let{activePanel:t}=(0,tn.useContext)(Ka),{value:r}=(0,tn.useContext)(Qs);return(0,Jt.jsx)(Db,{"data-open":t===r,children:(0,Jt.jsx)(FC,{children:e})})},UC=({children:e})=>{let{activePanel:t}=(0,tn.useContext)(Ka),{value:r}=(0,tn.useContext)(Qs);return(0,Jt.jsx)(FC,{children:typeof e=="function"?e({isActive:t===r}):e})},Mb=Cn.default.div`
|
|
2401
2476
|
display: flex;
|
|
2402
2477
|
flex-direction: column;
|
|
2403
2478
|
width: 100%;
|
|
2404
2479
|
gap: 8px;
|
|
2405
|
-
`,
|
|
2480
|
+
`,Wb=Cn.default.div`
|
|
2406
2481
|
display: flex;
|
|
2407
2482
|
justify-content: space-between;
|
|
2408
2483
|
align-items: center;
|
|
2409
2484
|
width: 100%;
|
|
2410
2485
|
cursor: pointer;
|
|
2411
2486
|
padding-bottom: 8px;
|
|
2412
|
-
`,
|
|
2487
|
+
`,Ob=Cn.default.div`
|
|
2413
2488
|
width: 100%;
|
|
2414
2489
|
|
|
2415
2490
|
&& {
|
|
@@ -2417,13 +2492,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2417
2492
|
border-color: var(--privy-color-foreground-4);
|
|
2418
2493
|
}
|
|
2419
2494
|
padding-bottom: 12px;
|
|
2420
|
-
`,
|
|
2495
|
+
`,Lb=Cn.default.div`
|
|
2421
2496
|
font-size: 14px;
|
|
2422
2497
|
font-weight: 500;
|
|
2423
2498
|
line-height: 19.6px;
|
|
2424
2499
|
width: 100%;
|
|
2425
2500
|
padding-right: 8px;
|
|
2426
|
-
`,
|
|
2501
|
+
`,Nb=Cn.default.div`
|
|
2427
2502
|
display: flex;
|
|
2428
2503
|
flex-direction: column;
|
|
2429
2504
|
width: 100%;
|
|
@@ -2435,7 +2510,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2435
2510
|
border-color: var(--privy-color-foreground-4);
|
|
2436
2511
|
border-radius: var(--privy-border-radius-md);
|
|
2437
2512
|
}
|
|
2438
|
-
`,
|
|
2513
|
+
`,Db=Cn.default.div`
|
|
2439
2514
|
position: relative;
|
|
2440
2515
|
overflow: hidden;
|
|
2441
2516
|
transition: max-height 25ms ease-out;
|
|
@@ -2447,36 +2522,36 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2447
2522
|
&[data-open='false'] {
|
|
2448
2523
|
max-height: 0;
|
|
2449
2524
|
}
|
|
2450
|
-
`,
|
|
2525
|
+
`,FC=Cn.default.div`
|
|
2451
2526
|
display: flex;
|
|
2452
2527
|
flex-direction: column;
|
|
2453
2528
|
gap: 12px;
|
|
2454
2529
|
flex: 1 1 auto;
|
|
2455
2530
|
min-height: 1px;
|
|
2456
|
-
`,
|
|
2531
|
+
`,Ub=Cn.default.div`
|
|
2457
2532
|
transform: ${e=>e.isactive?"rotate(180deg)":"rotate(0deg)"};
|
|
2458
|
-
`;var
|
|
2533
|
+
`;var BC=y(require("styled-components"));var HC=require("react/jsx-runtime"),Du=({walletAddress:e,chainId:t=an})=>(0,HC.jsx)(Fb,{href:H1(t,e),target:"_blank",children:Mt(e)}),Fb=BC.default.a`
|
|
2459
2534
|
&:hover {
|
|
2460
2535
|
text-decoration: underline;
|
|
2461
2536
|
}
|
|
2462
|
-
`;var
|
|
2537
|
+
`;var Gt=require("react/jsx-runtime"),Dd=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=r?.value||0,s=dt();return(0,Gt.jsx)(OC,{...s.render.standalone?{defaultValue:"details"}:{},children:(0,Gt.jsxs)(LC,{value:"details",children:[(0,Gt.jsx)(NC,{children:(0,Gt.jsxs)(Bb,{children:[(0,Gt.jsx)("div",{children:o?.title||o?.actionDescription||"Details"}),(0,Gt.jsx)(Hb,{children:(0,Gt.jsx)(PC,{weiQuantities:[l],tokenPrice:n,tokenSymbol:a})})]})}),(0,Gt.jsxs)(DC,{children:[(0,Gt.jsx)(Od,{label:"From",children:(0,Gt.jsx)(Du,{walletAddress:e,chainId:r.chainId||an})}),(0,Gt.jsx)(Od,{label:"To",children:(0,Gt.jsx)(Du,{walletAddress:t,chainId:r.chainId||an})}),o&&o.action&&(0,Gt.jsx)(Od,{label:"Action",children:o.action}),i&&(0,Gt.jsx)(xC,{transactionData:r,gas:i,tokenPrice:n,tokenSymbol:a})]}),(0,Gt.jsx)(UC,{children:({isActive:c})=>(0,Gt.jsx)(kC,{transactionData:r,displayFee:c,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},Bb=Uu.default.div`
|
|
2463
2538
|
display: flex;
|
|
2464
2539
|
flex-direction: row;
|
|
2465
2540
|
justify-content: space-between;
|
|
2466
|
-
`,
|
|
2541
|
+
`,Hb=Uu.default.div`
|
|
2467
2542
|
flex-shrink: 0;
|
|
2468
2543
|
padding-left: 8px;
|
|
2469
|
-
`;var
|
|
2544
|
+
`;var GC=y(require("styled-components")),VC=GC.default.img`
|
|
2470
2545
|
&& {
|
|
2471
2546
|
height: ${e=>e.size==="sm"?"65px":"140px"};
|
|
2472
2547
|
width: ${e=>e.size==="sm"?"65px":"140px"};
|
|
2473
2548
|
border-radius: 16px;
|
|
2474
2549
|
margin-bottom: 12px;
|
|
2475
2550
|
}
|
|
2476
|
-
`;var
|
|
2551
|
+
`;var Fu=require("react/jsx-runtime"),Js=({pendingTransaction:e})=>{let{getAccessToken:t}=$(),{wallets:r}=mo(),{walletProxy:o,rpcConfig:n,chains:i,appId:a,nativeTokenSymbolForChainId:l}=W(),[s,c]=(0,Ni.useState)(null),[m,f]=(0,Ni.useState)(e),{tokenPrice:u}=Ko(m),C=l(e.chainId)||"ETH",v=(0,Ni.useMemo)(()=>r.find(g=>g.walletClientType==="privy"),[r]);return(0,Ni.useEffect)(()=>{async function g(){if(!await t()||!o||!v)return m;let S=Er(m.chainId,i,n,{appId:a}),R=await(0,Ud.populateTransactionRequest)(v.address,m,S),{totalGasEstimate:T}=await(0,Ud.calculateTotalGasEstimate)(R,S);return c(T.toHexString()),R}g().then(f).catch(console.error)},[o]),v?(0,Fu.jsx)(Gb,{children:(0,Fu.jsx)(Dd,{from:v.address,to:m.to,txn:m,gas:s??void 0,tokenPrice:u,tokenSymbol:C})}):null},Gb=qC.default.div`
|
|
2477
2552
|
width: 100%;
|
|
2478
2553
|
padding: 1rem 0;
|
|
2479
|
-
`;var
|
|
2554
|
+
`;var zC=y(require("@heroicons/react/24/outline/CalendarIcon")),$C=y(require("@heroicons/react/24/outline/ExclamationTriangleIcon")),KC=y(require("@heroicons/react/24/outline/ShieldCheckIcon"));var Xe=require("react/jsx-runtime"),jC=({hasBlockingError:e,error:t,onClose:r,onBack:o,handleSubmit:n,account:i,submitSuccess:a})=>{let{pendingTransaction:l}=W();return(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)(x,{onClose:r},"header"),(0,Xe.jsx)(vt,{children:(0,Xe.jsxs)("div",{children:[(0,Xe.jsx)(Pt,{success:a,fail:!!t}),t?(0,Xe.jsx)($C.default,{style:{width:"38px",height:"38px"}}):(0,Xe.jsx)(Ri,{style:{width:"38px",height:"38px"}})]})}),(0,Xe.jsx)(Te,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),(0,Xe.jsxs)(vi,{children:[(0,Xe.jsxs)(xr,{children:[(0,Xe.jsx)(Ar,{children:(0,Xe.jsx)(KC.default,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),(0,Xe.jsxs)(xr,{children:[(0,Xe.jsx)(Ar,{children:(0,Xe.jsx)(zC.default,{})}),"You last added a passkey on"," ",i?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),l&&(0,Xe.jsx)(so,{children:(0,Xe.jsx)(Js,{pendingTransaction:l})}),t&&(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)(bc,{style:{marginTop:"1.25rem"},children:t.message}),(0,Xe.jsx)(H,{disabled:e,onClick:n,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&(0,Xe.jsx)(bs,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),(0,Xe.jsx)(J,{})]})};var ie=require("react/jsx-runtime"),Bu=({open:e,onClose:t})=>{let{user:r}=$(),[o,n]=(0,ri.useState)(null),{init:i,cancel:a,submit:l}=$a(),[s,c]=(0,ri.useState)(!1),[m,f]=(0,ri.useState)(!1),[u,C]=(0,ri.useState)(null),[v,g]=(0,ri.useState)(null);(0,ri.useEffect)(()=>{e&&r?.mfaMethods&&r.mfaMethods.length>0?R(r.mfaMethods[0]):n(null)},[r?.mfaMethods,e]);let E=k=>Mc(k)?(c(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):Hn(k)?(c(!1),new Error("The code you entered is not valid")):Bn(k)?(c(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(k),c(!1),new Error("Something went wrong."));async function S(k){g(null);try{if(!k||!o)return;await l(o,k),f(!0),c(!1),t()}catch(M){throw E(M)}}async function R(k){if(k==="passkey"){try{n(k);let M=await i(k);if(!M)throw new Error("something went wrong");C(M),await l(k,M),f(!0),c(!1),t()}catch(M){g(E(M))}return}try{n(k),await i(k)}catch(M){console.error(M)}}let T=()=>{n(null),g(null),a(),t()},A=()=>{n(null),g(null)};if(!e||!r)return null;if(o==="passkey"){let k=r.linkedAccounts.filter(M=>M.type==="passkey"&&M.enrolledInMfa).sort((M,D)=>D.firstVerifiedAt.valueOf()-M.firstVerifiedAt.valueOf())[0];return(0,ie.jsx)(jC,{account:k,selectedMethod:o,submitSuccess:m,hasBlockingError:s,error:v,onClose:T,onBack:A,handleSubmit:()=>S(u).catch(g)})}return o?(0,ie.jsx)(Vb,{submitSuccess:m,hasBlockingError:s,handleSubmitCode:S,selectedMethod:o,onClose:T,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(x,{onClose:T},"header"),(0,ie.jsx)(Ye,{children:(0,ie.jsx)(mt,{children:(0,ie.jsx)(JC.default,{})})}),(0,ie.jsx)(Te,{children:"Verify your identity"}),(0,ie.jsx)(Pe,{children:"Choose a verification method"}),(0,ie.jsxs)(yc,{children:[r.mfaMethods.includes("totp")&&(0,ie.jsxs)(Oe,{onClick:()=>R("totp"),children:[(0,ie.jsx)(YC.default,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&(0,ie.jsxs)(Oe,{onClick:()=>R("sms"),children:[(0,ie.jsx)(QC.default,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&(0,ie.jsxs)(Oe,{onClick:()=>R("passkey"),children:[(0,ie.jsx)(ZC.default,{}),"Passkey"]},"passkey")]}),(0,ie.jsx)(J,{})]})},Vb=({selectedMethod:e,submitSuccess:t,hasBlockingError:r,onClose:o,onBack:n,handleSubmitCode:i})=>{let{app:a}=P(),{pendingTransaction:l}=W();switch(e){case"sms":return(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(x,{onClose:o},"header"),(0,ie.jsx)(Ye,{children:(0,ie.jsx)(mt,{children:(0,ie.jsx)(e3.default,{})})}),(0,ie.jsx)(Te,{children:"Enter verification code"}),(0,ie.jsxs)(so,{children:[(0,ie.jsx)(Li,{success:t,disabled:r,onChange:i}),(0,ie.jsxs)(Pe,{children:["To continue, please enter the 6-digit code sent to your ",(0,ie.jsx)("strong",{children:"mobile device"})]}),l&&(0,ie.jsx)(Js,{pendingTransaction:l})]}),n&&(0,ie.jsx)(bs,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),(0,ie.jsx)(_o,{onClick:o,children:"Not now"}),(0,ie.jsx)(J,{})]});case"totp":return(0,ie.jsxs)(ie.Fragment,{children:[(0,ie.jsx)(x,{onClose:o},"header"),(0,ie.jsx)(Ye,{children:(0,ie.jsx)(mt,{children:(0,ie.jsx)(XC.default,{})})}),(0,ie.jsx)(Te,{children:"Enter verification code"}),(0,ie.jsxs)(so,{children:[(0,ie.jsx)(Li,{success:t,disabled:r,onChange:i}),(0,ie.jsxs)(Pe,{children:["To continue, please enter the 6-digit code generated from your"," ",(0,ie.jsx)("strong",{children:"authenticator app"})]}),l&&(0,ie.jsx)(Js,{pendingTransaction:l})]}),n&&(0,ie.jsx)(bs,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),(0,ie.jsx)(_o,{onClick:o,children:"Not now"}),(0,ie.jsx)(J,{})]});default:return null}};var ja=require("react"),t3=y(require("styled-components"));var Vt=require("react/jsx-runtime"),r3=()=>{let{authenticated:e,logout:t,ready:r,user:o}=$(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=P(),{getAuthMeta:s,initLoginWithOAuth:c,loginWithOAuth:m,updateWallets:f,setReadyToTrue:u,closePrivyModal:C,createAnalyticsEvent:v}=W(),[g,E]=(0,ja.useState)(!1),[S,R]=(0,ja.useState)(void 0),T=s()?.provider||"google",{name:A,component:k}=us(T),M=da(),D=ot;(0,ja.useEffect)(()=>{m(T).then(Z=>{E(!0),u(!0),Z&&M("login","onOAuthLoginComplete",Z)}).catch(Z=>{if(u(!1),Z?.privyErrorCode==="allowlist_rejected"){R(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(Z?.privyErrorCode==="max_accounts_reached"){console.error(new ro(Z).toString()),R(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}if(Z?.privyErrorCode==="user_does_not_exist"){R(void 0),l(),a("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:L,detail:U}=Wf(Z,T);R({retryable:L,detail:U,message:"Authentication failed"})}).finally(()=>{mi()})},[A,T]),(0,ja.useEffect)(()=>{if(r&&e&&g&&o){if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let L=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},D);return()=>clearTimeout(L)}if(Sr(o,n?.embeddedWallets?.createOnLogin)){let L=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:U=>{console.error(U),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:U,provider:T,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},D);return()=>clearTimeout(L)}else{let L=setTimeout(()=>C({shouldCallAuthOnSuccess:!0,isSuccess:!0}),D);return f(),()=>clearTimeout(L)}}},[r,e,g,o]);let G=g?`Successfully connected with ${A}`:S?S.message:`Verifying connection to ${A}`,Y="";return g?Y="You\u2019re good to go!":S?Y=S.detail:Y="Just a few moments more",(0,Vt.jsxs)(Vt.Fragment,{children:[(0,Vt.jsx)(x,{}),(0,Vt.jsx)(de,{}),(0,Vt.jsxs)(qb,{children:[(0,Vt.jsx)(vt,{children:(0,Vt.jsxs)("div",{children:[(0,Vt.jsx)(Pt,{success:g,fail:!!S}),(0,Vt.jsx)(k,{style:{width:"38px",height:"38px"}})]})}),(0,Vt.jsxs)(pt,{children:[(0,Vt.jsx)("h3",{children:G}),(0,Vt.jsx)("p",{children:Y})]}),S&&S?.retryable?(0,Vt.jsx)(Ln,{onClick:()=>{mi(),c(T),R(void 0)},disabled:!g&&!S?.retryable,children:"Retry"}):null]}),(0,Vt.jsx)(me,{}),(0,Vt.jsx)(J,{})]})},qb=t3.default.div`
|
|
2480
2555
|
display: flex;
|
|
2481
2556
|
flex-direction: column;
|
|
2482
2557
|
align-items: center;
|
|
@@ -2484,17 +2559,17 @@ You will need this password to access your ${e} wallet on a new device. Please k
|
|
|
2484
2559
|
margin-left: 27px;
|
|
2485
2560
|
margin-right: 27px;
|
|
2486
2561
|
gap: 24px;
|
|
2487
|
-
`;var
|
|
2562
|
+
`;var wn=require("react"),Hu=y(require("styled-components"));var Xt=require("react/jsx-runtime"),o3=()=>{let{lastScreen:e,currentScreen:t,navigateBack:r}=P(),{loginWithPasskey:o,closePrivyModal:n}=W(),i=ot,[a,l]=(0,wn.useState)("loading"),[s,c]=(0,wn.useState)(null),m=(0,wn.useRef)([]),f=E=>{m.current=[E,...m.current]};(0,wn.useEffect)(()=>()=>{m.current.forEach(E=>clearTimeout(E)),m.current=[]},[]);let u=()=>{switch(a){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}},C=()=>{switch(a){case"loading":return`Please follow prompts to verify your passkey.
|
|
2488
2563
|
You will have to sign up with another method first to register a passkey for your account.`;case"success":return"You've successfully logged in with your passkey.";case"error":if(s instanceof wt){if(s.privyErrorCode==="cannot_link_more_of_type")return"Cannot link more passkeys to account.";if(s.privyErrorCode==="passkey_not_allowed")return`Passkey request timed out or rejected by user.
|
|
2489
2564
|
You will have to sign up with another method first to register a passkey for your account.`}return`An unknown error occurred.
|
|
2490
|
-
You will have to sign up with another method first to register a passkey for your account.`}},
|
|
2565
|
+
You will have to sign up with another method first to register a passkey for your account.`}},v=()=>{switch(a){case"loading":case"success":return(0,Xt.jsx)(H,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return(0,Xt.jsx)(H,{onClick:g,disabled:!1,children:"Retry"})}},g=async()=>{l("loading");try{await o(),l("success")}catch(E){c(E),l("error")}};return(0,wn.useEffect)(()=>{a==="success"&&f(setTimeout(()=>{n({shouldCallAuthOnSuccess:!0,isSuccess:!0})},i))},[a]),(0,wn.useEffect)(()=>{g()},[]),(0,Xt.jsxs)(Xt.Fragment,{children:[(0,Xt.jsx)(x,{backFn:!e||t===e?void 0:r}),(0,Xt.jsxs)(zb,{children:[(0,Xt.jsx)(vt,{children:(0,Xt.jsxs)("div",{children:[(0,Xt.jsx)(Pt,{success:a==="success",fail:a==="error"}),(0,Xt.jsx)(Ii,{style:{width:"38px",height:"38px"}})]})}),(0,Xt.jsxs)(pt,{children:[(0,Xt.jsx)("h3",{children:u()}),(0,Xt.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:C()})]}),v()]}),(0,Xt.jsx)(J,{})]})},zb=Hu.default.div`
|
|
2491
2566
|
display: flex;
|
|
2492
2567
|
flex-direction: column;
|
|
2493
2568
|
align-items: center;
|
|
2494
2569
|
justify-content: center;
|
|
2495
2570
|
gap: 24px;
|
|
2496
2571
|
width: 100%;
|
|
2497
|
-
`,
|
|
2572
|
+
`,CH=Hu.default.div`
|
|
2498
2573
|
display: flex;
|
|
2499
2574
|
align-items: center;
|
|
2500
2575
|
justify-content: center;
|
|
@@ -2510,9 +2585,9 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2510
2585
|
stroke: var(--privy-color-accent) !important;
|
|
2511
2586
|
fill: var(--privy-color-accent) !important;
|
|
2512
2587
|
}
|
|
2513
|
-
`;var
|
|
2588
|
+
`;var Xs=require("react"),a3=y(require("styled-components"));var n3=require("react-device-detect");var i3=(e,t)=>{let r=new URL(window.location.href),o=encodeURIComponent(r.href.replace(/\/$/g,"")+`?privy_token=${e}&privy_connector=injected&privy_wallet_client=phantom`);if(!An()&&n3.isMobile)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};var vr=require("react/jsx-runtime"),s3=()=>{let{forkSession:e,ready:t,authenticated:r}=$(),[o,n]=(0,Xs.useState)(""),[i,a]=(0,Xs.useState)(!1);(0,Xs.useEffect)(()=>{t&&r&&e().then(n)},[t,r]);let l=i3(o,!i),s={title:"Redirecting to Phantom Mobile Wallet",description:"We'll take you to the Phantom Mobile Wallet app to continue your login experience.",footnote:""};return t&&(s.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",s.footnote="Once you're done, you can always return here and refresh to view your updated account."),i&&(s.title="Still here?",s.description="You may need to install the Phantom mobile app.",s.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),(0,vr.jsxs)(vr.Fragment,{children:[(0,vr.jsx)(x,{},"header"),(0,vr.jsx)(de,{}),(0,vr.jsx)(Vo,{title:s.title,description:s.description}),(0,vr.jsxs)(lo,{children:[(0,vr.jsx)($b,{children:(0,vr.jsx)(Uo,{style:{width:"72px",height:"72px"}})}),(0,vr.jsx)(mc,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?(0,vr.jsx)("p",{children:s.footnote}):null]}),(0,vr.jsx)(me,{}),(0,vr.jsx)(K,{})]})},$b=(0,a3.default)(jt)`
|
|
2514
2589
|
margin: 16px auto;
|
|
2515
|
-
`;var
|
|
2590
|
+
`;var l3=y(require("@heroicons/react/24/outline/ShieldCheckIcon")),Di=require("react"),Ui=y(require("styled-components"));var it=require("react/jsx-runtime"),c3=()=>{let[e,t]=(0,Di.useState)(!0),{authenticated:r,getAccessToken:o}=$(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=W(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:c}=P(),[m,f]=(0,Di.useState)(void 0),[u,C]=(0,Di.useState)(""),[v,g]=(0,Di.useState)(!1),{privyWallet:E,onCompleteNavigateTo:S,onSuccess:R,onFailure:T}=s.recoverWallet,A=(D="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),T(typeof D=="string"?new ur(D):D)};c.current=A,(0,Di.useEffect)(()=>{if(!r||!E)return A("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let k=D=>{D&&f(D)};return(0,it.jsxs)(it.Fragment,{children:[(0,it.jsx)(x,{onClose:A}),(0,it.jsx)(de,{}),(0,it.jsxs)(jb,{children:[(0,it.jsxs)(Kb,{children:[(0,it.jsx)(l3.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,it.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),(0,it.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),(0,it.jsxs)("div",{children:[(0,it.jsxs)(qn,{children:[(0,it.jsx)(Ta,{type:e?"password":"text",onChange:D=>k(D.target.value),disabled:v,style:{paddingRight:"2.3rem"}}),(0,it.jsx)(Sa,{style:{right:"0.75rem"},children:e?(0,it.jsx)(_a,{onClick:()=>t(!1)}):(0,it.jsx)(Pa,{onClick:()=>t(!0)})})]}),!!u&&(0,it.jsx)(Yb,{children:u})]}),(0,it.jsxs)("div",{children:[(0,it.jsxs)(gy,{children:[(0,it.jsx)("h4",{children:"Why is this necessary?"}),(0,it.jsx)("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),(0,it.jsx)(Zb,{loading:v||!n,disabled:!m,onClick:async()=>{g(!0);let D=await o();if(D&&E&&m!==null)try{a({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:E.address}}),await n?.recover({address:E.address,accessToken:D,recoveryPin:m,recoveryMethod:E.recoveryMethod}),C(""),S?l(S):i({shouldCallAuthOnSuccess:!1}),R?.(E),a({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:E.address}})}catch(G){cg(G)?C("Invalid recovery password, please try again."):C("An error has occurred, please try again.")}finally{g(!1)}else return A("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!E&&v,children:"Recover your account"})]})]}),(0,it.jsx)(me,{}),(0,it.jsx)(K,{})]})},Kb=Ui.default.div`
|
|
2516
2591
|
display: flex;
|
|
2517
2592
|
flex-direction: column;
|
|
2518
2593
|
align-items: center;
|
|
@@ -2534,48 +2609,48 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2534
2609
|
font-weight: 400;
|
|
2535
2610
|
line-height: 20px;
|
|
2536
2611
|
}
|
|
2537
|
-
`,
|
|
2612
|
+
`,jb=Ui.default.div`
|
|
2538
2613
|
display: flex;
|
|
2539
2614
|
flex-direction: column;
|
|
2540
2615
|
justify-content: space-between;
|
|
2541
|
-
`,
|
|
2616
|
+
`,Yb=Ui.default.div`
|
|
2542
2617
|
line-height: 20px;
|
|
2543
2618
|
height: 20px;
|
|
2544
2619
|
font-size: 13px;
|
|
2545
2620
|
color: var(--privy-color-error);
|
|
2546
2621
|
text-align: left;
|
|
2547
2622
|
margin-top: 0.5rem;
|
|
2548
|
-
`,
|
|
2549
|
-
${e=>e.hideAnimations&&
|
|
2623
|
+
`,Zb=(0,Ui.default)(H)`
|
|
2624
|
+
${e=>e.hideAnimations&&Ui.css`
|
|
2550
2625
|
&& {
|
|
2551
2626
|
// Remove animations because the recoverWallet task on the iframe partially
|
|
2552
2627
|
// blocks the renderer, so the animation stutters and doesn't look good
|
|
2553
2628
|
transition: none;
|
|
2554
2629
|
}
|
|
2555
2630
|
`}
|
|
2556
|
-
`;var
|
|
2631
|
+
`;var bn=require("react");var oi=require("react/jsx-runtime"),Fd=e=>(0,oi.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...e,children:[(0,oi.jsx)("path",{fill:"url(#icloud-gradient)",d:"M12.34 7.315a4.26 4.26 0 0 0-3.707 2.18 2.336 2.336 0 0 0-1.02-.236 2.336 2.336 0 0 0-2.3 1.963 3.217 3.217 0 0 0 1.244 6.181c.135-.001.27-.01.404-.029h8.943c.047.004.094.006.141.007.045-.001.09-.004.135-.007h.214v-.016a2.99 2.99 0 0 0 1.887-.988c.487-.55.757-1.261.757-1.998v-.006a3.017 3.017 0 0 0-.69-1.915 2.992 2.992 0 0 0-1.748-1.034 4.26 4.26 0 0 0-4.26-4.102Z"}),(0,oi.jsx)("defs",{children:(0,oi.jsxs)("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[(0,oi.jsx)("stop",{stopColor:"#3E82F4"}),(0,oi.jsx)("stop",{offset:1,stopColor:"#93DCF7"})]})})]});var Xr=require("react/jsx-runtime"),Bd=({style:e,...t})=>(0,Xr.jsxs)("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,Xr.jsxs)("g",{clipPath:"url(#clip0_2115_829)",children:[(0,Xr.jsx)("path",{d:"M2.34709 12.9404L2.3471 12.9404L2.34565 12.938L1.64031 11.7448L1.64004 11.7444L0.651257 10.0677C0.640723 10.0496 0.630746 10.0314 0.621325 10.0129H4.16461L2.39424 13.0139C2.3775 12.9901 2.36178 12.9656 2.34709 12.9404Z",fill:"#0066DA",stroke:"#6366F1"}),(0,Xr.jsx)("path",{d:"M8 4.48713L5.47995 0.215332C5.23253 0.358922 5.02176 0.556358 4.87514 0.80764L0.219931 8.70508C0.076007 8.95094 0.000191627 9.22937 0 9.51277H5.04009L8 4.48713Z",fill:"#00AC47"}),(0,Xr.jsx)("path",{d:"M13.48 13.7847C13.7274 13.6411 13.9382 13.4437 14.0848 13.1924L14.3781 12.6988L15.7801 10.3206C15.9267 10.0693 16.0001 9.79114 16.0001 9.51294H10.9596L12.0321 11.577L13.48 13.7847Z",fill:"#EA4335"}),(0,Xr.jsx)("path",{d:"M8.00003 4.48718L10.5201 0.215385C10.2726 0.0717949 9.98857 0 9.69533 0H6.30472C6.01148 0 5.7274 0.0807692 5.47998 0.215385L8.00003 4.48718Z",fill:"#00832D"}),(0,Xr.jsx)("path",{d:"M10.9599 9.51294H5.04007L2.52002 13.7847C2.76744 13.9283 3.05152 14.0001 3.34476 14.0001H12.6552C12.9484 14.0001 13.2325 13.9194 13.4799 13.7847L10.9599 9.51294Z",fill:"#2684FC"}),(0,Xr.jsx)("path",{d:"M13.4525 4.75636L11.1249 0.80764C10.9782 0.556358 10.7675 0.358922 10.52 0.215332L8 4.48713L10.9599 9.51277H15.9908C15.9908 9.23456 15.9175 8.95636 15.7709 8.70508L13.4525 4.75636Z",fill:"#FFBA00"})]}),(0,Xr.jsx)("defs",{children:(0,Xr.jsx)("clipPath",{id:"clip0_2115_829",children:(0,Xr.jsx)("rect",{width:"16",height:"14",fill:"white"})})})]});var Gu=y(require("styled-components")),el=Gu.default.div`
|
|
2557
2632
|
display: flex;
|
|
2558
2633
|
flex-direction: column;
|
|
2559
2634
|
gap: 12px;
|
|
2560
2635
|
padding-top: 24px;
|
|
2561
2636
|
padding-bottom: 24px;
|
|
2562
|
-
`,
|
|
2637
|
+
`,d3=Gu.default.div`
|
|
2563
2638
|
padding-bottom: 24px;
|
|
2564
|
-
`;var
|
|
2639
|
+
`;var er=require("react/jsx-runtime"),p3={"google-drive":{name:"Google Drive",component:Bd},icloud:{name:"iCloud",component:Fd}},u3=()=>{let{logout:e}=$(),{navigate:t,setModalData:r,data:o}=P(),{recoveryOAuthFlow:n,closePrivyModal:i,createAnalyticsEvent:a}=W(),[l,s]=(0,bn.useState)(!1),{provider:c,action:m,isInAccountCreateFlow:f}=o?.recoveryOAuthStatus,[u,C]=(0,bn.useState)(void 0),[v,g]=(0,bn.useState)(m==="create-wallet");if(c==="user-passcode")throw new Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let E=p3[c].name,S=p3[c].component,R=o?.recoverWallet?.onCompleteNavigateTo,T=new rt(async(Z="create-wallet")=>(g(!0),new Promise((L,U)=>{setTimeout(async()=>{try{let O=window.open();await n(c,Z,O),s(!0),L()}catch{C({message:`${Z==="recover"?"Recovery":"Back up"} with ${E} unsuccessful`,detail:m==="recover"?`Please verify that you are selecting the ${E} account associated with your backup.`:"",retryable:!0}),U()}},0)})));(0,bn.useEffect)(()=>{m!=="recover"&&T.execute(f?"create-wallet":"set-recovery")},[]),(0,bn.useEffect)(()=>{if(!l)return;let Z=setTimeout(()=>{f?(r({createWallet:{onSuccess:()=>{},onFailure:L=>{a({eventName:"embedded_wallet_creation_failure_logout",payload:{error:L,screen:"RecoveryOAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_CREATED_SCREEN")):i({shouldCallAuthOnSuccess:!1})},ot);return()=>clearTimeout(Z)},[l]);let A=(0,bn.useCallback)(async()=>{await T.execute("recover"),R?t(R):s(!0)},[]),k=c==="google-drive"?"Google Drive":"Apple iCloud",M=m==="recover"?"recovered":"backed up",D=m==="recover"?"Recovering":"Backing up",G=l&&`Successfully ${M} with ${k}.`||u&&u.message||`${D} with ${k}...`,Y=u?u.detail:"";return(0,er.jsxs)(er.Fragment,{children:[(0,er.jsx)(x,{}),v?(0,er.jsx)(er.Fragment,{children:(0,er.jsxs)(el,{children:[(0,er.jsx)(xe,{title:G,icon:(0,er.jsx)(S,{style:{width:"38px",height:"38px"}}),description:Y}),u&&u?.retryable?(0,er.jsx)(H,{onClick:()=>{mi(),C(void 0),m==="create-wallet"?T.execute("create-wallet"):A()},disabled:!l&&!u?.retryable,children:"Try again"}):null]})}):(0,er.jsxs)(el,{children:[(0,er.jsx)(xe,{title:"Confirm it's really you",icon:(0,er.jsx)(S,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${k} where your account is backed up.`}),(0,er.jsxs)(H,{onClick:A,children:["Confirm with ",k]})]}),(0,er.jsx)(K,{})]})};var En=require("react");var f3=require("react/jsx-runtime"),m3=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=P(),[n,i]=(0,En.useState)(""),[a,l]=(0,En.useState)(!1),[s,c]=(0,En.useState)(),[m,f]=(0,En.useState)(null),{authenticated:u}=$(),{closePrivyModal:C,isNewUserThisSession:v,initializeWalletProxy:g}=W(),{onSuccess:E,onFailure:S,callAuthOnSuccessOnClose:R}=r.createWallet,{createWallet:T}=Uc(),[A,k]=(0,En.useState)(null),M=new rt(async()=>{try{let Y=await T(s);if(!Y)return;k(Y),v?t("EMBEDDED_WALLET_CREATED_SCREEN"):(E(Y),C({shouldCallAuthOnSuccess:R}))}catch(Y){i(Y.message)}});(0,En.useEffect)(()=>{m||g(3e4).then(Y=>f(Y))},[m]),(0,En.useEffect)(()=>{if(!u){t("LANDING"),S(new Error("User must be authenticated before creating a Privy wallet"));return}},[u]);let D=()=>{A&&A?.recoveryMethod!=="user-passcode"?(S(new ur("User created a wallet but failed to set a password for it")),C({shouldCallAuthOnSuccess:!1})):A?(E(A),C({shouldCallAuthOnSuccess:R})):(S(new ur("User wallet creation failed")),C({shouldCallAuthOnSuccess:!1}))};o.current=()=>null;let G=async()=>{l(!0);let Y=250;return M.execute().then(()=>new Promise(Z=>setTimeout(Z,Y))).finally(()=>l(!1))};return(0,f3.jsx)(Hc,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!m,buttonLoading:a,buttonHideAnimations:!A&&a,isResettingPassword:!1,error:n,password:s||"",onClose:D,onPasswordChange:c,onPasswordGenerate:()=>c(Bc()),onSubmit:G})};var h3=y(require("@heroicons/react/24/outline/LockClosedIcon")),y3=y(require("@heroicons/react/24/outline/PencilSquareIcon")),g3=y(require("@heroicons/react/24/outline/QuestionMarkCircleIcon")),v3=require("react"),C3=y(require("styled-components"));var Le=require("react/jsx-runtime"),Vu=C3.default.div`
|
|
2565
2640
|
width: 24px;
|
|
2566
2641
|
height: 24px;
|
|
2567
2642
|
display: flex;
|
|
2568
2643
|
justify-content: center;
|
|
2569
2644
|
align-items: center;
|
|
2570
|
-
`,
|
|
2645
|
+
`,Qb={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},Jb=({onClose:e})=>(0,Le.jsxs)(d3,{children:[(0,Le.jsx)(xe,{title:"Why do I need to secure my account?",icon:(0,Le.jsx)(g3.default,{width:48}),description:(0,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),(0,Le.jsx)("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It\u2019s important you don\u2019t lose access to the method you choose."})]})}),(0,Le.jsx)(H,{onClick:e,children:"Select backup method"})]}),w3=()=>{let[e,t]=(0,v3.useState)(!1),{navigate:r,setModalData:o,data:n}=P(),{user:i}=$(),{embeddedWallets:a}=dt(),l=Ae(i),s=l===null,{isInAccountCreateFlow:c,isResettingPassword:m}=n.recoverySelection,f=l?.recoveryMethod!=="privy",u=f?"Update backup method":"Secure your account",C=f?(0,Le.jsxs)("span",{children:["Your account is currently secured using"," ",(0,Le.jsx)("strong",{children:Qb[l?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function v(g){o({recoveryOAuthStatus:{provider:g,action:s?"create-wallet":"set-recovery",isInAccountCreateFlow:c}}),r("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")}return(0,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)(x,{backFn:e?()=>t(!1):void 0,infoFn:e?void 0:()=>t(!0)},"header"),e?(0,Le.jsx)(Jb,{onClose:()=>t(!1)}):(0,Le.jsxs)(Le.Fragment,{children:[(0,Le.jsx)(xe,{title:u,icon:(0,Le.jsx)(h3.default,{width:48}),description:C}),(0,Le.jsx)(el,{children:a.userOwnedRecoveryOptions.filter(g=>["icloud","google-drive"].includes(l?.recoveryMethod||"")?g!==l?.recoveryMethod:!0).sort().map(g=>{switch(g){case"google-drive":return(0,Le.jsxs)(Oe,{onClick:()=>v("google-drive"),children:[(0,Le.jsx)(Vu,{children:(0,Le.jsx)(Bd,{style:{width:18}})}),"Back up to Google Drive"]},g);case"icloud":return(0,Le.jsxs)(Oe,{onClick:()=>v("icloud"),children:[(0,Le.jsx)(Vu,{children:(0,Le.jsx)(Fd,{style:{width:24}})}),"Back up to Apple iCloud"]},g);case"user-passcode":return(0,Le.jsxs)(Oe,{onClick:()=>{let E=Xp({isCreatingWallet:s,skipSplashScreen:!0});r(E)},children:[(0,Le.jsx)(Vu,{children:(0,Le.jsx)(y3.default,{style:{width:18}})}),m?"Reset your":"Set a"," password"]},g);default:return null}})})]}),(0,Le.jsx)(K,{})]})};var $u=require("@ethersproject/address"),eo=require("react"),Qa=require("@privy-io/js-sdk-core");var b3=["FUNDING_METHOD_SELECTION_SCREEN","FUNDING_TRANSFER_FROM_WALLET_SCREEN","FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN","FUNDING_MANUAL_TRANSFER_SCREEN","MOONPAY_PROMPT_SCREEN","MOONPAY_STATUS_SCREEN"],E3={["FUNDING_METHOD_SELECTION_SCREEN"]:null,["FUNDING_TRANSFER_FROM_WALLET_SCREEN"]:"external",["FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"]:"external",["FUNDING_MANUAL_TRANSFER_SCREEN"]:"manual",["MOONPAY_PROMPT_SCREEN"]:"moonpay",["MOONPAY_STATUS_SCREEN"]:"moonpay"},Xb={moonpay:"MOONPAY_PROMPT_SCREEN","coinbase-onramp":"COINBASE_ONRAMP_STATUS_SCREEN",external:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};function Hd({fundingMethods:e}){if(e.length===0)throw new Error("Wallet funding is not enabled");return e.length===1?Xb[e[0]]:"FUNDING_METHOD_SELECTION_SCREEN"}var qu=y(require("styled-components"));var T3=y(require("styled-components")),Gd=T3.default.span`
|
|
2571
2646
|
color: var(--privy-color-foreground);
|
|
2572
2647
|
font-size: 1.125rem;
|
|
2573
2648
|
font-weight: 600;
|
|
2574
2649
|
line-height: 1.875rem; /* 166.667% */
|
|
2575
2650
|
text-align: center;
|
|
2576
|
-
`;var Ee=require("react/jsx-runtime"),
|
|
2651
|
+
`;var Ee=require("react/jsx-runtime"),S3=({img:e,submitError:t,prepareError:r,onClose:o,action:n,amount:i,title:a,subtitle:l,total:s,to:c,network:m,hasFunds:f,fee:u,from:C,cta:v,chain:g,isSubmitting:E,isPreparing:S,isTokenPriceLoading:R,isTokenContractInfoLoading:T,symbol:A,balance:k,onClick:M,spender:D})=>(0,Ee.jsxs)(Ee.Fragment,{children:[(0,Ee.jsx)(x,{onClose:o}),e&&(0,Ee.jsx)(oE,{children:e}),(0,Ee.jsx)(Gd,{style:{marginTop:e?"1.5rem":0},children:a}),(0,Ee.jsx)(Ga,{children:l}),(0,Ee.jsxs)(qc,{style:{marginTop:"2rem"},children:[s&&(0,Ee.jsxs)(Gr,{children:[(0,Ee.jsx)(Vr,{children:"Total"}),(0,Ee.jsx)(qr,{$isLoading:S||R,children:s})]}),n&&n!=="transaction"&&(0,Ee.jsxs)(Gr,{children:[(0,Ee.jsx)(Vr,{children:"Action"}),(0,Ee.jsx)(qr,{children:n})]}),i?(0,Ee.jsxs)(Gr,{children:[(0,Ee.jsx)(Vr,{children:"Amount"}),(0,Ee.jsxs)(qr,{$isLoading:T,children:[rE(i)," ",A]})]}):null,D?(0,Ee.jsxs)(Gr,{children:[(0,Ee.jsx)(Vr,{children:"Spender"}),(0,Ee.jsx)(qr,{children:(0,Ee.jsx)(Fs,{address:D,url:g?.blockExplorers?.default?.url,showCopyIcon:!1})})]}):null,c&&(0,Ee.jsxs)(Gr,{children:[(0,Ee.jsx)(Vr,{children:"To"}),(0,Ee.jsx)(qr,{children:(0,Ee.jsx)(Fs,{address:c,url:g?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),(0,Ee.jsxs)(Gr,{children:[(0,Ee.jsx)(Vr,{children:"Network"}),(0,Ee.jsx)(qr,{children:m})]}),(0,Ee.jsxs)(Gr,{children:[(0,Ee.jsx)(Vr,{children:"Estimated fee"}),(0,Ee.jsx)(qr,{$isLoading:S||R,children:u})]})]}),(0,Ee.jsx)(Ho,{}),t?(0,Ee.jsx)(Ds,{style:{marginTop:"2rem"},children:t.message}):r?(0,Ee.jsx)(Ds,{style:{marginTop:"2rem"},children:tE}):null,(0,Ee.jsx)(eE,{$useSmallMargins:!!(r||t),address:C,balance:k,isLoading:S||R,errMsg:!S&&!r&&!t&&!f?`Add funds on ${g?.name} to complete transaction.`:void 0}),(0,Ee.jsx)(uc,{style:{marginTop:"1rem"},loading:E,onClick:M,children:v}),(0,Ee.jsx)(K,{})]}),eE=(0,qu.default)(sd)`
|
|
2577
2652
|
${e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;"}
|
|
2578
|
-
`,
|
|
2653
|
+
`,tE="There was an error preparing your transaction. Your transaction request will likely fail.",rE=e=>e.toLocaleString(),oE=qu.default.div`
|
|
2579
2654
|
display: flex;
|
|
2580
2655
|
width: 100%;
|
|
2581
2656
|
justify-content: center;
|
|
@@ -2585,12 +2660,12 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2585
2660
|
object-fit: contain;
|
|
2586
2661
|
border-radius: var(--privy-border-radius-sm);
|
|
2587
2662
|
}
|
|
2588
|
-
`;var
|
|
2663
|
+
`;var Ya=require("@heroicons/react/24/outline"),R3=require("react"),Or=y(require("styled-components"));var tl=require("@ethersproject/logger"),nE=new Set([tl.ErrorCode.CALL_EXCEPTION,tl.ErrorCode.NONCE_EXPIRED,tl.ErrorCode.REPLACEMENT_UNDERPRICED,tl.ErrorCode.TRANSACTION_REPLACED]),_3=e=>{let t;return e.code&&e.code!==-32e3&&nE.has(e.code)&&(t=e.transactionHash),t},P3=e=>e.code==="SERVER_ERROR"?e.error?.message??e.reason??e.message??"unknown error":e.error?.code==="SERVER_ERROR"?e.error?.error?.message??e.reason??e.message??"unknown error":e.reason??e.message??"unknown error";var et=require("react/jsx-runtime"),iE=e=>{let t=e.code?e.code?.toString().charAt(0)+e.code?.toString().slice(1).replace("_"," ").toLowerCase():"Something went wrong.",r=_3(e),o=P3(e);return{errorCode:t,transactionHash:r,errorMessage:o}},aE=()=>(0,et.jsxs)(dE,{children:[(0,et.jsx)(uE,{}),(0,et.jsx)(pE,{})]}),I3=({transactionError:e,chainId:t,onClose:r,onRetry:o})=>{let{chains:n}=W(),[i,a]=(0,R3.useState)(!1),{errorCode:l,transactionHash:s,errorMessage:c}=iE(e),m=n.find(f=>f.id===t)?.blockExplorers?.default.url??"https://etherscan.io";return(0,et.jsxs)(et.Fragment,{children:[(0,et.jsx)(x,{onClose:r}),(0,et.jsxs)(sE,{children:[(0,et.jsx)(aE,{}),(0,et.jsx)(lE,{children:l}),(0,et.jsx)(cE,{children:"Please try again."}),(0,et.jsxs)(x3,{children:[(0,et.jsx)(A3,{children:"Error message"}),(0,et.jsx)(k3,{clickable:!1,children:c})]}),s&&(0,et.jsxs)(x3,{children:[(0,et.jsx)(A3,{children:"Transaction hash"}),(0,et.jsxs)(fE,{children:["Copy this hash to view details about the transaction on a"," ",(0,et.jsx)("u",{children:(0,et.jsx)("a",{href:m,children:"block explorer"})}),"."]}),(0,et.jsxs)(k3,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(s),a(!0)},children:[s,(0,et.jsx)(gE,{clicked:i})]})]}),(0,et.jsx)(mE,{onClick:()=>o({resetNonce:!!s}),children:"Retry transaction"})]}),(0,et.jsx)(J,{})]})},sE=Or.default.div`
|
|
2589
2664
|
display: flex;
|
|
2590
2665
|
flex-direction: column;
|
|
2591
2666
|
align-items: center;
|
|
2592
2667
|
justify-content: center;
|
|
2593
|
-
`,
|
|
2668
|
+
`,lE=Or.default.span`
|
|
2594
2669
|
color: var(--privy-color-foreground);
|
|
2595
2670
|
text-align: center;
|
|
2596
2671
|
font-size: 1.125rem;
|
|
@@ -2598,7 +2673,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2598
2673
|
line-height: 1.25rem; /* 111.111% */
|
|
2599
2674
|
text-align: center;
|
|
2600
2675
|
margin: 10px;
|
|
2601
|
-
`,
|
|
2676
|
+
`,cE=Or.default.span`
|
|
2602
2677
|
margin-top: 4px;
|
|
2603
2678
|
margin-bottom: 10px;
|
|
2604
2679
|
color: var(--privy-color-foreground-3);
|
|
@@ -2609,7 +2684,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2609
2684
|
font-weight: 400;
|
|
2610
2685
|
line-height: 20px; /* 142.857% */
|
|
2611
2686
|
letter-spacing: -0.008px;
|
|
2612
|
-
`,
|
|
2687
|
+
`,dE=Or.default.div`
|
|
2613
2688
|
position: relative;
|
|
2614
2689
|
width: 60px;
|
|
2615
2690
|
height: 60px;
|
|
@@ -2617,37 +2692,37 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2617
2692
|
display: flex;
|
|
2618
2693
|
justify-content: center;
|
|
2619
2694
|
align-items: center;
|
|
2620
|
-
`,
|
|
2695
|
+
`,pE=(0,Or.default)(Ya.ExclamationCircleIcon)`
|
|
2621
2696
|
position: absolute;
|
|
2622
2697
|
width: 35px;
|
|
2623
2698
|
height: 35px;
|
|
2624
2699
|
color: var(--privy-color-error);
|
|
2625
|
-
`,
|
|
2700
|
+
`,uE=Or.default.div`
|
|
2626
2701
|
position: absolute;
|
|
2627
2702
|
width: 60px;
|
|
2628
2703
|
height: 60px;
|
|
2629
2704
|
border-radius: 50%;
|
|
2630
2705
|
background-color: var(--privy-color-error);
|
|
2631
2706
|
opacity: 0.1;
|
|
2632
|
-
`,
|
|
2707
|
+
`,mE=(0,Or.default)(H)`
|
|
2633
2708
|
&& {
|
|
2634
2709
|
margin-top: 24px;
|
|
2635
2710
|
}
|
|
2636
2711
|
transition: color 350ms ease, background-color 350ms ease;
|
|
2637
|
-
`,
|
|
2712
|
+
`,A3=Or.default.span`
|
|
2638
2713
|
width: 100%;
|
|
2639
2714
|
text-align: left;
|
|
2640
2715
|
font-size: 0.825rem;
|
|
2641
2716
|
color: var(--privy-color-foreground);
|
|
2642
2717
|
padding: 4px;
|
|
2643
|
-
`,
|
|
2718
|
+
`,x3=Or.default.div`
|
|
2644
2719
|
width: 100%;
|
|
2645
2720
|
margin: 5px;
|
|
2646
2721
|
display: flex;
|
|
2647
2722
|
flex-direction: column;
|
|
2648
2723
|
justify-content: center;
|
|
2649
2724
|
align-items: center;
|
|
2650
|
-
`,
|
|
2725
|
+
`,fE=Or.default.text`
|
|
2651
2726
|
position: relative;
|
|
2652
2727
|
width: 100%;
|
|
2653
2728
|
padding: 5px;
|
|
@@ -2655,7 +2730,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2655
2730
|
color: var(--privy-color-foreground-3);
|
|
2656
2731
|
text-align: left;
|
|
2657
2732
|
word-wrap: break-word;
|
|
2658
|
-
`,
|
|
2733
|
+
`,k3=Or.default.span`
|
|
2659
2734
|
position: relative;
|
|
2660
2735
|
width: 100%;
|
|
2661
2736
|
background-color: var(--privy-color-background-2);
|
|
@@ -2673,24 +2748,24 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2673
2748
|
&:hover {
|
|
2674
2749
|
background-color: var(--privy-color-foreground-4);
|
|
2675
2750
|
}`}
|
|
2676
|
-
`,
|
|
2751
|
+
`,hE=(0,Or.default)(Ya.ClipboardDocumentIcon)`
|
|
2677
2752
|
position: absolute;
|
|
2678
2753
|
top: 13px;
|
|
2679
2754
|
right: 13px;
|
|
2680
2755
|
width: 24px;
|
|
2681
2756
|
height: 24px;
|
|
2682
|
-
`,
|
|
2757
|
+
`,yE=(0,Or.default)(Ya.ClipboardDocumentCheckIcon)`
|
|
2683
2758
|
position: absolute;
|
|
2684
2759
|
top: 13px;
|
|
2685
2760
|
right: 13px;
|
|
2686
2761
|
width: 24px;
|
|
2687
2762
|
height: 24px;
|
|
2688
|
-
`,
|
|
2763
|
+
`,gE=({clicked:e})=>e?(0,et.jsx)(yE,{}):(0,et.jsx)(hE,{});var Vd=require("@ethersproject/bignumber"),M3=y(require("styled-components"));var yo=require("react/jsx-runtime"),vE=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=Vd.BigNumber.from(e.gasUsed),o=Vd.BigNumber.from(e.effectiveGasPrice),n=r.mul(o);if(t){let i=Vd.BigNumber.from(t);n=n.add(i)}return n.toString()}catch{return}else return},W3=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a,receiptHeader:l,receiptDescription:s})=>(0,yo.jsxs)(yo.Fragment,{children:[(0,yo.jsx)(x,{onClose:o}),(0,yo.jsx)(wi,{title:l??"Transaction complete!",description:s??"You're all set."}),(0,yo.jsx)(Dd,{tokenPrice:n,from:t.from,to:t.to,gas:vE(t,a),txn:e,transactionInfo:r,tokenSymbol:i}),(0,yo.jsx)(Ho,{}),(0,yo.jsx)(CE,{loading:!1,onClick:o,children:"All Done"}),(0,yo.jsx)(me,{}),(0,yo.jsx)(K,{})]}),CE=(0,M3.default)(H)`
|
|
2689
2764
|
&& {
|
|
2690
2765
|
margin-top: 24px;
|
|
2691
2766
|
}
|
|
2692
2767
|
transition: color 350ms ease, background-color 350ms ease;
|
|
2693
|
-
`;var
|
|
2768
|
+
`;var qd=require("viem");var wE=(e,t)=>Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(e/Math.pow(10,t)),O3=[{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],L3=async({address:e,chain:t,amount:r,rpcConfig:o,privyAppId:n})=>{if(!r)return{value:"",symbol:""};try{let i=(0,qd.createPublicClient)({chain:t,transport:(0,qd.http)(lp(t,o,n))}),[a,l]=await Promise.all([i.readContract({abi:O3,address:e,functionName:"symbol"}),i.readContract({abi:O3,address:e,functionName:"decimals"})]);return{value:wE(parseFloat(r.toString()),l),symbol:a}}catch(i){return console.log(i),{value:r.toString(),symbol:""}}};var zu=require("viem"),N3=e=>{let t=EE(e);if(t)return{action:"approve",isErc20Ish:!0,functionName:t.functionName,spender:t.args[0],amount:t.args[1]};let r=SE(e);return r?{action:"transfer",isErc20Ish:!0,functionName:r.functionName,amount:r.args[1]}:{action:"transaction",isErc20Ish:!1}},bE=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],EE=e=>{try{return(0,zu.decodeFunctionData)({abi:bE,data:e})}catch{return null}},TE=[{constant:!1,inputs:[{name:"to",type:"address"},{name:"value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],SE=e=>{try{return(0,zu.decodeFunctionData)({abi:TE,data:e})}catch{return null}};var D3=require("@ethersproject/bignumber"),zd=require("react"),$d=require("@privy-io/js-sdk-core");var U3=(e,t)=>{let[r,o]=(0,zd.useState)(null),{getAccessToken:n,user:i}=$(),{walletProxy:a}=W(),l=Ae(i),s=async()=>{if(!await n()||!a||!l)return null;let m=[],f=await(0,$d.populateTransactionRequest)(l.address,e,t).catch(E=>(m.push(E),e)),{totalGasEstimate:u,l1ExecutionFeeEstimate:C}=await(0,$d.calculateTotalGasEstimate)(f,t).catch(E=>(m.push(E),{totalGasEstimate:null,l1ExecutionFeeEstimate:null})),{balance:v,hasSufficientFunds:g}=await Wa(l.address,f,u??D3.BigNumber.from(0),t).catch(E=>(m.push(E),{balance:null,hasSufficientFunds:!1}));return{tx:f,totalGasEstimate:u,l1ExecutionFeeEstimate:C,balance:v,hasFunds:g,errors:m}};return(0,zd.useEffect)(()=>{r&&o(null),s().then(o)},[e]),r};var Za=require("react/jsx-runtime"),F3=new Kt(new oo("There was an issue preparing your transaction",Qa.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode)),B3=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t,setModalData:r,navigate:o}=P(),{rpcConfig:n,chains:i,closePrivyModal:a,walletProxy:l}=W(),{getAccessToken:s,user:c}=$(),{wallets:m}=mo(),f=dt(),[u,C]=(0,eo.useState)(e?.sendTransaction?.transactionRequest),[v,g]=(0,eo.useState)(null),[E,S]=(0,eo.useState)(!1),[R,T]=(0,eo.useState)(null),[A,k]=(0,eo.useState)(null);if(!u||!e?.sendTransaction)return(0,Za.jsx)(Ai,{error:new Error("Invalid transaction request"),onClick:()=>{e?.sendTransaction?.onFailure(F3),a({shouldCallAuthOnSuccess:!1})}});let M=(0,eo.useMemo)(()=>u.from?m.find(q=>(0,$u.getAddress)(q.address)===(0,$u.getAddress)(u.from)):Ae(c),[u.from]),D=(0,eo.useMemo)(()=>i.find(q=>Number(q.id)===Number(u.chainId)),[u.chainId]),G=D?.nativeCurrency.symbol??"ETH",{action:Y,amount:Z,spender:L,isErc20Ish:U}=(0,eo.useMemo)(()=>N3(u.data),[u.data]);(0,eo.useEffect)(()=>{u.to&&D&&U&&L3({amount:Z,address:u.to,chain:D,rpcConfig:f.rpcConfig,privyAppId:f.id}).then(g).catch(console.error)},[u.to,Z,D]);let{tokenPrice:O,isTokenPriceLoading:Ie}=Ko(u),je=(0,eo.useMemo)(()=>Er(Number(u.chainId),i,n,{appId:f.id}),[u.chainId,n]),Q=U3(u,je),re=()=>{if(!E)return R?(e?.sendTransaction?.onSuccess(R.response),a({shouldCallAuthOnSuccess:!1})):!A&&!Q?.errors[0]?(e?.sendTransaction?.onFailure(new Kt(new oo("The user rejected the request",Qa.ProviderErrors.E4001_USER_REJECTED_REQUEST.eipCode))),a({shouldCallAuthOnSuccess:!1})):(e?.sendTransaction?.onFailure(A??Q?.errors[0]??F3),a({shouldCallAuthOnSuccess:!1}))};t.current=re;let ae=async()=>{S(!0);try{let q=await s();if(E||!q||!M||!l)return;let fe=await zc(q,M.address,l,Q?.tx??u,je,e.sendTransaction?.requesterAppId),Dt=await fe.wait();T({receipt:$c(Dt),response:fe})}catch(q){console.warn({transaction:Q?.tx??u,error:q}),k(q)}finally{S(!1)}},Fe=async()=>{if(!Ae(c))return;if(!f.fundingConfig||f.fundingConfig.methods.length===0||!e.funding)throw new Error("Funding wallet is not enabled");let fe=Hd({fundingMethods:f.fundingConfig?.methods});r({...e,funding:{...e?.funding,methodScreen:fe}}),o(fe)},Ne=f.embeddedWallets.priceDisplay.primary==="fiat-currency",ut=(0,Qa.QuantityToBigNumber)(Q?.tx.value??0).add((0,Qa.QuantityToBigNumber)(Q?.totalGasEstimate?.toBigInt()??0)).toHexString(),lt=zr(ut,G),Nt=Ne&&O?jo(ut,O):void 0,at=zr(Q?.totalGasEstimate?.toString()??0,G),ge=Ne&&O?jo(Q?.totalGasEstimate?.toString()??0,O):void 0,Cr=zr(Q?.balance?.toString()??0,G,void 0,!0),go=Ne&&O?jo(Q?.balance?.toString()??0,O):void 0,Lo=e.sendTransaction?.uiOptions?.transactionInfo?.title||(Y==="approve"?"Confirm address":`Approve ${Y}`),N=e.sendTransaction?.uiOptions?.description||`${f.name} wants your permission to approve the following transaction.`,_t=e.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?(0,Za.jsx)("img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,vo=Q&&!Q.errors[0]&&!Q.hasFunds&&f.fundingConfig&&f.fundingConfig.methods.length>0,V=vo?"Add funds":e.sendTransaction?.uiOptions?.buttonText||"Approve";return R?.receipt?(0,Za.jsx)(W3,{txn:Q?.tx??u,onClose:re,receipt:R.receipt,transactionInfo:e.sendTransaction?.uiOptions.transactionInfo,tokenPrice:O,tokenSymbol:G,l1GasEstimate:Q?.l1ExecutionFeeEstimate?.toString(),receiptHeader:e.sendTransaction?.uiOptions.successHeader,receiptDescription:e.sendTransaction?.uiOptions.successDescription}):A?(0,Za.jsx)(I3,{transactionError:A,chainId:Q?.tx.chainId??u.chainId,onClose:re,onRetry:({resetNonce:q})=>{k(null);let fe={...Q?.tx??u};q&&(fe.nonce=void 0),C(fe)}}):(0,Za.jsx)(S3,{isSubmitting:E,submitError:A,isPreparing:!Q,isTokenPriceLoading:Ie,isTokenContractInfoLoading:!v,prepareError:Q?.errors[0],symbol:v?.symbol,chain:D,img:_t,title:Lo,subtitle:N,spender:L,total:u.value?Nt??lt:void 0,fee:ge??at,to:u.to,network:f.chains.find(q=>q.id===u.chainId)?.name??"",from:M?.address??"",cta:V,hasFunds:Q?.hasFunds,action:Y,balance:go??Cr,amount:v?.value??Z,onClose:re,onClick:vo?Fe:ae})};var H3=require("@ethersproject/bytes"),G3=require("@ethersproject/strings"),Tn=require("react"),Fi=y(require("styled-components")),Kd=require("@privy-io/js-sdk-core");var Ue=require("react/jsx-runtime"),_E=e=>{if(!(0,H3.isHexString)(e))return e;try{return(0,G3.toUtf8String)(e)}catch{return e}},PE=e=>JSON.stringify(e,null,2),AE=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?(0,Ue.jsx)(kE,{children:Object.entries(r).map(([o,n])=>(0,Ue.jsxs)("li",{children:[(0,Ue.jsxs)("strong",{children:[o,":"]})," ",t(n)]},o))}):(0,Ue.jsx)("span",{children:String(r)});return(0,Ue.jsx)("div",{children:t(e)})},xE=e=>{let{types:t,primaryType:r,...o}=e.typedData;return(0,Ue.jsxs)(Ue.Fragment,{children:[(0,Ue.jsx)(q3,{children:(0,Ue.jsx)(AE,{data:o})}),(0,Ue.jsx)(Kn,{text:PE(e.typedData),itemName:"full payload to clipboard"})," "]})},V3=()=>{let{authenticated:e}=$(),{initializeWalletProxy:t,closePrivyModal:r}=W(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:i}=P(),[a,l]=(0,Tn.useState)(!0),[s,c]=(0,Tn.useState)(""),[m,f]=(0,Tn.useState)(),[u,C]=(0,Tn.useState)(null),[v,g]=(0,Tn.useState)(!1),E=u!==null;(0,Tn.useEffect)(()=>{e||o("LANDING")},[e]),(0,Tn.useEffect)(()=>{t($i).then(Y=>{l(!1),Y||(c("An error has occurred, please try again."),f(new Kt(new oo(s,Kd.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:S,data:R,confirmAndSign:T,onSuccess:A,onFailure:k,uiOptions:M}=n.signMessage,D={title:M.title||"Sign message",description:M.description||"Signing this message will not cost you any fees.",buttonText:M.buttonText||"Sign and continue"},G=Y=>{Y?A(Y):k(m||new Kt(new oo("The user rejected the request.",Kd.ProviderErrors.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout(()=>{C(null),c(""),f(void 0)},200)};return i.current=()=>{G(u)},(0,Ue.jsxs)(Ue.Fragment,{children:[(0,Ue.jsx)(x,{onClose:()=>G(u)}),(0,Ue.jsx)(de,{}),M.iconUrl&&typeof M.iconUrl=="string"?(0,Ue.jsx)(ME,{children:(0,Ue.jsx)(VC,{size:"sm",src:M.iconUrl,alt:"app image"})}):null,(0,Ue.jsx)(Gd,{children:D.title}),(0,Ue.jsx)(Ga,{children:D.description}),S==="personal_sign"&&(0,Ue.jsx)(q3,{children:_E(R)}),S==="eth_signTypedData_v4"&&(0,Ue.jsx)(xE,{typedData:R}),(0,Ue.jsx)(WE,{}),(0,Ue.jsx)(RE,{fail:!0,children:s}),(0,Ue.jsx)(uc,{disabled:v||E||a,loading:v,onClick:async()=>{g(!0),c("");try{let Y=await T();C(Y),g(!1),setTimeout(()=>{G(Y)},ot)}catch(Y){console.error(Y),c("An error has occurred, please try again."),f(new Kt(new oo(s,Kd.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),g(!1)}},children:v?"Signing...":E?(0,Ue.jsxs)(IE,{children:[(0,Ue.jsx)(Ia,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",(0,Ue.jsx)("span",{children:"Success"})]}):D.buttonText}),(0,Ue.jsx)(me,{}),(0,Ue.jsx)(K,{})]})},q3=Fi.default.div`
|
|
2694
2769
|
margin-top: 1.5rem;
|
|
2695
2770
|
background-color: var(--privy-color-background-2);
|
|
2696
2771
|
border-radius: var(--privy-border-radius-md);
|
|
@@ -2709,7 +2784,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2709
2784
|
display: none; /* Safari and Chrome */
|
|
2710
2785
|
}
|
|
2711
2786
|
}
|
|
2712
|
-
`,
|
|
2787
|
+
`,kE=Fi.default.ul`
|
|
2713
2788
|
margin-left: 12px !important;
|
|
2714
2789
|
white-space: nowrap;
|
|
2715
2790
|
|
|
@@ -2721,7 +2796,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2721
2796
|
font-weight: 500 !important;
|
|
2722
2797
|
}
|
|
2723
2798
|
}
|
|
2724
|
-
`,
|
|
2799
|
+
`,RE=Fi.default.div`
|
|
2725
2800
|
line-height: 20px;
|
|
2726
2801
|
height: 20px;
|
|
2727
2802
|
font-size: 13px;
|
|
@@ -2731,20 +2806,20 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2731
2806
|
width: 100%;
|
|
2732
2807
|
margin-top: 16px;
|
|
2733
2808
|
margin-bottom: 4px;
|
|
2734
|
-
|
|
2809
|
+
`,IE=Fi.default.span`
|
|
2735
2810
|
display: flex;
|
|
2736
2811
|
align-items: center;
|
|
2737
2812
|
gap: 8px;
|
|
2738
|
-
`,
|
|
2813
|
+
`,ME=Fi.default.div`
|
|
2739
2814
|
display: flex;
|
|
2740
2815
|
flex-direction: column;
|
|
2741
2816
|
justify-content: center;
|
|
2742
2817
|
align-items: center;
|
|
2743
2818
|
width: 100%;
|
|
2744
2819
|
height: 82px;
|
|
2745
|
-
`,
|
|
2820
|
+
`,WE=Fi.default.div`
|
|
2746
2821
|
flex-grow: 1;
|
|
2747
|
-
`;var
|
|
2822
|
+
`;var Ja=require("react"),z3=y(require("styled-components"));var qt=require("react/jsx-runtime"),$3=()=>{let{authenticated:e,logout:t,ready:r,user:o}=$(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=P(),{initLoginWithTelegram:s,loginWithTelegram:c,updateWallets:m,setReadyToTrue:f,closePrivyModal:u,createAnalyticsEvent:C}=W(),[v,g]=(0,Ja.useState)(!1),[E,S]=(0,Ja.useState)(void 0),R=ot;async function T(){try{await c(),g(!0),f(!0)}catch(M){if(M?.privyErrorCode==="allowlist_rejected"){S(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(M?.privyErrorCode==="max_accounts_reached"){console.error(new ro(M).toString()),S(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}if(M?.privyErrorCode==="user_does_not_exist"){S(void 0),l(),a("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:D,detail:G}=wp(M);S({retryable:D,detail:G,message:"Authentication failed"})}}(0,Ja.useEffect)(()=>{T()},[]),(0,Ja.useEffect)(()=>{if(!(r&&e&&v&&o))return;if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let G=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},R);return()=>clearTimeout(G)}if(Sr(o,n?.embeddedWallets?.createOnLogin)){let G=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:Y=>{console.error(Y),C({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Y,provider:"telegram",screen:"TelegramAuthScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},R);return()=>clearTimeout(G)}m();let D=setTimeout(()=>u({shouldCallAuthOnSuccess:!0,isSuccess:!0}),R);return()=>clearTimeout(D)},[r,e,v,o]);let A=v?"Successfully connected with Telegram":E?E.message:"Verifying connection to Telegram",k="";return v?k="You\u2019re good to go!":E?k=E.detail:k="Just a few moments more",(0,qt.jsxs)(qt.Fragment,{children:[(0,qt.jsx)(x,{}),(0,qt.jsx)(de,{}),(0,qt.jsxs)(OE,{children:[(0,qt.jsx)(vt,{children:(0,qt.jsxs)("div",{children:[(0,qt.jsx)(Pt,{success:v,fail:!!E}),(0,qt.jsx)(_d,{style:{width:"38px",height:"38px"}})]})}),(0,qt.jsxs)(pt,{children:[(0,qt.jsx)("h3",{children:A}),(0,qt.jsx)("p",{children:k})]}),E&&E?.retryable?(0,qt.jsx)(Ln,{onClick:()=>{s().then(async()=>T()).catch(M=>{let{retryable:D,detail:G}=wp(M);S({retryable:D,detail:G,message:"Authentication failed"})}),S(void 0)},disabled:!v&&!E?.retryable,children:"Retry"}):null]}),(0,qt.jsx)(me,{}),(0,qt.jsx)(J,{})]})},OE=z3.default.div`
|
|
2748
2823
|
display: flex;
|
|
2749
2824
|
flex-direction: column;
|
|
2750
2825
|
align-items: center;
|
|
@@ -2752,9 +2827,9 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2752
2827
|
margin-left: 27px;
|
|
2753
2828
|
margin-right: 27px;
|
|
2754
2829
|
gap: 24px;
|
|
2755
|
-
`;var
|
|
2830
|
+
`;var Y3=y(require("@heroicons/react/24/outline/EnvelopeIcon"));var K3=y(require("@heroicons/react/24/outline/EnvelopeIcon")),rl=require("react"),Ku=y(require("styled-components"));var Oo=require("react/jsx-runtime"),j3=(0,rl.forwardRef)((e,t)=>{let[r,o]=(0,rl.useState)(""),[n,i]=(0,rl.useState)(!1),{authenticated:a,user:l}=$(),{initUpdateEmail:s}=W(),{navigate:c,setModalData:m,currentScreen:f}=P(),{enabled:u,token:C}=We(),v=Sl(r),g=n,E=n||!v,S=async T=>{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,T),c("AWAITING_PASSWORDLESS_CODE")}catch(A){m({errorModalData:{error:A,previousScreen:f||"LANDING"}})}i(!1)},R=()=>{u&&!C&&!a?(m({captchaModalData:{callback:T=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");return s(l.email.address,r,T)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):S(C)};return(0,Oo.jsxs)(Oo.Fragment,{children:[(0,Oo.jsx)(LE,{children:(0,Oo.jsxs)(NE,{children:[(0,Oo.jsx)(K3.default,{}),(0,Oo.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:T=>o(T.target.value),onKeyUp:T=>{T.key==="Enter"&&R()},value:r,autoComplete:"email"}),e.stacked?null:(0,Oo.jsx)(pa,{isSubmitting:g,onClick:R,disabled:E,children:"Submit"})]})}),e.stacked?(0,Oo.jsx)(H,{loadingText:null,loading:g,disabled:E,onClick:R,children:"Submit"}):null]})}),LE=Ku.default.div`
|
|
2756
2831
|
width: 100%;
|
|
2757
|
-
`,
|
|
2832
|
+
`,NE=Ku.default.label`
|
|
2758
2833
|
display: block;
|
|
2759
2834
|
position: relative;
|
|
2760
2835
|
width: 100%;
|
|
@@ -2812,7 +2887,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2812
2887
|
&& > input::placeholder {
|
|
2813
2888
|
color: var(--privy-color-foreground-3);
|
|
2814
2889
|
}
|
|
2815
|
-
`;var
|
|
2890
|
+
`;var to=require("react/jsx-runtime"),Z3=()=>(0,to.jsxs)(to.Fragment,{children:[(0,to.jsx)(x,{},"header"),(0,to.jsx)(de,{}),(0,to.jsx)(xe,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:(0,to.jsx)(Y3.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,to.jsx)(lo,{children:(0,to.jsx)(j3,{stacked:!0})}),(0,to.jsx)(me,{}),(0,to.jsx)(K,{})]});var jd=y(require("styled-components"));var ju=require("react/jsx-runtime"),Q3=({style:e,...t})=>(0,ju.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...e},...t,children:(0,ju.jsx)("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})});var Lr=require("react/jsx-runtime"),J3=()=>{let{navigate:e}=P();return(0,Lr.jsxs)(Lr.Fragment,{children:[(0,Lr.jsx)(x,{}),(0,Lr.jsxs)(DE,{children:[(0,Lr.jsx)(UE,{children:(0,Lr.jsx)(Q3,{})}),(0,Lr.jsxs)(FE,{children:[(0,Lr.jsx)("h3",{children:"Unable to sign in"}),(0,Lr.jsx)("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),(0,Lr.jsx)(H,{onClick:()=>{e("LANDING")},children:"Go back"})]}),(0,Lr.jsx)(K,{})]})},DE=jd.default.div`
|
|
2816
2891
|
display: flex;
|
|
2817
2892
|
flex-direction: column;
|
|
2818
2893
|
align-items: center;
|
|
@@ -2821,7 +2896,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2821
2896
|
width: 100%;
|
|
2822
2897
|
padding-top: 8px;
|
|
2823
2898
|
padding-bottom: 32px;
|
|
2824
|
-
`,
|
|
2899
|
+
`,UE=jd.default.div`
|
|
2825
2900
|
display: flex;
|
|
2826
2901
|
align-items: center;
|
|
2827
2902
|
justify-content: center;
|
|
@@ -2830,11 +2905,11 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
2830
2905
|
color: var(--privy-color-error);
|
|
2831
2906
|
background-color: var(--privy-color-error-light);
|
|
2832
2907
|
border-radius: 50%;
|
|
2833
|
-
`,
|
|
2908
|
+
`,FE=jd.default.div`
|
|
2834
2909
|
display: flex;
|
|
2835
2910
|
flex-direction: column;
|
|
2836
2911
|
gap: 8px;
|
|
2837
|
-
`;var
|
|
2912
|
+
`;var Yd=y(require("styled-components"));var BE=`
|
|
2838
2913
|
*,
|
|
2839
2914
|
::before,
|
|
2840
2915
|
::after {
|
|
@@ -3064,7 +3139,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
3064
3139
|
[hidden] {
|
|
3065
3140
|
display: none;
|
|
3066
3141
|
}
|
|
3067
|
-
`,
|
|
3142
|
+
`,X3=BE;var e0=Yd.createGlobalStyle`
|
|
3068
3143
|
:root {
|
|
3069
3144
|
// Borders
|
|
3070
3145
|
--privy-border-radius-sm: 6px;
|
|
@@ -3099,10 +3174,10 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
3099
3174
|
--privy-height-modal-full: 620px;
|
|
3100
3175
|
--privy-height-modal-compact: 480px;
|
|
3101
3176
|
};
|
|
3102
|
-
`,
|
|
3177
|
+
`,Yu=Yd.default.div`
|
|
3103
3178
|
// css normalize only the privy application to avoid conflicts
|
|
3104
3179
|
// with consuming application
|
|
3105
|
-
${
|
|
3180
|
+
${X3}
|
|
3106
3181
|
|
|
3107
3182
|
// Privy styles
|
|
3108
3183
|
color: var(--privy-color-foreground-2);
|
|
@@ -3153,7 +3228,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
3153
3228
|
opacity: 1;
|
|
3154
3229
|
}
|
|
3155
3230
|
}
|
|
3156
|
-
`;var
|
|
3231
|
+
`;var Bi=require("@headlessui/react"),Zd=y(require("react")),Xa=y(require("styled-components")),Sn=require("react/jsx-runtime"),t0=({children:e,open:t,onClick:r,...o})=>(0,Sn.jsx)(Bi.Transition,{show:t,as:Zd.default.Fragment,children:(0,Sn.jsxs)(Bi.Dialog,{onClose:r,...o,as:GE,children:[(0,Sn.jsx)(Bi.Transition.Child,{as:Zd.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,Sn.jsx)(HE,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),(0,Sn.jsx)(VE,{children:(0,Sn.jsx)(Bi.Transition.Child,{as:Zd.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,Sn.jsx)(Bi.Dialog.Panel,{as:qE,children:e})})})]})}),HE=Xa.default.div`
|
|
3157
3232
|
position: fixed;
|
|
3158
3233
|
inset: 0;
|
|
3159
3234
|
|
|
@@ -3166,10 +3241,10 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
3166
3241
|
backdrop-filter: unset;
|
|
3167
3242
|
-webkit-backdrop-filter: unset;
|
|
3168
3243
|
}
|
|
3169
|
-
`,
|
|
3244
|
+
`,GE=Xa.default.div`
|
|
3170
3245
|
position: relative;
|
|
3171
3246
|
z-index: 999999;
|
|
3172
|
-
`,
|
|
3247
|
+
`,VE=Xa.default.div`
|
|
3173
3248
|
position: fixed;
|
|
3174
3249
|
inset: 0;
|
|
3175
3250
|
display: flex;
|
|
@@ -3177,7 +3252,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
3177
3252
|
justify-content: center;
|
|
3178
3253
|
width: 100vw;
|
|
3179
3254
|
min-height: 100vh;
|
|
3180
|
-
`,
|
|
3255
|
+
`,qE=Xa.default.div`
|
|
3181
3256
|
// reset some default dialog styles
|
|
3182
3257
|
padding: 0;
|
|
3183
3258
|
background: transparent;
|
|
@@ -3224,13 +3299,13 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
3224
3299
|
box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
|
|
3225
3300
|
border-radius: var(--privy-border-radius-lg);
|
|
3226
3301
|
}
|
|
3227
|
-
`,
|
|
3302
|
+
`,r0=Xa.default.div`
|
|
3228
3303
|
display: flex;
|
|
3229
3304
|
flex-direction: column;
|
|
3230
3305
|
align-items: center;
|
|
3231
3306
|
justify-content: center;
|
|
3232
3307
|
height: 100%;
|
|
3233
|
-
`;var tt=require("react/jsx-runtime"),
|
|
3308
|
+
`;var tt=require("react/jsx-runtime"),zE={["LANDING"]:Bv,["CONNECT_OR_CREATE"]:Fv,["AWAITING_PASSWORDLESS_CODE"]:Ay,["AWAITING_CONNECTION"]:tg,["AWAITING_CONNECT_ONLY_CONNECTION"]:ng,["AWAITING_FARCASTER_CONNECTION"]:k1,["AWAITING_FARCASTER_SIGNER"]:W1,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:o3,["PHANTOM_INTERSTITIAL_SCREEN"]:s3,["LOGIN_FAILED_SCREEN"]:Kv,["AWAITING_OAUTH_SCREEN"]:r3,["CROSS_APP_AUTH_SCREEN"]:sg,["ALLOWLIST_REJECTION_SCREEN"]:hy,["ACCOUNT_NOT_FOUND_SCREEN"]:cy,["USER_LIMIT_REACHED_SCREEN"]:J3,["INSTALL_PHANTOM_SCREEN"]:av,["LINK_EMAIL_SCREEN"]:Gv,["LINK_PHONE_SCREEN"]:qv,["LINK_WALLET_SCREEN"]:zv,["LINK_PASSKEY_SCREEN"]:p2,["UPDATE_EMAIL_SCREEN"]:Z3,["CONNECT_ONLY_LANDING_SCREEN"]:Jy,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:Qy,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:_g,["EMBEDDED_WALLET_CREATED_SCREEN"]:gg,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:fg,["EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN"]:c3,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:w3,["EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN"]:u3,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:Eg,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:V3,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:B3,["FUNDING_METHOD_SELECTION_SCREEN"]:w2,["MOONPAY_PROMPT_SCREEN"]:V2,["MOONPAY_STATUS_SCREEN"]:K2,["COINBASE_ONRAMP_STATUS_SCREEN"]:e2,["FUNDING_TRANSFER_FROM_WALLET_SCREEN"]:J2,["FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"]:q1,["FUNDING_MANUAL_TRANSFER_SCREEN"]:R2,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:u1,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:l1,["EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN"]:m3,["MFA_ENROLLMENT_FLOW_SCREEN"]:_C,["CAPTCHA_SCREEN"]:Ly,["ERROR_SCREEN"]:h1,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:tv,["AFFIRMATIVE_CONSENT_SCREEN"]:my,["TELEGRAM_AUTH_SCREEN"]:$3},$E=["LANDING","AWAITING_CONNECTION"],o0=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=$(),{headless:n}=dt(),{ready:i,currentScreen:a}=P(),{status:l,execute:s,reset:c,enabled:m}=We(),f=o&&a&&$E.includes(a)&&!n&&l==="ready";if((0,_n.useEffect)(()=>{f&&s()},[f]),(0,_n.useEffect)(()=>{!o&&m&&c()},[o,m]),(!r||!i)&&a!=="AWAITING_OAUTH_SCREEN"&&a!=="CROSS_APP_AUTH_SCREEN"&&a!=="TELEGRAM_AUTH_SCREEN")return(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(x,{}),(0,tt.jsx)(de,{}),(0,tt.jsx)(r0,{children:(0,tt.jsx)(At,{})}),(0,tt.jsx)(me,{}),(0,tt.jsx)(J,{})]});if(!a&&e)return(0,tt.jsx)(Bu,{open:e,onClose:t});if(!a)return null;let u=zE[a];return(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(Ao,{if:!!e,children:(0,tt.jsx)(u,{})}),(0,tt.jsx)(Ao,{if:!e,children:(0,tt.jsx)(Bu,{open:e,onClose:t})})]})},KE=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let r=(0,_n.useRef)(null),o=Zh(r);return(0,tt.jsx)(YE,{style:{height:o},id:"privy-modal-content",children:(0,tt.jsx)("div",{ref:r,children:(0,tt.jsx)(o0,{isMfaVerifying:e,onMfaVerificationComplete:t})})})},jE=()=>{let{closePrivyModal:e}=W(),{onUserCloseViaDialogOrKeybindRef:t}=P();return{gracefulClosePrivyModal:(0,_n.useCallback)(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},Qd=({open:e})=>{let{app:t}=P(),{gracefulClosePrivyModal:r}=jE(),[o,n]=(0,_n.useState)(!1);dc({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=e||o;return t.render.standalone?(0,tt.jsx)(Yu,{children:(0,tt.jsx)(n0,{id:"privy-modal-content",children:(0,tt.jsx)(o0,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})}):(0,tt.jsx)(t0,{open:i,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:(0,tt.jsx)(Yu,{children:(0,tt.jsx)(KE,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})})},n0=Zu.default.div`
|
|
3234
3309
|
display: flex;
|
|
3235
3310
|
flex-direction: column;
|
|
3236
3311
|
text-align: center;
|
|
@@ -3239,7 +3314,7 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
3239
3314
|
width: 100%;
|
|
3240
3315
|
background: var(--privy-color-background);
|
|
3241
3316
|
padding: 0 16px;
|
|
3242
|
-
`,
|
|
3317
|
+
`,YE=(0,Zu.default)(n0)`
|
|
3243
3318
|
transition: height 150ms ease-out;
|
|
3244
3319
|
overflow: hidden;
|
|
3245
3320
|
|
|
@@ -3253,4 +3328,4 @@ You will have to sign up with another method first to register a passkey for you
|
|
|
3253
3328
|
box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
|
|
3254
3329
|
border-radius: var(--privy-border-radius-lg);
|
|
3255
3330
|
}
|
|
3256
|
-
`;var Zs=require("react"),MC=require("react/jsx-runtime");function p7({botUsername:e,scriptHost:t}){let r=document.createElement("script"),{origin:o}=new URL(t);return r.async=!0,r.src=`${o}/js/telegram-login.js`,r.setAttribute("data-telegram-login",e),r.setAttribute("data-request-access","write"),r.setAttribute("data-lang","en"),r}function RC(e){let t=(0,Zs.useRef)(null),r=(0,Zs.useRef)();return(0,Zs.useEffect)(()=>{r.current?.remove(),r.current=p7(e),t.current?.after(r.current)},[e]),(0,MC.jsx)("div",{ref:t,hidden:!0})}var IC=require("react"),Ya=require("react");var Vd=class{constructor(){this.callbacks={}}enqueue(t,r){this.callbacks[t]=r}dequeue(t,r){let o=this.callbacks[r];if(!o)throw new Error(`cannot dequeue ${t} event: no event found for id ${r}`);switch(delete this.callbacks[r],t){case"privy:iframe:ready":return o;case"privy:wallet:create":return o;case"privy:wallet:import":return o;case"privy:wallet:connect":return o;case"privy:wallet:recover":return o;case"privy:wallet:rpc":return o;case"privy:wallet:set-recovery":return o;case"privy:mfa:verify":return o;case"privy:mfa:init-enrollment":return o;case"privy:mfa:submit-enrollment":return o;case"privy:mfa:unenroll":return o;case"privy:mfa:clear":return o;case"privy:farcaster:init-signer":return o;case"privy:farcaster:sign":return o;case"privy:solana-wallet:create":return o;case"privy:solana-wallet:connect":return o;case"privy:solana-wallet:recover":return o;case"privy:solana-wallet:rpc":return o;default:throw new Error(`invalid wallet event type ${t}`)}}};async function Xn(e,t,r,o,n,i=!1){let a=i,l=async m=>{if(a&&t&&t.length>0){m===(i?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new Ze("missing_or_invalid_mfa","MFA verification failed, retry."));let f=await new Promise((u,v)=>{r.current={resolve:u,reject:v};let b=1e3*60*5;setTimeout(()=>{let g=new Ze("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(g),v(g)},b)});return await e(f)}return await e()},s=4,c=null;for(let m=0;m<s;m++)try{c=await l(m),o.current?.resolve(void 0);break}catch(f){if(f.type==="missing_or_invalid_mfa")a=!0;else throw o.current?.resolve(void 0),f}if(c===null){let m=new Ze("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(m),m}return c}var LC=require("react/jsx-runtime"),u7=function(e){return()=>`id-${e++}`}(0);function m7(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function qt(e){return e.error!==void 0}var Wt=new Vd,Fu=new Map,f7=(e,t)=>typeof t=="bigint"?t.toString():t,h7=(e,t)=>`${e}${JSON.stringify(t,f7)}`;function zt(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let i=h7(e,t);if(e==="privy:wallet:create"){let l=Fu.get(i);if(l)return l}let a=new Promise((l,s)=>{let c=u7();Wt.enqueue(c,{resolve:l,reject:s}),n.postMessage({id:c,event:e,data:t},o)}).finally(()=>{Fu.delete(i)});return Fu.set(i,a),a}function y7(e){switch(e.event){case"privy:iframe:ready":let t=Wt.dequeue(e.event,e.id);return qt(e)?t.reject(new Ze(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=Wt.dequeue(e.event,e.id);return qt(e)?r.reject(new Ze(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:import":let o=Wt.dequeue(e.event,e.id);return qt(e)?o.reject(new Ze(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let n=Wt.dequeue(e.event,e.id);return qt(e)?n.reject(new Ze(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:recover":let i=Wt.dequeue(e.event,e.id);return qt(e)?i.reject(new Ze(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:rpc":let a=Wt.dequeue(e.event,e.id);return qt(e)?a.reject(new Ze(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:set-recovery":let l=Wt.dequeue(e.event,e.id);return qt(e)?l.reject(new Ze(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:verify":let s=Wt.dequeue(e.event,e.id);return qt(e)?s.reject(new Ze(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:init-enrollment":{let u=Wt.dequeue(e.event,e.id);return qt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:submit-enrollment":{let u=Wt.dequeue(e.event,e.id);return qt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:unenroll":{let u=Wt.dequeue(e.event,e.id);return qt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:clear":{let u=Wt.dequeue(e.event,e.id);return qt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:farcaster:init-signer":{let u=Wt.dequeue(e.event,e.id);return qt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:farcaster:sign":{let u=Wt.dequeue(e.event,e.id);return qt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:solana-wallet:create":let c=Wt.dequeue(e.event,e.id);return qt(e)?c.reject(new Ze(e.error.type,e.error.message)):c.resolve(e.data);case"privy:solana-wallet:connect":let m=Wt.dequeue(e.event,e.id);return qt(e)?m.reject(new Ze(e.error.type,e.error.message)):m.resolve(e.data);case"privy:solana-wallet:recover":let f=Wt.dequeue(e.event,e.id);return qt(e)?f.reject(new Ze(e.error.type,e.error.message)):f.resolve(e.data);case"privy:solana-wallet:rpc":{let u=Wt.dequeue(e.event,e.id);return qt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function WC(e){let t=(0,Ya.useRef)(null),r=(0,Ya.useRef)(e.mfaMethods),o=ia(),[n,i]=(0,IC.useState)(!1);return(0,Ya.useEffect)(()=>{r.current=e.mfaMethods},[e.mfaMethods]),(0,Ya.useEffect)(()=>{if(!n)return;let a=t.current;if(!a)return;function l(u){u&&u.origin===e.origin&&m7(u.data)&&y7(u.data)}let s={create(u){return zt("privy:wallet:create",u,a,e.origin)},import(u){return zt("privy:wallet:import",u,a,e.origin)},connect(u){return zt("privy:wallet:connect",u,a,e.origin)},recover(u){return Xn(v=>zt("privy:wallet:recover",{...u,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!u.recoveryMethod||u.recoveryMethod==="privy")},rpc(u){return Xn(v=>zt("privy:wallet:rpc",{...u,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},createSolana(u){return zt("privy:solana-wallet:create",u,a,e.origin)},connectSolana(u){return zt("privy:solana-wallet:connect",u,a,e.origin)},recoverSolana(u){return zt("privy:solana-wallet:recover",u,a,e.origin)},rpcSolana(u){return zt("privy:solana-wallet:rpc",u,a,e.origin)},setRecovery(u){return Xn(v=>zt("privy:wallet:set-recovery",{...u,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(u){return Xn(v=>zt("privy:mfa:verify",{...u,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(u){return Xn(v=>zt("privy:mfa:init-enrollment",{...u,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(u){return Xn(v=>zt("privy:mfa:submit-enrollment",{...u,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(u){return Xn(v=>zt("privy:mfa:unenroll",{...u,...v},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(u){return zt("privy:mfa:clear",u,a,e.origin)},initFarcasterSigner(u){return zt("privy:farcaster:init-signer",u,a,e.origin)},signFarcasterMessage(u){return zt("privy:farcaster:sign",u,a,e.origin)}};window.addEventListener("message",l);let c=()=>e.onLoad(s),m=(...u)=>{console.warn("Privy iframe failed to load: ",...u),e.onLoadFailed()},f=new AbortController;return Ja(()=>zt("privy:iframe:ready",{},a,e.origin),{abortSignal:f.signal}).then(c,m),()=>{window.removeEventListener("message",l),f.abort()}},[n]),(0,LC.jsx)("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>i(!0),src:vl(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}var Gd=class{constructor(t,r){this.walletProxy=t,this.address=r}async handleSignMessage(t,r){if(!t.params||typeof t.params.message!="string")throw new Error("Message must be provided as a string for Solana signMessage RPC");return(await this.walletProxy.rpcSolana({accessToken:r,publicKey:this.address,request:t})).response.data}async request(t){console.debug("EmbeddedSolanaProvider.request() called with args",t);let r=await Re();if(!r)throw new Error("User must be authenticated to use embedded Solana wallet");if(!await OC())throw new w("Unable to connect to Solana embedded wallet");switch(t.method){case"signMessage":return await this.handleSignMessage(t,r);default:throw new Error("Embedded Solana provider does not yet support this RPC method.")}}};async function qd({api:e,requesterAppId:t,providerAppId:r}){let n=(await e.get(`/api/v1/apps/${t}/cross-app/connections`)).connections.find(i=>i.provider_app_id===r);if(!n)throw new w("Invalid connected app");return{name:n.provider_app_name,logoUrl:n.provider_app_icon_url||void 0,apiUrl:n.provider_app_custom_api_url,readOnly:n.read_only}}async function NC({api:e,appId:t}){let r=ai(),o=Vi(),n=await Gi(r);try{let{url:i}=await e.post(dl,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:n,state_code:o});return{url:i,stateCode:o,codeVerifier:r}}catch(i){throw Ce(i)}}async function DC({api:e,appId:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new w("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new w("User denied confirmation during cross-app auth flow");try{return(await e.post(pl,{authorization_code:n,state_code:r,code_verifier:o,provider:`privy:${t}`})).oauth_tokens?.access_token}catch(i){let a=Ce(i);throw a.privyErrorCode?new w(a.message||"Invalid code during cross-app auth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during cross-app auth flow"?new w("Invalid code during cross-app auth flow.",void 0,"oauth_user_denied"):new w("Invalid code during cross-app auth flow.",void 0,"unknown_auth_error")}}async function UC({url:e,popup:t}){return t.location=e,new Promise((o,n)=>{let a=setTimeout(()=>{n(new w("Authorization request timed out after 2 minutes.")),l()},12e4);function l(){t?.close(),window.removeEventListener("message",m)}let s,c=setInterval(()=>{t?.closed&&!s&&(l(),clearInterval(c),clearTimeout(a),n(new w("User rejected request")))},300);function m(f){f.data&&(f.data.type==="PRIVY_OAUTH_RESPONSE"&&f.data.stateCode&&f.data.authorizationCode&&(clearTimeout(a),o(f.data),l()),f.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(a),n(new w(f.data.error)),l()),f.data.type==="PRIVY_OAUTH_USE_BROADCAST_CHANNEL"&&(s=new BroadcastChannel("popup-privy-oauth"),s.onmessage=m))}window.addEventListener("message",m)})}var zd=async({user:e,address:t,client:r,request:o,requesterAppId:n,reconnect:i})=>{r.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:t,method:o.method}});let a=e?.linkedAccounts.find(u=>!!(u.type==="cross_app"&&u.embeddedWallets.find(v=>v.address===t)));if(!e||!a)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Cannot request a signature with this wallet address",address:t}}),new w("Cannot request a signature with this wallet address");let l=r.getProviderAccessToken(a.providerApp.id),s=await qd({api:r.api,requesterAppId:n,providerAppId:a.providerApp.id});if(!l){if(s.readOnly)throw console.error("cannot transact against a read-only provider app"),new w("Cannot transact against a read-only provider app");await i({appId:a.providerApp.id})&&(l=r.getProviderAccessToken(a.providerApp.id))}if(!l)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Transactions require a valid token",address:t}}),new w("Transactions require a valid token");let c=window.open(void 0,void 0,Bu({w:400,h:680}));if(!c)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:t}}),new w("Failed to initialize signature request");let m=new URL(`${s.apiUrl}/oauth/transact`);return m.searchParams.set("token",l||""),m.searchParams.set("request",g7(o)),c.location=m.href,new Promise((u,v)=>{let g=setTimeout(()=>{k(),v(new w("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})},12e4),E=setInterval(()=>{c.closed&&(k(),v(new w("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))},300),x=S=>{S.data&&(S.data.token?.action==="set"&&S.data.token?.value!==void 0?r.storeProviderAccessToken(a.providerApp.id,S.data.token.value):S.data.token?.action==="clear"&&r.storeProviderAccessToken(a.providerApp.id,null),S.data.type==="PRIVY_CROSS_APP_ACTION_RESPONSE"&&S.data.result&&(k(),u(S.data.result),r.createAnalyticsEvent({eventName:"cross_app_request_success",payload:{address:t,method:o.method}})),S.data.type==="PRIVY_CROSS_APP_ACTION_ERROR"&&S.data.error&&(k(),v(S.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:S.data.error,address:t}})))};window.addEventListener("message",x);let k=()=>{c.close(),clearInterval(E),clearTimeout(g),window.removeEventListener("message",x)}})},g7=e=>JSON.stringify({content:{request:{request:e}},timestamp:Date.now(),callbackUrl:window.origin}),Bu=({w:e,h:t})=>{let r=window.screenLeft!==void 0?window.screenLeft:window.screenX,o=window.screenTop!==void 0?window.screenTop:window.screenY,n=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,i=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,a=n/window.screen.availWidth,l=i/window.screen.availHeight,s=(n-e)/2/a+r,c=(i-t)/2/l+o;return`toolbar=0,location=0,menubar=0,height=${t},width=${e},popup=1,left=${s},top=${c}`};var v7="https://cdn.apple-cloudkit.com";async function Hu({url:e,popup:t,provider:r}){return t.location=e,new Promise((n,i)=>{function a(){t?.close(),window.removeEventListener("message",l)}function l(s){s.data&&(s.data.type==="PRIVY_OAUTH_RESPONSE"&&s.data.stateCode&&s.data.authorizationCode&&(n(s.data),a()),s.origin===v7&&s.data.ckSession&&(n({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:s.data.ckSession}),a()),s.data.type==="PRIVY_OAUTH_ERROR"&&(i(s.data.error),a()))}window.addEventListener("message",l)})}var FC=e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type});var er=require("react/jsx-runtime"),rn;function C7(e){return typeof e=="string"&&e.length===25}function Re(){if(!rn){let e=X.get(ti);return Promise.resolve(e||null)}return rn.getAccessToken()}var VC,Pf=(e,t,r)=>VC(e,t,r),GC,xf=(e,t)=>GC(e,t),qC,Af=(e,t)=>qC(e,t),zC,kf=()=>zC(),$C,OC=()=>$C(),w7=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;X.put(ts,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},KC=({config:e,...t})=>{if(!C7(t.appId))throw new w("Cannot initialize the Privy provider with an invalid Privy app ID");rn||(rn=new oa({appId:t.appId,appClientId:t.clientId,apiUrl:t.apiUrl}));let r=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&r.embeddedWallets?.createOnLogin===void 0&&(r.embeddedWallets||(r.embeddedWallets={}),r.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),(0,er.jsx)(wh,{client:rn,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:(0,er.jsx)(b7,{...t,client:rn})})},b7=e=>{let t=e.client,[r,o]=(0,ve.useState)(!1),[n,i]=(0,ve.useState)(!1),[a,l]=(0,ve.useState)(!1),[s,c]=(0,ve.useState)(null),[m,f]=(0,ve.useState)([]),[u,v]=(0,ve.useState)(null),b=(0,ve.useRef)(m),[g,E]=(0,ve.useState)(!1),[x,k]=(0,ve.useState)(null),[S,A]=(0,ve.useState)(!1),[M,I]=(0,ve.useState)({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:T}),[U,H]=(0,ve.useState)({status:"initial"}),[Y,Z]=(0,ve.useState)(null),[O,D]=(0,ve.useState)(null),L=pt(),Me=Kl(),[je,Q]=(0,ve.useState)(!0),[ae,ie]=(0,ve.useState)({}),[Fe,Ne]=(0,ve.useState)(null),[ut,ct]=(0,ve.useState)(null),[Lt,at]=(0,ve.useState)(!1),[ye,gr]=(0,ve.useState)(!1),fo=(0,ve.useRef)(null),Wo=(0,ve.useRef)(null),N=(0,ve.useRef)(Uh),[St,ho]=(0,ve.useState)(!1);t.onStoreToken=d=>{d&&F(N,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{c(null),l(!1),F(N,"accessToken","onAccessTokenRemoved")};let G=(0,ve.useRef)(null),q=(0,ve.useRef)(null),fe=d=>{k(d),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:d}})},Ot=d=>{L.embeddedWallets.createOnLogin!=="off"&&Q(!0),fe(d)};(0,ve.useEffect)(()=>{let d=pi(s);if(!d||!O)return;let p={address:d.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:kn,id:"io.privy.solana.wallet"},getProvider:async()=>new Gd(O,d.address)};v(p)},[O,s]),(0,ve.useEffect)(()=>{if(!s){t.connectors?.removeEmbeddedWalletConnector();return}let d=xe(s),p=Bl(s);if(d||t.connectors?.removeEmbeddedWalletConnector(),p||t.connectors?.removeImportedWalletConnector(),!t.connectors){console.debug("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!O){console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized");return}d&&t.connectors.addEmbeddedWalletConnector(O,d.address,L.defaultChain,e.appId),p&&t.connectors.addImportedWalletConnector(O,p.address,L.defaultChain,e.appId)},[O,s]),(0,ve.useEffect)(()=>{O&&ut?.(O)},[O]),(0,ve.useEffect)(()=>{(async()=>{if(!L.customAuth?.enabled)return;Q(!0);let{getCustomAccessToken:p,isLoading:h}=L.customAuth;if(!(!n||h))try{let C=await p();if(!C&&a){await Ni.logout();return}if(!C||a)return;t.startAuthFlow(new Ui(C));let{user:R,isNewUser:V}=await t.authenticate();if(!R){await Ni.logout();return}c(R||null),E(V||!1),l(!0),gr(!0)}catch(C){console.warn(C),a&&await Ni.logout()}})()},[L.customAuth?.enabled,L.customAuth?.getCustomAccessToken,L.customAuth?.isLoading,n,a]),(0,ve.useEffect)(()=>{ye&&O&&s&&br(s,L.embeddedWallets.createOnLogin)&&(gr(!1),Ku(s,Hi).catch(console.error))},[ye&&O&&s]),(0,ve.useEffect)(()=>{async function d(){let p=Qa(),h=Js();w7();let C=(0,BC.createStore)();t.initializeConnectorManager({walletConnectCloudProjectId:L.walletConnectCloudProjectId,rpcConfig:L.rpcConfig,chains:L.chains,defaultChain:L.defaultChain,store:C,walletList:L.appearance.walletList,shouldEnforceDefaultChainOnConnect:L.shouldEnforceDefaultChainOnConnect,externalWalletConfig:L.externalWallets,appName:L.name??"Privy"});let R;t.connectors?.on("connectorInitialized",()=>{R&&clearTimeout(R);let Ie=t.connectors.walletConnectors.length,le=t.connectors.walletConnectors.reduce((ft,Be)=>ft+(Be.initialized?1:0),0);le===Ie?ho(!0):R=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:le,expected:Ie}),ho(!0)},1500)}),t.connectors?.initialize().then(()=>{R0()});let V=await t.getAuthenticatedUser(),K=!!V;if(L.customAuth?.enabled||(l(!!V),V&&F(N,"login","onComplete",V,!1,!0,null,null),c(V)),p){q.current=K?"link":"login";return}if(h&&!K){q.current="login",Ot("TELEGRAM_AUTH_SCREEN");return}ge.setReadyToTrue(!!V)}!n&&Me&&d()},[t,Fe,n,Me]),(0,ve.useEffect)(()=>{if(!n)return;if(!s){at(!0);return}if(!!!s.linkedAccounts.find(h=>h.type==="wallet"&&h.walletClientType==="privy")){at(!0);return}let p=!!m.find(h=>h.walletClientType==="privy");at(p)},[n,s,m]);let Qa=()=>{let d=ls();if(d.inProgress&&d.popupFlow){if(window.opener.location.origin!==window.location.origin){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."});return}if(d.authorizationCode==="error"){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."});return}window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:d.stateCode,authorizationCode:d.authorizationCode});return}let p="privy:";function h(C){return C.startsWith(p)}return d.inProgress&&h(d.provider)&&!d.popupFlow&&(new BroadcastChannel("popup-privy-oauth").postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:d.stateCode,authorizationCode:d.authorizationCode}),window.close()),!d.inProgress||d.headless?!1:(t.startAuthFlow(new Oo(d)),Ot("AWAITING_OAUTH_SCREEN"),!0)},Js=()=>{let d=Ef();if(!d||!L.loginMethods.telegram||!L.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let p=new zi;return t.startAuthFlow(p),d.flowType==="login-url"&&(p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult={id:d.id,first_name:d.first_name,last_name:d.last_name,auth_date:d.auth_date,username:d.username,photo_url:d.photo_url,hash:d.hash}),d.flowType==="web-app"&&(p.meta.telegramAuthResult=void 0,p.meta.telegramWebAppData={query_id:d.query_id,user:d.user,auth_date:d.auth_date,hash:d.hash}),!0},k0=async(d,p,h,C)=>{let R=await t.connectors?.createWalletConnector(d,p)||null;Kd(R,p,h,C)};async function Kd(d,p,h,C){if(d)I({status:"disconnected",connectedWallet:null,connectError:null,connector:d,connectRetry:T});else return I({status:"disconnected",connectedWallet:null,connectError:new we("Unable to connect to wallet."),connector:null,connectRetry:T}),C?.(null,h);d instanceof wo&&p&&await d.resetConnection(p),I({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Kd(d,p,h,C)});try{let R=await d.connect({showPrompt:!0});if(L.shouldEnforceDefaultChainOnConnect&&!L.chains.find(V=>V.id===Number(R?.chainId.replace("eip155:","")))&&!(R?.connectorType==="wallet_connect_v2"&&R?.walletClientType==="metamask")){I(V=>({...V,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:T}));try{await R?.switchChain(L.defaultChain.id),R&&(R.chainId=Bi(ei(L.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${L.defaultChain.id}`)}}return I(V=>({...V,status:"connected",connectedWallet:R,connectError:null,connectRetry:T})),R&&F(N,"connectWallet","onSuccess",R),C?.(R,h)}catch(R){return R instanceof wt?(console.warn(R.cause?R.cause:R.message),F(N,"connectWallet","onError",R.privyErrorCode||"generic_connect_wallet_error")):(console.warn(R),F(N,"connectWallet","onError","unknown_connect_wallet_error")),I(V=>({...V,status:"disconnected",connectedWallet:null,connectError:R})),C?.(null,h)}}let Xs=async(d,p)=>{if(d===null)return;let h=new an(d,t,p);t.startAuthFlow(h)},R0=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_connector"),h=d.get("privy_wallet_client");if(!p||!h)return;if(h==="phantom"&&!Sn()&&Ot("LOGIN_FAILED_SCREEN"),!t.connectors)throw new w("Connector not initialized");fe("AWAITING_CONNECTION");let C=new URL(window.location.href);C.searchParams.delete("privy_connector"),C.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",C),k0(p,h,void 0,Xs)};(0,ve.useEffect)(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let kt=d=>{if(!a)throw F(N,"linkAccount","onError","must_be_authenticated",{linkMethod:d}),new w("User must be authenticated before linking an account.")},$u=()=>{kt("siwe"),G.current="siwe",q.current="link",fe("LINK_WALLET_SCREEN")},M0=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},I0=async d=>{if(!t.connectors)throw new w("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(I(h=>({...h,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:T})),L.captchaEnabled&&!a){let h={callback:C=>Xs(d,C),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};ie({captchaModalData:h}),Ot("CAPTCHA_SCREEN")}else await Xs(d),Ot("AWAITING_CONNECTION")},W0=async(d,p)=>{let{signedUrl:h,externalTransactionId:C}=await m2(t,d,p??{},L.appearance.palette,L.fundingMethodConfig?.moonpay.useSandbox??!1);return{signedUrl:h,externalTransactionId:C}},el=()=>{f(d=>{let p=t.connectors?.wallets.map(h=>({...h,linked:M0(h),loginOrLink:async()=>{if(!await h.isConnected())throw new w("Wallet is not connected");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new w("Cannot link or login with embedded wallet");I0(h)},fund:async C=>{await ge.fundWallet(h.address,C)},unlink:async()=>{if(!a)throw new w("User is not authenticated.");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new w("Cannot unlink an embedded wallet");let C=await t.unlinkWallet(h.address);c(C)}}))||[];return Hl(d,p)?d:p})};(0,ve.useEffect)(()=>{el()},[s?.linkedAccounts,a,n]),(0,ve.useEffect)(()=>{if(n){if(!t.connectors)throw new w("Connector not initialized");el(),t.connectors.on("walletsUpdated",el)}},[n]);let L0=d=>{if(d&&"suggestedAddress"in d&&d.suggestedAddress){let p=(0,tn.getAddress)(d.suggestedAddress);Z(p)}fe(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};(0,ve.useEffect)(()=>{if(!m[0])return;let d=m[0],p=b.current.find(C=>C.address===d.address),h;if(d.walletClientType==="privy"?h=s?.linkedAccounts.find(C=>C.type==="wallet"&&C.address===d.address&&C.walletClientType==="privy"):h=s?.linkedAccounts.find(C=>C.type==="wallet"&&C.address===d.address&&C.walletClientType!=="privy"),!p&&h){let C=Object.assign({},s);C.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported},c(C)}b.current=m},[m]);let Ku=async(d,p)=>{if(xe(d))throw F(N,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[C,R]=await Promise.all([ge.initializeWalletProxy(p),Re()]);if(!C&&L.customAuth?.enabled)throw F(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!C||!R||L.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((V,K)=>{Q(!0),ie({createWallet:{onSuccess:le=>{F(N,"createWallet","onSuccess",le),V(le)},onFailure:le=>{F(N,"createWallet","onError","unknown_embedded_wallet_error"),K(le)},callAuthOnSuccessOnClose:!1}}),fe("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await C.create({accessToken:R});let V=await ge.refreshUser(),K=xe(V);if(!K)throw F(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return F(N,"createWallet","onSuccess",K),K}},O0=d=>{if(!L.chains.map(p=>p.id).includes(d))throw new we(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},ju=(d,p,h)=>new Promise(async(C,R)=>{let{requesterAppId:V}=p||{};if(!a||!s){F(N,"sendTransaction","onError","must_be_authenticated"),R(new Error("User must be authenticated before signing with a Privy wallet"));return}let K=d.from,Ie=K?s?.linkedAccounts.find(ht=>ht.type==="wallet"&&ht.walletClientType==="privy"&&(0,tn.getAddress)(ht.address)===(0,tn.getAddress)(K)):xe(s);if(!Ie){F(N,"sendTransaction","onError","embedded_wallet_not_found"),R(new Error("Must have a Privy wallet before signing"));return}Q(!0);let le=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,ft=d.chainId?Number(d.chainId):le.chainId;O0(ft);let Be=Object.assign({},d,{chainId:ft}),Cr=async()=>{let ht=await Re();if(!ht||!O){F(N,"sendTransaction","onError","embedded_wallet_not_found"),R(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await ge.recoverEmbeddedEthereumWallet()){F(N,"sendTransaction","onError","unknown_connect_wallet_error"),R(new Error("Unable to connect to wallet"));return}let Di=Wr(Be.chainId,L.chains,L.rpcConfig,{appId:e.appId}),Lo=await(0,Za.populateTransactionRequest)(Ie.address,Be,Di);if(L.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:U0}=await(0,Za.calculateTotalGasEstimate)(Lo,Di),{hasSufficientFunds:F0}=await ka(Ie.address,Lo,U0,Di);if(!F0)throw new $t(new to("Wallet has insufficient funds for this transaction.",Za.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let Xu=await Uc(ht,Ie.address,O,Lo,Di,V);F(N,"sendTransaction","onSuccess",Xu),C(Xu)}catch(rl){F(N,"sendTransaction","onError","transaction_failure"),R(rl)}};if(L.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),Cr();else{let ht={transactionRequest:Be,onSuccess:Lo=>{F(N,"sendTransaction","onSuccess",Lo),C(Lo)},onFailure:Lo=>{F(N,"sendTransaction","onError","transaction_failure"),R(Lo)},uiOptions:p||{},fundWalletConfig:h,requesterAppId:V},rl={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:Lo=>{F(N,"sendTransaction","onError","unknown_connect_wallet_error"),R(Lo)}},Di=Qu({address:Ie.address,fundWalletConfig:h,chainIdOverride:Be.chainId,comingFromSendTransactionScreen:!0});ie({connectWallet:rl,sendTransaction:ht,funding:Di}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function Yu(){return new Promise(async(d,p)=>{let h=await Re();if(!h||!O)throw new Error("Must have valid access token to enroll in MFA");try{await O.verifyMfa({accessToken:h}),d()}catch(C){p(C)}})}let Zu=d=>d?.linkedAccounts.filter(p=>p.latestVerifiedAt!==null&&!(p.type==="wallet"&&p.walletClientType==="privy")).sort((p,h)=>h.latestVerifiedAt.getTime()-p.latestVerifiedAt.getTime())[0],vr=d=>{let p=s?.linkedAccounts.filter(R=>R.type===d).length??0,{displayName:h,loginMethod:C}=jn(d);if(d==="passkey"&&p>=5||d!=="passkey"&&p>=1)throw F(N,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:C}),new w(`User already has an account of type ${h} linked.`)},N0=()=>{if(!L.loginConfig.telegramAuthConfiguration?.linkEnabled)throw F(N,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:"telegram"}),new w("User can't link an account because Telegram linking is disabled.")},Qu=({address:d,fundWalletConfig:p,methodScreen:h,chainIdOverride:C=null,comingFromSendTransactionScreen:R=!1})=>{if(!L.fundingConfig||L.fundingConfig.methods.length===0)return;let V=Xc(p)&&p.amount?p.amount:L.fundingConfig.defaultRecommendedAmount,K=Xc(p)&&p.chain?p.chain.id:Ma(L.fundingConfig.defaultRecommendedCurrency.chain),Ie=Xc(p)&&p.chain?p.chain:L.chains.find(le=>le.id===K);if(C&&L.chains.find(le=>le.id===C)&&(Ie=L.chains.find(le=>le.id===C)),!Ie)throw new w("Funding chain is not in PrivyProvider chains list");return{address:d,amount:V,chain:Ie,methodScreen:h,comingFromSendTransactionScreen:R,...u2(p)?{moonpayConfigOverride:p.config}:{}}};async function Ju({legacySetWalletPasswordFlow:d=!1}){k(null);let p=d?"setWalletPassword":"setWalletRecovery";if(!a||!s)throw F(N,p,"onError","must_be_authenticated"),new Error("User must be authenticated before adding recovery method to Privy wallet");let h=xe(s);if(!h||!O)throw F(N,p,"onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a recovery method");if(pi(s))throw new Error("Cannot set user-controlled recovery for user with Solana.");try{await Yu()}catch(R){throw F(N,p,"onError","missing_or_invalid_mfa"),R}return new Promise((R,V)=>{Q(!0);let K={onSuccess:Be=>{F(N,p,"onSuccess","user-passcode",Be),R(Be)},onFailure:Be=>{F(N,p,"onError","user_exited_set_password_flow"),V(Be)},callAuthOnSuccessOnClose:!1},Ie=h.recoveryMethod==="user-passcode",ft={onCompleteNavigateTo:Ac({walletAction:"update",availableRecoveryMethods:L.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:d,isResettingPassword:Ie}),shouldForceMFA:!1,onFailure:Be=>{F(N,p,"onError","unknown_connect_wallet_error"),V(Be)}};ie({setWalletPassword:K,createWallet:K,connectWallet:ft,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:Ie}}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")})}async function tl({appId:d}){kt(`privy:${d}`),G.current=`privy:${d}`,q.current="link";let p=window.open(void 0,void 0,Bu({w:440,h:680}));return t.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{appId:d}}),new Promise(async(h,C)=>{let{name:R,logoUrl:V}=await qd({api:t.api,providerAppId:d,requesterAppId:L.id});ie({crossAppAuth:{appId:d,name:R,logoUrl:V,popup:p,onSuccess:h,onError:C}}),Ot("CROSS_APP_AUTH_SCREEN")})}let Ni={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:L0,importWallet:async({privateKey:d})=>{kt("siwe");let[p,h]=await Promise.all([ge.initializeWalletProxy(15e3),Re()]);if(p&&h){await p.import({privateKey:d,accessToken:h});let C=await ge.refreshUser(),R=Bl(C);if(!R)throw F(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to import wallet");return F(N,"createWallet","onSuccess",R),R}else throw new w("User is not authenticated")},linkWallet:$u,linkCrossAppAccount:tl,linkEmail:()=>{kt("email"),vr("email"),G.current="email",q.current="link",fe("LINK_EMAIL_SCREEN")},linkPhone:()=>{kt("sms"),vr("phone"),G.current="sms",q.current="link",fe("LINK_PHONE_SCREEN")},linkGoogle:async()=>{kt("google"),vr("google_oauth"),q.current="link",await ge.initLoginWithOAuth("google")},linkTwitter:async()=>{kt("twitter"),vr("twitter_oauth"),q.current="link",await ge.initLoginWithOAuth("twitter")},linkDiscord:async()=>{kt("discord"),vr("discord_oauth"),q.current="link",await ge.initLoginWithOAuth("discord")},linkGithub:async()=>{kt("github"),vr("github_oauth"),q.current="link",await ge.initLoginWithOAuth("github")},linkSpotify:async()=>{kt("spotify"),vr("spotify_oauth"),q.current="link",await ge.initLoginWithOAuth("spotify")},linkInstagram:async()=>{kt("instagram"),vr("instagram_oauth"),q.current="link",await ge.initLoginWithOAuth("instagram")},linkTiktok:async()=>{kt("tiktok"),vr("tiktok_oauth"),q.current="link",await ge.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{kt("linkedin"),vr("linkedin_oauth"),q.current="link",await ge.initLoginWithOAuth("linkedin")},linkApple:async()=>{kt("apple"),vr("apple_oauth"),q.current="link",await ge.initLoginWithOAuth("apple")},linkPasskey:async()=>{kt("passkey"),vr("passkey"),await ge.initLinkWithPasskey(),fe("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{kt("telegram"),vr("telegram"),N0(),q.current="link",G.current="telegram",await ge.initLoginWithTelegram(),fe("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{kt("farcaster"),vr("farcaster"),await ge.initLoginWithFarcaster(),q.current="link",G.current="farcaster",fe("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(kt("email"),!s?.email)throw new w("User does not have an email linked to their account.");q.current="link",G.current="email",fe("UPDATE_EMAIL_SCREEN")},login:async d=>{d&&"target"in d&&d&&(d=void 0);let p="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!n){let h=await new Promise(C=>{Ne(R=>C.bind(R))});if(Ne(null),h){console.warn(p);return}}if(a){console.warn(p);return}q.current="login",ie({login:d}),Ot("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{Ne(()=>d)}),Ne(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(m[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}Ot("CONNECT_OR_CREATE")},logout:async()=>{if(s&&t.clearProviderAcccessTokens(s),k(null),await t.logout(),s&&O)try{await O.clearMfa({userId:s.id})}catch{}c(null),l(!1),F(N,"logout","onSuccess"),q.current=null,G.current=null,o(!1),X.del(rs)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new dt;let d=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(C=>C.address===d?.address));return!d||!p?new dt:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new $d.Web3Provider(new go(new dt));let d=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(C=>C.address===d?.address));return!d||!p?new $d.Web3Provider(new go(new dt)):new $d.Web3Provider(new go(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new An(new dt);let d=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(C=>C.address===d?.address));return!d||!p?new An(new dt):new An(p.proxyProvider)},unlinkWallet:async d=>{let p=await t.unlinkWallet(d);return c(p),p},unlinkEmail:async d=>{let p=await t.unlinkEmail(d);return c(p),p},unlinkPhone:async d=>{let p=await t.unlinkPhone(d);return c(p),p},unlinkGoogle:async d=>{let p=await t.unlinkOAuth("google",d);return c(p),p},unlinkTwitter:async d=>{let p=await t.unlinkOAuth("twitter",d);return c(p),p},unlinkDiscord:async d=>{let p=await t.unlinkOAuth("discord",d);return c(p),p},unlinkGithub:async d=>{let p=await t.unlinkOAuth("github",d);return c(p),p},unlinkSpotify:async d=>{let p=await t.unlinkOAuth("spotify",d);return c(p),p},unlinkInstagram:async d=>{let p=await t.unlinkOAuth("instagram",d);return c(p),p},unlinkTiktok:async d=>{let p=await t.unlinkOAuth("tiktok",d);return c(p),p},unlinkLinkedIn:async d=>{let p=await t.unlinkOAuth("linkedin",d);return c(p),p},unlinkApple:async d=>{let p=await t.unlinkOAuth("apple",d);return c(p),p},unlinkFarcaster:async d=>{let p=await t.unlinkFarcaster(d);return c(p),p},unlinkTelegram:async d=>{let p=await t.unlinkTelegram(d);return c(p),p},unlinkPasskey:async d=>{let p=await t.unlinkPasskey(d);return c(p),p},unlinkCrossAppAccount:async({subject:d})=>{let p=s?.linkedAccounts.find(C=>C.type==="cross_app"&&C.subject===d)?.providerApp;if(!p)throw new w("Invalid subject");t.storeProviderAccessToken(p.id,null);let h=await t.unlinkOAuth(`privy:${p.id}`,d);return c(h),h},setActiveWallet:async d=>{let p=m.find(C=>(0,tn.getAddress)(C.address)===(0,tn.getAddress)(d)),h=s?.linkedAccounts.find(C=>C.type==="wallet"&&(0,tn.getAddress)(C.address)===(0,tn.getAddress)(d));if(!p||!await p.isConnected())Z(d),$u();else if(!p.linked)p.loginOrLink();else{let C=Object.assign({},s);C.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported},c(C)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw F(N,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return Ku(s,15e3)},setWalletRecovery:async()=>Ju({legacySetWalletPasswordFlow:!1}),setWalletPassword:async()=>Ju({legacySetWalletPasswordFlow:!0}),signMessage:(d,p,h)=>new Promise(async(C,R)=>{let{requesterAppId:V}=p||{};if(!a||!s){F(N,"signMessage","onError","must_be_authenticated"),R(new Error("User must be authenticated before signing with a Privy wallet"));return}let K=h?s?.linkedAccounts.find(le=>le.type==="wallet"&&le.walletClientType==="privy"&&(0,tn.getAddress)(le.address)===(0,tn.getAddress)(h)):xe(s);if(!K){F(N,"signMessage","onError","embedded_wallet_not_found"),R(new Error("Must have a Privy wallet before signing"));return}if(typeof d!="string"||d.length<1){F(N,"signMessage","onError","invalid_message"),R(new Error("Message must be a non-empty string"));return}Q(!0);let Ie=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let le=await Re();if(!O||!le)throw new Error("Unable to connect to wallet");if(!await ge.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:K.address,requesterAppId:V}});let{response:Be}=await O.rpc({accessToken:le,address:K.address,requesterAppId:V,request:{method:"personal_sign",params:[d,K.address]}}),Cr=Be.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:K.address,requesterAppId:V}}),Cr};if(L.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let le=await Ie();F(N,"signMessage","onSuccess",le),C(le)}catch(le){F(N,"signMessage","onError","unable_to_sign"),R(le??new $t("Unable to sign message"))}}else{let Be={method:"personal_sign",data:d,confirmAndSign:Ie,onSuccess:ht=>{F(N,"signMessage","onSuccess",ht),C(ht)},onFailure:ht=>{F(N,"signMessage","onError","unable_to_sign"),R(ht)},uiOptions:p||{}},Cr={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:ht=>{F(N,"signMessage","onError","unknown_connect_wallet_error"),R(ht)},address:K.address};ie({signMessage:Be,connectWallet:Cr}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(h,C)=>{let{requesterAppId:R}=p||{};if(!a||!s){F(N,"signTypedData","onError","must_be_authenticated"),C(new Error("User must be authenticated before signing with a Privy wallet"));return}let V=xe(s);if(!V){F(N,"signTypedData","onError","embedded_wallet_not_found"),C(new Error("Must have a Privy wallet before signing"));return}Q(!0);let K=Xa(d),Ie=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let le=await Re();if(!O||!le)throw new Error("Unable to connect to wallet");if(!await ge.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:V.address,requesterAppId:R}});let{response:Be}=await O.rpc({accessToken:le,address:V.address,requesterAppId:R,request:{method:"eth_signTypedData_v4",params:[V.address,K]}}),Cr=Be.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:V.address,requesterAppId:R}}),Cr};if(L.embeddedWallets.noPromptOnSignature||(L.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let le=await Ie();F(N,"signTypedData","onSuccess",le),h(le)}catch(le){F(N,"signTypedData","onError","unable_to_sign"),C(le??new $t("Unable to sign message"))}}else{let Be={method:"eth_signTypedData_v4",data:K,confirmAndSign:Ie,onSuccess:ht=>{F(N,"signTypedData","onSuccess",ht),h(ht)},onFailure:ht=>{F(N,"signTypedData","onError","unable_to_sign"),C(ht)},uiOptions:p||{}},Cr={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:ht=>{F(N,"signMessage","onError","unknown_connect_wallet_error"),C(ht)}};ie({signMessage:Be,connectWallet:Cr}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,h)=>{let R=await(await ju(d,p,h)).wait();return Fc(R)},exportWallet:()=>new Promise(async(d,p)=>{if(!a||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}if(!xe(s)){p(new Error("Must have a Privy wallet before exporting"));return}Q(!0);let C={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p,shouldForceMFA:!0};if(ie(ae),!await Re()||!O){p(new Error("Must have valid access token to enroll in MFA"));return}if(!O){p(new Error("Must have a Privy wallet before exporting"));return}let V={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,onSuccess:d,onFailure:p};ie({keyExport:V,connectWallet:C}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:Yu,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 w("Invalid MFA code");fo.current?.resolve({mfaMethod:d,mfaCode:p,relyingParty:window.origin}),await new Promise((V,K)=>{Wo.current={resolve:V,reject:K}});break;case"passkey":if(typeof p=="string")throw new w("Invalid authenticator response");let C=await(await import("@simplewebauthn/browser")).startAuthentication(p),R=FC(C);fo.current?.resolve({mfaMethod:d,mfaCode:R,relyingParty:window.origin}),await new Promise((V,K)=>{Wo.current={resolve:V,reject:K}});break;default:throw fo.current?.reject(new w("Unsupported MFA method")),new w(`Unsupported MFA method: ${d}`)}},cancel(){fo.current?.reject(new w("MFA canceled"))},async initEnrollmentWithSms(d){let p=await Re();if(!p||!O)throw new Error("Must have valid access token to enroll in MFA");await O.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber})},enrollInMfa(d){return new Promise((p,h)=>{if(!d){ge.closePrivyModal(),p();return}L.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."),ie({mfaEnrollmentFlow:{mfaMethods:L.mfa.methods,onSuccess:p,onFailure:h}}),fe("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await Re();if(!d||!O)throw new Error("Must have valid access token to enroll in MFA");let p=await O.initEnrollMfa({method:"totp",accessToken:d});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(d){let p=await Re();if(!p||!O)throw new Error("Must have valid access token to enroll in MFA");await O.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber,code:d.mfaCode});let h=await t.getAuthenticatedUser();c(h)},async submitEnrollmentWithTotp(d){let p=await Re();if(!p||!O)throw new Error("Must have valid access token to enroll in MFA");await O.submitEnrollMfa({method:"totp",accessToken:p,code:d.mfaCode});let h=await t.getAuthenticatedUser();c(h)},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:d}){let p=await Re();if(!p||!O)throw new Error("Must have valid access token to enroll in MFA");await O.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:d});let h=await t.getAuthenticatedUser();c(h)},async unenroll(d){let p=await Re();if(!p||!O)throw new Error("Must have valid access token to remove MFA");d==="passkey"?await O.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:[]}):await O.unenrollMfa({method:d,accessToken:p});let h=await t.getAuthenticatedUser();c(h)},requestFarcasterSignerFromWarpcast:async()=>{let d=await Re(),p=s?.linkedAccounts.find(R=>R.type==="wallet"&&R.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!O||!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 ge.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");let C=await O.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:d,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(C.status==="approved"){let R=await t.getAuthenticatedUser();c(R||s||null)}ie({farcasterSigner:C}),fe("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let d=await Re(),p=s?.linkedAccounts.find(R=>R.type==="wallet"&&R.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!O||!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 ge.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!s.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");return(R=>Uint8Array.from(R.match(/.{1,2}/g).map(V=>parseInt(V,16))))(s.farcaster.signerPublicKey.slice(2))},signFarcasterMessage:async d=>{let p=await Re(),h=s?.linkedAccounts.find(K=>K.type==="wallet"&&K.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!O||!h)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 ge.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!s.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");let R=await import("@simplewebauthn/browser"),V=await O.signFarcasterMessage({address:h.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{hash:R.bufferToBase64URLString(d)},fid:BigInt(s.farcaster.fid),relyingParty:window.origin});return new Uint8Array(R.base64URLStringToBuffer(V.signature))},isHeadlessOAuthLoading:S,loginWithCode(d){return ge.loginWithCode(d)},initLoginWithEmail(d){return ge.initLoginWithEmail(d)},initLoginWithSms(d){return ge.initLoginWithSms(d)},otpState:U,fundWallet(d,p){return ge.fundWallet(d,p)},initLoginWithHeadlessOAuth(d,p){return ge.initLoginWithHeadlessOAuth(d,p)},loginWithHeadlessOAuth(d){return ge.loginWithHeadlessOAuth(d)},generateSiweMessage({address:d,chainId:p}){return ge.generateSiweMessage({address:d,chainId:p})},linkWithSiwe({message:d,signature:p,chainId:h,walletClientType:C,connectorType:R}){return kt("siwe"),ge.linkWithSiwe({message:d,signature:p,chainId:h,walletClientType:C,connectorType:R})},signMessageWithCrossAppWallet(d,{address:p}){return zd({user:s,client:t,address:p,requesterAppId:L.id,request:{method:"personal_sign",params:[d,p]},reconnect:tl})},signTypedDataWithCrossAppWallet(d,{address:p}){let h=Xa(d);return zd({user:s,client:t,address:p,requesterAppId:L.id,request:{method:"eth_signTypedData_v4",params:[p,h]},reconnect:tl})},sendTransactionWithCrossAppWallet(d,{address:p}){return zd({user:s,client:t,address:p,requesterAppId:L.id,request:{method:"eth_sendTransaction",params:[d]},reconnect:tl})},isModalOpen:r,mfaMethods:L.mfa.methods};VC=Ni.signMessage,GC=Ni.signTypedData,qC=async(...d)=>{let p=await ju(...d);return L.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let ge=(()=>({isNewUserThisSession:g,linkingOrConnectingHint:Y,pendingTransaction:null,walletConnectionStatus:M,connectors:t.connectors?.walletConnectors??[],rpcConfig:L.rpcConfig,chains:L.chains,appId:e.appId,showFiatPrices:L.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>L.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(O)return O;let p=new Promise(R=>{ct(()=>V=>R(V))}),h=new Promise(R=>setTimeout(()=>R(null),d)),C=await Promise.race([p,h]);return ct(null),C},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:(d={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s,h;p&&G.current&&(h=Zu(s)),q.current==="login"?d.shouldCallAuthOnSuccess&&p&&G.current?(F(N,"login","onComplete",s,g,!1,G.current,h??null),e.onSuccess?.(s,g)):F(N,"login","onError","exited_auth_flow"):q.current==="link"&&h&&(d.isSuccess&&p&&G.current?F(N,"linkAccount","onSuccess",s,G.current,h):G.current&&F(N,"linkAccount","onError","exited_link_flow",{linkMethod:G.current})),Z(null),q.current=null,G.current=null,E(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},openPrivyModal:fe,connectWallet:Kd,initLoginWithWallet:async(d,p)=>{G.current="siwe",Xs(d,p)},loginWithWallet:async()=>{if(!n)throw new on;if(!(t.authFlow instanceof an))throw new w("Must initialize SIWE flow first.");let d,p;if(a)try{({user:d}=await t.link()),G.current="siwe"}catch(h){throw F(N,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),h}else try{({user:d,isNewUser:p}=await t.authenticate()),G.current="siwe"}catch(h){throw F(N,"login","onError",h.privyErrorCode||"generic_connect_wallet_error"),h}c(d||s||null),E(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new es(d);t.startAuthFlow(p);try{G.current="farcaster",await p.initializeFarcasterConnect()}catch(h){throw q.current==="login"?F(N,"login","onError",h.privyErrorCode||"unknown_auth_error"):q.current==="link"&&F(N,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"farcaster"}),h}},loginWithFarcaster:async()=>{if(!n)throw new on;if(!(t.authFlow instanceof es))throw new w("Must initialize Farcaster flow first.");let d,p;if(a)try{({user:d}=await t.link()),G.current="farcaster"}catch(h){throw F(N,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"farcaster"}),h}else try{({user:d,isNewUser:p}=await t.authenticate()),G.current="farcaster"}catch(h){throw F(N,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}c(d||null),E(p||!1),l(!0)},async crossAppAuthFlow({appId:d,popup:p}){let h=`privy:${d}`;G.current=h;let{url:C,stateCode:R,codeVerifier:V}=await NC({api:t.api,appId:d});if(!C)throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:d}}),new w("No authorization URL returned for cross-app auth.");try{let K=await UC({url:C,popup:p,provider:h}),Ie=K.stateCode,le=K.authorizationCode;if(Ie!==R)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:h,storedStateCode:R??"",returnedStateCode:Ie??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let ft=await DC({api:rn.api,appId:d,codeVerifier:V,stateCode:Ie,authorizationCode:le});ft&&t.storeProviderAccessToken(d,ft);let Be=await ge.refreshUser();if(!Be)throw new w("Unable to update user");return t.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{appId:d}}),Be}catch(K){throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:K.toString(),provider:h}}),K}},async initLoginWithOAuth(d,p){if(G.current=d,Qd()){if(d==="google"&&pa(window.navigator.userAgent)){Ot("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{Ot("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}d==="twitter"&&window.opener&&window.opener.postMessage({type:"PRIVY_OAUTH_USE_BROADCAST_CHANNEL"},"*"),X.del(ni);let h=new Oo({provider:d});p&&h.addCaptchaToken(p),t.startAuthFlow(h);let C=await t.authFlow.getAuthorizationUrl();C&&C.url&&(d==="twitter"&&HC.isAndroid&&(C.url=C.url.replace("x.com","twitter.com")),window.location.assign(C.url))},async initLoginWithTelegram(d){if(!n)throw new on;G.current="telegram";let p=new zi(d);t.startAuthFlow(p),p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult=await new Promise((h,C)=>{if(!L.loginConfig.telegramAuthConfiguration)return C(new w("Telegram Auth configuration is not loaded"));if(!window.Telegram)return C(new w("Telegram was not initialized"));window.Telegram.Login.auth({bot_id:L.loginConfig.telegramAuthConfiguration.botId,request_access:!0},R=>R?h(R):C(new w("Telegram auth failed or was canceled by the client")))})},async loginWithTelegram(){if(!(t.authFlow instanceof zi))throw new w("Must initialize Telegram flow before calling loginWithTelegram");let d,p;if(a)try{({user:d}=await t.link()),G.current="telegram"}catch(h){throw F(N,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),h}else try{let h=await t.authenticate();d=h.user,p=h.isNewUser,G.current="telegram"}catch(h){throw q.current==="login"?F(N,"login","onError",h.privyErrorCode||"unknown_auth_error"):q.current==="link"&&F(N,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),h}c(d),E(p||!1),l(!0)},async recoveryOAuthFlow(d,p,h){let C,R;function V(K){if(!K)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:d}}),new w("Recovery OAuth failed")}switch(d){case"google-drive":{let{url:K,codeVerifier:Ie,stateCode:le}=await zp({api:rn.api,provider:d});V(K);let ft,Be;try{let Cr=await Hu({url:K,popup:h,provider:d});if(ft=Cr.stateCode,Be=Cr.authorizationCode,ft!==le)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:le??"",returnedStateCode:ft??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected")}catch(Cr){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:Cr.toString(),provider:d}}),new w("Recovery OAuth failed")}[C,R]=await Promise.all([Re(),Jy({api:rn.api,provider:d,codeVerifier:Ie,stateCode:ft,authorizationCode:Be})]);break}case"icloud":{let{url:K}=await zp({api:rn.api,provider:d});V(K);let{ckWebAuthToken:Ie}=await Hu({url:K,popup:h,provider:d});R=Ie,C=await Re();break}}if(!O)throw new w("Cannot connect to wallet proxy");if(!C)throw new w("Unable to authorize user");switch(p){case"recover":let K=ae.recoverWallet?.privyWallet?.address;if(!K)throw new w("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:K,recoveryMethod:d}}),await O.recover({address:K,accessToken:C,recoveryAccessToken:R,recoveryMethod:d}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:K,recoveryMethod:d}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await O.create({accessToken:C,recoveryAccessToken:R,recoveryMethod:d});let Ie=await ge.refreshUser(),le=xe(Ie);if(!le)throw F(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:le.address}}),F(N,"createWallet","onSuccess",le);break;case"set-recovery":let ft=xe(s);if(!ft)throw F(N,"setWalletRecovery","onError","embedded_wallet_not_found"),new Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{recoveryMethod:d}}),await O.setRecovery({address:ft.address,accessToken:C,recoveryAccessToken:R,recoveryMethod:d});let Be=xe(await ge.refreshUser());if(!Be)throw F(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:ft.address,recoveryMethod:d}}),F(N,"setWalletRecovery","onSuccess",d,Be);break;default:throw new w("Unsupported recovery action")}},async loginWithOAuth(d){if(!(t.authFlow instanceof Oo))throw new w("Must initialize OAuth flow before calling loginWithOAuth");let p=X.get(ri),h=t.authFlow.meta.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:p??"",returnedStateCode:h??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let C,R,V;if(a)try{let K=await t.link();C=K.user,V=K.oAuthTokens,G.current=d}catch(K){throw F(N,"linkAccount","onError",K.privyErrorCode||"failed_to_link_account",{linkMethod:d}),K}else try{let K=await t.authenticate();C=K.user,R=K.isNewUser,V=K.oAuthTokens,G.current=d}catch(K){throw q.current==="login"?F(N,"login","onError",K.privyErrorCode||"unknown_auth_error"):q.current==="link"&&F(N,"linkAccount","onError",K.privyErrorCode||"failed_to_link_account",{linkMethod:d}),K}return c(C),E(R||!1),l(!0),V&&C&&F(N,"oAuthAuthorization","onOAuthTokenGrant",V,{user:C}),V},async initLoginWithPasskey(d){let p=new ci(d);t.startAuthFlow(p),q.current="login";try{G.current="passkey",await p.initAuthenticationFlow()}catch(h){throw F(N,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}},async loginWithPasskey(){if(!n)throw new on;if(!(t.authFlow instanceof ci))throw new w("Must initialize Passkey flow first.");if(G.current!=="passkey")throw new w("Must init login with Passkey flow first.");let d,p;try{G.current="passkey",{user:d,isNewUser:p}=await t.authenticate()}catch(h){throw F(N,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}c(d),E(p||!1),l(!0)},async initLinkWithPasskey(d){let p=new ci(d);t.startAuthFlow(p),q.current="link",G.current="passkey";try{await p.initLinkFlow()}catch(h){throw F(N,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"passkey"}),h}},async linkWithPasskey(){if(!n)throw new on;if(!(t.authFlow instanceof ci))throw new w("Must initialize Passkey flow first.");if(G.current!=="passkey")throw new w("Must init login with Passkey flow first.");let d;try{G.current="passkey",{user:d}=await t.link()}catch(p){throw F(N,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account",{linkMethod:"passkey"}),p}return c(d||s||null),d},async initLoginWithHeadlessOAuth(d,p){if(Qd()){if(d==="google"&&pa(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 h=new Oo({provider:d,headless:!0});p&&h.addCaptchaToken(p);let C=await t.startAuthFlow(h).getAuthorizationUrl();C?.url&&window.location.assign(C.url)},async loginWithHeadlessOAuth(d){A(!0),t.startAuthFlow(new Oo(d));let p=X.get(ri),h=d.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d.provider,storedStateCode:p??"",returnedStateCode:h??""}}),A(!1),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let C,R;if(a)try{({user:C}=await t.link()),G.current=d.provider}catch(V){throw F(N,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account",{linkMethod:d.provider}),V}else try{({user:C,isNewUser:R}=await t.authenticate()),G.current=d.provider}catch(V){throw q.current==="login"?F(N,"login","onError",V.privyErrorCode||"unknown_auth_error"):q.current==="link"&&F(N,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account",{linkMethod:d.provider}),V}return c(C),E(R||!1),l(!0),A(!1),C??void 0},initLoginWithEmail:async(d,p)=>{let h=new Tn(d,p);t.startAuthFlow(h);try{G.current="email",await h.sendCodeEmail()}catch(C){throw q.current==="login"?F(N,"login","onError",C.privyErrorCode||"unknown_auth_error"):q.current==="link"&&F(N,"linkAccount","onError",C.privyErrorCode||"failed_to_link_account",{linkMethod:"email"}),C}},initUpdateEmail:async(d,p,h)=>{let C=new ml(d,p,h);t.startAuthFlow(C),await C.sendCodeEmail()},initLoginWithSms:async(d,p)=>{H({status:"sending-code"});let h=new di(d,p);t.startAuthFlow(h);try{G.current="sms",await h.sendSmsCode(),H({status:"awaiting-code-input"})}catch(C){throw H({status:"error",error:C}),q.current==="login"?F(N,"login","onError",C.privyErrorCode||"unknown_auth_error"):q.current==="link"&&F(N,"linkAccount","onError",C.privyErrorCode||"failed_to_link_account",{linkMethod:"sms"}),C}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(H({status:"submitting-code"}),!n){let C=new on;throw H({status:"error",error:C}),C}if(t.authFlow instanceof Tn)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof di)t.authFlow.meta.smsCode=d.trim();else{let C=new w("Must initialize a passwordless code flow first");throw H({status:"error",error:C}),C}await Re();let p,h;if(q.current==="link")try{({user:p}=await t.link())}catch(C){throw H({status:"error",error:C}),F(N,"linkAccount","onError",C.privyErrorCode||"failed_to_link_account",{linkMethod:G.current}),C}else try{({user:p,isNewUser:h}=await t.authenticate())}catch(C){throw H({status:"error",error:C}),F(N,"login","onError",C.privyErrorCode||"unknown_auth_error"),C}c(p||s||null),E(h||!1),l(!0),H({status:"done"})},generateSiweMessage:async({address:d,chainId:p,captchaToken:h})=>{q.current="link",G.current="siwe";let C=await t.generateSiweNonce({address:d,captchaToken:h}),R=p.replace("eip155:","");return Fl({address:d,chainId:R,nonce:C})},linkWithSiwe:async({message:d,signature:p,chainId:h,walletClientType:C,connectorType:R})=>{let V;try{if(q.current!=="link"||G.current!=="siwe")throw new w("Must ensure no other auth flow is in progress other than the SIWE signature flow.");V=await t.linkWithSiwe({message:d,signature:p,chainId:h,walletClientType:C,connectorType:R});let K=Zu(V);K&&F(N,"linkAccount","onSuccess",V,"siwe",K)}catch(K){throw F(N,"linkAccount","onError",K.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),q.current=null,G.current=null,K}c(V||s||null),q.current=null,G.current=null},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:O,createAnalyticsEvent:({eventName:d,payload:p,timestamp:h})=>t.createAnalyticsEvent({eventName:d,payload:p,timestamp:h}),acceptTerms:async()=>{let d=await t.acceptTerms();return c(d),d},getUsdTokenPrice:d=>t.getUsdTokenPrice(d),recoverEmbeddedEthereumWallet:async()=>new Promise(async(d,p)=>{let h=xe(s)||Bl(s),C=await Re();if(!C||!O||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}Q(!0);try{await O.connect({accessToken:C,address:h.address}),d(!0)}catch(R){if(bi(R)&&h.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:h.address}}),(await O.recover({address:h.address,accessToken:C,recoveryMethod:h.recoveryMethod})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:h.address}}),d(!0);else if(bi(R)&&h.recoveryMethod!=="privy"){ie({recoverWallet:{privyWallet:h,onFailure:p,onSuccess:()=>d(!0)},recoveryOAuthStatus:{provider:h.recoveryMethod,action:"recover"}});let V=kc(h.recoveryMethod);fe(V)}else p(R)}}),embeddedSolanaWallet:u,createEmbeddedSolanaWallet:async()=>{Q(!0);let d=await Re(),p=pi(s),h=xe(s);if(!s||!d)throw new w("User must be logged in to create a Solana wallet");if(p)throw new w("User already has an embedded Solana wallet.");if(h)if(h.recoveryMethod==="privy")await ge.recoverEmbeddedEthereumWallet();else throw new w("Cannot create an embedded Solana wallet for a user with an existing Ethereum wallet with user-controlled recovery.");let C=await ge.initializeWalletProxy(15e3);if(!C)throw new w("Unable to initialize wallet proxy");t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await C.createSolana({accessToken:d,ethereumAddress:h?.address});let R=await ge.refreshUser(),V=pi(R);if(!V)throw new w("Could not get Solana wallet for user");return t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:V.address}}),V}catch(R){throw t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new w("Failed to create Solana embedded wallet with error ",R)}},recoverEmbeddedSolanaWallet:async()=>new Promise(async(d,p)=>{let h=pi(s),C=await Re();if(!C||!O||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}Q(!0);try{await O.connectSolana({accessToken:C,publicKey:h.address}),d(!0)}catch(R){bi(R)&&h.recoveryMethod==="privy"?(t.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:h.address}}),(await O.recoverSolana({publicKey:h.address,accessToken:C})).publicKey||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_solana_wallet_recovery_completed",payload:{walletAddress:h.address}}),d(!0)):p(R)}}),getMoonpaySignedUrl:W0,setReadyToTrue:d=>{i(!0),Fe?.(d)},updateWallets:()=>el(),fundWallet:async(d,p)=>{if(!L.fundingConfig||L.fundingConfig.methods.length===0)throw new Error("Wallet funding is not enabled");let h=Md({fundingMethods:L.fundingConfig.methods});ie({funding:Qu({address:d,fundWalletConfig:p,methodScreen:h})}),fe(h)},requestFarcasterSignerStatus:async d=>{let p=await Re(),h=s?.linkedAccounts.find(R=>R.type==="wallet"&&R.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!O||!h)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 C=await t.requestFarcasterSignerStatus(d);if(C.status==="approved"){let R=await t.getAuthenticatedUser();c(R||s||null)}return C}}))();zC=ge.recoverEmbeddedEthereumWallet,$C=ge.recoverEmbeddedSolanaWallet;let D0=(0,ve.useMemo)(()=>({wallets:m,ready:Lt&&St}),[m,Lt,St]);return(0,er.jsx)(De.Provider,{value:Ni,children:(0,er.jsx)(Sp.Provider,{value:N,children:(0,er.jsx)(ou.Provider,{value:D0,children:(0,er.jsx)(Lh,{...L,children:(0,er.jsxs)(Tp.Provider,{value:ge,children:[(0,er.jsx)(Dy,{children:(0,er.jsxs)(Th,{data:ae,setModalData:ie,setInitialScreen:k,initialScreen:x,authenticated:a,open:r,children:[e.children,!L.headless&&L.captchaEnabled&&n&&!a&&(0,er.jsx)(Xl,{delayedExecution:!1}),(0,er.jsx)(_C,{theme:{...L.appearance.palette||{}}}),!L.render.standalone&&(0,er.jsx)(Hd,{open:r})]})}),je&&Me?(0,er.jsx)(WC,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:fo,mfaSubmitPromise:Wo,onLoad:D,onLoadFailed:()=>null}):null,L.loginMethods.telegram&&L.loginConfig.telegramAuthConfiguration&&(0,er.jsx)(_o,{if:!0,children:(0,er.jsx)(RC,{scriptHost:e.apiUrl||Tl,botUsername:L.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};var jC=require("react");function YC(e){let{login:t}=(0,jC.useContext)(De);return ze("login",e),{login:t}}var ZC=require("react");function QC(e){let{logout:t}=(0,ZC.useContext)(De);return ze("logout",e),{logout:t}}var Qs=require("react");function JC(){let e=We(),t=Kl(),{initLoginWithHeadlessOAuth:r,loginWithHeadlessOAuth:o,isHeadlessOAuthLoading:n,ready:i,user:a}=$(),l=(0,Qs.useCallback)(async c=>{if(e.enabled&&e.status!=="success")throw new Lr(e.error,null,"captcha_failure");return r(c.provider,e.token)},[r,e]),s=(0,Qs.useCallback)(async()=>{let c=ls();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(m){throw m}finally{li()}},[o]);return(0,Qs.useEffect)(()=>{let c=ls();i&&t&&c.inProgress&&c.headless&&!c.popupFlow&&s()},[i,t]),{initOAuth:l,loginWithOAuth:s,loading:n}}var Vu=require("react");var XC=()=>{let e=We(),{initLoginWithEmail:t,loginWithCode:r}=$(),o=(0,Vu.useCallback)(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=(0,Vu.useCallback)(async({code:i})=>{if(e.enabled&&e.status==="error")throw new Lr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};var Gu=require("react");var e0=()=>{let e=We(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=$(),n=(0,Gu.useCallback)(async({phoneNumber:a})=>{if(!a)throw new Error("SMS required to send OTP code");return t(a)},[t]),i=(0,Gu.useCallback)(async({code:a})=>{if(e.enabled&&e.status!=="success")throw new Lr(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:n,loginWithCode:i,state:o}};var qu=require("react");var t0=()=>{let e=We(),{generateSiweMessage:t,linkWithSiwe:r}=$(),o=(0,qu.useCallback)(async({address:i,chainId:a})=>{if(!i||!a)throw new Error("wallet address and chainId required to generate nonce");return t({address:i,chainId:a}).then(l=>l)},[t]),n=(0,qu.useCallback)(async({signature:i,message:a,chainId:l,walletClientType:s,connectorType:c})=>{if(e.enabled&&e.status!=="success")throw new Lr(e.error,null,"captcha_failure");return r({message:a,signature:i,chainId:l,walletClientType:s,connectorType:c})},[r,e.status]);return{generateSiweMessage:o,linkWithSiwe:n}};var r0=require("react");function o0(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:m,linkSpotify:f,linkInstagram:u,linkTelegram:v,linkFarcaster:b}=(0,r0.useContext)(De);return ze("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:m,linkSpotify:f,linkInstagram:u,linkFarcaster:b,linkTelegram:v}}var n0=require("react");function i0(e){let{connectWallet:t}=(0,n0.useContext)(De);return ze("connectWallet",e),{connectWallet:t}}var a0=require("react");function s0(e){let{createWallet:t}=(0,a0.useContext)(De);return ze("createWallet",e),{createWallet:t}}var l0=()=>{let{fundWallet:e}=$();return{fundWallet:e}};var c0=()=>{let{embeddedSolanaWallet:e,createEmbeddedSolanaWallet:t}=W();return{createWallet:t,wallets:e?[e]:[]}};var d0=()=>{let{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:n}=$();return{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessage:r,signTypedData:o,sendTransaction:n}};var p0=require("react");function u0(e){let{sendTransaction:t}=(0,p0.useContext)(De);return ze("sendTransaction",e),{sendTransaction:t}}var m0=require("react");function f0(e){let{setWalletPassword:t}=(0,m0.useContext)(De);return ze("setWalletPassword",e),{setWalletPassword:t}}var h0=require("react");function y0(e){let{setWalletRecovery:t}=(0,h0.useContext)(De);return ze("setWalletRecovery",e),{setWalletRecovery:t}}var g0=require("react");function v0(e){let{signMessage:t}=(0,g0.useContext)(De);return ze("signMessage",e),{signMessage:t}}var C0=require("react");function w0(e){let{signTypedData:t}=(0,C0.useContext)(De);return ze("signTypedData",e),{signTypedData:t}}var b0=require("react");var E0=()=>{let{isModalOpen:e}=(0,b0.useContext)(De);return{isOpen:e}};var T0=require("react");function S0(e){let{getAccessToken:t}=(0,T0.useContext)(De);return ze("accessToken",e),{getAccessToken:t}}function _0(e){let{authenticated:t,user:r}=$(),{initLoginWithOAuth:o}=W(),n=ia();return ze("oAuthAuthorization",e),{reauthorize:i=>E7(t,r,o,n,i.provider)}}var E7=async(e,t,r,o,n)=>{if(!e)throw o("linkAccount","onError","must_be_authenticated",{linkMethod:n}),new w("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some(a=>a.type.includes(n)))throw new w(`OAuth account of type ${n} not linked to the account.`);await r(n)};var P0=zu;function zu(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=$();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}function x0(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function A0(e){return e.find(r=>r.walletClientType==="privy"&&r.connectorType==="embedded"&&!r.imported)??null}0&&(module.exports={AsExternalProvider,Captcha,ConnectorManager,LoginModal,PrivyClient,PrivyProvider,PrivyProxyProvider,SUPPORTED_CHAINS,VERSION,WalletConnector,addRpcUrlOverrideToChain,errorIndicatesMaxMfaRetries,errorIndicatesMfaTimeout,errorIndicatesMfaVerificationFailed,getAccessToken,getEmbeddedConnectedWallet,useConnectWallet,useCreateWallet,useCrossAppAccounts,useExperimentalFarcasterSigner,useFarcasterSigner,useFundWallet,useLinkAccount,useLinkWithSiwe,useLogin,useLoginWithEmail,useLoginWithOAuth,useLoginWithSms,useLogout,useMfa,useMfaEnrollment,useModalStatus,useOAuthTokens,usePrivy,useRegisterMfaListener,useSendTransaction,useSetWalletPassword,useSetWalletRecovery,useSignMessage,useSignTypedData,useSolanaWallets,useToken,useWallets});
|
|
3331
|
+
`;var ol=require("react"),a0=require("react/jsx-runtime");function ZE({botUsername:e,scriptHost:t}){let r=document.createElement("script"),{origin:o}=new URL(t);return r.async=!0,r.src=`${o}/js/telegram-login.js`,r.setAttribute("data-telegram-login",e),r.setAttribute("data-request-access","write"),r.setAttribute("data-lang","en"),r}function i0(e){let t=(0,ol.useRef)(null),r=(0,ol.useRef)();return(0,ol.useEffect)(()=>{r.current?.remove(),r.current=ZE(e),t.current?.after(r.current)},[e]),(0,a0.jsx)("div",{ref:t,hidden:!0})}var s0=require("react"),es=require("react");var Jd=class{constructor(){this.callbacks={}}enqueue(t,r){this.callbacks[t]=r}dequeue(t,r){let o=this.callbacks[r];if(!o)throw new Error(`cannot dequeue ${t} event: no event found for id ${r}`);switch(delete this.callbacks[r],t){case"privy:iframe:ready":return o;case"privy:wallet:create":return o;case"privy:wallet:import":return o;case"privy:wallet:connect":return o;case"privy:wallet:recover":return o;case"privy:wallet:rpc":return o;case"privy:wallet:set-recovery":return o;case"privy:mfa:verify":return o;case"privy:mfa:init-enrollment":return o;case"privy:mfa:submit-enrollment":return o;case"privy:mfa:unenroll":return o;case"privy:mfa:clear":return o;case"privy:farcaster:init-signer":return o;case"privy:farcaster:sign":return o;case"privy:solana-wallet:create":return o;case"privy:solana-wallet:connect":return o;case"privy:solana-wallet:recover":return o;case"privy:solana-wallet:rpc":return o;default:throw new Error(`invalid wallet event type ${t}`)}}};async function ni(e,t,r,o,n,i=!1){let a=i,l=async m=>{if(a&&t&&t.length>0){m===(i?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new Ze("missing_or_invalid_mfa","MFA verification failed, retry."));let f=await new Promise((u,C)=>{r.current={resolve:u,reject:C};let v=1e3*60*5;setTimeout(()=>{let g=new Ze("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(g),C(g)},v)});return await e(f)}return await e()},s=4,c=null;for(let m=0;m<s;m++)try{c=await l(m),o.current?.resolve(void 0);break}catch(f){if(f.type==="missing_or_invalid_mfa")a=!0;else throw o.current?.resolve(void 0),f}if(c===null){let m=new Ze("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(m),m}return c}var c0=require("react/jsx-runtime"),QE=function(e){return()=>`id-${e++}`}(0);function JE(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function zt(e){return e.error!==void 0}var Lt=new Jd,Qu=new Map,XE=(e,t)=>typeof t=="bigint"?t.toString():t,e7=(e,t)=>`${e}${JSON.stringify(t,XE)}`;function $t(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let i=e7(e,t);if(e==="privy:wallet:create"){let l=Qu.get(i);if(l)return l}let a=new Promise((l,s)=>{let c=QE();Lt.enqueue(c,{resolve:l,reject:s}),n.postMessage({id:c,event:e,data:t},o)}).finally(()=>{Qu.delete(i)});return Qu.set(i,a),a}function t7(e){switch(e.event){case"privy:iframe:ready":let t=Lt.dequeue(e.event,e.id);return zt(e)?t.reject(new Ze(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=Lt.dequeue(e.event,e.id);return zt(e)?r.reject(new Ze(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:import":let o=Lt.dequeue(e.event,e.id);return zt(e)?o.reject(new Ze(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:connect":let n=Lt.dequeue(e.event,e.id);return zt(e)?n.reject(new Ze(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:recover":let i=Lt.dequeue(e.event,e.id);return zt(e)?i.reject(new Ze(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:rpc":let a=Lt.dequeue(e.event,e.id);return zt(e)?a.reject(new Ze(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:set-recovery":let l=Lt.dequeue(e.event,e.id);return zt(e)?l.reject(new Ze(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:verify":let s=Lt.dequeue(e.event,e.id);return zt(e)?s.reject(new Ze(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:init-enrollment":{let u=Lt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:submit-enrollment":{let u=Lt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:unenroll":{let u=Lt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:mfa:clear":{let u=Lt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:farcaster:init-signer":{let u=Lt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:farcaster:sign":{let u=Lt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}case"privy:solana-wallet:create":let c=Lt.dequeue(e.event,e.id);return zt(e)?c.reject(new Ze(e.error.type,e.error.message)):c.resolve(e.data);case"privy:solana-wallet:connect":let m=Lt.dequeue(e.event,e.id);return zt(e)?m.reject(new Ze(e.error.type,e.error.message)):m.resolve(e.data);case"privy:solana-wallet:recover":let f=Lt.dequeue(e.event,e.id);return zt(e)?f.reject(new Ze(e.error.type,e.error.message)):f.resolve(e.data);case"privy:solana-wallet:rpc":{let u=Lt.dequeue(e.event,e.id);return zt(e)?u.reject(new Ze(e.error.type,e.error.message)):u.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function l0(e){let t=(0,es.useRef)(null),r=(0,es.useRef)(e.mfaMethods),o=da(),[n,i]=(0,s0.useState)(!1);return(0,es.useEffect)(()=>{r.current=e.mfaMethods},[e.mfaMethods]),(0,es.useEffect)(()=>{if(!n)return;let a=t.current;if(!a)return;function l(u){u&&u.origin===e.origin&&JE(u.data)&&t7(u.data)}let s={create(u){return $t("privy:wallet:create",u,a,e.origin)},import(u){return $t("privy:wallet:import",u,a,e.origin)},connect(u){return $t("privy:wallet:connect",u,a,e.origin)},recover(u){return ni(C=>$t("privy:wallet:recover",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!u.recoveryMethod||u.recoveryMethod==="privy")},rpc(u){return ni(C=>$t("privy:wallet:rpc",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},createSolana(u){return $t("privy:solana-wallet:create",u,a,e.origin)},connectSolana(u){return $t("privy:solana-wallet:connect",u,a,e.origin)},recoverSolana(u){return $t("privy:solana-wallet:recover",u,a,e.origin)},rpcSolana(u){return $t("privy:solana-wallet:rpc",u,a,e.origin)},setRecovery(u){return ni(C=>$t("privy:wallet:set-recovery",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(u){return ni(C=>$t("privy:mfa:verify",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(u){return ni(C=>$t("privy:mfa:init-enrollment",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(u){return ni(C=>$t("privy:mfa:submit-enrollment",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(u){return ni(C=>$t("privy:mfa:unenroll",{...u,...C},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(u){return $t("privy:mfa:clear",u,a,e.origin)},initFarcasterSigner(u){return $t("privy:farcaster:init-signer",u,a,e.origin)},signFarcasterMessage(u){return $t("privy:farcaster:sign",u,a,e.origin)}};window.addEventListener("message",l);let c=()=>e.onLoad(s),m=(...u)=>{console.warn("Privy iframe failed to load: ",...u),e.onLoadFailed()},f=new AbortController;return os(()=>$t("privy:iframe:ready",{},a,e.origin),{abortSignal:f.signal}).then(c,m),()=>{window.removeEventListener("message",l),f.abort()}},[n]),(0,c0.jsx)("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>i(!0),src:_l(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}var Xd=class{constructor(t,r){this.walletProxy=t,this.address=r}async handleSignMessage(t,r){if(!t.params||typeof t.params.message!="string")throw new Error("Message must be provided as a string for Solana signMessage RPC");return(await this.walletProxy.rpcSolana({accessToken:r,publicKey:this.address,request:t})).response.data}async request(t){console.debug("EmbeddedSolanaProvider.request() called with args",t);let r=await Re();if(!r)throw new Error("User must be authenticated to use embedded Solana wallet");if(!await d0())throw new b("Unable to connect to Solana embedded wallet");switch(t.method){case"signMessage":return await this.handleSignMessage(t,r);default:throw new Error("Embedded Solana provider does not yet support this RPC method.")}}};async function p0({url:e,popup:t}){return t.location=e,new Promise((o,n)=>{let a=setTimeout(()=>{n(new b("Authorization request timed out after 2 minutes.")),l()},12e4);function l(){t?.close(),window.removeEventListener("message",m)}let s,c=setInterval(()=>{t?.closed&&!s&&(l(),clearInterval(c),clearTimeout(a),n(new b("User rejected request")))},300);function m(f){f.data&&(f.data.type==="PRIVY_OAUTH_RESPONSE"&&f.data.stateCode&&f.data.authorizationCode&&(clearTimeout(a),o(f.data),l()),f.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(a),n(new b(f.data.error)),l()),f.data.type==="PRIVY_OAUTH_USE_BROADCAST_CHANNEL"&&(s=new BroadcastChannel("popup-privy-oauth"),s.onmessage=m))}window.addEventListener("message",m)})}var r7="https://cdn.apple-cloudkit.com";async function Ju({url:e,popup:t,provider:r}){return t.location=e,new Promise((n,i)=>{function a(){t?.close(),window.removeEventListener("message",l)}function l(s){s.data&&(s.data.type==="PRIVY_OAUTH_RESPONSE"&&s.data.stateCode&&s.data.authorizationCode&&(n(s.data),a()),s.origin===r7&&s.data.ckSession&&(n({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:s.data.ckSession}),a()),s.data.type==="PRIVY_OAUTH_ERROR"&&(i(s.data.error),a()))}window.addEventListener("message",l)})}var u0=e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type});var tr=require("react/jsx-runtime"),on;function o7(e){return typeof e=="string"&&e.length===25}function Re(){if(!on){let e=X.get(ai);return Promise.resolve(e||null)}return on.getAccessToken()}var h0,Ff=(e,t,r)=>h0(e,t,r),y0,Bf=(e,t)=>y0(e,t),g0,Hf=(e,t)=>g0(e,t),v0,Gf=()=>v0(),C0,d0=()=>C0(),n7=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;X.put(as,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},w0=({config:e,...t})=>{if(!o7(t.appId))throw new b("Cannot initialize the Privy provider with an invalid Privy app ID");on||(on=new la({appId:t.appId,appClientId:t.clientId,apiUrl:t.apiUrl}));let r=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&r.embeddedWallets?.createOnLogin===void 0&&(r.embeddedWallets||(r.embeddedWallets={}),r.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),(0,tr.jsx)(Wh,{client:on,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:(0,tr.jsx)(i7,{...t,client:on})})},i7=e=>{let t=e.client,[r,o]=(0,ve.useState)(!1),[n,i]=(0,ve.useState)(!1),[a,l]=(0,ve.useState)(!1),[s,c]=(0,ve.useState)(null),[m,f]=(0,ve.useState)([]),[u,C]=(0,ve.useState)(null),v=(0,ve.useRef)(m),[g,E]=(0,ve.useState)(!1),[S,R]=(0,ve.useState)(null),[T,A]=(0,ve.useState)(!1),[k,M]=(0,ve.useState)({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:_}),[D,G]=(0,ve.useState)({status:"initial"}),[Y,Z]=(0,ve.useState)(null),[L,U]=(0,ve.useState)(null),O=dt(),Ie=ec(),[je,Q]=(0,ve.useState)(!0),[re,ae]=(0,ve.useState)({}),[Fe,Ne]=(0,ve.useState)(null),[ut,lt]=(0,ve.useState)(null),[Nt,at]=(0,ve.useState)(!1),[ge,Cr]=(0,ve.useState)(!1),go=(0,ve.useRef)(null),Lo=(0,ve.useRef)(null),N=(0,ve.useRef)(Qh),[_t,vo]=(0,ve.useState)(!1);t.onStoreToken=d=>{d&&B(N,"accessToken","onAccessTokenGranted",d)},t.onDeleteToken=()=>{c(null),l(!1),B(N,"accessToken","onAccessTokenRemoved")};let V=(0,ve.useRef)(null),q=(0,ve.useRef)(null),fe=d=>{R(d),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:d}})},Dt=d=>{O.embeddedWallets.createOnLogin!=="off"&&Q(!0),fe(d)};(0,ve.useEffect)(()=>{let d=yi(s);if(!d||!L)return;let p={address:d.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:Mn,id:"io.privy.solana.wallet"},getProvider:async()=>new Xd(L,d.address)};C(p)},[L,s]),(0,ve.useEffect)(()=>{if(!s){t.connectors?.removeEmbeddedWalletConnector();return}let d=Ae(s),p=Kl(s);if(d||t.connectors?.removeEmbeddedWalletConnector(),p||t.connectors?.removeImportedWalletConnector(),!t.connectors){console.debug("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!L){console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized");return}d&&t.connectors.addEmbeddedWalletConnector(L,d.address,O.defaultChain,e.appId),p&&t.connectors.addImportedWalletConnector(L,p.address,O.defaultChain,e.appId)},[L,s]),(0,ve.useEffect)(()=>{L&&ut?.(L)},[L]),(0,ve.useEffect)(()=>{(async()=>{if(!O.customAuth?.enabled)return;Q(!0);let{getCustomAccessToken:p,isLoading:h}=O.customAuth;if(!(!n||h))try{let w=await p();if(!w&&a){await Hi.logout();return}if(!w||a)return;t.startAuthFlow(new Vi(w));let{user:I,isNewUser:F}=await t.authenticate();if(!I){await Hi.logout();return}c(I||null),E(F||!1),l(!0),Cr(!0)}catch(w){console.warn(w),a&&await Hi.logout()}})()},[O.customAuth?.enabled,O.customAuth?.getCustomAccessToken,O.customAuth?.isLoading,n,a]),(0,ve.useEffect)(()=>{ge&&L&&s&&Sr(s,O.embeddedWallets.createOnLogin)&&(Cr(!1),nm(s,$i).catch(console.error))},[ge&&L&&s]),(0,ve.useEffect)(()=>{async function d(){let p=rs(),h=il();n7();let w=(0,m0.createStore)();t.initializeConnectorManager({walletConnectCloudProjectId:O.walletConnectCloudProjectId,rpcConfig:O.rpcConfig,chains:O.chains,defaultChain:O.defaultChain,store:w,walletList:O.appearance.walletList,shouldEnforceDefaultChainOnConnect:O.shouldEnforceDefaultChainOnConnect,externalWalletConfig:O.externalWallets,appName:O.name??"Privy"});let I;t.connectors?.on("connectorInitialized",()=>{I&&clearTimeout(I);let Me=t.connectors.walletConnectors.length,le=t.connectors.walletConnectors.reduce((yt,Be)=>yt+(Be.initialized?1:0),0);le===Me?vo(!0):I=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:le,expected:Me}),vo(!0)},1500)}),t.connectors?.initialize().then(()=>{ow()});let F=await t.getAuthenticatedUser(),j=!!F;if(O.customAuth?.enabled||(l(!!F),F&&B(N,"login","onComplete",F,!1,!0,null,null),c(F)),p){q.current=j?"link":"login";return}if(h&&!j){q.current="login",Dt("TELEGRAM_AUTH_SCREEN");return}he.setReadyToTrue(!!F)}!n&&Ie&&d()},[t,Fe,n,Ie]),(0,ve.useEffect)(()=>{if(!n)return;if(!s){at(!0);return}if(!!!s.linkedAccounts.find(h=>h.type==="wallet"&&h.walletClientType==="privy")){at(!0);return}let p=!!m.find(h=>h.walletClientType==="privy");at(p)},[n,s,m]);let rs=()=>{let d=ms();if(d.inProgress&&d.popupFlow){if(window.opener.location.origin!==window.location.origin){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."});return}if(d.authorizationCode==="error"){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."});return}window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:d.stateCode,authorizationCode:d.authorizationCode});return}let p="privy:";function h(w){return w.startsWith(p)}return d.inProgress&&h(d.provider)&&!d.popupFlow&&(new BroadcastChannel("popup-privy-oauth").postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:d.stateCode,authorizationCode:d.authorizationCode}),window.close()),!d.inProgress||d.headless?!1:(t.startAuthFlow(new Do(d)),Dt("AWAITING_OAUTH_SCREEN"),!0)},il=()=>{let d=Lf();if(!d||!O.loginMethods.telegram||!O.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let p=new Zi;return t.startAuthFlow(p),d.flowType==="login-url"&&(p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult={id:d.id,first_name:d.first_name,last_name:d.last_name,auth_date:d.auth_date,username:d.username,photo_url:d.photo_url,hash:d.hash}),d.flowType==="web-app"&&(p.meta.telegramAuthResult=void 0,p.meta.telegramWebAppData={query_id:d.query_id,user:d.user,auth_date:d.auth_date,hash:d.hash}),!0},rw=async(d,p,h,w)=>{let I=await t.connectors?.createWalletConnector(d,p)||null;tp(I,p,h,w)};async function tp(d,p,h,w){if(d)M({status:"disconnected",connectedWallet:null,connectError:null,connector:d,connectRetry:_});else return M({status:"disconnected",connectedWallet:null,connectError:new we("Unable to connect to wallet."),connector:null,connectRetry:_}),w?.(null,h);d instanceof To&&p&&await d.resetConnection(p),M({connector:d,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>tp(d,p,h,w)});try{let I=await d.connect({showPrompt:!0});if(O.shouldEnforceDefaultChainOnConnect&&!O.chains.find(F=>F.id===Number(I?.chainId.replace("eip155:","")))&&!(I?.connectorType==="wallet_connect_v2"&&I?.walletClientType==="metamask")){M(F=>({...F,connector:d,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:_}));try{await I?.switchChain(O.defaultChain.id),I&&(I.chainId=zi(ii(O.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${O.defaultChain.id}`)}}return M(F=>({...F,status:"connected",connectedWallet:I,connectError:null,connectRetry:_})),I&&B(N,"connectWallet","onSuccess",I),w?.(I,h)}catch(I){return I instanceof wt?(console.warn(I.cause?I.cause:I.message),B(N,"connectWallet","onError",I.privyErrorCode||"generic_connect_wallet_error")):(console.warn(I),B(N,"connectWallet","onError","unknown_connect_wallet_error")),M(F=>({...F,status:"disconnected",connectedWallet:null,connectError:I})),w?.(null,h)}}let al=async(d,p)=>{if(d===null)return;let h=new sn(d,t,p);t.startAuthFlow(h)},ow=()=>{let d=new URLSearchParams(window.location.search),p=d.get("privy_connector"),h=d.get("privy_wallet_client");if(!p||!h)return;if(h==="phantom"&&!An()&&Dt("LOGIN_FAILED_SCREEN"),!t.connectors)throw new b("Connector not initialized");fe("AWAITING_CONNECTION");let w=new URL(window.location.href);w.searchParams.delete("privy_connector"),w.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",w),rw(p,h,void 0,al)};(0,ve.useEffect)(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(c)},[n,a,s,t]);let It=d=>{if(!a)throw B(N,"linkAccount","onError","must_be_authenticated",{linkMethod:d}),new b("User must be authenticated before linking an account.")},om=()=>{It("siwe"),V.current="siwe",q.current="link",fe("LINK_WALLET_SCREEN")},nw=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},iw=async d=>{if(!t.connectors)throw new b("Connector not initialized");let p=t.connectors.findWalletConnector(d.connectorType,d.walletClientType)||null;if(M(h=>({...h,connector:p,status:"connected",connectedWallet:d,connectError:null,connectRetry:_})),O.captchaEnabled&&!a){let h={callback:w=>al(d,w),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};ae({captchaModalData:h}),Dt("CAPTCHA_SCREEN")}else await al(d),Dt("AWAITING_CONNECTION")},aw=async(d,p)=>{let{signedUrl:h,externalTransactionId:w}=await H2(t,d,p??{},O.appearance.palette,O.fundingMethodConfig?.moonpay.useSandbox??!1);return{signedUrl:h,externalTransactionId:w}},sl=()=>{f(d=>{let p=t.connectors?.wallets.map(h=>({...h,linked:nw(h),loginOrLink:async()=>{if(!await h.isConnected())throw new b("Wallet is not connected");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new b("Cannot link or login with embedded wallet");iw(h)},fund:async w=>{await he.fundWallet(h.address,w)},unlink:async()=>{if(!a)throw new b("User is not authenticated.");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new b("Cannot unlink an embedded wallet");let w=await t.unlinkWallet(h.address);c(w)}}))||[];return jl(d,p)?d:p})};(0,ve.useEffect)(()=>{sl()},[s?.linkedAccounts,a,n]),(0,ve.useEffect)(()=>{if(n){if(!t.connectors)throw new b("Connector not initialized");sl(),t.connectors.on("walletsUpdated",sl)}},[n]);let sw=d=>{if(d&&"suggestedAddress"in d&&d.suggestedAddress){let p=(0,rn.getAddress)(d.suggestedAddress);Z(p)}fe(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};(0,ve.useEffect)(()=>{if(!m[0])return;let d=m[0],p=v.current.find(w=>w.address===d.address),h;if(d.walletClientType==="privy"?h=s?.linkedAccounts.find(w=>w.type==="wallet"&&w.address===d.address&&w.walletClientType==="privy"):h=s?.linkedAccounts.find(w=>w.type==="wallet"&&w.address===d.address&&w.walletClientType!=="privy"),!p&&h){let w=Object.assign({},s);w.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported},c(w)}v.current=m},[m]);let nm=async(d,p)=>{if(Ae(d))throw B(N,"createWallet","onError","embedded_wallet_already_exists"),new Error("Only one Privy wallet per user is currently allowed");let[w,I]=await Promise.all([he.initializeWalletProxy(p),Re()]);if(!w&&O.customAuth?.enabled)throw B(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!w||!I||O.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((F,j)=>{Q(!0),ae({createWallet:{onSuccess:le=>{B(N,"createWallet","onSuccess",le),F(le)},onFailure:le=>{B(N,"createWallet","onError","unknown_embedded_wallet_error"),j(le)},callAuthOnSuccessOnClose:!1}}),fe("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await w.create({accessToken:I});let F=await he.refreshUser(),j=Ae(F);if(!j)throw B(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return B(N,"createWallet","onSuccess",j),j}},lw=d=>{if(!O.chains.map(p=>p.id).includes(d))throw new we(`Chain ID ${d} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},im=(d,p,h)=>new Promise(async(w,I)=>{let{requesterAppId:F}=p||{};if(!a||!s){B(N,"sendTransaction","onError","must_be_authenticated"),I(new Error("User must be authenticated before signing with a Privy wallet"));return}let j=d.from,Me=j?s?.linkedAccounts.find(gt=>gt.type==="wallet"&>.walletClientType==="privy"&&(0,rn.getAddress)(gt.address)===(0,rn.getAddress)(j)):Ae(s);if(!Me){B(N,"sendTransaction","onError","embedded_wallet_not_found"),I(new Error("Must have a Privy wallet before signing"));return}Q(!0);let le=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,yt=d.chainId?Number(d.chainId):le.chainId;lw(yt);let Be=Object.assign({},d,{chainId:yt}),br=async()=>{let gt=await Re();if(!gt||!L){B(N,"sendTransaction","onError","embedded_wallet_not_found"),I(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await he.recoverEmbeddedEthereumWallet()){B(N,"sendTransaction","onError","unknown_connect_wallet_error"),I(new Error("Unable to connect to wallet"));return}let Gi=Er(Be.chainId,O.chains,O.rpcConfig,{appId:e.appId}),No=await(0,ts.populateTransactionRequest)(Me.address,Be,Gi);if(O.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:pw}=await(0,ts.calculateTotalGasEstimate)(No,Gi),{hasSufficientFunds:uw}=await Wa(Me.address,No,pw,Gi);if(!uw)throw new Kt(new oo("Wallet has insufficient funds for this transaction.",ts.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let dm=await zc(gt,Me.address,L,No,Gi,F);B(N,"sendTransaction","onSuccess",dm),w(dm)}catch(cl){B(N,"sendTransaction","onError","transaction_failure"),I(cl)}};if(O.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),br();else{let gt={transactionRequest:Be,onSuccess:No=>{B(N,"sendTransaction","onSuccess",No),w(No)},onFailure:No=>{B(N,"sendTransaction","onError","transaction_failure"),I(No)},uiOptions:p||{},fundWalletConfig:h,requesterAppId:F},cl={onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:No=>{B(N,"sendTransaction","onError","unknown_connect_wallet_error"),I(No)}},Gi=lm({address:Me.address,fundWalletConfig:h,chainIdOverride:Be.chainId,comingFromSendTransactionScreen:!0});ae({connectWallet:cl,sendTransaction:gt,funding:Gi}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function am(){return new Promise(async(d,p)=>{let h=await Re();if(!h||!L)throw new Error("Must have valid access token to enroll in MFA");try{await L.verifyMfa({accessToken:h}),d()}catch(w){p(w)}})}let sm=d=>d?.linkedAccounts.filter(p=>p.latestVerifiedAt!==null&&!(p.type==="wallet"&&p.walletClientType==="privy")).sort((p,h)=>h.latestVerifiedAt.getTime()-p.latestVerifiedAt.getTime())[0],wr=d=>{let p=s?.linkedAccounts.filter(I=>I.type===d).length??0,{displayName:h,loginMethod:w}=Xn(d);if(d==="passkey"&&p>=5||d!=="passkey"&&p>=1)throw B(N,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:w}),new b(`User already has an account of type ${h} linked.`)},cw=()=>{if(!O.loginConfig.telegramAuthConfiguration?.linkEnabled)throw B(N,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:"telegram"}),new b("User can't link an account because Telegram linking is disabled.")},lm=({address:d,fundWalletConfig:p,methodScreen:h,chainIdOverride:w=null,comingFromSendTransactionScreen:I=!1})=>{if(!O.fundingConfig||O.fundingConfig.methods.length===0)return;let F=cd(p)&&p.amount?p.amount:O.fundingConfig.defaultRecommendedAmount,j=cd(p)&&p.chain?p.chain.id:La(O.fundingConfig.defaultRecommendedCurrency.chain),Me=cd(p)&&p.chain?p.chain:O.chains.find(le=>le.id===j);if(w&&O.chains.find(le=>le.id===w)&&(Me=O.chains.find(le=>le.id===w)),!Me)throw new b("Funding chain is not in PrivyProvider chains list");return{address:d,amount:F,chain:Me,methodScreen:h,comingFromSendTransactionScreen:I,...B2(p)?{moonpayConfigOverride:p.config}:{}}};async function cm({legacySetWalletPasswordFlow:d=!1}){R(null);let p=d?"setWalletPassword":"setWalletRecovery";if(!a||!s)throw B(N,p,"onError","must_be_authenticated"),new Error("User must be authenticated before adding recovery method to Privy wallet");let h=Ae(s);if(!h||!L)throw B(N,p,"onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a recovery method");if(yi(s))throw new Error("Cannot set user-controlled recovery for user with Solana.");try{await am()}catch(I){throw B(N,p,"onError","missing_or_invalid_mfa"),I}return new Promise((I,F)=>{Q(!0);let j={onSuccess:Be=>{B(N,p,"onSuccess","user-passcode",Be),I(Be)},onFailure:Be=>{B(N,p,"onError","user_exited_set_password_flow"),F(Be)},callAuthOnSuccessOnClose:!1},Me=h.recoveryMethod==="user-passcode",yt={onCompleteNavigateTo:Lc({walletAction:"update",availableRecoveryMethods:O.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:d,isResettingPassword:Me}),shouldForceMFA:!1,onFailure:Be=>{B(N,p,"onError","unknown_connect_wallet_error"),F(Be)}};ae({setWalletPassword:j,createWallet:j,connectWallet:yt,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:Me}}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")})}async function ll({appId:d}){It(`privy:${d}`),V.current=`privy:${d}`,q.current="link";let p=window.open(void 0,void 0,Ns({w:440,h:680}));return t.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{appId:d}}),new Promise(async(h,w)=>{let{name:I,logoUrl:F}=await Qc({api:t.api,providerAppId:d,requesterAppId:O.id});ae({crossAppAuth:{appId:d,name:I,logoUrl:F,popup:p,onSuccess:h,onError:w}}),Dt("CROSS_APP_AUTH_SCREEN")})}let Hi={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:sw,importWallet:async({privateKey:d})=>{It("siwe");let[p,h]=await Promise.all([he.initializeWalletProxy(15e3),Re()]);if(p&&h){await p.import({privateKey:d,accessToken:h});let w=await he.refreshUser(),I=Kl(w);if(!I)throw B(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to import wallet");return B(N,"createWallet","onSuccess",I),I}else throw new b("User is not authenticated")},linkWallet:om,linkCrossAppAccount:ll,linkEmail:()=>{It("email"),wr("email"),V.current="email",q.current="link",fe("LINK_EMAIL_SCREEN")},linkPhone:()=>{It("sms"),wr("phone"),V.current="sms",q.current="link",fe("LINK_PHONE_SCREEN")},linkGoogle:async()=>{It("google"),wr("google_oauth"),q.current="link",await he.initLoginWithOAuth("google")},linkTwitter:async()=>{It("twitter"),wr("twitter_oauth"),q.current="link",await he.initLoginWithOAuth("twitter")},linkDiscord:async()=>{It("discord"),wr("discord_oauth"),q.current="link",await he.initLoginWithOAuth("discord")},linkGithub:async()=>{It("github"),wr("github_oauth"),q.current="link",await he.initLoginWithOAuth("github")},linkSpotify:async()=>{It("spotify"),wr("spotify_oauth"),q.current="link",await he.initLoginWithOAuth("spotify")},linkInstagram:async()=>{It("instagram"),wr("instagram_oauth"),q.current="link",await he.initLoginWithOAuth("instagram")},linkTiktok:async()=>{It("tiktok"),wr("tiktok_oauth"),q.current="link",await he.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{It("linkedin"),wr("linkedin_oauth"),q.current="link",await he.initLoginWithOAuth("linkedin")},linkApple:async()=>{It("apple"),wr("apple_oauth"),q.current="link",await he.initLoginWithOAuth("apple")},linkPasskey:async()=>{It("passkey"),wr("passkey"),await he.initLinkWithPasskey(),fe("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{It("telegram"),wr("telegram"),cw(),q.current="link",V.current="telegram",await he.initLoginWithTelegram(),fe("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{It("farcaster"),wr("farcaster"),await he.initLoginWithFarcaster(),q.current="link",V.current="farcaster",fe("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(It("email"),!s?.email)throw new b("User does not have an email linked to their account.");q.current="link",V.current="email",fe("UPDATE_EMAIL_SCREEN")},login:async d=>{d&&"target"in d&&d&&(d=void 0);let p="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!n){let h=await new Promise(w=>{Ne(I=>w.bind(I))});if(Ne(null),h){console.warn(p);return}}if(a){console.warn(p);return}q.current="login",ae({login:d}),Dt("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(d=>{Ne(()=>d)}),Ne(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(m[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}Dt("CONNECT_OR_CREATE")},logout:async()=>{if(s&&t.clearProviderAcccessTokens(s),R(null),await t.logout(),s&&L)try{await L.clearMfa({userId:s.id})}catch{}c(null),l(!1),B(N,"logout","onSuccess"),q.current=null,V.current=null,o(!1),X.del(ss)},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new ct;let d=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(w=>w.address===d?.address));return!d||!p?new ct:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new ep.Web3Provider(new wo(new ct));let d=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(w=>w.address===d?.address));return!d||!p?new ep.Web3Provider(new wo(new ct)):new ep.Web3Provider(new wo(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new In(new ct);let d=m.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(w=>w.address===d?.address));return!d||!p?new In(new ct):new In(p.proxyProvider)},unlinkWallet:async d=>{let p=await t.unlinkWallet(d);return c(p),p},unlinkEmail:async d=>{let p=await t.unlinkEmail(d);return c(p),p},unlinkPhone:async d=>{let p=await t.unlinkPhone(d);return c(p),p},unlinkGoogle:async d=>{let p=await t.unlinkOAuth("google",d);return c(p),p},unlinkTwitter:async d=>{let p=await t.unlinkOAuth("twitter",d);return c(p),p},unlinkDiscord:async d=>{let p=await t.unlinkOAuth("discord",d);return c(p),p},unlinkGithub:async d=>{let p=await t.unlinkOAuth("github",d);return c(p),p},unlinkSpotify:async d=>{let p=await t.unlinkOAuth("spotify",d);return c(p),p},unlinkInstagram:async d=>{let p=await t.unlinkOAuth("instagram",d);return c(p),p},unlinkTiktok:async d=>{let p=await t.unlinkOAuth("tiktok",d);return c(p),p},unlinkLinkedIn:async d=>{let p=await t.unlinkOAuth("linkedin",d);return c(p),p},unlinkApple:async d=>{let p=await t.unlinkOAuth("apple",d);return c(p),p},unlinkFarcaster:async d=>{let p=await t.unlinkFarcaster(d);return c(p),p},unlinkTelegram:async d=>{let p=await t.unlinkTelegram(d);return c(p),p},unlinkPasskey:async d=>{let p=await t.unlinkPasskey(d);return c(p),p},unlinkCrossAppAccount:async({subject:d})=>{let p=s?.linkedAccounts.find(w=>w.type==="cross_app"&&w.subject===d)?.providerApp;if(!p)throw new b("Invalid subject");t.storeProviderAccessToken(p.id,null);let h=await t.unlinkOAuth(`privy:${p.id}`,d);return c(h),h},setActiveWallet:async d=>{let p=m.find(w=>(0,rn.getAddress)(w.address)===(0,rn.getAddress)(d)),h=s?.linkedAccounts.find(w=>w.type==="wallet"&&(0,rn.getAddress)(w.address)===(0,rn.getAddress)(d));if(!p||!await p.isConnected())Z(d),om();else if(!p.linked)p.loginOrLink();else{let w=Object.assign({},s);w.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported},c(w)}},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!a||!s)throw B(N,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return nm(s,15e3)},setWalletRecovery:async()=>cm({legacySetWalletPasswordFlow:!1}),setWalletPassword:async()=>cm({legacySetWalletPasswordFlow:!0}),signMessage:(d,p,h)=>new Promise(async(w,I)=>{let{requesterAppId:F}=p||{};if(!a||!s){B(N,"signMessage","onError","must_be_authenticated"),I(new Error("User must be authenticated before signing with a Privy wallet"));return}let j=h?s?.linkedAccounts.find(le=>le.type==="wallet"&&le.walletClientType==="privy"&&(0,rn.getAddress)(le.address)===(0,rn.getAddress)(h)):Ae(s);if(!j){B(N,"signMessage","onError","embedded_wallet_not_found"),I(new Error("Must have a Privy wallet before signing"));return}if(typeof d!="string"||d.length<1){B(N,"signMessage","onError","invalid_message"),I(new Error("Message must be a non-empty string"));return}Q(!0);let Me=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let le=await Re();if(!L||!le)throw new Error("Unable to connect to wallet");if(!await he.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:j.address,requesterAppId:F}});let{response:Be}=await L.rpc({accessToken:le,address:j.address,requesterAppId:F,request:{method:"personal_sign",params:[d,j.address]}}),br=Be.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:j.address,requesterAppId:F}}),br};if(O.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let le=await Me();B(N,"signMessage","onSuccess",le),w(le)}catch(le){B(N,"signMessage","onError","unable_to_sign"),I(le??new Kt("Unable to sign message"))}}else{let Be={method:"personal_sign",data:d,confirmAndSign:Me,onSuccess:gt=>{B(N,"signMessage","onSuccess",gt),w(gt)},onFailure:gt=>{B(N,"signMessage","onError","unable_to_sign"),I(gt)},uiOptions:p||{}},br={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:gt=>{B(N,"signMessage","onError","unknown_connect_wallet_error"),I(gt)},address:j.address};ae({signMessage:Be,connectWallet:br}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(d,p)=>new Promise(async(h,w)=>{let{requesterAppId:I}=p||{};if(!a||!s){B(N,"signTypedData","onError","must_be_authenticated"),w(new Error("User must be authenticated before signing with a Privy wallet"));return}let F=Ae(s);if(!F){B(N,"signTypedData","onError","embedded_wallet_not_found"),w(new Error("Must have a Privy wallet before signing"));return}Q(!0);let j=ns(d),Me=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let le=await Re();if(!L||!le)throw new Error("Unable to connect to wallet");if(!await he.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:F.address,requesterAppId:I}});let{response:Be}=await L.rpc({accessToken:le,address:F.address,requesterAppId:I,request:{method:"eth_signTypedData_v4",params:[F.address,j]}}),br=Be.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:F.address,requesterAppId:I}}),br};if(O.embeddedWallets.noPromptOnSignature||(O.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let le=await Me();B(N,"signTypedData","onSuccess",le),h(le)}catch(le){B(N,"signTypedData","onError","unable_to_sign"),w(le??new Kt("Unable to sign message"))}}else{let Be={method:"eth_signTypedData_v4",data:j,confirmAndSign:Me,onSuccess:gt=>{B(N,"signTypedData","onSuccess",gt),h(gt)},onFailure:gt=>{B(N,"signTypedData","onError","unable_to_sign"),w(gt)},uiOptions:p||{}},br={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:gt=>{B(N,"signMessage","onError","unknown_connect_wallet_error"),w(gt)}};ae({signMessage:Be,connectWallet:br}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(d,p,h)=>{let I=await(await im(d,p,h)).wait();return $c(I)},exportWallet:()=>new Promise(async(d,p)=>{if(!a||!s){p(new Error("User must be authenticated before exporting their Privy wallet"));return}if(!Ae(s)){p(new Error("Must have a Privy wallet before exporting"));return}Q(!0);let w={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:p,shouldForceMFA:!0};if(ae(re),!await Re()||!L){p(new Error("Must have valid access token to enroll in MFA"));return}if(!L){p(new Error("Must have a Privy wallet before exporting"));return}let F={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,onSuccess:d,onFailure:p};ae({keyExport:F,connectWallet:w}),fe("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:am,async init(d){switch(d){case"sms":await t.initMfaSmsVerification();return;case"passkey":return await t.initMfaPasskeyVerification();case"totp":return;default:throw new Error(`Unsupported MFA method: ${d}`)}},async submit(d,p){switch(d){case"totp":case"sms":if(typeof p!="string")throw new b("Invalid MFA code");go.current?.resolve({mfaMethod:d,mfaCode:p,relyingParty:window.origin}),await new Promise((F,j)=>{Lo.current={resolve:F,reject:j}});break;case"passkey":if(typeof p=="string")throw new b("Invalid authenticator response");let w=await(await import("@simplewebauthn/browser")).startAuthentication(p),I=u0(w);go.current?.resolve({mfaMethod:d,mfaCode:I,relyingParty:window.origin}),await new Promise((F,j)=>{Lo.current={resolve:F,reject:j}});break;default:throw go.current?.reject(new b("Unsupported MFA method")),new b(`Unsupported MFA method: ${d}`)}},cancel(){go.current?.reject(new b("MFA canceled"))},async initEnrollmentWithSms(d){let p=await Re();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber})},enrollInMfa(d){return new Promise((p,h)=>{if(!d){he.closePrivyModal(),p();return}O.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),ae({mfaEnrollmentFlow:{mfaMethods:O.mfa.methods,onSuccess:p,onFailure:h}}),fe("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let d=await Re();if(!d||!L)throw new Error("Must have valid access token to enroll in MFA");let p=await L.initEnrollMfa({method:"totp",accessToken:d});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(d){let p=await Re();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:d.phoneNumber,code:d.mfaCode});let h=await t.getAuthenticatedUser();c(h)},async submitEnrollmentWithTotp(d){let p=await Re();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"totp",accessToken:p,code:d.mfaCode});let h=await t.getAuthenticatedUser();c(h)},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:d}){let p=await Re();if(!p||!L)throw new Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:d});let h=await t.getAuthenticatedUser();c(h)},async unenroll(d){let p=await Re();if(!p||!L)throw new Error("Must have valid access token to remove MFA");d==="passkey"?await L.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:[]}):await L.unenrollMfa({method:d,accessToken:p});let h=await t.getAuthenticatedUser();c(h)},requestFarcasterSignerFromWarpcast:async()=>{let d=await Re(),p=s?.linkedAccounts.find(I=>I.type==="wallet"&&I.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await he.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");let w=await L.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:d,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(w.status==="approved"){let I=await t.getAuthenticatedUser();c(I||s||null)}ae({farcasterSigner:w}),fe("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let d=await Re(),p=s?.linkedAccounts.find(I=>I.type==="wallet"&&I.walletClientType==="privy");if(!d)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await he.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!s.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");return(I=>Uint8Array.from(I.match(/.{1,2}/g).map(F=>parseInt(F,16))))(s.farcaster.signerPublicKey.slice(2))},signFarcasterMessage:async d=>{let p=await Re(),h=s?.linkedAccounts.find(j=>j.type==="wallet"&&j.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!h)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 he.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!s.farcaster?.signerPublicKey)throw new Error("Must have a Farcaster signer public key to sign");let I=await import("@simplewebauthn/browser"),F=await L.signFarcasterMessage({address:h.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{hash:I.bufferToBase64URLString(d)},fid:BigInt(s.farcaster.fid),relyingParty:window.origin});return new Uint8Array(I.base64URLStringToBuffer(F.signature))},isHeadlessOAuthLoading:T,loginWithCode(d){return he.loginWithCode(d)},initLoginWithEmail(d){return he.initLoginWithEmail(d)},initLoginWithSms(d){return he.initLoginWithSms(d)},otpState:D,fundWallet(d,p){return he.fundWallet(d,p)},initLoginWithHeadlessOAuth(d,p){return he.initLoginWithHeadlessOAuth(d,p)},loginWithHeadlessOAuth(d){return he.loginWithHeadlessOAuth(d)},generateSiweMessage({address:d,chainId:p}){return he.generateSiweMessage({address:d,chainId:p})},linkWithSiwe({message:d,signature:p,chainId:h,walletClientType:w,connectorType:I}){return It("siwe"),he.linkWithSiwe({message:d,signature:p,chainId:h,walletClientType:w,connectorType:I})},signMessageWithCrossAppWallet(d,{address:p}){return Jc({user:s,client:t,address:p,requesterAppId:O.id,request:{method:"personal_sign",params:[d,p]},reconnect:ll})},signTypedDataWithCrossAppWallet(d,{address:p}){let h=ns(d);return Jc({user:s,client:t,address:p,requesterAppId:O.id,request:{method:"eth_signTypedData_v4",params:[p,h]},reconnect:ll})},sendTransactionWithCrossAppWallet(d,{address:p}){return Jc({user:s,client:t,address:p,requesterAppId:O.id,request:{method:"eth_sendTransaction",params:[d]},reconnect:ll})},isModalOpen:r,mfaMethods:O.mfa.methods};h0=Hi.signMessage,y0=Hi.signTypedData,g0=async(...d)=>{let p=await im(...d);return O.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let he=(()=>({isNewUserThisSession:g,linkingOrConnectingHint:Y,pendingTransaction:null,walletConnectionStatus:k,connectors:t.connectors?.walletConnectors??[],rpcConfig:O.rpcConfig,chains:O.chains,appId:e.appId,showFiatPrices:O.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:d=>O.chains.find(p=>p.id===Number(d))?.nativeCurrency.symbol,initializeWalletProxy:async d=>{if(L)return L;let p=new Promise(I=>{lt(()=>F=>I(F))}),h=new Promise(I=>setTimeout(()=>I(null),d)),w=await Promise.race([p,h]);return lt(null),w},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:async(d={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s,h;if(p&&V.current&&(h=sm(s)),q.current==="login"?d.shouldCallAuthOnSuccess&&p&&V.current?(B(N,"login","onComplete",s,g,!1,V.current,h??null),e.onSuccess?.(s,g)):B(N,"login","onError","exited_auth_flow"):q.current==="link"&&h&&(d.isSuccess&&p&&V.current?B(N,"linkAccount","onSuccess",s,V.current,h):V.current&&B(N,"linkAccount","onError","exited_link_flow",{linkMethod:V.current})),S&&b3.includes(S)&&re.funding){let w=E3[S]??null,I=Er(re.funding.chain.id,O.chains,O.rpcConfig,{appId:e.appId}),F;try{F=(await I.getBalance(re.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}B(N,"fundWallet","onUserExited",{address:re.funding.address,chain:re.funding.chain,fundingMethod:w,balance:F})}Z(null),q.current=null,V.current=null,E(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},openPrivyModal:fe,connectWallet:tp,initLoginWithWallet:async(d,p)=>{V.current="siwe",al(d,p)},loginWithWallet:async()=>{if(!n)throw new nn;if(!(t.authFlow instanceof sn))throw new b("Must initialize SIWE flow first.");let d,p;if(a)try{({user:d}=await t.link()),V.current="siwe"}catch(h){throw B(N,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),h}else try{({user:d,isNewUser:p}=await t.authenticate()),V.current="siwe"}catch(h){throw B(N,"login","onError",h.privyErrorCode||"generic_connect_wallet_error"),h}c(d||s||null),E(p||!1),l(!0)},initLoginWithFarcaster:async d=>{let p=new is(d);t.startAuthFlow(p);try{V.current="farcaster",await p.initializeFarcasterConnect()}catch(h){throw q.current==="login"?B(N,"login","onError",h.privyErrorCode||"unknown_auth_error"):q.current==="link"&&B(N,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"farcaster"}),h}},loginWithFarcaster:async()=>{if(!n)throw new nn;if(!(t.authFlow instanceof is))throw new b("Must initialize Farcaster flow first.");let d,p;if(a)try{({user:d}=await t.link()),V.current="farcaster"}catch(h){throw B(N,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"farcaster"}),h}else try{({user:d,isNewUser:p}=await t.authenticate()),V.current="farcaster"}catch(h){throw B(N,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}c(d||null),E(p||!1),l(!0)},async crossAppAuthFlow({appId:d,popup:p}){let h=`privy:${d}`;V.current=h;let{url:w,stateCode:I,codeVerifier:F}=await z1({api:t.api,appId:d});if(!w)throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:d}}),new b("No authorization URL returned for cross-app auth.");try{let j=await p0({url:w,popup:p,provider:h}),Me=j.stateCode,le=j.authorizationCode;if(Me!==I)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:h,storedStateCode:I??"",returnedStateCode:Me??""}}),new b("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let yt=await $1({api:on.api,appId:d,codeVerifier:F,stateCode:Me,authorizationCode:le});yt&&t.storeProviderAccessToken(d,yt);let Be=await he.refreshUser();if(!Be)throw new b("Unable to update user");return t.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{appId:d}}),Be}catch(j){throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:j.toString(),provider:h}}),j}},async initLoginWithOAuth(d,p){if(V.current=d,ip()){if(d==="google"&&ha(window.navigator.userAgent)){Dt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{Dt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}d==="twitter"&&window.opener&&window.opener.postMessage({type:"PRIVY_OAUTH_USE_BROADCAST_CHANNEL"},"*"),X.del(ci);let h=new Do({provider:d});p&&h.addCaptchaToken(p),t.startAuthFlow(h);let w=await t.authFlow.getAuthorizationUrl();w&&w.url&&(d==="twitter"&&f0.isAndroid&&(w.url=w.url.replace("x.com","twitter.com")),window.location.assign(w.url))},async initLoginWithTelegram(d){if(!n)throw new nn;V.current="telegram";let p=new Zi(d);t.startAuthFlow(p),p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult=await new Promise((h,w)=>{if(!O.loginConfig.telegramAuthConfiguration)return w(new b("Telegram Auth configuration is not loaded"));if(!window.Telegram)return w(new b("Telegram was not initialized"));window.Telegram.Login.auth({bot_id:O.loginConfig.telegramAuthConfiguration.botId,request_access:!0},I=>I?h(I):w(new b("Telegram auth failed or was canceled by the client")))})},async loginWithTelegram(){if(!(t.authFlow instanceof Zi))throw new b("Must initialize Telegram flow before calling loginWithTelegram");let d,p;if(a)try{({user:d}=await t.link()),V.current="telegram"}catch(h){throw B(N,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),h}else try{let h=await t.authenticate();d=h.user,p=h.isNewUser,V.current="telegram"}catch(h){throw q.current==="login"?B(N,"login","onError",h.privyErrorCode||"unknown_auth_error"):q.current==="link"&&B(N,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),h}c(d),E(p||!1),l(!0)},async recoveryOAuthFlow(d,p,h){let w,I;function F(j){if(!j)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:d}}),new b("Recovery OAuth failed")}switch(d){case"google-drive":{let{url:j,codeVerifier:Me,stateCode:le}=await eu({api:on.api,provider:d});F(j);let yt,Be;try{let br=await Ju({url:j,popup:h,provider:d});if(yt=br.stateCode,Be=br.authorizationCode,yt!==le)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:le??"",returnedStateCode:yt??""}}),new b("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected")}catch(br){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:br.toString(),provider:d}}),new b("Recovery OAuth failed")}[w,I]=await Promise.all([Re(),dg({api:on.api,provider:d,codeVerifier:Me,stateCode:yt,authorizationCode:Be})]);break}case"icloud":{let{url:j}=await eu({api:on.api,provider:d});F(j);let{ckWebAuthToken:Me}=await Ju({url:j,popup:h,provider:d});I=Me,w=await Re();break}}if(!L)throw new b("Cannot connect to wallet proxy");if(!w)throw new b("Unable to authorize user");switch(p){case"recover":let j=re.recoverWallet?.privyWallet?.address;if(!j)throw new b("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:j,recoveryMethod:d}}),await L.recover({address:j,accessToken:w,recoveryAccessToken:I,recoveryMethod:d}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:j,recoveryMethod:d}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await L.create({accessToken:w,recoveryAccessToken:I,recoveryMethod:d});let Me=await he.refreshUser(),le=Ae(Me);if(!le)throw B(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:le.address}}),B(N,"createWallet","onSuccess",le);break;case"set-recovery":let yt=Ae(s);if(!yt)throw B(N,"setWalletRecovery","onError","embedded_wallet_not_found"),new Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{recoveryMethod:d}}),await L.setRecovery({address:yt.address,accessToken:w,recoveryAccessToken:I,recoveryMethod:d});let Be=Ae(await he.refreshUser());if(!Be)throw B(N,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:yt.address,recoveryMethod:d}}),B(N,"setWalletRecovery","onSuccess",d,Be);break;default:throw new b("Unsupported recovery action")}},async loginWithOAuth(d){if(!(t.authFlow instanceof Do))throw new b("Must initialize OAuth flow before calling loginWithOAuth");let p=X.get(si),h=t.authFlow.meta.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d,storedStateCode:p??"",returnedStateCode:h??""}}),new b("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let w,I,F;if(a)try{let j=await t.link();w=j.user,F=j.oAuthTokens,V.current=d}catch(j){throw B(N,"linkAccount","onError",j.privyErrorCode||"failed_to_link_account",{linkMethod:d}),j}else try{let j=await t.authenticate();w=j.user,I=j.isNewUser,F=j.oAuthTokens,V.current=d}catch(j){throw q.current==="login"?B(N,"login","onError",j.privyErrorCode||"unknown_auth_error"):q.current==="link"&&B(N,"linkAccount","onError",j.privyErrorCode||"failed_to_link_account",{linkMethod:d}),j}return c(w),E(I||!1),l(!0),F&&w&&B(N,"oAuthAuthorization","onOAuthTokenGrant",F,{user:w}),F},async initLoginWithPasskey(d){let p=new fi(d);t.startAuthFlow(p),q.current="login";try{V.current="passkey",await p.initAuthenticationFlow()}catch(h){throw B(N,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}},async loginWithPasskey(){if(!n)throw new nn;if(!(t.authFlow instanceof fi))throw new b("Must initialize Passkey flow first.");if(V.current!=="passkey")throw new b("Must init login with Passkey flow first.");let d,p;try{V.current="passkey",{user:d,isNewUser:p}=await t.authenticate()}catch(h){throw B(N,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}c(d),E(p||!1),l(!0)},async initLinkWithPasskey(d){let p=new fi(d);t.startAuthFlow(p),q.current="link",V.current="passkey";try{await p.initLinkFlow()}catch(h){throw B(N,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"passkey"}),h}},async linkWithPasskey(){if(!n)throw new nn;if(!(t.authFlow instanceof fi))throw new b("Must initialize Passkey flow first.");if(V.current!=="passkey")throw new b("Must init login with Passkey flow first.");let d;try{V.current="passkey",{user:d}=await t.link()}catch(p){throw B(N,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account",{linkMethod:"passkey"}),p}return c(d||s||null),d},async initLoginWithHeadlessOAuth(d,p){if(ip()){if(d==="google"&&ha(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 h=new Do({provider:d,headless:!0});p&&h.addCaptchaToken(p);let w=await t.startAuthFlow(h).getAuthorizationUrl();w?.url&&window.location.assign(w.url)},async loginWithHeadlessOAuth(d){A(!0),t.startAuthFlow(new Do(d));let p=X.get(si),h=d.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:d.provider,storedStateCode:p??"",returnedStateCode:h??""}}),A(!1),new b("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let w,I;if(a)try{({user:w}=await t.link()),V.current=d.provider}catch(F){throw B(N,"linkAccount","onError",F.privyErrorCode||"failed_to_link_account",{linkMethod:d.provider}),F}else try{({user:w,isNewUser:I}=await t.authenticate()),V.current=d.provider}catch(F){throw q.current==="login"?B(N,"login","onError",F.privyErrorCode||"unknown_auth_error"):q.current==="link"&&B(N,"linkAccount","onError",F.privyErrorCode||"failed_to_link_account",{linkMethod:d.provider}),F}return c(w),E(I||!1),l(!0),A(!1),w??void 0},initLoginWithEmail:async(d,p)=>{let h=new Pn(d,p);t.startAuthFlow(h);try{V.current="email",await h.sendCodeEmail()}catch(w){throw q.current==="login"?B(N,"login","onError",w.privyErrorCode||"unknown_auth_error"):q.current==="link"&&B(N,"linkAccount","onError",w.privyErrorCode||"failed_to_link_account",{linkMethod:"email"}),w}},initUpdateEmail:async(d,p,h)=>{let w=new wl(d,p,h);t.startAuthFlow(w),await w.sendCodeEmail()},initLoginWithSms:async(d,p)=>{G({status:"sending-code"});let h=new hi(d,p);t.startAuthFlow(h);try{V.current="sms",await h.sendSmsCode(),G({status:"awaiting-code-input"})}catch(w){throw G({status:"error",error:w}),q.current==="login"?B(N,"login","onError",w.privyErrorCode||"unknown_auth_error"):q.current==="link"&&B(N,"linkAccount","onError",w.privyErrorCode||"failed_to_link_account",{linkMethod:"sms"}),w}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async d=>{if(G({status:"submitting-code"}),!n){let w=new nn;throw G({status:"error",error:w}),w}if(t.authFlow instanceof Pn)t.authFlow.meta.emailCode=d.trim();else if(t.authFlow instanceof hi)t.authFlow.meta.smsCode=d.trim();else{let w=new b("Must initialize a passwordless code flow first");throw G({status:"error",error:w}),w}await Re();let p,h;if(q.current==="link")try{({user:p}=await t.link())}catch(w){throw G({status:"error",error:w}),B(N,"linkAccount","onError",w.privyErrorCode||"failed_to_link_account",{linkMethod:V.current}),w}else try{({user:p,isNewUser:h}=await t.authenticate())}catch(w){throw G({status:"error",error:w}),B(N,"login","onError",w.privyErrorCode||"unknown_auth_error"),w}c(p||s||null),E(h||!1),l(!0),G({status:"done"})},generateSiweMessage:async({address:d,chainId:p,captchaToken:h})=>{q.current="link",V.current="siwe";let w=await t.generateSiweNonce({address:d,captchaToken:h}),I=p.replace("eip155:","");return $l({address:d,chainId:I,nonce:w})},linkWithSiwe:async({message:d,signature:p,chainId:h,walletClientType:w,connectorType:I})=>{let F;try{if(q.current!=="link"||V.current!=="siwe")throw new b("Must ensure no other auth flow is in progress other than the SIWE signature flow.");F=await t.linkWithSiwe({message:d,signature:p,chainId:h,walletClientType:w,connectorType:I}),F=await he.refreshUser()??F;let j=sm(F);j&&B(N,"linkAccount","onSuccess",F,"siwe",j)}catch(j){throw B(N,"linkAccount","onError",j.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),q.current=null,V.current=null,j}c(F||s||null),q.current=null,V.current=null},refreshUser:async()=>{let d=await t.getAuthenticatedUser();return c(d),d},walletProxy:L,createAnalyticsEvent:({eventName:d,payload:p,timestamp:h})=>t.createAnalyticsEvent({eventName:d,payload:p,timestamp:h}),acceptTerms:async()=>{let d=await t.acceptTerms();return c(d),d},getUsdTokenPrice:d=>t.getUsdTokenPrice(d),recoverEmbeddedEthereumWallet:async()=>new Promise(async(d,p)=>{let h=Ae(s)||Kl(s),w=await Re();if(!w||!L||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}Q(!0);try{await L.connect({accessToken:w,address:h.address}),d(!0)}catch(I){if(_i(I)&&h.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:h.address}}),(await L.recover({address:h.address,accessToken:w,recoveryMethod:h.recoveryMethod})).address||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:h.address}}),d(!0);else if(_i(I)&&h.recoveryMethod!=="privy"){ae({recoverWallet:{privyWallet:h,onFailure:p,onSuccess:()=>d(!0)},recoveryOAuthStatus:{provider:h.recoveryMethod,action:"recover"}});let F=Nc(h.recoveryMethod);fe(F)}else p(I)}}),embeddedSolanaWallet:u,createEmbeddedSolanaWallet:async()=>{Q(!0);let d=await Re(),p=yi(s),h=Ae(s);if(!s||!d)throw new b("User must be logged in to create a Solana wallet");if(p)throw new b("User already has an embedded Solana wallet.");if(h)if(h.recoveryMethod==="privy")await he.recoverEmbeddedEthereumWallet();else throw new b("Cannot create an embedded Solana wallet for a user with an existing Ethereum wallet with user-controlled recovery.");let w=await he.initializeWalletProxy(15e3);if(!w)throw new b("Unable to initialize wallet proxy");t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await w.createSolana({accessToken:d,ethereumAddress:h?.address});let I=await he.refreshUser(),F=yi(I);if(!F)throw new b("Could not get Solana wallet for user");return t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:F.address}}),F}catch(I){throw t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new b("Failed to create Solana embedded wallet with error ",I)}},recoverEmbeddedSolanaWallet:async()=>new Promise(async(d,p)=>{let h=yi(s),w=await Re();if(!w||!L||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}Q(!0);try{await L.connectSolana({accessToken:w,publicKey:h.address}),d(!0)}catch(I){_i(I)&&h.recoveryMethod==="privy"?(t.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:h.address}}),(await L.recoverSolana({publicKey:h.address,accessToken:w})).publicKey||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_solana_wallet_recovery_completed",payload:{walletAddress:h.address}}),d(!0)):p(I)}}),getMoonpaySignedUrl:aw,initCoinbaseOnRamp:t.initCoinbaseOnRamp.bind(t),getCoinbaseOnRampStatus:t.getCoinbaseOnRampStatus.bind(t),setReadyToTrue:d=>{i(!0),Fe?.(d)},updateWallets:()=>sl(),fundWallet:async(d,p)=>{if(!O.fundingConfig||O.fundingConfig.methods.length===0)throw new Error("Wallet funding is not enabled");let h=Hd({fundingMethods:O.fundingConfig.methods});ae({funding:lm({address:d,fundWalletConfig:p,methodScreen:h})}),fe(h)},requestFarcasterSignerStatus:async d=>{let p=await Re(),h=s?.linkedAccounts.find(I=>I.type==="wallet"&&I.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!L||!h)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");let w=await t.requestFarcasterSignerStatus(d);if(w.status==="approved"){let I=await t.getAuthenticatedUser();c(I||s||null)}return w}}))();v0=he.recoverEmbeddedEthereumWallet,C0=he.recoverEmbeddedSolanaWallet;let dw=(0,ve.useMemo)(()=>({wallets:m,ready:Nt&&_t}),[m,Nt,_t]);return(0,tr.jsx)(De.Provider,{value:Hi,children:(0,tr.jsx)(Op.Provider,{value:N,children:(0,tr.jsx)(uu.Provider,{value:dw,children:(0,tr.jsx)(Kh,{...O,children:(0,tr.jsxs)(Wp.Provider,{value:he,children:[(0,tr.jsx)(Yy,{children:(0,tr.jsxs)(Nh,{data:re,setModalData:ae,setInitialScreen:R,initialScreen:S,authenticated:a,open:r,children:[e.children,!O.headless&&O.captchaEnabled&&n&&!a&&(0,tr.jsx)(ac,{delayedExecution:!1}),(0,tr.jsx)(e0,{theme:{...O.appearance.palette||{}}}),!O.render.standalone&&(0,tr.jsx)(Qd,{open:r})]})}),je&&Ie?(0,tr.jsx)(l0,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:go,mfaSubmitPromise:Lo,onLoad:U,onLoadFailed:()=>null}):null,O.loginMethods.telegram&&O.loginConfig.telegramAuthConfiguration&&(0,tr.jsx)(Ao,{if:!0,children:(0,tr.jsx)(i0,{scriptHost:e.apiUrl||Rl,botUsername:O.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};var b0=require("react");function E0(e){let{login:t}=(0,b0.useContext)(De);return He("login",e),{login:t}}var T0=require("react");function S0(e){let{logout:t}=(0,T0.useContext)(De);return He("logout",e),{logout:t}}var nl=require("react");function _0(){let e=We(),t=ec(),{initLoginWithHeadlessOAuth:r,loginWithHeadlessOAuth:o,isHeadlessOAuthLoading:n,ready:i,user:a}=$(),l=(0,nl.useCallback)(async c=>{if(e.enabled&&e.status!=="success")throw new Nr(e.error,null,"captcha_failure");return r(c.provider,e.token)},[r,e]),s=(0,nl.useCallback)(async()=>{let c=ms();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(m){throw m}finally{mi()}},[o]);return(0,nl.useEffect)(()=>{let c=ms();i&&t&&c.inProgress&&c.headless&&!c.popupFlow&&s()},[i,t]),{initOAuth:l,loginWithOAuth:s,loading:n}}var Xu=require("react");var P0=()=>{let e=We(),{initLoginWithEmail:t,loginWithCode:r}=$(),o=(0,Xu.useCallback)(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=(0,Xu.useCallback)(async({code:i})=>{if(e.enabled&&e.status==="error")throw new Nr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};var em=require("react");var A0=()=>{let e=We(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=$(),n=(0,em.useCallback)(async({phoneNumber:a})=>{if(!a)throw new Error("SMS required to send OTP code");return t(a)},[t]),i=(0,em.useCallback)(async({code:a})=>{if(e.enabled&&e.status!=="success")throw new Nr(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:n,loginWithCode:i,state:o}};var tm=require("react");var x0=()=>{let e=We(),{generateSiweMessage:t,linkWithSiwe:r}=$(),o=(0,tm.useCallback)(async({address:i,chainId:a})=>{if(!i||!a)throw new Error("wallet address and chainId required to generate nonce");return t({address:i,chainId:a}).then(l=>l)},[t]),n=(0,tm.useCallback)(async({signature:i,message:a,chainId:l,walletClientType:s,connectorType:c})=>{if(e.enabled&&e.status!=="success")throw new Nr(e.error,null,"captcha_failure");return r({message:a,signature:i,chainId:l,walletClientType:s,connectorType:c})},[r,e.status]);return{generateSiweMessage:o,linkWithSiwe:n}};var k0=require("react");function R0(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:m,linkSpotify:f,linkInstagram:u,linkTelegram:C,linkFarcaster:v}=(0,k0.useContext)(De);return He("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:c,linkTiktok:m,linkSpotify:f,linkInstagram:u,linkFarcaster:v,linkTelegram:C}}var I0=require("react");function M0(e){let{connectWallet:t}=(0,I0.useContext)(De);return He("connectWallet",e),{connectWallet:t}}var W0=require("react");function O0(e){let{createWallet:t}=(0,W0.useContext)(De);return He("createWallet",e),{createWallet:t}}var L0=e=>{He("fundWallet",e);let{fundWallet:t}=$();return{fundWallet:t}};var N0=()=>{let{embeddedSolanaWallet:e,createEmbeddedSolanaWallet:t}=W();return{createWallet:t,wallets:e?[e]:[]}};var D0=()=>{let{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:n}=$();return{linkCrossAppAccount:e,unlinkCrossAppAccount:t,signMessage:r,signTypedData:o,sendTransaction:n}};var U0=require("react");function F0(e){let{sendTransaction:t}=(0,U0.useContext)(De);return He("sendTransaction",e),{sendTransaction:t}}var B0=require("react");function H0(e){let{setWalletPassword:t}=(0,B0.useContext)(De);return He("setWalletPassword",e),{setWalletPassword:t}}var G0=require("react");function V0(e){let{setWalletRecovery:t}=(0,G0.useContext)(De);return He("setWalletRecovery",e),{setWalletRecovery:t}}var q0=require("react");function z0(e){let{signMessage:t}=(0,q0.useContext)(De);return He("signMessage",e),{signMessage:t}}var $0=require("react");function K0(e){let{signTypedData:t}=(0,$0.useContext)(De);return He("signTypedData",e),{signTypedData:t}}var j0=require("react");var Y0=()=>{let{isModalOpen:e}=(0,j0.useContext)(De);return{isOpen:e}};var Z0=require("react");function Q0(e){let{getAccessToken:t}=(0,Z0.useContext)(De);return He("accessToken",e),{getAccessToken:t}}function J0(e){let{authenticated:t,user:r}=$(),{initLoginWithOAuth:o}=W(),n=da();return He("oAuthAuthorization",e),{reauthorize:i=>a7(t,r,o,n,i.provider)}}var a7=async(e,t,r,o,n)=>{if(!e)throw o("linkAccount","onError","must_be_authenticated",{linkMethod:n}),new b("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some(a=>a.type.includes(n)))throw new b(`OAuth account of type ${n} not linked to the account.`);await r(n)};var X0=rm;function rm(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=$();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}function ew(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function tw(e){return e.find(r=>r.walletClientType==="privy"&&r.connectorType==="embedded"&&!r.imported)??null}0&&(module.exports={AsExternalProvider,Captcha,ConnectorManager,LoginModal,PrivyClient,PrivyProvider,PrivyProxyProvider,SUPPORTED_CHAINS,VERSION,WalletConnector,addRpcUrlOverrideToChain,errorIndicatesMaxMfaRetries,errorIndicatesMfaTimeout,errorIndicatesMfaVerificationFailed,getAccessToken,getEmbeddedConnectedWallet,useConnectWallet,useCreateWallet,useCrossAppAccounts,useExperimentalFarcasterSigner,useFarcasterSigner,useFundWallet,useLinkAccount,useLinkWithSiwe,useLogin,useLoginWithEmail,useLoginWithOAuth,useLoginWithSms,useLogout,useMfa,useMfaEnrollment,useModalStatus,useOAuthTokens,usePrivy,useRegisterMfaListener,useSendTransaction,useSetWalletPassword,useSetWalletRecovery,useSignMessage,useSignTypedData,useSolanaWallets,useToken,useWallets});
|