@privy-io/react-auth 1.82.0 → 1.83.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{$ as Bn,$a as xt,A as js,Aa as Nr,B as Ju,Ba as hm,C as Un,Ca as ym,D as ju,Da as gm,E as Ai,Ea as zd,F as $u,Fa as Cm,G as Uo,Ga as vm,H as Ir,Ha as wm,I as La,Ia as Le,J as em,Ja as al,K as $s,Ka as pt,L as tm,La as bm,M as We,Ma as L,N as rm,Na as xe,O as om,Oa as K,P as Ud,Pa as Em,Q as Fn,Qa as Tm,R as Fd,Ra as Sm,S as el,Sa as Ne,T as nm,Ta as O,U as Bd,Ua as Ri,V as Hd,Va as ki,W as tl,Wa as G,X as Na,Xa as Z,Y as Oa,Ya as Am,Z as rl,Za as $t,_ as Da,_a as Pm,a as Gu,aa as Hn,ab as Kd,b as Xs,ba as Vn,bb as Ua,c as Dd,ca as ol,cb as Fa,d as qu,da as Vd,db as xm,e as jt,ea as Gd,eb as Rm,f as Mr,fa as Gn,fb as _i,g as w,ga as Fo,gb as km,h as zu,ha as qd,hb as _m,i as _e,ia as Pi,ib as Bo,j as ae,ja as im,jb as Mi,k as ot,ka as am,kb as yo,l as Dn,la as sm,lb as bt,m as fr,ma as lm,mb as Ba,n as Ku,na as cm,nb as Mm,o as fo,oa as xi,ob as j0,p as Ia,pa as Zr,pb as $0,q as J,qa as dm,r as en,ra as nl,s as Zs,sa as pm,t as Yu,ta as Wr,u as Js,ua as um,v as Qu,va as il,w as Ut,wa as mm,x as Xu,xa as Lr,y as Zu,ya as ho,z as Wa,za as fm}from"./chunk-K2LQRC3N.js";import{getAddress as wi}from"@ethersproject/address";import{Web3Provider as Ou}from"@ethersproject/providers";import{createStore as nA}from"mipd";import{useEffect as co,useMemo as iA,useRef as _a,useState as dt}from"react";import{isAndroid as aA}from"react-device-detect";import{ProviderErrors as sA,calculateTotalGasEstimate as lA,populateTransactionRequest as cA}from"@privy-io/js-sdk-core";var sl="/api/v1/sessions",ll="/api/v1/sessions/logout",Im="/api/v1/sessions/fork",cl="/api/v1/sessions/fork/recover",Wm="/api/v1/siwe/init",Lm="/api/v1/siwe/authenticate",Nm="/api/v1/siwe/link",Om="/api/v1/siwe/unlink",Dm="/api/v1/farcaster/init",Um="/api/v1/farcaster/authenticate",Fm="/api/v1/farcaster/link",Bm="/api/v1/farcaster/status",Hm="/api/v1/farcaster/unlink",Vm="/api/v1/passwordless/init",Gm="/api/v1/passwordless/authenticate",qm="/api/v1/passwordless/link",zm="/api/v1/passwordless/unlink",Km="/api/v1/passwordless/update",Ym="/api/v1/passwordless_sms/init",Qm="/api/v1/passwordless_sms/link",Xm="/api/v1/passwordless_sms/unlink",Zm="/api/v1/passwordless_sms/authenticate",Jm="/api/v1/passwordless_sms/update",dl="/api/v1/oauth/init",pl="/api/v1/oauth/authenticate",ul="/api/v1/oauth/link",jm="/api/v1/oauth/unlink",$m="/api/v1/recovery/oauth/init",ef="/api/v1/recovery/oauth/init_icloud",tf="/api/v1/recovery/oauth/authenticate",rf="/api/v1/passkeys/link/init",of="/api/v1/passkeys/authenticate/init",nf="/api/v1/passkeys/link",af="/api/v1/passkeys/authenticate",sf="/api/v1/passkeys/unlink",lf="/api/v1/telegram/authenticate",cf="/api/v1/telegram/link",df="/api/v1/telegram/unlink";var pf="/api/v1/mfa/passwordless_sms/init",uf="/api/v1/mfa/passkeys/init",mf="/api/v1/users/me/accept_terms",ml="/api/v1/analytics_events",ff="/api/v1/custom_jwt_account/authenticate",hf="/api/v1/guest/authenticate",yf="/api/v1/plugins/moonpay_on_ramp/sign",gf="/api/v1/funding/coinbase_on_ramp/init",Cf="/api/v1/funding/coinbase_on_ramp/status";var Ii=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(ff,{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 ae(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(Gm,{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 ae(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(qm,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw ae(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(Vm,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw ae(o)}}},fl=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(Km,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw ae(r)}}};import{isMobile as eC,isIOS as tC}from"react-device-detect";var hl=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(yl))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var yl={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 vf(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function wf(e,t){let r=vf(t);if(r.deepLink)return Pf(r.deepLink,e);if(r.universalLink)return Yd(r.universalLink,e);throw new w(`Unsupported wallet ${t.id}`)}function bf(e,t){let r=vf(t);if(r.universalLink)return Yd(r.universalLink,e)}var Ef="WALLETCONNECT_DEEPLINK_CHOICE";function Tf(){try{localStorage.removeItem(Ef)}catch{}}function Sf({href:e,name:t}){try{localStorage.setItem(Ef,JSON.stringify({href:e,name:t}))}catch{}}function Af(e){return e.startsWith("http://")||e.startsWith("https://")}function Pf(e,t){if(Af(e))return Yd(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 Yd(e,t){if(!Af(e))return Pf(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function gl(e,t){window.open(e,t,"noreferrer noopener")}var Ye=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 Ha=class{constructor(t){this._meta={};this.captchaToken=t,this.startChannelOnce=new Ye(this._startChannelOnce.bind(this)),this.pollForReady=new Ye(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(Um,{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,identity_token:t.identity_token,is_new_user:t.is_new_user}}catch(t){throw ae(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(Fm,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw ae(t)}}async _startChannelOnce(){if(!this.api)throw new w("Auth flow has no API instance");let t=await this.api.post(Dm,{token:this.captchaToken});eC&&!tC&&t.connect_uri&&gl(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(Bm,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};import{base64url as Rf}from"jose";async function xf(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function Va(e){return crypto.getRandomValues(new Uint8Array(e))}var Wi=class{constructor(t){this.meta={guestCredential:this.getOrCreateGuestCredential(t)}}getOrCreateGuestCredential(t){let r=rl(t);if(Ia()){if(J.get(r))return J.get(r);{let o=Rf.encode(Va(32));return J.put(r,o),o}}return Rf.encode(Va(32))}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{let t=await this.api.post(hf,{guest_credential:this.meta.guestCredential});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 ae(t)}}async link(){throw new Error("Linking is not supported for the guest flow")}};import{base64url as kf}from"jose";var rC="S256",oC="S256";function qn(){return kf.encode(Va(36))}function Li(){return qn()}async function Ni(e,t=rC){if(t==oC){let r=await xf(e);return kf.encode(r)}else return e}function _f(){let e=J.get(Hn);if(!e)throw new w("Authentication error.");return e}function Cl(){return!!J.get(Vn)}var go=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:Cl();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=_f();try{let r=await this.api.post(pl,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return J.del(Hn),this.meta.headless&&J.del(Vn),{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=ae(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=J.get(Hn);if(!t)throw new w("Authentication error.");try{let r=await this.api.post(ul,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return J.del(Hn),r}catch(r){throw ae(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=qn();J.put(Hn,t);let r=Li();J.put(Bn,r);let o=await Ni(t);this.meta.headless&&J.put(Vn,!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 ae(n)}}};function Qd(e){return e.charAt(0).toUpperCase()+e.slice(1)}import{jsx as Mf,jsxs as nC}from"react/jsx-runtime";var vl=({style:e,...t})=>nC("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:[Mf("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"}),Mf("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});import{jsx as Ga,jsxs as iC}from"react/jsx-runtime";var wl=({style:e,...t})=>iC("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:[Ga("g",{clipPath:"url(#clip0)",children:Ga("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"})}),Ga("defs",{children:Ga("clipPath",{id:"clip0",children:Ga("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as If}from"react/jsx-runtime";var bl=({style:e,...t})=>If("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:If("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"})});import aC from"@heroicons/react/24/outline/GlobeAltIcon";import{jsx as sC}from"react/jsx-runtime";var Wf=({style:e})=>sC(aC,{style:{color:"var(--privy-color-error)",...e}});import{jsx as El,jsxs as lC}from"react/jsx-runtime";var Tl=({style:e,...t})=>lC("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:[El("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"}),El("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"}),El("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"}),El("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});import{jsx as Or,jsxs as Sl}from"react/jsx-runtime";function Al(e){return Sl("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:[Sl("defs",{children:[Sl("linearGradient",{id:"b",children:[Or("stop",{offset:"0",stopColor:"#3771c8"}),Or("stop",{stopColor:"#3771c8",offset:".128"}),Or("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),Sl("linearGradient",{id:"a",children:[Or("stop",{offset:"0",stopColor:"#fd5"}),Or("stop",{offset:".1",stopColor:"#fd5"}),Or("stop",{offset:".5",stopColor:"#ff543e"}),Or("stop",{offset:"1",stopColor:"#c837ab"})]}),Or("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"}),Or("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"})]}),Or("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)"}),Or("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)"}),Or("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"})]})}import{jsx as Pl}from"react/jsx-runtime";function xl({style:e,...t}){return Pl("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:Pl("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:Pl("g",{transform:"scale(5.12,5.12)",children:Pl("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}import{jsx as Lf,jsxs as cC}from"react/jsx-runtime";function Rl(e){return cC("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[Lf("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"}),Lf("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}import{jsx as Xd,jsxs as dC}from"react/jsx-runtime";function kl(e){return dC("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:[Xd("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"}),Xd("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"}),Xd("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}import{jsx as Nf}from"react/jsx-runtime";var _l=({style:e,...t})=>Nf("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:Nf("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 Of={google:{name:"Google",component:Tl},discord:{name:"Discord",component:wl},github:{name:"Github",component:bl},linkedin:{name:"LinkedIn",component:xl},twitter:{name:"Twitter",component:_l},spotify:{name:"Spotify",component:Rl},instagram:{name:"Instagram",component:Al},tiktok:{name:"Tiktok",component:kl},apple:{name:"Apple",component:vl}},qa=e=>e in Of?Of[e]:{name:"Unknown",component:Wf};function Df(e,t){let r={detail:"",retryable:!1},o=Qd(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=qa(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=qa(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 za(){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:Cl(),popupFlow:window.opener!==null&&n}}function zn(){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"),J.del(Bn),window.history.replaceState({},"",e)}var Kn=class{constructor(t){this.initAuthenticateOnce=new Ye(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new Ye(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(af,{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"):ae(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(nf,{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"):ae(r)}}async _initAuthenticateOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(of,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new w("Auth flow has no API instance");return await this.api.post(rf,{})}_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 Ml=({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
+ import{$ as Gn,$a as D,A as Js,Aa as fm,B as em,Ba as kr,C as Hn,Ca as hm,D as tm,Da as al,E as Ri,Ea as ym,F as rm,Fa as _r,G as Do,Ga as mo,H as Rr,Ha as gm,I as Oa,Ia as Ir,J as om,Ja as Cm,K as js,Ka as vm,L as nm,La as wm,M as Ie,Ma as Zd,N as im,Na as bm,O as am,Oa as Em,P as Vd,Pa as Tm,Q as Vn,Qa as Me,R as Gd,Ra as sl,S as $s,Sa as ut,T as sm,Ta as Sm,U as qd,Ua as M,V as zd,Va as We,W as el,Wa as V,X as Da,Xa as Pm,Y as Ua,Ya as Am,Z as tl,Za as xm,_ as Fa,_a as He,a as Ku,aa as qn,ab as Mi,b as Qs,ba as zn,bb as Wi,c as Hd,ca as Kn,cb as B,d as Yu,da as rl,db as J,e as Zt,ea as Kd,eb as Rm,f as xr,fa as Yd,fb as Jt,g as v,ga as Yn,gb as km,h as Qu,ha as Uo,hb as Pt,i as Re,ia as Qd,ib as Fo,j as ne,ja as ki,jb as Jd,k as nt,ka as lm,kb as Ba,l as Bn,la as cm,lb as _m,m as dr,ma as dm,mb as Im,n as Xu,na as pm,nb as Li,o as uo,oa as um,ob as Mm,p as La,pa as Ue,pb as Wm,q as X,qa as Xd,qb as Bo,r as tn,ra as _i,rb as Ni,s as Xs,sa as ol,sb as fo,t as Zu,ta as nl,tb as wt,u as Zs,ua as vt,ub as Ha,v as Ju,va as Dt,vb as Lm,w as Yr,wa as Ii,wb as rC,x as ju,xa as Qr,xb as oC,y as $u,ya as mm,yb as nC,z as Na,za as il}from"./chunk-2RPS75G6.js";import{getAddress as Si}from"@ethersproject/address";import{Web3Provider as Bu}from"@ethersproject/providers";import{createStore as iP}from"mipd";import{useEffect as so,useMemo as aP,useRef as Wa,useState as pt}from"react";import{isAndroid as sP}from"react-device-detect";import{ProviderErrors as lP,calculateTotalGasEstimate as cP,populateTransactionRequest as dP}from"@privy-io/js-sdk-core";var ll="/api/v1/sessions",cl="/api/v1/sessions/logout",Nm="/api/v1/sessions/fork",dl="/api/v1/sessions/fork/recover",Om="/api/v1/siwe/init",Dm="/api/v1/siwe/authenticate",Um="/api/v1/siwe/link",Fm="/api/v1/siwe/unlink",Bm="/api/v1/farcaster/init",Hm="/api/v1/farcaster/authenticate",Vm="/api/v1/farcaster/link",Gm="/api/v1/farcaster/status",qm="/api/v1/farcaster/unlink",zm="/api/v1/passwordless/init",Km="/api/v1/passwordless/authenticate",Ym="/api/v1/passwordless/link",Qm="/api/v1/passwordless/unlink",Xm="/api/v1/passwordless/update",Zm="/api/v1/passwordless_sms/init",Jm="/api/v1/passwordless_sms/link",jm="/api/v1/passwordless_sms/unlink",$m="/api/v1/passwordless_sms/authenticate",ef="/api/v1/passwordless_sms/update",pl="/api/v1/oauth/init",ul="/api/v1/oauth/authenticate",ml="/api/v1/oauth/link",tf="/api/v1/oauth/unlink",rf="/api/v1/recovery/oauth/init",of="/api/v1/recovery/oauth/init_icloud",nf="/api/v1/recovery/oauth/authenticate",af="/api/v1/passkeys/link/init",sf="/api/v1/passkeys/authenticate/init",lf="/api/v1/passkeys/link",cf="/api/v1/passkeys/authenticate",df="/api/v1/passkeys/unlink",pf="/api/v1/telegram/authenticate",uf="/api/v1/telegram/link",mf="/api/v1/telegram/unlink";var ff="/api/v1/mfa/passwordless_sms/init",hf="/api/v1/mfa/passkeys/init",yf="/api/v1/users/me/accept_terms",fl="/api/v1/analytics_events",gf="/api/v1/custom_jwt_account/authenticate",Cf="/api/v1/guest/authenticate",vf="/api/v1/plugins/moonpay_on_ramp/sign",wf="/api/v1/funding/coinbase_on_ramp/init",bf="/api/v1/funding/coinbase_on_ramp/status";var Oi=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new v("Auth flow has no API instance");try{let t=await this.api.post(gf,{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 ne(t)}}async link(){throw new Error("Unimplemented")}};var rn=class{constructor(t,r,o=!1){this.meta={email:t,captchaToken:r,disableSignup:o}}async authenticate(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new v("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(Km,{email:this.meta.email,code:this.meta.emailCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});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 ne(t)}}async link(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new v("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 ne(t)}}async sendCodeEmail(t,r){if(!this.api)throw new v("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new v("Email must be set when initialzing authentication.");try{return await this.api.post(zm,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw ne(o)}}},hl=class extends rn{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r,disableSignup:!1}}async link(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new v("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(Xm,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw ne(r)}}};import{isMobile as iC,isIOS as aC}from"react-device-detect";var yl=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[r,o]of Object.entries(gl))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var gl={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 Ef(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function Tf(e,t){let r=Ef(t);if(r.deepLink)return kf(r.deepLink,e);if(r.universalLink)return jd(r.universalLink,e);throw new v(`Unsupported wallet ${t.id}`)}function Sf(e,t){let r=Ef(t);if(r.universalLink)return jd(r.universalLink,e)}var Pf="WALLETCONNECT_DEEPLINK_CHOICE";function Af(){try{localStorage.removeItem(Pf)}catch{}}function xf({href:e,name:t}){try{localStorage.setItem(Pf,JSON.stringify({href:e,name:t}))}catch{}}function Rf(e){return e.startsWith("http://")||e.startsWith("https://")}function kf(e,t){if(Rf(e))return jd(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 jd(e,t){if(!Rf(e))return kf(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function Cl(e,t){window.open(e,t,"noreferrer noopener")}var Ze=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 Va=class{constructor(t,r=!1){this._meta={disableSignup:!1};this.captchaToken=t,this.startChannelOnce=new Ze(this._startChannelOnce.bind(this)),this.pollForReady=new Ze(this._pollForReady.bind(this)),this._meta.disableSignup=r}get meta(){return this._meta}async authenticate(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.channelToken)throw new v("Auth flow must be initialized first");try{let t=await this.api.post(Hm,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});if(!t)throw new v("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 ne(t)}}async link(){if(!this.api)throw new v("Auth flow has no API instance");try{return await this.api.post(Vm,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw ne(t)}}async _startChannelOnce(){if(!this.api)throw new v("Auth flow has no API instance");let t=await this.api.post(Bm,{token:this.captchaToken});iC&&!aC&&t.connect_uri&&Cl(t.connect_uri,"_blank"),this._meta={...this._meta,connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new v("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.channelToken)throw new v("Auth flow must be initialized first");let t=await this.api.get(Gm,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};import{base64url as If}from"jose";async function _f(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function Ga(e){return crypto.getRandomValues(new Uint8Array(e))}var Di=class{constructor(t){this.meta={guestCredential:this.getOrCreateGuestCredential(t)}}getOrCreateGuestCredential(t){let r=tl(t);if(La()){if(X.get(r))return X.get(r);{let o=If.encode(Ga(32));return X.put(r,o),o}}return If.encode(Ga(32))}async authenticate(){if(!this.api)throw new v("Auth flow has no API instance");try{let t=await this.api.post(Cf,{guest_credential:this.meta.guestCredential});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 ne(t)}}async link(){throw new Error("Linking is not supported for the guest flow")}};import{base64url as Mf}from"jose";var sC="S256",lC="S256";function Qn(){return Mf.encode(Ga(36))}function Ui(){return Qn()}async function Fi(e,t=sC){if(t==lC){let r=await _f(e);return Mf.encode(r)}else return e}function Wf(){let e=X.get(qn);if(!e)throw new v("Authentication error.");return e}function vl(){return!!X.get(zn)}function Lf(){return!!X.get(Kn)}var ho=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:vl();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 v("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new v("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new v("User denied confirmation during OAuth flow");let t=Wf();try{let r=await this.api.post(ul,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return X.del(qn),X.del(zn),X.del(Kn),{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=ne(r);throw o.privyErrorCode?new v(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new v("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new v("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new v("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new v("User denied confirmation during OAuth flow");let t=X.get(qn);if(!t)throw new v("Authentication error.");try{let r=await this.api.post(ml,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return X.del(qn),r}catch(r){throw ne(r)}}async getAuthorizationUrl(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.provider)throw new v("Provider must be set when initializing OAuth authentication.");let t=Qn();X.put(qn,t);let r=Ui();X.put(Gn,r);let o=await Fi(t);this.meta.headless&&X.put(zn,!0),this.meta.disableSignup&&X.put(Kn,!0);try{return await this.api.post(pl,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw ne(n)}}};function $d(e){return e.charAt(0).toUpperCase()+e.slice(1)}import{jsx as Nf,jsxs as cC}from"react/jsx-runtime";var wl=({style:e,...t})=>cC("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:[Nf("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"}),Nf("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});import{jsx as qa,jsxs as dC}from"react/jsx-runtime";var bl=({style:e,...t})=>dC("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:[qa("g",{clipPath:"url(#clip0)",children:qa("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"})}),qa("defs",{children:qa("clipPath",{id:"clip0",children:qa("rect",{width:"71",height:"55",fill:"white"})})})]});import{jsx as Of}from"react/jsx-runtime";var El=({style:e,...t})=>Of("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:Of("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"})});import pC from"@heroicons/react/24/outline/GlobeAltIcon";import{jsx as uC}from"react/jsx-runtime";var Df=({style:e})=>uC(pC,{style:{color:"var(--privy-color-error)",...e}});import{jsx as Tl,jsxs as mC}from"react/jsx-runtime";var Sl=({style:e,...t})=>mC("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:[Tl("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"}),Tl("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"}),Tl("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"}),Tl("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});import{jsx as Mr,jsxs as Pl}from"react/jsx-runtime";function Al(e){return Pl("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:[Pl("defs",{children:[Pl("linearGradient",{id:"b",children:[Mr("stop",{offset:"0",stopColor:"#3771c8"}),Mr("stop",{stopColor:"#3771c8",offset:".128"}),Mr("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),Pl("linearGradient",{id:"a",children:[Mr("stop",{offset:"0",stopColor:"#fd5"}),Mr("stop",{offset:".1",stopColor:"#fd5"}),Mr("stop",{offset:".5",stopColor:"#ff543e"}),Mr("stop",{offset:"1",stopColor:"#c837ab"})]}),Mr("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"}),Mr("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"})]}),Mr("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)"}),Mr("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)"}),Mr("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"})]})}import{jsx as xl}from"react/jsx-runtime";function Rl({style:e,...t}){return xl("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:xl("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:xl("g",{transform:"scale(5.12,5.12)",children:xl("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}import{jsx as Uf,jsxs as fC}from"react/jsx-runtime";function kl(e){return fC("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[Uf("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"}),Uf("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}import{jsx as ep,jsxs as hC}from"react/jsx-runtime";function _l(e){return hC("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:[ep("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"}),ep("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"}),ep("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}import{jsx as Ff}from"react/jsx-runtime";var Il=({style:e,...t})=>Ff("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:Ff("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 Bf={google:{name:"Google",component:Sl},discord:{name:"Discord",component:bl},github:{name:"Github",component:El},linkedin:{name:"LinkedIn",component:Rl},twitter:{name:"Twitter",component:Il},spotify:{name:"Spotify",component:kl},instagram:{name:"Instagram",component:Al},tiktok:{name:"Tiktok",component:_l},apple:{name:"Apple",component:wl}},za=e=>e in Bf?Bf[e]:{name:"Unknown",component:Df};function Hf(e,t){let r={detail:"",retryable:!1},o=$d(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=za(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let n=za(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 Ka(){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:vl(),popupFlow:window.opener!==null&&n,disableSignup:Lf()}}function Xn(){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(Gn),window.history.replaceState({},"",e)}var Zn=class{constructor(t){this.initAuthenticateOnce=new Ze(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new Ze(this._initLinkOnce.bind(this)),this.meta={captchaToken:t}}async initAuthenticationFlow(){if(!this.api)throw new v("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new v("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 v("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new v("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(cf,{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 v("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):ne(r)}}async link(){let t=await import("@simplewebauthn/browser");if(!this.api)throw new v("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new v("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(lf,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new v("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):ne(r)}}async _initAuthenticateOnce(){if(!this.api)throw new v("Auth flow has no API instance");return await this.api.post(sf,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new v("Auth flow has no API instance");return await this.api.post(af,{})}_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 Ml=({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 Ho=class{constructor(t,r,o){this.getNonceOnce=new Ye(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,identity_token:o.identity_token,is_new_user:o.is_new_user}}catch(t){throw ae(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 ae(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=Ml({address:t,chainId:r,nonce:this.nonce}),this.preparedMessage}};var rn=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(Zm,{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 ae(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(Qm,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw ae(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(Ym,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw ae(o)}}},Il=class extends rn{constructor(r,o,n){super(o,n);this.meta={phoneNumber:o,captchaToken:n,oldPhoneNumber:r}}async link(){if(!this.api)throw new w("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new w("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(Jm,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(r){throw ae(r)}}};var Oi=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(lf,{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 ae(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(cf,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw ae(t)}}};function Zd(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 Ff(){let e;if(e=pC(),e)return Uf(),{...e,flowType:"login-url"};if(e=uC(),e)return Uf(),{...e,flowType:"web-app"}}function pC(){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 uC(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id")||void 0,o=t.get("user"),n=Number(t.get("auth_date")||""),i=t.get("hash"),a=t.get("chat_instance")||void 0,l=t.get("chat_type")||void 0,s=t.get("start_param")||void 0;if(!(!o||!n||!i))return{query_id:r,user:o,auth_date:n,hash:i,chat_instance:a,chat_type:l,start_param:s}}function Uf(){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"),e.hash="",window.history.replaceState({},"",e)}import{v4 as QC}from"uuid";import{getAddress as Bf}from"@ethersproject/address";function $(e){return e?new Date(e*1e3):null}function mC(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:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(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,walletIndex:r.wallet_index};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:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(i);break;case"email":let a={address:r.address,type:r.type,verifiedAt:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(a);break;case"phone":let l={number:r.phoneNumber,type:r.type,verifiedAt:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(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:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(s);break;case"spotify_oauth":let d={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(d);break;case"instagram_oauth":let u={subject:r.subject,username:r.username,type:r.type,verifiedAt:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(u);break;case"twitter_oauth":let m={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(m);break;case"discord_oauth":let f={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(f);break;case"github_oauth":let g={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(g);break;case"tiktok_oauth":let v={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(v);break;case"linkedin_oauth":let C={subject:r.subject,name:r.name,email:r.email,vanityName:r.vanity_name,type:r.type,verifiedAt:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(C);break;case"apple_oauth":let b={subject:r.subject,email:r.email,type:r.type,verifiedAt:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(b);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)});break;case"farcaster":let A={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:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(A);break;case"passkey":let _={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:$(r.verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(_);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:$(r.first_verified_at),firstVerifiedAt:$(r.first_verified_at),latestVerifiedAt:$(r.latest_verified_at)};t.push(S);break;default:console.warn(`Unrecognized account type: ${o}. Please consider upgrading the Privy SDK.`)}}return t}function er(e,t){return e.slice().sort((r,o)=>(o.firstVerifiedAt??o.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===t)}var Me=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum"&&t.walletIndex===0)||null,Jd=e=>e?.linkedAccounts.filter(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="ethereum"),fC=e=>e?.linkedAccounts.filter(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.chainType==="ethereum"),Yn=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&!t.imported&&t.chainType==="solana")||null,Wl=e=>e?.linkedAccounts.find(t=>t.type==="wallet"&&t.walletClientType==="privy"&&t.imported&&t.chainType==="ethereum")||null,Ll=(e,t)=>{let r=fC(e).find(n=>Bf(n.address)===Bf(t)),o=r?r.imported?r:Me(e):void 0;return{signingWallet:r,rootWallet:o}},hC=e=>e.linkedAccounts.filter(t=>t.type==="wallet"),Et=(e,t)=>Me(e)||Yn(e)?!1:t==="all-users"||t==="users-without-wallets"&&!hC(e)?.length;function Ft(e){if(!e)return null;let t=mC(e.linked_accounts),r=er(t,"wallet"),o=er(t,"email"),n=er(t,"phone"),i=er(t,"google_oauth"),a=er(t,"twitter_oauth"),l=er(t,"discord_oauth"),s=er(t,"github_oauth"),d=er(t,"spotify_oauth"),u=er(t,"instagram_oauth"),m=er(t,"tiktok_oauth"),f=er(t,"linkedin_oauth"),g=er(t,"apple_oauth"),v=er(t,"farcaster"),C=er(t,"telegram"),b=e.mfa_methods.map(({type:_,verified_at:S})=>({type:_,verifiedAt:$(S)}));return{id:e.id,createdAt:$(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,walletIndex:r.walletIndex},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:d&&{subject:d.subject,email:d.email,name:d.name},instagram:u&&{subject:u.subject,username:u.username},tiktok:m&&{subject:m.subject,username:m.username,name:m.name},linkedin:f&&{subject:f.subject,name:f.name,email:f.email,vanityName:f.vanityName},apple:g&&{subject:g.subject,email:g.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:C&&{telegramUserId:C.telegramUserId,firstName:C.firstName,lastName:C.lastName,username:C.username,photoUrl:C.photoUrl},mfaMethods:b.map(_=>_.type),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}}import{getAddress as eh}from"@ethersproject/address";import{isHexString as HC}from"@ethersproject/bytes";import VC from"eventemitter3";import TC from"@coinbase/wallet-sdk";import{jsx as Hf,jsxs as yC}from"react/jsx-runtime";var Vo=({style:e,...t})=>yC("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:[Hf("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),Hf("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});import{getAddress as wo}from"@ethersproject/address";import{Web3Provider as Yf}from"@ethersproject/providers";import{default as bC}from"eventemitter3";import wC from"eventemitter3";var gC=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation"],Vf=e=>gC.includes(e);import{ErrorCode as CC}from"@ethersproject/logger";import{ProviderErrors as Qn}from"@privy-io/js-sdk-core";var Di=class extends _e{constructor(){super("Wallet timeout");this.type="wallet_error"}},Ui=class extends _e{constructor(){super("User rejected connection");this.type="wallet_error"}},Jr=e=>{if(e instanceof _e)return e;if(e?.code&&e?.reason){let t=new Tt(e);return e.code===CC.ACTION_REJECTED&&(t.details=Qn.E4001_USER_REJECTED_REQUEST),t}return e?.code?new Tt(e):new _e("Unknown connector error",e)},Dr=class extends jt{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},Tt=class extends Dr{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(Qn).find(i=>i.eipCode===o.code);this.details=n||Qn.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=Qn.E32002_CONNECTION_ALREADY_PENDING:this.details=Qn.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=Qn.E32002_WALLET_LOCKED))}},vC={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},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1}},Co={...vC,...Qn};var Ze=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 Di,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||Gn,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 _e(`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 Jr(r)})}},on=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},Ka=class extends wC{constructor({walletProxy:r,address:o,rootAddress:n,rpcConfig:i,chains:a,appId:l,chainId:s=1,walletIndex:d}){super();this.walletProxy=r,this.address=o,this.rootAddress=n,this.chainId=s,this.rpcConfig=i,this.chains=a,this.provider=Ir(s,this.chains,i,{appId:l}),this.rpcTimeoutDuration=Fi(i,"privy"),this.appId=l,this.walletIndex=d}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new on(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await be()||!this.address)throw new on("Disconnected",4900);return(await zf(o,void 0,void 0,this.address)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new on(`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 on(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=Ir(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 Gf(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=r.params[0],n=typeof r.params[1]=="string"?JSON.parse(r.params[1]):r.params[1];return await qf(La(n),void 0,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:Un(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 Un(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(Vf(r.method)){let o=await be();if(await Kf(),!o||!this.address)throw new on("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.rootAddress,accessToken:o,hdWalletIndex:this.walletIndex,request:{method:r.method,params:r.params}})).response.data}catch(n){throw console.error(n),new on("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await be();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}}},vo=class extends Ze{constructor(r){super(r,r.rpcTimeoutDuration)}},nn=class extends Ze{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 EC=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},tr=class extends bC{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=Ai(r),this.walletClientType==="privy"&&J.put(ol(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=Fi(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,i){let a=async()=>!!this.wallets.find(l=>wo(l.address)===wo(r));return{address:wo(r),chainId:o,meta:n,imported:i,switchChain:async l=>{if(!a)throw new _e("Wallet is not currently connected.");let s=this.wallets.find(g=>wo(g.address)===wo(r))?.chainId;if(!s)throw new _e("Unable to determine current chainId.");let d,u;if(typeof l=="number"?(d=`0x${l.toString(16)}`,u=l):(d=l,u=Number(l)),s===Ai(d))return;let m=this.chains.find(g=>g.id===u);if(!m)throw new _e(`Unsupported chainId: ${l}`);let f=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:d}]})};try{return await f()}catch(g){if(EC(g,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:d,chainName:m.name,nativeCurrency:m.nativeCurrency,rpcUrls:[m.rpcUrls.default?.http[0]??""],blockExplorerUrls:[m.blockExplorers?.default.url??""]}]}),f();throw this.walletClientType==="rainbow"&&g.message?.includes("wallet_switchEthereumChain")?new _e(`Rainbow does not support the chainId ${o}`):g}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new _e("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new _e("Wallet is not currently connected.");return new Yf(new vo(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new _e("Wallet is not currently connected.");return new nn(this.proxyProvider)},sign:async l=>{if(!await a())throw new _e("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 d=await Wa(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,d),Array.isArray(d)&&(o=d)}}catch(d){console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",d)}if(!o||!Array.isArray(o)||o.length<=0||!o[0])return;let n=o[0],i=wo(n),a=[],l;if(this.walletClientType==="privy"){let d=J.get(ol(i));this.chains.find(u=>u.id===Number(d))||(J.del(ol(i)),d=null),l=d||`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 d=await Wa(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,d),typeof d=="string")l=d;else if(typeof d=="number")l=`0x${d.toString(16)}`;else throw new Error("Invalid chainId returned from provider")}catch(d){console.warn(`Failed to get chainId from provider, defaulting to ${qd}`,d),l=qd}let s=Ai(l);if(!a.find(d=>wo(d.address)===i)){let d={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet(wo(n),s,d,this.connectorType==="embedded_imported"))}Nl(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=>wo(n)===wo(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 Yf(new vo(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 SC=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],Qf=(e,t)=>e.makeWeb3Provider({options:t}),Ol,Dl=class extends tr{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 Ze(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"),!Ol){let s=[o.id].concat(r.map(u=>u.id)),d=this.connectionOptions!=="eoaOnly"?s.filter(u=>!SC.includes(u)):[];d.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${d.join(", ")}`),Ol=new TC({appName:a,appLogoUrl:l,appChainIds:s})}this.proxyProvider.setWalletProvider(Qf(Ol,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:Vo,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 _e("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw Jr(r)}}updateConnectionPreference(r){this.connectionOptions=r,this.walletClientType=r==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(Qf(Ol,this.connectionOptions))}};var Ya=class extends tr{constructor({provider:r,chains:o,defaultChain:n,rpcConfig:i,imported:a,walletIndex:l}){super("privy",o,n,i);this.connectorType="embedded";this.proxyProvider=r,this.walletIndex=l,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:[Un(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:xi,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};import{jsx as Xf}from"react/jsx-runtime";var Bi=({style:e,...t})=>Xf("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:Xf("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});import{jsx as hr,jsxs as AC}from"react/jsx-runtime";var Hi=({style:e,...t})=>AC("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:[hr("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),hr("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("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"}),hr("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});import{jsx as Zf,jsxs as PC}from"react/jsx-runtime";var bo=({style:e,...t})=>PC("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:[Zf("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),Zf("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 Gi=class extends tr{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new Ze(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 _e("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Jr(r)}}},Vi,qi=class extends tr{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";Xs(this,Vi,void 0);this.proxyProvider=new Ze(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?Dd(this,Vi,{name:"MetaMask",icon:Hi,id:"io.metamask"}):a==="phantom"&&Dd(this,Vi,{name:"Phantom",icon:bo,id:"phantom"})}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return Gu(this,Vi)??{name:"Browser Extension",icon:Bi,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 _e("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Jr(r)}}};Vi=new WeakMap;import{getAddress as VR}from"@ethersproject/address";import{Web3Provider as qR}from"@ethersproject/providers";import{isMobile as xC}from"react-device-detect";var Ul=class extends Gi{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{xC||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 _e("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw Jr(t)}}};var Fl=class extends tr{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new Ze(void 0,Gn);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 Bl=class extends Fl{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:bo,id:"phantom"}}};import{EthereumProvider as DC,OPTIONAL_EVENTS as UC,OPTIONAL_METHODS as FC}from"@walletconnect/ethereum-provider";import{isMobile as BC}from"react-device-detect";import{createContext as kC,useContext as _C,useEffect as jd,useRef as MC,useState as IC}from"react";import{jsx as RC}from"react/jsx-runtime";function Jf({src:e,...t}){return RC("img",{src:e,...t,style:{display:"none"}})}import{jsx as LC,jsxs as NC}from"react/jsx-runtime";var jf=kC({ready:!1,app:vm,currentScreen:null,lastScreen:null,navigate:pt,navigateBack:pt,resetNavigation:pt,setModalData:pt,onUserCloseViaDialogOrKeybindRef:void 0}),WC=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],$f=e=>{let t=Le(),r=e.authenticated,[o,n]=IC(e.initialScreen);jd(()=>{!r&&!WC.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=MC(null);jd(()=>{e.open||(i.current=null)},[e.open]),jd(()=>{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 NC(jf.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&LC(Jf,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},x=()=>_C(jf);import{jsx as zi,jsxs as OC}from"react/jsx-runtime";var Qa=({style:e,...t})=>{let{app:r}=x();return OC("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:[zi("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),zi("g",{clipPath:"url(#clip0_1765_9946)",children:zi("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"})}),zi("defs",{children:zi("clipPath",{id:"clip0_1765_9946",children:zi("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var jr=class extends tr{constructor(r,o,n,i,a,l,s,d){super(d||"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 Ze(void 0,this.rpcTimeoutDuration),d&&(this.walletEntry=yl[d],this.walletClientType=d)}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=hl(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:Hi,id:"io.metamask"}:{name:Ju(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Qa,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=yl[r],this.walletClientType=r,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,Tf(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new Ui)};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 _e("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=hl(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Fi(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(a=>{if(a){o(Jr(a));return}o(new _e("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=$u(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 DC.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:UC,optionalMethods:FC,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(),BC&&this.walletEntry){let{redirect:l,href:s}=wf(a,this.walletEntry);Sf({href:s,name:this.walletEntry.displayName}),this.redirectUri=l;let d=bf(a,this.walletEntry);d?.redirect&&(this.fallbackUniversalRedirectUri=d.redirect),gl(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=hl(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 ep=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>HC(o)).map(o=>eh(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},Fi=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||Gn:Gn,Xa=class extends VC{constructor(r,o,n,i,a,l,s,d,u,m,f){super();this.getEthereumProvider=()=>{let r=this.wallets[0],o=this.walletConnectors.find(n=>n.wallets.find(i=>i.address===r?.address));return!r||!o?new Ze: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=d,this.externalWalletConfig=u,this.privyAppName=m,this.privyAppLogo=f,this.storedConnections=$d()}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;J.get(Vd)&&(J.getKeys().forEach(o=>{o.startsWith("walletconnect")&&J.del(o)}),J.del(Vd));let r=ju(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"),!en()&&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}findEmbeddedWalletConnectors(){return this.walletConnectors.filter(r=>r.connectorType==="embedded")}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"))}addEmbeddedWalletConnectors({walletProxy:r,rootWallet:o,embeddedWallets:n,defaultChain:i,appId:a}){for(let l of n){let s=this.findEmbeddedWalletConnectors().find(d=>d.walletIndex===l.walletIndex);if(s)s.proxyProvider.walletProxy=r;else{let d=new Ka({walletProxy:r,address:l.address,rootAddress:o.address,rpcConfig:this.rpcConfig,chains:this.chains,appId:a,chainId:i.id,walletIndex:l.walletIndex}),u=new Ya({provider:d,chains:this.chains,defaultChain:i,rpcConfig:this.rpcConfig,imported:!1,walletIndex:l.walletIndex});this.addWalletConnector(u)}}}addImportedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded_imported","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new Ka({walletProxy:r,rootAddress:o,address:o,walletIndex:0,rpcConfig:this.rpcConfig,chains:this.chains,appId:i,chainId:n.id}),s=new Ya({provider:l,chains:this.chains,walletIndex:0,defaultChain:n,rpcConfig:this.rpcConfig,imported:!0});this.addWalletConnector(s)}}removeEmbeddedWalletConnectors(){this.walletConnectors=this.walletConnectors.filter(r=>r.connectorType!=="embedded"),this.saveConnectionHistory(),this.storedConnections=$d(),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=$d(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let i=this.findWalletConnector(r,o);if(i)return i instanceof jr&&i.resetConnection(o),i;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new Ul(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new qi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new qi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new qi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Gi(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new Dl(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new Bl(this.defaultChain):new jr(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}));J.put(Gd,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=eh(r),this.emit("walletsUpdated")}};function Nl(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 GC=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",$d=()=>{let e=J.get(Gd);return e&&Array.isArray(e)&&e.map(o=>GC(o)).every(Boolean)?e:[]};import{ofetch as qC}from"ofetch";var zC=[sl,cl,ll,ml],Hl=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=Ud,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=qC.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=zC.includes(i.toString());if(!l.has("authorization")){let d=await this.client.getAccessToken({disableAutoRefresh:s});d!==null&&l.set("authorization",`Bearer ${d}`)}a.headers=l,a.retryDelay&&(a.retryDelay=a.retryDelay*3)},onRequestError:({error:i})=>{if(i instanceof DOMException&&i.name==="AbortError")throw new zu}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw ae(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw ae(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw ae(o)}}};var th=e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map(t=>({id:t.id,type:t.type,transports:t.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification});import an from"js-cookie";function rh(e){return e instanceof tn?"email":e instanceof rn?"sms":e instanceof Ho?"siwe":e instanceof Wi?"guest":e instanceof Ii?"custom_auth":e instanceof go?e.meta.provider:null}import{isSafari as KC}from"react-device-detect";function Vl(){return!(KC&&window.location.origin.startsWith("http://localhost"))}import*as oh from"jose";var Ur=class{static parse(t){try{return new Ur(t)}catch{return null}}constructor(t){this.value=t,this._decoded=oh.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 YC=30,Gl=class{constructor(){this.authenticateOnce=new Ye(async t=>this._authenticate(t)),this.linkOnce=new Ye(async t=>this._link(t)),this.refreshOnce=new Ye(this._refresh.bind(this)),this.destroyOnce=new Ye(this._destroy.bind(this)),this.forkSessionOnce=new Ye(this._forkSession.bind(this))}get token(){try{let t=J.get(Fn);return typeof t=="string"?new Ur(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=J.get(el);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=J.get(Na);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=J.get(Da(t));if(typeof r=="string"){let o=new Ur(r);return o.isExpired()?(J.del(Da(t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=an.get(tl);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!==cm}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=Ur.parse(this.token);return t!==null&&!t.isExpired(YC)}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"?J.put(Da(t),r):J.del(Da(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=rh(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:Ft(o),isNewUser:n,oAuthTokens:l}}catch(r){throw console.warn("Error authenticating session"),ot(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:Ft(r),oAuthTokens:n}}catch(r){throw console.warn("Error linking account"),ot(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),Ft(n.user)}catch(n){if(n instanceof Mr&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw ot(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(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(Im,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw ot(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=J.get(Fn);if(J.put(Fn,t),!this.client?.useServerCookies){let o=Ur.parse(t)?.expiration;an.set(Fd,t,{sameSite:"Strict",secure:Vl(),expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else J.del(Fn),an.remove(Fd),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(J.put(el,t),this.client?.useServerCookies||an.set(tl,"t",{sameSite:"Strict",secure:Vl(),expires:30})):(J.del(el),an.remove(nm),an.remove(tl))}storeIdentityToken(t){if(this.client?.useServerCookies)return;J.put(Bd,t);let r=Ur.parse(t)?.expiration;an.set(Hd,t,{sameSite:"Strict",secure:Vl(),expires:r?new Date(r*1e3):void 0})}clearIdentityToken(){J.del(Bd),an.remove(Hd)}clearForkedToken(){J.del(Na)}};var tp,ql,nh,Za=class{constructor(t){Xs(this,ql);this.apiUrl=t.apiUrl||$s,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!t.apiUrl&&t.apiUrl.startsWith("https://privy."),this.timeout=t.timeout||tm,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=qu(this,ql,nh).call(this),tp||(tp=new Gl),this.session=tp,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:d}){this.connectors||(this.connectors=new Xa(this.appId,t,r,o,n,i,a,l,s,d))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new Hl({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)}async link(){if(!this.authFlow)throw new w("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(pf,{action:"verify"})}catch(t){throw ae(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(uf,{});return th(t.options)}catch(t){throw ae(t)}}async acceptTerms(){try{let t=await this.api.post(mf,{});return Ft(t)}catch(t){throw ot(t)}}async unlinkEmail(t){try{let r=await this.api.post(zm,{address:t});return await this.getAuthenticatedUser()??Ft(r)}catch(r){throw ot(r)}}async unlinkPhone(t){try{let r=await this.api.post(Xm,{phoneNumber:t});return await this.getAuthenticatedUser()??Ft(r)}catch(r){throw ot(r)}}async unlinkWallet(t){try{let r=await this.api.post(Om,{address:t});return await this.getAuthenticatedUser()??Ft(r)}catch(r){throw ot(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(jm,{provider:t,subject:r});return await this.getAuthenticatedUser()??Ft(o)}catch(o){throw ot(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(Hm,{fid:t});return await this.getAuthenticatedUser()??Ft(r)}catch(r){throw ot(r)}}async unlinkTelegram(t){try{let r=await this.api.post(df,{telegram_user_id:t});return await this.getAuthenticatedUser()??Ft(r)}catch(r){throw ot(r)}}async unlinkPasskey(t){try{let r=await this.api.post(sf,{credential_id:t});return await this.getAuthenticatedUser()??Ft(r)}catch(r){throw ot(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(ml,{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(yf,t)}catch(r){throw ot(r)}}async initCoinbaseOnRamp(t){try{return this.api.post(gf,t)}catch(r){throw ot(r)}}async getCoinbaseOnRampStatus({partnerUserId:t}){try{return this.api.get(`${Cf}?partnerUserId=${t}`)}catch(r){throw ot(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?this.session.hasRefreshCredentials()?Ur.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:(this.session.destroyLocalState(),null):!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,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 ot(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(Wm,{address:t,token:r})).nonce}catch(o){throw ot(o)}}async authenticateWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(Lm,{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(Nm,{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 Ft(a)}catch(a){throw ot(a)}}async setCustomMetadata(t){try{let r=await this.api.post("api/v1/users/custom_metadata",{custom_metadata:t});return await this.getAuthenticatedUser()??Ft(r)}catch(r){throw ot(r)}}};ql=new WeakSet,nh=function(){if(typeof window>"u")return null;try{let r=J.get(Oa);if(typeof r=="string"&&r.length>0)return r}catch{}let t=QC();try{return J.put(Oa,t),t}catch{return t}};import{Turnstile as ev}from"@marsidev/react-turnstile";import{useEffect as tv,useMemo as rv}from"react";import{useMemo as XC,useRef as ZC,useContext as JC,useState as rp,createContext as jC}from"react";import{jsx as $C}from"react/jsx-runtime";var ih=jC({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:pt,setError:pt,setExecuting:pt,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:pt,reset:pt,execute:pt}),yr=class extends jt{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},ah=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=ZC(null),[i,a]=rp(),[l,s]=rp(),[d,u]=rp(!1),m=XC(()=>o?!d&&!i&&!l?{status:"ready"}:d&&!i&&!l?{status:"loading"}:i&&!l?{status:"success",token:i}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[o,i,l,d]);return $C(ih.Provider,{value:{...m,ref:n,enabled:o,siteKey:r,appId:t,setToken:a,setError:s,setExecuting:u,remove(){o&&(n.current?.remove(),u(!1),s(void 0),a(void 0))},reset(){o&&(n.current?.reset(),u(!1),s(void 0),a(void 0))},execute(){o&&(u(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await Zu(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new yr("Captcha failed",null,"captcha_timeout")}}},children:e})},Ae=()=>JC(ih);import{jsx as sh}from"react/jsx-runtime";var op=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=Ae(),[,s]=rv(()=>r?.split("t:")||[],[r]);if(tv(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return sh("div",{className:"hidden h-0 w-0",children:sh(ev,{...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:d=>{e.onSuccess?.(d),i(d),a(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};import{useCallback as FS,useEffect as b0,useRef as BS,useState as HS}from"react";import S0 from"styled-components";function np(e){Ne("configureMfa",e)}import Sv from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import fh from"styled-components";import Xn,{css as lh}from"styled-components";import ap from"styled-components";import{Fragment as nv,jsx as ip,jsxs as iv}from"react/jsx-runtime";var it=({success:e,fail:t})=>iv(nv,{children:[ip(at,{className:e?"success":t?"fail":""}),ip(Ja,{className:e?"success":t?"fail":""})]}),at=ap.span`
12
+ - https://privy.io`};var Ho=class{constructor(t,r,o,n=!1){this._meta={disableSignup:!1};this.getNonceOnce=new Ze(this._getNonceOnce.bind(this)),this.wallet=t,this.captchaToken=o,this.client=r,this._meta.disableSignup=n}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new v("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,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});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 ne(t)}}async link(){if(!this.client)throw new v("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 ne(t)}}async sign(){if(!this.client)throw new v("SiweFlow has no client instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new v("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 v("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildSiweMessage(){if(!this.client)throw new v("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=Ml({address:t,chainId:r,nonce:this.nonce}),this.preparedMessage}};var on=class{constructor(t,r,o=!1){this.meta={phoneNumber:t,captchaToken:r,disableSignup:o}}async authenticate(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new v("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post($m,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});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 ne(t)}}async link(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new v("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(Jm,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw ne(t)}}async sendSmsCode(t,r){if(!this.api)throw new v("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new v("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(Zm,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw ne(o)}}},Wl=class extends on{constructor(r,o,n){super(o,n);this.meta={phoneNumber:o,captchaToken:n,oldPhoneNumber:r,disableSignup:!1}}async link(){if(!this.api)throw new v("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new v("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(ef,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(r){throw ne(r)}}};var Bi=class{constructor(t,r=!1){this.meta={disableSignup:!1};this.meta={captchaToken:t,disableSignup:!1},this.meta.disableSignup=r}async authenticate(){if(!this.api)throw new v("Auth flow has no API instance");try{let t=await this.api.post(pf,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});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 ne(t)}}async link(){if(!this.api)throw new v("Auth flow has no API instance");try{return await this.api.post(uf,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw ne(t)}}};function tp(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 Gf(){let e;if(e=yC(),e)return Vf(),{...e,flowType:"login-url"};if(e=gC(),e)return Vf(),{...e,flowType:"web-app"}}function yC(){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 gC(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id")||void 0,o=t.get("user"),n=Number(t.get("auth_date")||""),i=t.get("hash"),a=t.get("chat_instance")||void 0,l=t.get("chat_type")||void 0,s=t.get("start_param")||void 0;if(!(!o||!n||!i))return{query_id:r,user:o,auth_date:n,hash:i,chat_instance:a,chat_type:l,start_param:s}}function Vf(){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"),e.hash="",window.history.replaceState({},"",e)}import{v4 as ZC}from"uuid";import{getAddress as oh}from"@ethersproject/address";import{isHexString as GC}from"@ethersproject/bytes";import qC from"eventemitter3";import PC from"@coinbase/wallet-sdk";import{jsx as qf,jsxs as CC}from"react/jsx-runtime";var Vo=({style:e,...t})=>CC("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:[qf("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),qf("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});import{getAddress as Co}from"@ethersproject/address";import{Web3Provider as Zf}from"@ethersproject/providers";import{default as TC}from"eventemitter3";import EC from"eventemitter3";var vC=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation"],zf=e=>vC.includes(e);import{ErrorCode as wC}from"@ethersproject/logger";import{ProviderErrors as Jn}from"@privy-io/js-sdk-core";var Hi=class extends Re{constructor(){super("Wallet timeout");this.type="wallet_error"}},Vi=class extends Re{constructor(){super("User rejected connection");this.type="wallet_error"}},Xr=e=>{if(e instanceof Re)return e;if(e?.code&&e?.reason){let t=new bt(e);return e.code===wC.ACTION_REJECTED&&(t.details=Jn.E4001_USER_REJECTED_REQUEST),t}return e?.code?new bt(e):new Re("Unknown connector error",e)},Wr=class extends Zt{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},bt=class extends Wr{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(Jn).find(i=>i.eipCode===o.code);this.details=n||Jn.UNKNOWN_ERROR,o.code===-32002&&(o.message?.includes("already pending for origin")?o.message?.includes("wallet_requestPermissions")?this.details=Jn.E32002_CONNECTION_ALREADY_PENDING:this.details=Jn.E32002_REQUEST_ALREADY_PENDING:o.message?.includes("Already processing")&&o.message.includes("eth_requestAccounts")&&(this.details=Jn.E32002_WALLET_LOCKED))}},bC={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},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1}},yo={...bC,...Jn};var je=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 Hi,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||Yn,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 Re(`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 Xr(r)})}},nn=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},Ya=class extends EC{constructor({walletProxy:r,address:o,rootAddress:n,rpcConfig:i,chains:a,appId:l,chainId:s=1,walletIndex:d}){super();this.walletProxy=r,this.address=o,this.rootAddress=n,this.chainId=s,this.rpcConfig=i,this.chains=a,this.provider=Rr(s,this.chains,i,{appId:l}),this.rpcTimeoutDuration=Gi(i,"privy"),this.appId=l,this.walletIndex=d}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new nn(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await ve()||!this.address)throw new nn("Disconnected",4900);return(await Qf(o,void 0,void 0,this.address)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new nn(`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 nn(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=Rr(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 Kf(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=r.params[0],n=typeof r.params[1]=="string"?JSON.parse(r.params[1]):r.params[1];return await Yf(Oa(n),void 0,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:Hn(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 Hn(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(zf(r.method)){let o=await ve();if(await Xf(),!o||!this.address)throw new nn("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.rootAddress,accessToken:o,hdWalletIndex:this.walletIndex,request:{method:r.method,params:r.params}})).response.data}catch(n){throw console.error(n),new nn("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await ve();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 je{constructor(r){super(r,r.rpcTimeoutDuration)}},an=class extends je{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 SC=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||e.message?.includes("4902")}},jt=class extends TC{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=Ri(r),this.walletClientType==="privy"&&X.put(rl(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=Gi(i,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,i){let a=async()=>!!this.wallets.find(l=>Co(l.address)===Co(r));return{address:Co(r),chainId:o,meta:n,imported:i,switchChain:async l=>{if(!a)throw new Re("Wallet is not currently connected.");let s=this.wallets.find(y=>Co(y.address)===Co(r))?.chainId;if(!s)throw new Re("Unable to determine current chainId.");let d,u;if(typeof l=="number"?(d=`0x${l.toString(16)}`,u=l):(d=l,u=Number(l)),s===Ri(d))return;let m=this.chains.find(y=>y.id===u);if(!m)throw new Re(`Unsupported chainId: ${l}`);let f=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:d}]})};try{return await f()}catch(y){if(SC(y,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:d,chainName:m.name,nativeCurrency:m.nativeCurrency,rpcUrls:[m.rpcUrls.default?.http[0]??""],blockExplorerUrls:[m.blockExplorers?.default.url??""]}]}),f();throw this.walletClientType==="rainbow"&&y.message?.includes("wallet_switchEthereumChain")?new Re(`Rainbow does not support the chainId ${o}`):y}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new Re("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new Re("Wallet is not currently connected.");return new Zf(new go(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new Re("Wallet is not currently connected.");return new an(this.proxyProvider)},sign:async l=>{if(!await a())throw new Re("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 d=await Na(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,d),Array.isArray(d)&&(o=d)}}catch(d){console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",d)}if(!o||!Array.isArray(o)||o.length<=0||!o[0])return;let n=o[0],i=Co(n),a=[],l;if(this.walletClientType==="privy"){let d=X.get(rl(i));this.chains.find(u=>u.id===Number(d))||(X.del(rl(i)),d=null),l=d||`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 d=await Na(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,d),typeof d=="string")l=d;else if(typeof d=="number")l=`0x${d.toString(16)}`;else throw new Error("Invalid chainId returned from provider")}catch(d){console.warn(`Failed to get chainId from provider, defaulting to ${Qd}`,d),l=Qd}let s=Ri(l);if(!a.find(d=>Co(d.address)===i)){let d={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet(Co(n),s,d,this.connectorType==="embedded_imported"))}Ll(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=>Co(n)===Co(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 Zf(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 AC=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],Jf=(e,t)=>e.makeWeb3Provider({options:t}),Nl,Ol=class extends jt{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 je(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"),!Nl){let s=[o.id].concat(r.map(u=>u.id)),d=this.connectionOptions!=="eoaOnly"?s.filter(u=>!AC.includes(u)):[];d.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${d.join(", ")}`),Nl=new PC({appName:a,appLogoUrl:l,appChainIds:s})}this.proxyProvider.setWalletProvider(Jf(Nl,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:Vo,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 Re("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw Xr(r)}}updateConnectionPreference(r){this.connectionOptions=r,this.walletClientType=r==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(Jf(Nl,this.connectionOptions))}};var Qa=class extends jt{constructor({provider:r,chains:o,defaultChain:n,rpcConfig:i,imported:a,walletIndex:l}){super("privy",o,n,i);this.connectorType="embedded";this.proxyProvider=r,this.walletIndex=l,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:[Hn(r?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Ii,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};import{jsx as jf}from"react/jsx-runtime";var qi=({style:e,...t})=>jf("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:jf("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});import{jsx as pr,jsxs as xC}from"react/jsx-runtime";var zi=({style:e,...t})=>xC("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:[pr("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),pr("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),pr("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"}),pr("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"}),pr("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"}),pr("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"}),pr("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"}),pr("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"}),pr("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"}),pr("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"}),pr("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"}),pr("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"}),pr("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});import{jsx as $f,jsxs as RC}from"react/jsx-runtime";var vo=({style:e,...t})=>RC("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:[$f("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),$f("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 Yi=class extends jt{constructor(r,o,n,i,a){super(a||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new je(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 Re("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Xr(r)}}},Ki,Qi=class extends jt{constructor(r,o,n,i,a){super(a??"unknown",r,o,n);this.connectorType="injected";Qs(this,Ki,void 0);this.proxyProvider=new je(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(i),a==="metamask"?Hd(this,Ki,{name:"MetaMask",icon:zi,id:"io.metamask"}):a==="phantom"&&Hd(this,Ki,{name:"Phantom",icon:vo,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 Ku(this,Ki)??{name:"Browser Extension",icon:qi,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 Re("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Xr(r)}}};Ki=new WeakMap;import{getAddress as FR}from"@ethersproject/address";import{Web3Provider as HR}from"@ethersproject/providers";import{isMobile as kC}from"react-device-detect";var Dl=class extends Yi{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{kC||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 Re("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw Xr(t)}}};var Ul=class extends jt{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new je(void 0,Yn);this.connectorType=r}get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw new Error("connect called for an uninstalled wallet via the NullConnector")}disconnect(){throw new Error("disconnect called for an uninstalled wallet via the NullConnector")}promptConnection(r){throw new Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${r}`)}};var Fl=class extends Ul{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:vo,id:"phantom"}}};import{EthereumProvider as FC,OPTIONAL_EVENTS as BC,OPTIONAL_METHODS as HC}from"@walletconnect/ethereum-provider";import{isMobile as VC}from"react-device-detect";import{createContext as IC,useContext as MC,useEffect as rp,useRef as WC,useState as LC}from"react";import{jsx as _C}from"react/jsx-runtime";function eh({src:e,...t}){return _C("img",{src:e,...t,style:{display:"none"}})}import{jsx as OC,jsxs as DC}from"react/jsx-runtime";var th=IC({ready:!1,app:Em,currentScreen:null,lastScreen:null,navigate:ut,navigateBack:ut,resetNavigation:ut,setModalData:ut,onUserCloseViaDialogOrKeybindRef:void 0}),NC=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],rh=e=>{let t=Me(),r=e.authenticated,[o,n]=LC(e.initialScreen);rp(()=>{!r&&!NC.includes(e.initialScreen)&&e.setInitialScreen(null)},[r]);let i=WC(null);rp(()=>{e.open||(i.current=null)},[e.open]),rp(()=>{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 DC(th.Provider,{value:a,children:[(typeof t.appearance.logo=="string"||t.appearance.logo?.type==="img")&&OC(eh,{src:typeof t.appearance.logo=="string"?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},R=()=>MC(th);import{jsx as Xi,jsxs as UC}from"react/jsx-runtime";var Xa=({style:e,...t})=>{let{app:r}=R();return UC("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:[Xi("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),Xi("g",{clipPath:"url(#clip0_1765_9946)",children:Xi("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"})}),Xi("defs",{children:Xi("clipPath",{id:"clip0_1765_9946",children:Xi("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var Zr=class extends jt{constructor(r,o,n,i,a,l,s,d){super(d||"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 je(void 0,this.rpcTimeoutDuration),d&&(this.walletEntry=gl[d],this.walletClientType=d)}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=yl(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:em(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||Xa,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=gl[r],this.walletClientType=r,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,Af(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new Vi)};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 Re("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let s=yl(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=s?.entry,this.walletClientType=s?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Gi(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(l),r()})().catch(a=>{if(a){o(Xr(a));return}o(new Re("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=rm(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 FC.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:BC,optionalMethods:HC,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(),VC&&this.walletEntry){let{redirect:l,href:s}=Tf(a,this.walletEntry);xf({href:s,name:this.walletEntry.displayName}),this.redirectUri=l;let d=Sf(a,this.walletEntry);d?.redirect&&(this.fallbackUniversalRedirectUri=d.redirect),Cl(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=yl(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 np=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(o=>GC(o)).map(o=>oh(o));return t?.length?!!e?.linkedAccounts.filter(o=>o.type=="wallet"&&t.includes(o.address)).length:!1},Gi=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||Yn:Yn,Za=class extends qC{constructor(r,o,n,i,a,l,s,d,u,m,f){super();this.getEthereumProvider=()=>{let r=this.wallets[0],o=this.walletConnectors.find(n=>n.wallets.find(i=>i.address===r?.address));return!r||!o?new je: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=d,this.externalWalletConfig=u,this.privyAppName=m,this.privyAppLogo=f,this.storedConnections=op()}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(Kd)&&(X.getKeys().forEach(o=>{o.startsWith("walletconnect")&&X.del(o)}),X.del(Kd));let r=tm(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"),!tn()&&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}findEmbeddedWalletConnectors(){return this.walletConnectors.filter(r=>r.connectorType==="embedded")}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"))}addEmbeddedWalletConnectors({walletProxy:r,rootWallet:o,embeddedWallets:n,defaultChain:i,appId:a}){for(let l of n){let s=this.findEmbeddedWalletConnectors().find(d=>d.walletIndex===l.walletIndex);if(s)s.proxyProvider.walletProxy=r;else{let d=new Ya({walletProxy:r,address:l.address,rootAddress:o.address,rpcConfig:this.rpcConfig,chains:this.chains,appId:a,chainId:i.id,walletIndex:l.walletIndex}),u=new Qa({provider:d,chains:this.chains,defaultChain:i,rpcConfig:this.rpcConfig,imported:!1,walletIndex:l.walletIndex});this.addWalletConnector(u)}}}addImportedWalletConnector(r,o,n,i){let a=this.findWalletConnector("embedded_imported","privy");if(a)a.proxyProvider.walletProxy=r;else{let l=new Ya({walletProxy:r,rootAddress:o,address:o,walletIndex:0,rpcConfig:this.rpcConfig,chains:this.chains,appId:i,chainId:n.id}),s=new Qa({provider:l,chains:this.chains,walletIndex:0,defaultChain:n,rpcConfig:this.rpcConfig,imported:!0});this.addWalletConnector(s)}}removeEmbeddedWalletConnectors(){this.walletConnectors=this.walletConnectors.filter(r=>r.connectorType!=="embedded"),this.saveConnectionHistory(),this.storedConnections=op(),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=op(),this.emit("walletsUpdated")}}async createWalletConnector(r,o,n){let i=this.findWalletConnector(r,o);if(i)return i instanceof Zr&&i.resetConnection(o),i;let l=(()=>{if(r==="injected"){if(o==="metamask"&&n?.eip6963InjectedProvider)return new Dl(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,"metamask");if(o==="metamask"&&n?.legacyInjectedProvider)return new Qi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"metamask");if(o==="phantom"&&n?.legacyInjectedProvider)return new Qi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider,"phantom");if(n?.legacyInjectedProvider&&o==="unknown_browser_extension")return new Qi(this.chains,this.defaultChain,this.rpcConfig,n?.legacyInjectedProvider);if(n?.eip6963InjectedProvider)return new Yi(this.chains,this.defaultChain,this.rpcConfig,n?.eip6963InjectedProvider,o)}else return r==="coinbase_wallet"?new Ol(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new Fl(this.defaultChain):new Zr(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(Yd,r)}async activeWalletSign(r){let o=this.wallets,n=o.length>0?o[0]:null;return n?n.sign(r):null}setActiveWallet(r){this.activeWallet=oh(r),this.emit("walletsUpdated")}};function Ll(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 zC=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",op=()=>{let e=X.get(Yd);return e&&Array.isArray(e)&&e.map(o=>zC(o)).every(Boolean)?e:[]};import{ofetch as KC}from"ofetch";var YC=[ll,dl,cl,fl],Bl=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=Vd,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=KC.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=YC.includes(i.toString());if(!l.has("authorization")){let d=await this.client.getAccessToken({disableAutoRefresh:s});d!==null&&l.set("authorization",`Bearer ${d}`)}a.headers=l,a.retryDelay&&(a.retryDelay=a.retryDelay*3)},onRequestError:({error:i})=>{if(i instanceof DOMException&&i.name==="AbortError")throw new Qu}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw ne(o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw ne(n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw ne(o)}}};var nh=e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map(t=>({id:t.id,type:t.type,transports:t.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification});import sn from"js-cookie";function ih(e){return e instanceof rn?"email":e instanceof on?"sms":e instanceof Ho?"siwe":e instanceof Di?"guest":e instanceof Oi?"custom_auth":e instanceof ho?e.meta.provider:null}import{isSafari as QC}from"react-device-detect";function Hl(){return!(QC&&window.location.origin.startsWith("http://localhost"))}import*as ah from"jose";var Lr=class{static parse(t){try{return new Lr(t)}catch{return null}}constructor(t){this.value=t,this._decoded=ah.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 XC=30,Vl=class{constructor(){this.authenticateOnce=new Ze(async t=>this._authenticate(t)),this.linkOnce=new Ze(async t=>this._link(t)),this.refreshOnce=new Ze(this._refresh.bind(this)),this.destroyOnce=new Ze(this._destroy.bind(this)),this.forkSessionOnce=new Ze(this._forkSession.bind(this))}get token(){try{let t=X.get(Vn);return typeof t=="string"?new Lr(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=X.get($s);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=X.get(Da);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=X.get(Fa(t));if(typeof r=="string"){let o=new Lr(r);return o.isExpired()?(X.del(Fa(t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=sn.get(el);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!==um}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=Lr.parse(this.token);return t!==null&&!t.isExpired(XC)}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(Fa(t),r):X.del(Fa(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=ih(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:Dt(o),isNewUser:n,oAuthTokens:l}}catch(r){throw console.warn("Error authenticating session"),nt(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:Dt(r),oAuthTokens:n}}catch(r){throw console.warn("Error linking account"),nt(r)}}async _refresh(){if(!this.api)throw new v("Session has no API instance");if(!this.client)throw new v("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(ll,a,{headers:i}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(dl,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),Dt(n.user)}catch(n){if(n instanceof xr&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw nt(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(cl,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new v("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 nt(r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=X.get(Vn);if(X.put(Vn,t),!this.client?.useServerCookies){let o=Lr.parse(t)?.expiration;sn.set(Gd,t,{sameSite:"Strict",secure:Hl(),expires:o?new Date(o*1e3):void 0})}r!==t&&this.client?.onStoreToken?.(t)}else X.del(Vn),sn.remove(Gd),this.client?.onDeleteToken?.()}storeRefreshToken(t){typeof t=="string"?(X.put($s,t),this.client?.useServerCookies||sn.set(el,"t",{sameSite:"Strict",secure:Hl(),expires:30})):(X.del($s),sn.remove(sm),sn.remove(el))}storeIdentityToken(t){if(this.client?.useServerCookies)return;X.put(qd,t);let r=Lr.parse(t)?.expiration;sn.set(zd,t,{sameSite:"Strict",secure:Hl(),expires:r?new Date(r*1e3):void 0})}clearIdentityToken(){X.del(qd),sn.remove(zd)}clearForkedToken(){X.del(Da)}};var ip,Gl,sh,Ja=class{constructor(t){Qs(this,Gl);this.apiUrl=t.apiUrl||js,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!t.apiUrl&&t.apiUrl.startsWith("https://privy."),this.timeout=t.timeout||nm,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=Yu(this,Gl,sh).call(this),ip||(ip=new Vl),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:d}){this.connectors||(this.connectors=new Za(this.appId,t,r,o,n,i,a,l,s,d))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new Bl({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 v("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new v("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(ff,{action:"verify"})}catch(t){throw ne(t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(hf,{});return nh(t.options)}catch(t){throw ne(t)}}async acceptTerms(){try{let t=await this.api.post(yf,{});return Dt(t)}catch(t){throw nt(t)}}async unlinkEmail(t){try{let r=await this.api.post(Qm,{address:t});return await this.getAuthenticatedUser()??Dt(r)}catch(r){throw nt(r)}}async unlinkPhone(t){try{let r=await this.api.post(jm,{phoneNumber:t});return await this.getAuthenticatedUser()??Dt(r)}catch(r){throw nt(r)}}async unlinkWallet(t){try{let r=await this.api.post(Fm,{address:t});return await this.getAuthenticatedUser()??Dt(r)}catch(r){throw nt(r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(tf,{provider:t,subject:r});return await this.getAuthenticatedUser()??Dt(o)}catch(o){throw nt(o)}}async unlinkFarcaster(t){try{let r=await this.api.post(qm,{fid:t});return await this.getAuthenticatedUser()??Dt(r)}catch(r){throw nt(r)}}async unlinkTelegram(t){try{let r=await this.api.post(mf,{telegram_user_id:t});return await this.getAuthenticatedUser()??Dt(r)}catch(r){throw nt(r)}}async unlinkPasskey(t){try{let r=await this.api.post(df,{credential_id:t});return await this.getAuthenticatedUser()??Dt(r)}catch(r){throw nt(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(fl,{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(vf,t)}catch(r){throw nt(r)}}async initCoinbaseOnRamp(t){try{return this.api.post(wf,t)}catch(r){throw nt(r)}}async getCoinbaseOnRampStatus({partnerUserId:t}){try{return this.api.get(`${bf}?partnerUserId=${t}`)}catch(r){throw nt(r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?this.session.hasRefreshCredentials()?Lr.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:(this.session.destroyLocalState(),null):!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,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 nt(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(Om,{address:t,token:r})).nonce}catch(o){throw nt(o)}}async authenticateWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i,mode:a}){return await this.api.post(Dm,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:i,mode:a})}async linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:i}){return await this.api.post(Um,{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 Dt(a)}catch(a){throw nt(a)}}async setCustomMetadata(t){try{let r=await this.api.post("api/v1/users/custom_metadata",{custom_metadata:t});return await this.getAuthenticatedUser()??Dt(r)}catch(r){throw nt(r)}}};Gl=new WeakSet,sh=function(){if(typeof window>"u")return null;try{let r=X.get(Ua);if(typeof r=="string"&&r.length>0)return r}catch{}let t=ZC();try{return X.put(Ua,t),t}catch{return t}};import{Turnstile as rv}from"@marsidev/react-turnstile";import{useEffect as ov,useMemo as nv}from"react";import{useMemo as JC,useRef as jC,useContext as $C,useState as ap,createContext as ev}from"react";import{jsx as tv}from"react/jsx-runtime";var lh=ev({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:ut,setError:ut,setExecuting:ut,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:ut,reset:ut,execute:ut}),ur=class extends Zt{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},ch=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=jC(null),[i,a]=ap(),[l,s]=ap(),[d,u]=ap(!1),m=JC(()=>o?!d&&!i&&!l?{status:"ready"}:d&&!i&&!l?{status:"loading"}:i&&!l?{status:"success",token:i}:l?{status:"error",error:l}:{status:"ready"}:{status:"disabled"},[o,i,l,d]);return tv(lh.Provider,{value:{...m,ref:n,enabled:o,siteKey:r,appId:t,setToken:a,setError:s,setExecuting:u,remove(){o&&(n.current?.remove(),u(!1),s(void 0),a(void 0))},reset(){o&&(n.current?.reset(),u(!1),s(void 0),a(void 0))},execute(){o&&(u(!0),n.current?.execute())},async waitForResult(){if(!o)return"";try{return await $u(()=>n.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new ur("Captcha failed",null,"captcha_timeout")}}},children:e})},Ee=()=>$C(lh);import{jsx as dh}from"react/jsx-runtime";var sp=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:i,setExecuting:a,ref:l}=Ee(),[,s]=nv(()=>r?.split("t:")||[],[r]);if(ov(()=>l.current?.remove,[]),!t)return null;if(!s)throw new Error("Unsupported captcha site key");return dh("div",{className:"hidden h-0 w-0",children:dh(rv,{...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:d=>{e.onSuccess?.(d),i(d),a(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),n(void 0),i(void 0)}catch{n("expired_and_failed_reset")}}})})};import{useCallback as FS,useEffect as A0,useRef as BS,useState as HS}from"react";import k0 from"styled-components";function lp(e){He("configureMfa",e)}import Av from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import gh from"styled-components";import jn,{css as ph}from"styled-components";import dp from"styled-components";import{Fragment as av,jsx as cp,jsxs as sv}from"react/jsx-runtime";var at=({success:e,fail:t})=>sv(av,{children:[cp(st,{className:e?"success":t?"fail":""}),cp(ja,{className:e?"success":t?"fail":""})]}),st=dp.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
- `,Ja=ap(at)`
45
+ `,ja=dp(st)`
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
- `,Eo=e=>ip(ov,{color:e.color||"var(--privy-color-foreground-3)"}),ov=ap(at)`
51
+ `,wo=e=>cp(iv,{color:e.color||"var(--privy-color-foreground-3)"}),iv=dp(st)`
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
- `;import{jsx as rr,jsxs as Kl}from"react/jsx-runtime";var ja=Xn.button`
61
+ `;import{jsx as $t,jsxs as zl}from"react/jsx-runtime";var $a=jn.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
- `,F=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>rr(ch,{disabled:t||r,...n,children:t?Kl("span",{children:[rr(Eo,{}),o?rr("span",{children:o}):null]}):e}),Go=({children:e,loading:t,disabled:r,...o})=>rr(av,{disabled:r,...o,children:t?rr(Eo,{color:"var(--privy-color-foreground-accent)"}):e}),av=Xn(ja)`
83
+ `,F=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>$t(uh,{disabled:t||r,...n,children:t?zl("span",{children:[$t(wo,{}),o?$t("span",{children:o}):null]}):e}),Go=({children:e,loading:t,disabled:r,...o})=>$t(lv,{disabled:r,...o,children:t?$t(wo,{color:"var(--privy-color-foreground-accent)"}):e}),lv=jn($a)`
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
- `,zl=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>rr(ch,{as:"a",disabled:t||r,...n,children:t?Kl("span",{children:[rr(Eo,{}),o?rr("span",{children:o}):null]}):e}),ch=Xn(ja)`
109
+ `,ql=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>$t(uh,{as:"a",disabled:t||r,...n,children:t?zl("span",{children:[$t(wo,{}),o?$t("span",{children:o}):null]}):e}),uh=jn($a)`
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?lh`
135
+ ${e=>e.disabled?ph`
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
- `,$r=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>rr(sv,{disabled:t||r,...n,children:t?Kl("span",{children:[rr(Eo,{}),o?rr("span",{children:o}):null]}):e}),sv=Xn(ja)`
154
+ `,Jr=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>$t(cv,{disabled:t||r,...n,children:t?zl("span",{children:[$t(wo,{}),o?$t("span",{children:o}):null]}):e}),cv=jn($a)`
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
- `,sn=Xn.button`
183
+ `,ln=jn.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&&lh`
196
+ ${e=>e.invisible&&ph`
197
197
  pointer-events: none;
198
198
  `}
199
199
 
@@ -211,10 +211,10 @@ Resources:
211
211
  cursor: not-allowed;
212
212
  }
213
213
  }
214
- `,Y_=Xn.div`
214
+ `,q_=jn.div`
215
215
  /* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */
216
216
  height: 44px;
217
- `,Ki=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>Kl(lv,{isSubmitting:o,onClick:t,disabled:r,...n,children:[rr("span",{children:e}),rr("span",{children:rr(Eo,{})})]}),lv=Xn.button`
217
+ `,Zi=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>zl(dv,{isSubmitting:o,onClick:t,disabled:r,...n,children:[$t("span",{children:e}),$t("span",{children:$t(wo,{})})]}),dv=jn.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
- `;import cv from"styled-components";var dh=cv.span`
259
+ `;import pv from"styled-components";var mh=pv.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
- `;import dv from"@heroicons/react/24/outline/ArrowLeftIcon";import pv from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import uv from"@heroicons/react/24/outline/XMarkIcon";import Yi from"styled-components";import{jsx as or,jsxs as ph}from"react/jsx-runtime";var mv=({backFn:e})=>or("div",{children:or(sp,{onClick:e,children:or(dv,{height:"16px",width:"16px",strokeWidth:2})})}),fv=({infoFn:e})=>or("div",{children:or(yv,{"aria-label":"info",onClick:e,children:or(pv,{height:"22px",width:"22px",strokeWidth:2})})}),hv=e=>or("div",{children:or(sp,{"aria-label":"close modal",onClick:e.onClose,children:or(uv,{height:"16px",width:"16px",strokeWidth:2})})});var R=({backFn:e,infoFn:t,onClose:r,title:o,closeable:n=!0})=>{let{closePrivyModal:i}=L(),a=Le();return ph(gv,{children:[ph(Cv,{children:[e&&or(mv,{backFn:e}),t&&or(fv,{infoFn:t})]}),o&&or(wv,{id:"privy-dialog-title",children:o}),or(vv,{children:!a.render.standalone&&n&&or(hv,{onClose:r||(()=>i())})})]})},sp=Yi.button`
271
+ `;import uv from"@heroicons/react/24/outline/ArrowLeftIcon";import mv from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import fv from"@heroicons/react/24/outline/XMarkIcon";import Ji from"styled-components";import{jsx as er,jsxs as fh}from"react/jsx-runtime";var hv=({backFn:e})=>er("div",{children:er(pp,{onClick:e,children:er(uv,{height:"16px",width:"16px",strokeWidth:2})})}),yv=({infoFn:e})=>er("div",{children:er(Cv,{"aria-label":"info",onClick:e,children:er(mv,{height:"22px",width:"22px",strokeWidth:2})})}),gv=e=>er("div",{children:er(pp,{"aria-label":"close modal",onClick:e.onClose,children:er(fv,{height:"16px",width:"16px",strokeWidth:2})})});var k=({backFn:e,infoFn:t,onClose:r,title:o,closeable:n=!0})=>{let{closePrivyModal:i}=M(),a=Me();return fh(vv,{children:[fh(wv,{children:[e&&er(hv,{backFn:e}),t&&er(yv,{infoFn:t})]}),o&&er(Ev,{id:"privy-dialog-title",children:o}),er(bv,{children:!a.render.standalone&&n&&er(gv,{onClose:r||(()=>i())})})]})},pp=Ji.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
- `,yv=Yi(sp)`
290
+ `,Cv=Ji(pp)`
291
291
  && {
292
292
  background-color: transparent;
293
293
  }
294
- `,gv=Yi.div`
294
+ `,vv=Ji.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
- `,Cv=Yi.div`
306
+ `,wv=Ji.div`
307
307
  flex: 1;
308
308
  align-items: center;
309
309
  display: flex;
310
310
  gap: 8px;
311
- `,vv=Yi.div`
311
+ `,bv=Ji.div`
312
312
  flex: 1;
313
313
  display: flex;
314
314
  justify-content: flex-end;
315
- `,wv=Yi.div`
315
+ `,Ev=Ji.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
- `;import bv from"styled-components";var Ev=bv.div`
322
+ `;import Tv from"styled-components";var Sv=Tv.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
- `,je=Ev;import ln,{css as Tv}from"styled-components";var gr=ln.div`
345
+ `,tt=Sv;import cn,{css as Pv}from"styled-components";var mr=cn.div`
346
346
  text-align: left;
347
347
  flex-grow: 1;
348
- `,Yl=ln.div`
348
+ `,Kl=cn.div`
349
349
  display: flex;
350
350
  flex-direction: column;
351
351
  justify-content: flex-end;
352
352
  flex-grow: 1;
353
- `,nr=ln.div`
353
+ `,tr=cn.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
- `,uh=ln(nr)`
368
+ `,hh=cn(tr)`
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
- `,mh=Tv`
374
+ `,yh=Pv`
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
- `,Ql=ln.div`
411
+ `,Yl=cn.div`
412
412
  text-align: center;
413
413
  font-size: 14px;
414
414
  margin-bottom: 24px;
415
- `,Pe=ln.button`
416
- ${mh}
417
- `,lp=ln.a`
418
- ${mh}
419
- `,eo=ln.div`
415
+ `,Te=cn.button`
416
+ ${yh}
417
+ `,up=cn.a`
418
+ ${yh}
419
+ `,jr=cn.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
- `;import{Fragment as xv,jsx as Zn,jsxs as $a}from"react/jsx-runtime";var hh=()=>{let{navigate:e,app:t}=x();return $a(xv,{children:[Zn(R,{}),$a(Av,{children:[Zn(je,{children:$a("div",{children:[Zn(dh,{color:"var(--privy-color-warn-light)"}),Zn(Sv,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),$a(Pv,{children:[Zn("h3",{children:"Account not found"}),$a("p",{children:["Please try logging in again or go to ",t.name," to create an account."]})]}),Zn(gr,{}),Zn(F,{onClick:()=>e("LANDING"),children:"Try logging in again"})]})]})},Av=fh.div`
426
+ `;import{Fragment as kv,jsx as $n,jsxs as es}from"react/jsx-runtime";var Ch=()=>{let{navigate:e,app:t}=R();return es(kv,{children:[$n(k,{}),es(xv,{children:[$n(tt,{children:es("div",{children:[$n(mh,{color:"var(--privy-color-warn-light)"}),$n(Av,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),es(Rv,{children:[$n("h3",{children:"Account not found"}),es("p",{children:["Please try logging in again or go to ",t.name," to create an account."]})]}),$n(mr,{}),$n(F,{onClick:()=>e("LANDING"),children:"Try logging in again"})]})]})},xv=gh.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
- `,Pv=fh.div`
435
+ `,Rv=gh.div`
436
436
  display: flex;
437
437
  flex-direction: column;
438
438
  gap: 8px;
439
- `;import gh from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import Rv from"@heroicons/react/24/solid/DocumentCheckIcon";import kv from"styled-components";import ht from"styled-components";var Fe=ht.div`
439
+ `;import wh from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import _v from"@heroicons/react/24/solid/DocumentCheckIcon";import Iv from"styled-components";import ht from"styled-components";var Fe=ht.div`
440
440
  display: flex;
441
441
  flex-direction: column;
442
442
  align-items: center;
@@ -444,17 +444,17 @@ Resources:
444
444
  @media (max-width: 440px) {
445
445
  padding: 10px 10px 20px;
446
446
  }
447
- `,fe=ht.div`
447
+ `,ue=ht.div`
448
448
  font-size: 18px;
449
449
  line-height: 30px;
450
450
  text-align: center;
451
451
  font-weight: 600;
452
452
  margin-bottom: 10px;
453
- `,ye=ht.div`
453
+ `,fe=ht.div`
454
454
  font-size: 0.875rem;
455
455
 
456
456
  text-align: center;
457
- `,Fr=ht.div`
457
+ `,Nr=ht.div`
458
458
  display: flex;
459
459
  flex-direction: column;
460
460
  align-items: center;
@@ -464,7 +464,7 @@ Resources:
464
464
  @media (max-width: 440px) {
465
465
  padding: 10px 10px 20px;
466
466
  }
467
- `,Jn=ht.div`
467
+ `,ei=ht.div`
468
468
  display: flex;
469
469
  flex-direction: column;
470
470
  align-items: stretch;
@@ -472,7 +472,7 @@ Resources:
472
472
  padding: 1rem 0rem 0rem;
473
473
  flex-grow: 1;
474
474
  width: 100%;
475
- `,ir=ht.div`
475
+ `,rr=ht.div`
476
476
  width: 25px;
477
477
  display: flex;
478
478
  align-items: center;
@@ -484,19 +484,19 @@ Resources:
484
484
  width: 25px !important;
485
485
  color: var(--privy-color-accent);
486
486
  }
487
- `,ar=ht.div`
487
+ `,or=ht.div`
488
488
  display: flex;
489
489
  align-items: center;
490
490
  gap: 10px;
491
491
  font-size: 0.875rem;
492
492
  line-height: 1rem;
493
493
  text-align: left;
494
- `,kt=ht.div`
494
+ `,xt=ht.div`
495
495
  display: flex;
496
496
  flex-direction: column;
497
497
  gap: 10px;
498
498
  padding-top: 20px;
499
- `,Xl=ht.div`
499
+ `,Ql=ht.div`
500
500
  display: flex;
501
501
  flex-direction: column;
502
502
  align-items: stretch;
@@ -504,11 +504,11 @@ Resources:
504
504
  padding: 1rem 0rem 0rem;
505
505
  flex-grow: 1;
506
506
  width: 100%;
507
- `,Zl=ht.div`
507
+ `,Xl=ht.div`
508
508
  display: flex;
509
509
  gap: 5px;
510
510
  width: 100%;
511
- `,Jl=ht.button`
511
+ `,Zl=ht.button`
512
512
  && {
513
513
  background-color: transparent;
514
514
  color: var(--privy-color-foreground-3);
@@ -526,7 +526,7 @@ Resources:
526
526
  &&:hover {
527
527
  color: var(--privy-color-error);
528
528
  }
529
- `,jl=ht.div`
529
+ `,Jl=ht.div`
530
530
  display: flex;
531
531
  align-items: center;
532
532
  gap: 0.5rem;
@@ -536,7 +536,7 @@ Resources:
536
536
  height: 20px !important;
537
537
  width: 20px !important;
538
538
  }
539
- `,jn=ht.div`
539
+ `,ti=ht.div`
540
540
  display: flex;
541
541
  align-items: center;
542
542
  gap: 6px;
@@ -550,15 +550,15 @@ Resources:
550
550
  display: flex !important;
551
551
  align-items: flex-end;
552
552
  }
553
- `,$l=ht.div`
553
+ `,jl=ht.div`
554
554
  width: 100%;
555
555
  display: flex;
556
556
  justify-content: space-between;
557
- `,yh=ht.p`
557
+ `,vh=ht.p`
558
558
  text-align: left;
559
559
  width: 100%;
560
560
  color: var(--privy-color-foreground-3) !important;
561
- `,es=ht.button`
561
+ `,ts=ht.button`
562
562
  display: flex;
563
563
  flex-direction: row;
564
564
  align-items: center;
@@ -588,7 +588,7 @@ Resources:
588
588
  &:hover {
589
589
  text-decoration: underline;
590
590
  }
591
- `,Je=ht.div`
591
+ `,$e=ht.div`
592
592
  display: flex;
593
593
  align-items: center;
594
594
  justify-content: center;
@@ -603,12 +603,12 @@ Resources:
603
603
  width: auto !important;
604
604
  color: white;
605
605
  }
606
- `,ec=ht.div`
606
+ `,$l=ht.div`
607
607
  color: var(--privy-color-error);
608
- `;import{Fragment as Iv,jsx as To,jsxs as ts}from"react/jsx-runtime";var Ch=()=>{let{user:e,logout:t}=K(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:i}=x(),{acceptTerms:a,closePrivyModal:l,createAnalyticsEvent:s}=L(),d=m=>{m?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};o.current=d;let u=async m=>{m.preventDefault(),await a(),e&&Et(e,r?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:f=>{console.error(f),s({eventName:"embedded_wallet_creation_failure_logout",payload:{error:f,screen:"AffirmativeConsentScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):l()};return To(_v,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:u,onDecline:d})},_v=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>ts(Iv,{children:[To(R,{closeable:!1}),To(Rv,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),To(fe,{style:{marginTop:24},children:"One last step"}),To(ye,{children:"By signing up, you agree to our terms and privacy policy."}),ts(nr,{style:{marginTop:24},children:[e&&ts(lp,{target:"_blank",href:e,children:["View Terms ",To(gh,{style:{marginLeft:"auto"}})]}),t&&ts(lp,{target:"_blank",href:t,children:["View Privacy Policy ",To(gh,{style:{marginLeft:"auto"}})]})]}),ts(Mv,{style:{marginTop:24},children:[To($r,{onClick:o,children:"No thanks"}),To(F,{onClick:r,children:"Accept"})]}),To(G,{})]}),Mv=kv.div`
608
+ `;import{Fragment as Lv,jsx as bo,jsxs as rs}from"react/jsx-runtime";var bh=()=>{let{user:e,logout:t}=V(),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:i}=R(),{acceptTerms:a,closePrivyModal:l,createAnalyticsEvent:s}=M(),d=m=>{m?.preventDefault(),l({shouldCallAuthOnSuccess:!1}),t()};o.current=d;let u=async m=>{m.preventDefault(),await a(),e&&vt(e,r?.embeddedWallets?.createOnLogin)?(n({createWallet:{onSuccess:()=>{},onFailure:f=>{console.error(f),s({eventName:"embedded_wallet_creation_failure_logout",payload:{error:f,screen:"AffirmativeConsentScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):l()};return bo(Mv,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:u,onDecline:d})},Mv=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>rs(Lv,{children:[bo(k,{closeable:!1}),bo(_v,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),bo(ue,{style:{marginTop:24},children:"One last step"}),bo(fe,{children:"By signing up, you agree to our terms and privacy policy."}),rs(tr,{style:{marginTop:24},children:[e&&rs(up,{target:"_blank",href:e,children:["View Terms ",bo(wh,{style:{marginLeft:"auto"}})]}),t&&rs(up,{target:"_blank",href:t,children:["View Privacy Policy ",bo(wh,{style:{marginLeft:"auto"}})]})]}),rs(Wv,{style:{marginTop:24},children:[bo(Jr,{onClick:o,children:"No thanks"}),bo(F,{onClick:r,children:"Accept"})]}),bo(B,{})]}),Wv=Iv.div`
609
609
  display: flex;
610
610
  gap: 10px;
611
- `;import wh from"styled-components";import Wv from"styled-components";var tc=Wv.span`
611
+ `;import Th from"styled-components";import Nv from"styled-components";var ec=Nv.span`
612
612
  && {
613
613
  width: 82px;
614
614
  height: 82px;
@@ -623,7 +623,7 @@ Resources:
623
623
  transition: border-color 800ms;
624
624
  border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
625
625
  }
626
- `;import{jsx as vh}from"react/jsx-runtime";var rc=({style:e,...t})=>vh("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:vh("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})});import{Fragment as cp,jsx as So,jsxs as oc}from"react/jsx-runtime";var bh=()=>{let{navigate:e,app:t}=x(),r=t?.allowlistConfig.errorTitle||"You don't have access to this app",o=t?.allowlistConfig.errorDetail||"Have you been invited?",n=t?.allowlistConfig.errorCtaText||"Try another account";return oc(cp,{children:[So(R,{}),oc(Lv,{children:[So(je,{children:oc("div",{children:[So(tc,{}),So(rc,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),oc(Nv,{children:[typeof r=="string"?So("h3",{children:r}):So(cp,{children:r}),typeof o=="string"?So("p",{children:o}):So(cp,{children:o})]}),t?.allowlistConfig.errorCtaLink?So(F,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):So(F,{onClick:()=>{e("LANDING")},children:n})]})]})},Lv=wh.div`
626
+ `;import{jsx as Eh}from"react/jsx-runtime";var tc=({style:e,...t})=>Eh("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:Eh("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})});import{Fragment as mp,jsx as Eo,jsxs as rc}from"react/jsx-runtime";var Sh=()=>{let{navigate:e,app:t}=R(),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 rc(mp,{children:[Eo(k,{}),rc(Ov,{children:[Eo(tt,{children:rc("div",{children:[Eo(ec,{}),Eo(tc,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),rc(Dv,{children:[typeof r=="string"?Eo("h3",{children:r}):Eo(mp,{children:r}),typeof o=="string"?Eo("p",{children:o}):Eo(mp,{children:o})]}),t?.allowlistConfig.errorCtaLink?Eo(F,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):Eo(F,{onClick:()=>{e("LANDING")},children:n})]})]})},Ov=Th.div`
627
627
  display: flex;
628
628
  flex-direction: column;
629
629
  align-items: center;
@@ -631,11 +631,11 @@ Resources:
631
631
  gap: 24px;
632
632
  width: 100%;
633
633
  padding-bottom: 16px;
634
- `,Nv=wh.div`
634
+ `,Dv=Th.div`
635
635
  display: flex;
636
636
  flex-direction: column;
637
637
  gap: 8px;
638
- `;import Uv from"@heroicons/react/20/solid/CheckIcon";import Fv from"@heroicons/react/24/outline/EnvelopeIcon";import Bv from"@heroicons/react/24/outline/PhoneIcon";import{useEffect as pp,useState as os}from"react";import{isMobile as Hv}from"react-device-detect";import ei from"styled-components";import sr from"styled-components";var lr=sr.div`
638
+ `;import Bv from"@heroicons/react/20/solid/CheckIcon";import Hv from"@heroicons/react/24/outline/EnvelopeIcon";import Vv from"@heroicons/react/24/outline/PhoneIcon";import{useEffect as hp,useState as ns}from"react";import{isMobile as Gv}from"react-device-detect";import oi from"styled-components";import nr from"styled-components";var ir=nr.div`
639
639
  display: flex;
640
640
  flex-direction: column;
641
641
  align-items: flex-start;
@@ -643,36 +643,36 @@ Resources:
643
643
  margin-top: auto;
644
644
  gap: 16px;
645
645
  flex-grow: 100;
646
- `,St=sr.div`
646
+ `,Et=nr.div`
647
647
  display: flex;
648
648
  flex-direction: column;
649
649
  align-items: center;
650
650
  justify-content: center;
651
651
  flex-grow: 1;
652
652
  width: 100%;
653
- `,Eh=sr.div`
653
+ `,Ph=nr.div`
654
654
  display: flex;
655
655
  flex-direction: column;
656
656
  align-items: center;
657
657
  width: 100%;
658
- `,Qi=sr(St)`
658
+ `,ji=nr(Et)`
659
659
  padding: 20px 0;
660
- `,Cr=sr(St)`
660
+ `,fr=nr(Et)`
661
661
  gap: 16px;
662
- `,cn=sr.div`
662
+ `,dn=nr.div`
663
663
  display: flex;
664
664
  flex-direction: column;
665
665
  width: 100%;
666
- `,Qe=sr.div`
666
+ `,Je=nr.div`
667
667
  display: flex;
668
668
  flex-direction: column;
669
669
  gap: 8px;
670
- `,ZM=sr.div`
670
+ `,YI=nr.div`
671
671
  display: flex;
672
672
  flex-direction: column;
673
673
  justify-content: space-between;
674
674
  height: 100%;
675
- `,Th=sr.div`
675
+ `,Ah=nr.div`
676
676
  display: flex;
677
677
  flex-direction: column;
678
678
  justify-content: flex-start;
@@ -695,15 +695,15 @@ Resources:
695
695
  color: var(--privy-color-foreground-3);
696
696
  font-size: 14px;
697
697
  }
698
- `,oe=sr.div`
698
+ `,te=nr.div`
699
699
  height: 16px;
700
- `,ne=sr.div`
700
+ `,re=nr.div`
701
701
  height: 12px;
702
- `,Sh=sr.div`
702
+ `,xh=nr.div`
703
703
  position: relative;
704
- `,Xi=sr.div`
704
+ `,$i=nr.div`
705
705
  height: ${e=>e.height??"12"}px;
706
- `,Ah=sr.div`
706
+ `,Rh=nr.div`
707
707
  background-color: var(--privy-color-accent);
708
708
  display: flex;
709
709
  justify-content: center;
@@ -711,9 +711,9 @@ Resources:
711
711
  border-radius: 50%;
712
712
  border-color: white;
713
713
  border-width: 2px !important;
714
- `;import dp from"styled-components";import{Fragment as Dv,jsx as rs,jsxs as xh}from"react/jsx-runtime";var $n=({title:e,description:t,children:r,...o})=>rs(Ph,{...o,children:xh(Dv,{children:[rs("h3",{children:e}),typeof t=="string"?rs("p",{children:t}):t,r]})}),Ao=dp($n)`
714
+ `;import fp from"styled-components";import{Fragment as Fv,jsx as os,jsxs as _h}from"react/jsx-runtime";var ri=({title:e,description:t,children:r,...o})=>os(kh,{...o,children:_h(Fv,{children:[os("h3",{children:e}),typeof t=="string"?os("p",{children:t}):t,r]})}),To=fp(ri)`
715
715
  margin-bottom: 24px;
716
- `,ve=({title:e,description:t,icon:r,children:o,...n})=>xh(Ov,{...n,children:[r||null,rs("h3",{children:e}),t&&typeof t=="string"?rs("p",{children:t}):t,o]}),Ph=dp.div`
716
+ `,ge=({title:e,description:t,icon:r,children:o,...n})=>_h(Uv,{...n,children:[r||null,os("h3",{children:e}),t&&typeof t=="string"?os("p",{children:t}):t,o]}),kh=fp.div`
717
717
  display: flex;
718
718
  flex-direction: column;
719
719
  justify-content: flex-start;
@@ -733,7 +733,7 @@ Resources:
733
733
  color: var(--privy-color-foreground-2);
734
734
  font-size: 14px;
735
735
  }
736
- `,Ov=dp(Ph)`
736
+ `,Uv=fp(kh)`
737
737
  align-items: center;
738
738
  text-align: center;
739
739
  gap: 16px;
@@ -741,7 +741,7 @@ Resources:
741
741
  h3 {
742
742
  margin-bottom: 24px;
743
743
  }
744
- `;import{Fragment as Zv,jsx as Bt,jsxs as qo}from"react/jsx-runtime";var up=6,Rh=new Array(up).fill(""),Vv=1400,Gv=30;var _h=()=>{let{app:e,navigate:t,lastScreen:r,navigateBack:o,setModalData:n,onUserCloseViaDialogOrKeybindRef:i}=x(),{closePrivyModal:a,resendEmailCode:l,resendSmsCode:s,getAuthMeta:d,loginWithCode:u,updateWallets:m,createAnalyticsEvent:f}=L(),{authenticated:g,logout:v,user:C}=K(),[b,A]=os(Rh),[_,S]=os(!1),[P,E]=os(null),[k,D]=os(null),[H,M]=os(0);i.current=()=>null;let X=d()?.email?0:1,W=We,Y=W-500;pp(()=>{if(H){let ee=setTimeout(()=>{M(H-1)},1e3);return()=>clearTimeout(ee)}},[H]),pp(()=>{if(g&&_&&C){if(e?.legal.requireUsersAcceptTerms&&!C.hasAcceptedTerms){let ue=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},Y);return()=>clearTimeout(ue)}if(Et(C,e?.embeddedWallets?.createOnLogin)){let ue=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:me=>{console.error(me),f({eventName:"embedded_wallet_creation_failure_logout",payload:{error:me,screen:"AwaitingPasswordlessCodeScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},Y);return()=>clearTimeout(ue)}else{m();let ue=setTimeout(()=>a({shouldCallAuthOnSuccess:!0,isSuccess:!0}),W);return()=>clearTimeout(ue)}}},[g,_,C]),pp(()=>{if(P&&k===0){let ee=setTimeout(()=>{A(Rh),E(null),document.querySelector("input[name=code-0]")?.focus()},Vv);return()=>clearTimeout(ee)}},[P]);let Ce=ee=>{ee.preventDefault();let ue=ee.currentTarget.value.replace(" ","");if(ue==="")return;if(isNaN(Number(ue))){E("Code should be numeric"),D(1);return}E(null),D(null);let me=Number(ee.currentTarget.name?.charAt(5)),Te=[...ue||[""]].slice(0,up-me),ce=[...b.slice(0,me),...Te,...b.slice(me+Te.length)];A(ce);let Se=Te.length,ft=Math.min(Math.max(me+Se,0),up-1);isNaN(Number(ee.currentTarget.value))||document.querySelector(`input[name=code-${ft}]`)?.focus(),ce.every(tt=>tt&&!isNaN(+tt))&&(document.querySelector(`input[name=code-${ft}]`)?.blur(),u(ce.join("")).then(()=>S(!0)).catch(le=>{if(le instanceof Mr&&le.privyErrorCode==="invalid_credentials")E("Invalid or expired verification code");else if(le instanceof Mr&&le.privyErrorCode==="cannot_link_more_of_type")E(le.message);else if(le instanceof Mr&&le.privyErrorCode==="max_accounts_reached"){console.error(new fo(le).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else if(le instanceof Mr&&le.privyErrorCode==="user_does_not_exist"){t("ACCOUNT_NOT_FOUND_SCREEN");return}else if(le instanceof Mr&&le.privyErrorCode==="linked_to_another_user"){n({errorModalData:{error:le,previousScreen:r??"AWAITING_PASSWORDLESS_CODE"}}),t("ERROR_SCREEN",!1);return}else E("Issue verifying code");D(0)}))},q=ee=>{k===1&&(E(null),D(null));let ue=[...b.slice(0,ee),"",...b.slice(ee+1)];A(ue),ee>0&&document.querySelector(`input[name=code-${ee-1}]`)?.focus()},pe=X==0?Bt(Fv,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):Bt(Bv,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),Q=X==0?qo("p",{children:["Please check ",Bt(kh,{children:d()?.email})," for an email from privy.io and enter your code below."]}):qo("p",{children:["Please check ",Bt(kh,{children:d()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return qo(Zv,{children:[Bt(R,{backFn:()=>o()},"header"),qo(qv,{children:[Bt(ve,{title:"Enter confirmation code",description:Q,icon:pe}),qo(Eh,{children:[qo(zv,{children:[Bt(Kv,{fail:!!P,success:_,children:Bt("span",{children:P||(_?"Success!":"")})}),Bt("div",{children:b.map((ee,ue)=>Bt("input",{name:`code-${ue}`,type:"text",value:b[ue],onChange:Ce,onKeyUp:me=>{me.key==="Backspace"&&q(ue)},inputMode:"numeric",autoFocus:ue===0,pattern:"[0-9]",className:`${_?"success":""} ${P?"fail":""}`,autoComplete:Hv?"one-time-code":"off"},ue))})]}),qo(Yv,{children:[qo("span",{children:["Didn't get ",X==0?"an email":"a message","?"]}),H?qo(Xv,{children:[Bt(Uv,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),Bt("span",{children:"Code sent"})]}):Bt(Qv,{children:Bt("button",{onClick:async()=>{M(Gv),X==0?await l():await s()},children:"Resend code"})})]})]})]}),Bt(G,{})]})},qv=ei.div`
744
+ `;import{Fragment as jv,jsx as Ut,jsxs as qo}from"react/jsx-runtime";var yp=6,Ih=new Array(yp).fill(""),qv=1400,zv=30;var Wh=()=>{let{app:e,navigate:t,lastScreen:r,navigateBack:o,setModalData:n,onUserCloseViaDialogOrKeybindRef:i}=R(),{closePrivyModal:a,resendEmailCode:l,resendSmsCode:s,getAuthMeta:d,loginWithCode:u,updateWallets:m,createAnalyticsEvent:f}=M(),{authenticated:y,logout:E,user:C}=V(),[w,P]=ns(Ih),[_,T]=ns(!1),[A,S]=ns(null),[I,N]=ns(null),[H,x]=ns(0);i.current=()=>null;let K=d()?.email?0:1,W=Ie,Q=W-500;hp(()=>{if(H){let ie=setTimeout(()=>{x(H-1)},1e3);return()=>clearTimeout(ie)}},[H]),hp(()=>{if(y&&_&&C){if(e?.legal.requireUsersAcceptTerms&&!C.hasAcceptedTerms){let se=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},Q);return()=>clearTimeout(se)}if(vt(C,e?.embeddedWallets?.createOnLogin)){let se=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:_e=>{console.error(_e),f({eventName:"embedded_wallet_creation_failure_logout",payload:{error:_e,screen:"AwaitingPasswordlessCodeScreen"}}),E()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},Q);return()=>clearTimeout(se)}else{m();let se=setTimeout(()=>a({shouldCallAuthOnSuccess:!0,isSuccess:!0}),W);return()=>clearTimeout(se)}}},[y,_,C]),hp(()=>{if(A&&I===0){let ie=setTimeout(()=>{P(Ih),S(null),document.querySelector("input[name=code-0]")?.focus()},qv);return()=>clearTimeout(ie)}},[A]);let de=ie=>{ie.preventDefault();let se=ie.currentTarget.value.replace(" ","");if(se==="")return;if(isNaN(Number(se))){S("Code should be numeric"),N(1);return}S(null),N(null);let _e=Number(ie.currentTarget.name?.charAt(5)),be=[...se||[""]].slice(0,yp-_e),ye=[...w.slice(0,_e),...be,...w.slice(_e+be.length)];P(ye);let ae=be.length,Xe=Math.min(Math.max(_e+ae,0),yp-1);isNaN(Number(ie.currentTarget.value))||document.querySelector(`input[name=code-${Xe}]`)?.focus(),ye.every(it=>it&&!isNaN(+it))&&(document.querySelector(`input[name=code-${Xe}]`)?.blur(),u(ye.join("")).then(()=>T(!0)).catch(le=>{if(le instanceof xr&&le.privyErrorCode==="invalid_credentials")S("Invalid or expired verification code");else if(le instanceof xr&&le.privyErrorCode==="cannot_link_more_of_type")S(le.message);else if(le instanceof xr&&le.privyErrorCode==="max_accounts_reached"){console.error(new uo(le).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else if(le instanceof xr&&le.privyErrorCode==="user_does_not_exist"){t("ACCOUNT_NOT_FOUND_SCREEN");return}else if(le instanceof xr&&le.privyErrorCode==="linked_to_another_user"){n({errorModalData:{error:le,previousScreen:r??"AWAITING_PASSWORDLESS_CODE"}}),t("ERROR_SCREEN",!1);return}else S("Issue verifying code");N(0)}))},q=ie=>{I===1&&(S(null),N(null));let se=[...w.slice(0,ie),"",...w.slice(ie+1)];P(se),ie>0&&document.querySelector(`input[name=code-${ie-1}]`)?.focus()},pe=K==0?Ut(Hv,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):Ut(Vv,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),Z=K==0?qo("p",{children:["Please check ",Ut(Mh,{children:d()?.email})," for an email from privy.io and enter your code below."]}):qo("p",{children:["Please check ",Ut(Mh,{children:d()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return qo(jv,{children:[Ut(k,{backFn:()=>o()},"header"),qo(Kv,{children:[Ut(ge,{title:"Enter confirmation code",description:Z,icon:pe}),qo(Ph,{children:[qo(Yv,{children:[Ut(Qv,{fail:!!A,success:_,children:Ut("span",{children:A||(_?"Success!":"")})}),Ut("div",{children:w.map((ie,se)=>Ut("input",{name:`code-${se}`,type:"text",value:w[se],onChange:de,onKeyUp:_e=>{_e.key==="Backspace"&&q(se)},inputMode:"numeric",autoFocus:se===0,pattern:"[0-9]",className:`${_?"success":""} ${A?"fail":""}`,autoComplete:Gv?"one-time-code":"off"},se))})]}),qo(Xv,{children:[qo("span",{children:["Didn't get ",K==0?"an email":"a message","?"]}),H?qo(Jv,{children:[Ut(Bv,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),Ut("span",{children:"Code sent"})]}):Ut(Zv,{children:Ut("button",{onClick:async()=>{x(zv),K==0?await l():await s()},children:"Resend code"})})]})]})]}),Ut(B,{})]})},Kv=oi.div`
745
745
  display: flex;
746
746
  flex-direction: column;
747
747
  align-items: flex-start;
@@ -749,7 +749,7 @@ Resources:
749
749
  margin: auto;
750
750
  gap: 16px;
751
751
  flex-grow: 1;
752
- `,zv=ei.div`
752
+ `,Yv=oi.div`
753
753
  display: flex;
754
754
  flex-direction: column;
755
755
  width: 100%;
@@ -806,7 +806,7 @@ Resources:
806
806
  transform: translate(1px, 0px);
807
807
  }
808
808
  }
809
- `,Kv=ei.div`
809
+ `,Qv=oi.div`
810
810
  line-height: 20px;
811
811
  height: 20px;
812
812
  font-size: 13px;
@@ -814,7 +814,7 @@ Resources:
814
814
  display: flex;
815
815
  justify-content: flex-end;
816
816
  width: 100%;
817
- `,Yv=ei.div`
817
+ `,Xv=oi.div`
818
818
  font-size: 13px;
819
819
  color: var(--privy-color-foreground);
820
820
  display: flex;
@@ -825,13 +825,13 @@ Resources:
825
825
  // Equal opposing size buffer to account for auto margining when the
826
826
  // success/fail text does not show up
827
827
  padding-bottom: 32px;
828
- `,Qv=ei.div`
828
+ `,Zv=oi.div`
829
829
  color: var(--privy-color-accent);
830
830
  padding: 2px 0;
831
831
  > button {
832
832
  text-decoration: underline;
833
833
  }
834
- `,Xv=ei.div`
834
+ `,Jv=oi.div`
835
835
  display: flex;
836
836
  align-items: center;
837
837
  justify-content: center;
@@ -840,10 +840,10 @@ Resources:
840
840
  gap: 4px;
841
841
  background: var(--privy-color-background-2);
842
842
  color: var(--privy-color-foreground-2);
843
- `,kh=ei.span`
843
+ `,Mh=oi.span`
844
844
  font-weight: 500;
845
845
  word-break: break-all;
846
- `;import t4 from"@heroicons/react/24/solid/CheckCircleIcon";import r4 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as mp,useRef as o4,useState as Ji}from"react";import n4 from"styled-components";import Jv from"styled-components";import{Fragment as e4,jsx as Zi,jsxs as $v}from"react/jsx-runtime";var Mh=({icon:e})=>{let t=e;return Zi(e4,{children:Zi(jv,{children:$v("div",{children:[Zi(it,{}),typeof t=="string"?Zi("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?Zi(t,{style:{width:"38px",height:"38px"}}):Zi("span",{})]})})})},jv=Jv.div`
846
+ `;import o4 from"@heroicons/react/24/solid/CheckCircleIcon";import n4 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as gp,useRef as i4,useState as ta}from"react";import a4 from"styled-components";import $v from"styled-components";import{Fragment as r4,jsx as ea,jsxs as t4}from"react/jsx-runtime";var Lh=({icon:e})=>{let t=e;return ea(r4,{children:ea(e4,{children:t4("div",{children:[ea(at,{}),typeof t=="string"?ea("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?ea(t,{style:{width:"38px",height:"38px"}}):ea("span",{})]})})})},e4=$v.div`
847
847
  display: flex;
848
848
  flex-direction: column;
849
849
  justify-content: center;
@@ -866,14 +866,14 @@ Resources:
866
866
  left: -19px;
867
867
  top: -19px;
868
868
  }
869
- `;import{Fragment as a4,jsx as to,jsxs as fp}from"react/jsx-runtime";var Wh=500,Ih=Wh*2,Lh=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:i}=x(),{status:a,token:l,waitForResult:s,reset:d,execute:u}=Ae(),m=o4([]),f=Y=>{m.current=[Y,...m.current]},[g,v]=Ji(!0);mp(()=>{let Y=setTimeout(v,Ih,!1);return f(Y),()=>{m.current.forEach(Ce=>clearTimeout(Ce)),m.current=[]}},[]);let[C,b]=Ji(""),[A,_]=Ji("Checking that you are a human..."),[S,P]=Ji(to(F,{onClick:()=>{},disabled:!0,children:"Continue"})),[E,k]=Ji(!1),[D,H]=Ji(3),M=r?.captchaModalData,X=async Y=>{try{await M?.callback(Y),M?.onSuccessNavigateTo&&n(M?.onSuccessNavigateTo,!1)}catch(Ce){if(Ce instanceof yr)return;{let q={error:Ce,previousScreen:e||"LANDING"};i({errorModalData:q}),n(M?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};mp(()=>{if(a==="success"){let Y=setTimeout(async()=>{let Ce=await s();!Ce||M?.userIntentRequired||X(Ce)},Ih);f(Y)}else if(a==="ready"){let Y=setTimeout(()=>{a==="ready"&&u()},Wh);f(Y)}},[a]),mp(()=>{if(!g)switch(a){case"success":b("Success!"),_("CAPTCHA passed successfully."),P(to(F,{onClick:()=>{k(!0),X(l)},disabled:!M?.userIntentRequired,loading:E,children:M?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":b(""),_("Checking that you are a human..."),P(to(F,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":b("Something went wrong"),D<=0?(_("If you use an adblocker or VPN, try disabling and re-attempting."),P(null)):(_("You did not pass CAPTCHA. Please try again."),P(to(F,{onClick:W,children:"Retry"})));break;case"ready":default:break}},[a,g,E]);let W=async()=>{if(D<=0)return;H(Ce=>Ce-1),d(),u();let Y=await s();!Y||M?.userIntentRequired||X(Y)};return fp(a4,{children:[to(R,{backFn:!e||t===e?void 0:o}),fp(i4,{children:[a==="success"?to(t4,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?to(r4,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):to(Mh,{}),fp(Qe,{children:[C?to("h3",{children:C}):null,to("p",{children:A})]}),S]}),to(Z,{})]})},i4=n4.div`
869
+ `;import{Fragment as l4,jsx as $r,jsxs as Cp}from"react/jsx-runtime";var Oh=500,Nh=Oh*2,Dh=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:i}=R(),{status:a,token:l,waitForResult:s,reset:d,execute:u}=Ee(),m=i4([]),f=Q=>{m.current=[Q,...m.current]},[y,E]=ta(!0);gp(()=>{let Q=setTimeout(E,Nh,!1);return f(Q),()=>{m.current.forEach(de=>clearTimeout(de)),m.current=[]}},[]);let[C,w]=ta(""),[P,_]=ta("Checking that you are a human..."),[T,A]=ta($r(F,{onClick:()=>{},disabled:!0,children:"Continue"})),[S,I]=ta(!1),[N,H]=ta(3),x=r?.captchaModalData,K=async Q=>{try{await x?.callback(Q),x?.onSuccessNavigateTo&&n(x?.onSuccessNavigateTo,!1)}catch(de){if(de instanceof ur)return;{let q={error:de,previousScreen:e||"LANDING"};i({errorModalData:q}),n(x?.onErrorNavigateTo||"ERROR_SCREEN",!1)}}};gp(()=>{if(a==="success"){let Q=setTimeout(async()=>{let de=await s();!de||x?.userIntentRequired||K(de)},Nh);f(Q)}else if(a==="ready"){let Q=setTimeout(()=>{a==="ready"&&u()},Oh);f(Q)}},[a]),gp(()=>{if(!y)switch(a){case"success":w("Success!"),_("CAPTCHA passed successfully."),A($r(F,{onClick:()=>{I(!0),K(l)},disabled:!x?.userIntentRequired,loading:S,children:x?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":w(""),_("Checking that you are a human..."),A($r(F,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":w("Something went wrong"),N<=0?(_("If you use an adblocker or VPN, try disabling and re-attempting."),A(null)):(_("You did not pass CAPTCHA. Please try again."),A($r(F,{onClick:W,children:"Retry"})));break;case"ready":default:break}},[a,y,S]);let W=async()=>{if(N<=0)return;H(de=>de-1),d(),u();let Q=await s();!Q||x?.userIntentRequired||K(Q)};return Cp(l4,{children:[$r(k,{backFn:!e||t===e?void 0:o}),Cp(s4,{children:[a==="success"?$r(o4,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):a==="error"?$r(n4,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):$r(Lh,{}),Cp(Je,{children:[C?$r("h3",{children:C}):null,$r("p",{children:P})]}),T]}),$r(J,{})]})},s4=a4.div`
870
870
  display: flex;
871
871
  flex-direction: column;
872
872
  align-items: center;
873
873
  justify-content: center;
874
874
  gap: 24px;
875
875
  width: 100%;
876
- `;import{isMobile as zh}from"react-device-detect";import Kh from"styled-components";import s4 from"@heroicons/react/24/outline/WalletIcon";import{jsx as hp}from"react/jsx-runtime";var nc=({icon:e,name:t})=>typeof e=="string"?hp("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?hp(s4,{}):e?hp(e,{}):null;import{jsx as ro,jsxs as Nh}from"react/jsx-runtime";var Oh=({...e})=>Nh("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[ro("defs",{children:Nh("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:[ro("stop",{offset:"0",stopColor:"#f1562b"}),ro("stop",{offset:"0.3",stopColor:"#f1542b"}),ro("stop",{offset:"0.41",stopColor:"#f04d2a"}),ro("stop",{offset:"0.49",stopColor:"#ef4229"}),ro("stop",{offset:"0.5",stopColor:"#ef4029"}),ro("stop",{offset:"0.56",stopColor:"#e83e28"}),ro("stop",{offset:"0.67",stopColor:"#e13c26"}),ro("stop",{offset:"1",stopColor:"#df3c26"})]})}),ro("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"}),ro("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});import{jsx as oo,jsxs as ns}from"react/jsx-runtime";var Dh=({style:e,...t})=>ns("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:[oo("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"}),oo("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:oo("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"})}),ns("g",{mask:"url(#mask0_16909_31415)",children:[oo("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"}),oo("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"}),oo("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"}}),oo("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"}})]}),ns("defs",{children:[ns("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[oo("stop",{stopColor:"#002D72"}),oo("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),ns("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[oo("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),oo("stop",{offset:"1",stopColor:"#002D72"})]})]})]});import{jsx as vr,jsxs as ji}from"react/jsx-runtime";var Uh=e=>ji("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[vr("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),vr("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)"}),vr("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)"}),vr("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)"}),vr("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)"}),ji("defs",{children:[ji("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[vr("stop",{stopColor:"white"}),vr("stop",{offset:"1",stopColor:"white"})]}),ji("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[vr("stop",{stopColor:"#8697FF"}),vr("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),ji("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[vr("stop",{stopColor:"#8697FF"}),vr("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),ji("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[vr("stop",{stopColor:"white"}),vr("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]});import{jsx as he,jsxs as wr}from"react/jsx-runtime";var Fh=({style:e,...t})=>wr("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:[he("g",{clipPath:"url(#clip0_5_32)",children:wr("g",{clipPath:"url(#clip1_5_32)",children:[he("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:he("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"})}),he("g",{mask:"url(#mask0_5_32)",children:he("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),he("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)"}),he("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),he("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),he("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),he("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),he("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),he("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)"}),he("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),he("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),wr("defs",{children:[wr("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[he("stop",{stopColor:"#174299"}),he("stop",{offset:"1",stopColor:"#001E59"})]}),wr("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[he("stop",{offset:"0.770277",stopColor:"#FF4000"}),he("stop",{offset:"1",stopColor:"#8754C9"})]}),wr("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[he("stop",{stopColor:"#FF4000"}),he("stop",{offset:"1",stopColor:"#8754C9"})]}),wr("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[he("stop",{stopColor:"#8754C9"}),he("stop",{offset:"1",stopColor:"#FF4000"})]}),wr("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[he("stop",{offset:"0.723929",stopColor:"#FFF700"}),he("stop",{offset:"1",stopColor:"#FF9901"})]}),wr("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[he("stop",{stopColor:"#FFF700"}),he("stop",{offset:"1",stopColor:"#FF9901"})]}),wr("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[he("stop",{stopColor:"#FFF700"}),he("stop",{offset:"1",stopColor:"#FF9901"})]}),wr("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[he("stop",{offset:"0.59513",stopColor:"#00AAFF"}),he("stop",{offset:"1",stopColor:"#01DA40"})]}),wr("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[he("stop",{stopColor:"#00AAFF"}),he("stop",{offset:"1",stopColor:"#01DA40"})]}),wr("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:[he("stop",{stopColor:"#00AAFF"}),he("stop",{offset:"1",stopColor:"#01DA40"})]}),he("clipPath",{id:"clip0_5_32",children:he("rect",{width:"120",height:"120",fill:"white"})}),he("clipPath",{id:"clip1_5_32",children:he("rect",{width:"120",height:"120",fill:"white"})})]})]});import{jsx as ic,jsxs as l4}from"react/jsx-runtime";var Bh=({style:e,...t})=>l4("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:[ic("rect",{width:"28",height:"28",rx:"3",fill:"#12FF80"}),ic("path",{d:"M22.5151 13.9979H20.4244C19.7981 13.9979 19.2945 14.5058 19.2945 15.128V18.163C19.2945 18.7894 18.7866 19.2931 18.1645 19.2931H9.8398C9.21344 19.2931 8.70981 19.8011 8.70981 20.4233V22.5185C8.70981 23.145 9.21767 23.6487 9.8398 23.6487H18.6427C19.2691 23.6487 19.7642 23.1407 19.7642 22.5185V20.8423C19.7642 20.2159 20.2721 19.7757 20.8942 19.7757H22.5151C23.1415 19.7757 23.6451 19.2677 23.6451 18.6455V15.1196C23.6451 14.4889 23.1373 13.9979 22.5151 13.9979Z",fill:"black"}),ic("path",{d:"M8.7098 9.84127C8.7098 9.21481 9.21766 8.71111 9.83978 8.71111H18.156C18.7823 8.71111 19.286 8.20317 19.286 7.58095V5.48995C19.286 4.86349 18.7781 4.35979 18.156 4.35979H9.35732C8.73096 4.35979 8.22733 4.86772 8.22733 5.48995V7.10264C8.22733 7.7291 7.71947 8.2328 7.09734 8.2328H5.48912C4.86276 8.2328 4.35913 8.74074 4.35913 9.36296V12.8931C4.35913 13.5196 4.86699 13.9979 5.49335 13.9979H7.58404C8.2104 13.9979 8.71403 13.4899 8.71403 12.8677L8.7098 9.84127Z",fill:"black"}),ic("path",{d:"M13.0139 11.8011H15.0242C15.6802 11.8011 16.2092 12.3344 16.2092 12.9862V14.9968C16.2092 15.6529 15.6759 16.182 15.0242 16.182H13.0139C12.3579 16.182 11.8289 15.6487 11.8289 14.9968V12.9862C11.8289 12.3302 12.3621 11.8011 13.0139 11.8011Z",fill:"black"})]});import{jsx as Po,jsxs as Hh}from"react/jsx-runtime";var Vh=({style:e,...t})=>Hh("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:[Po("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),Hh("g",{children:[Po("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"}),Po("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"}),Po("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"}),Po("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"}),Po("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"}),Po("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"}),Po("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"}),Po("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"}),Po("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});import{jsx as is,jsxs as Gh}from"react/jsx-runtime";var qh=({style:e,...t})=>Gh("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:[Gh("g",{clipPath:"url(#clip0_1704_1423)",children:[is("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"}),is("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"})]}),is("defs",{children:is("clipPath",{id:"clip0_1704_1423",children:is("rect",{width:"176",height:"176",fill:"white"})})})]});var Br={coinbase_wallet:{logo:Vo,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:Vo,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:Hi,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:bo,displayName:"Phantom"},rainbow:{logo:Fh,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Qa,displayName:"WalletConnect"},zerion:{logo:qh,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:Oh,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:Dh,displayName:"Crypto.com DeFi Wallet",rdns:"com.crypto.wallet"},uniswap:{logo:Vh,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:Uh,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"},safe:{displayName:"Safe",logo:Bh}},dn=(e,t,r)=>{if(Br[e]?.displayName)return e==="coinbase_wallet"?Br[r].displayName:Br[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},ac=(e,t,r)=>{if(Br[e]?.logo)return e==="coinbase_wallet"?Br[r].logo:Br[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Qa};function $i(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some(n=>t.includes(n))}import{jsx as sc,jsxs as p4}from"react/jsx-runtime";var ti=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:i}=x(),{connectWallet:a}=L(),l=xt(),s=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,d=window.matchMedia("(display-mode: standalone)").matches,u;return n.connectorType==="phantom"?u=()=>{en()?(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(zh?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:n.connectorType==="coinbase_wallet"&&n.connectionOptions==="eoaOnly"&&zh&&!d&&!Zs()?u=()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`}:u=()=>{$i(window.navigator.userAgent)&&!event?.isTrusted||(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION"))},p4(c4,{onClick:u,children:[sc(nc,{icon:ac(e,n.connectorType,n.walletClientType)??r,name:n.walletClientType}),sc("span",{children:dn(e,n.connectorType,n.walletClientType)||t||n.walletClientType}),l?.walletClientType===s?sc(d4,{color:"gray",children:"Recent"}):sc("span",{id:"connect-text",children:"Connect"})]})},c4=Kh(Pe)`
876
+ `;import{isMobile as Qh}from"react-device-detect";import Xh from"styled-components";import c4 from"@heroicons/react/24/outline/WalletIcon";import{jsx as vp}from"react/jsx-runtime";var oc=({icon:e,name:t})=>typeof e=="string"?vp("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?vp(c4,{}):e?vp(e,{}):null;import{jsx as eo,jsxs as Uh}from"react/jsx-runtime";var Fh=({...e})=>Uh("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[eo("defs",{children:Uh("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:[eo("stop",{offset:"0",stopColor:"#f1562b"}),eo("stop",{offset:"0.3",stopColor:"#f1542b"}),eo("stop",{offset:"0.41",stopColor:"#f04d2a"}),eo("stop",{offset:"0.49",stopColor:"#ef4229"}),eo("stop",{offset:"0.5",stopColor:"#ef4029"}),eo("stop",{offset:"0.56",stopColor:"#e83e28"}),eo("stop",{offset:"0.67",stopColor:"#e13c26"}),eo("stop",{offset:"1",stopColor:"#df3c26"})]})}),eo("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"}),eo("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});import{jsx as to,jsxs as is}from"react/jsx-runtime";var Bh=({style:e,...t})=>is("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:[to("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"}),to("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:to("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"})}),is("g",{mask:"url(#mask0_16909_31415)",children:[to("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"}),to("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"}),to("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"}}),to("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"}})]}),is("defs",{children:[is("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[to("stop",{stopColor:"#002D72"}),to("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),is("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[to("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),to("stop",{offset:"1",stopColor:"#002D72"})]})]})]});import{jsx as hr,jsxs as ra}from"react/jsx-runtime";var Hh=e=>ra("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[hr("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),hr("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)"}),hr("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)"}),hr("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)"}),hr("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)"}),ra("defs",{children:[ra("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[hr("stop",{stopColor:"white"}),hr("stop",{offset:"1",stopColor:"white"})]}),ra("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[hr("stop",{stopColor:"#8697FF"}),hr("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),ra("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[hr("stop",{stopColor:"#8697FF"}),hr("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),ra("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[hr("stop",{stopColor:"white"}),hr("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]});import{jsx as me,jsxs as yr}from"react/jsx-runtime";var Vh=({style:e,...t})=>yr("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:[me("g",{clipPath:"url(#clip0_5_32)",children:yr("g",{clipPath:"url(#clip1_5_32)",children:[me("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:me("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"})}),me("g",{mask:"url(#mask0_5_32)",children:me("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),me("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)"}),me("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),me("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),me("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),me("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),me("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),me("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)"}),me("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),me("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),yr("defs",{children:[yr("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[me("stop",{stopColor:"#174299"}),me("stop",{offset:"1",stopColor:"#001E59"})]}),yr("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[me("stop",{offset:"0.770277",stopColor:"#FF4000"}),me("stop",{offset:"1",stopColor:"#8754C9"})]}),yr("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[me("stop",{stopColor:"#FF4000"}),me("stop",{offset:"1",stopColor:"#8754C9"})]}),yr("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[me("stop",{stopColor:"#8754C9"}),me("stop",{offset:"1",stopColor:"#FF4000"})]}),yr("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[me("stop",{offset:"0.723929",stopColor:"#FFF700"}),me("stop",{offset:"1",stopColor:"#FF9901"})]}),yr("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[me("stop",{stopColor:"#FFF700"}),me("stop",{offset:"1",stopColor:"#FF9901"})]}),yr("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[me("stop",{stopColor:"#FFF700"}),me("stop",{offset:"1",stopColor:"#FF9901"})]}),yr("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[me("stop",{offset:"0.59513",stopColor:"#00AAFF"}),me("stop",{offset:"1",stopColor:"#01DA40"})]}),yr("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[me("stop",{stopColor:"#00AAFF"}),me("stop",{offset:"1",stopColor:"#01DA40"})]}),yr("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:[me("stop",{stopColor:"#00AAFF"}),me("stop",{offset:"1",stopColor:"#01DA40"})]}),me("clipPath",{id:"clip0_5_32",children:me("rect",{width:"120",height:"120",fill:"white"})}),me("clipPath",{id:"clip1_5_32",children:me("rect",{width:"120",height:"120",fill:"white"})})]})]});import{jsx as nc,jsxs as d4}from"react/jsx-runtime";var Gh=({style:e,...t})=>d4("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:[nc("rect",{width:"28",height:"28",rx:"3",fill:"#12FF80"}),nc("path",{d:"M22.5151 13.9979H20.4244C19.7981 13.9979 19.2945 14.5058 19.2945 15.128V18.163C19.2945 18.7894 18.7866 19.2931 18.1645 19.2931H9.8398C9.21344 19.2931 8.70981 19.8011 8.70981 20.4233V22.5185C8.70981 23.145 9.21767 23.6487 9.8398 23.6487H18.6427C19.2691 23.6487 19.7642 23.1407 19.7642 22.5185V20.8423C19.7642 20.2159 20.2721 19.7757 20.8942 19.7757H22.5151C23.1415 19.7757 23.6451 19.2677 23.6451 18.6455V15.1196C23.6451 14.4889 23.1373 13.9979 22.5151 13.9979Z",fill:"black"}),nc("path",{d:"M8.7098 9.84127C8.7098 9.21481 9.21766 8.71111 9.83978 8.71111H18.156C18.7823 8.71111 19.286 8.20317 19.286 7.58095V5.48995C19.286 4.86349 18.7781 4.35979 18.156 4.35979H9.35732C8.73096 4.35979 8.22733 4.86772 8.22733 5.48995V7.10264C8.22733 7.7291 7.71947 8.2328 7.09734 8.2328H5.48912C4.86276 8.2328 4.35913 8.74074 4.35913 9.36296V12.8931C4.35913 13.5196 4.86699 13.9979 5.49335 13.9979H7.58404C8.2104 13.9979 8.71403 13.4899 8.71403 12.8677L8.7098 9.84127Z",fill:"black"}),nc("path",{d:"M13.0139 11.8011H15.0242C15.6802 11.8011 16.2092 12.3344 16.2092 12.9862V14.9968C16.2092 15.6529 15.6759 16.182 15.0242 16.182H13.0139C12.3579 16.182 11.8289 15.6487 11.8289 14.9968V12.9862C11.8289 12.3302 12.3621 11.8011 13.0139 11.8011Z",fill:"black"})]});import{jsx as So,jsxs as qh}from"react/jsx-runtime";var zh=({style:e,...t})=>qh("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:[So("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),qh("g",{children:[So("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"}),So("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"}),So("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"}),So("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"}),So("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"}),So("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"}),So("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"}),So("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"}),So("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});import{jsx as as,jsxs as Kh}from"react/jsx-runtime";var Yh=({style:e,...t})=>Kh("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:[Kh("g",{clipPath:"url(#clip0_1704_1423)",children:[as("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"}),as("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"})]}),as("defs",{children:as("clipPath",{id:"clip0_1704_1423",children:as("rect",{width:"176",height:"176",fill:"white"})})})]});var Or={coinbase_wallet:{logo:Vo,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:Vo,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:zi,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:vo,displayName:"Phantom"},rainbow:{logo:Vh,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Xa,displayName:"WalletConnect"},zerion:{logo:Yh,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:Fh,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:Bh,displayName:"Crypto.com DeFi Wallet",rdns:"com.crypto.wallet"},uniswap:{logo:zh,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:Hh,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"},safe:{displayName:"Safe",logo:Gh}},pn=(e,t,r)=>{if(Or[e]?.displayName)return e==="coinbase_wallet"?Or[r].displayName:Or[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},ic=(e,t,r)=>{if(Or[e]?.logo)return e==="coinbase_wallet"?Or[r].logo:Or[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return Xa};function oa(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some(n=>t.includes(n))}import{jsx as ac,jsxs as m4}from"react/jsx-runtime";var ni=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:i}=R(),{connectWallet:a}=M(),l=Pt(),s=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,d=window.matchMedia("(display-mode: standalone)").matches,u;return n.connectorType==="phantom"?u=()=>{tn()?(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):i(Qh?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:n.connectorType==="coinbase_wallet"&&n.connectionOptions==="eoaOnly"&&Qh&&!d&&!Xs()?u=()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`}:u=()=>{oa(window.navigator.userAgent)&&!event?.isTrusted||(a(n,s),i(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION"))},m4(p4,{onClick:u,children:[ac(oc,{icon:ic(e,n.connectorType,n.walletClientType)??r,name:n.walletClientType}),ac("span",{children:pn(e,n.connectorType,n.walletClientType)||t||n.walletClientType}),l?.walletClientType===s?ac(u4,{color:"gray",children:"Recent"}):ac("span",{id:"connect-text",children:"Connect"})]})},p4=Xh(Te)`
877
877
  /* Show "Connect" on hover */
878
878
  > #connect-text {
879
879
  font-weight: 500;
@@ -895,16 +895,16 @@ Resources:
895
895
  display: none;
896
896
  }
897
897
  }
898
- `,d4=Kh($t)`
898
+ `,u4=Xh(Jt)`
899
899
  margin-left: auto;
900
- `;import{Fragment as y4,jsx as ea,jsxs as g4}from"react/jsx-runtime";var u4=["coinbase_wallet"],m4=["metamask","okx_wallet","rainbow","uniswap","uniswap_extension","zerion","rabby_wallet","cryptocom"],f4=["safe"],h4=["phantom"],ta=({connectOnly:e})=>{let{connectors:t}=L(),{app:r,data:o}=x(),n=pn(o?.externalConnectWallet?.walletList??r.appearance.walletList,t,e,r.appearance.walletList,r.externalWallets.walletConnect.enabled);return g4(y4,{children:[...n]})},pn=(e,t,r,o,n)=>{let i=[],a=[],l=[],s=t.find(d=>d.connectorType==="wallet_connect_v2");for(let d of e)if(d==="detected_wallets"){let u=t.filter(({connectorType:m,walletClientType:f})=>f==="uniswap_wallet_extension"||f==="uniswap_extension"?!o.includes("uniswap"):f==="crypto.com_wallet_extension"?!o.includes("cryptocom"):m==="injected"&&!o.includes(f));for(let m of u){let{walletClientType:f,walletBranding:g}=m;(f==="unknown"?a:i).push(ea(ti,{connectOnly:r,provider:f,logo:g.icon,displayName:g.name,connector:m},`${d}-${f}`))}}else if(h4.includes(d)){let u=t.find(m=>m.connectorType==="injected"&&m.walletClientType===d||m.connectorType===d);u&&i.push(ea(ti,{connectOnly:r,provider:d,connector:u},d))}else if(m4.includes(d)){let u=t.find(m=>d==="uniswap"?m.walletClientType==="uniswap_wallet_extension"||m.walletClientType==="uniswap_extension":d==="cryptocom"?m.walletClientType==="crypto.com_wallet_extension":m.connectorType==="injected"&&m.walletClientType===d);n&&!u&&(u=s),u&&i.push(ea(ti,{connectOnly:r,provider:d,connector:u,logo:u.connectorType==="injected"?u.walletBranding.icon:void 0,displayName:u.connectorType==="injected"?u.walletBranding.name:void 0},d))}else if(u4.includes(d)){let u=t.find(({connectorType:m})=>m===d);u&&i.push(ea(ti,{connectOnly:r,provider:d,connector:u},d))}else f4.includes(d)?s&&l.push(ea(ti,{connectOnly:r,provider:d,connector:s},d)):d==="wallet_connect"&&s&&l.push(ea(ti,{connectOnly:r,provider:d,connector:s},d));return[...a,...i,...l]};import{Fragment as C4,jsx as as,jsxs as v4}from"react/jsx-runtime";var Yh=()=>{let{app:e,data:t}=x(),r=t?.externalConnectWallet?.suggestedAddress,o=r?`Connect the wallet with address ${Ut(r)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return v4(C4,{children:[as(R,{},"header"),as(Ao,{title:"Connect your wallet",description:o}),as(nr,{children:as(ta,{connectOnly:!0})}),as(G,{})]})};import{Fragment as w4,jsx as ra,jsxs as b4}from"react/jsx-runtime";var Qh=()=>{let{app:e,data:t}=x(),r=t?.externalConnectWallet?.suggestedAddress,o=r?`Connect the wallet with address ${Ut(r)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return b4(w4,{children:[ra(R,{},"header"),ra($n,{title:"Connect your wallet",description:o}),ra(nr,{children:ra(ta,{connectOnly:!0})}),e&&ra(ki,{app:e,alwaysShowImplicitConsent:!0}),ra(G,{})]})};import{useEffect as ey,useState as ty}from"react";import{isMobile as k4}from"react-device-detect";import _4 from"styled-components";import{useEffect as yp,useState as un}from"react";import{isMobile as lc}from"react-device-detect";import jh from"styled-components";import{useEffect as Xh,useRef as E4}from"react";var T4=(e,t)=>{let r=E4(()=>{});Xh(()=>{r.current=e}),Xh(()=>{if(t!==null){let o=setInterval(()=>r.current(),t||0);return()=>clearInterval(o)}},[t])},Zh=T4;import{useState as S4,useEffect as A4,useCallback as P4}from"react";function Jh(){let[e,t]=S4(!1),r=P4(()=>{document.hidden&&t(!0)},[]);return A4(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}import{Fragment as Cp,jsx as yt,jsxs as oa}from"react/jsx-runtime";var gp=2,vp=e=>e?.privyErrorCode==="linked_to_another_user"?Co.ERROR_USER_EXISTS:e instanceof Tt&&!e.details.default?e.details:e instanceof Di?Co.ERROR_TIMED_OUT:e instanceof Ui?Co.ERROR_USER_REJECTED_CONNECTION:e?.privyErrorCode==="cannot_link_more_of_type"?Co.ERROR_USER_LIMIT_REACHED:Co.ERROR_WALLET_CONNECTION,$h=()=>{let[e,t]=un(!1),[r,o]=un(!1),[n,i]=un(void 0),{authenticated:a,logout:l}=K(),{app:s,navigate:d,navigateBack:u,lastScreen:m,currentScreen:f,setModalData:g}=x(),{getAuthFlow:v,walletConnectionStatus:C,closePrivyModal:b,initLoginWithWallet:A,loginWithWallet:_,updateWallets:S,createAnalyticsEvent:P}=L(),{walletConnectors:E}=K(),[k,D]=un(0),{user:H}=K(),[M]=un(H?.linkedAccounts.length||0),[X,W]=un(""),[Y,Ce]=un(""),[q,pe]=un(!1),{hasTabbedAway:Q}=Jh(),{enabled:ee,token:ue}=Ae(),me=lc&&C?.connector?.connectorType==="wallet_connect_v2"||lc&&C?.connector?.connectorType==="coinbase_wallet"||lc&&C?.connector?.connectorType==="injected"&&C?.connector?.walletClientType==="phantom",Te=C?.status==="connected",ce=C?.status==="switching_to_supported_chain";yp(()=>{let B=v(),se=B instanceof Ho?B:void 0;if(Te&&!se&&(ee&&!ue&&!a?(g({captchaModalData:{callback:rt=>A(C.connectedWallet,rt).then(()=>{pe(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),d("CAPTCHA_SCREEN",!1)):A(C.connectedWallet,ue).then(()=>{pe(!0)})),se&&me&&Te&&!se.preparedMessage){se.buildSiweMessage();return}!se||me||!Te||r||(async()=>{o(!0),i(void 0);try{C?.connector?.connectorType==="wallet_connect_v2"&&C?.connector?.walletClientType==="metamask"&&await Xu(2500),await ft()}catch(rt){console.warn("Auto-prompted signature failed",rt)}finally{o(!1)}})()},[k,Te,q]),yp(()=>{if(H&&e){let se=We-500;if(s?.legal.requireUsersAcceptTerms&&!H.hasAcceptedTerms){let On=setTimeout(()=>{d("AFFIRMATIVE_CONSENT_SCREEN")},se);return()=>clearTimeout(On)}if(Et(H,s?.embeddedWallets?.createOnLogin)){let On=setTimeout(()=>{g({createWallet:{onSuccess:()=>{},onFailure:bi=>{console.error(bi),P({eventName:"embedded_wallet_creation_failure_logout",payload:{error:bi,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),d("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},se);return()=>clearTimeout(On)}S();let rt=setTimeout(()=>b({shouldCallAuthOnSuccess:!0,isSuccess:!0}),We);return()=>clearTimeout(rt)}},[H,e]);let Se=B=>{if(B?.privyErrorCode==="allowlist_rejected"){d("ALLOWLIST_REJECTION_SCREEN");return}else if(B?.privyErrorCode==="max_accounts_reached"){console.error(new fo(B).toString()),d("USER_LIMIT_REACHED_SCREEN");return}else if(B?.privyErrorCode==="user_does_not_exist"){d("ACCOUNT_NOT_FOUND_SCREEN");return}i(vp(B))};async function ft(){try{await _(),t(!0)}catch(B){Se(B)}finally{o(!1)}}yp(()=>{C?.connectError&&Se(C?.connectError)},[C]),Zh(()=>{let B=tt==="wallet_connect_v2"&&C?.connector instanceof jr?C.connector.redirectUri:void 0;B&&W(B);let se=tt==="wallet_connect_v2"&&C?.connector instanceof jr?C.connector.fallbackUniversalRedirectUri:void 0;se&&Ce(se)},C?.connector instanceof jr&&!X?500:null);let tt=C?.connector?.connectorType||"injected",le=C?.connector?.walletClientType||"unknown",nt=Br[le]?.displayName||C?.connector?.walletBranding.name||"Browser Extension",mr=Br[le]?.logo||C?.connector?.walletBranding.icon||(B=>yt(Bi,{...B})),vt=nt==="Browser Extension"?nt.toLowerCase():nt,I;e?I=`Successfully connected with ${vt}`:n?I=n.message:ce?I="Switching networks":Te?I=r&&me?"Signing":"Sign to verify":I=`Waiting for ${vt}`;let Ke="Don\u2019t see your wallet? Check your other browser windows.";if(e){let B=H?.linkedAccounts.length||0;M===B?Ke="Wallet was already linked.":Ke="You\u2019re good to go!"}else k>=gp&&n?Ke="Unable to connect wallet":n?Ke=n.detail:ce?Ke="Switch your wallet to the requested network.":Te&&me?Ke="Sign the message in your wallet to verify it belongs to you.":le==="metamask"&&lc?Ke="Click continue to open and connect MetaMask.":le==="metamask"?Ke="For the best experience, connect only one wallet at a time.":tt==="wallet_connect"?Ke="Open your mobile wallet app to continue":tt==="coinbase_wallet"&&(Zs()||(ep(H)?Ke="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":Ke="Open the Coinbase app on your phone to continue."));let Qt=E?.walletConnectors?.find(B=>B.walletClientType==="coinbase_wallet"),U=le==="coinbase_wallet"&&(ep(H)||n===Co.ERROR_USER_EXISTS);return oa(Cp,{children:[yt(R,{backFn:!m||f===m?void 0:u}),oa(x4,{children:[yt(wp,{walletLogo:mr,success:e,fail:!!n}),oa(Qe,{children:[yt("h3",{children:I}),yt("p",{children:Ke}),!Te&&X&&!Q?oa("p",{children:["Still here?"," ",yt("a",{href:X,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),Y&&oa(Cp,{children:[" ","or"," ",yt("a",{href:Y,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]}):null]}),U?yt(F,{onClick:()=>Qt&&Qt?.disconnect(),disabled:e,children:"Use a different wallet"}):n==Co.ERROR_USER_EXISTS&&f!==m?yt(F,{onClick:u,children:"Use a different wallet"}):Te&&!e&&me?yt(F,{onClick:()=>{o(!0),ft()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&k<gp?yt(F,{onClick:()=>{D(k+1),i(void 0),Te?(o(!0),ft()):C?.connectRetry()},disabled:!e&&(!n?.retryable||k>=gp),children:"Retry"}):!e&&!n?yt(F,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),yt(Z,{})]})},x4=jh.div`
900
+ `;import{Fragment as C4,jsx as na,jsxs as v4}from"react/jsx-runtime";var f4=["coinbase_wallet"],h4=["metamask","okx_wallet","rainbow","uniswap","uniswap_extension","zerion","rabby_wallet","cryptocom"],y4=["safe"],g4=["phantom"],ia=({connectOnly:e})=>{let{connectors:t}=M(),{app:r,data:o}=R(),n=un(o?.externalConnectWallet?.walletList??r.appearance.walletList,t,e,r.appearance.walletList,r.externalWallets.walletConnect.enabled);return v4(C4,{children:[...n]})},un=(e,t,r,o,n)=>{let i=[],a=[],l=[],s=t.find(d=>d.connectorType==="wallet_connect_v2");for(let d of e)if(d==="detected_wallets"){let u=t.filter(({connectorType:m,walletClientType:f})=>f==="uniswap_wallet_extension"||f==="uniswap_extension"?!o.includes("uniswap"):f==="crypto.com_wallet_extension"?!o.includes("cryptocom"):m==="injected"&&!o.includes(f));for(let m of u){let{walletClientType:f,walletBranding:y}=m;(f==="unknown"?a:i).push(na(ni,{connectOnly:r,provider:f,logo:y.icon,displayName:y.name,connector:m},`${d}-${f}`))}}else if(g4.includes(d)){let u=t.find(m=>m.connectorType==="injected"&&m.walletClientType===d||m.connectorType===d);u&&i.push(na(ni,{connectOnly:r,provider:d,connector:u},d))}else if(h4.includes(d)){let u=t.find(m=>d==="uniswap"?m.walletClientType==="uniswap_wallet_extension"||m.walletClientType==="uniswap_extension":d==="cryptocom"?m.walletClientType==="crypto.com_wallet_extension":m.connectorType==="injected"&&m.walletClientType===d);n&&!u&&(u=s),u&&i.push(na(ni,{connectOnly:r,provider:d,connector:u,logo:u.connectorType==="injected"?u.walletBranding.icon:void 0,displayName:u.connectorType==="injected"?u.walletBranding.name:void 0},d))}else if(f4.includes(d)){let u=t.find(({connectorType:m})=>m===d);u&&i.push(na(ni,{connectOnly:r,provider:d,connector:u},d))}else y4.includes(d)?s&&l.push(na(ni,{connectOnly:r,provider:d,connector:s},d)):d==="wallet_connect"&&s&&l.push(na(ni,{connectOnly:r,provider:d,connector:s},d));return[...a,...i,...l]};import{Fragment as w4,jsx as ss,jsxs as b4}from"react/jsx-runtime";var Zh=()=>{let{app:e,data:t}=R(),r=t?.externalConnectWallet?.suggestedAddress,o=r?`Connect the wallet with address ${Yr(r)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return b4(w4,{children:[ss(k,{},"header"),ss(To,{title:"Connect your wallet",description:o}),ss(tr,{children:ss(ia,{connectOnly:!0})}),ss(B,{})]})};import{Fragment as E4,jsx as ii,jsxs as Jh}from"react/jsx-runtime";var jh=()=>{let{app:e,data:t}=R(),r=t?.externalConnectWallet?.suggestedAddress,o=r?Jh("span",{children:["Connect the wallet with address ",ii(Fo,{showCopyIcon:!1,address:r})," ",e?.name?`to ${e.name}.`:"."]}):`Connect a wallet to your ${e?.name} account`;return Jh(E4,{children:[ii(k,{},"header"),ii(ri,{title:"Connect your wallet",description:o}),ii(tr,{children:ii(ia,{connectOnly:!0})}),e&&ii(Wi,{app:e,alwaysShowImplicitConsent:!0}),ii(B,{})]})};import{useEffect as ny,useState as iy}from"react";import{isMobile as _4}from"react-device-detect";import I4 from"styled-components";import{useEffect as wp,useState as mn}from"react";import{isMobile as sc}from"react-device-detect";import ry from"styled-components";import{useEffect as $h,useRef as T4}from"react";var S4=(e,t)=>{let r=T4(()=>{});$h(()=>{r.current=e}),$h(()=>{if(t!==null){let o=setInterval(()=>r.current(),t||0);return()=>clearInterval(o)}},[t])},ey=S4;import{useState as P4,useEffect as A4,useCallback as x4}from"react";function ty(){let[e,t]=P4(!1),r=x4(()=>{document.hidden&&t(!0)},[]);return A4(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}import{Fragment as Ep,jsx as yt,jsxs as aa}from"react/jsx-runtime";var bp=2,Tp=e=>e?.privyErrorCode==="linked_to_another_user"?yo.ERROR_USER_EXISTS:e instanceof bt&&!e.details.default?e.details:e instanceof Hi?yo.ERROR_TIMED_OUT:e instanceof Vi?yo.ERROR_USER_REJECTED_CONNECTION:e?.privyErrorCode==="cannot_link_more_of_type"?yo.ERROR_USER_LIMIT_REACHED:yo.ERROR_WALLET_CONNECTION,oy=()=>{let[e,t]=mn(!1),[r,o]=mn(!1),[n,i]=mn(void 0),{authenticated:a,logout:l}=V(),{app:s,navigate:d,navigateBack:u,lastScreen:m,currentScreen:f,setModalData:y,data:E}=R(),{getAuthFlow:C,walletConnectionStatus:w,closePrivyModal:P,initLoginWithWallet:_,loginWithWallet:T,updateWallets:A,createAnalyticsEvent:S}=M(),{walletConnectors:I}=V(),[N,H]=mn(0),{user:x}=V(),[K]=mn(x?.linkedAccounts.length||0),[W,Q]=mn(""),[de,q]=mn(""),[pe,Z]=mn(!1),{hasTabbedAway:ie}=ty(),{enabled:se,token:_e}=Ee(),be=sc&&w?.connector?.connectorType==="wallet_connect_v2"||sc&&w?.connector?.connectorType==="coinbase_wallet"||sc&&w?.connector?.connectorType==="injected"&&w?.connector?.walletClientType==="phantom",ye=w?.status==="connected",ae=w?.status==="switching_to_supported_chain";wp(()=>{let j=C(),Oe=j instanceof Ho?j:void 0;if(ye&&!Oe&&(se&&!_e&&!a?(y({captchaModalData:{callback:Lo=>_(w.connectedWallet,Lo,E?.login?.disableSignup).then(()=>{Z(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),d("CAPTCHA_SCREEN",!1)):_(w.connectedWallet,_e,E?.login?.disableSignup).then(()=>{Z(!0)})),Oe&&be&&ye&&!Oe.preparedMessage){Oe.buildSiweMessage();return}!Oe||be||!ye||r||(async()=>{o(!0),i(void 0);try{w?.connector?.connectorType==="wallet_connect_v2"&&w?.connector?.walletClientType==="metamask"&&await ju(2500),await it()}catch(Lo){console.warn("Auto-prompted signature failed",Lo)}finally{o(!1)}})()},[N,ye,pe]),wp(()=>{if(x&&e){let Oe=Ie-500;if(s?.legal.requireUsersAcceptTerms&&!x.hasAcceptedTerms){let Dn=setTimeout(()=>{d("AFFIRMATIVE_CONSENT_SCREEN")},Oe);return()=>clearTimeout(Dn)}if(vt(x,s?.embeddedWallets?.createOnLogin)){let Dn=setTimeout(()=>{y({createWallet:{onSuccess:()=>{},onFailure:Un=>{console.error(Un),S({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Un,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),d("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},Oe);return()=>clearTimeout(Dn)}A();let Lo=setTimeout(()=>P({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Ie);return()=>clearTimeout(Lo)}},[x,e]);let Xe=j=>{if(j?.privyErrorCode==="allowlist_rejected"){d("ALLOWLIST_REJECTION_SCREEN");return}else if(j?.privyErrorCode==="max_accounts_reached"){console.error(new uo(j).toString()),d("USER_LIMIT_REACHED_SCREEN");return}else if(j?.privyErrorCode==="user_does_not_exist"){d("ACCOUNT_NOT_FOUND_SCREEN");return}i(Tp(j))};async function it(){try{await T(),t(!0)}catch(j){Xe(j)}finally{o(!1)}}wp(()=>{w?.connectError&&Xe(w?.connectError)},[w]),ey(()=>{let j=le==="wallet_connect_v2"&&w?.connector instanceof Zr?w.connector.redirectUri:void 0;j&&Q(j);let Oe=le==="wallet_connect_v2"&&w?.connector instanceof Zr?w.connector.fallbackUniversalRedirectUri:void 0;Oe&&q(Oe)},w?.connector instanceof Zr&&!W?500:null);let le=w?.connector?.connectorType||"injected",et=w?.connector?.walletClientType||"unknown",Ot=Or[et]?.displayName||w?.connector?.walletBranding.name||"Browser Extension",zr=Or[et]?.logo||w?.connector?.walletBranding.icon||(j=>yt(qi,{...j})),L=Ot==="Browser Extension"?Ot.toLowerCase():Ot,Se;e?Se=`Successfully connected with ${L}`:n?Se=n.message:ae?Se="Switching networks":ye?Se=r&&be?"Signing":"Sign to verify":Se=`Waiting for ${L}`;let qe="Don\u2019t see your wallet? Check your other browser windows.";if(e){let j=x?.linkedAccounts.length||0;K===j?qe="Wallet was already linked.":qe="You\u2019re good to go!"}else N>=bp&&n?qe="Unable to connect wallet":n?qe=n.detail:ae?qe="Switch your wallet to the requested network.":ye&&be?qe="Sign the message in your wallet to verify it belongs to you.":et==="metamask"&&sc?qe="Click continue to open and connect MetaMask.":et==="metamask"?qe="For the best experience, connect only one wallet at a time.":le==="wallet_connect"?qe="Open your mobile wallet app to continue":le==="coinbase_wallet"&&(Xs()||(np(x)?qe="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":qe="Open the Coinbase app on your phone to continue."));let U=I?.walletConnectors?.find(j=>j.walletClientType==="coinbase_wallet"),Y=et==="coinbase_wallet"&&(np(x)||n===yo.ERROR_USER_EXISTS);return aa(Ep,{children:[yt(k,{backFn:!m||f===m?void 0:u}),aa(R4,{children:[yt(Sp,{walletLogo:zr,success:e,fail:!!n}),aa(Je,{children:[yt("h3",{children:Se}),yt("p",{children:qe}),!ye&&W&&!ie?aa("p",{children:["Still here?"," ",yt("a",{href:W,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),de&&aa(Ep,{children:[" ","or"," ",yt("a",{href:de,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]}):null]}),Y?yt(F,{onClick:()=>U&&U?.disconnect(),disabled:e,children:"Use a different wallet"}):n==yo.ERROR_USER_EXISTS&&f!==m?yt(F,{onClick:u,children:"Use a different wallet"}):ye&&!e&&be?yt(F,{onClick:()=>{o(!0),it()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&n?.retryable&&N<bp?yt(F,{onClick:()=>{H(N+1),i(void 0),ye?(o(!0),it()):w?.connectRetry()},disabled:!e&&(!n?.retryable||N>=bp),children:"Retry"}):!e&&!n?yt(F,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),yt(J,{})]})},R4=ry.div`
901
901
  display: flex;
902
902
  flex-direction: column;
903
903
  align-items: center;
904
904
  justify-content: center;
905
905
  gap: 24px;
906
906
  width: 100%;
907
- `,R4=jh.div`
907
+ `,k4=ry.div`
908
908
  display: flex;
909
909
  flex-direction: column;
910
910
  justify-content: center;
@@ -927,14 +927,14 @@ Resources:
927
927
  left: -19px;
928
928
  top: -19px;
929
929
  }
930
- `,wp=e=>{let t=e.walletLogo;return yt(Cp,{children:yt(R4,{children:oa("div",{children:[yt(it,{success:e.success,fail:e.fail}),typeof t=="string"?yt("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):yt(t,{style:{width:"38px",height:"38px"}})]})})})};import{Fragment as I4,jsx as zo,jsxs as bp}from"react/jsx-runtime";var cc=2,ry=()=>{let{navigateBack:e,navigate:t,lastScreen:r,currentScreen:o,data:n}=x(),{walletConnectionStatus:i,closePrivyModal:a}=L(),[l,s]=ty(void 0),[d,u]=ty(0),m=i?.status==="connected",f=i?.status==="switching_to_supported_chain";ey(()=>{if(m){let E;if(n?.externalConnectWallet?.onCompleteNavigateTo){let k=n.externalConnectWallet.onCompleteNavigateTo;E=setTimeout(()=>{t(k)},We)}else E=setTimeout(a,We);return()=>clearTimeout(E)}},[m]);let g=E=>{s(vp(E))};ey(()=>{i?.connectError&&g(i?.connectError)},[i]);let v=i?.connector?.connectorType||"injected",C=i?.connector?.walletClientType||"unknown",b=Br[C]?.displayName||i?.connector?.walletBranding.name||"Browser Extension",A=Br[C]?.logo||i?.connector?.walletBranding.icon||(E=>zo(Bi,{...E})),_=b==="Browser Extension"?b.toLowerCase():b,S;m?S=`Successfully connected with ${_}`:l?S=l.message:f?S="Switching networks":S=`Waiting for ${_}`;let P="Don\u2019t see your wallet? Check your other browser windows.";return m?P="You\u2019re good to go!":d>=cc&&l?P="Unable to connect wallet":l?P=l.detail:f?P="Switch your wallet to the requested network.":C==="metamask"&&k4?P="Click to continue to open and connect MetaMask.":C==="metamask"?P="For the best experience, connect only one wallet at a time.":v==="wallet_connect_v2"?P="Open your mobile wallet app to continue":v==="coinbase_wallet"&&(P="Open the Coinbase app on your phone to continue."),bp(I4,{children:[zo(R,{backFn:o===r?void 0:e}),bp(M4,{children:[zo(wp,{walletLogo:A,success:m,fail:!!l}),bp(Qe,{children:[zo("h3",{children:S}),zo("p",{children:P})]}),l==Co.ERROR_USER_EXISTS?zo(F,{onClick:e,children:"Use a different wallet"}):!m&&l?.retryable&&d<cc?zo(F,{onClick:()=>{u(d+1),s(void 0),i?.connectRetry()},disabled:!m&&(!l?.retryable||d>=cc),children:"Retry"}):!m&&l&&d>=cc?zo(F,{onClick:e,children:"Use a different wallet"}):null]}),zo(Z,{})]})},M4=_4.div`
930
+ `,Sp=e=>{let t=e.walletLogo;return yt(Ep,{children:yt(k4,{children:aa("div",{children:[yt(at,{success:e.success,fail:e.fail}),typeof t=="string"?yt("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):yt(t,{style:{width:"38px",height:"38px"}})]})})})};import{Fragment as W4,jsx as zo,jsxs as Pp}from"react/jsx-runtime";var lc=2,ay=()=>{let{navigateBack:e,navigate:t,lastScreen:r,currentScreen:o,data:n}=R(),{walletConnectionStatus:i,closePrivyModal:a}=M(),[l,s]=iy(void 0),[d,u]=iy(0),m=i?.status==="connected",f=i?.status==="switching_to_supported_chain";ny(()=>{if(m){let S;if(n?.externalConnectWallet?.onCompleteNavigateTo){let I=n.externalConnectWallet.onCompleteNavigateTo;S=setTimeout(()=>{t(I)},Ie)}else S=setTimeout(a,Ie);return()=>clearTimeout(S)}},[m]);let y=S=>{s(Tp(S))};ny(()=>{i?.connectError&&y(i?.connectError)},[i]);let E=i?.connector?.connectorType||"injected",C=i?.connector?.walletClientType||"unknown",w=Or[C]?.displayName||i?.connector?.walletBranding.name||"Browser Extension",P=Or[C]?.logo||i?.connector?.walletBranding.icon||(S=>zo(qi,{...S})),_=w==="Browser Extension"?w.toLowerCase():w,T;m?T=`Successfully connected with ${_}`:l?T=l.message:f?T="Switching networks":T=`Waiting for ${_}`;let A="Don\u2019t see your wallet? Check your other browser windows.";return m?A="You\u2019re good to go!":d>=lc&&l?A="Unable to connect wallet":l?A=l.detail:f?A="Switch your wallet to the requested network.":C==="metamask"&&_4?A="Click to continue to open and connect MetaMask.":C==="metamask"?A="For the best experience, connect only one wallet at a time.":E==="wallet_connect_v2"?A="Open your mobile wallet app to continue":E==="coinbase_wallet"&&(A="Open the Coinbase app on your phone to continue."),Pp(W4,{children:[zo(k,{backFn:o===r?void 0:e}),Pp(M4,{children:[zo(Sp,{walletLogo:P,success:m,fail:!!l}),Pp(Je,{children:[zo("h3",{children:T}),zo("p",{children:A})]}),l==yo.ERROR_USER_EXISTS?zo(F,{onClick:e,children:"Use a different wallet"}):!m&&l?.retryable&&d<lc?zo(F,{onClick:()=>{u(d+1),s(void 0),i?.connectRetry()},disabled:!m&&(!l?.retryable||d>=lc),children:"Retry"}):!m&&l&&d>=lc?zo(F,{onClick:e,children:"Use a different wallet"}):null]}),zo(J,{})]})},M4=I4.div`
931
931
  display: flex;
932
932
  flex-direction: column;
933
933
  align-items: center;
934
934
  justify-content: center;
935
935
  gap: 24px;
936
936
  width: 100%;
937
- `;import{useEffect as iy,useMemo as W4,useState as L4}from"react";import N4 from"styled-components";import{jsx as oy}from"react/jsx-runtime";var ny=({name:e,logoUrl:t})=>{let r=`${e??"Provider app"} logo`;return typeof t=="string"?oy("img",{src:t,alt:r,style:{width:"38px",height:"38px",maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):oy("span",{})};import{Fragment as D4,jsx as Ko,jsxs as dc}from"react/jsx-runtime";var ay=()=>{let e=Le(),{data:t,navigate:r,setModalData:o,onUserCloseViaDialogOrKeybindRef:n}=x(),{crossAppAuthFlow:i,updateWallets:a,closePrivyModal:l,createAnalyticsEvent:s}=L(),{logout:d}=Kd(),[u,m]=L4({}),f=t?.crossAppAuth,g={id:f.appId,name:f.name,logoUrl:f.logoUrl},v=We,C=new w(`There was an issue connecting your ${g.name} account. Please try again.`),b=new Ye(async P=>{if(!f.popup){m({error:C});return}try{let E=await i({appId:P,popup:f.popup,action:f.action});m({data:E})}catch(E){E instanceof w?m({error:E}):E instanceof Mr?(f.popup&&f.popup.close(),m({error:C})):m({error:C})}}),A=()=>{u.data&&(a(),f.onSuccess(u.data),l({shouldCallAuthOnSuccess:!0,isSuccess:!0})),f.onError(u.error??new w("User canceled flow")),l({shouldCallAuthOnSuccess:!1,isSuccess:!1})};n.current=A,iy(()=>{g.id.length&&b.execute(g.id)},[g.id]),iy(()=>{if(!u.data)return;let P=u.data;if(e.legal.requireUsersAcceptTerms&&!P.hasAcceptedTerms){let k=setTimeout(()=>{r("AFFIRMATIVE_CONSENT_SCREEN")},v);return()=>clearTimeout(k)}if(Et(P,e.embeddedWallets?.createOnLogin)){let k=setTimeout(()=>{o({createWallet:{onSuccess:()=>{},onFailure:D=>{console.error(D),s({eventName:"embedded_wallet_creation_failure_logout",payload:{error:D,provider:`privy:${g.id}`,screen:"CrossAppAuthScreen"}}),d()},callAuthOnSuccessOnClose:!0}}),r("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},v);return()=>clearTimeout(k)}let E=setTimeout(A,v);return()=>clearTimeout(E)},[u.data]);let{title:_,subtitle:S}=W4(()=>u.data?{title:`Successfully connected with ${g.name}`,subtitle:"You're good to go!"}:u.error?{title:"Authentication failed",subtitle:u.error.message}:{title:`Connecting to ${g.name}`,subtitle:`Please check the pop-up from ${g.name} to continue`},[u,g.name]);return dc(D4,{children:[Ko(R,{onClose:A}),Ko(oe,{}),dc(O4,{children:[Ko(je,{children:dc("div",{children:[Ko(it,{success:!!u.data,fail:!!u.error}),Ko(ny,{name:g.name,logoUrl:g.logoUrl})]})}),dc(Qe,{children:[Ko("h3",{children:_}),Ko("p",{children:S})]})]}),Ko(ne,{}),Ko(Z,{})]})},O4=N4.div`
937
+ `;import{useEffect as cy,useMemo as L4,useState as N4}from"react";import O4 from"styled-components";import{jsx as sy}from"react/jsx-runtime";var ly=({name:e,logoUrl:t})=>{let r=`${e??"Provider app"} logo`;return typeof t=="string"?sy("img",{src:t,alt:r,style:{width:"38px",height:"38px",maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):sy("span",{})};import{Fragment as U4,jsx as Ko,jsxs as cc}from"react/jsx-runtime";var dy=()=>{let e=Me(),{data:t,navigate:r,setModalData:o,onUserCloseViaDialogOrKeybindRef:n}=R(),{crossAppAuthFlow:i,updateWallets:a,closePrivyModal:l,createAnalyticsEvent:s}=M(),{logout:d}=Jd(),[u,m]=N4({}),f=t?.crossAppAuth,y={id:f.appId,name:f.name,logoUrl:f.logoUrl},E=Ie,C=new v(`There was an issue connecting your ${y.name} account. Please try again.`),w=new Ze(async A=>{if(!f.popup){m({error:C});return}try{let S=await i({appId:A,popup:f.popup,action:f.action});m({data:S})}catch(S){S instanceof v?m({error:S}):S instanceof xr?(f.popup&&f.popup.close(),m({error:C})):m({error:C})}}),P=()=>{u.data&&(a(),f.onSuccess(u.data),l({shouldCallAuthOnSuccess:!0,isSuccess:!0})),f.onError(u.error??new v("User canceled flow")),l({shouldCallAuthOnSuccess:!1,isSuccess:!1})};n.current=P,cy(()=>{y.id.length&&w.execute(y.id)},[y.id]),cy(()=>{if(!u.data)return;let A=u.data;if(e.legal.requireUsersAcceptTerms&&!A.hasAcceptedTerms){let I=setTimeout(()=>{r("AFFIRMATIVE_CONSENT_SCREEN")},E);return()=>clearTimeout(I)}if(vt(A,e.embeddedWallets?.createOnLogin)){let I=setTimeout(()=>{o({createWallet:{onSuccess:()=>{},onFailure:N=>{console.error(N),s({eventName:"embedded_wallet_creation_failure_logout",payload:{error:N,provider:`privy:${y.id}`,screen:"CrossAppAuthScreen"}}),d()},callAuthOnSuccessOnClose:!0}}),r("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},E);return()=>clearTimeout(I)}let S=setTimeout(P,E);return()=>clearTimeout(S)},[u.data]);let{title:_,subtitle:T}=L4(()=>u.data?{title:`Successfully connected with ${y.name}`,subtitle:"You're good to go!"}:u.error?{title:"Authentication failed",subtitle:u.error.message}:{title:`Connecting to ${y.name}`,subtitle:`Please check the pop-up from ${y.name} to continue`},[u,y.name]);return cc(U4,{children:[Ko(k,{onClose:P}),Ko(te,{}),cc(D4,{children:[Ko(tt,{children:cc("div",{children:[Ko(at,{success:!!u.data,fail:!!u.error}),Ko(ly,{name:y.name,logoUrl:y.logoUrl})]})}),cc(Je,{children:[Ko("h3",{children:_}),Ko("p",{children:T})]})]}),Ko(re,{}),Ko(J,{})]})},D4=O4.div`
938
938
  display: flex;
939
939
  flex-direction: column;
940
940
  align-items: center;
@@ -942,7 +942,7 @@ Resources:
942
942
  margin-left: 27px;
943
943
  margin-right: 27px;
944
944
  gap: 24px;
945
- `;import q4 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as z4,useMemo as K4,useState as Y4}from"react";import Q4 from"styled-components";import pc from"styled-components";import{jsx as Ep,jsxs as V4}from"react/jsx-runtime";var uc=()=>Ep(U4,{children:V4(F4,{children:[Ep(B4,{}),Ep(H4,{})]})}),U4=pc.div`
945
+ `;import z4 from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as K4,useMemo as Y4,useState as Q4}from"react";import X4 from"styled-components";import dc from"styled-components";import{jsx as Ap,jsxs as G4}from"react/jsx-runtime";var pc=()=>Ap(F4,{children:G4(B4,{children:[Ap(H4,{}),Ap(V4,{})]})}),F4=dc.div`
946
946
  display: flex;
947
947
  justify-content: center;
948
948
  align-items: center;
@@ -954,14 +954,14 @@ Resources:
954
954
  @media all and (display-mode: standalone) {
955
955
  margin-bottom: 30px;
956
956
  }
957
- `,F4=pc.div`
957
+ `,B4=dc.div`
958
958
  position: relative;
959
959
  height: 140px;
960
960
  width: 140px;
961
961
 
962
962
  opacity: 1;
963
963
  animation: fadein 200ms ease;
964
- `,B4=pc.div`
964
+ `,H4=dc.div`
965
965
  position: absolute;
966
966
  top: 0;
967
967
  right: 0;
@@ -974,7 +974,7 @@ Resources:
974
974
  border: 4px solid var(--privy-color-accent-light);
975
975
  border-radius: 50%;
976
976
  }
977
- `,H4=pc.div`
977
+ `,V4=dc.div`
978
978
  position: absolute;
979
979
  top: 0;
980
980
  right: 0;
@@ -998,12 +998,12 @@ Resources:
998
998
  transform: rotate(360deg);
999
999
  }
1000
1000
  }
1001
- `;var sy=["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 Oe=class extends Error{constructor(r,o){super(o);this.type=r}};function na(e){let t=e.type;return typeof t=="string"&&sy.includes(t)}function G4(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function ri(e){return na(e)&&e.type==="wallet_not_on_device"}function ly(e){return na(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function oi(e){return!!(na(e)&&e.type==="mfa_timeout")}function ni(e){return!!(na(e)&&e.type==="missing_or_invalid_mfa")}function Tp(e){return!!(na(e)&&e.type==="mfa_verification_max_attempts_reached")}function mc(e){return!!(na(e)&&e.message.includes("code 429"))}function fc(e){return!!(G4(e)&&e.message==="MFA canceled")}function Sp({isCreatingWallet:e,skipSplashScreen:t}){return e?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":t?"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function hc({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r,isResettingPassword:o,showAutomaticRecovery:n}){return n?"EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN":r||t.length===1?Sp({isCreatingWallet:e==="create",skipSplashScreen:o}):"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"}function yc(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 Ap({api:e,provider:t}){let r=qn(),o=Li(),n=await Ni(r);try{return t==="icloud"?{url:(await e.post(ef,{client_type:"web"})).url}:{url:(await e.post($m,{redirect_to:window.location.href,code_challenge:n,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(i){throw ae(i)}}async function cy({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new w("User denied confirmation during OAuth flow");try{return(await e.post(tf,{authorization_code:n,state_code:r,code_verifier:o,provider:t})).access_token}catch(i){let a=ae(i);throw a.privyErrorCode?new w(a.message||"Invalid code during OAuth flow.",void 0,a.privyErrorCode):a.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")}}import{Fragment as py,jsx as ia,jsxs as Pp}from"react/jsx-runtime";var dy=1,uy=()=>{let{authenticated:e,user:t,getAccessToken:r}=K(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:i}=L(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:d}=x(),u=K4(()=>Date.now(),[]),[m,f]=Y4(!1),{onCompleteNavigateTo:g,onFailure:v,shouldForceMFA:C,address:b}=l?.connectWallet,A=S=>{m||(f(!0),v(typeof S=="string"?new Error(S):S))};z4(()=>{let S=b?t?.linkedAccounts.find(k=>k.type==="wallet"&&k.walletClientType==="privy"&&k.address===b):Me(t),P;return!e||!S?A("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let k=await r();if(!k)return A("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:k,address:S.address}),C&&await i.verifyMfa({accessToken:k});let D=(Date.now()-u)/1e3;g==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&D<dy?P=setTimeout(()=>{a(g,!1)},(dy-D)*1e3):a(g,!1)}catch(D){if(ri(D)&&S.recoveryMethod==="privy"){let H=await r();if(!H)return A("User must be authenticated and have a Privy wallet before it can be recovered");try{n({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:S.address}}),(await i?.recover({address:S.address,accessToken:H,recoveryMethod:S.recoveryMethod}))?.address||A(new Error("Unable to recover wallet")),g?a(g):o({shouldCallAuthOnSuccess:!1}),n({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:S.address}}),a(g)}catch{A("An error has occurred, please try again.")}}else if(ri(D)&&S.recoveryMethod!=="privy"){s({...l,recoverWallet:{privyWallet:S,onCompleteNavigateTo:g,onFailure:v},recoveryOAuthStatus:{provider:S.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}});let H=yc(S.recoveryMethod);a(H)}else A(D)}})(),()=>clearTimeout(P)):void 0},[e,t,i]);let _=()=>{A("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return d.current=_,Pp(py,{children:[ia(R,{onClose:_}),m?Pp(py,{children:[Pp(Cr,{children:[ia(q4,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),ia(ve,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),ia(F,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):ia(uc,{}),ia(X4,{})]})},X4=Q4.div`
1001
+ `;var py=["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 Le=class extends Error{constructor(r,o){super(o);this.type=r}};function sa(e){let t=e.type;return typeof t=="string"&&py.includes(t)}function q4(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function ai(e){return sa(e)&&e.type==="wallet_not_on_device"}function uy(e){return sa(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function si(e){return!!(sa(e)&&e.type==="mfa_timeout")}function li(e){return!!(sa(e)&&e.type==="missing_or_invalid_mfa")}function xp(e){return!!(sa(e)&&e.type==="mfa_verification_max_attempts_reached")}function uc(e){return!!(sa(e)&&e.message.includes("code 429"))}function mc(e){return!!(q4(e)&&e.message==="MFA canceled")}function Rp({isCreatingWallet:e,skipSplashScreen:t}){return e?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":t?"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function fc({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r,isResettingPassword:o,showAutomaticRecovery:n}){return n?"EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN":r||t.length===1?Rp({isCreatingWallet:e==="create",skipSplashScreen:o}):"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"}function hc(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 kp({api:e,provider:t}){let r=Qn(),o=Ui(),n=await Fi(r);try{return t==="icloud"?{url:(await e.post(of,{client_type:"web"})).url}:{url:(await e.post(rf,{redirect_to:window.location.href,code_challenge:n,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(i){throw ne(i)}}async function my({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new v("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new v("User denied confirmation during OAuth flow");try{return(await e.post(nf,{authorization_code:n,state_code:r,code_verifier:o,provider:t})).access_token}catch(i){let a=ne(i);throw a.privyErrorCode?new v(a.message||"Invalid code during OAuth flow.",void 0,a.privyErrorCode):a.message==="User denied confirmation during OAuth flow"?new v("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new v("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}import{Fragment as hy,jsx as la,jsxs as _p}from"react/jsx-runtime";var fy=1,yy=()=>{let{authenticated:e,user:t,getAccessToken:r}=V(),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:i}=M(),{navigate:a,data:l,setModalData:s,onUserCloseViaDialogOrKeybindRef:d}=R(),u=Y4(()=>Date.now(),[]),[m,f]=Q4(!1),{onCompleteNavigateTo:y,onFailure:E,shouldForceMFA:C,address:w}=l?.connectWallet,P=T=>{m||(f(!0),E(typeof T=="string"?new Error(T):T))};K4(()=>{let T=w?t?.linkedAccounts.find(I=>I.type==="wallet"&&I.walletClientType==="privy"&&I.address===w):Ue(t),A;return!e||!T?P("User must be authenticated and have a Privy wallet before it can be connected"):i?((async()=>{let I=await r();if(!I)return P("User must be authenticated and have a Privy wallet before it can be connected");try{await i.connect({accessToken:I,address:T.address}),C&&await i.verifyMfa({accessToken:I});let N=(Date.now()-u)/1e3;y==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&N<fy?A=setTimeout(()=>{a(y,!1)},(fy-N)*1e3):a(y,!1)}catch(N){if(ai(N)&&T.recoveryMethod==="privy"){let H=await r();if(!H)return P("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:H,recoveryMethod:T.recoveryMethod}))?.address||P(new Error("Unable to recover wallet")),y?a(y):o({shouldCallAuthOnSuccess:!1}),n({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:T.address}}),a(y)}catch{P("An error has occurred, please try again.")}}else if(ai(N)&&T.recoveryMethod!=="privy"){s({...l,recoverWallet:{privyWallet:T,onCompleteNavigateTo:y,onFailure:E},recoveryOAuthStatus:{provider:T.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}});let H=hc(T.recoveryMethod);a(H)}else P(N)}})(),()=>clearTimeout(A)):void 0},[e,t,i]);let _=()=>{P("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return d.current=_,_p(hy,{children:[la(k,{onClose:_}),m?_p(hy,{children:[_p(fr,{children:[la(z4,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),la(ge,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),la(F,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):la(pc,{}),la(Z4,{})]})},Z4=X4.div`
1002
1002
  height: 44px;
1003
- `;import Z4 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as J4}from"react";import{Fragment as j4,jsx as aa,jsxs as my}from"react/jsx-runtime";var fy=()=>{let{user:e}=K(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=L(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=x(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:d}=i.createWallet,u=()=>{let m=Me(e);m?(o(),l(m)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:d})};return J4(()=>{let m=setTimeout(u,rm);return()=>clearTimeout(m)},[]),a.current=u,my(j4,{children:[aa(R,{onClose:u}),aa(oe,{}),my(Cr,{children:[aa(Z4,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),aa(ve,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),aa(ne,{}),aa(G,{})]})};import{useEffect as gy,useRef as aw,useState as xp}from"react";import Rp from"styled-components";import{ExclamationTriangleIcon as $4}from"@heroicons/react/24/outline";import ew from"styled-components";import{jsx as rw,jsxs as ow}from"react/jsx-runtime";var hy=({children:e,theme:t})=>ow(tw,{$theme:t,children:[rw($4,{width:"1.25rem",color:t==="dark"?"#FDE68A":"var(--privy-color-warn)"}),e]}),tw=ew.div`
1003
+ `;import J4 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as j4}from"react";import{Fragment as $4,jsx as ca,jsxs as gy}from"react/jsx-runtime";var Cy=()=>{let{user:e}=V(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=M(),{app:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=R(),{onSuccess:l,onFailure:s,callAuthOnSuccessOnClose:d}=i.createWallet,u=()=>{let m=Ue(e);m?(o(),l(m)):s(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:d})};return j4(()=>{let m=setTimeout(u,im);return()=>clearTimeout(m)},[]),a.current=u,gy($4,{children:[ca(k,{onClose:u}),ca(te,{}),gy(fr,{children:[ca(J4,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),ca(ge,{title:r?`Welcome${n?.name?` to ${n?.name}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),ca(re,{}),ca(B,{})]})};import{useEffect as by,useRef as sw,useState as Ip}from"react";import Mp from"styled-components";import{ExclamationTriangleIcon as ew}from"@heroicons/react/24/outline";import tw from"styled-components";import{jsx as ow,jsxs as nw}from"react/jsx-runtime";var vy=({children:e,theme:t})=>nw(rw,{$theme:t,children:[ow(ew,{width:"1.25rem",color:t==="dark"?"#FDE68A":"var(--privy-color-warn)"}),e]}),rw=tw.div`
1004
1004
  display: flex;
1005
1005
  gap: 0.5rem;
1006
- background-color: ${e=>e.$theme==="dark"?"var(--privy-color-background-2)":"var(--privy-color-background)"};
1006
+ background-color: ${e=>e.$theme==="dark"?"var(--privy-color-background-2)":"var(--privy-color-warn-light)"};
1007
1007
 
1008
1008
  ${e=>e.$theme==="dark"?"color: #FDE68A;":""}
1009
1009
 
@@ -1020,7 +1020,7 @@ Resources:
1020
1020
  && {
1021
1021
  border-radius: var(--privy-border-radius-sm);
1022
1022
  }
1023
- `;import nw from"styled-components";var Hr=nw.span`
1023
+ `;import iw from"styled-components";var Dr=iw.span`
1024
1024
  margin-top: 4px;
1025
1025
  color: var(--privy-color-foreground);
1026
1026
  text-align: center;
@@ -1032,25 +1032,25 @@ Resources:
1032
1032
  && a {
1033
1033
  color: var(--privy-color-accent);
1034
1034
  }
1035
- `;import iw from"styled-components";var no=iw.span`
1035
+ `;import aw from"styled-components";var ro=aw.span`
1036
1036
  color: var(--privy-color-foreground);
1037
1037
  font-size: 1.125rem;
1038
1038
  font-weight: 600;
1039
1039
  line-height: 1.875rem; /* 166.667% */
1040
1040
  text-align: center;
1041
- `;import{Fragment as dw,jsx as Vr,jsxs as gc}from"react/jsx-runtime";var Cy=()=>{let[e,t]=xp(null),{authenticated:r,user:o,getAccessToken:n}=K(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=L(),s=Le(),{data:d,onUserCloseViaDialogOrKeybindRef:u}=x(),{onFailure:m,onSuccess:f,origin:g,appId:v,appClientId:C,wallet:b}=d.keyExport,A=S=>{i({shouldCallAuthOnSuccess:!1}),m(typeof S=="string"?new Error(S):S)},_=()=>{i({shouldCallAuthOnSuccess:!1}),f(),a({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:b.address}})};return gy(()=>{if(!r||!b)return A("User must be authenticated before exporting their wallet");n().then(t,A)},[r,o]),u.current=_,gc(dw,{children:[Vr(R,{onClose:_}),gc(lw,{children:[Vr(no,{children:"Transfer wallet"}),gc(Hr,{children:["Either copy your private key or seed phrase to transfer your wallet."," ",Vr("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),Vr(hy,{theme:s.appearance.palette.colorScheme,children:"Never share your private key or seed phrase with anyone."}),Vr(_i,{isLoading:!1,isPulsing:!1,title:"Your wallet",address:b.address,showIcon:!0}),Vr("div",{style:{width:"100%"},children:e&&Vr(sw,{origin:g,appId:v,appClientId:C,accessToken:e,clientAnalyticsId:l,wallet:b,dimensions:{height:"44px"}})})]}),Vr(G,{})]})};function sw(e){let[t,r]=xp(e.dimensions.width),[o,n]=xp(void 0),i=aw(null);gy(()=>{if(i.current&&t===void 0){let{width:s}=i.current.getBoundingClientRect();r(s)}let l=getComputedStyle(document.documentElement);n({background:l.getPropertyValue("--privy-color-background"),background2:l.getPropertyValue("--privy-color-background-2"),foreground3:l.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:l.getPropertyValue("--privy-color-foreground-accent"),accent:l.getPropertyValue("--privy-color-accent"),accentDark:l.getPropertyValue("--privy-color-accent-dark"),success:l.getPropertyValue("--privy-color-success")})},[]);let a=e.wallet.chainType==="ethereum"&&!e.wallet.imported;return Vr("div",{ref:i,children:t&&gc(cw,{children:[Vr("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:js(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{client_id:e.appClientId,address:e.wallet.address,width:`${t}px`,caid:e.clientAnalyticsId,phrase_export:a,...o},{token:e.accessToken})}),Vr(yy,{children:"Loading..."}),a&&Vr(yy,{children:"Loading..."})]})})}var lw=Rp.div`
1041
+ `;import{Fragment as pw,jsx as Ur,jsxs as yc}from"react/jsx-runtime";var Ey=()=>{let[e,t]=Ip(null),{authenticated:r,user:o,getAccessToken:n}=V(),{closePrivyModal:i,createAnalyticsEvent:a,clientAnalyticsId:l}=M(),s=Me(),{data:d,onUserCloseViaDialogOrKeybindRef:u}=R(),{onFailure:m,onSuccess:f,origin:y,appId:E,appClientId:C,wallet:w}=d.keyExport,P=T=>{i({shouldCallAuthOnSuccess:!1}),m(typeof T=="string"?new Error(T):T)},_=()=>{i({shouldCallAuthOnSuccess:!1}),f(),a({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:w.address}})};return by(()=>{if(!r||!w)return P("User must be authenticated before exporting their wallet");n().then(t,P)},[r,o]),u.current=_,yc(pw,{children:[Ur(k,{onClose:_}),yc(cw,{children:[Ur(ro,{children:"Transfer wallet"}),yc(Dr,{children:["Either copy your private key or seed phrase to transfer your wallet."," ",Ur("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),Ur(vy,{theme:s.appearance.palette.colorScheme,children:"Never share your private key or seed phrase with anyone."}),Ur(Li,{isLoading:!1,isPulsing:!1,title:"Your wallet",address:w.address,showIcon:!0}),Ur("div",{style:{width:"100%"},children:e&&Ur(lw,{origin:y,appId:E,appClientId:C,accessToken:e,clientAnalyticsId:l,wallet:w,dimensions:{height:"44px"}})})]}),Ur(B,{})]})};function lw(e){let[t,r]=Ip(e.dimensions.width),[o,n]=Ip(void 0),i=sw(null);by(()=>{if(i.current&&t===void 0){let{width:s}=i.current.getBoundingClientRect();r(s)}let l=getComputedStyle(document.documentElement);n({background:l.getPropertyValue("--privy-color-background"),background2:l.getPropertyValue("--privy-color-background-2"),foreground3:l.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:l.getPropertyValue("--privy-color-foreground-accent"),accent:l.getPropertyValue("--privy-color-accent"),accentDark:l.getPropertyValue("--privy-color-accent-dark"),success:l.getPropertyValue("--privy-color-success")})},[]);let a=e.wallet.chainType==="ethereum"&&!e.wallet.imported;return Ur("div",{ref:i,children:t&&yc(dw,{children:[Ur("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:Js(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{client_id:e.appClientId,address:e.wallet.address,width:`${t}px`,caid:e.clientAnalyticsId,phrase_export:a,...o},{token:e.accessToken})}),Ur(wy,{children:"Loading..."}),a&&Ur(wy,{children:"Loading..."})]})})}var cw=Mp.div`
1042
1042
  display: flex;
1043
1043
  flex-direction: column;
1044
1044
  gap: 1.25rem;
1045
1045
  text-align: left;
1046
- `,cw=Rp.div`
1046
+ `,dw=Mp.div`
1047
1047
  overflow: visible;
1048
1048
  position: relative;
1049
1049
  overflow: none;
1050
1050
  height: 44px;
1051
1051
  display: flex;
1052
1052
  gap: 12px;
1053
- `,yy=Rp.div`
1053
+ `,wy=Mp.div`
1054
1054
  display: flex;
1055
1055
  align-items: center;
1056
1056
  justify-content: center;
@@ -1061,9 +1061,9 @@ Resources:
1061
1061
  border-radius: var(--privy-border-radius-md);
1062
1062
  background-color: var(--privy-color-background-2);
1063
1063
  color: var(--privy-color-foreground-3);
1064
- `;import mw from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as fw,useState as vy}from"react";import hw from"styled-components";import{useCallback as pw,useRef as uw}from"react";function Cc(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=L(),o=uw(!1);return{createWallet:pw(async i=>{let a=await be();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(Pi);if(!l)throw new Error("walletProxy does not exist.");let s=2e4,d=new Promise((g,v)=>{setTimeout(()=>{v(new Error("walletProxy.create timed out."))},s)});if(!await Promise.race([l.create({accessToken:a,recoveryPassword:i}),d]))throw new Error("walletProxy.create did not send a response.");let m=await e();if(!m)throw new Error("Failed to refresh user.");let f=Me(m);if(!f)throw new Error("Updated user is missing embedded wallet.");return t({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:f.address}}),o.current=!0,f}catch(l){if(o.current)return;throw t({eventName:"embedded_wallet_creation_failed",payload:{error:l.toString()}}),console.warn(l),l}},[])}}import{Fragment as gw,jsx as sa,jsxs as wy}from"react/jsx-runtime";var by=()=>{let{app:e,setModalData:t,navigate:r,data:o,onUserCloseViaDialogOrKeybindRef:n}=x(),[i,a]=vy(""),{embeddedWallets:l}=Le(),{authenticated:s}=K(),{closePrivyModal:d}=L(),{onSuccess:u,onFailure:m,callAuthOnSuccessOnClose:f}=o.createWallet,g=e?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,{createWallet:v}=Cc(),[C,b]=vy(null),A=new Ye(async()=>{try{let S=await v();if(!S)return;b(S),r("EMBEDDED_WALLET_CREATED_SCREEN")}catch(S){a(S.message)}});fw(()=>{if(!s){r("LANDING"),m(new Error("User must be authenticated before creating a Privy wallet"));return}if(g){t({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}});let S=hc({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:l.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1});return r(S)}A.execute()},[g,s]);let _=()=>{C?(u(C),d({shouldCallAuthOnSuccess:f})):(m(new fr("User wallet creation failed")),d({shouldCallAuthOnSuccess:!1}))};return n.current=()=>null,i?wy(gw,{children:[sa(R,{closeable:!1}),wy(Cr,{children:[sa(mw,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),sa(ve,{title:"Something went wrong",description:i})]}),sa(F,{onClick:_,children:"Close"}),sa(yw,{})]}):sa(uc,{})},yw=hw.div`
1064
+ `;import fw from"@heroicons/react/24/solid/XCircleIcon";import{useEffect as hw,useState as Ty}from"react";import yw from"styled-components";import{useCallback as uw,useRef as mw}from"react";function gc(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=M(),o=mw(!1);return{createWallet:uw(async i=>{let a=await ve();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(ki);if(!l)throw new Error("walletProxy does not exist.");let s=2e4,d=new Promise((y,E)=>{setTimeout(()=>{E(new Error("walletProxy.create timed out."))},s)});if(!await Promise.race([l.create({accessToken:a,recoveryPassword:i}),d]))throw new Error("walletProxy.create did not send a response.");let m=await e();if(!m)throw new Error("Failed to refresh user.");let f=Ue(m);if(!f)throw new Error("Updated user is missing embedded wallet.");return t({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:f.address}}),o.current=!0,f}catch(l){if(o.current)return;throw t({eventName:"embedded_wallet_creation_failed",payload:{error:l.toString()}}),console.warn(l),l}},[])}}import{Fragment as Cw,jsx as da,jsxs as Sy}from"react/jsx-runtime";var Py=()=>{let{app:e,setModalData:t,navigate:r,data:o,onUserCloseViaDialogOrKeybindRef:n}=R(),[i,a]=Ty(""),{embeddedWallets:l}=Me(),{authenticated:s}=V(),{closePrivyModal:d}=M(),{onSuccess:u,onFailure:m,callAuthOnSuccessOnClose:f}=o.createWallet,y=e?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,{createWallet:E}=gc(),[C,w]=Ty(null),P=new Ze(async()=>{try{let T=await E();if(!T)return;w(T),r("EMBEDDED_WALLET_CREATED_SCREEN")}catch(T){a(T.message)}});hw(()=>{if(!s){r("LANDING"),m(new Error("User must be authenticated before creating a Privy wallet"));return}if(y){t({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}});let T=fc({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:l.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1});return r(T)}P.execute()},[y,s]);let _=()=>{C?(u(C),d({shouldCallAuthOnSuccess:f})):(m(new dr("User wallet creation failed")),d({shouldCallAuthOnSuccess:!1}))};return n.current=()=>null,i?Sy(Cw,{children:[da(k,{closeable:!1}),Sy(fr,{children:[da(fw,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),da(ge,{title:"Something went wrong",description:i})]}),da(F,{onClick:_,children:"Close"}),da(gw,{})]}):da(pc,{})},gw=yw.div`
1065
1065
  height: 44px;
1066
- `;import{useEffect as d5,useState as Tc}from"react";import{useCallback as Np,useEffect as c5}from"react";import Ew from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useEffect as Tw,useState as Mp}from"react";import Cw from"@heroicons/react/24/outline/ArrowPathIcon";import vw from"@heroicons/react/24/outline/EyeIcon";import ww from"@heroicons/react/24/outline/EyeSlashIcon";import _t,{css as kp}from"styled-components";var bw=kp`
1066
+ `;import{useEffect as p5,useState as Ec}from"react";import{useCallback as Fp,useEffect as d5}from"react";import Tw from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useEffect as Sw,useState as Np}from"react";import vw from"@heroicons/react/24/outline/ArrowPathIcon";import ww from"@heroicons/react/24/outline/EyeIcon";import bw from"@heroicons/react/24/outline/EyeSlashIcon";import Rt,{css as Wp}from"styled-components";var Ew=Wp`
1067
1067
  font-size: 14px;
1068
1068
  font-style: normal;
1069
1069
  font-weight: 400;
@@ -1071,8 +1071,8 @@ Resources:
1071
1071
  letter-spacing: -0.008px;
1072
1072
  text-align: left;
1073
1073
  transition: color 0.1s ease-in;
1074
- `,vc=_t.span`
1075
- ${bw}
1074
+ `,Cc=Rt.span`
1075
+ ${Ew}
1076
1076
  transition: color 0.1s ease-in;
1077
1077
  color: ${({error:e})=>e?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
1078
1078
  text-transform: ${({error:e})=>e?"":"capitalize"};
@@ -1080,18 +1080,18 @@ Resources:
1080
1080
  &[aria-hidden='true'] {
1081
1081
  visibility: hidden;
1082
1082
  }
1083
- `,mn=_t.div`
1083
+ `,fn=Rt.div`
1084
1084
  display: flex;
1085
1085
  flex-direction: column;
1086
1086
  justify-content: center;
1087
1087
  flex-grow: 1;
1088
- `,fn=_t(F)`
1089
- ${e=>e.hideAnimations&&kp`
1088
+ `,hn=Rt(F)`
1089
+ ${e=>e.hideAnimations&&Wp`
1090
1090
  && {
1091
1091
  transition: none;
1092
1092
  }
1093
1093
  `}
1094
- `,Ey=kp`
1094
+ `,Ay=Wp`
1095
1095
  && {
1096
1096
  width: 100%;
1097
1097
  border-width: 1px;
@@ -1106,8 +1106,8 @@ Resources:
1106
1106
  font-weight: 300;
1107
1107
  line-height: 22px; /* 137.5% */
1108
1108
  }
1109
- `,la=_t.input`
1110
- ${Ey}
1109
+ `,pa=Rt.input`
1110
+ ${Ay}
1111
1111
 
1112
1112
  &::placeholder {
1113
1113
  color: var(--privy-color-foreground-3);
@@ -1118,15 +1118,15 @@ Resources:
1118
1118
  overflow: hidden;
1119
1119
  text-overflow: ellipsis;
1120
1120
  white-space: nowrap;
1121
- `,Ty=_t.div`
1122
- ${Ey}
1123
- `,hn=_t.div`
1121
+ `,xy=Rt.div`
1122
+ ${Ay}
1123
+ `,yn=Rt.div`
1124
1124
  position: relative;
1125
1125
  width: 100%;
1126
1126
  display: flex;
1127
1127
  align-items: center;
1128
1128
  justify-content: ${({centered:e})=>e?"center":"space-between"};
1129
- `,yn=_t.div`
1129
+ `,gn=Rt.div`
1130
1130
  display: flex;
1131
1131
  flex-direction: column;
1132
1132
  align-items: center;
@@ -1148,12 +1148,12 @@ Resources:
1148
1148
  font-weight: 400;
1149
1149
  line-height: 20px;
1150
1150
  }
1151
- `,ss=_t.div`
1151
+ `,ls=Rt.div`
1152
1152
  display: flex;
1153
1153
  flex-direction: column;
1154
1154
  gap: 10px;
1155
1155
  padding-bottom: 1rem;
1156
- `,ls=_t.div`
1156
+ `,cs=Rt.div`
1157
1157
  display: flex;
1158
1158
  text-align: left;
1159
1159
  align-items: center;
@@ -1173,13 +1173,13 @@ Resources:
1173
1173
  > :first-child {
1174
1174
  min-width: 24px;
1175
1175
  }
1176
- `,zO=_t.div`
1176
+ `,VO=Rt.div`
1177
1177
  height: var(--privy-height-modal-full);
1178
1178
 
1179
1179
  @media (max-width: 440px) {
1180
1180
  height: var(--privy-height-modal-compact);
1181
1181
  }
1182
- `,_p=_t(ja)`
1182
+ `,Lp=Rt($a)`
1183
1183
  display: flex;
1184
1184
  flex: 1;
1185
1185
  gap: 4px;
@@ -1191,7 +1191,7 @@ Resources:
1191
1191
  border-color: var(--privy-color-foreground-3);
1192
1192
  border-width: 1px;
1193
1193
  }
1194
- `,ca=_t.div`
1194
+ `,ua=Rt.div`
1195
1195
  position: absolute;
1196
1196
  right: 0.5rem;
1197
1197
 
@@ -1199,7 +1199,7 @@ Resources:
1199
1199
  flex-direction: row;
1200
1200
  justify-content: space-around;
1201
1201
  align-items: center;
1202
- `,Sy=_t(Cw)`
1202
+ `,Ry=Rt(vw)`
1203
1203
  height: 1.25rem;
1204
1204
  width: 1.25rem;
1205
1205
  stroke: var(--privy-color-accent);
@@ -1208,7 +1208,7 @@ Resources:
1208
1208
  :active {
1209
1209
  stroke: var(--privy-color-accent-light);
1210
1210
  }
1211
- `,da=_t(ww)`
1211
+ `,ma=Rt(bw)`
1212
1212
  height: 1.25rem;
1213
1213
  width: 1.25rem;
1214
1214
  stroke: var(--privy-color-accent);
@@ -1217,7 +1217,7 @@ Resources:
1217
1217
  :active {
1218
1218
  stroke: var(--privy-color-accent-light);
1219
1219
  }
1220
- `,pa=_t(vw)`
1220
+ `,fa=Rt(ww)`
1221
1221
  height: 1.25rem;
1222
1222
  width: 1.25rem;
1223
1223
  stroke: var(--privy-color-accent);
@@ -1226,7 +1226,7 @@ Resources:
1226
1226
  :active {
1227
1227
  stroke: var(--privy-color-accent-light);
1228
1228
  }
1229
- `,Ay=_t.progress`
1229
+ `,ky=Rt.progress`
1230
1230
  height: 4px;
1231
1231
  width: 100%;
1232
1232
  margin: 8px 0;
@@ -1242,7 +1242,7 @@ Resources:
1242
1242
  transition: all 0.1s ease-out;
1243
1243
  background: ${({label:e})=>e==="Strong"&&"#78dca6"||e==="Medium"&&"var(--privy-color-warn)"||"var(--privy-color-error)"};
1244
1244
  }
1245
- `;import{Fragment as Sw,jsx as br,jsxs as wc}from"react/jsx-runtime";var Py=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[i,a]=Mp(!0),[l,s]=Mp(!1),[d,u]=Mp(""),m=r===d;return Tw(()=>{d&&!l&&s(!0)},[d]),wc(Sw,{children:[br(R,{closeable:!1,backFn:n}),br(oe,{}),wc(mn,{children:[wc(yn,{children:[br(Ew,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),br("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),br("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),wc(hn,{children:[br(la,{value:d,onChange:f=>u(f.target.value),onKeyUp:f=>{f.key==="Enter"&&o()},onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text",style:{paddingRight:"2.3rem"}}),br(ca,{style:{right:"0.75rem"},children:i?br(da,{onClick:()=>a(!1)}):br(pa,{onClick:()=>a(!0)})})]}),br(vc,{"aria-hidden":!l||m,error:!0,children:"Passwords do not match"})]}),br(fn,{onClick:o,loading:t,disabled:!m,hideAnimations:e,children:"Continue"}),br(ne,{}),br(G,{})]})};import Rw from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as kw}from"react";import _w from"styled-components";import ds from"styled-components";import{jsx as cs,jsxs as xw}from"react/jsx-runtime";var xy=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>cs("label",{children:xw(Aw,{className:e,children:[cs(ky,{checked:t,...o}),cs(Pw,{color:r,checked:t,children:cs(Ry,{viewBox:"0 0 24 24",children:cs("polyline",{points:"20 6 9 17 4 12"})})})]})});var oD=ds.label`
1245
+ `;import{Fragment as Pw,jsx as gr,jsxs as vc}from"react/jsx-runtime";var _y=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[i,a]=Np(!0),[l,s]=Np(!1),[d,u]=Np(""),m=r===d;return Sw(()=>{d&&!l&&s(!0)},[d]),vc(Pw,{children:[gr(k,{closeable:!1,backFn:n}),gr(te,{}),vc(fn,{children:[vc(gn,{children:[gr(Tw,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),gr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),gr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),vc(yn,{children:[gr(pa,{value:d,onChange:f=>u(f.target.value),onKeyUp:f=>{f.key==="Enter"&&o()},onBlur:()=>s(!0),placeholder:"confirm your password",type:i?"password":"text",style:{paddingRight:"2.3rem"}}),gr(ua,{style:{right:"0.75rem"},children:i?gr(ma,{onClick:()=>a(!1)}):gr(fa,{onClick:()=>a(!0)})})]}),gr(Cc,{"aria-hidden":!l||m,error:!0,children:"Passwords do not match"})]}),gr(hn,{onClick:o,loading:t,disabled:!m,hideAnimations:e,children:"Continue"}),gr(re,{}),gr(B,{})]})};import kw from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as _w}from"react";import Iw from"styled-components";import ps from"styled-components";import{jsx as ds,jsxs as Rw}from"react/jsx-runtime";var Iy=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>ds("label",{children:Rw(Aw,{className:e,children:[ds(Wy,{checked:t,...o}),ds(xw,{color:r,checked:t,children:ds(My,{viewBox:"0 0 24 24",children:ds("polyline",{points:"20 6 9 17 4 12"})})})]})});var eD=ps.label`
1246
1246
  && {
1247
1247
  cursor: pointer;
1248
1248
  display: flex;
@@ -1254,14 +1254,14 @@ Resources:
1254
1254
  border: 1px solid var(--privy-color-foreground-4);
1255
1255
  width: 100%;
1256
1256
  }
1257
- `,Aw=ds.div`
1257
+ `,Aw=ps.div`
1258
1258
  display: inline-block;
1259
1259
  vertical-align: middle;
1260
- `,Ry=ds.svg`
1260
+ `,My=ps.svg`
1261
1261
  fill: none;
1262
1262
  stroke: white;
1263
1263
  stroke-width: 3px;
1264
- `,ky=ds.input.attrs({type:"checkbox"})`
1264
+ `,Wy=ps.input.attrs({type:"checkbox"})`
1265
1265
  border: 0;
1266
1266
  clip: rect(0 0 0 0);
1267
1267
  clippath: inset(50%);
@@ -1272,7 +1272,7 @@ Resources:
1272
1272
  position: absolute;
1273
1273
  white-space: nowrap;
1274
1274
  width: 1px;
1275
- `,Pw=ds.div`
1275
+ `,xw=ps.div`
1276
1276
  display: inline-block;
1277
1277
  width: 18px;
1278
1278
  height: 18px;
@@ -1287,28 +1287,28 @@ Resources:
1287
1287
  border-width: 1px;
1288
1288
  }
1289
1289
 
1290
- ${ky}:focus + & {
1290
+ ${Wy}:focus + & {
1291
1291
  box-shadow: 0 0 0 1px ${e=>e.color};
1292
1292
  }
1293
1293
 
1294
- ${Ry} {
1294
+ ${My} {
1295
1295
  visibility: ${e=>e.checked?"visible":"hidden"};
1296
1296
  }
1297
- `;import{Fragment as _y,jsx as Gr,jsxs as ps}from"react/jsx-runtime";var My=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[i,a]=kw(!1);return ps(_y,{children:[Gr(R,{closeable:!1,backFn:o}),Gr(oe,{}),ps(mn,{children:[ps(yn,{children:[Gr(Rw,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),Gr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),Gr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),Gr(ss,{children:ps(ls,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[Gr(xy,{color:"var(--privy-color-error)",readOnly:!0,checked:i}),Gr(_y,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),ps(Mw,{children:[n.initiatedBy==="user"&&Gr($r,{onClick:n.onCancel,disabled:t,children:"Cancel"}),Gr(fn,{onClick:r,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),Gr(ne,{}),Gr(G,{})]})},Mw=_w.div`
1297
+ `;import{Fragment as Ly,jsx as Fr,jsxs as us}from"react/jsx-runtime";var Ny=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[i,a]=_w(!1);return us(Ly,{children:[Fr(k,{closeable:!1,backFn:o}),Fr(te,{}),us(fn,{children:[us(gn,{children:[Fr(kw,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),Fr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),Fr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),Fr(ls,{children:us(cs,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:l=>{l.preventDefault(),a(s=>!s)},children:[Fr(Iy,{color:"var(--privy-color-error)",readOnly:!0,checked:i}),Fr(Ly,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),us(Mw,{children:[n.initiatedBy==="user"&&Fr(Jr,{onClick:n.onCancel,disabled:t,children:"Cancel"}),Fr(hn,{onClick:r,loading:t,hideAnimations:e,disabled:!i,children:"Set Password"})]}),Fr(re,{}),Fr(B,{})]})},Mw=Iw.div`
1298
1298
  display: flex;
1299
1299
  gap: 10px;
1300
- `;import Yw from"@heroicons/react/24/outline/KeyIcon";import Uy from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as Fy,useMemo as Ip,useEffect as Qw}from"react";import By from"styled-components";import Iw from"fast-password-entropy";import*as Iy from"secure-password-utilities";import{DEFAULT_WORDLIST as Ww}from"secure-password-utilities/wordlists";var Lw=95,Nw=8,Ow=3,Dw=.3,Uw=/[a-z]/,Fw=/[A-Z]/,Bw=/[0-9]/,Hw="a-zA-Z0-9",Wy="!@#$%^&*()\\-_+.",Ly=`${Hw}${Wy}`,Vw=new RegExp(`[${Wy}]`),Gw=new RegExp(`[${Ly}]`),Ny=new RegExp(`^[${Ly}]{6,}$`),Oy=(e="")=>{let t=e.split("").filter(r=>!Gw.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},bc=()=>Iy.generatePassphrase(4,Ww);function qw(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function zw(e){if(e.length<Nw)return 0;let t=0;Uw.test(e)&&(t+=1),Fw.test(e)&&(t+=1),Bw.test(e)&&(t+=1),Vw.test(e)&&(t+=1);let r=t/Ow;return Math.max(0,Math.min(1,r))}function Kw(e=""){let t=zw(e),r=Iw(e)/Lw;return(t*Dw+r)/2}function Dy(e=""){let t=Kw(e);return{value:t,label:qw(t)}}import{Fragment as Jw,jsx as Mt,jsxs as xo}from"react/jsx-runtime";var Hy=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,isResettingPassword:n,onSubmit:i,onClose:a,onBack:l,onPasswordChange:s,onPasswordGenerate:d})=>{let[u,m]=Fy(!1),[f,g]=Fy(!1);Qw(()=>{r&&!f&&g(!0)},[r]);let v=Ip(()=>f?(r?.length||0)<6?"Password must be at least 6 characters":Ny.test(r||"")?null:`Invalid characters used ( ${Oy(r).join(" ")} )`:null,[r,f]),C=Ip(()=>v?{value:0,label:"Weak"}:Dy(r),[r,v]),b=Ip(()=>!!(!r?.length||v),[v,r]);return xo(Jw,{children:[Mt(R,{onClose:a,closeable:o.initiatedBy==="user",backFn:l}),Mt(oe,{}),xo(mn,{children:[xo(yn,{children:[Mt(Yw,{height:48,width:48,stroke:"var(--privy-color-accent)"}),xo("h3",{style:{color:"var(--privy-color-foreground)"},children:[n?"Reset":"Set"," your password"]}),Mt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),xo(hn,{children:[Mt(la,{value:r,onChange:A=>s(A.target.value),onKeyUp:A=>{A.key==="Enter"&&i()},placeholder:"enter or generate a strong password",type:u?"password":"text",style:{paddingRight:"3.8rem"}}),xo(ca,{style:{width:"3.5rem"},children:[u?Mt(da,{onClick:()=>m(!1)}):Mt(pa,{onClick:()=>m(!0)}),Mt(Sy,{onClick:d})]})]}),Mt(Ay,{value:C.value===0?.01:C.value,label:C.label}),Mt(vc,{error:!!v,children:v||`Password Strength: ${f?C.label:"--"}`}),xo(Zw,{children:[Mt(Xw,{children:xo(ss,{children:[xo(ls,{children:[Mt(Uy,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),xo(ls,{children:[Mt(Uy,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),Mt(fn,{onClick:i,loading:t,disabled:b,hideAnimations:e,children:"Continue"})]})]}),Mt(ne,{}),Mt(G,{})]})},Xw=By(ss)`
1300
+ `;import Qw from"@heroicons/react/24/outline/KeyIcon";import Vy from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as Gy,useMemo as Op,useEffect as Xw}from"react";import qy from"styled-components";import Ww from"fast-password-entropy";import*as Oy from"secure-password-utilities";import{DEFAULT_WORDLIST as Lw}from"secure-password-utilities/wordlists";var Nw=95,Ow=8,Dw=3,Uw=.3,Fw=/[a-z]/,Bw=/[A-Z]/,Hw=/[0-9]/,Vw="a-zA-Z0-9",Dy="!@#$%^&*()\\-_+.",Uy=`${Vw}${Dy}`,Gw=new RegExp(`[${Dy}]`),qw=new RegExp(`[${Uy}]`),Fy=new RegExp(`^[${Uy}]{6,}$`),By=(e="")=>{let t=e.split("").filter(r=>!qw.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},wc=()=>Oy.generatePassphrase(4,Lw);function zw(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function Kw(e){if(e.length<Ow)return 0;let t=0;Fw.test(e)&&(t+=1),Bw.test(e)&&(t+=1),Hw.test(e)&&(t+=1),Gw.test(e)&&(t+=1);let r=t/Dw;return Math.max(0,Math.min(1,r))}function Yw(e=""){let t=Kw(e),r=Ww(e)/Nw;return(t*Uw+r)/2}function Hy(e=""){let t=Yw(e);return{value:t,label:zw(t)}}import{Fragment as jw,jsx as kt,jsxs as Po}from"react/jsx-runtime";var zy=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,isResettingPassword:n,onSubmit:i,onClose:a,onBack:l,onPasswordChange:s,onPasswordGenerate:d})=>{let[u,m]=Gy(!1),[f,y]=Gy(!1);Xw(()=>{r&&!f&&y(!0)},[r]);let E=Op(()=>f?(r?.length||0)<6?"Password must be at least 6 characters":Fy.test(r||"")?null:`Invalid characters used ( ${By(r).join(" ")} )`:null,[r,f]),C=Op(()=>E?{value:0,label:"Weak"}:Hy(r),[r,E]),w=Op(()=>!!(!r?.length||E),[E,r]);return Po(jw,{children:[kt(k,{onClose:a,closeable:o.initiatedBy==="user",backFn:l}),kt(te,{}),Po(fn,{children:[Po(gn,{children:[kt(Qw,{height:48,width:48,stroke:"var(--privy-color-accent)"}),Po("h3",{style:{color:"var(--privy-color-foreground)"},children:[n?"Reset":"Set"," your password"]}),kt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),Po(yn,{children:[kt(pa,{value:r,onChange:P=>s(P.target.value),onKeyUp:P=>{P.key==="Enter"&&i()},placeholder:"enter or generate a strong password",type:u?"password":"text",style:{paddingRight:"3.8rem"}}),Po(ua,{style:{width:"3.5rem"},children:[u?kt(ma,{onClick:()=>m(!1)}):kt(fa,{onClick:()=>m(!0)}),kt(Ry,{onClick:d})]})]}),kt(ky,{value:C.value===0?.01:C.value,label:C.label}),kt(Cc,{error:!!E,children:E||`Password Strength: ${f?C.label:"--"}`}),Po(Jw,{children:[kt(Zw,{children:Po(ls,{children:[Po(cs,{children:[kt(Vy,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),Po(cs,{children:[kt(Vy,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),kt(hn,{onClick:i,loading:t,disabled:w,hideAnimations:e,children:"Continue"})]})]}),kt(re,{}),kt(B,{})]})},Zw=qy(ls)`
1301
1301
  flex: 1;
1302
1302
  padding-top: 1rem;
1303
- `,Zw=By.div`
1303
+ `,Jw=qy.div`
1304
1304
  display: flex;
1305
1305
  flex-direction: column;
1306
1306
  height: 100%;
1307
- `;import jw from"@heroicons/react/24/outline/ArrowDownTrayIcon";import $w from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import e5 from"@heroicons/react/24/outline/DocumentDuplicateIcon";import t5 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as r5,useCallback as Vy}from"react";import{Fragment as Wp,jsx as cr,jsxs as ii}from"react/jsx-runtime";var Gy=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:i})=>{let[a,l]=r5(!1),s=Vy(()=>{l(!0),o&&navigator.clipboard.writeText(o)},[o]),d=Vy(()=>{let u=document.createElement("a"),m=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),f=new Blob([o5(r,o)],{type:"text/plain"}),g=URL.createObjectURL(f);u.href=g,u.target="_blank",u.download=`${m}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(g)},5e3)},[o]);return ii(Wp,{children:[cr(R,{backFn:i,closeable:!1}),cr(oe,{}),ii(mn,{children:[ii(yn,{children:[cr(t5,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),cr("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),cr("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),cr(hn,{centered:!0,children:cr(Ty,{children:o})}),ii("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[cr(_p,{onClick:s,children:a?ii(Wp,{children:[cr($w,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):ii(Wp,{children:[cr(e5,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),ii(_p,{onClick:d,children:[cr(jw,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),cr(fn,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),cr(ne,{}),cr(G,{})]})},o5=(e,t)=>`Your wallet recovery password for ${e} is
1307
+ `;import $w from"@heroicons/react/24/outline/ArrowDownTrayIcon";import e5 from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import t5 from"@heroicons/react/24/outline/DocumentDuplicateIcon";import r5 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{useState as o5,useCallback as Ky}from"react";import{Fragment as Dp,jsx as ar,jsxs as ci}from"react/jsx-runtime";var Yy=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:i})=>{let[a,l]=o5(!1),s=Ky(()=>{l(!0),o&&navigator.clipboard.writeText(o)},[o]),d=Ky(()=>{let u=document.createElement("a"),m=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),f=new Blob([n5(r,o)],{type:"text/plain"}),y=URL.createObjectURL(f);u.href=y,u.target="_blank",u.download=`${m}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(y)},5e3)},[o]);return ci(Dp,{children:[ar(k,{backFn:i,closeable:!1}),ar(te,{}),ci(fn,{children:[ci(gn,{children:[ar(r5,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),ar("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),ar("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),ar(yn,{centered:!0,children:ar(xy,{children:o})}),ci("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[ar(Lp,{onClick:s,children:a?ci(Dp,{children:[ar(e5,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):ci(Dp,{children:[ar(t5,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),ci(Lp,{onClick:d,children:[ar($w,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),ar(hn,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),ar(re,{}),ar(B,{})]})},n5=(e,t)=>`Your wallet recovery password for ${e} is
1308
1308
 
1309
1309
  ${t}
1310
1310
 
1311
- You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;import n5 from"@heroicons/react/24/solid/CheckCircleIcon";import i5 from"@heroicons/react/24/solid/XCircleIcon";import{Fragment as a5,jsx as Yo,jsxs as Lp}from"react/jsx-runtime";var qy=({error:e,onClose:t})=>Lp(a5,{children:[Yo(R,{closeable:!1}),Yo(oe,{}),e?Lp(Cr,{children:[Yo(i5,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),Yo(ve,{title:"Something went wrong",description:e})]}):Lp(Cr,{children:[Yo(n5,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),Yo(ve,{title:"Success"})]}),Yo(F,{onClick:t,children:"Close"}),Yo(ne,{}),Yo(G,{})]});import{useReducer as s5}from"react";var l5=(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}},zy=()=>{let[e,t]=s5(l5,"creating");return{send:t,state:e}};import{jsx as us}from"react/jsx-runtime";var Ec=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:o}=x(),{send:n,state:i}=zy(),a=Np(async()=>{i==="finalizing"&&await e(),n("next")},[i,n,e]);c5(()=>{let d;return i==="done"&&t.config.initiatedBy==="automatic"&&(d=setTimeout(()=>t.onClose?.(),We)),()=>{d&&clearTimeout(d)}},[i,t.config.initiatedBy,t.onClose]);let l=Np(()=>{n("back")},[n]),s=Np(()=>{o("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,o]);return i==="creating"?us(Hy,{...t,onSubmit:a,onBack:r==="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"?s:void 0}):i==="saving"?us(Gy,{...t,onSubmit:a,onBack:l}):i==="confirming"?us(Py,{...t,onSubmit:a,onBack:l}):i==="finalizing"?us(My,{...t,onSubmit:a,onBack:l}):i==="done"?us(qy,{...t,onSubmit:a}):null};import{jsx as p5}from"react/jsx-runtime";var Ky=()=>{let[e,t]=Tc(null),[r,o]=Tc(!1),[n,i]=Tc(null),[a,l]=Tc(""),{authenticated:s,getAccessToken:d,user:u}=K(),{walletProxy:m,refreshUser:f,closePrivyModal:g,createAnalyticsEvent:v}=L(),{app:C,navigate:b,data:A,onUserCloseViaDialogOrKeybindRef:_}=x(),{onSuccess:S,onFailure:P}=A.createWallet,E=Me(u),k=e?.recoveryMethod==="user-passcode",D=E?.recoveryMethod==="user-passcode";d5(()=>{s||(b("LANDING"),P(new Ku("User must be authenticated before setting a password on a Privy wallet")))},[s]);let H=()=>{if(n){P(n),g({shouldCallAuthOnSuccess:!1});return}if(!k){P(new fr("Exited before password was added to wallet")),g({shouldCallAuthOnSuccess:!1});return}S(e),g({shouldCallAuthOnSuccess:!1})};_.current=H;let M=async()=>{let W=await d();if(W&&E?.address&&a&&m)try{if(v({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:E.address,existingRecoveryMethod:E.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:D}}),!(await m.setRecovery({accessToken:W,address:E.address,recoveryPassword:a,recoveryMethod:"user-passcode"})).address){i(new fr("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:E.address,existingRecoveryMethod:E.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:D,reason:"error setting password"}});return}let Ce=await f(),q=Me(Ce);if(!q){i(new fr("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:E.address,existingRecoveryMethod:E.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:D,reason:"wallet disconnected"}});return}t(q),v({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:E.address,existingRecoveryMethod:E.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:D}})}catch(Y){console.warn(Y),i(Y instanceof Error?Y:new Error("Error setting password on privy wallet")),v({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:E.address,reason:Y}})}},X=async()=>{k?(S(e),g({shouldCallAuthOnSuccess:!1})):(o(!0),i(null),await M(),o(!1))};return p5(Ec,{appName:C?.name||"privy",config:{initiatedBy:"user",onCancel:H},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:X,onClose:H})};import u5 from"@heroicons/react/24/outline/UserCircleIcon";import m5 from"@heroicons/react/24/solid/LockClosedIcon";import{Fragment as f5,jsx as Qo,jsxs as Sc}from"react/jsx-runtime";var Yy=()=>{let{closePrivyModal:e}=L(),{data:t,setModalData:r,navigate:o,onUserCloseViaDialogOrKeybindRef:n}=x(),{onSuccess:i,onFailure:a}=t.setWalletPassword,l=()=>{a(new fr("Exited before password was added to wallet")),e({shouldCallAuthOnSuccess:!1})};return n.current=l,Sc(f5,{children:[Qo(R,{onClose:l}),Qo(oe,{}),Sc(Cr,{children:[Sc(Sh,{children:[Qo(u5,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),Qo(Ah,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:Qo(m5,{width:"12px",height:"12px",fill:"white"})})]}),Sc(ve,{title:"Secure Your Account",children:["Please set a password to secure your account.",Qo("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),Qo(F,{onClick:()=>{r({createWallet:{onFailure:a,onSuccess:i,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),o("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),Qo(ne,{}),Qo(G,{})]})};import h5 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import y5 from"@heroicons/react/24/outline/PhoneIcon";import Qy from"styled-components";import{Fragment as w5,jsx as qr,jsxs as Ac}from"react/jsx-runtime";var g5=(e,t)=>{let r=qr(h5,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof w)switch(e.privyErrorCode){case"client_request_timeout":return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:r};case"insufficient_balance":return{title:"Insufficient balance",detail:e.message,ctaText:"Try again",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}else{if(e instanceof Oe&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:qr(y5,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof jt)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:r};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:r};case"allowlist_rejected":return{title:t.errorTitle||"You don't have access to this app",detail:t.errorDetail||"Have you been invited?",ctaText:t.errorCtaText||"Try another account",icon:qr(rc,{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:qr("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:qr("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:r};case"not_supported":return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:r};case"too_many_requests":return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}else return e instanceof Mr&&e.status&&[400,422].includes(e.status)?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:r}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}},Xy=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=x(),i=r?.errorModalData?.previousScreen||(o===n?void 0:o);return qr(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}=Ae(),{app:n}=x(),i=g5(e,n.allowlistConfig),a=()=>{if(e instanceof jt&&(e.privyErrorCode==="invalid_captcha"&&o(),e.privyErrorCode==="allowlist_rejected"&&n.allowlistConfig.errorCtaLink)){window.location.href=n.allowlistConfig.errorCtaLink;return}r?.()};return Ac(w5,{children:[qr(R,{backFn:t}),Ac(C5,{children:[qr(je,{children:Ac("div",{children:[qr(tc,{color:"var(--privy-color-error)"}),i.icon]})}),Ac(v5,{children:[qr("h3",{children:i.title}),qr("p",{children:i.detail})]}),qr(F,{color:"var(--privy-color-error)",onClick:a,children:i.ctaText})]})]})},C5=Qy.div`
1311
+ You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;import i5 from"@heroicons/react/24/solid/CheckCircleIcon";import a5 from"@heroicons/react/24/solid/XCircleIcon";import{Fragment as s5,jsx as Yo,jsxs as Up}from"react/jsx-runtime";var Qy=({error:e,onClose:t})=>Up(s5,{children:[Yo(k,{closeable:!1}),Yo(te,{}),e?Up(fr,{children:[Yo(a5,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),Yo(ge,{title:"Something went wrong",description:e})]}):Up(fr,{children:[Yo(i5,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),Yo(ge,{title:"Success"})]}),Yo(F,{onClick:t,children:"Close"}),Yo(re,{}),Yo(B,{})]});import{useReducer as l5}from"react";var c5=(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}},Xy=()=>{let[e,t]=l5(c5,"creating");return{send:t,state:e}};import{jsx as ms}from"react/jsx-runtime";var bc=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:o}=R(),{send:n,state:i}=Xy(),a=Fp(async()=>{i==="finalizing"&&await e(),n("next")},[i,n,e]);d5(()=>{let d;return i==="done"&&t.config.initiatedBy==="automatic"&&(d=setTimeout(()=>t.onClose?.(),Ie)),()=>{d&&clearTimeout(d)}},[i,t.config.initiatedBy,t.onClose]);let l=Fp(()=>{n("back")},[n]),s=Fp(()=>{o("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,o]);return i==="creating"?ms(zy,{...t,onSubmit:a,onBack:r==="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"?s:void 0}):i==="saving"?ms(Yy,{...t,onSubmit:a,onBack:l}):i==="confirming"?ms(_y,{...t,onSubmit:a,onBack:l}):i==="finalizing"?ms(Ny,{...t,onSubmit:a,onBack:l}):i==="done"?ms(Qy,{...t,onSubmit:a}):null};import{jsx as u5}from"react/jsx-runtime";var Zy=()=>{let[e,t]=Ec(null),[r,o]=Ec(!1),[n,i]=Ec(null),[a,l]=Ec(""),{authenticated:s,getAccessToken:d,user:u}=V(),{walletProxy:m,refreshUser:f,closePrivyModal:y,createAnalyticsEvent:E}=M(),{app:C,navigate:w,data:P,onUserCloseViaDialogOrKeybindRef:_}=R(),{onSuccess:T,onFailure:A}=P.createWallet,S=Ue(u),I=e?.recoveryMethod==="user-passcode",N=S?.recoveryMethod==="user-passcode";p5(()=>{s||(w("LANDING"),A(new Xu("User must be authenticated before setting a password on a Privy wallet")))},[s]);let H=()=>{if(n){A(n),y({shouldCallAuthOnSuccess:!1});return}if(!I){A(new dr("Exited before password was added to wallet")),y({shouldCallAuthOnSuccess:!1});return}T(e),y({shouldCallAuthOnSuccess:!1})};_.current=H;let x=async()=>{let W=await d();if(W&&S?.address&&a&&m)try{if(E({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:S.address,existingRecoveryMethod:S.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:N}}),!(await m.setRecovery({accessToken:W,address:S.address,recoveryPassword:a,recoveryMethod:"user-passcode"})).address){i(new dr("Error setting password on privy wallet")),E({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:S.address,existingRecoveryMethod:S.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:N,reason:"error setting password"}});return}let de=await f(),q=Ue(de);if(!q){i(new dr("Error setting password on privy wallet")),E({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:S.address,existingRecoveryMethod:S.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:N,reason:"wallet disconnected"}});return}t(q),E({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:S.address,existingRecoveryMethod:S.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:N}})}catch(Q){console.warn(Q),i(Q instanceof Error?Q:new Error("Error setting password on privy wallet")),E({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:S.address,reason:Q}})}},K=async()=>{I?(T(e),y({shouldCallAuthOnSuccess:!1})):(o(!0),i(null),await x(),o(!1))};return u5(bc,{appName:C?.name||"privy",config:{initiatedBy:"user",onCancel:H},error:n?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:a,isResettingPassword:N,onPasswordGenerate:()=>l(wc()),onPasswordChange:l,onSubmit:K,onClose:H})};import m5 from"@heroicons/react/24/outline/UserCircleIcon";import f5 from"@heroicons/react/24/solid/LockClosedIcon";import{Fragment as h5,jsx as Qo,jsxs as Tc}from"react/jsx-runtime";var Jy=()=>{let{closePrivyModal:e}=M(),{data:t,setModalData:r,navigate:o,onUserCloseViaDialogOrKeybindRef:n}=R(),{onSuccess:i,onFailure:a}=t.setWalletPassword,l=()=>{a(new dr("Exited before password was added to wallet")),e({shouldCallAuthOnSuccess:!1})};return n.current=l,Tc(h5,{children:[Qo(k,{onClose:l}),Qo(te,{}),Tc(fr,{children:[Tc(xh,{children:[Qo(m5,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),Qo(Rh,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:Qo(f5,{width:"12px",height:"12px",fill:"white"})})]}),Tc(ge,{title:"Secure Your Account",children:["Please set a password to secure your account.",Qo("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),Qo(F,{onClick:()=>{r({createWallet:{onFailure:a,onSuccess:i,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),o("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),Qo(re,{}),Qo(B,{})]})};import y5 from"@heroicons/react/24/outline/ExclamationTriangleIcon";import g5 from"@heroicons/react/24/outline/PhoneIcon";import jy from"styled-components";import{Fragment as b5,jsx as Br,jsxs as Sc}from"react/jsx-runtime";var C5=(e,t)=>{let r=Br(y5,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof v)switch(e.privyErrorCode){case"client_request_timeout":return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:r};case"insufficient_balance":return{title:"Insufficient balance",detail:e.message,ctaText:"Try again",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}else{if(e instanceof Le&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:Br(g5,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof Zt)switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:r};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:r};case"allowlist_rejected":return{title:t.errorTitle||"You don't have access to this app",detail:t.errorDetail||"Have you been invited?",ctaText:t.errorCtaText||"Try another account",icon:Br(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:Br("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:Br("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:r};case"not_supported":return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:r};case"too_many_requests":return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}else return e instanceof xr&&e.status&&[400,422].includes(e.status)?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:r}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}},$y=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=R(),i=r?.errorModalData?.previousScreen||(o===n?void 0:o);return Br(di,{error:r?.errorModalData?.error||new Error,backFn:()=>i?e(i,!1):t(),onClick:()=>e(i||"LANDING",!1)})},di=({error:e,backFn:t,onClick:r})=>{let{reset:o}=Ee(),{app:n}=R(),i=C5(e,n.allowlistConfig),a=()=>{if(e instanceof Zt&&(e.privyErrorCode==="invalid_captcha"&&o(),e.privyErrorCode==="allowlist_rejected"&&n.allowlistConfig.errorCtaLink)){window.location.href=n.allowlistConfig.errorCtaLink;return}r?.()};return Sc(b5,{children:[Br(k,{backFn:t}),Sc(v5,{children:[Br(tt,{children:Sc("div",{children:[Br(ec,{color:"var(--privy-color-error)"}),i.icon]})}),Sc(w5,{children:[Br("h3",{children:i.title}),Br("p",{children:i.detail})]}),Br(F,{color:"var(--privy-color-error)",onClick:a,children:i.ctaText})]})]})},v5=jy.div`
1312
1312
  display: flex;
1313
1313
  flex-direction: column;
1314
1314
  align-items: center;
@@ -1316,11 +1316,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1316
1316
  gap: 24px;
1317
1317
  width: 100%;
1318
1318
  padding-bottom: 16px;
1319
- `,v5=Qy.div`
1319
+ `,w5=jy.div`
1320
1320
  display: flex;
1321
1321
  flex-direction: column;
1322
1322
  gap: 8px;
1323
- `;import{useEffect as tg,useRef as B5,useState as Dp}from"react";import{isIOS as H5,isMobile as rg}from"react-device-detect";import ig from"styled-components";import{useState as b5}from"react";import E5 from"styled-components";import{jsx as Zy}from"react/jsx-runtime";var ua=({style:e,color:t,...r})=>Zy("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:Zy("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});import{jsx as Jy,jsxs as S5}from"react/jsx-runtime";var gn=e=>{let[t,r]=b5(!1);return S5(T5,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?Jy(ua,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):Jy(km,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},T5=E5.button`
1323
+ `;import{useEffect as ig,useRef as H5,useState as Hp}from"react";import{isIOS as V5,isMobile as ag}from"react-device-detect";import cg from"styled-components";import{useState as E5}from"react";import T5 from"styled-components";import{jsx as eg}from"react/jsx-runtime";var ha=({style:e,color:t,...r})=>eg("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:eg("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});import{jsx as tg,jsxs as P5}from"react/jsx-runtime";var Cn=e=>{let[t,r]=E5(!1);return P5(S5,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?tg(ha,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):tg(Mm,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},S5=T5.button`
1324
1324
  display: flex;
1325
1325
  align-items: center;
1326
1326
  gap: 6px;
@@ -1358,7 +1358,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1358
1358
  width: 14px;
1359
1359
  height: 14px;
1360
1360
  }
1361
- `;import{useState as A5}from"react";import P5 from"styled-components";import{jsx as R5}from"react/jsx-runtime";var Pc=e=>{let[t,r]=A5(!1);return R5(x5,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},x5=P5.a`
1361
+ `;import{useState as A5}from"react";import x5 from"styled-components";import{jsx as k5}from"react/jsx-runtime";var Pc=e=>{let[t,r]=A5(!1);return k5(R5,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},R5=x5.a`
1362
1362
  display: flex;
1363
1363
  align-items: center;
1364
1364
  gap: 6px;
@@ -1396,7 +1396,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1396
1396
  width: 14px;
1397
1397
  height: 14px;
1398
1398
  }
1399
- `;import k5 from"qrcode";import _5 from"react";import M5 from"styled-components";import{jsx as jy}from"react/jsx-runtime";var $y=()=>jy("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:jy("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});import{Fragment as ms,jsx as Ht,jsxs as eg}from"react/jsx-runtime";var Er=7,Op=(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},I5=(e,t)=>{let r=k5.create(e,{errorCorrectionLevel:t}).modules,o=Qu(Array.from(r.data),r.size);return o=Op(o,0,0,Er,Er),o=Op(o,o.length-Er,0,Er,Er),o=Op(o,0,o.length-Er,Er,Er),o},W5=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>Ht(ms,{children:[0,1,2].map(i=>Ht("circle",{r:r*(Er-i*2)/2,cx:e+r*Er/2,cy:t+r*Er/2,fill:i%2!==0?o:n},`finder-${e}-${t}-${i}`))}),L5=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-Er)*e,0],[0,(t-Er)*e]];return Ht(ms,{children:n.map(([i,a])=>Ht(W5,{x:i,y:a,cellSize:e,bgColor:r,fgColor:o},`finder-${i}-${a}`))})},N5=({matrix:e,cellSize:t,color:r})=>Ht(ms,{children:e.map((i,a)=>i.map((l,s)=>l?Ht("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}`):Ht(_5.Fragment,{},`circle-${a}-${s}`)))}),O5=({cellSize:e,matrixSize:t,element:r,sizePercentage:o,bgColor:n})=>{if(!r)return Ht(ms,{});let i=t*(o||.14),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,d=.1,u=s-s*d*2,m=r,f=a*e;return eg(ms,{children:[Ht("rect",{x:a*e,y:a*e,width:s,height:s,fill:n}),Ht(m,{x:f+s*d,y:f+s*d,height:u,width:u})]})},D5=e=>{let t=e.outputSize,r=I5(e.url,e.errorCorrectionLevel),o=t/r.length,n=em(o*2,{min:t*.025,max:t*.036});return eg("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%",padding:`${n}px`},children:[Ht(N5,{matrix:r,cellSize:o,color:e.fgColor}),Ht(L5,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),Ht(O5,{cellSize:o,element:e.logo?.element,bgColor:e.bgColor,matrixSize:r.length})]})},U5=M5.div`
1399
+ `;import _5 from"qrcode";import I5 from"react";import M5 from"styled-components";import{jsx as rg}from"react/jsx-runtime";var og=()=>rg("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:rg("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});import{Fragment as fs,jsx as Ft,jsxs as ng}from"react/jsx-runtime";var Cr=7,Bp=(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},W5=(e,t)=>{let r=_5.create(e,{errorCorrectionLevel:t}).modules,o=Ju(Array.from(r.data),r.size);return o=Bp(o,0,0,Cr,Cr),o=Bp(o,o.length-Cr,0,Cr,Cr),o=Bp(o,0,o.length-Cr,Cr,Cr),o},L5=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>Ft(fs,{children:[0,1,2].map(i=>Ft("circle",{r:r*(Cr-i*2)/2,cx:e+r*Cr/2,cy:t+r*Cr/2,fill:i%2!==0?o:n},`finder-${e}-${t}-${i}`))}),N5=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-Cr)*e,0],[0,(t-Cr)*e]];return Ft(fs,{children:n.map(([i,a])=>Ft(L5,{x:i,y:a,cellSize:e,bgColor:r,fgColor:o},`finder-${i}-${a}`))})},O5=({matrix:e,cellSize:t,color:r})=>Ft(fs,{children:e.map((i,a)=>i.map((l,s)=>l?Ft("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}`):Ft(I5.Fragment,{},`circle-${a}-${s}`)))}),D5=({cellSize:e,matrixSize:t,element:r,sizePercentage:o,bgColor:n})=>{if(!r)return Ft(fs,{});let i=t*(o||.14),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,d=.1,u=s-s*d*2,m=r,f=a*e;return ng(fs,{children:[Ft("rect",{x:a*e,y:a*e,width:s,height:s,fill:n}),Ft(m,{x:f+s*d,y:f+s*d,height:u,width:u})]})},U5=e=>{let t=e.outputSize,r=W5(e.url,e.errorCorrectionLevel),o=t/r.length,n=om(o*2,{min:t*.025,max:t*.036});return ng("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%",padding:`${n}px`},children:[Ft(O5,{matrix:r,cellSize:o,color:e.fgColor}),Ft(N5,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),Ft(D5,{cellSize:o,element:e.logo?.element,bgColor:e.bgColor,matrixSize:r.length})]})},F5=M5.div`
1400
1400
  display: flex;
1401
1401
  justify-content: center;
1402
1402
  align-items: center;
@@ -1410,7 +1410,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1410
1410
  border-color: ${e=>e.borderColor};
1411
1411
  border-radius: var(--privy-border-radius-md);
1412
1412
  }
1413
- `,Cn=e=>{let{appearance:t}=Le(),r=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",n=e.size||160,i=t.palette.colorScheme==="dark"?r:o;return Ht(U5,{size:n,bgColor:r,fgColor:o,borderColor:i,children:Ht(D5,{url:e.url,logo:{element:e.squareLogoElement??$y},outputSize:n,bgColor:r,fgColor:o,errorCorrectionLevel:e.errorCorrectionLevel||"Q"})})};import{jsx as xc,jsxs as F5}from"react/jsx-runtime";var Ro=({style:e,...t})=>F5("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:[xc("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),xc("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"}),xc("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"}),xc("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});import{Fragment as Rc,jsx as Ie,jsxs as ko}from"react/jsx-runtime";var og="#8a63d2",ag=1e3,V5=ag*2,G5=ag*120,sg=()=>{let{authenticated:e,logout:t,ready:r,user:o}=K(),{lastScreen:n,navigate:i,navigateBack:a,setModalData:l,app:s}=x(),{getAuthFlow:d,loginWithFarcaster:u,closePrivyModal:m,createAnalyticsEvent:f}=L(),[g,v]=Dp(void 0),[C,b]=Dp(!1),[A,_]=Dp(!1),S=B5([]),P=We,E=d(),k=E?.meta.connectUri;return tg(()=>{let D=Date.now(),H=setInterval(async()=>{let M=await E.pollForReady.execute(),X=Date.now()-D;if(M){clearInterval(H),b(!0);try{await u(),_(!0)}catch(W){let Y={retryable:!1,message:"Authentication failed"};if(W?.privyErrorCode==="allowlist_rejected"){i("ALLOWLIST_REJECTION_SCREEN");return}else if(W?.privyErrorCode==="max_accounts_reached"){console.error(new fo(W).toString()),i("USER_LIMIT_REACHED_SCREEN");return}else if(W?.privyErrorCode==="user_does_not_exist"){i("ACCOUNT_NOT_FOUND_SCREEN");return}else W?.privyErrorCode==="linked_to_another_user"?Y.detail="This account has already been linked to another user.":W?.privyErrorCode==="invalid_credentials"?(Y.retryable=!0,Y.detail="Something went wrong. Try again."):W?.privyErrorCode==="too_many_requests"&&(Y.detail="Too many requests. Please wait before trying again.");v(Y)}}else X>G5&&(clearInterval(H),v({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},V5);return()=>{clearInterval(H),S.current.forEach(M=>clearTimeout(M))}},[]),tg(()=>{if(r&&e&&A&&o){if(s?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let H=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},P);return()=>clearTimeout(H)}A&&(Et(o,s?.embeddedWallets.createOnLogin)?S.current.push(setTimeout(()=>{l({createWallet:{onSuccess:()=>{},onFailure:H=>{console.error(H),f({eventName:"embedded_wallet_creation_failure_logout",payload:{error:H,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},P)):S.current.push(setTimeout(()=>m({shouldCallAuthOnSuccess:!0,isSuccess:!0}),P)))}},[A,r,e,o]),rg||C?ko(Rc,{children:[Ie(R,{backFn:n?a:void 0,onClose:m},"header"),Ie(oe,{}),H5?Ie(Rc,{children:ko(q5,{children:[Ie(je,{children:ko("div",{children:[Ie(it,{success:A,fail:!!g}),Ie(Ro,{style:{width:"38px",height:"38px"}})]})}),ko(Qe,{children:[Ie(fe,{children:g?g.message:"Sign in with Farcaster"}),Ie(ye,{children:g?g.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),k&&Ie(F,{onClick:D=>{D.preventDefault(),window.location.href=k},children:"Open Warpcast app"})]})}):Ie(Rc,{children:ko(ng,{children:[Ie(je,{children:ko("div",{children:[Ie(it,{success:A,fail:!!g}),Ie(Ro,{style:{width:"38px",height:"38px"}})]})}),ko(Qe,{children:[Ie(fe,{children:g?g.message:"Signing in with Farcaster"}),Ie(ye,{children:g?g.detail:"This should only take a moment"}),Ie(St,{children:k&&rg&&Ie(Pc,{text:"Take me to Warpcast",url:k,color:og})})]})]})}),Ie(Z,{})]}):ko(Rc,{children:[Ie(R,{backFn:n?a:void 0,onClose:m},"header"),Ie(oe,{}),Ie(ng,{children:ko("div",{children:[Ie(fe,{children:"Sign in with Farcaster"}),Ie(ye,{children:"Scan with your phone's camera to continue."}),Ie(Qi,{children:k?Ie(Cn,{url:k,size:275,squareLogoElement:Ro}):Ie(at,{})}),ko(St,{children:[Ie(ye,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),k&&Ie(gn,{text:k,itemName:"link",color:og})]})]})}),Ie(Z,{})]})},ng=ig.div`
1413
+ `,vn=e=>{let{appearance:t}=Me(),r=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",n=e.size||160,i=t.palette.colorScheme==="dark"?r:o;return Ft(F5,{size:n,bgColor:r,fgColor:o,borderColor:i,children:Ft(U5,{url:e.url,logo:{element:e.squareLogoElement??og},outputSize:n,bgColor:r,fgColor:o,errorCorrectionLevel:e.errorCorrectionLevel||"Q"})})};import{jsx as Ac,jsxs as B5}from"react/jsx-runtime";var Ao=({style:e,...t})=>B5("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:[Ac("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),Ac("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"}),Ac("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"}),Ac("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});import{Fragment as xc,jsx as ke,jsxs as xo}from"react/jsx-runtime";var sg="#8a63d2",dg=1e3,G5=dg*2,q5=dg*120,pg=()=>{let{authenticated:e,logout:t,ready:r,user:o}=V(),{lastScreen:n,navigate:i,navigateBack:a,setModalData:l,app:s}=R(),{getAuthFlow:d,loginWithFarcaster:u,closePrivyModal:m,createAnalyticsEvent:f}=M(),[y,E]=Hp(void 0),[C,w]=Hp(!1),[P,_]=Hp(!1),T=H5([]),A=Ie,S=d(),I=S?.meta.connectUri;return ig(()=>{let N=Date.now(),H=setInterval(async()=>{let x=await S.pollForReady.execute(),K=Date.now()-N;if(x){clearInterval(H),w(!0);try{await u(),_(!0)}catch(W){let Q={retryable:!1,message:"Authentication failed"};if(W?.privyErrorCode==="allowlist_rejected"){i("ALLOWLIST_REJECTION_SCREEN");return}else if(W?.privyErrorCode==="max_accounts_reached"){console.error(new uo(W).toString()),i("USER_LIMIT_REACHED_SCREEN");return}else if(W?.privyErrorCode==="user_does_not_exist"){i("ACCOUNT_NOT_FOUND_SCREEN");return}else W?.privyErrorCode==="linked_to_another_user"?Q.detail="This account has already been linked to another user.":W?.privyErrorCode==="invalid_credentials"?(Q.retryable=!0,Q.detail="Something went wrong. Try again."):W?.privyErrorCode==="too_many_requests"&&(Q.detail="Too many requests. Please wait before trying again.");E(Q)}}else K>q5&&(clearInterval(H),E({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},G5);return()=>{clearInterval(H),T.current.forEach(x=>clearTimeout(x))}},[]),ig(()=>{if(r&&e&&P&&o){if(s?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let H=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},A);return()=>clearTimeout(H)}P&&(vt(o,s?.embeddedWallets.createOnLogin)?T.current.push(setTimeout(()=>{l({createWallet:{onSuccess:()=>{},onFailure:H=>{console.error(H),f({eventName:"embedded_wallet_creation_failure_logout",payload:{error:H,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},A)):T.current.push(setTimeout(()=>m({shouldCallAuthOnSuccess:!0,isSuccess:!0}),A)))}},[P,r,e,o]),ag||C?xo(xc,{children:[ke(k,{backFn:n?a:void 0,onClose:m},"header"),ke(te,{}),V5?ke(xc,{children:xo(z5,{children:[ke(tt,{children:xo("div",{children:[ke(at,{success:P,fail:!!y}),ke(Ao,{style:{width:"38px",height:"38px"}})]})}),xo(Je,{children:[ke(ue,{children:y?y.message:"Sign in with Farcaster"}),ke(fe,{children:y?y.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),I&&ke(F,{onClick:N=>{N.preventDefault(),window.location.href=I},children:"Open Warpcast app"})]})}):ke(xc,{children:xo(lg,{children:[ke(tt,{children:xo("div",{children:[ke(at,{success:P,fail:!!y}),ke(Ao,{style:{width:"38px",height:"38px"}})]})}),xo(Je,{children:[ke(ue,{children:y?y.message:"Signing in with Farcaster"}),ke(fe,{children:y?y.detail:"This should only take a moment"}),ke(Et,{children:I&&ag&&ke(Pc,{text:"Take me to Warpcast",url:I,color:sg})})]})]})}),ke(J,{})]}):xo(xc,{children:[ke(k,{backFn:n?a:void 0,onClose:m},"header"),ke(te,{}),ke(lg,{children:xo("div",{children:[ke(ue,{children:"Sign in with Farcaster"}),ke(fe,{children:"Scan with your phone's camera to continue."}),ke(ji,{children:I?ke(vn,{url:I,size:275,squareLogoElement:Ao}):ke(st,{})}),xo(Et,{children:[ke(fe,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),I&&ke(Cn,{text:I,itemName:"link",color:sg})]})]})}),ke(J,{})]})},lg=cg.div`
1414
1414
  display: flex;
1415
1415
  flex-direction: column;
1416
1416
  align-items: center;
@@ -1418,14 +1418,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
1418
1418
  margin-left: 27px;
1419
1419
  margin-right: 27px;
1420
1420
  gap: 24px;
1421
- `,q5=ig.div`
1421
+ `,z5=cg.div`
1422
1422
  display: flex;
1423
1423
  flex-direction: column;
1424
1424
  align-items: center;
1425
1425
  justify-content: center;
1426
1426
  gap: 24px;
1427
1427
  width: 100%;
1428
- `;import{useEffect as z5,useRef as K5,useState as Up}from"react";import{isIOS as Y5,isMobile as lg}from"react-device-detect";import pg from"styled-components";import{Fragment as kc,jsx as De,jsxs as io}from"react/jsx-runtime";var cg="#8a63d2",ug=1e3,Q5=ug*2,X5=ug*300,mg=()=>{let{lastScreen:e,navigateBack:t,data:r,app:o}=x(),{requestFarcasterSignerStatus:n,closePrivyModal:i}=L(),[a,l]=Up(void 0),[s,d]=Up(!1),[u,m]=Up(!1),f=K5([]),g=We,v=r?.farcasterSigner;z5(()=>{let b=Date.now(),A=setInterval(async()=>{if(!v?.public_key){clearInterval(A),l({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}v.status==="approved"&&(clearInterval(A),d(!1),m(!0),f.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),g)));let _=await n(v?.public_key),S=Date.now()-b;_.status==="approved"?(clearInterval(A),d(!1),m(!0),f.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),g))):S>X5?(clearInterval(A),l({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):_.status==="revoked"&&(clearInterval(A),l({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},Q5);return()=>{clearInterval(A),f.current.forEach(_=>clearTimeout(_))}},[]);let C=v?.status==="pending_approval"?v.signer_approval_url:void 0;return lg||s?io(kc,{children:[De(R,{backFn:e?t:void 0,onClose:i},"header"),De(oe,{}),Y5?De(kc,{children:io(Z5,{children:[De(je,{children:io("div",{children:[De(it,{success:u,fail:!!a}),De(Ro,{style:{width:"38px",height:"38px"}})]})}),io(Qe,{children:[De(fe,{children:a?a.message:"Add a signer to Farcaster"}),De(ye,{children:a?a.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),C&&De(F,{onClick:b=>{b.preventDefault(),window.location.href=C},children:"Open Warpcast app"})]})}):De(kc,{children:io(dg,{children:[De(je,{children:io("div",{children:[De(it,{success:u,fail:!!a}),De(Ro,{style:{width:"38px",height:"38px"}})]})}),io(Qe,{children:[De(fe,{children:a?a.message:"Requesting signer from Farcaster"}),De(ye,{children:a?a.detail:"This should only take a moment"}),De(St,{children:C&&lg&&De(Pc,{text:"Take me to Warpcast",url:C,color:cg})})]})]})}),De(Z,{})]}):io(kc,{children:[De(R,{backFn:e?t:void 0,onClose:i},"header"),De(oe,{}),De(dg,{children:io("div",{children:[De(fe,{children:"Add a signer to Farcaster"}),io(ye,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),De(Qi,{children:v?.status==="pending_approval"?De(Cn,{url:v.signer_approval_url,size:275,squareLogoElement:Ro}):De(at,{})}),io(St,{children:[De(ye,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),v?.status==="pending_approval"&&De(gn,{text:v.signer_approval_url,itemName:"link",color:cg})]})]})}),De(Z,{})]})},dg=pg.div`
1428
+ `;import{useEffect as K5,useRef as Y5,useState as Vp}from"react";import{isIOS as Q5,isMobile as ug}from"react-device-detect";import hg from"styled-components";import{Fragment as Rc,jsx as Ne,jsxs as oo}from"react/jsx-runtime";var mg="#8a63d2",yg=1e3,X5=yg*2,Z5=yg*300,gg=()=>{let{lastScreen:e,navigateBack:t,data:r,app:o}=R(),{requestFarcasterSignerStatus:n,closePrivyModal:i}=M(),[a,l]=Vp(void 0),[s,d]=Vp(!1),[u,m]=Vp(!1),f=Y5([]),y=Ie,E=r?.farcasterSigner;K5(()=>{let w=Date.now(),P=setInterval(async()=>{if(!E?.public_key){clearInterval(P),l({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}E.status==="approved"&&(clearInterval(P),d(!1),m(!0),f.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),y)));let _=await n(E?.public_key),T=Date.now()-w;_.status==="approved"?(clearInterval(P),d(!1),m(!0),f.current.push(setTimeout(()=>i({shouldCallAuthOnSuccess:!1,isSuccess:!0}),y))):T>Z5?(clearInterval(P),l({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):_.status==="revoked"&&(clearInterval(P),l({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},X5);return()=>{clearInterval(P),f.current.forEach(_=>clearTimeout(_))}},[]);let C=E?.status==="pending_approval"?E.signer_approval_url:void 0;return ug||s?oo(Rc,{children:[Ne(k,{backFn:e?t:void 0,onClose:i},"header"),Ne(te,{}),Q5?Ne(Rc,{children:oo(J5,{children:[Ne(tt,{children:oo("div",{children:[Ne(at,{success:u,fail:!!a}),Ne(Ao,{style:{width:"38px",height:"38px"}})]})}),oo(Je,{children:[Ne(ue,{children:a?a.message:"Add a signer to Farcaster"}),Ne(fe,{children:a?a.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),C&&Ne(F,{onClick:w=>{w.preventDefault(),window.location.href=C},children:"Open Warpcast app"})]})}):Ne(Rc,{children:oo(fg,{children:[Ne(tt,{children:oo("div",{children:[Ne(at,{success:u,fail:!!a}),Ne(Ao,{style:{width:"38px",height:"38px"}})]})}),oo(Je,{children:[Ne(ue,{children:a?a.message:"Requesting signer from Farcaster"}),Ne(fe,{children:a?a.detail:"This should only take a moment"}),Ne(Et,{children:C&&ug&&Ne(Pc,{text:"Take me to Warpcast",url:C,color:mg})})]})]})}),Ne(J,{})]}):oo(Rc,{children:[Ne(k,{backFn:e?t:void 0,onClose:i},"header"),Ne(te,{}),Ne(fg,{children:oo("div",{children:[Ne(ue,{children:"Add a signer to Farcaster"}),oo(fe,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),Ne(ji,{children:E?.status==="pending_approval"?Ne(vn,{url:E.signer_approval_url,size:275,squareLogoElement:Ao}):Ne(st,{})}),oo(Et,{children:[Ne(fe,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),E?.status==="pending_approval"&&Ne(Cn,{text:E.signer_approval_url,itemName:"link",color:mg})]})]})}),Ne(J,{})]})},fg=hg.div`
1429
1429
  display: flex;
1430
1430
  flex-direction: column;
1431
1431
  align-items: center;
@@ -1433,14 +1433,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
1433
1433
  margin-left: 27px;
1434
1434
  margin-right: 27px;
1435
1435
  gap: 24px;
1436
- `,Z5=pg.div`
1436
+ `,J5=hg.div`
1437
1437
  display: flex;
1438
1438
  flex-direction: column;
1439
1439
  align-items: center;
1440
1440
  justify-content: center;
1441
1441
  gap: 24px;
1442
1442
  width: 100%;
1443
- `;import j6 from"@heroicons/react/24/outline/CheckCircleIcon";import{useEffect as vn,useState as zt}from"react";import{createPublicClient as o1,createWalletClient as $6,custom as e7,encodeFunctionData as t7,http as n1,parseEther as r7,publicActions as o7}from"viem";import{jsx as J5}from"react/jsx-runtime";function It({title:e}){let{currentScreen:t,navigateBack:r,navigate:o,data:n}=x(),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,J5(R,{title:e,backFn:i})}import _c from"styled-components";import{jsx as Fp,jsxs as r6}from"react/jsx-runtime";var ma=({size:e})=>Fp(j5,{$size:e,children:r6($5,{children:[Fp(e6,{}),Fp(t6,{})]})}),j5=_c.div`
1443
+ `;import $6 from"@heroicons/react/24/outline/CheckCircleIcon";import{useEffect as wn,useState as Gt}from"react";import{createPublicClient as s1,createWalletClient as e7,custom as t7,encodeFunctionData as r7,http as l1,parseEther as o7,publicActions as n7}from"viem";import{jsx as j5}from"react/jsx-runtime";function _t({title:e}){let{currentScreen:t,navigateBack:r,navigate:o,data:n}=R(),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,j5(k,{title:e,backFn:i})}import kc from"styled-components";import{jsx as Gp,jsxs as o6}from"react/jsx-runtime";var ya=({size:e})=>Gp($5,{$size:e,children:o6(e6,{children:[Gp(t6,{}),Gp(r6,{})]})}),$5=kc.div`
1444
1444
  --spinner-size: ${e=>e.$size?e.$size:"96px"};
1445
1445
 
1446
1446
  display: flex;
@@ -1451,14 +1451,14 @@ You will need this password to access your ${e} wallet on a new device. Please k
1451
1451
  @media all and (display-mode: standalone) {
1452
1452
  margin-bottom: 30px;
1453
1453
  }
1454
- `,$5=_c.div`
1454
+ `,e6=kc.div`
1455
1455
  position: relative;
1456
1456
  height: var(--spinner-size);
1457
1457
  width: var(--spinner-size);
1458
1458
 
1459
1459
  opacity: 1;
1460
1460
  animation: fadein 200ms ease;
1461
- `,e6=_c.div`
1461
+ `,t6=kc.div`
1462
1462
  position: absolute;
1463
1463
  top: 0;
1464
1464
  right: 0;
@@ -1471,7 +1471,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1471
1471
  border: 4px solid #f1f2f9;
1472
1472
  border-radius: 50%;
1473
1473
  }
1474
- `,t6=_c.div`
1474
+ `,r6=kc.div`
1475
1475
  position: absolute;
1476
1476
  top: 0;
1477
1477
  right: 0;
@@ -1495,22 +1495,22 @@ You will need this password to access your ${e} wallet on a new device. Please k
1495
1495
  transform: rotate(360deg);
1496
1496
  }
1497
1497
  }
1498
- `;function o6(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function Mc(e){let t=e.filter(r=>!Cm.has(r.id));return zd.concat(t)}import{useState as Bp,useEffect as n6}from"react";var _o=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=L(),[n,i]=Bp(!0),[a,l]=Bp(void 0),[s,d]=Bp(void 0);return n6(()=>{let u=e.chainId||Fo,f=Mc(o).find(v=>v.id===Number(u));(async()=>{if(!t){i(!1);return}if(!f){i(!1),l(new Error(`Unable to fetch token price on chain id ${u}`));return}try{i(!0);let v=await r(f);v?d(v):l(new Error(`Unable to fetch token price on chain id ${f.id}`))}catch(v){l(v)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};var fs=[{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}];var Ic=({amount:e,decimals:t})=>Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(e/10n**BigInt(t));var fg="0x0000000000000000000000000000000000000000",hg=({destinationCurrency:e,...t})=>({tradeType:"EXACT_OUTPUT",originCurrency:fg,destinationCurrency:e??fg,...t}),i6="https://api.testnets.relay.link/execute/swap",a6="https://api.relay.link/execute/swap",yg=async({input:e,isTestnet:t})=>{let r=await fetch(t?i6:a6,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),o=await r.json();if(!r.ok&&(typeof o.message!="string"||!o.message.startsWith("Invalid address")))throw console.error("Relay error:",o),new Error(o.message??"Error fetching quote from relay");return o},gg=e=>{let t=e.steps[0]?.items?.[0];if(t)return{from:t.data.from,to:t.data.to,value:Number(t.data.value),chainId:Number(t.data.chainId),data:t.data.data}};import{createPublicClient as s6,http as l6}from"viem";var Cg=({chains:e,appId:t,address:r,rpcConfig:o})=>Promise.all(e.map(async n=>({balance:await s6({chain:n,transport:l6(Uo(n,o,t))}).getBalance({address:r}).catch(()=>0n),chain:n})));import{createPublicClient as c6,http as d6}from"viem";var vg=async({chain:e,address:t,appId:r,rpcConfig:o,erc20Address:n})=>({balance:await c6({chain:e,transport:d6(Uo(e,o,r))}).readContract({address:n,abi:p6,functionName:"balanceOf",args:[t]}).catch(()=>0n),chain:e}),p6=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];import wg from"styled-components";var Wc=wg.span`
1498
+ `;function n6(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function _c(e){let t=e.filter(r=>!bm.has(r.id));return Zd.concat(t)}import{useState as qp,useEffect as i6}from"react";var Ro=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=M(),[n,i]=qp(!0),[a,l]=qp(void 0),[s,d]=qp(void 0);return i6(()=>{let u=e.chainId||Uo,f=_c(o).find(E=>E.id===Number(u));(async()=>{if(!t){i(!1);return}if(!f){i(!1),l(new Error(`Unable to fetch token price on chain id ${u}`));return}try{i(!0);let E=await r(f);E?d(E):l(new Error(`Unable to fetch token price on chain id ${f.id}`))}catch(E){l(E)}finally{i(!1)}})()},[e.chainId]),{tokenPrice:s,isTokenPriceLoading:n,tokenPriceError:a}};var hs=[{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}];var Ic=({amount:e,decimals:t})=>Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(e/10n**BigInt(t));var Xo="sdk_fiat_on_ramp_completed_with_status";var Cg="0x0000000000000000000000000000000000000000",vg=({destinationCurrency:e,...t})=>({tradeType:"EXACT_OUTPUT",originCurrency:Cg,destinationCurrency:e??Cg,...t}),a6="https://api.testnets.relay.link/execute/swap",s6="https://api.relay.link/execute/swap",wg=async({input:e,isTestnet:t})=>{let r=await fetch(t?a6:s6,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),o=await r.json();if(!r.ok&&(typeof o.message!="string"||!o.message.startsWith("Invalid address")))throw console.error("Relay error:",o),new Error(o.message??"Error fetching quote from relay");return o},bg=e=>{let t=e.steps[0]?.items?.[0];if(t)return{from:t.data.from,to:t.data.to,value:Number(t.data.value),chainId:Number(t.data.chainId),data:t.data.data}};import{createPublicClient as l6,http as c6}from"viem";var Eg=({chains:e,appId:t,address:r,rpcConfig:o})=>Promise.all(e.map(async n=>({balance:await l6({chain:n,transport:c6(Do(n,o,t))}).getBalance({address:r}).catch(()=>0n),chain:n})));import{createPublicClient as d6,http as p6}from"viem";var Tg=async({chain:e,address:t,appId:r,rpcConfig:o,erc20Address:n})=>({balance:await d6({chain:e,transport:p6(Do(e,o,r))}).readContract({address:n,abi:u6,functionName:"balanceOf",args:[t]}).catch(()=>0n),chain:e}),u6=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];import Sg from"styled-components";var Mc=Sg.span`
1499
1499
  display: flex;
1500
1500
  flex-direction: column;
1501
1501
  gap: 0.35rem;
1502
1502
  width: 100%;
1503
- `,Wt=wg.span`
1503
+ `,It=Sg.span`
1504
1504
  display: flex;
1505
1505
  width: 100%;
1506
1506
  justify-content: space-between;
1507
1507
  gap: 0.5rem;
1508
- `;import u6 from"styled-components";var Lt=u6.span`
1508
+ `;import m6 from"styled-components";var Mt=m6.span`
1509
1509
  color: var(--privy-color-foreground-3);
1510
1510
  font-size: 0.875rem;
1511
1511
  font-weight: 400;
1512
1512
  line-height: 1.375rem; /* 157.143% */
1513
- `;import Ug from"styled-components";import m6 from"styled-components";var Vt=m6.span`
1513
+ `;import Vg from"styled-components";import f6 from"styled-components";var Bt=f6.span`
1514
1514
  color: var(--privy-color-foreground);
1515
1515
  font-size: 0.875rem;
1516
1516
  font-weight: 500;
@@ -1518,21 +1518,21 @@ You will need this password to access your ${e} wallet on a new device. Please k
1518
1518
  word-break: break-all;
1519
1519
  text-align: right;
1520
1520
 
1521
- ${Am}
1522
- `;import v6 from"@heroicons/react/24/outline/GlobeAltIcon";import{jsx as Gt,jsxs as Lc}from"react/jsx-runtime";var bg=e=>Gt("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 2500 2500",xmlSpace:"preserve",...e,children:Gt("g",{id:"Layer_x0020_1",children:Lc("g",{id:"_2405588477232",children:[Gt("rect",{fill:"none",width:"2500",height:"2500"}),Gt("g",{children:Lc("g",{children:[Gt("path",{fill:"#213147",d:"M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"}),Gt("g",{children:Lc("g",{children:[Gt("g",{children:Gt("path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),Gt("g",{children:Gt("path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),Gt("g",{children:Gt("path",{fill:"#9DCCED",d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"})}),Gt("polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),Lc("g",{children:[Gt("path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),Gt("path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})});import{jsx as Eg,jsxs as f6}from"react/jsx-runtime";var Tg=e=>f6("svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Eg("rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),Eg("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z",fill:"#E84142"})]});import{jsx as Sg,jsxs as h6}from"react/jsx-runtime";var Ag=e=>h6("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Sg("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),Sg("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"})]});import{jsx as Pg}from"react/jsx-runtime";var xg=e=>Pg("svg",{version:"1.1",id:"Symbol",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlSpace:"preserve",x:"0px",y:"0px",viewBox:"0 0 384 383",enableBackground:"new 0 0 384 383;",...e,children:Pg("path",{d:`M383.5,0H0.5v383h383V249.3h-63.6C298,298.1,248.7,332,192.3,332c-77.8,0-140.8-63.6-140.8-140.8
1523
- C51.4,114,114.5,51,192.3,51C249.8,51,299.1,86,321,135.9h62.5V0z`})});import{jsx as fa,jsxs as Rg}from"react/jsx-runtime";var kg=e=>Rg("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[fa("rect",{width:"199.4",height:"207.623",fill:"#121212"}),Rg("g",{"clip-path":"url(#clip0_2303_643)",children:[fa("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),fa("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),fa("defs",{children:fa("clipPath",{id:"clip0_2303_643",children:fa("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]});import{jsx as hs,jsxs as y6}from"react/jsx-runtime";var _g=e=>y6("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 327.5 533.3",enableBackground:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...e,children:[hs("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),hs("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),hs("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),hs("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),hs("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]});import{jsx as Hp,jsxs as g6}from"react/jsx-runtime";var Mg=e=>g6("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Hp("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),Hp("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),Hp("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]});import{jsx as Ig,jsxs as C6}from"react/jsx-runtime";var Wg=e=>C6("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Ig("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),Ig("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]});import{jsx as Nc,jsxs as Lg}from"react/jsx-runtime";var Ng=e=>Lg("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Nc("rect",{width:"30",height:"30",fill:"url(#pattern0)"}),Lg("defs",{children:[Nc("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:Nc("use",{xlinkHref:"#image0_1_18",transform:"scale(0.00041841)"})}),Nc("image",{id:"image0_1_18",width:"2390",height:"2390",xlinkHref:"data:image/png;base64,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"})]})]});import{jsx as Og}from"react/jsx-runtime";var w6={[Zr.id]:bg,[nl.id]:Tg,[Wr.id]:Ag,[il.id]:xg,[mm.id]:kg,[Lr.id]:_g,[ho.id]:Mg,[Nr.id]:Wg,[gm.id]:Ng},ha=({chainId:e,...t})=>{let r=w6[e];return r?Og(r,{...t}):Og(v6,{...t})};import{Fragment as T6,jsx as ys,jsxs as Dg}from"react/jsx-runtime";var Fg=({balance:e,className:t,chain:r})=>ys(Rm,{className:t,$state:void 0,children:ys(Oc,{balance:e,chain:r})}),Oc=({balance:e,chain:t})=>Dg(T6,{children:[Dg(b6,{children:[ys(E6,{chainId:t.id}),ys(Vt,{children:t.name})]}),ys($t,{isLoading:!1,isPulsing:!1,color:"gray",children:e})]}),b6=Ug.div`
1521
+ ${Rm}
1522
+ `;import w6 from"@heroicons/react/24/outline/GlobeAltIcon";import{jsx as Ht,jsxs as Wc}from"react/jsx-runtime";var Pg=e=>Ht("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 2500 2500",xmlSpace:"preserve",...e,children:Ht("g",{id:"Layer_x0020_1",children:Wc("g",{id:"_2405588477232",children:[Ht("rect",{fill:"none",width:"2500",height:"2500"}),Ht("g",{children:Wc("g",{children:[Ht("path",{fill:"#213147",d:"M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"}),Ht("g",{children:Wc("g",{children:[Ht("g",{children:Ht("path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),Ht("g",{children:Ht("path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),Ht("g",{children:Ht("path",{fill:"#9DCCED",d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"})}),Ht("polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),Wc("g",{children:[Ht("path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),Ht("path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})});import{jsx as Ag,jsxs as h6}from"react/jsx-runtime";var xg=e=>h6("svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Ag("rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),Ag("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z",fill:"#E84142"})]});import{jsx as Rg,jsxs as y6}from"react/jsx-runtime";var kg=e=>y6("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Rg("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),Rg("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"})]});import{jsx as _g}from"react/jsx-runtime";var Ig=e=>_g("svg",{version:"1.1",id:"Symbol",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlSpace:"preserve",x:"0px",y:"0px",viewBox:"0 0 384 383",enableBackground:"new 0 0 384 383;",...e,children:_g("path",{d:`M383.5,0H0.5v383h383V249.3h-63.6C298,298.1,248.7,332,192.3,332c-77.8,0-140.8-63.6-140.8-140.8
1523
+ C51.4,114,114.5,51,192.3,51C249.8,51,299.1,86,321,135.9h62.5V0z`})});import{jsx as ga,jsxs as Mg}from"react/jsx-runtime";var Wg=e=>Mg("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[ga("rect",{width:"199.4",height:"207.623",fill:"#121212"}),Mg("g",{"clip-path":"url(#clip0_2303_643)",children:[ga("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),ga("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),ga("defs",{children:ga("clipPath",{id:"clip0_2303_643",children:ga("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]});import{jsx as ys,jsxs as g6}from"react/jsx-runtime";var Lg=e=>g6("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 327.5 533.3",enableBackground:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...e,children:[ys("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),ys("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),ys("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),ys("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),ys("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]});import{jsx as zp,jsxs as C6}from"react/jsx-runtime";var Ng=e=>C6("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[zp("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),zp("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),zp("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]});import{jsx as Og,jsxs as v6}from"react/jsx-runtime";var Dg=e=>v6("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Og("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),Og("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]});import{jsx as Lc,jsxs as Ug}from"react/jsx-runtime";var Fg=e=>Ug("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[Lc("rect",{width:"30",height:"30",fill:"url(#pattern0)"}),Ug("defs",{children:[Lc("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:Lc("use",{xlinkHref:"#image0_1_18",transform:"scale(0.00041841)"})}),Lc("image",{id:"image0_1_18",width:"2390",height:"2390",xlinkHref:"data:image/png;base64,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"})]})]});import{jsx as Bg}from"react/jsx-runtime";var b6={[Qr.id]:Pg,[il.id]:xg,[kr.id]:kg,[al.id]:Ig,[ym.id]:Wg,[_r.id]:Lg,[mo.id]:Ng,[Ir.id]:Dg,[wm.id]:Fg},Ca=({chainId:e,...t})=>{let r=b6[e];return r?Bg(r,{...t}):Bg(w6,{...t})};import{Fragment as S6,jsx as gs,jsxs as Hg}from"react/jsx-runtime";var Gg=({balance:e,className:t,chain:r})=>gs(Im,{className:t,$state:void 0,children:gs(Nc,{balance:e,chain:r})}),Nc=({balance:e,chain:t})=>Hg(S6,{children:[Hg(E6,{children:[gs(T6,{chainId:t.id}),gs(Bt,{children:t.name})]}),gs(Jt,{isLoading:!1,isPulsing:!1,color:"gray",children:e})]}),E6=Vg.div`
1524
1524
  display: flex;
1525
1525
  align-items: center;
1526
- `,E6=Ug(ha)`
1526
+ `,T6=Vg(Ca)`
1527
1527
  height: 1.25rem;
1528
1528
  width: 1.25rem;
1529
1529
  display: inline-block;
1530
1530
  margin-right: 0.5rem;
1531
1531
  border-radius: 4px;
1532
- `;import{Menu as Dc}from"@headlessui/react";import{ChevronDownIcon as S6}from"@heroicons/react/24/outline";import Cs from"styled-components";import{jsx as gs,jsxs as Bg}from"react/jsx-runtime";var Hg=({options:e,onSelect:t,selected:r,className:o})=>Bg(Dc,{as:A6,children:[Bg(Dc.Button,{as:R6,children:[gs(Oc,{balance:r.balance,chain:r.chain}),gs(Vp,{height:16})]}),gs(Dc.Items,{as:P6,className:o,anchor:"bottom",children:e.map((n,i)=>gs(Dc.Item,{as:x6,onClick:()=>t(i),children:gs(Oc,{balance:n.balance,chain:n.chain})},i))})]}),A6=Cs.div`
1532
+ `;import{Menu as Oc}from"@headlessui/react";import{ChevronDownIcon as P6}from"@heroicons/react/24/outline";import vs from"styled-components";import{jsx as Cs,jsxs as qg}from"react/jsx-runtime";var zg=({options:e,onSelect:t,selected:r,className:o})=>qg(Oc,{as:A6,children:[qg(Oc.Button,{as:k6,children:[Cs(Nc,{balance:r.balance,chain:r.chain}),Cs(Kp,{height:16})]}),Cs(Oc.Items,{as:x6,className:o,anchor:"bottom",children:e.map((n,i)=>Cs(Oc.Item,{as:R6,onClick:()=>t(i),children:Cs(Nc,{balance:n.balance,chain:n.chain})},i))})]}),A6=vs.div`
1533
1533
  width: 100%;
1534
1534
  position: relative;
1535
- `,P6=Cs.div`
1535
+ `,x6=vs.div`
1536
1536
  width: 100%;
1537
1537
  margin-top: 0.5rem;
1538
1538
  position: absolute;
@@ -1546,7 +1546,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1546
1546
  }
1547
1547
 
1548
1548
  z-index: 1;
1549
- `,x6=Cs.button`
1549
+ `,R6=vs.button`
1550
1550
  width: 100%;
1551
1551
  display: flex;
1552
1552
  justify-content: space-between;
@@ -1562,27 +1562,27 @@ You will need this password to access your ${e} wallet on a new device. Please k
1562
1562
  :hover {
1563
1563
  background: var(--privy-color-background-2);
1564
1564
  }
1565
- `,Vp=Cs(S6)`
1565
+ `,Kp=vs(P6)`
1566
1566
  height: 1rem;
1567
1567
  margin-left: 0.5rem;
1568
- `,R6=Cs.button`
1569
- ${xm}
1568
+ `,k6=vs.button`
1569
+ ${_m}
1570
1570
 
1571
1571
  /* Push the chip all the way to the right */
1572
1572
  span {
1573
1573
  margin-left: auto;
1574
1574
  }
1575
1575
 
1576
- ${Vp} {
1576
+ ${Kp} {
1577
1577
  transition: rotate 100ms ease-in;
1578
1578
  }
1579
1579
 
1580
1580
  &[aria-expanded='true'] {
1581
- ${Vp} {
1581
+ ${Kp} {
1582
1582
  rotate: -180deg;
1583
1583
  }
1584
1584
  }
1585
- `;import Kr,{keyframes as K6}from"styled-components";import k6 from"@heroicons/react/24/outline/ClockIcon";import _6 from"@heroicons/react/24/outline/TrashIcon";import M6 from"@heroicons/react/24/solid/CheckBadgeIcon";import I6 from"@heroicons/react/24/solid/CheckCircleIcon";import W6 from"@heroicons/react/24/solid/LockClosedIcon";import{useEffect as L6,useState as vs}from"react";import zr,{css as Kg}from"styled-components";import{jsx as Vg}from"react/jsx-runtime";var si=({style:e,...t})=>Vg("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:Vg("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})});import{jsx as Ge,jsxs as Gg}from"react/jsx-runtime";var li=({style:e,...t})=>Gg("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:[Gg("g",{clipPath:"url(#clip0_113_33841)",children:[Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"}),Ge("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"})]}),Ge("defs",{children:Ge("clipPath",{id:"clip0_113_33841",children:Ge("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});import{Fragment as Gp,jsx as we,jsxs as dr}from"react/jsx-runtime";var qg=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,i]=vs([]),a=t?e.length:2,l=d=>d.authenticatorName?d.createdWithBrowser?`${d.authenticatorName} on ${d.createdWithBrowser}`:d.authenticatorName:d.createdWithBrowser?d.createdWithOs?`${d.createdWithBrowser} on ${d.createdWithOs}`:`${d.createdWithBrowser}`:"Unknown device",s=async d=>{i(u=>u.concat([d])),await r(d),i(u=>u.filter(m=>m!==d))};return dr("div",{children:[we(B6,{children:"Your passkeys"}),dr(Qg,{children:[e.slice(0,a).map(d=>dr(G6,{children:[dr("div",{children:[we(H6,{children:l(d)}),dr(V6,{children:["Last used: ",(d.latestVerifiedAt??d.verifiedAt).toLocaleString()]})]}),we(z6,{disabled:n.includes(d.credentialId),onClick:()=>s(d.credentialId),children:n.includes(d.credentialId)?we(Eo,{}):we(_6,{height:"1.6em"})})]},d.credentialId)),e.length>2&&!t&&we(qp,{onClick:o,children:"View all"})]})]})},N6=()=>dr(Qg,{children:[dr(ar,{children:[we(ir,{children:we(M6,{})}),"Log in with Touch ID, Face ID, or a security key."]}),dr(ar,{children:[we(ir,{children:we(W6,{})}),"More secure than a password."]}),dr(ar,{children:[we(ir,{children:we(k6,{})}),"Takes seconds to set up and use."]})]}),Yg=()=>{let{user:e,unlinkPasskey:t}=K(),{linkWithPasskey:r,closePrivyModal:o}=L(),n=e?.linkedAccounts.filter(C=>C.type==="passkey"),[i,a]=vs(!1),[l,s]=vs(""),[d,u]=vs(!1),[m,f]=vs(!1);L6(()=>{n.length===0&&f(!1)},[n.length]);let g=()=>{a(!0),r().then(()=>u(!0)).catch(C=>{if(C instanceof jt){if(C.privyErrorCode==="cannot_link_more_of_type"){s("Cannot link more passkeys to account.");return}else if(C.privyErrorCode==="passkey_not_allowed"){s("Passkey request timed out or rejected by user.");return}}s("Unknown error occurred.")}).finally(()=>{a(!1)})},v=async C=>(a(!0),await t(C).then(()=>u(!0)).catch(b=>{if(b instanceof jt&&b.privyErrorCode==="missing_or_invalid_mfa"){s("Cannot unlink a passkey enrolled in MFA");return}s("Unknown error occurred.")}).finally(()=>{a(!1)}));return d?dr(Gp,{children:[we(R,{onClose:()=>o()},"header"),we(Fe,{children:we(Je,{status:"success",children:we(I6,{})})}),we(zg,{children:"Passkey added"}),we(U6,{children:"From now on, you can use your passkey to log in."}),we(kt,{children:we(F,{onClick:()=>o(),children:"Done"})}),we(Z,{})]}):m?dr(Gp,{children:[we(R,{backFn:()=>f(!1),onClose:()=>o()},"header"),we(qg,{passkeys:n,expanded:m,onUnlink:v,onExpand:()=>f(!0)}),we(Z,{})]}):dr(Gp,{children:[we(R,{onClose:()=>o()},"header"),we(Fe,{children:dr(Uc,{children:[we(si,{}),we(li,{})]})}),we(zg,{children:"Secure your account with a passkey"}),we(F6,{}),n.length===0?we(N6,{}):we(qg,{passkeys:n,expanded:m,onUnlink:v,onExpand:()=>f(!0)}),dr(kt,{style:{marginTop:"12px"},children:[l&&we(O6,{fail:!0,children:l}),we(F,{onClick:g,loading:i,children:"Add new passkey"})]}),we(Z,{})]})},Uc=zr.div`
1585
+ `;import Vr,{keyframes as Y6}from"styled-components";import _6 from"@heroicons/react/24/outline/ClockIcon";import I6 from"@heroicons/react/24/outline/TrashIcon";import M6 from"@heroicons/react/24/solid/CheckBadgeIcon";import W6 from"@heroicons/react/24/solid/CheckCircleIcon";import L6 from"@heroicons/react/24/solid/LockClosedIcon";import{useEffect as N6,useState as ws}from"react";import Hr,{css as Zg}from"styled-components";import{jsx as Kg}from"react/jsx-runtime";var pi=({style:e,...t})=>Kg("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:Kg("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})});import{jsx as Ke,jsxs as Yg}from"react/jsx-runtime";var ui=({style:e,...t})=>Yg("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:[Yg("g",{clipPath:"url(#clip0_113_33841)",children:[Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"}),Ke("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"})]}),Ke("defs",{children:Ke("clipPath",{id:"clip0_113_33841",children:Ke("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});import{Fragment as Yp,jsx as Ce,jsxs as sr}from"react/jsx-runtime";var Qg=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,i]=ws([]),a=t?e.length:2,l=d=>d.authenticatorName?d.createdWithBrowser?`${d.authenticatorName} on ${d.createdWithBrowser}`:d.authenticatorName:d.createdWithBrowser?d.createdWithOs?`${d.createdWithBrowser} on ${d.createdWithOs}`:`${d.createdWithBrowser}`:"Unknown device",s=async d=>{i(u=>u.concat([d])),await r(d),i(u=>u.filter(m=>m!==d))};return sr("div",{children:[Ce(H6,{children:"Your passkeys"}),sr(jg,{children:[e.slice(0,a).map(d=>sr(q6,{children:[sr("div",{children:[Ce(V6,{children:l(d)}),sr(G6,{children:["Last used: ",(d.latestVerifiedAt??d.verifiedAt).toLocaleString()]})]}),Ce(K6,{disabled:n.includes(d.credentialId),onClick:()=>s(d.credentialId),children:n.includes(d.credentialId)?Ce(wo,{}):Ce(I6,{height:"1.6em"})})]},d.credentialId)),e.length>2&&!t&&Ce(Qp,{onClick:o,children:"View all"})]})]})},O6=()=>sr(jg,{children:[sr(or,{children:[Ce(rr,{children:Ce(M6,{})}),"Log in with Touch ID, Face ID, or a security key."]}),sr(or,{children:[Ce(rr,{children:Ce(L6,{})}),"More secure than a password."]}),sr(or,{children:[Ce(rr,{children:Ce(_6,{})}),"Takes seconds to set up and use."]})]}),Jg=()=>{let{user:e,unlinkPasskey:t}=V(),{linkWithPasskey:r,closePrivyModal:o}=M(),n=e?.linkedAccounts.filter(C=>C.type==="passkey"),[i,a]=ws(!1),[l,s]=ws(""),[d,u]=ws(!1),[m,f]=ws(!1);N6(()=>{n.length===0&&f(!1)},[n.length]);let y=()=>{a(!0),r().then(()=>u(!0)).catch(C=>{if(C instanceof Zt){if(C.privyErrorCode==="cannot_link_more_of_type"){s("Cannot link more passkeys to account.");return}else if(C.privyErrorCode==="passkey_not_allowed"){s("Passkey request timed out or rejected by user.");return}}s("Unknown error occurred.")}).finally(()=>{a(!1)})},E=async C=>(a(!0),await t(C).then(()=>u(!0)).catch(w=>{if(w instanceof Zt&&w.privyErrorCode==="missing_or_invalid_mfa"){s("Cannot unlink a passkey enrolled in MFA");return}s("Unknown error occurred.")}).finally(()=>{a(!1)}));return d?sr(Yp,{children:[Ce(k,{onClose:()=>o()},"header"),Ce(Fe,{children:Ce($e,{status:"success",children:Ce(W6,{})})}),Ce(Xg,{children:"Passkey added"}),Ce(F6,{children:"From now on, you can use your passkey to log in."}),Ce(xt,{children:Ce(F,{onClick:()=>o(),children:"Done"})}),Ce(J,{})]}):m?sr(Yp,{children:[Ce(k,{backFn:()=>f(!1),onClose:()=>o()},"header"),Ce(Qg,{passkeys:n,expanded:m,onUnlink:E,onExpand:()=>f(!0)}),Ce(J,{})]}):sr(Yp,{children:[Ce(k,{onClose:()=>o()},"header"),Ce(Fe,{children:sr(Dc,{children:[Ce(pi,{}),Ce(ui,{})]})}),Ce(Xg,{children:"Secure your account with a passkey"}),Ce(B6,{}),n.length===0?Ce(O6,{}):Ce(Qg,{passkeys:n,expanded:m,onUnlink:E,onExpand:()=>f(!0)}),sr(xt,{style:{marginTop:"12px"},children:[l&&Ce(D6,{fail:!0,children:l}),Ce(F,{onClick:y,loading:i,children:"Add new passkey"})]}),Ce(J,{})]})},Dc=Hr.div`
1586
1586
  display: flex;
1587
1587
  align-items: center;
1588
1588
  justify-content: center;
@@ -1598,7 +1598,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1598
1598
  stroke: var(--privy-color-accent) !important;
1599
1599
  fill: var(--privy-color-accent) !important;
1600
1600
  }
1601
- `,O6=zr.div`
1601
+ `,D6=Hr.div`
1602
1602
  line-height: 20px;
1603
1603
  height: 20px;
1604
1604
  font-size: 13px;
@@ -1606,7 +1606,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1606
1606
  display: flex;
1607
1607
  justify-content: flex-beginngin;
1608
1608
  width: 100%;
1609
- `,D6=Kg`
1609
+ `,U6=Zg`
1610
1610
  && {
1611
1611
  width: 100%;
1612
1612
  font-size: 0.875rem;
@@ -1631,9 +1631,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
1631
1631
  box-shadow: none;
1632
1632
  }
1633
1633
  }
1634
- `,qp=zr.button`
1635
- ${D6}
1636
- `,Qg=zr.div`
1634
+ `,Qp=Hr.button`
1635
+ ${U6}
1636
+ `,jg=Hr.div`
1637
1637
  display: flex;
1638
1638
  flex-direction: column;
1639
1639
  align-items: stretch;
@@ -1641,18 +1641,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1641
1641
  padding: 0.5rem 0rem 0rem;
1642
1642
  flex-grow: 1;
1643
1643
  width: 100%;
1644
- `,zg=zr.div`
1644
+ `,Xg=Hr.div`
1645
1645
  font-size: 18px;
1646
1646
  line-height: 18px;
1647
1647
  text-align: center;
1648
1648
  font-weight: 600;
1649
- `,U6=zr.div`
1649
+ `,F6=Hr.div`
1650
1650
  font-size: 0.875rem;
1651
1651
  text-align: center;
1652
1652
  margin-top: 10px;
1653
- `,F6=zr.div`
1653
+ `,B6=Hr.div`
1654
1654
  height: 32px;
1655
- `,B6=zr.div`
1655
+ `,H6=Hr.div`
1656
1656
  line-height: 20px;
1657
1657
  height: 20px;
1658
1658
  font-size: 1em;
@@ -1660,18 +1660,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1660
1660
  display: flex;
1661
1661
  justify-content: flex-beginning;
1662
1662
  width: 100%;
1663
- `,H6=zr.div`
1663
+ `,V6=Hr.div`
1664
1664
  font-size: 1em;
1665
1665
  line-height: 1.3em;
1666
1666
  font-weight: 500;
1667
1667
  color: var(--privy-color-foreground-2);
1668
1668
  padding: 0.2em 0;
1669
- `,V6=zr.div`
1669
+ `,G6=Hr.div`
1670
1670
  font-size: 0.875rem;
1671
1671
  line-height: 1rem;
1672
1672
  color: #64668b;
1673
1673
  padding: 0.2em 0;
1674
- `,G6=zr.div`
1674
+ `,q6=Hr.div`
1675
1675
  display: flex;
1676
1676
  align-items: center;
1677
1677
  justify-content: space-between;
@@ -1684,7 +1684,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1684
1684
  border: 1px solid #e2e3f0 !important;
1685
1685
  width: 100%;
1686
1686
  height: 5em;
1687
- `,q6=Kg`
1687
+ `,z6=Zg`
1688
1688
  :focus,
1689
1689
  :hover,
1690
1690
  :active {
@@ -1701,15 +1701,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
1701
1701
  svg:hover {
1702
1702
  color: var(--privy-color-foreground-3);
1703
1703
  }
1704
- `,z6=zr.button`
1705
- ${q6}
1706
- `;var Xg=Kr.div`
1704
+ `,K6=Hr.button`
1705
+ ${z6}
1706
+ `;var $g=Vr.div`
1707
1707
  display: flex;
1708
1708
  flex-direction: column;
1709
1709
  gap: 12px;
1710
1710
  padding-top: 24px;
1711
1711
  padding-bottom: 24px;
1712
- `,Fc=Kr.div`
1712
+ `,Uc=Vr.div`
1713
1713
  width: 24px;
1714
1714
  height: 24px;
1715
1715
  display: flex;
@@ -1719,19 +1719,19 @@ You will need this password to access your ${e} wallet on a new device. Please k
1719
1719
  svg {
1720
1720
  border-radius: var(--privy-border-radius-sm);
1721
1721
  }
1722
- `,ya=Kr.div`
1722
+ `,va=Vr.div`
1723
1723
  display: flex;
1724
1724
  flex-direction: column;
1725
1725
  justify-content: center;
1726
1726
  align-items: center;
1727
1727
  gap: 8px;
1728
- `,ga=Kr.div`
1728
+ `,wa=Vr.div`
1729
1729
  display: flex;
1730
1730
  align-items: baseline;
1731
1731
  gap: 4px;
1732
- `,Bc=Kr.div`
1732
+ `,Fc=Vr.div`
1733
1733
  font-size: 42px !important;
1734
- `,Zg=Kr.input`
1734
+ `,e1=Vr.input`
1735
1735
  font-size: 42px !important;
1736
1736
  text-align: right;
1737
1737
  background-color: var(--privy-color-background);
@@ -1746,17 +1746,17 @@ You will need this password to access your ${e} wallet on a new device. Please k
1746
1746
  border: none !important;
1747
1747
  box-shadow: none !important;
1748
1748
  }
1749
- `,Jg=Kr.div`
1749
+ `,t1=Vr.div`
1750
1750
  cursor: pointer;
1751
1751
  padding-left: 4px;
1752
- `,Ca=Kr.div`
1752
+ `,ba=Vr.div`
1753
1753
  font-size: 18px;
1754
- `,va=Kr.div`
1754
+ `,Ea=Vr.div`
1755
1755
  font-size: 12px;
1756
1756
  color: var(--privy-color-foreground-3);
1757
1757
  // we need this container to maintain a static height if there's no content
1758
1758
  height: 20px;
1759
- `,jg=Kr.div`
1759
+ `,r1=Vr.div`
1760
1760
  display: flex;
1761
1761
  flex-direction: row;
1762
1762
  line-height: 22px;
@@ -1766,31 +1766,31 @@ You will need this password to access your ${e} wallet on a new device. Please k
1766
1766
  margin-right: 6px;
1767
1767
  margin: auto;
1768
1768
  }
1769
- `,$g=Kr(qp)`
1769
+ `,o1=Vr(Qp)`
1770
1770
  margin-top: 16px;
1771
- `,Y6=K6`
1771
+ `,Q6=Y6`
1772
1772
  from {
1773
1773
  opacity: 0;
1774
1774
  }
1775
1775
  to {
1776
1776
  opacity: 1;
1777
1777
  }
1778
- `,e1=Kr(sn)`
1778
+ `,n1=Vr(ln)`
1779
1779
  border-radius: var(--privy-border-radius-md) !important;
1780
- animation: ${Y6} 0.3s ease-in-out;
1781
- `;import{Fragment as Q6,jsx as qt,jsxs as ws}from"react/jsx-runtime";var t1=({displayName:e,errorMessage:t,configuredFundingChain:r,formattedBalance:o,fundingAmount:n,fundingCurrency:i,fundingAmountInUsd:a,options:l,selectedOption:s,isPreparing:d,isSubmitting:u,onSubmit:m,onSelect:f})=>ws(Q6,{children:[qt(It,{}),qt(oe,{}),qt(no,{children:"Transfer from another network"}),ws(Hr,{children:["You need more funds on the ",r.name," network. Bridge from another blockchain network."]}),ws(ya,{style:{marginTop:"2rem"},children:[ws(ga,{children:[qt(Bc,{children:n}),qt(Ca,{children:i})]}),a&&qt(va,{children:a})]}),qt(Wt,{style:{marginTop:"1.5rem"},children:qt(Lt,{children:"From"})}),qt(Hg,{selected:{chain:s.chain,balance:bt(s.balance,s.chain.nativeCurrency.symbol,3,!0)},options:l.map(({chain:g,balance:v})=>({chain:g,balance:bt(v,g.nativeCurrency.symbol,3,!0)})),onSelect:f}),qt(Wt,{children:qt(Lt,{style:{marginTop:"1.5rem"},children:"To"})}),qt(Fg,{chain:r,balance:o}),qt(Ua,{style:{marginTop:"1rem"},children:t}),ws(Go,{style:{marginTop:"1rem"},loading:u||d,disabled:d||u,onClick:m,children:["Confirm with ",e]}),qt(ne,{}),qt(G,{})]});import X6 from"styled-components";import{Fragment as J6,jsx as At,jsxs as ci}from"react/jsx-runtime";var r1=({wallet:e,displayName:t,addressToFund:r,chain:o,isBridging:n,isErc20Flow:i,totalPriceInNativeCurrency:a,totalPriceInUsd:l,gasPriceInNativeCurrency:s,gasPriceInUsd:d})=>ci(J6,{children:[At(It,{}),At(ma,{}),At(St,{style:{marginTop:"16px"},children:At(nc,{icon:ac(e.walletClientType,e.connectorType,e.walletClientType),name:e.walletClientType})}),At(ve,{style:{marginTop:"8px",marginBottom:"12px"},title:`${n?"Bridging":"Confirming"} with ${t}`}),!n&&!i&&ci(Wc,{children:[ci(Wt,{children:[At(Lt,{children:"Total"}),At(Vt,{children:l||a})]}),ci(Wt,{children:[At(Lt,{children:"To"}),At(Vt,{children:At(Fa,{address:r,showCopyIcon:!1})})]}),ci(Wt,{children:[At(Lt,{children:"Network"}),At(Vt,{children:ci(Z6,{children:[At(ha,{chainId:o.id,height:16,width:16})," ",o.name]})})]}),s&&ci(Wt,{children:[At(Lt,{children:"Estimated fee"}),At(Vt,{children:d||s})]})]}),At(Xi,{height:24}),At(G,{})]}),Z6=X6.div`
1780
+ animation: ${Q6} 0.3s ease-in-out;
1781
+ `;import{Fragment as X6,jsx as Vt,jsxs as bs}from"react/jsx-runtime";var i1=({displayName:e,errorMessage:t,configuredFundingChain:r,formattedBalance:o,fundingAmount:n,fundingCurrency:i,fundingAmountInUsd:a,options:l,selectedOption:s,isPreparing:d,isSubmitting:u,onSubmit:m,onSelect:f})=>bs(X6,{children:[Vt(_t,{}),Vt(te,{}),Vt(ro,{children:"Transfer from another network"}),bs(Dr,{children:["You need more funds on the ",r.name," network. Bridge from another blockchain network."]}),bs(va,{style:{marginTop:"2rem"},children:[bs(wa,{children:[Vt(Fc,{children:n}),Vt(ba,{children:i})]}),a&&Vt(Ea,{children:a})]}),Vt(It,{style:{marginTop:"1.5rem"},children:Vt(Mt,{children:"From"})}),Vt(zg,{selected:{chain:s.chain,balance:wt(s.balance,s.chain.nativeCurrency.symbol,3,!0)},options:l.map(({chain:y,balance:E})=>({chain:y,balance:wt(E,y.nativeCurrency.symbol,3,!0)})),onSelect:f}),Vt(It,{children:Vt(Mt,{style:{marginTop:"1.5rem"},children:"To"})}),Vt(Gg,{chain:r,balance:o}),Vt(Ba,{style:{marginTop:"1rem"},children:t}),bs(Go,{style:{marginTop:"1rem"},loading:u||d,disabled:d||u,onClick:m,children:["Confirm with ",e]}),Vt(re,{}),Vt(B,{})]});import Z6 from"styled-components";import{Fragment as j6,jsx as Tt,jsxs as mi}from"react/jsx-runtime";var a1=({wallet:e,displayName:t,addressToFund:r,chain:o,isBridging:n,isErc20Flow:i,totalPriceInNativeCurrency:a,totalPriceInUsd:l,gasPriceInNativeCurrency:s,gasPriceInUsd:d})=>mi(j6,{children:[Tt(_t,{}),Tt(ya,{}),Tt(Et,{style:{marginTop:"16px"},children:Tt(oc,{icon:ic(e.walletClientType,e.connectorType,e.walletClientType),name:e.walletClientType})}),Tt(ge,{style:{marginTop:"8px",marginBottom:"12px"},title:`${n?"Bridging":"Confirming"} with ${t}`}),!n&&!i&&mi(Mc,{children:[mi(It,{children:[Tt(Mt,{children:"Total"}),Tt(Bt,{children:l||a})]}),mi(It,{children:[Tt(Mt,{children:"To"}),Tt(Bt,{children:Tt(Fo,{address:r,showCopyIcon:!1})})]}),mi(It,{children:[Tt(Mt,{children:"Network"}),Tt(Bt,{children:mi(J6,{children:[Tt(Ca,{chainId:o.id,height:16,width:16})," ",o.name]})})]}),s&&mi(It,{children:[Tt(Mt,{children:"Estimated fee"}),Tt(Bt,{children:d||s})]})]}),Tt($i,{height:24}),Tt(B,{})]}),J6=Z6.div`
1782
1782
  display: flex;
1783
1783
  flex-direction: row;
1784
1784
  align-items: center;
1785
1785
  gap: 4px;
1786
- `;import{Fragment as i1,jsx as Yr,jsxs as zp}from"react/jsx-runtime";var a1=()=>{let{rpcConfig:e,appId:t,closePrivyModal:r}=L(),{navigate:o,setModalData:n,app:i,data:a}=x(),{wallets:l}=Bo(),[s,d]=zt(!1),[u,m]=zt(0n),[f,g]=zt(!1),[v,C]=zt(null),[b,A]=zt(null),[_,S]=zt([]),[P,E]=zt(0),[k,D]=zt(!1),[H,M]=zt(!1),[X,W]=zt(!1),[Y,Ce]=zt(!1),{erc20ContractInfo:q,erc20Address:pe,address:Q,chain:ee,amount:ue}=a.funding;vn(()=>{pe&&!q&&C(new Error("Unable to fetch token details"))},[]);let me=!!pe&&!!q,Te=me?BigInt(parseFloat(ue)*10**q.decimals):r7(ue),ce=l[0],[Se,ft]=zt(null);vn(()=>{(async()=>{if(!ce)return;let Oo=await ce.getEthereumProvider(),Ue=$6({account:ce.address,transport:e7(Oo)}).extend(o7);ft(Ue)})().catch(console.error)},[ce]);let[tt,le]=zt(0n);vn(()=>{o1({chain:ee,transport:n1(Uo(ee,e,t))}).getBalance({address:Q}).then(le).catch(console.error)},[]);let[nt,mr]=zt(0n);vn(()=>{me&&vg({chain:ee,address:Q,appId:t,rpcConfig:e,erc20Address:pe}).then(wt=>mr(wt.balance)).catch(console.error)},[]);let{tokenPrice:vt}=_o({chainId:ee.id}),[I,Ke]=zt({to:Q,chain:ee,value:Te,data:void 0});vn(()=>{(async()=>{if(!Se||!ce||k||X)return;D(!0);let Oo,Ue=o1({chain:ee,transport:n1(Uo(ee,e,t))});if(me&&!I.data){if(!await Ue.simulateContract({address:pe,chain:ee,abi:fs,functionName:"transfer",args:[Q,Te],account:ce.address}).catch(po=>{console.warn("Simulated token transfer failed with error, fetching bridge options.",po)})){D(!1),g(!0);return}D(!1),Ke({to:pe,chain:ee,data:t7({abi:fs,functionName:"transfer",args:[Q,Te]}),value:"0x0"});return}try{Oo=await Ue.prepareTransactionRequest({account:ce.address,to:I.to,chain:I.chain,data:I.data,value:BigInt(I.value??0)})}catch(Xt){console.error(Xt),_.length>1&&A(Xt.shortMessage??"Something went wrong")}if(!Oo){D(!1),g(!0);return}D(!1),W(!0),d(!0),m(Oo.gas);try{await Se.switchChain({id:I.chain.id})}catch{await Se.addChain({chain:I.chain}),await Se.switchChain({id:I.chain.id})}let Do;try{Do=await Se.sendTransaction(Oo)}catch(Xt){console.error(Xt);let po=Xt;po.name==="TransactionExecutionError"&&(_.length<1?C(new w(po.shortMessage,void 0,"transaction_failure")):A(Xt.shortMessage??"Something went wrong"))}if(!Do){W(!1);return}await Se.waitForTransactionReceipt({hash:Do}),W(!1),Ce(!0)})().catch(console.error)},[Se,I]),vn(()=>{(async()=>{if(!f||!Se||!ce)return;let Ue=Mc(i.chains).filter(Xe=>Xe.id!==a.funding.chain.id&&!!Xe.testnet==!!a.funding.chain.testnet);me&&Ue.unshift(a.funding.chain);let Do=await Cg({chains:Ue,address:ce.address,appId:t,rpcConfig:e}),Xt=me?Do.filter(Xe=>Xe.balance>0n):Do.filter(Xe=>Xe.balance>Te);if(Xt.length<1){C(new w(`Wallet ${Ut(ce.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}Xt.sort((Xe,Ma)=>Number(Ma.balance-Xe.balance));let po=(await Promise.allSettled(Xt.map(async Xe=>({quote:await yg({isTestnet:!!a.funding?.chain.testnet,input:hg({amount:Te.toString(),user:ce.address,recipient:Q,destinationChainId:ee.id,destinationCurrency:pe,originChainId:Xe.chain.id})}),...Xe})))).filter(Xe=>Xe.status==="fulfilled").map(Xe=>Xe.value);if(po.length<1){C(new w(`Wallet ${Ut(ce.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}let Ei=po.map(Xe=>({bridgeTx:gg(Xe.quote),balance:Xe.balance,chain:Xe.chain})).filter(Xe=>!!Xe.bridgeTx);if(Ei.length>1){S(Ei);return}let uo=Ei[0];if(!uo){C(new w(`Wallet ${Ut(ce.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}M(!0),Ke({data:uo.bridgeTx.data,to:uo.bridgeTx.to,value:uo.bridgeTx.value,chain:uo.chain})})().catch(console.error)},[f]),vn(()=>{if(!v)return;let wt={error:v,previousScreen:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};n({funding:a?.funding,sendTransaction:a?.sendTransaction,errorModalData:wt}),o("ERROR_SCREEN",!1)},[v]);let Qt=ce?dn(ce.walletClientType,ce.connectorType,ce.walletClientType)||"wallet":null,U=!me&&vt?Mi(a?.funding?.amount??"0",vt):void 0,B=me?u:Ba([u,Te]),se=B&&vt?yo(B,vt):void 0,rt=B?bt(B,"ETH"):void 0,On=u&&vt?yo(u,vt):void 0,bi=u?bt(u,"ETH"):void 0;if(vn(()=>{if(!Y)return;let wt=setTimeout(r,om);return()=>clearTimeout(wt)},[Y]),Y)return zp(i1,{children:[Yr(It,{}),Yr(oe,{}),zp(Cr,{children:[Yr(j6,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),Yr(ve,{title:"Success!",description:`You\u2019ve successfully added ${ue} ${me?q.symbol:ee.nativeCurrency.symbol} to your ${i.name} wallet. It may take a minute before the funds are available to use.`})]}),Yr(ne,{}),Yr(G,{})]});let zs=me?`${Ic({amount:nt,decimals:q.decimals})} ${q.symbol}`:bt(tt,ee.nativeCurrency.symbol,3,!0),Xr=_[P];return _.length>1&&Xr?Yr(t1,{displayName:Qt,configuredFundingChain:ee,formattedBalance:zs,fundingAmount:ue,fundingCurrency:me?q.symbol:ee.nativeCurrency.symbol,fundingAmountInUsd:U,options:_,selectedOption:Xr,isPreparing:k,isSubmitting:X,errorMessage:b,onSubmit:()=>{Ke({to:Xr.bridgeTx.to,data:Xr.bridgeTx.data,value:Xr.bridgeTx.value,chain:Xr.chain})},onSelect:wt=>{wt!==P&&(A(null),E(wt))}}):s&&u&&ce&&a?.funding?Yr(r1,{wallet:ce,displayName:Qt,addressToFund:Q,isBridging:H,isErc20Flow:me,totalPriceInUsd:se,totalPriceInNativeCurrency:rt,gasPriceInUsd:On,gasPriceInNativeCurrency:bi,chain:a.funding.chain}):zp(i1,{children:[Yr(It,{}),Yr(ma,{}),Yr("div",{style:{marginTop:"1rem"}}),Yr(G,{})]})};import c7 from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import d7 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as p7,useMemo as u7,useState as u1}from"react";import m1 from"styled-components";var Hc=class{constructor({authorizationCode:t,stateCode:r,codeVerifier:o,provider:n}){this.meta={authorizationCode:t,stateCode:r,codeVerifier:o,provider:n}}async authenticate(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(pl,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(t){throw ae(t)}}async link(){if(!this.api)throw new w("Auth flow has no API instance");try{return await this.api.post(ul,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(t){throw ae(t)}}};async function Vc({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 s1({api:e,appId:t}){let r=qn(),o=Li(),n=await Ni(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 ae(i)}}async function l1({appId:e,stateCode:t,codeVerifier:r,authorizationCode:o,action:n,client:i}){if(!o||!t)throw new w("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(o==="undefined")throw new w("User denied confirmation during cross-app auth flow");try{let a=new Hc({authorizationCode:o,stateCode:t,codeVerifier:r,provider:`privy:${e}`});i.startAuthFlow(a);let s=(n==="link"?await i.link():await i.authenticate()).oAuthTokens?.accessToken;return console.debug(),s}catch(a){let l=ae(a);throw l.privyErrorCode?new w(l.message||"Invalid code during cross-app auth flow.",void 0,l.privyErrorCode):l.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")}}var Gc=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(f=>!!(f.type==="cross_app"&&f.embeddedWallets.find(g=>g.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 Vc({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,action:"link"})&&(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 d=window.open(void 0,void 0,bs({w:400,h:680}));if(!d)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:t}}),new w("Failed to initialize signature request");let u=new URL(`${s.apiUrl}/oauth/transact`);return u.searchParams.set("token",l||""),u.searchParams.set("request",n7(o)),d.location=u.href,new Promise((f,g)=>{let C=setTimeout(()=>{_(),g(new w("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})},12e4),b=setInterval(()=>{d.closed&&(_(),g(new w("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))},300),A=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&&(_(),f(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&&(_(),g(S.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:S.data.error,address:t}})))};window.addEventListener("message",A);let _=()=>{d.close(),clearInterval(b),clearTimeout(C),window.removeEventListener("message",A)}})},n7=e=>JSON.stringify({content:{request:{request:e}},timestamp:Date.now(),callbackUrl:window.origin}),bs=({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,d=(i-t)/2/l+o;return`toolbar=0,location=0,menubar=0,height=${t},width=${e},popup=1,left=${s},top=${d}`};var wa="sdk_fiat_on_ramp_completed_with_status";var i7=new Set([Lr.id,Wr.id,ho.id,Nr.id,Zr.id]),a7=new Set([Lr.id,Wr.id,Nr.id,ho.id]),s7={[Lr.id]:"ethereum",[Wr.id]:"base",[ho.id]:"optimism",[Nr.id]:"polygon",[Zr.id]:"arbitrum"},c1=(e,t)=>{switch(t){case"native-currency":return i7.has(e);case"USDC":return a7.has(e);default:return console.warn("Unknown asset passed to Coinbase Onramp"),!1}};function d1(e){let t=s7[e];if(!t)throw new w(`Unsupported chainId: ${e} for Coinbase Onramp`);return t}function l7(e){return e.startsWith(".")?`0${e}`:e}var p1=({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",l7(t)),o.searchParams.set("defaultNetwork",r),o.searchParams.set("partnerUserId",e.partner_user_id),{url:o}};import{Fragment as y1,jsx as Tr,jsxs as Es}from"react/jsx-runtime";var m7=240,f1=1500,f7=Math.floor(m7*1e3/f1),h1=()=>{let{data:e,setModalData:t,navigate:r}=x(),{closePrivyModal:o,createAnalyticsEvent:n,initCoinbaseOnRamp:i,getCoinbaseOnRampStatus:a}=L(),l=e?.funding,s=l.isUSDC?"USDC":"ETH",[d,u]=u1(!1),[m,f]=u1(!1);return p7(()=>{if(d)return;u(!0);let g=async()=>{try{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp"}});let C=window.open(void 0,void 0,bs({w:440,h:680})),b=d1(l.chain.id),A=await i({addresses:[{address:l.address,blockchains:[b]}],assets:[s]}),{url:_}=p1({input:A,amount:l.amount,blockchain:b});if(!C)throw new Error("Unable to initiate Coinbase Onramp flow.");C.location=_.toString();let S=0,P=!1;for(;S<f7;){S++;let{status:E}=await a({partnerUserId:A.partner_user_id});if(E==="success"){P=!0;break}if(E==="failure")throw new Error("There was an error completing Coinbase Onramp flow.");if(C.closed)throw new Error("User exited Coinbase Onramp flow before transaction response.");await new Promise(k=>setTimeout(k,f1))}if(!P)throw new Error("Timed out waiting for transaction response from Coinbase Onramp.");n({eventName:wa,payload:{status:"success",provider:"coinbase-onramp"}}),f(!0)}catch(C){console.error(C),n({eventName:wa,payload:{status:"failure",provider:"coinbase-onramp",error:C.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{u(!1)}},v=setTimeout(()=>void g(),500);return()=>clearTimeout(v)},[]),Es(y1,{children:[Tr(R,{title:"Fund account"},"header"),Tr(y7,{isSucccess:m,onClickCta:o}),Tr(G,{})]})},h7=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:""},y7=({isSucccess:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=u7(()=>h7(e),[e]);return Es(y1,{children:[Es(b7,{children:[Tr(v7,{isSucccess:e}),Es(Qe,{children:[Tr("h3",{children:r}),Tr(w7,{children:o})]})]}),n&&Tr(F,{onClick:t,children:n})]})},g7=e=>e?"var(--privy-color-success)":"var(--privy-color-foreground-4)",C7=e=>e?d7:()=>Tr(c7,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),v7=({isSucccess:e})=>{if(!e){let o="var(--privy-color-foreground-4)";return Es("div",{style:{position:"relative"},children:[Tr(at,{color:o,style:{position:"absolute"}}),Tr(Ja,{color:o}),Tr(Vo,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let t=C7(e),r=g7(e);return Tr("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&Tr(t,{width:"4rem",height:"4rem",color:r})})},w7=m1.p`
1786
+ `;import{Fragment as c1,jsx as Gr,jsxs as Xp}from"react/jsx-runtime";var d1=()=>{let{rpcConfig:e,appId:t,closePrivyModal:r,createAnalyticsEvent:o}=M(),{navigate:n,setModalData:i,app:a,data:l}=R(),{wallets:s}=Bo(),[d,u]=Gt(!1),[m,f]=Gt(0n),[y,E]=Gt(!1),[C,w]=Gt(null),[P,_]=Gt(null),[T,A]=Gt([]),[S,I]=Gt(0),[N,H]=Gt(!1),[x,K]=Gt(!1),[W,Q]=Gt(!1),[de,q]=Gt(!1),{erc20ContractInfo:pe,erc20Address:Z,address:ie,chain:se,amount:_e}=l.funding;wn(()=>{Z&&!pe&&w(new Error("Unable to fetch token details"))},[]);let be=!!Z&&!!pe,ye=be?BigInt(parseFloat(_e)*10**pe.decimals):o7(_e),ae=s[0],[Xe,it]=Gt(null);wn(()=>{(async()=>{if(!ae)return;let De=await ae.getEthereumProvider(),lo=e7({account:ae.address,transport:t7(De)}).extend(n7);it(lo)})().catch(console.error)},[ae]);let[le,et]=Gt(0n);wn(()=>{s1({chain:se,transport:l1(Do(se,e,t))}).getBalance({address:ie}).then(et).catch(console.error)},[]);let[Ot,zr]=Gt(0n);wn(()=>{be&&Tg({chain:se,address:ie,appId:t,rpcConfig:e,erc20Address:Z}).then(Kt=>zr(Kt.balance)).catch(console.error)},[]);let{tokenPrice:L}=Ro({chainId:se.id}),[Se,qe]=Gt({to:ie,chain:se,value:ye,data:void 0});wn(()=>{(async()=>{if(!Xe||!ae||N||W)return;H(!0);let De,lo=s1({chain:Se.chain,transport:l1(Do(Se.chain,e,t))});if(be&&!Se.data){if(!await lo.simulateContract({address:Z,chain:Se.chain,abi:hs,functionName:"transfer",args:[ie,ye],account:ae.address}).catch(co=>{console.warn("Simulated token transfer failed with error, fetching bridge options.",co)})){H(!1),E(!0);return}H(!1),qe({to:Z,chain:Se.chain,data:r7({abi:hs,functionName:"transfer",args:[ie,ye]}),value:"0x0"});return}try{De=await lo.prepareTransactionRequest({account:ae.address,to:Se.to,chain:Se.chain,data:Se.data,value:BigInt(Se.value??0)})}catch(Yt){console.error(Yt),T.length>1&&_(Yt.shortMessage??"Something went wrong")}if(!De){H(!1),E(!0);return}H(!1),Q(!0),u(!0),f(De.gas);try{await Xe.switchChain({id:Se.chain.id})}catch{await Xe.addChain({chain:Se.chain}),await Xe.switchChain({id:Se.chain.id})}let No;try{No=await Xe.sendTransaction(De),o({eventName:Xo,payload:{provider:"external",status:"success",address:ae.address,chainId:Se.chain.id,value:Se.value?.toString(),txHash:No}})}catch(Yt){console.error(Yt);let co=Yt;co.name==="TransactionExecutionError"&&(T.length<1?w(new v(co.shortMessage,void 0,"transaction_failure")):_(Yt.shortMessage??"Something went wrong"))}if(!No){Q(!1);return}await Xe.waitForTransactionReceipt({hash:No}),Q(!1),q(!0)})().catch(console.error)},[Xe,Se]),wn(()=>{(async()=>{if(!y||!Xe||!ae)return;let lo=_c(a.chains).filter(ze=>ze.id!==l.funding.chain.id&&!!ze.testnet==!!l.funding.chain.testnet);be&&lo.unshift(l.funding.chain);let No=await Eg({chains:lo,address:ae.address,appId:t,rpcConfig:e}),Yt=be?No.filter(ze=>ze.balance>0n):No.filter(ze=>ze.balance>ye);if(Yt.length<1){w(new v(`Wallet ${Yr(ae.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}Yt.sort((ze,Bd)=>Number(Bd.balance-ze.balance));let co=(await Promise.allSettled(Yt.map(async ze=>({quote:await wg({isTestnet:!!l.funding?.chain.testnet,input:vg({amount:ye.toString(),user:ae.address,recipient:ie,destinationChainId:se.id,destinationCurrency:Z,originChainId:ze.chain.id})}),...ze})))).filter(ze=>ze.status==="fulfilled").map(ze=>ze.value);if(co.length<1){w(new v(`Wallet ${Yr(ae.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}let Oo=co.map(ze=>({bridgeTx:bg(ze.quote),balance:ze.balance,chain:ze.chain})).filter(ze=>!!ze.bridgeTx);if(Oo.length>1){A(Oo);return}let Fn=Oo[0];if(!Fn){w(new v(`Wallet ${Yr(ae.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}K(!0),qe({data:Fn.bridgeTx.data,to:Fn.bridgeTx.to,value:Fn.bridgeTx.value,chain:Fn.chain})})().catch(console.error)},[y]),wn(()=>{if(!C)return;let Kt={error:C,previousScreen:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};i({funding:l?.funding,sendTransaction:l?.sendTransaction,errorModalData:Kt}),n("ERROR_SCREEN",!1)},[C]);let U=ae?pn(ae.walletClientType,ae.connectorType,ae.walletClientType)||"wallet":null,Y=!be&&L?Ni(l?.funding?.amount??"0",L):void 0,j=be?m:Ha([m,ye]),Oe=j&&L?fo(j,L):void 0,Lo=j?wt(j,"ETH"):void 0,Dn=m&&L?fo(m,L):void 0,Un=m?wt(m,"ETH"):void 0;if(wn(()=>{if(!de)return;let Kt=setTimeout(r,am);return()=>clearTimeout(Kt)},[de]),de)return Xp(c1,{children:[Gr(_t,{}),Gr(te,{}),Xp(fr,{children:[Gr($6,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),Gr(ge,{title:"Success!",description:`You\u2019ve successfully added ${_e} ${be?pe.symbol:se.nativeCurrency.symbol} to your ${a.name} wallet. It may take a minute before the funds are available to use.`})]}),Gr(re,{}),Gr(B,{})]});let Pi=be?`${Ic({amount:Ot,decimals:pe.decimals})} ${pe.symbol}`:wt(le,se.nativeCurrency.symbol,3,!0),Kr=T[S];return T.length>1&&Kr?Gr(i1,{displayName:U,configuredFundingChain:se,formattedBalance:Pi,fundingAmount:_e,fundingCurrency:be?pe.symbol:se.nativeCurrency.symbol,fundingAmountInUsd:Y,options:T,selectedOption:Kr,isPreparing:N,isSubmitting:W,errorMessage:P,onSubmit:()=>{qe({to:Kr.bridgeTx.to,data:Kr.bridgeTx.data,value:Kr.bridgeTx.value,chain:Kr.chain})},onSelect:Kt=>{Kt!==S&&(_(null),I(Kt))}}):d&&m&&ae&&l?.funding?Gr(a1,{wallet:ae,displayName:U,addressToFund:ie,isBridging:x,isErc20Flow:be,totalPriceInUsd:Oe,totalPriceInNativeCurrency:Lo,gasPriceInUsd:Dn,gasPriceInNativeCurrency:Un,chain:l.funding.chain}):Xp(c1,{children:[Gr(_t,{}),Gr(ya,{}),Gr("div",{style:{marginTop:"1rem"}}),Gr(B,{})]})};import d7 from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import p7 from"@heroicons/react/24/solid/CheckCircleIcon";import{useEffect as u7,useMemo as m7,useState as y1}from"react";import g1 from"styled-components";var Bc=class{constructor({authorizationCode:t,stateCode:r,codeVerifier:o,provider:n}){this.meta={authorizationCode:t,stateCode:r,codeVerifier:o,provider:n}}async authenticate(){if(!this.api)throw new v("Auth flow has no API instance");try{return await this.api.post(ul,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(t){throw ne(t)}}async link(){if(!this.api)throw new v("Auth flow has no API instance");try{return await this.api.post(ml,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(t){throw ne(t)}}};async function Hc({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 v("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 p1({api:e,appId:t}){let r=Qn(),o=Ui(),n=await Fi(r);try{let{url:i}=await e.post(pl,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:n,state_code:o});return{url:i,stateCode:o,codeVerifier:r}}catch(i){throw ne(i)}}async function u1({appId:e,stateCode:t,codeVerifier:r,authorizationCode:o,action:n,client:i}){if(!o||!t)throw new v("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(o==="undefined")throw new v("User denied confirmation during cross-app auth flow");try{let a=new Bc({authorizationCode:o,stateCode:t,codeVerifier:r,provider:`privy:${e}`});i.startAuthFlow(a);let s=(n==="link"?await i.link():await i.authenticate()).oAuthTokens?.accessToken;return console.debug(),s}catch(a){let l=ne(a);throw l.privyErrorCode?new v(l.message||"Invalid code during cross-app auth flow.",void 0,l.privyErrorCode):l.message==="User denied confirmation during cross-app auth flow"?new v("Invalid code during cross-app auth flow.",void 0,"oauth_user_denied"):new v("Invalid code during cross-app auth flow.",void 0,"unknown_auth_error")}}var Vc=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(f=>!!(f.type==="cross_app"&&f.embeddedWallets.find(y=>y.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 v("Cannot request a signature with this wallet address");let l=r.getProviderAccessToken(a.providerApp.id),s=await Hc({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 v("Cannot transact against a read-only provider app");await i({appId:a.providerApp.id,action:"link"})&&(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 v("Transactions require a valid token");let d=window.open(void 0,void 0,Es({w:400,h:680}));if(!d)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:t}}),new v("Failed to initialize signature request");let u=new URL(`${s.apiUrl}/oauth/transact`);return u.searchParams.set("token",l||""),u.searchParams.set("request",i7(o)),d.location=u.href,new Promise((f,y)=>{let C=setTimeout(()=>{_(),y(new v("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})},12e4),w=setInterval(()=>{d.closed&&(_(),y(new v("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))},300),P=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&&(_(),f(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&&(_(),y(T.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:T.data.error,address:t}})))};window.addEventListener("message",P);let _=()=>{d.close(),clearInterval(w),clearTimeout(C),window.removeEventListener("message",P)}})},i7=e=>JSON.stringify({content:{request:{request:e}},timestamp:Date.now(),callbackUrl:window.origin}),Es=({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,d=(i-t)/2/l+o;return`toolbar=0,location=0,menubar=0,height=${t},width=${e},popup=1,left=${s},top=${d}`};var a7=new Set([_r.id,kr.id,mo.id,Ir.id,Qr.id]),s7=new Set([_r.id,kr.id,Ir.id,mo.id]),l7={[_r.id]:"ethereum",[kr.id]:"base",[mo.id]:"optimism",[Ir.id]:"polygon",[Qr.id]:"arbitrum"},m1=(e,t)=>{switch(t){case"native-currency":return a7.has(e);case"USDC":return s7.has(e);default:return console.warn("Unknown asset passed to Coinbase Onramp"),!1}};function f1(e){let t=l7[e];if(!t)throw new v(`Unsupported chainId: ${e} for Coinbase Onramp`);return t}function c7(e){return e.startsWith(".")?`0${e}`:e}var h1=({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",c7(t)),o.searchParams.set("defaultNetwork",r),o.searchParams.set("partnerUserId",e.partner_user_id),{url:o}};import{Fragment as w1,jsx as vr,jsxs as Ts}from"react/jsx-runtime";var f7=240,C1=1500,h7=Math.floor(f7*1e3/C1),v1=()=>{let{data:e,setModalData:t,navigate:r}=R(),{closePrivyModal:o,createAnalyticsEvent:n,initCoinbaseOnRamp:i,getCoinbaseOnRampStatus:a}=M(),l=e?.funding,s=l.isUSDC?"USDC":"ETH",[d,u]=y1(!1),[m,f]=y1(!1);return u7(()=>{if(d)return;u(!0);let y=async()=>{try{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp",value:l.amount,chainId:l.chain.id}});let C=window.open(void 0,void 0,Es({w:440,h:680})),w=f1(l.chain.id),P=await i({addresses:[{address:l.address,blockchains:[w]}],assets:[s]}),{url:_}=h1({input:P,amount:l.amount,blockchain:w});if(!C)throw new Error("Unable to initiate Coinbase Onramp flow.");C.location=_.toString();let T=0,A=!1;for(;T<h7;){T++;let{status:S}=await a({partnerUserId:P.partner_user_id});if(S==="success"){A=!0;break}if(S==="failure")throw new Error("There was an error completing Coinbase Onramp flow.");if(C.closed)throw new Error("User exited Coinbase Onramp flow before transaction response.");await new Promise(I=>setTimeout(I,C1))}if(!A)throw new Error("Timed out waiting for transaction response from Coinbase Onramp.");f(!0)}catch(C){console.error(C),n({eventName:Xo,payload:{status:"failure",provider:"coinbase-onramp",error:C.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{u(!1)}},E=setTimeout(()=>void y(),500);return()=>clearTimeout(E)},[]),Ts(w1,{children:[vr(k,{title:"Fund account"},"header"),vr(g7,{isSucccess:m,onClickCta:o}),vr(B,{})]})},y7=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:""},g7=({isSucccess:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=m7(()=>y7(e),[e]);return Ts(w1,{children:[Ts(E7,{children:[vr(w7,{isSucccess:e}),Ts(Je,{children:[vr("h3",{children:r}),vr(b7,{children:o})]})]}),n&&vr(F,{onClick:t,children:n})]})},C7=e=>e?"var(--privy-color-success)":"var(--privy-color-foreground-4)",v7=e=>e?p7:()=>vr(d7,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),w7=({isSucccess:e})=>{if(!e){let o="var(--privy-color-foreground-4)";return Ts("div",{style:{position:"relative"},children:[vr(st,{color:o,style:{position:"absolute"}}),vr(ja,{color:o}),vr(Vo,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let t=v7(e),r=C7(e);return vr("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&vr(t,{width:"4rem",height:"4rem",color:r})})},b7=g1.p`
1787
1787
  font-size: 1rem;
1788
1788
  color: var(--privy-color-foreground-3);
1789
1789
  margin-bottom: 1rem;
1790
1790
  display: flex;
1791
1791
  flex-direction: column;
1792
1792
  gap: 1rem;
1793
- `,b7=m1.div`
1793
+ `,E7=g1.div`
1794
1794
  display: flex;
1795
1795
  flex-direction: column;
1796
1796
  align-items: center;
@@ -1798,7 +1798,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1798
1798
  margin-left: 1.75rem;
1799
1799
  margin-right: 1.75rem;
1800
1800
  padding: 2rem 0;
1801
- `;import{getAddress as P1}from"@ethersproject/address";import D7 from"@heroicons/react/24/outline/PencilIcon";import U7 from"@heroicons/react/24/outline/WalletIcon";import{useEffect as x1,useRef as F7,useState as B7}from"react";import{ExclamationTriangleIcon as E7}from"@heroicons/react/24/outline";import T7 from"styled-components";import{jsx as A7,jsxs as P7}from"react/jsx-runtime";var g1=({children:e})=>P7(S7,{children:[A7(E7,{width:"3rem",color:"var(--privy-color-error)"}),e]}),S7=T7.div`
1801
+ `;import{getAddress as k1}from"@ethersproject/address";import U7 from"@heroicons/react/24/outline/PencilIcon";import F7 from"@heroicons/react/24/outline/WalletIcon";import{useEffect as _1,useRef as B7,useState as H7}from"react";import{ExclamationTriangleIcon as T7}from"@heroicons/react/24/outline";import S7 from"styled-components";import{jsx as A7,jsxs as x7}from"react/jsx-runtime";var b1=({children:e})=>x7(P7,{children:[A7(T7,{width:"3rem",color:"var(--privy-color-error)"}),e]}),P7=S7.div`
1802
1802
  display: flex;
1803
1803
  gap: 0.5rem;
1804
1804
  background-color: var(--privy-color-error-light);
@@ -1817,11 +1817,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1817
1817
  border: 1px solid var(--privy-color-error);
1818
1818
  border-radius: var(--privy-border-radius-sm);
1819
1819
  }
1820
- `;import{createPublicClient as x7,http as R7}from"viem";var qc=async({address:e,chain:t,rpcConfig:r,privyAppId:o})=>{try{let n=x7({chain:t,transport:R7(Uo(t,r,o))}),[i,a]=await Promise.all([n.readContract({abi:C1,address:e,functionName:"symbol"}),n.readContract({abi:C1,address:e,functionName:"decimals"})]);return{decimals:a,symbol:i}}catch(n){return console.log(n),null}},C1=[{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"}];import{ofetch as k7}from"ofetch";import{useEffect as _7,useRef as M7,useState as I7}from"react";var zc="moonpay",W7=new Set([Lr.id,Zr.id,Wr.id,Nr.id]),L7=new Set([Lr.id,Zr.id,ho.id,Wr.id,Nr.id]);function v1(e,t){switch(e){case Zr.id:return t==="native-currency"?"ETH_ARBITRUM":"USDC_ARBITRUM";case 43114:return"AVAX_CCHAIN";case Wr.id:return t==="native-currency"?"ETH_BASE":"USDC_BASE";case il.id:return"CELO_CELO";case Nr.id:return t==="native-currency"?"MATIC_POLYGON":"USDC_POLYGON";case Lr.id:return t==="native-currency"?"ETH_ETHEREUM":"USDC_ETHEREUM";default:return console.warn(`Chain ${e} not supported by Moonpay, defaulting to Ethereum mainnet`),"ETH_ETHEREUM"}}function w1(e){return parseFloat(e)}function b1(e){return!!e&&e.config!==void 0&&e.provider!==void 0}function E1(e){return!!e&&(e.chain!==void 0||e.amount!==void 0)}async function T1(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 N7(e,t){let r=t?am:im,o=t?lm:sm;return k7(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function S1(e,t=!1){let[r,o]=I7(null),{createAnalyticsEvent:n}=L(),{data:i,navigate:a,setModalData:l}=x(),s=i?.funding,d=M7(0);return _7(()=>{let u=setInterval(async()=>{if(e)try{let[m]=await N7(e,t),f=m.status==="waitingAuthorization"&&m.paymentMethod==="credit_debit_card"?"pending":m.status;if(["failed","completed","awaitingAuthorization"].includes(f)&&(n({eventName:wa,payload:{status:f,provider:zc,paymentMethod:m.paymentMethod,cardPaymentType:m.cardPaymentType,currency:m.currency?.code,baseCurrencyAmount:m.baseCurrencyAmount,quoteCurrencyAmount:m.quoteCurrencyAmount,feeAmount:m.feeAmount,extraFeeAmount:m.extraFeeAmount,networkFeeAmount:m.networkFeeAmount}}),clearInterval(u)),f==="failed"||f==="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(f)}catch(m){m.response?.status!==404&&(d.current+=1),d.current>=3&&(n({eventName:wa,payload:{status:"serviceFailure",provider:zc}}),clearInterval(u),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(u)},[e,d]),r}var A1=(e,t)=>{switch(t){case"native-currency":return W7.has(e);case"USDC":return L7.has(e);default:return console.warn("Unknown asset passed to MoonPay Onramp"),!1}};import{jsx as Kp,jsxs as O7}from"react/jsx-runtime";var ba=({size:e=61,...t})=>Kp("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:O7("g",{id:"moonpay_symbol_wht 2",children:[Kp("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),Kp("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});import{Fragment as R1,jsx as gt,jsxs as wn}from"react/jsx-runtime";var k1=()=>{let{wallets:e}=Bo(),{navigate:t,data:r,setModalData:o}=x(),n=Le(),i=r?.funding,a=F7(null),[l,s]=B7(!1);x1(()=>{a.current&&a.current.style.setProperty("--funding-input-length",Math.max(i.amount.length,1).toString())},[i.amount,a.current]);let d=n.fundingConfig?.methods.slice()??[],{tokenPrice:u}=_o({chainId:i.chain.id});x1(()=>{i.erc20Address&&i.chain&&!i.erc20ContractInfo&&qc({address:i.erc20Address,chain:i.chain,rpcConfig:n.rpcConfig,privyAppId:n.id}).then(E=>o({...r,funding:{...r.funding,erc20ContractInfo:E?{symbol:E.symbol,decimals:E.decimals}:void 0}})).catch(console.error)},[i.erc20Address,i.chain]);let m=u?Mi(i.amount,u):void 0,f=e.find(E=>P1(E.address)===P1(i.address)),g=f&&f.walletClientType!=="privy"?dn(f.walletClientType,f.connectorType,f.walletClientType):n.name,v=parseFloat(i.amount),C=!isNaN(v)&&v>0,b=!!(i.erc20Address&&!i.erc20ContractInfo),A=i.isUSDC?"USDC":i.erc20Address?void 0:"native-currency",_=A&&A1(Number(i.chain.id),A),S=A&&c1(Number(i.chain.id),A),P=i.erc20Address||!i.erc20Address&&!i.isUSDC;return wn(R1,{children:[gt(It,{}),wn("h3",{children:["Add funds to your"," ",g?.toLowerCase().endsWith("wallet")?g:g+" wallet"]}),gt(cn,{style:{marginTop:"32px"},children:gt(ya,{children:b?gt(ma,{size:"50px"}):wn(R1,{children:[wn(ga,{onClick:()=>a.current?.focus(),children:[gt(Zg,{ref:a,value:i.amount,onFocus:()=>s(!0),onBlur:()=>s(!1),onChange:E=>{let k=E.target.value;/^[0-9.]*$/.test(k)&&k.split(".").length-1<=1&&o({...r,funding:{...i,amount:k}})}}),gt(Ca,{children:i.erc20Address?i.erc20ContractInfo?.symbol:i.chain.nativeCurrency.symbol}),!l&&gt(Jg,{children:gt(D7,{width:12,height:12})})]}),!i.erc20Address&&gt(va,{children:m&&C?m:""})]})})}),wn(Xg,{children:[i.errorMessage&&gt(g1,{children:i.errorMessage}),d.sort().map(E=>{switch(E){case"moonpay":return _?wn(Pe,{disabled:!C||b,onClick:()=>{t("MOONPAY_PROMPT_SCREEN")},children:[gt(Fc,{children:gt(ba,{style:{width:24}})}),"Moonpay"]},E):null;case"coinbase-onramp":return S?wn(Pe,{disabled:!C||b,onClick:()=>{t("COINBASE_ONRAMP_STATUS_SCREEN")},children:[gt(Fc,{children:gt(Vo,{style:{width:24}})}),"Coinbase Onramp"]},E):null;case"external":return P?wn(Pe,{disabled:!C||b,onClick:()=>{t("FUNDING_TRANSFER_FROM_WALLET_SCREEN")},children:[gt(Fc,{children:gt(U7,{style:{width:24}})}),"Transfer from wallet"]},E):null}}),gt($g,{disabled:!C,onClick:()=>t("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),gt(G,{})]})};import{formatUnits as H7}from"@ethersproject/units";import V7 from"@heroicons/react/24/outline/DocumentDuplicateIcon";import G7 from"@heroicons/react/24/outline/InformationCircleIcon";import q7 from"@heroicons/react/24/outline/QrCodeIcon";import{useEffect as z7,useMemo as K7,useState as Yp}from"react";import Ea from"styled-components";import{Fragment as Kc,jsx as qe,jsxs as Nt}from"react/jsx-runtime";var Y7=2e3,_1=()=>{let{wallets:e}=Bo(),{app:t,data:r,setModalData:o,navigate:n,lastScreen:i}=x(),{chains:a,rpcConfig:l,appId:s,closePrivyModal:d}=L(),[u,m]=Yp("default"),[f,g]=Yp(void 0),v=r?.funding,{tokenPrice:C}=_o({chainId:v.chain.id}),b=C?Mi(v.amount,C):void 0,A=e.find(E=>Ut(E.address)===Ut(v.address)),_=A&&A.walletClientType!=="privy"?dn(A.walletClientType,A.connectorType,A.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"),qe(Kc,{});z7(()=>{let E=Ir(v.chain.id,a,l,{appId:s});function k(){E.getBalance(v.address).then(H=>g(parseFloat(H7(H,"ether")))).catch(()=>g(void 0))}let D=setInterval(k,Y7);return k(),()=>clearInterval(D)},[]);let S=K7(()=>f!==void 0?f>=parseFloat(v.amount):!1,[f,v.amount]),P=Nt(Kc,{children:[qe(_i,{title:"Your wallet",errMsg:void 0,isLoading:!v||f===void 0,isPulsing:!S,balance:`${f!==void 0?f.toPrecision(2):""} ETH`,address:v.address,statusColor:S?"green":"gray"}),S&&qe(e1,{onClick:()=>d(),children:"Close"})]});return u==="qr-code"?Nt(Kc,{children:[qe(R,{backFn:()=>m("default")}),Nt(cn,{style:{gap:"24px",marginBottom:"24px"},children:[Nt("div",{children:[qe(fe,{children:"Scan QR code"}),Nt(ye,{children:["Scan this code using your mobile wallet to send funds to your ",_," ","wallet."]})]}),qe(Cn,{url:v.address,size:200,squareLogoElement:Q7}),P]}),qe(G,{})]}):Nt(Kc,{children:[qe(It,{}),qe(ve,{title:"Send funds",description:"Send funds directly to your wallet by copying your wallet address or scanning a QR code."}),Nt(cn,{style:{gap:"16px"},children:[Nt(J7,{children:[qe(G7,{height:"20px",width:"20px",color:"var(--privy-color-accent-light)"}),Nt(j7,{children:["Make sure to send on ",v.chain.name,"."]})]}),Nt($7,{children:[qe(Xi,{height:16}),Nt(ya,{children:[Nt(ga,{children:[qe(Bc,{children:v.amount}),qe(Ca,{children:v.chain.nativeCurrency.symbol})]}),qe(va,{children:b?`${b} USD`:"..."}),Nt(jg,{children:[qe(ha,{chainId:v.chain.id,height:16,width:16})," ",v.chain.name]})]}),qe(Xi,{height:8}),Nt(Z7,{children:[qe(X7,{text:v.address}),qe(I1,{onClick:()=>m("qr-code"),children:Nt(M1,{children:[qe(q7,{height:"16px",width:"16px"}),"Scan code"]})})]})]}),P]}),qe(Xi,{height:16}),qe(G,{})]})},Q7=({...e})=>qe(xi,{color:"black",...e}),X7=e=>{let[t,r]=Yp(!1);return qe(I1,{onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},children:Nt(M1,{children:[t?qe(ua,{style:{height:"16px",width:"16px"},strokeWidth:"2"}):qe(V7,{style:{height:"16px",width:"16px"}}),t?"Copied":"Copy address"]})})},Z7=Ea.div`
1820
+ `;import{createPublicClient as R7,http as k7}from"viem";var Gc=async({address:e,chain:t,rpcConfig:r,privyAppId:o})=>{try{let n=R7({chain:t,transport:k7(Do(t,r,o))}),[i,a]=await Promise.all([n.readContract({abi:E1,address:e,functionName:"symbol"}),n.readContract({abi:E1,address:e,functionName:"decimals"})]);return{decimals:a,symbol:i}}catch(n){return console.log(n),null}},E1=[{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"}];import{ofetch as _7}from"ofetch";import{useEffect as I7,useRef as M7,useState as W7}from"react";var qc="moonpay",L7=new Set([_r.id,Qr.id,kr.id,Ir.id]),N7=new Set([_r.id,Qr.id,mo.id,kr.id,Ir.id]);function T1(e,t){switch(e){case Qr.id:return t==="native-currency"?"ETH_ARBITRUM":"USDC_ARBITRUM";case 43114:return"AVAX_CCHAIN";case kr.id:return t==="native-currency"?"ETH_BASE":"USDC_BASE";case al.id:return"CELO_CELO";case Ir.id:return t==="native-currency"?"MATIC_POLYGON":"USDC_POLYGON";case _r.id:return t==="native-currency"?"ETH_ETHEREUM":"USDC_ETHEREUM";default:return console.warn(`Chain ${e} not supported by Moonpay, defaulting to Ethereum mainnet`),"ETH_ETHEREUM"}}function S1(e){return parseFloat(e)}function P1(e){return!!e&&e.config!==void 0&&e.provider!==void 0}function zc(e){return!!e&&(e.chain!==void 0||e.amount!==void 0)}async function A1(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 O7(e,t){let r=t?cm:lm,o=t?pm:dm;return _7(`${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function x1(e,t=!1){let[r,o]=W7(null),{createAnalyticsEvent:n}=M(),{data:i,navigate:a,setModalData:l}=R(),s=i?.funding,d=M7(0);return I7(()=>{let u=setInterval(async()=>{if(e)try{let[m]=await O7(e,t),f=m.status==="waitingAuthorization"&&m.paymentMethod==="credit_debit_card"?"pending":m.status;if(["failed","completed","awaitingAuthorization"].includes(f)&&(n({eventName:Xo,payload:{status:f,provider:qc,paymentMethod:m.paymentMethod,cardPaymentType:m.cardPaymentType,currency:m.currency?.code,baseCurrencyAmount:m.baseCurrencyAmount,quoteCurrencyAmount:m.quoteCurrencyAmount,feeAmount:m.feeAmount,extraFeeAmount:m.extraFeeAmount,networkFeeAmount:m.networkFeeAmount,isSandbox:t}}),clearInterval(u)),f==="failed"||f==="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(f)}catch(m){m.response?.status!==404&&(d.current+=1),d.current>=3&&(n({eventName:Xo,payload:{status:"serviceFailure",provider:qc}}),clearInterval(u),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(u)},[e,d]),r}var R1=(e,t)=>{switch(t){case"native-currency":return L7.has(e);case"USDC":return N7.has(e);default:return console.warn("Unknown asset passed to MoonPay Onramp"),!1}};import{jsx as Zp,jsxs as D7}from"react/jsx-runtime";var Ta=({size:e=61,...t})=>Zp("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:D7("g",{id:"moonpay_symbol_wht 2",children:[Zp("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),Zp("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});import{Fragment as I1,jsx as gt,jsxs as bn}from"react/jsx-runtime";var M1=()=>{let{wallets:e}=Bo(),{navigate:t,data:r,setModalData:o}=R(),n=Me(),i=r?.funding,a=B7(null),[l,s]=H7(!1);_1(()=>{a.current&&a.current.style.setProperty("--funding-input-length",Math.max(i.amount.length,1).toString())},[i.amount,a.current]);let d=n.fundingConfig?.methods.slice()??[],{tokenPrice:u}=Ro({chainId:i.chain.id});_1(()=>{i.erc20Address&&i.chain&&!i.erc20ContractInfo&&Gc({address:i.erc20Address,chain:i.chain,rpcConfig:n.rpcConfig,privyAppId:n.id}).then(S=>o({...r,funding:{...r.funding,erc20ContractInfo:S?{symbol:S.symbol,decimals:S.decimals}:void 0}})).catch(console.error)},[i.erc20Address,i.chain]);let m=u?Ni(i.amount,u):void 0,f=e.find(S=>k1(S.address)===k1(i.address)),y=f&&f.walletClientType!=="privy"?pn(f.walletClientType,f.connectorType,f.walletClientType):n.name,E=parseFloat(i.amount),C=!isNaN(E)&&E>0,w=!!(i.erc20Address&&!i.erc20ContractInfo),P=i.isUSDC?"USDC":i.erc20Address?void 0:"native-currency",_=P&&R1(Number(i.chain.id),P),T=P&&m1(Number(i.chain.id),P),A=i.erc20Address||!i.erc20Address&&!i.isUSDC;return bn(I1,{children:[gt(_t,{}),bn("h3",{children:["Add funds to your"," ",y?.toLowerCase().endsWith("wallet")?y:y+" wallet"]}),gt(dn,{style:{marginTop:"32px"},children:gt(va,{children:w?gt(ya,{size:"50px"}):bn(I1,{children:[bn(wa,{onClick:()=>a.current?.focus(),children:[gt(e1,{ref:a,value:i.amount,onFocus:()=>s(!0),onBlur:()=>s(!1),onChange:S=>{let I=S.target.value;/^[0-9.]*$/.test(I)&&I.split(".").length-1<=1&&o({...r,funding:{...i,amount:I}})}}),gt(ba,{children:i.erc20Address?i.erc20ContractInfo?.symbol:i.chain.nativeCurrency.symbol}),!l&&gt(t1,{children:gt(U7,{width:12,height:12})})]}),!i.erc20Address&&gt(Ea,{children:m&&C?m:""})]})})}),bn($g,{children:[i.errorMessage&&gt(b1,{children:i.errorMessage}),d.sort().map(S=>{switch(S){case"moonpay":return _?bn(Te,{disabled:!C||w,onClick:()=>{t("MOONPAY_PROMPT_SCREEN")},children:[gt(Uc,{children:gt(Ta,{style:{width:24}})}),"Moonpay"]},S):null;case"coinbase-onramp":return T?bn(Te,{disabled:!C||w,onClick:()=>{t("COINBASE_ONRAMP_STATUS_SCREEN")},children:[gt(Uc,{children:gt(Vo,{style:{width:24}})}),"Coinbase Onramp"]},S):null;case"external":return A?bn(Te,{disabled:!C||w,onClick:()=>{t("FUNDING_TRANSFER_FROM_WALLET_SCREEN")},children:[gt(Uc,{children:gt(F7,{style:{width:24}})}),"Transfer from wallet"]},S):null}}),gt(o1,{disabled:!C,onClick:()=>t("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),gt(B,{})]})};import{formatUnits as V7}from"@ethersproject/units";import G7 from"@heroicons/react/24/outline/DocumentDuplicateIcon";import q7 from"@heroicons/react/24/outline/InformationCircleIcon";import z7 from"@heroicons/react/24/outline/QrCodeIcon";import{useEffect as K7,useMemo as Y7,useState as Jp}from"react";import Sa from"styled-components";import{Fragment as Kc,jsx as Ye,jsxs as Wt}from"react/jsx-runtime";var Q7=2e3,W1=()=>{let{wallets:e}=Bo(),{app:t,data:r,setModalData:o,navigate:n,lastScreen:i}=R(),{chains:a,rpcConfig:l,appId:s,closePrivyModal:d,createAnalyticsEvent:u}=M(),[m,f]=Jp("default"),[y,E]=Jp(void 0),C=r?.funding,{tokenPrice:w}=Ro({chainId:C.chain.id}),P=w?Ni(C.amount,w):void 0,_=e.find(I=>Yr(I.address)===Yr(C.address)),T=_&&_.walletClientType!=="privy"?pn(_.walletClientType,_.connectorType,_.walletClientType):t.name;if(!C)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"),Ye(Kc,{});K7(()=>{let I=Rr(C.chain.id,a,l,{appId:s});function N(){I.getBalance(C.address).then(x=>{let K=parseFloat(V7(x,"ether"));E(W=>(W&&K>W&&u({eventName:Xo,payload:{provider:"manual",status:"success",address:_?.address,value:(K-W).toString()}}),K))}).catch(()=>E(void 0))}let H=setInterval(N,Q7);return N(),()=>clearInterval(H)},[]);let A=Y7(()=>y!==void 0?y>=parseFloat(C.amount):!1,[y,C.amount]),S=Wt(Kc,{children:[Ye(Li,{title:"Your wallet",errMsg:void 0,isLoading:!C||y===void 0,isPulsing:!A,balance:`${y!==void 0?y.toPrecision(2):""} ETH`,address:C.address,statusColor:A?"green":"gray"}),A&&Ye(n1,{onClick:()=>d(),children:"Close"})]});return m==="qr-code"?Wt(Kc,{children:[Ye(k,{backFn:()=>f("default")}),Wt(dn,{style:{gap:"24px",marginBottom:"24px"},children:[Wt("div",{children:[Ye(ue,{children:"Scan QR code"}),Wt(fe,{children:["Scan this code using your mobile wallet to send funds to your ",T," ","wallet."]})]}),Ye(vn,{url:C.address,size:200,squareLogoElement:X7}),S]}),Ye(B,{})]}):Wt(Kc,{children:[Ye(_t,{}),Ye(ge,{title:"Send funds",description:"Send funds directly to your wallet by copying your wallet address or scanning a QR code."}),Wt(dn,{style:{gap:"16px"},children:[Wt(j7,{children:[Ye(q7,{height:"20px",width:"20px",color:"var(--privy-color-accent-light)"}),Wt($7,{children:["Make sure to send on ",C.chain.name,"."]})]}),Wt(e8,{children:[Ye($i,{height:16}),Wt(va,{children:[Wt(wa,{children:[Ye(Fc,{children:C.amount}),Ye(ba,{children:C.chain.nativeCurrency.symbol})]}),Ye(Ea,{children:P?`${P} USD`:"..."}),Wt(r1,{children:[Ye(Ca,{chainId:C.chain.id,height:16,width:16})," ",C.chain.name]})]}),Ye($i,{height:8}),Wt(J7,{children:[Ye(Z7,{text:C.address}),Ye(N1,{onClick:()=>f("qr-code"),children:Wt(L1,{children:[Ye(z7,{height:"16px",width:"16px"}),"Scan code"]})})]})]}),S]}),Ye($i,{height:16}),Ye(B,{})]})},X7=({...e})=>Ye(Ii,{color:"black",...e}),Z7=e=>{let[t,r]=Jp(!1);return Ye(N1,{onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},children:Wt(L1,{children:[t?Ye(ha,{style:{height:"16px",width:"16px"},strokeWidth:"2"}):Ye(G7,{style:{height:"16px",width:"16px"}}),t?"Copied":"Copy address"]})})},J7=Sa.div`
1821
1821
  display: flex;
1822
1822
  flex-direction: row;
1823
1823
  gap: 8px;
1824
- `,J7=Ea.div`
1824
+ `,j7=Sa.div`
1825
1825
  display: flex;
1826
1826
  flex-direction: row;
1827
1827
  padding: 8px;
@@ -1830,11 +1830,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1830
1830
  svg {
1831
1831
  margin-right: 12px;
1832
1832
  }
1833
- `,j7=Ea.div`
1833
+ `,$7=Sa.div`
1834
1834
  line-height: 20px;
1835
1835
  font-size: 18px
1836
1836
  text-align: center;
1837
- `,$7=Ea.div`
1837
+ `,e8=Sa.div`
1838
1838
  display: flex;
1839
1839
  flex-direction: column;
1840
1840
  background-color: var(--privy-color-background-2);
@@ -1844,11 +1844,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
1844
1844
  }
1845
1845
  padding: 16px;
1846
1846
  gap: 8px;
1847
- `,M1=Ea.span`
1847
+ `,L1=Sa.span`
1848
1848
  display: flex;
1849
1849
  align-items: center;
1850
1850
  margin: auto;
1851
- `,I1=Ea.button`
1851
+ `,N1=Sa.button`
1852
1852
  display: flex;
1853
1853
  align-items: center;
1854
1854
  width: 100%;
@@ -1885,7 +1885,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1885
1885
  width: 18px;
1886
1886
  height: 18px;
1887
1887
  }
1888
- `;import{useEffect as m8,useState as f8}from"react";import e8 from"@heroicons/react/24/outline/ClockIcon";import t8 from"@heroicons/react/24/outline/EyeSlashIcon";import r8 from"@heroicons/react/24/outline/LinkIcon";import Mo from"styled-components";import{Fragment as W1,jsx as Kt,jsxs as di}from"react/jsx-runtime";var Qp=({title:e,desc:t,icon:r})=>di(l8,{children:[Kt(d8,{children:r}),di(c8,{children:[Kt(a8,{children:e}),Kt(s8,{children:t})]})]}),L1=({app:e,signedUrl:t,onContinue:r})=>di(W1,{children:[di(n8,{children:[Kt(ba,{size:"3.75rem"}),di(i8,{children:[e?.name," uses ",Kt("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),di(p8,{children:[Kt(Qp,{icon:Kt(r8,{width:"1rem"}),title:"Purchase assets to fund your account",desc:di(W1,{children:["Connect a payment method (",Kt("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),Kt(Qp,{icon:Kt(e8,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),Kt(Qp,{icon:Kt(t8,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),Kt(u8,{className:"mobile-only"})]}),Kt(o8,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),Kt(zl,{disabled:!t,href:t??"#",target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),o8=Mo.span`
1888
+ `;import{useEffect as f8,useState as h8}from"react";import t8 from"@heroicons/react/24/outline/ClockIcon";import r8 from"@heroicons/react/24/outline/EyeSlashIcon";import o8 from"@heroicons/react/24/outline/LinkIcon";import ko from"styled-components";import{Fragment as O1,jsx as qt,jsxs as fi}from"react/jsx-runtime";var jp=({title:e,desc:t,icon:r})=>fi(c8,{children:[qt(p8,{children:r}),fi(d8,{children:[qt(s8,{children:e}),qt(l8,{children:t})]})]}),D1=({app:e,signedUrl:t,onContinue:r})=>fi(O1,{children:[fi(i8,{children:[qt(Ta,{size:"3.75rem"}),fi(a8,{children:[e?.name," uses ",qt("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),fi(u8,{children:[qt(jp,{icon:qt(o8,{width:"1rem"}),title:"Purchase assets to fund your account",desc:fi(O1,{children:["Connect a payment method (",qt("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),qt(jp,{icon:qt(t8,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),qt(jp,{icon:qt(r8,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),qt(m8,{className:"mobile-only"})]}),qt(n8,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),qt(ql,{disabled:!t,href:t??"#",target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),n8=ko.span`
1889
1889
  display: inline-block;
1890
1890
  color: var(--privy-color-foreground-3);
1891
1891
  text-align: center;
@@ -1894,13 +1894,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
1894
1894
  font-weight: 400;
1895
1895
  line-height: 140%; /* 0.875rem */
1896
1896
  margin-bottom: 0.25rem;
1897
- `,n8=Mo.div`
1897
+ `,i8=ko.div`
1898
1898
  display: flex;
1899
1899
  flex-direction: column;
1900
1900
  align-items: center;
1901
1901
  justify-content: center;
1902
1902
  padding: 1.5rem 0;
1903
- `,i8=Mo.span`
1903
+ `,a8=ko.span`
1904
1904
  color: var(--privy-color-foreground);
1905
1905
  text-align: center;
1906
1906
  font-size: 1.125rem;
@@ -1909,46 +1909,46 @@ You will need this password to access your ${e} wallet on a new device. Please k
1909
1909
  margin: 1.5rem 0;
1910
1910
  text-align: center;
1911
1911
  max-width: 19.5rem;
1912
- `,a8=Mo.span`
1912
+ `,s8=ko.span`
1913
1913
  color: var(--privy-color-foreground);
1914
1914
  font-size: 0.875rem;
1915
1915
  font-weight: 500;
1916
1916
  line-height: 1.225rem;
1917
1917
  width: 100%;
1918
- `,s8=Mo.span`
1918
+ `,l8=ko.span`
1919
1919
  color: var(--privy-color-foreground-2);
1920
1920
  font-size: 0.875rem;
1921
1921
  font-weight: 400;
1922
1922
  line-height: 1.225rem;
1923
- `,l8=Mo.div`
1923
+ `,c8=ko.div`
1924
1924
  display: flex;
1925
1925
  align-items: flex-start;
1926
1926
  gap: 0.5rem;
1927
1927
  align-self: stretch;
1928
- `,c8=Mo.div`
1928
+ `,d8=ko.div`
1929
1929
  display: flex;
1930
1930
  flex-direction: column;
1931
1931
  gap: 0.25rem;
1932
1932
  align-items: flex-start;
1933
1933
  text-align: left;
1934
1934
  flex: 1 0 0;
1935
- `,d8=Mo.div`
1935
+ `,p8=ko.div`
1936
1936
  padding-top: 2px;
1937
- `,p8=Mo.div`
1937
+ `,u8=ko.div`
1938
1938
  display: flex;
1939
1939
  flex-direction: column;
1940
1940
  gap: 1.25rem;
1941
1941
  margin: 0 0.5rem;
1942
- `,u8=Mo.div`
1942
+ `,m8=ko.div`
1943
1943
  margin: 30px 0;
1944
- `;import{Fragment as h8,jsx as Xp,jsxs as y8}from"react/jsx-runtime";var N1=()=>{let{app:e,data:t,navigate:r,setModalData:o}=x(),{createAnalyticsEvent:n,getMoonpaySignedUrl:i}=L(),[a,l]=f8(null),s=t?.funding,d=s.isUSDC?"USDC":"native-currency";return m8(()=>{if(a||!s)return;async function u(){if(!e.fundingConfig)return;let{signedUrl:m,externalTransactionId:f}=await i(s.address,{...e.fundingMethodConfig.moonpay,...s.moonpayConfigOverride,currencyCode:s.moonpayConfigOverride?.currencyCode??v1(s.chain.id,d),quoteCurrencyAmount:s.moonpayConfigOverride?.quoteCurrencyAmount??w1(s.amount)});l(m),o({moonpayStatus:{externalTransactionId:f},funding:t?.funding})}u()},[a,s]),y8(h8,{children:[Xp(It,{}),Xp(L1,{app:e,signedUrl:a,onContinue:()=>{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:zc}}),r("MOONPAY_STATUS_SCREEN")}}),Xp(G,{})]})};import g8 from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import C8 from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as v8}from"react";import O1 from"styled-components";import{Fragment as U1,jsx as Sr,jsxs as Ts}from"react/jsx-runtime";var D1=()=>{let{app:e,data:t}=x(),{closePrivyModal:r}=L(),{externalTransactionId:o}=t?.moonpayStatus,n=S1(o||null,e.fundingMethodConfig.moonpay.useSandbox??!1);return Ts(U1,{children:[Sr(R,{title:"Fund account"},"header"),Sr(b8,{status:n,onClickCta:r}),Sr(G,{})]})},w8=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:""}}},b8=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=v8(()=>w8(e),[e]);return Ts(U1,{children:[Ts(P8,{children:[Sr(S8,{status:e}),Ts(Qe,{children:[Sr("h3",{children:r}),Sr(A8,{children:o})]})]}),n&&Sr(F,{onClick:t,children:n})]})},E8=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)",T8=e=>{switch(e){case"completed":return C8;case"waitingAuthorization":return()=>Sr(g8,{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}},S8=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return Ts("div",{style:{position:"relative"},children:[Sr(at,{color:o,style:{position:"absolute"}}),Sr(Ja,{color:o}),Sr(ba,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=T8(e),r=E8(e);return Sr("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&Sr(t,{width:"4rem",height:"4rem",color:r})})},A8=O1.p`
1944
+ `;import{Fragment as y8,jsx as $p,jsxs as g8}from"react/jsx-runtime";var U1=()=>{let{app:e,data:t,navigate:r,setModalData:o}=R(),{createAnalyticsEvent:n,getMoonpaySignedUrl:i}=M(),[a,l]=h8(null),s=t?.funding,d=s.isUSDC?"USDC":"native-currency";return f8(()=>{if(a||!s)return;async function u(){if(!e.fundingConfig)return;let{signedUrl:m,externalTransactionId:f}=await i(s.address,{...e.fundingMethodConfig.moonpay,...s.moonpayConfigOverride,currencyCode:s.moonpayConfigOverride?.currencyCode??T1(s.chain.id,d),quoteCurrencyAmount:s.moonpayConfigOverride?.quoteCurrencyAmount??S1(s.amount)});l(m),o({moonpayStatus:{externalTransactionId:f},funding:t?.funding})}u()},[a,s]),g8(y8,{children:[$p(_t,{}),$p(D1,{app:e,signedUrl:a,onContinue:()=>{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:qc}}),r("MOONPAY_STATUS_SCREEN")}}),$p(B,{})]})};import C8 from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import v8 from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as w8}from"react";import F1 from"styled-components";import{Fragment as H1,jsx as wr,jsxs as Ss}from"react/jsx-runtime";var B1=()=>{let{app:e,data:t}=R(),{closePrivyModal:r}=M(),{externalTransactionId:o}=t?.moonpayStatus,n=x1(o||null,e.fundingMethodConfig.moonpay.useSandbox??!1);return Ss(H1,{children:[wr(k,{title:"Fund account"},"header"),wr(E8,{status:n,onClickCta:r}),wr(B,{})]})},b8=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:""}}},E8=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=w8(()=>b8(e),[e]);return Ss(H1,{children:[Ss(x8,{children:[wr(P8,{status:e}),Ss(Je,{children:[wr("h3",{children:r}),wr(A8,{children:o})]})]}),n&&wr(F,{onClick:t,children:n})]})},T8=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)",S8=e=>{switch(e){case"completed":return v8;case"waitingAuthorization":return()=>wr(C8,{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}},P8=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return Ss("div",{style:{position:"relative"},children:[wr(st,{color:o,style:{position:"absolute"}}),wr(ja,{color:o}),wr(Ta,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=S8(e),r=T8(e);return wr("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&wr(t,{width:"4rem",height:"4rem",color:r})})},A8=F1.p`
1945
1945
  font-size: 1rem;
1946
1946
  color: var(--privy-color-foreground-3);
1947
1947
  margin-bottom: 1rem;
1948
1948
  display: flex;
1949
1949
  flex-direction: column;
1950
1950
  gap: 1rem;
1951
- `,P8=O1.div`
1951
+ `,x8=F1.div`
1952
1952
  display: flex;
1953
1953
  flex-direction: column;
1954
1954
  align-items: center;
@@ -1956,7 +1956,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
1956
1956
  margin-left: 1.75rem;
1957
1957
  margin-right: 1.75rem;
1958
1958
  padding: 2rem 0;
1959
- `;import{useEffect as L8,useState as N8}from"react";import x8,{css as R8}from"styled-components";import{jsx as _8}from"react/jsx-runtime";var Yc=()=>{let{enabled:e,token:t}=Ae(),{navigate:r,setModalData:o}=x(),{initLoginWithPasskey:n}=L();return _8(Zp,{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"})},k8=R8`
1959
+ `;import{useEffect as N8,useState as O8}from"react";import R8,{css as k8}from"styled-components";import{jsx as I8}from"react/jsx-runtime";var Yc=()=>{let{enabled:e,token:t}=Ee(),{navigate:r,setModalData:o}=R(),{initLoginWithPasskey:n}=M();return I8(eu,{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"})},_8=k8`
1960
1960
  && {
1961
1961
  width: 100%;
1962
1962
  font-size: 0.875rem;
@@ -1981,9 +1981,9 @@ You will need this password to access your ${e} wallet on a new device. Please k
1981
1981
  box-shadow: none;
1982
1982
  }
1983
1983
  }
1984
- `,Zp=x8.button`
1985
- ${k8}
1986
- `;import M8 from"@heroicons/react/24/outline/ChevronRightIcon";import I8 from"@heroicons/react/24/outline/WalletIcon";import{jsx as Jp,jsxs as W8}from"react/jsx-runtime";var Qc=({onClick:e,text:t})=>W8(Pe,{onClick:e,children:[Jp(I8,{}),Jp(gr,{children:t}),Jp(M8,{})]});import{Fragment as F1,jsx as bn,jsxs as Xc}from"react/jsx-runtime";var B1=()=>{let{connectors:e}=L(),{app:t,setModalData:r,data:o,navigate:n}=x(),[i,a]=N8("default"),l=pn(t.appearance.walletList,e,!0,t.appearance.walletList,t.externalWallets.walletConnect.enabled),s=bn(Qc,{text:"More wallets",onClick:()=>a("overflow")});return L8(()=>{r({...o,externalConnectWallet:{onCompleteNavigateTo:"FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"}})},[]),i==="overflow"?Xc(F1,{children:[bn(R,{backFn:()=>a("default")},"header"),Xc(nr,{children:[bn(Hr,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),l]}),bn(G,{})]}):Xc(F1,{children:[bn(It,{}),bn(ve,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),Xc(nr,{children:[...l.length>3?l.slice(0,2):l,l.length>3&&s,bn(Zp,{onClick:()=>n("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),bn(G,{})]})};import O8 from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import D8 from"styled-components";import{Fragment as F8,jsx as En,jsxs as B8}from"react/jsx-runtime";var H1=()=>{let{closePrivyModal:e}=L();return B8(F8,{children:[En(R,{},"header"),En(U8,{children:En(O8,{style:{width:32,height:32}})}),En(Ao,{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"}}),En(lr,{children:En(F,{onClick:()=>e(),children:"Close"})}),En(ne,{}),En(G,{})]})},U8=D8.div`
1984
+ `,eu=R8.button`
1985
+ ${_8}
1986
+ `;import M8 from"@heroicons/react/24/outline/ChevronRightIcon";import W8 from"@heroicons/react/24/outline/WalletIcon";import{jsx as tu,jsxs as L8}from"react/jsx-runtime";var Qc=({onClick:e,text:t})=>L8(Te,{onClick:e,children:[tu(W8,{}),tu(mr,{children:t}),tu(M8,{})]});import{Fragment as V1,jsx as En,jsxs as Xc}from"react/jsx-runtime";var G1=()=>{let{connectors:e}=M(),{app:t,setModalData:r,data:o,navigate:n}=R(),[i,a]=O8("default"),l=un(t.appearance.walletList,e,!0,t.appearance.walletList,t.externalWallets.walletConnect.enabled),s=En(Qc,{text:"More wallets",onClick:()=>a("overflow")});return N8(()=>{r({...o,externalConnectWallet:{onCompleteNavigateTo:"FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"}})},[]),i==="overflow"?Xc(V1,{children:[En(k,{backFn:()=>a("default")},"header"),Xc(tr,{children:[En(Dr,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),l]}),En(B,{})]}):Xc(V1,{children:[En(_t,{}),En(ge,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),Xc(tr,{children:[...l.length>3?l.slice(0,2):l,l.length>3&&s,En(eu,{onClick:()=>n("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),En(B,{})]})};import D8 from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import U8 from"styled-components";import{Fragment as B8,jsx as Tn,jsxs as H8}from"react/jsx-runtime";var q1=()=>{let{closePrivyModal:e}=M();return H8(B8,{children:[Tn(k,{},"header"),Tn(F8,{children:Tn(D8,{style:{width:32,height:32}})}),Tn(To,{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"}}),Tn(ir,{children:Tn(F,{onClick:()=>e(),children:"Close"})}),Tn(re,{}),Tn(B,{})]})},F8=U8.div`
1987
1987
  border-radius: 50%;
1988
1988
  height: 68px;
1989
1989
  width: 68px;
@@ -1993,18 +1993,18 @@ You will need this password to access your ${e} wallet on a new device. Please k
1993
1993
  background-color: var(--privy-color-accent);
1994
1994
  color: white;
1995
1995
  margin: 0 auto 24px auto;
1996
- `;import*as z1 from"react-device-detect";import q8 from"styled-components";import jp from"styled-components";import{jsx as V1}from"react/jsx-runtime";var G1=({style:e,...t})=>V1("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:V1("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})});import{jsx as V8,jsxs as G8}from"react/jsx-runtime";var q1=jp.div`
1996
+ `;import*as Q1 from"react-device-detect";import z8 from"styled-components";import ru from"styled-components";import{jsx as z1}from"react/jsx-runtime";var K1=({style:e,...t})=>z1("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:z1("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})});import{jsx as G8,jsxs as q8}from"react/jsx-runtime";var Y1=ru.div`
1997
1997
  display: flex;
1998
1998
  flex-direction: column;
1999
1999
  justify-content: flex-start;
2000
2000
  gap: 4px;
2001
- `,$p=jp.div`
2001
+ `,ou=ru.div`
2002
2002
  &&& {
2003
2003
  margin-left: 7px; /* TODO: This is a total hack */
2004
2004
  border-left: 2px solid var(--privy-color-foreground-4);
2005
2005
  height: 12px;
2006
2006
  }
2007
- `,Zc=({children:e})=>G8(H8,{children:[V8(G1,{style:{width:"16px",height:"16px"}}),e]}),H8=jp.div`
2007
+ `,Zc=({children:e})=>q8(V8,{children:[G8(K1,{style:{width:"16px",height:"16px"}}),e]}),V8=ru.div`
2008
2008
  display: flex;
2009
2009
  justify-content: flex-start;
2010
2010
  justify-items: center;
@@ -2022,22 +2022,22 @@ You will need this password to access your ${e} wallet on a new device. Please k
2022
2022
  margin-bottom: auto;
2023
2023
  }
2024
2024
  }
2025
- `;import{Fragment as Y8,jsx as Pt,jsxs as Ss}from"react/jsx-runtime";var z8=()=>Ss(K8,{children:[Pt($n,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),Pt(St,{children:Pt(bo,{style:{width:"152px",height:"152px"}})}),Ss(q1,{children:[Pt(Zc,{children:Ss("div",{children:[Pt("span",{children:"Install the "}),Pt("a",{href:z1.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"})]})}),Pt($p,{}),Pt(Zc,{children:"Set up your first wallet"}),Pt($p,{}),Pt(Zc,{children:"Store your recovery phrase in a safe place!"})]}),Pt(sn,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),K1=()=>{let{navigateBack:e}=x();return Ss(Y8,{children:[Pt(R,{backFn:e},"header"),Pt(oe,{}),Pt(z8,{}),Pt(ne,{}),Ss(Z,{children:[Pt("span",{children:"Still not sure? "}),Pt("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},K8=q8(St)`
2025
+ `;import{Fragment as Q8,jsx as St,jsxs as Ps}from"react/jsx-runtime";var K8=()=>Ps(Y8,{children:[St(ri,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),St(Et,{children:St(vo,{style:{width:"152px",height:"152px"}})}),Ps(Y1,{children:[St(Zc,{children:Ps("div",{children:[St("span",{children:"Install the "}),St("a",{href:Q1.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"})]})}),St(ou,{}),St(Zc,{children:"Set up your first wallet"}),St(ou,{}),St(Zc,{children:"Store your recovery phrase in a safe place!"})]}),St(ln,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),X1=()=>{let{navigateBack:e}=R();return Ps(Q8,{children:[St(k,{backFn:e},"header"),St(te,{}),St(K8,{}),St(re,{}),Ps(J,{children:[St("span",{children:"Still not sure? "}),St("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},Y8=z8(Et)`
2026
2026
  gap: 30px;
2027
2027
 
2028
2028
  > :first-child > svg {
2029
2029
  margin-top: 20px;
2030
2030
  }
2031
- `;import D9 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as U9,useState as d2}from"react";import F9 from"styled-components";var Q8={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:",guest:"guest"},Tn=e=>{let t=Q8[e];return e==="wallet"||e==="phone"?{displayName:e,loginMethod:t}:{displayName:t,loginMethod:t}};import J8 from"styled-components";import X8 from"react";import{jsx as Z8}from"react/jsx-runtime";var Y1=()=>{let{app:e}=x(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?Z8("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?X8.cloneElement(t,{alt:r,style:o}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};import{jsx as Q1}from"react/jsx-runtime";var Jc=e=>{let{app:t}=x();return t?.appearance.logo?Q1(j8,{...e,children:Q1(Y1,{})}):null},j8=J8.div`
2031
+ `;import U9 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as F9,useState as m2}from"react";import B9 from"styled-components";var X8={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:",guest:"guest"},Sn=e=>{let t=X8[e];return e==="wallet"||e==="phone"?{displayName:e,loginMethod:t}:{displayName:t,loginMethod:t}};import j8 from"styled-components";import Z8 from"react";import{jsx as J8}from"react/jsx-runtime";var Z1=()=>{let{app:e}=R(),t=e?.appearance?.logo,r=`${e?.name} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?J8("img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?Z8.cloneElement(t,{alt:r,style:o}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};import{jsx as J1}from"react/jsx-runtime";var Jc=e=>{let{app:t}=R();return t?.appearance.logo?J1($8,{...e,children:J1(Z1,{})}):null},$8=j8.div`
2032
2032
  display: flex;
2033
2033
  flex-direction: column;
2034
2034
  align-items: center;
2035
2035
  padding: 24px 0;
2036
2036
  flex-grow: 1;
2037
2037
  justify-content: center;
2038
- `;import n9 from"@heroicons/react/24/outline/EnvelopeIcon";import{useRef as i9}from"react";import $8 from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as e9,useState as eu}from"react";import Z1 from"styled-components";import{Fragment as o9,jsx as pi,jsxs as X1}from"react/jsx-runtime";var jc=e9((e,t)=>{let[r,o]=eu(e.defaultValue||""),[n,i]=eu(!1),{authenticated:a}=K(),{initLoginWithEmail:l}=L(),{navigate:s,setModalData:d,currentScreen:u}=x(),{enabled:m,token:f}=Ae(),[g,v]=eu(!1),{accountType:C}=xt(),b=Js(r),A=n,_=n||!b,S=E=>{i(!0),l(r,E).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(k=>{d({errorModalData:{error:k,previousScreen:u||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},P=()=>{m&&!f&&!a?(d({captchaModalData:{callback:E=>l(r,E),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):S(f)};return X1(o9,{children:[pi(t9,{children:X1(r9,{stacked:e.stacked,children:[pi($8,{}),pi("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onFocus:()=>v(!0),onChange:E=>o(E.target.value),onKeyUp:E=>{E.key==="Enter"&&P()},value:r,autoComplete:"email"}),C==="email"&&!g?pi($t,{color:"gray",children:"Recent"}):e.stacked?pi("span",{}):pi(Ki,{isSubmitting:A,onClick:P,disabled:_,children:"Submit"})]})}),e.stacked?pi(F,{loadingText:null,loading:A,disabled:_,onClick:P,children:"Submit"}):null]})}),t9=Z1.div`
2038
+ `;import i9 from"@heroicons/react/24/outline/EnvelopeIcon";import{useRef as a9}from"react";import e9 from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as t9,useState as nu}from"react";import $1 from"styled-components";import{Fragment as n9,jsx as hi,jsxs as j1}from"react/jsx-runtime";var jc=t9((e,t)=>{let[r,o]=nu(e.defaultValue||""),[n,i]=nu(!1),{authenticated:a}=V(),{initLoginWithEmail:l}=M(),{navigate:s,setModalData:d,currentScreen:u,data:m}=R(),{enabled:f,token:y}=Ee(),[E,C]=nu(!1),{accountType:w}=Pt(),P=Zs(r),_=n,T=n||!P,A=I=>{i(!0),l(r,I,m?.login?.disableSignup).then(()=>{s("AWAITING_PASSWORDLESS_CODE")}).catch(N=>{d({errorModalData:{error:N,previousScreen:u||"LANDING"}}),s("ERROR_SCREEN")}).finally(()=>{i(!1)})},S=()=>{f&&!y&&!a?(d({captchaModalData:{callback:I=>l(r,I),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),s("CAPTCHA_SCREEN")):A(y)};return j1(n9,{children:[hi(r9,{children:j1(o9,{stacked:e.stacked,children:[hi(e9,{}),hi("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onFocus:()=>C(!0),onChange:I=>o(I.target.value),onKeyUp:I=>{I.key==="Enter"&&S()},value:r,autoComplete:"email"}),w==="email"&&!E?hi(Jt,{color:"gray",children:"Recent"}):e.stacked?hi("span",{}):hi(Zi,{isSubmitting:_,onClick:S,disabled:T,children:"Submit"})]})}),e.stacked?hi(F,{loadingText:null,loading:_,disabled:T,onClick:S,children:"Submit"}):null]})}),r9=$1.div`
2039
2039
  width: 100%;
2040
- `,r9=Z1.label`
2040
+ `,o9=$1.label`
2041
2041
  display: block;
2042
2042
  position: relative;
2043
2043
  width: 100%;
@@ -2104,11 +2104,11 @@ You will need this password to access your ${e} wallet on a new device. Please k
2104
2104
  && > input::placeholder {
2105
2105
  color: var(--privy-color-foreground-3);
2106
2106
  }
2107
- `;import{Fragment as a9,jsx as $c,jsxs as J1}from"react/jsx-runtime";var ed=({isEditable:e,setIsEditable:t,defaultValue:r})=>{let o=i9(null);return J1(a9,{children:[$c(eo,{if:!e,children:$c(jc,{ref:o,defaultValue:r})}),$c(eo,{if:e,children:J1(Pe,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[$c(n9,{})," Continue with Email"]})})]})};import{useState as s9}from"react";import l9 from"styled-components";import{jsx as tu,jsxs as d9}from"react/jsx-runtime";var td=()=>{let[e,t]=s9(!1),{currentScreen:r,navigate:o,setModalData:n}=x(),{enabled:i,token:a}=Ae(),{initLoginWithFarcaster:l}=L(),{accountType:s}=xt();return d9(Pe,{onClick:async()=>{t(!0);try{i&&!a?(n({captchaModalData:{callback:u=>l(u),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):(await l(a),o("AWAITING_FARCASTER_CONNECTION"))}catch(u){n({errorModalData:{error:u,previousScreen:r||"LANDING"}}),o("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[tu(Ro,{})," Farcaster",e&&tu(Eo,{}),s==="farcaster"&&tu(c9,{color:"gray",children:"Recent"})]})},c9=l9($t)`
2107
+ `;import{Fragment as s9,jsx as $c,jsxs as e2}from"react/jsx-runtime";var ed=({isEditable:e,setIsEditable:t,defaultValue:r})=>{let o=a9(null);return e2(s9,{children:[$c(jr,{if:!e,children:$c(jc,{ref:o,defaultValue:r})}),$c(jr,{if:e,children:e2(Te,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[$c(i9,{})," Continue with Email"]})})]})};import{useState as l9}from"react";import c9 from"styled-components";import{jsx as iu,jsxs as p9}from"react/jsx-runtime";var td=()=>{let[e,t]=l9(!1),{currentScreen:r,navigate:o,setModalData:n,data:i}=R(),{enabled:a,token:l}=Ee(),{initLoginWithFarcaster:s}=M(),{accountType:d}=Pt();return p9(Te,{onClick:async()=>{t(!0);try{a&&!l?(n({captchaModalData:{callback:m=>s(m,i?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):(await s(l,i?.login?.disableSignup),o("AWAITING_FARCASTER_CONNECTION"))}catch(m){n({errorModalData:{error:m,previousScreen:r||"LANDING"}}),o("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[iu(Ao,{})," Farcaster",e&&iu(wo,{}),d==="farcaster"&&iu(d9,{color:"gray",children:"Recent"})]})},d9=c9(Jt)`
2108
2108
  margin-left: auto;
2109
- `;import T9 from"@heroicons/react/24/outline/PhoneIcon";import{useRef as S9}from"react";import{forwardRef as C9,useEffect as v9,useState as nd}from"react";import i2 from"styled-components";import p9 from"libphonenumber-js/examples.mobile.json";import{isPossiblePhoneNumber as u9,AsYouType as j1,getCountries as m9,getCountryCallingCode as rd,getExampleNumber as f9}from"libphonenumber-js/min";import{jsx as g9,jsxs as y9}from"react/jsx-runtime";var As=(e,t)=>u9(String(e),t),od=(e,t)=>`+${rd(t)} ${e}`,$1=e=>`*${e.replaceAll("-","").slice(-4)}`,e2=e=>new j1(e),h9=m9().map(e=>({code:e,callCode:rd(e)})),t2=e=>{let t=f9(e,p9)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},r2=({value:e,onChange:t})=>g9("select",{value:e,onChange:t,children:h9.map(r=>y9("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))}),o2=e=>{let t=new j1;t.input(e);let r=t.getCountry()||"US",o=t.getCallingCode()||"1";return{countryCode:r,phone:e.replace("+"+o,"")}};import{Fragment as E9,jsx as ui,jsxs as n2}from"react/jsx-runtime";var Sn=C9((e,t)=>{let{app:r}=x(),[o,n]=nd(!1),{accountType:i}=xt(),[a,l]=nd(""),[s,d]=nd(r?.intl.defaultCountry??"US"),u=As(a,s),m=e2(s),f=t2(s),g=rd(s),v=!u,[C,b]=nd(!1),A=g.length,_=E=>{let k=E.target.value;d(k),l(""),e.onChange&&e.onChange({rawPhoneNumber:a,qualifiedPhoneNumber:od(a,k),countryCode:k,isValid:As(a,s)})},S=(E,k)=>{try{let D=E.replace(/\D/g,""),H=a.replace(/\D/g,""),M=D===H?E:m.input(E);l(M),e.onChange&&e.onChange({rawPhoneNumber:M,qualifiedPhoneNumber:od(E,k),countryCode:k,isValid:As(E,k)})}catch(D){console.error("Error processing phone number:",D)}},P=()=>{b(!0);let E=od(a,s);e.onSubmit({rawPhoneNumber:a,qualifiedPhoneNumber:E,countryCode:s,isValid:As(a,s)}).finally(()=>b(!1))};return v9(()=>{if(e.defaultValue){let E=o2(e.defaultValue);m.reset(),_({target:{value:E.countryCode}}),S(E.phone,E.countryCode)}},[e.defaultValue]),n2(E9,{children:[ui(w9,{children:n2(b9,{callingCodeLength:A,stacked:e.stacked,children:[ui(r2,{value:s,onChange:_}),ui("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:f,onFocus:()=>n(!0),onChange:E=>{S(E.target.value,s)},onKeyUp:E=>{E.key==="Enter"&&P()},value:a,autoComplete:"tel"}),i==="phone"&&!o&&!e.hideRecent?ui($t,{color:"gray",children:"Recent"}):!e.stacked&&!e.noIncludeSubmitButton?ui(Ki,{isSubmitting:C,onClick:P,disabled:v,children:"Submit"}):ui("span",{})]})}),e.stacked&&!e.noIncludeSubmitButton?ui(F,{loading:C,loadingText:null,onClick:P,disabled:v,children:"Submit"}):null]})}),w9=i2.div`
2109
+ `;import S9 from"@heroicons/react/24/outline/PhoneIcon";import{useRef as P9}from"react";import{forwardRef as v9,useEffect as w9,useState as nd}from"react";import l2 from"styled-components";import u9 from"libphonenumber-js/examples.mobile.json";import{isPossiblePhoneNumber as m9,AsYouType as t2,getCountries as f9,getCountryCallingCode as rd,getExampleNumber as h9}from"libphonenumber-js/min";import{jsx as C9,jsxs as g9}from"react/jsx-runtime";var As=(e,t)=>m9(String(e),t),od=(e,t)=>`+${rd(t)} ${e}`,r2=e=>`*${e.replaceAll("-","").slice(-4)}`,o2=e=>new t2(e),y9=f9().map(e=>({code:e,callCode:rd(e)})),n2=e=>{let t=h9(e,u9)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},i2=({value:e,onChange:t})=>C9("select",{value:e,onChange:t,children:y9.map(r=>g9("option",{value:r.code,children:[r.code," +",r.callCode]},r.code))}),a2=e=>{let t=new t2;t.input(e);let r=t.getCountry()||"US",o=t.getCallingCode()||"1";return{countryCode:r,phone:e.replace("+"+o,"")}};import{Fragment as T9,jsx as yi,jsxs as s2}from"react/jsx-runtime";var Pn=v9((e,t)=>{let{app:r}=R(),[o,n]=nd(!1),{accountType:i}=Pt(),[a,l]=nd(""),[s,d]=nd(r?.intl.defaultCountry??"US"),u=As(a,s),m=o2(s),f=n2(s),y=rd(s),E=!u,[C,w]=nd(!1),P=y.length,_=S=>{let I=S.target.value;d(I),l(""),e.onChange&&e.onChange({rawPhoneNumber:a,qualifiedPhoneNumber:od(a,I),countryCode:I,isValid:As(a,s)})},T=(S,I)=>{try{let N=S.replace(/\D/g,""),H=a.replace(/\D/g,""),x=N===H?S:m.input(S);l(x),e.onChange&&e.onChange({rawPhoneNumber:x,qualifiedPhoneNumber:od(S,I),countryCode:I,isValid:As(S,I)})}catch(N){console.error("Error processing phone number:",N)}},A=()=>{w(!0);let S=od(a,s);e.onSubmit({rawPhoneNumber:a,qualifiedPhoneNumber:S,countryCode:s,isValid:As(a,s)}).finally(()=>w(!1))};return w9(()=>{if(e.defaultValue){let S=a2(e.defaultValue);m.reset(),_({target:{value:S.countryCode}}),T(S.phone,S.countryCode)}},[e.defaultValue]),s2(T9,{children:[yi(b9,{children:s2(E9,{callingCodeLength:P,stacked:e.stacked,children:[yi(i2,{value:s,onChange:_}),yi("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:f,onFocus:()=>n(!0),onChange:S=>{T(S.target.value,s)},onKeyUp:S=>{S.key==="Enter"&&A()},value:a,autoComplete:"tel"}),i==="phone"&&!o&&!e.hideRecent?yi(Jt,{color:"gray",children:"Recent"}):!e.stacked&&!e.noIncludeSubmitButton?yi(Zi,{isSubmitting:C,onClick:A,disabled:E,children:"Submit"}):yi("span",{})]})}),e.stacked&&!e.noIncludeSubmitButton?yi(F,{loading:C,loadingText:null,onClick:A,disabled:E,children:"Submit"}):null]})}),b9=l2.div`
2110
2110
  width: 100%;
2111
- `,b9=i2.label`
2111
+ `,E9=l2.label`
2112
2112
  --country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.callingCodeLength}px));
2113
2113
  --phone-input-extra-padding-left: calc(12px + calc(3 * ${e=>e.callingCodeLength}px));
2114
2114
  display: block;
@@ -2201,15 +2201,15 @@ You will need this password to access your ${e} wallet on a new device. Please k
2201
2201
  && > input::placeholder {
2202
2202
  color: var(--privy-color-foreground-3);
2203
2203
  }
2204
- `;import{Fragment as A9,jsx as id,jsxs as a2}from"react/jsx-runtime";var ad=({isEditable:e,setIsEditable:t,defaultValue:r})=>{let o=S9(null),{authenticated:n}=K(),{navigate:i,setModalData:a,currentScreen:l}=x(),{initLoginWithSms:s}=L(),{enabled:d,token:u}=Ae();async function m({qualifiedPhoneNumber:f}){if(d&&!u&&!n)a({captchaModalData:{callback:g=>s(f,g),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),i("CAPTCHA_SCREEN");else try{await s(f,u),i("AWAITING_PASSWORDLESS_CODE")}catch(g){a({errorModalData:{error:g,previousScreen:l||"LANDING"}}),i("ERROR_SCREEN")}}return a2(A9,{children:[id(eo,{if:!e,children:id(Sn,{ref:o,onSubmit:m,defaultValue:r})}),id(eo,{if:e,children:a2(Pe,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[id(T9,{})," Continue with SMS"]})})]})};import{useState as P9}from"react";import x9 from"styled-components";import{jsx as Io,jsxs as _9}from"react/jsx-runtime";var R9={apple:{logo:Io(vl,{}),displayName:"Apple"},discord:{logo:Io(wl,{}),displayName:"Discord"},github:{logo:Io(bl,{}),displayName:"GitHub"},google:{logo:Io(Tl,{}),displayName:"Google"},linkedin:{logo:Io(xl,{}),displayName:"LinkedIn"},spotify:{logo:Io(Rl,{}),displayName:"Spotify"},instagram:{logo:Io(Al,{}),displayName:"Instagram"},twitter:{logo:Io(_l,{}),displayName:"Twitter"},tiktok:{logo:Io(kl,{}),displayName:"TikTok"}},st=({provider:e})=>{let{enabled:t,token:r}=Ae(),{navigate:o,setModalData:n}=x(),[i,a]=P9(!1),{initLoginWithOAuth:l}=L(),{accountType:s}=xt(),d=s?Tn(s):null,{displayName:u,logo:m}=R9[e];return _9(Pe,{onClick:()=>{a(!0),t&&!r?(n({captchaModalData:{callback:g=>l(e,g),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):l(e)},disabled:i,children:[m," ",u,d?.loginMethod===e&&Io(k9,{color:"gray",children:"Recent"})]})},k9=x9($t)`
2204
+ `;import{Fragment as A9,jsx as id,jsxs as c2}from"react/jsx-runtime";var ad=({isEditable:e,setIsEditable:t,defaultValue:r})=>{let o=P9(null),{authenticated:n}=V(),{navigate:i,setModalData:a,currentScreen:l,data:s}=R(),{initLoginWithSms:d}=M(),{enabled:u,token:m}=Ee();async function f({qualifiedPhoneNumber:y}){if(u&&!m&&!n)a({captchaModalData:{callback:E=>d(y,E,s?.login?.disableSignup),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),i("CAPTCHA_SCREEN");else try{await d(y,m,s?.login?.disableSignup),i("AWAITING_PASSWORDLESS_CODE")}catch(E){a({errorModalData:{error:E,previousScreen:l||"LANDING"}}),i("ERROR_SCREEN")}}return c2(A9,{children:[id(jr,{if:!e,children:id(Pn,{ref:o,onSubmit:f,defaultValue:r})}),id(jr,{if:e,children:c2(Te,{onClick:()=>{t(),setTimeout(()=>{o.current?.focus()},0)},children:[id(S9,{})," Continue with SMS"]})})]})};import{useState as x9}from"react";import R9 from"styled-components";import{jsx as _o,jsxs as I9}from"react/jsx-runtime";var k9={apple:{logo:_o(wl,{}),displayName:"Apple"},discord:{logo:_o(bl,{}),displayName:"Discord"},github:{logo:_o(El,{}),displayName:"GitHub"},google:{logo:_o(Sl,{}),displayName:"Google"},linkedin:{logo:_o(Rl,{}),displayName:"LinkedIn"},spotify:{logo:_o(kl,{}),displayName:"Spotify"},instagram:{logo:_o(Al,{}),displayName:"Instagram"},twitter:{logo:_o(Il,{}),displayName:"Twitter"},tiktok:{logo:_o(_l,{}),displayName:"TikTok"}},lt=({provider:e})=>{let{enabled:t,token:r}=Ee(),{navigate:o,setModalData:n,data:i}=R(),[a,l]=x9(!1),{initLoginWithOAuth:s}=M(),{accountType:d}=Pt(),u=d?Sn(d):null,{displayName:m,logo:f}=k9[e];return I9(Te,{onClick:()=>{l(!0),t&&!r?(n({captchaModalData:{callback:E=>s(e,E,i?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):s(e,void 0,i?.login?.disableSignup)},disabled:a,children:[f," ",m,u?.loginMethod===e&&_o(_9,{color:"gray",children:"Recent"})]})},_9=R9(Jt)`
2205
2205
  margin-left: auto;
2206
- `;import{useState as M9}from"react";import I9 from"styled-components";import{jsx as An,jsxs as s2}from"react/jsx-runtime";function sd(e){return s2("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...e,children:[An("defs",{children:s2("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[An("stop",{offset:"0",stopColor:"#1d93d2"}),An("stop",{offset:"1",stopColor:"#38b0e3"})]})}),An("title",{children:"Telegram_logo"}),An("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),An("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"}),An("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"}),An("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"})]})}import{jsx as l2,jsxs as L9}from"react/jsx-runtime";var ld=()=>{let{enabled:e,token:t}=Ae(),{navigate:r,setModalData:o}=x(),[n,i]=M9(!1),{initLoginWithTelegram:a}=L(),{accountType:l}=xt();async function s(u){try{await a(u),r("TELEGRAM_AUTH_SCREEN")}catch(m){console.error(m),i(!1)}}async function d(){if(i(!0),e&&!t){o({captchaModalData:{callback:s,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN");return}await s()}return L9(Pe,{onClick:d,disabled:n,children:[l2(sd,{}),"Telegram",l==="telegram"&&l2(W9,{color:"gray",children:"Recent"})]})},W9=I9($t)`
2206
+ `;import{useState as M9}from"react";import W9 from"styled-components";import{jsx as An,jsxs as d2}from"react/jsx-runtime";function sd(e){return d2("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...e,children:[An("defs",{children:d2("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[An("stop",{offset:"0",stopColor:"#1d93d2"}),An("stop",{offset:"1",stopColor:"#38b0e3"})]})}),An("title",{children:"Telegram_logo"}),An("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),An("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"}),An("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"}),An("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"})]})}import{jsx as p2,jsxs as N9}from"react/jsx-runtime";var ld=()=>{let{enabled:e,token:t}=Ee(),{navigate:r,setModalData:o,data:n}=R(),[i,a]=M9(!1),{initLoginWithTelegram:l}=M(),{accountType:s}=Pt();async function d(m){try{await l(m,n?.login?.disableSignup),r("TELEGRAM_AUTH_SCREEN")}catch(f){console.error(f),a(!1)}}async function u(){if(a(!0),e&&!t){o({captchaModalData:{callback:d,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN");return}await d()}return N9(Te,{onClick:u,disabled:i,children:[p2(sd,{}),"Telegram",s==="telegram"&&p2(L9,{color:"gray",children:"Recent"})]})},L9=W9(Jt)`
2207
2207
  margin-left: auto;
2208
- `;import N9 from"@heroicons/react/24/outline/ChevronRightIcon";import{jsx as c2,jsxs as O9}from"react/jsx-runtime";var cd=({onClick:e,text:t,icon:r})=>O9(Pe,{onClick:e,children:[r,c2(gr,{children:t}),c2(N9,{})]});import{Fragment as ru,jsx as $e,jsxs as pd}from"react/jsx-runtime";var ud=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=L(),{app:o,onUserCloseViaDialogOrKeybindRef:n,data:i}=x(),{appearance:{palette:{colorScheme:a}}}=Le(),{accountType:l,walletClientType:s}=xt(),d=l?Tn(l):null,u=o.loginMethodsAndOrder?.primary??[],m=o.loginMethodsAndOrder?.overflow??[],f=[...u,...m],g=o.loginMethods.passkey,v=i?.login,C=[];s&&f.includes(s)?C.push(s):l&&f.includes(d?.loginMethod)&&C.push(d?.loginMethod);let[b,A]=d2("default"),[_,S]=d2(l==="phone"?"sms":"email");U9(()=>{l==="phone"&&S("sms");let q=f.indexOf("sms"),pe=f.indexOf("email");q>-1&&q<pe&&S("sms")},[l,u,m]);let P=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{A("default")},150)};n.current=P;let E=q=>q==="email"?$e(ed,{isEditable:_==="email",setIsEditable:()=>{S("email")},defaultValue:v?.prefill?.type==="email"?v.prefill.value:void 0},q):q==="sms"?$e(ad,{isEditable:_==="sms",setIsEditable:()=>{S("sms")},defaultValue:v?.prefill?.type==="phone"?v.prefill.value:void 0},q):q==="apple"?$e(st,{provider:"apple"},q):q==="discord"?$e(st,{provider:"discord"},q):q==="farcaster"?$e(td,{},q):q==="github"?$e(st,{provider:"github"},q):q==="google"?$e(st,{provider:"google"},q):q==="linkedin"?$e(st,{provider:"linkedin"},q):q==="spotify"?$e(st,{provider:"spotify"},q):q==="instagram"?$e(st,{provider:"instagram"},q):q==="tiktok"?$e(st,{provider:"tiktok"},q):q==="twitter"?$e(st,{provider:"twitter"},q):q==="telegram"?$e(ld,{},q):pn([q],r,e,f,o.externalWallets.walletConnect.enabled),k=C.flatMap(E),D=u.filter(q=>q!==s&&q!==d?.loginMethod).flatMap(E),H=m.filter(q=>q!==s&&q!==d?.loginMethod).flatMap(E),M=[...k,...D,...H],X=B9({primary:D.length+k.length,overflow:H.length}),[W,Y]=Yu(M,X),Ce=b==="default"?void 0:()=>{A("default")};return pd(ru,{children:[$e(R,{title:o.appearance.landingHeader,onClose:P,backFn:Ce}),b==="default"&&$e(H9,{}),b==="default"&&(typeof o.appearance.loginMessage=="string"?$e(Ql,{children:o.appearance.loginMessage}):o.appearance.loginMessage),$e(Yl,{style:{overflow:"hidden"},children:pd(uh,{colorScheme:a,style:{maxHeight:400,overflowY:"scroll",padding:2},children:[b==="default"&&pd(ru,{children:[...W,Y.length>0&&$e(cd,{text:"More options",icon:$e(D9,{}),onClick:()=>A("overflow")})]}),b==="overflow"&&pd(ru,{children:[...Y]}),g&&b==="default"&&$e(Yc,{})]})}),o&&$e(ki,{app:o}),$e(G,{})]})},dd=5,B9=({primary:e,overflow:t})=>e<dd?e:e===dd&&t===0?dd:dd-1,H9=F9(Jc)`
2208
+ `;import O9 from"@heroicons/react/24/outline/ChevronRightIcon";import{jsx as u2,jsxs as D9}from"react/jsx-runtime";var cd=({onClick:e,text:t,icon:r})=>D9(Te,{onClick:e,children:[r,u2(mr,{children:t}),u2(O9,{})]});import{Fragment as au,jsx as rt,jsxs as pd}from"react/jsx-runtime";var ud=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=M(),{app:o,onUserCloseViaDialogOrKeybindRef:n,data:i}=R(),{appearance:{palette:{colorScheme:a}}}=Me(),{accountType:l,walletClientType:s}=Pt(),d=l?Sn(l):null,u=o.loginMethodsAndOrder?.primary??[],m=o.loginMethodsAndOrder?.overflow??[],f=[...u,...m],y=o.loginMethods.passkey,E=i?.login,C=[];s&&f.includes(s)?C.push(s):l&&f.includes(d?.loginMethod)&&C.push(d?.loginMethod);let[w,P]=m2("default"),[_,T]=m2(l==="phone"?"sms":"email");F9(()=>{l==="phone"&&T("sms");let q=f.indexOf("sms"),pe=f.indexOf("email");q>-1&&q<pe&&T("sms")},[l,u,m]);let A=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{P("default")},150)};n.current=A;let S=q=>q==="email"?rt(ed,{isEditable:_==="email",setIsEditable:()=>{T("email")},defaultValue:E?.prefill?.type==="email"?E.prefill.value:void 0},q):q==="sms"?rt(ad,{isEditable:_==="sms",setIsEditable:()=>{T("sms")},defaultValue:E?.prefill?.type==="phone"?E.prefill.value:void 0},q):q==="apple"?rt(lt,{provider:"apple"},q):q==="discord"?rt(lt,{provider:"discord"},q):q==="farcaster"?rt(td,{},q):q==="github"?rt(lt,{provider:"github"},q):q==="google"?rt(lt,{provider:"google"},q):q==="linkedin"?rt(lt,{provider:"linkedin"},q):q==="spotify"?rt(lt,{provider:"spotify"},q):q==="instagram"?rt(lt,{provider:"instagram"},q):q==="tiktok"?rt(lt,{provider:"tiktok"},q):q==="twitter"?rt(lt,{provider:"twitter"},q):q==="telegram"?rt(ld,{},q):un([q],r,e,f,o.externalWallets.walletConnect.enabled),I=C.flatMap(S),N=u.filter(q=>q!==s&&q!==d?.loginMethod).flatMap(S),H=m.filter(q=>q!==s&&q!==d?.loginMethod).flatMap(S),x=[...I,...N,...H],K=H9({primary:N.length+I.length,overflow:H.length}),[W,Q]=Zu(x,K),de=w==="default"?void 0:()=>{P("default")};return pd(au,{children:[rt(k,{title:o.appearance.landingHeader,onClose:A,backFn:de}),w==="default"&&rt(V9,{}),w==="default"&&(typeof o.appearance.loginMessage=="string"?rt(Yl,{children:o.appearance.loginMessage}):o.appearance.loginMessage),rt(Kl,{style:{overflow:"hidden"},children:pd(hh,{colorScheme:a,style:{maxHeight:400,overflowY:"scroll",padding:2},children:[w==="default"&&pd(au,{children:[...W,Q.length>0&&rt(cd,{text:"More options",icon:rt(U9,{}),onClick:()=>P("overflow")})]}),w==="overflow"&&pd(au,{children:[...Q]}),y&&w==="default"&&rt(Yc,{})]})}),o&&rt(Wi,{app:o}),rt(B,{})]})},dd=5,H9=({primary:e,overflow:t})=>e<dd?e:e===dd&&t===0?dd:dd-1,V9=B9(Jc)`
2209
2209
  margin-bottom: 16px;
2210
- `;import V9 from"@heroicons/react/24/outline/EnvelopeIcon";import G9 from"@heroicons/react/24/outline/PhoneIcon";import q9 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as z9,useMemo as m2,useState as f2}from"react";import K9 from"styled-components";import{toObjectKeys as Y9}from"@privy-io/js-sdk-core";import{jsx as Ps,jsxs as p2}from"react/jsx-runtime";var u2=({...e})=>p2("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[p2("g",{clipPath:"url(#clip0_2856_1743)",children:[Ps("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"}),Ps("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"})]}),Ps("defs",{children:Ps("clipPath",{id:"clip0_2856_1743",children:Ps("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});import{Fragment as xs,jsx as He,jsxs as Ta}from"react/jsx-runtime";var md=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=L(),{data:o,onUserCloseViaDialogOrKeybindRef:n}=x(),i=Le(),{accountType:a,walletClientType:l}=xt(),s=a?Tn(a):null,d=o?.login,u=m2(()=>d?.loginMethods?Y9(d.loginMethods,!0):null,[d]),{email:m,sms:f,google:g,twitter:v,discord:C,github:b,spotify:A,instagram:_,tiktok:S,linkedin:P,apple:E,wallet:k,farcaster:D,telegram:H}=u??i.loginMethods,{passkey:M}=i.loginMethods,X=[m&&"email",f&&"sms",g&&"google",v&&"twitter",C&&"discord",b&&"github",A&&"spotify",_&&"instagram",S&&"tiktok",P&&"linkedin",E&&"apple",D&&"farcaster",H&&"telegram"].filter(U=>!!U),W=X.length>0,Y=m2(()=>k&&!W?"web3-first":k&&i?.appearance.loginGroupPriority||"web2-first",[k,W,i?.appearance.loginGroupPriority]),Ce=i?.appearance.hideDirectWeb2Inputs,[q,pe]=f2("default"),[Q,ee]=f2(h2({mostRecentlyUsedAccountType:a,smsAvailable:f,emailAvailable:m,prefilledType:d?.prefill?.type}));z9(()=>{ee(h2({mostRecentlyUsedAccountType:a,smsAvailable:f,emailAvailable:m,prefilledType:d?.prefill?.type}))},[m,f,a]);let ue=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{pe("default")},150)};n.current=ue;let me=[];l&&k?me.push(l):s?.loginMethod&&X.includes(s.loginMethod)&&me.push(s.loginMethod);let Te=U=>U==="email"?He(ed,{isEditable:Q==="email",setIsEditable:()=>{ee("email")},defaultValue:d?.prefill?.type==="email"?d.prefill.value:void 0},U):U==="sms"?He(ad,{isEditable:Q==="sms",setIsEditable:()=>{ee("sms")},defaultValue:d?.prefill?.type==="phone"?d.prefill.value:void 0},U):U==="apple"?He(st,{provider:"apple"},U):U==="discord"?He(st,{provider:"discord"},U):U==="farcaster"?He(td,{},U):U==="github"?He(st,{provider:"github"},U):U==="google"?He(st,{provider:"google"},U):U==="linkedin"?He(st,{provider:"linkedin"},U):U==="tiktok"?He(st,{provider:"tiktok"},U):U==="spotify"?He(st,{provider:"spotify"},U):U==="instagram"?He(st,{provider:"instagram"},U):U==="twitter"?He(st,{provider:"twitter"},U):U==="telegram"?He(ld,{},U):pn([U],r,e,[],i.externalWallets.walletConnect.enabled),ce=pn(i.appearance.walletList.filter(U=>U!==l),r,e,[...i.appearance.walletList,l],i.externalWallets.walletConnect.enabled),Se=X.filter(U=>U!==s?.loginMethod).flatMap(Te),ft=me.flatMap(Te);Y==="web3-first"&&q==="default"?ce.unshift(...ft):Y==="web2-first"&&Se.unshift(...ft);let tt=q==="default"?void 0:()=>{pe("default")},le=X.filter(U=>U!=="email"&&U!=="sms"),nt=X9({priority:Y,email:m,sms:f,social:le}),mr=Z9({priority:Y,email:m,sms:f,social:le}),vt=J9({priority:Y}),I=He(Qc,{text:vt,onClick:()=>pe("web3-overflow")}),Ke=He(cd,{text:nt,icon:mr,onClick:()=>pe("web2-overflow")}),Qt=Ce?0:1;return Ta(xs,{children:[He(R,{title:i.appearance.landingHeader,onClose:ue,backFn:tt}),q==="default"&&He(Q9,{}),q==="default"&&(typeof i.appearance.loginMessage=="string"?He(Ql,{children:i.appearance.loginMessage}):i.appearance.loginMessage),He(Yl,{style:{overflow:"hidden",padding:2},children:Ta(nr,{children:[q==="default"&&Y==="web2-first"&&Ta(xs,{children:[...Se.length>4?Se.slice(0,3):Se,Se.length>4&&Ke,k&&I]}),q==="default"&&Y==="web3-first"&&Ta(xs,{children:[k&&Ta(xs,{children:[...ce.length>4?ce.slice(0,3):ce,ce.length>4&&I]}),Se.length>Qt&&Ke,Se.length===Qt&&Se[0]]}),q==="web2-overflow"&&Ta(xs,{children:[...Y==="web3-first"?Se:Se.slice(3)]}),...q==="web3-overflow"?ce:[],M&&q==="default"&&He(Yc,{})]})}),i&&He(ki,{app:i}),He(G,{})]})},Q9=K9(Jc)`
2210
+ `;import G9 from"@heroicons/react/24/outline/EnvelopeIcon";import q9 from"@heroicons/react/24/outline/PhoneIcon";import z9 from"@heroicons/react/24/outline/UserCircleIcon";import{useEffect as K9,useMemo as y2,useState as g2}from"react";import Y9 from"styled-components";import{toObjectKeys as Q9}from"@privy-io/js-sdk-core";import{jsx as xs,jsxs as f2}from"react/jsx-runtime";var h2=({...e})=>f2("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[f2("g",{clipPath:"url(#clip0_2856_1743)",children:[xs("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"}),xs("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"})]}),xs("defs",{children:xs("clipPath",{id:"clip0_2856_1743",children:xs("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});import{Fragment as Rs,jsx as Ve,jsxs as Pa}from"react/jsx-runtime";var md=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=M(),{data:o,onUserCloseViaDialogOrKeybindRef:n}=R(),i=Me(),{accountType:a,walletClientType:l}=Pt(),s=a?Sn(a):null,d=o?.login,u=y2(()=>d?.loginMethods?Q9(d.loginMethods,!0):null,[d]),{email:m,sms:f,google:y,twitter:E,discord:C,github:w,spotify:P,instagram:_,tiktok:T,linkedin:A,apple:S,wallet:I,farcaster:N,telegram:H}=u??i.loginMethods,{passkey:x}=i.loginMethods,K=[m&&"email",f&&"sms",y&&"google",E&&"twitter",C&&"discord",w&&"github",P&&"spotify",_&&"instagram",T&&"tiktok",A&&"linkedin",S&&"apple",N&&"farcaster",H&&"telegram"].filter(U=>!!U),W=K.length>0,Q=y2(()=>I&&!W?"web3-first":I&&i?.appearance.loginGroupPriority||"web2-first",[I,W,i?.appearance.loginGroupPriority]),de=i?.appearance.hideDirectWeb2Inputs,[q,pe]=g2("default"),[Z,ie]=g2(C2({mostRecentlyUsedAccountType:a,smsAvailable:f,emailAvailable:m,prefilledType:d?.prefill?.type}));K9(()=>{ie(C2({mostRecentlyUsedAccountType:a,smsAvailable:f,emailAvailable:m,prefilledType:d?.prefill?.type}))},[m,f,a]);let se=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{pe("default")},150)};n.current=se;let _e=[];l&&I?_e.push(l):s?.loginMethod&&K.includes(s.loginMethod)&&_e.push(s.loginMethod);let be=U=>U==="email"?Ve(ed,{isEditable:Z==="email",setIsEditable:()=>{ie("email")},defaultValue:d?.prefill?.type==="email"?d.prefill.value:void 0},U):U==="sms"?Ve(ad,{isEditable:Z==="sms",setIsEditable:()=>{ie("sms")},defaultValue:d?.prefill?.type==="phone"?d.prefill.value:void 0},U):U==="apple"?Ve(lt,{provider:"apple"},U):U==="discord"?Ve(lt,{provider:"discord"},U):U==="farcaster"?Ve(td,{},U):U==="github"?Ve(lt,{provider:"github"},U):U==="google"?Ve(lt,{provider:"google"},U):U==="linkedin"?Ve(lt,{provider:"linkedin"},U):U==="tiktok"?Ve(lt,{provider:"tiktok"},U):U==="spotify"?Ve(lt,{provider:"spotify"},U):U==="instagram"?Ve(lt,{provider:"instagram"},U):U==="twitter"?Ve(lt,{provider:"twitter"},U):U==="telegram"?Ve(ld,{},U):un([U],r,e,[],i.externalWallets.walletConnect.enabled),ye=un(i.appearance.walletList.filter(U=>U!==l),r,e,[...i.appearance.walletList,l],i.externalWallets.walletConnect.enabled),ae=K.filter(U=>U!==s?.loginMethod).flatMap(be),Xe=_e.flatMap(be);Q==="web3-first"&&q==="default"?ye.unshift(...Xe):Q==="web2-first"&&ae.unshift(...Xe);let it=q==="default"?void 0:()=>{pe("default")},le=K.filter(U=>U!=="email"&&U!=="sms"),et=Z9({priority:Q,email:m,sms:f,social:le}),Ot=J9({priority:Q,email:m,sms:f,social:le}),zr=j9({priority:Q}),L=Ve(Qc,{text:zr,onClick:()=>pe("web3-overflow")}),Se=Ve(cd,{text:et,icon:Ot,onClick:()=>pe("web2-overflow")}),qe=de?0:1;return Pa(Rs,{children:[Ve(k,{title:i.appearance.landingHeader,onClose:se,backFn:it}),q==="default"&&Ve(X9,{}),q==="default"&&(typeof i.appearance.loginMessage=="string"?Ve(Yl,{children:i.appearance.loginMessage}):i.appearance.loginMessage),Ve(Kl,{style:{overflow:"hidden",padding:2},children:Pa(tr,{children:[q==="default"&&Q==="web2-first"&&Pa(Rs,{children:[...ae.length>4?ae.slice(0,3):ae,ae.length>4&&Se,I&&L]}),q==="default"&&Q==="web3-first"&&Pa(Rs,{children:[I&&Pa(Rs,{children:[...ye.length>4?ye.slice(0,3):ye,ye.length>4&&L]}),ae.length>qe&&Se,ae.length===qe&&ae[0]]}),q==="web2-overflow"&&Pa(Rs,{children:[...Q==="web3-first"?ae:ae.slice(3)]}),...q==="web3-overflow"?ye:[],x&&q==="default"&&Ve(Yc,{})]})}),i&&Ve(Wi,{app:i}),Ve(B,{})]})},X9=Y9(Jc)`
2211
2211
  margin-bottom: 16px;
2212
- `,X9=({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",Z9=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?He(q9,{}):t&&r?He(u2,{}):t?He(V9,{}):r?He(G9,{}):null,J9=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets",h2=({mostRecentlyUsedAccountType:e,smsAvailable:t,emailAvailable:r,prefilledType:o})=>r&&(e==="email"&&o!=="phone"||o==="email")?"email":t&&(e==="phone"||o==="phone")?"sms":"email";import{jsx as y2}from"react/jsx-runtime";var g2=()=>{let{app:e}=x();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?y2(ud,{connectOnly:!0}):y2(md,{connectOnly:!0})};import{jsx as C2}from"react/jsx-runtime";var v2=()=>{let{app:e}=x();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?C2(ud,{connectOnly:!1}):C2(md,{connectOnly:!1})};import j9 from"@heroicons/react/24/outline/EnvelopeIcon";import{Fragment as $9,jsx as Pn,jsxs as eb}from"react/jsx-runtime";var w2=()=>{let{app:e}=x();return eb($9,{children:[Pn(R,{},"header"),Pn(oe,{}),Pn(ve,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:Pn(j9,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),Pn(lr,{children:Pn(jc,{stacked:!0})}),Pn(ne,{}),Pn(G,{})]})};import tb from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as rb,jsx as xn,jsxs as ob}from"react/jsx-runtime";var b2=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=x(),{initLoginWithSms:i}=L();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 ob(rb,{children:[xn(R,{},"header"),xn(oe,{}),xn(ve,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:xn(tb,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),xn(lr,{children:xn(Sn,{stacked:!0,onSubmit:a,hideRecent:!0})}),xn(ne,{}),xn(G,{})]})};import{Fragment as nb,jsx as Rs,jsxs as ib}from"react/jsx-runtime";var E2=()=>{let{app:e,data:t}=x(),r=t?.externalConnectWallet?.suggestedAddress,o=r?`Link the wallet with address ${Ut(r)} ${e?.name?`to ${e.name}.`:"."}`:`Link a wallet to your ${e?.name} account`;return ib(nb,{children:[Rs(R,{},"header"),Rs(Ao,{title:"Link your wallet",description:o}),Rs(nr,{children:Rs(ta,{connectOnly:!1})}),Rs(G,{})]})};import{jsx as T2,jsxs as ab}from"react/jsx-runtime";var S2=({style:e,...t})=>ab("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:[T2("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),T2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});import{Fragment as sb,jsx as Rn,jsxs as A2}from"react/jsx-runtime";var P2=()=>{let{closePrivyModal:e}=L(),{navigate:t}=x();return A2(sb,{children:[Rn(R,{},"header"),Rn(oe,{}),Rn(S2,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),Rn(Ao,{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"}}),A2(lr,{children:[Rn(F,{onClick:()=>t("LANDING"),children:"Try again"}),Rn($r,{onClick:()=>e(),children:"Cancel"})]}),Rn(ne,{}),Rn(G,{})]})};import qb from"@heroicons/react/24/solid/CheckBadgeIcon";import zb from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import Kb from"@heroicons/react/24/solid/IdentificationIcon";import Yb from"@heroicons/react/24/solid/PhoneIcon";import Qb from"@heroicons/react/24/solid/QuestionMarkCircleIcon";import F2 from"@heroicons/react/24/solid/ShieldCheckIcon";import{useEffect as Xb,useState as Sa}from"react";import{useContext as lb}from"react";function ks(){let{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}=lb(xe);return{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}}import{useContext as cb}from"react";function ao(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenroll:a,enrollInMfa:l}=cb(xe);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenrollWithSms:()=>a("sms"),unenrollWithTotp:()=>a("totp"),unenrollWithPasskey:()=>a("passkey"),showMfaEnrollmentModal:()=>l(!0),closeMfaEnrollmentModal:()=>l(!1)}}import db from"styled-components";import{jsx as x2,jsxs as ub}from"react/jsx-runtime";var R2=e=>ub(pb,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[x2("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),x2("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"})]}),pb=db.svg`
2212
+ `,Z9=({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",J9=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?Ve(z9,{}):t&&r?Ve(h2,{}):t?Ve(G9,{}):r?Ve(q9,{}):null,j9=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets",C2=({mostRecentlyUsedAccountType:e,smsAvailable:t,emailAvailable:r,prefilledType:o})=>r&&(e==="email"&&o!=="phone"||o==="email")?"email":t&&(e==="phone"||o==="phone")?"sms":"email";import{jsx as v2}from"react/jsx-runtime";var w2=()=>{let{app:e}=R();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?v2(ud,{connectOnly:!0}):v2(md,{connectOnly:!0})};import{jsx as b2}from"react/jsx-runtime";var E2=()=>{let{app:e}=R();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?b2(ud,{connectOnly:!1}):b2(md,{connectOnly:!1})};import $9 from"@heroicons/react/24/outline/EnvelopeIcon";import{Fragment as eb,jsx as xn,jsxs as tb}from"react/jsx-runtime";var T2=()=>{let{app:e}=R();return tb(eb,{children:[xn(k,{},"header"),xn(te,{}),xn(ge,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:xn($9,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),xn(ir,{children:xn(jc,{stacked:!0})}),xn(re,{}),xn(B,{})]})};import rb from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as ob,jsx as Rn,jsxs as nb}from"react/jsx-runtime";var S2=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=R(),{initLoginWithSms:i}=M();async function a({qualifiedPhoneNumber:l}){try{await i(l),o("AWAITING_PASSWORDLESS_CODE")}catch(s){n({errorModalData:{error:s,previousScreen:r?.errorModalData?.previousScreen||t||"LINK_PHONE_SCREEN"}}),o("ERROR_SCREEN")}}return nb(ob,{children:[Rn(k,{},"header"),Rn(te,{}),Rn(ge,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:Rn(rb,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),Rn(ir,{children:Rn(Pn,{stacked:!0,onSubmit:a,hideRecent:!0})}),Rn(re,{}),Rn(B,{})]})};import{Fragment as ib,jsx as Aa,jsxs as P2}from"react/jsx-runtime";var A2=()=>{let{app:e,data:t}=R(),r=t?.externalConnectWallet?.suggestedAddress,o=r?P2("span",{children:["Link the wallet with address ",Aa(Fo,{showCopyIcon:!1,address:r})," ",e?.name?`to ${e.name}.`:"."]}):`Link a wallet to your ${e?.name} account`;return P2(ib,{children:[Aa(k,{},"header"),Aa(To,{title:"Link your wallet",description:o}),Aa(tr,{children:Aa(ia,{connectOnly:!1})}),Aa(B,{})]})};import{jsx as x2,jsxs as ab}from"react/jsx-runtime";var R2=({style:e,...t})=>ab("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:[x2("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),x2("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});import{Fragment as sb,jsx as kn,jsxs as k2}from"react/jsx-runtime";var _2=()=>{let{closePrivyModal:e}=M(),{navigate:t}=R();return k2(sb,{children:[kn(k,{},"header"),kn(te,{}),kn(R2,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),kn(To,{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"}}),k2(ir,{children:[kn(F,{onClick:()=>t("LANDING"),children:"Try again"}),kn(Jr,{onClick:()=>e(),children:"Cancel"})]}),kn(re,{}),kn(B,{})]})};import qb from"@heroicons/react/24/solid/CheckBadgeIcon";import zb from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import Kb from"@heroicons/react/24/solid/IdentificationIcon";import Yb from"@heroicons/react/24/solid/PhoneIcon";import Qb from"@heroicons/react/24/solid/QuestionMarkCircleIcon";import G2 from"@heroicons/react/24/solid/ShieldCheckIcon";import{useEffect as Xb,useState as xa}from"react";import{useContext as lb}from"react";function ks(){let{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}=lb(We);return{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}}import{useContext as cb}from"react";function no(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenroll:a,enrollInMfa:l}=cb(We);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:i,unenrollWithSms:()=>a("sms"),unenrollWithTotp:()=>a("totp"),unenrollWithPasskey:()=>a("passkey"),showMfaEnrollmentModal:()=>l(!0),closeMfaEnrollmentModal:()=>l(!1)}}import db from"styled-components";import{jsx as I2,jsxs as ub}from"react/jsx-runtime";var M2=e=>ub(pb,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[I2("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),I2("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"})]}),pb=db.svg`
2213
2213
  height: 90px;
2214
2214
  width: 90px;
2215
2215
 
@@ -2220,7 +2220,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2220
2220
  > path {
2221
2221
  fill: white;
2222
2222
  }
2223
- `;import ou from"@heroicons/react/20/solid/CheckIcon";import mb from"@heroicons/react/24/outline/ChevronRightIcon";import fb from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import hb from"@heroicons/react/24/outline/FingerPrintIcon";import yb from"@heroicons/react/24/outline/PhoneIcon";import nu from"@heroicons/react/24/outline/TrashIcon";import gb from"@heroicons/react/24/solid/ShieldCheckIcon";import{Fragment as Cb,jsx as Re,jsxs as pr}from"react/jsx-runtime";var k2=({showIntro:e,userMfaMethods:t,appMfaMethods:r,userHasAuthSms:o,isTotpLoading:n,isPasskeyLoading:i,error:a,onClose:l,onBackToIntro:s,handleSelectMethod:d,setRemovingMfaMethod:u})=>{let m=t.reduce((g,v)=>({...g,[v]:!0}),{}),f=r.reduce((g,v)=>({...g,[v]:!0}),{});return pr(Cb,{children:[Re(R,{backFn:e?s:void 0,onClose:l},"header"),Re(Fe,{children:Re(Je,{children:Re(gb,{})})}),Re(fe,{children:"Choose a verification method"}),t.length>0?Re(ye,{children:"To add or delete verification methods, verification is required."}):Re(ye,{children:"How would you like to verify your identity? You can change this later."}),a&&Re(ec,{style:{marginTop:"1.25rem"},children:a.message}),pr(Xl,{children:[(f.totp||m.totp)&&pr(Zl,{children:[Re(Pe,{style:{justifyContent:"center"},disabled:m.totp||n,onClick:()=>d("totp"),children:n?Re(at,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):pr($l,{children:[pr(jl,{children:[Re(fb,{}),"Authenticator App"]}),m.totp?pr(jn,{children:[Re(ou,{}),"Added"]}):Re(jn,{children:"Recommended"})]})}),m.totp&&Re(Jl,{onClick:()=>u("totp"),children:Re(nu,{})})]},"totp"),(f.sms||m.sms)&&pr(Zl,{children:[Re(Pe,{disabled:m.sms||o,onClick:()=>d("sms"),children:pr($l,{children:[pr(jl,{children:[Re(yb,{}),"SMS"]}),m.sms&&pr(jn,{children:[Re(ou,{}),"Added"]}),o&&Re(jn,{children:"Disabled"})]})}),m.sms&&Re(Jl,{onClick:()=>u("sms"),children:Re(nu,{})})]},"sms"),(f.passkey||m.passkey)&&pr(Zl,{children:[Re(Pe,{style:{justifyContent:"center"},onClick:()=>d("passkey"),disabled:m.passkey||i,children:i?Re(at,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):pr($l,{children:[pr(jl,{children:[Re(hb,{}),"Passkey"]}),m.passkey?pr(jn,{children:[Re(ou,{}),"Added"]}):Re(jn,{isAccent:!0,children:Re(mb,{})})]})}),m.passkey&&Re(Jl,{onClick:()=>u("passkey"),children:Re(nu,{})})]},"passkey")]}),Re(Z,{})]})};import vb from"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import wb from"@heroicons/react/24/outline/ClockIcon";import bb from"@heroicons/react/24/outline/ShieldCheckIcon";import Eb from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as Tb,useState as _s}from"react";import fd from"styled-components";import{Fragment as iu,jsx as ge,jsxs as Qr}from"react/jsx-runtime";var M2=({onComplete:e,onClose:t,onReset:r})=>{let{user:o}=K(),{data:n}=x(),{initLinkWithPasskey:i,linkWithPasskey:a}=L(),{initEnrollmentWithPasskey:l,submitEnrollmentWithPasskey:s}=ao(),[d,u]=_s(!1),[m,f]=_s(!1),[g,v]=_s(!1),[C,b]=_s(null),A=Tb(()=>o?.linkedAccounts.filter(E=>E.type==="passkey")??[],[o]),_=()=>{n?.mfaEnrollmentFlow?.onSuccess(),e()},S=async E=>{u(!0);try{await l(),await s({credentialIds:E}),v(!0)}catch(k){b(k)}finally{u(!1)}},P=async()=>{f(!0),b(null);try{await i();let k=(await a())?.linkedAccounts.filter(D=>D.type==="passkey").map(D=>D.credentialId)??[];await S(k)}catch(E){b(E)}finally{f(!1)}};return A.length===0||m?ge(Sb,{onReset:r,onClose:t,onClick:P,isCreating:m}):g?ge(Pb,{onClick:_,onClose:_}):C?ge(ai,{error:C,backFn:()=>b(null),onClick:()=>b(null)}):ge(Ab,{passkeys:A,isSubmitting:d,isCreating:m,onReset:r,onClose:t,onSubmitEnrollment:()=>S(A.map(E=>E.credentialId)),onAddPasskey:P})},Sb=({onReset:e,onClose:t,onClick:r,isCreating:o})=>Qr(iu,{children:[ge(R,{backFn:e,onClose:t},"header"),ge(Fe,{children:Qr(Uc,{children:[ge(si,{}),ge(li,{})]})}),ge(fe,{children:"Set up passkey verification"}),Qr(Jn,{children:[Qr(ar,{children:[ge(ir,{children:ge(bb,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),Qr(ar,{children:[ge(ir,{children:ge(wb,{})}),"Takes seconds to set up and use"]}),Qr(ar,{children:[ge(ir,{children:ge(vb,{})}),"Use your passkey to verify transactions and login to your account"]})]}),ge(F,{style:{marginTop:"2.25rem"},onClick:r,loading:o,children:"Add a new passkey"}),ge(Z,{})]}),Ab=({onReset:e,onClose:t,onAddPasskey:r,onSubmitEnrollment:o,passkeys:n,isSubmitting:i,isCreating:a})=>{let[l,s]=_s(!1),d=l?n.length:n.length>3?2:3;return Qr(iu,{children:[ge(R,{backFn:l?()=>s(!1):e,onClose:t},"header"),!l&&ge(Fe,{children:Qr(Uc,{children:[ge(si,{}),ge(li,{})]})}),ge(fe,{children:"Enable your passkeys for verification"}),Qr(Jn,{children:[n.slice(0,d).map(u=>Qr(xb,{children:[ge(Rb,{children:_b(u)}),Qr(kb,{children:["Last used: ",u.latestVerifiedAt?.toLocaleString()]})]},u.credentialId)),!l&&n.length>3&&ge(_2,{onClick:()=>s(!0),children:"View All"})]}),ge(F,{style:{marginTop:"1.5rem"},onClick:o,loading:i,children:"Enable passkeys"}),n.length<5&&ge(_2,{style:{marginTop:"0.5rem"},onClick:r,disabled:a,children:a?ge(at,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),ge(Z,{})]})},Pb=({onClick:e,onClose:t})=>Qr(iu,{children:[ge(R,{onClose:t},"header"),ge(Fe,{children:ge(Je,{status:"success",children:ge(Eb,{})})}),ge(fe,{children:"Passkey verification added"}),ge(ye,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),ge(kt,{children:ge(F,{onClick:e,children:"Done"})}),ge(Z,{})]}),xb=fd.div`
2223
+ `;import su from"@heroicons/react/20/solid/CheckIcon";import mb from"@heroicons/react/24/outline/ChevronRightIcon";import fb from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import hb from"@heroicons/react/24/outline/FingerPrintIcon";import yb from"@heroicons/react/24/outline/PhoneIcon";import lu from"@heroicons/react/24/outline/TrashIcon";import gb from"@heroicons/react/24/solid/ShieldCheckIcon";import{Fragment as Cb,jsx as Ae,jsxs as lr}from"react/jsx-runtime";var W2=({showIntro:e,userMfaMethods:t,appMfaMethods:r,userHasAuthSms:o,isTotpLoading:n,isPasskeyLoading:i,error:a,onClose:l,onBackToIntro:s,handleSelectMethod:d,setRemovingMfaMethod:u})=>{let m=t.reduce((y,E)=>({...y,[E]:!0}),{}),f=r.reduce((y,E)=>({...y,[E]:!0}),{});return lr(Cb,{children:[Ae(k,{backFn:e?s:void 0,onClose:l},"header"),Ae(Fe,{children:Ae($e,{children:Ae(gb,{})})}),Ae(ue,{children:"Choose a verification method"}),t.length>0?Ae(fe,{children:"To add or delete verification methods, verification is required."}):Ae(fe,{children:"How would you like to verify your identity? You can change this later."}),a&&Ae($l,{style:{marginTop:"1.25rem"},children:a.message}),lr(Ql,{children:[(f.totp||m.totp)&&lr(Xl,{children:[Ae(Te,{style:{justifyContent:"center"},disabled:m.totp||n,onClick:()=>d("totp"),children:n?Ae(st,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):lr(jl,{children:[lr(Jl,{children:[Ae(fb,{}),"Authenticator App"]}),m.totp?lr(ti,{children:[Ae(su,{}),"Added"]}):Ae(ti,{children:"Recommended"})]})}),m.totp&&Ae(Zl,{onClick:()=>u("totp"),children:Ae(lu,{})})]},"totp"),(f.sms||m.sms)&&lr(Xl,{children:[Ae(Te,{disabled:m.sms||o,onClick:()=>d("sms"),children:lr(jl,{children:[lr(Jl,{children:[Ae(yb,{}),"SMS"]}),m.sms&&lr(ti,{children:[Ae(su,{}),"Added"]}),o&&Ae(ti,{children:"Disabled"})]})}),m.sms&&Ae(Zl,{onClick:()=>u("sms"),children:Ae(lu,{})})]},"sms"),(f.passkey||m.passkey)&&lr(Xl,{children:[Ae(Te,{style:{justifyContent:"center"},onClick:()=>d("passkey"),disabled:m.passkey||i,children:i?Ae(st,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):lr(jl,{children:[lr(Jl,{children:[Ae(hb,{}),"Passkey"]}),m.passkey?lr(ti,{children:[Ae(su,{}),"Added"]}):Ae(ti,{isAccent:!0,children:Ae(mb,{})})]})}),m.passkey&&Ae(Zl,{onClick:()=>u("passkey"),children:Ae(lu,{})})]},"passkey")]}),Ae(J,{})]})};import vb from"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import wb from"@heroicons/react/24/outline/ClockIcon";import bb from"@heroicons/react/24/outline/ShieldCheckIcon";import Eb from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as Tb,useState as _s}from"react";import fd from"styled-components";import{Fragment as cu,jsx as he,jsxs as qr}from"react/jsx-runtime";var N2=({onComplete:e,onClose:t,onReset:r})=>{let{user:o}=V(),{data:n}=R(),{initLinkWithPasskey:i,linkWithPasskey:a}=M(),{initEnrollmentWithPasskey:l,submitEnrollmentWithPasskey:s}=no(),[d,u]=_s(!1),[m,f]=_s(!1),[y,E]=_s(!1),[C,w]=_s(null),P=Tb(()=>o?.linkedAccounts.filter(S=>S.type==="passkey")??[],[o]),_=()=>{n?.mfaEnrollmentFlow?.onSuccess(),e()},T=async S=>{u(!0);try{await l(),await s({credentialIds:S}),E(!0)}catch(I){w(I)}finally{u(!1)}},A=async()=>{f(!0),w(null);try{await i();let I=(await a())?.linkedAccounts.filter(N=>N.type==="passkey").map(N=>N.credentialId)??[];await T(I)}catch(S){w(S)}finally{f(!1)}};return P.length===0||m?he(Sb,{onReset:r,onClose:t,onClick:A,isCreating:m}):y?he(Ab,{onClick:_,onClose:_}):C?he(di,{error:C,backFn:()=>w(null),onClick:()=>w(null)}):he(Pb,{passkeys:P,isSubmitting:d,isCreating:m,onReset:r,onClose:t,onSubmitEnrollment:()=>T(P.map(S=>S.credentialId)),onAddPasskey:A})},Sb=({onReset:e,onClose:t,onClick:r,isCreating:o})=>qr(cu,{children:[he(k,{backFn:e,onClose:t},"header"),he(Fe,{children:qr(Dc,{children:[he(pi,{}),he(ui,{})]})}),he(ue,{children:"Set up passkey verification"}),qr(ei,{children:[qr(or,{children:[he(rr,{children:he(bb,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),qr(or,{children:[he(rr,{children:he(wb,{})}),"Takes seconds to set up and use"]}),qr(or,{children:[he(rr,{children:he(vb,{})}),"Use your passkey to verify transactions and login to your account"]})]}),he(F,{style:{marginTop:"2.25rem"},onClick:r,loading:o,children:"Add a new passkey"}),he(J,{})]}),Pb=({onReset:e,onClose:t,onAddPasskey:r,onSubmitEnrollment:o,passkeys:n,isSubmitting:i,isCreating:a})=>{let[l,s]=_s(!1),d=l?n.length:n.length>3?2:3;return qr(cu,{children:[he(k,{backFn:l?()=>s(!1):e,onClose:t},"header"),!l&&he(Fe,{children:qr(Dc,{children:[he(pi,{}),he(ui,{})]})}),he(ue,{children:"Enable your passkeys for verification"}),qr(ei,{children:[n.slice(0,d).map(u=>qr(xb,{children:[he(Rb,{children:_b(u)}),qr(kb,{children:["Last used: ",u.latestVerifiedAt?.toLocaleString()]})]},u.credentialId)),!l&&n.length>3&&he(L2,{onClick:()=>s(!0),children:"View All"})]}),he(F,{style:{marginTop:"1.5rem"},onClick:o,loading:i,children:"Enable passkeys"}),n.length<5&&he(L2,{style:{marginTop:"0.5rem"},onClick:r,disabled:a,children:a?he(st,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),he(J,{})]})},Ab=({onClick:e,onClose:t})=>qr(cu,{children:[he(k,{onClose:t},"header"),he(Fe,{children:he($e,{status:"success",children:he(Eb,{})})}),he(ue,{children:"Passkey verification added"}),he(fe,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),he(xt,{children:he(F,{onClick:e,children:"Done"})}),he(J,{})]}),xb=fd.div`
2224
2224
  && {
2225
2225
  padding: 0.75rem 1rem;
2226
2226
  text-align: left;
@@ -2240,7 +2240,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2240
2240
  line-height: 1.125rem;
2241
2241
 
2242
2242
  color: var(--privy-color-foreground-2);
2243
- `,_b=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",_2=fd.button`
2243
+ `,_b=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",L2=fd.button`
2244
2244
  && {
2245
2245
  width: 100%;
2246
2246
  font-size: 0.875rem;
@@ -2265,7 +2265,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2265
2265
  box-shadow: none;
2266
2266
  }
2267
2267
  }
2268
- `;import Fb from"@heroicons/react/24/solid/CheckCircleIcon";import L2 from"@heroicons/react/24/solid/PhoneIcon";import{useState as hd}from"react";import{useState as au}from"react";import{isMobile as Mb}from"react-device-detect";import W2 from"styled-components";import{Fragment as Ub,jsx as Ms,jsxs as Db}from"react/jsx-runtime";var Is=6,Ib=new Array(Is).fill("");function Wb(e){return e.replace(/\s+/g,"")}function su(e){return/^[0-9]{1}$/.test(e)}function I2(e){return e.length===Is&&e.every(su)}function Lb(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var mi=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,i]=au(Ib),[a,l]=au(null),[s,d]=au(null),u=async v=>{v.preventDefault();let C=Wb(v.currentTarget.value);if(C==="")return;let b=Lb(n,su),A=C.split(""),_=!A.every(su),S=A.length+b>Is;if(_){l("Passcode can only be numbers"),d(1);return}if(S){l("Passcode must be exactly 6 numbers"),d(1);return}l(null),d(null);let P=Number(v.currentTarget.name?.charAt(4)),E=[...C||[""]].slice(0,Is-P),k=[...n.slice(0,P),...E,...n.slice(P+E.length)];i(k);let D=E.length,H=Math.min(Math.max(P+D,0),Is-1);if(document.querySelector(`input[name=pin-${H}]`)?.focus(),I2(k))try{await e(k.join("")),document.querySelector(`input[name=pin-${H}]`)?.blur()}catch(X){d(1),l(X.message)}else try{await e(null)}catch(X){d(1),l(X.message)}},m=v=>{s===1&&(l(null),d(null));let C=[...n.slice(0,v),"",...n.slice(v+1)];i(C),v>0&&document.querySelector(`input[name=pin-${v-1}]`)?.focus(),I2(C)?e(C.join("")):e(null)},g=o?"success":!!(r||a)?"fail":"";return Ms(Ub,{children:Db(Nb,{children:[Ms("div",{children:n.map((v,C)=>Ms("input",{name:`pin-${C}`,type:"text",value:n[C],onChange:u,onKeyUp:b=>{b.key==="Backspace"&&m(C)},inputMode:"numeric",autoFocus:C===0,pattern:"[0-9]",className:g,autoComplete:Mb?"one-time-code":"off",disabled:t},C))}),Ms("div",{children:Ms(Ob,{fail:!!r||!!a,children:r||a})})]})})},Nb=W2.div`
2268
+ `;import Fb from"@heroicons/react/24/solid/CheckCircleIcon";import U2 from"@heroicons/react/24/solid/PhoneIcon";import{useState as hd}from"react";import{useState as du}from"react";import{isMobile as Ib}from"react-device-detect";import D2 from"styled-components";import{Fragment as Ub,jsx as Is,jsxs as Db}from"react/jsx-runtime";var Ms=6,Mb=new Array(Ms).fill("");function Wb(e){return e.replace(/\s+/g,"")}function pu(e){return/^[0-9]{1}$/.test(e)}function O2(e){return e.length===Ms&&e.every(pu)}function Lb(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var gi=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,i]=du(Mb),[a,l]=du(null),[s,d]=du(null),u=async E=>{E.preventDefault();let C=Wb(E.currentTarget.value);if(C==="")return;let w=Lb(n,pu),P=C.split(""),_=!P.every(pu),T=P.length+w>Ms;if(_){l("Passcode can only be numbers"),d(1);return}if(T){l("Passcode must be exactly 6 numbers"),d(1);return}l(null),d(null);let A=Number(E.currentTarget.name?.charAt(4)),S=[...C||[""]].slice(0,Ms-A),I=[...n.slice(0,A),...S,...n.slice(A+S.length)];i(I);let N=S.length,H=Math.min(Math.max(A+N,0),Ms-1);if(document.querySelector(`input[name=pin-${H}]`)?.focus(),O2(I))try{await e(I.join("")),document.querySelector(`input[name=pin-${H}]`)?.blur()}catch(K){d(1),l(K.message)}else try{await e(null)}catch(K){d(1),l(K.message)}},m=E=>{s===1&&(l(null),d(null));let C=[...n.slice(0,E),"",...n.slice(E+1)];i(C),E>0&&document.querySelector(`input[name=pin-${E-1}]`)?.focus(),O2(C)?e(C.join("")):e(null)},y=o?"success":!!(r||a)?"fail":"";return Is(Ub,{children:Db(Nb,{children:[Is("div",{children:n.map((E,C)=>Is("input",{name:`pin-${C}`,type:"text",value:n[C],onChange:u,onKeyUp:w=>{w.key==="Backspace"&&m(C)},inputMode:"numeric",autoFocus:C===0,pattern:"[0-9]",className:y,autoComplete:Ib?"one-time-code":"off",disabled:t},C))}),Is("div",{children:Is(Ob,{fail:!!r||!!a,children:r||a})})]})})},Nb=D2.div`
2269
2269
  display: flex;
2270
2270
  flex-direction: column;
2271
2271
  width: 100%;
@@ -2333,7 +2333,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2333
2333
  transform: translate(1px, 0px);
2334
2334
  }
2335
2335
  }
2336
- `,Ob=W2.div`
2336
+ `,Ob=D2.div`
2337
2337
  line-height: 20px;
2338
2338
  font-size: 13px;
2339
2339
  display: flex;
@@ -2341,7 +2341,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2341
2341
  width: 100%;
2342
2342
 
2343
2343
  color: ${e=>e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
2344
- `;import{Fragment as lu,jsx as Ve,jsxs as fi}from"react/jsx-runtime";var N2=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=hd(""),[i,a]=hd(!1),[l,s]=hd(null),[d,u]=hd("enroll"),{initEnrollmentWithSms:m,submitEnrollmentWithSms:f}=ao(),{app:g,data:v}=x();function C(){v?.mfaEnrollmentFlow?.onSuccess(),e()}async function b({qualifiedPhoneNumber:S}){try{await m({phoneNumber:S}),n(S),u("verify")}catch(P){s(P)}}async function A(S){try{if(!S)return;await f({phoneNumber:o,mfaCode:S}),a(!0)}catch(P){throw mc(P)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):ni(P)?new Error("The code you entered is not valid"):oi(P)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):fc(P)?new Error("Verification canceled"):new Error("Unknown error")}}function _(){d==="verify"?u("enroll"):t()}return l?Ve(ai,{error:l,backFn:()=>s(null),onClick:()=>s(null)}):d==="enroll"?fi(lu,{children:[Ve(R,{backFn:t,onClose:r},"header"),Ve(Fe,{children:Ve(Je,{children:Ve(L2,{})})}),Ve(fe,{children:"Set up SMS verification"}),Ve(ye,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),fi(Fr,{children:[Ve(Sn,{onSubmit:b,hideRecent:!0}),fi(yh,{children:["By providing your mobile number, you agree to receive text messages from ",g?.name,". Some carrier charges may apply"]})]}),Ve(Z,{})]}):i?fi(lu,{children:[Ve(R,{onClose:C},"header"),Ve(Fe,{children:Ve(Je,{status:"success",children:Ve(Fb,{})})}),Ve(fe,{children:"SMS verification added"}),Ve(ye,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),Ve(kt,{children:Ve(F,{onClick:C,children:"Done"})}),Ve(Z,{})]}):fi(lu,{children:[Ve(R,{backFn:_,onClose:r},"header"),Ve(Fe,{children:Ve(Je,{children:Ve(L2,{})})}),Ve(fe,{children:"Enter enrollment code"}),fi(Fr,{children:[Ve(mi,{onChange:A}),fi(ye,{children:["To continue, enter the 6-digit code sent to ",Ve("strong",{children:$1(o)})]})]}),Ve(Z,{})]})};import Vb from"@heroicons/react/24/solid/CheckCircleIcon";import Gb from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import{useState as D2}from"react";import Bb from"@heroicons/react/24/solid/ShieldCheckIcon";import{jsx as Hb}from"react/jsx-runtime";var O2=({size:e,authUrl:t})=>Hb(Cn,{url:t,squareLogoElement:Bb,size:e,fgColor:"#1F1F1F"});import{Fragment as cu,jsx as Be,jsxs as Ws}from"react/jsx-runtime";var U2=({onComplete:e,onClose:t,onReset:r,totpInfo:o})=>{let[n,i]=D2("enroll"),[a,l]=D2(!1),{submitEnrollmentWithTotp:s}=ao(),{data:d}=x();function u(){d?.mfaEnrollmentFlow?.onSuccess(),e()}function m(){i("verify")}async function f(v){try{if(!v)return;await s({mfaCode:v}),l(!0)}catch(C){throw mc(C)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):ni(C)?new Error("The code you entered is not valid"):oi(C)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):fc(C)?new Error("Verification canceled"):new Error("Unknown error")}}function g(){n==="verify"?i("enroll"):r()}return n==="enroll"?Ws(cu,{children:[Be(R,{backFn:r,onClose:t},"header"),Be(fe,{children:"Scan QR code"}),Be(ye,{children:"Open your authenticator app and scan the QR code to continue."}),Be(Qi,{children:Be(O2,{authUrl:o.authUrl,size:200})}),Ws(kt,{children:[Be(St,{children:Be(gn,{itemName:"secret",text:o.secret})}),Be(F,{onClick:m,children:"Continue"})]}),Be(Z,{})]}):a?Ws(cu,{children:[Be(R,{onClose:u},"header"),Be(Fe,{children:Be(Je,{status:"success",children:Be(Vb,{})})}),Be(fe,{children:"Authenticator app verification added"}),Be(ye,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),Be(kt,{children:Be(F,{onClick:u,children:"Done"})}),Be(Z,{})]}):Ws(cu,{children:[Be(R,{backFn:g,onClose:t},"header"),Be(Fe,{children:Be(Je,{children:Be(Gb,{})})}),Be(fe,{children:"Enter enrollment code"}),Be(Fr,{children:Be(mi,{onChange:f})}),Ws(ye,{children:["To continue, enter the 6-digit code generated from your ",Be("strong",{children:"authenticator app"})]}),Be(Z,{})]})};import{Fragment as Aa,jsx as j,jsxs as Ar}from"react/jsx-runtime";var B2=()=>{let{user:e,enrollInMfa:t}=K(),[r,o]=Sa(null),{unenrollWithSms:n,unenrollWithTotp:i,unenrollWithPasskey:a}=ao(),{app:l,ready:s,data:d,onUserCloseViaDialogOrKeybindRef:u}=x(),{closePrivyModal:m}=L(),{promptMfa:f}=ks(),{initEnrollmentWithTotp:g}=ao(),[v,C]=Sa(!1),[b,A]=Sa(null),[_,S]=Sa(null),P=()=>{m({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),A(null)},500)},{initEnrollmentWithPasskey:E,submitEnrollmentWithPasskey:k}=ao(),[D,H]=Sa(!1),[M,X]=Sa(null);u.current=P;let W=e?.mfaMethods.includes("sms"),Y=!!e?.phone,Ce=e?.mfaMethods.includes("totp"),q=e?.mfaMethods.includes("passkey"),pe=W||Ce||q,Q=e?.linkedAccounts.filter(le=>le.type==="passkey").map(le=>le.credentialId)??[];Xb(()=>{pe&&C(!0)},[pe]);function ee(){o(null),A(null)}function ue(){C(!1)}async function me(){H(!0);try{await E(),await k({credentialIds:Q})}catch(le){X(le)}finally{H(!1)}}async function Te(le){if(await f().catch(X),le==="totp"){A(le),S(null),g().then(nt=>{S(nt)}).catch(()=>{S(null),ee()});return}if(le==="passkey"&&Q.length===1)return await me();A(le)}if(!s||!e||!l)return Ar(Aa,{children:[j(R,{onClose:P},"header"),j(Fe,{children:j(R2,{})}),j(Fr,{children:j(at,{})}),j(Z,{})]});async function ce(){o(null);try{await n()}catch{o(null)}}async function Se(){o(null);try{await i()}catch{o(null)}}async function ft(){o(null);try{await f(),await a()}catch{o(null)}}if(r==="sms")return Ar(Aa,{children:[j(R,{backFn:ee,onClose:P},"header"),j(Fe,{children:j(Je,{children:j(Yb,{})})}),j(fe,{children:"Remove SMS verification?"}),Ar(ye,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),j(kt,{children:j(F,{warn:!0,onClick:ce,children:"Remove SMS for MFA"})}),j(Z,{})]});if(r==="totp")return Ar(Aa,{children:[j(R,{backFn:ee,onClose:P},"header"),j(Fe,{children:j(Je,{children:j(zb,{})})}),j(fe,{children:"Remove Authenticator App verification?"}),Ar(ye,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),j(kt,{children:j(F,{warn:!0,onClick:Se,children:"Remove Authenticator App for MFA"})}),j(Z,{})]});if(r==="passkey")return Ar(Aa,{children:[j(R,{backFn:ee,onClose:P},"header"),j(Fe,{children:j(Je,{children:j(Qb,{})})}),j(fe,{children:"Are you sure you want to remove passkey verification?"}),j(ye,{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."}),j(kt,{children:j(F,{warn:!0,onClick:ft,children:"Yes, remove"})}),j(Z,{})]});if(d.mfaEnrollmentFlow.mfaMethods.length===0&&!pe)return Ar(Aa,{children:[j(R,{onClose:P},"header"),j(Fe,{children:j(Je,{children:j(F2,{})})}),j(fe,{children:"Add more security"}),Ar(ye,{children:[l?.name," does not have any verification methods enabled."]}),j(kt,{children:j(F,{onClick:P,children:"Close"})}),j(Z,{})]});let tt=!pe&&!v;return tt?Ar(Aa,{children:[j(R,{onClose:P},"header"),j(Fe,{children:j(Je,{children:j(F2,{})})}),j(fe,{children:"Transaction Protection"}),j(ye,{children:"Set up transaction protection to add an extra layer of security to your account"}),Ar(Jn,{children:[Ar(ar,{children:[j(ir,{children:j(qb,{})}),"Enable 2-Step verification for your ",l?.name," wallet."]}),Ar(ar,{children:[j(ir,{children:j(Kb,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),Ar(kt,{children:[j(F,{onClick:()=>C(!0),children:"Continue"}),j($r,{onClick:P,children:"Not now"})]}),j(Z,{})]}):b==="sms"?j(N2,{onComplete:P,onReset:ee,onClose:P}):b==="totp"&&_?j(U2,{onComplete:P,onClose:P,onReset:ee,totpInfo:_}):b==="passkey"?j(M2,{onComplete:P,onReset:ee,onClose:P}):j(k2,{showIntro:tt,userMfaMethods:e.mfaMethods,appMfaMethods:l.mfa.methods,userHasAuthSms:Y,onBackToIntro:ue,handleSelectMethod:Te,isTotpLoading:b==="totp"&&!_,isPasskeyLoading:D,error:M,onClose:P,setRemovingMfaMethod:o})};import xE from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import RE from"@heroicons/react/24/outline/FingerPrintIcon";import kE from"@heroicons/react/24/outline/PhoneIcon";import _E from"@heroicons/react/24/outline/ShieldCheckIcon";import ME from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import IE from"@heroicons/react/24/solid/PhoneIcon";import{useEffect as WE,useState as Os}from"react";import{useMemo as CE,useEffect as vE,useState as s3}from"react";import wE from"styled-components";import{calculateTotalGasEstimate as bE,populateTransactionRequest as EE}from"@privy-io/js-sdk-core";import a3 from"styled-components";import V2 from"styled-components";import{jsx as H2,jsxs as jb}from"react/jsx-runtime";var yd=({label:e,children:t,valueStyles:r})=>jb(Zb,{children:[H2("div",{children:e}),H2(Jb,{style:{...r},children:t})]}),Zb=V2.div`
2344
+ `;import{Fragment as uu,jsx as Ge,jsxs as Ci}from"react/jsx-runtime";var F2=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=hd(""),[i,a]=hd(!1),[l,s]=hd(null),[d,u]=hd("enroll"),{initEnrollmentWithSms:m,submitEnrollmentWithSms:f}=no(),{app:y,data:E}=R();function C(){E?.mfaEnrollmentFlow?.onSuccess(),e()}async function w({qualifiedPhoneNumber:T}){try{await m({phoneNumber:T}),n(T),u("verify")}catch(A){s(A)}}async function P(T){try{if(!T)return;await f({phoneNumber:o,mfaCode:T}),a(!0)}catch(A){throw uc(A)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):li(A)?new Error("The code you entered is not valid"):si(A)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):mc(A)?new Error("Verification canceled"):new Error("Unknown error")}}function _(){d==="verify"?u("enroll"):t()}return l?Ge(di,{error:l,backFn:()=>s(null),onClick:()=>s(null)}):d==="enroll"?Ci(uu,{children:[Ge(k,{backFn:t,onClose:r},"header"),Ge(Fe,{children:Ge($e,{children:Ge(U2,{})})}),Ge(ue,{children:"Set up SMS verification"}),Ge(fe,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),Ci(Nr,{children:[Ge(Pn,{onSubmit:w,hideRecent:!0}),Ci(vh,{children:["By providing your mobile number, you agree to receive text messages from ",y?.name,". Some carrier charges may apply"]})]}),Ge(J,{})]}):i?Ci(uu,{children:[Ge(k,{onClose:C},"header"),Ge(Fe,{children:Ge($e,{status:"success",children:Ge(Fb,{})})}),Ge(ue,{children:"SMS verification added"}),Ge(fe,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),Ge(xt,{children:Ge(F,{onClick:C,children:"Done"})}),Ge(J,{})]}):Ci(uu,{children:[Ge(k,{backFn:_,onClose:r},"header"),Ge(Fe,{children:Ge($e,{children:Ge(U2,{})})}),Ge(ue,{children:"Enter enrollment code"}),Ci(Nr,{children:[Ge(gi,{onChange:P}),Ci(fe,{children:["To continue, enter the 6-digit code sent to ",Ge("strong",{children:r2(o)})]})]}),Ge(J,{})]})};import Vb from"@heroicons/react/24/solid/CheckCircleIcon";import Gb from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import{useState as H2}from"react";import Bb from"@heroicons/react/24/solid/ShieldCheckIcon";import{jsx as Hb}from"react/jsx-runtime";var B2=({size:e,authUrl:t})=>Hb(vn,{url:t,squareLogoElement:Bb,size:e,fgColor:"#1F1F1F"});import{Fragment as mu,jsx as Be,jsxs as Ws}from"react/jsx-runtime";var V2=({onComplete:e,onClose:t,onReset:r,totpInfo:o})=>{let[n,i]=H2("enroll"),[a,l]=H2(!1),{submitEnrollmentWithTotp:s}=no(),{data:d}=R();function u(){d?.mfaEnrollmentFlow?.onSuccess(),e()}function m(){i("verify")}async function f(E){try{if(!E)return;await s({mfaCode:E}),l(!0)}catch(C){throw uc(C)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):li(C)?new Error("The code you entered is not valid"):si(C)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):mc(C)?new Error("Verification canceled"):new Error("Unknown error")}}function y(){n==="verify"?i("enroll"):r()}return n==="enroll"?Ws(mu,{children:[Be(k,{backFn:r,onClose:t},"header"),Be(ue,{children:"Scan QR code"}),Be(fe,{children:"Open your authenticator app and scan the QR code to continue."}),Be(ji,{children:Be(B2,{authUrl:o.authUrl,size:200})}),Ws(xt,{children:[Be(Et,{children:Be(Cn,{itemName:"secret",text:o.secret})}),Be(F,{onClick:m,children:"Continue"})]}),Be(J,{})]}):a?Ws(mu,{children:[Be(k,{onClose:u},"header"),Be(Fe,{children:Be($e,{status:"success",children:Be(Vb,{})})}),Be(ue,{children:"Authenticator app verification added"}),Be(fe,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),Be(xt,{children:Be(F,{onClick:u,children:"Done"})}),Be(J,{})]}):Ws(mu,{children:[Be(k,{backFn:y,onClose:t},"header"),Be(Fe,{children:Be($e,{children:Be(Gb,{})})}),Be(ue,{children:"Enter enrollment code"}),Be(Nr,{children:Be(gi,{onChange:f})}),Ws(fe,{children:["To continue, enter the 6-digit code generated from your ",Be("strong",{children:"authenticator app"})]}),Be(J,{})]})};import{Fragment as Ra,jsx as $,jsxs as br}from"react/jsx-runtime";var q2=()=>{let{user:e,enrollInMfa:t}=V(),[r,o]=xa(null),{unenrollWithSms:n,unenrollWithTotp:i,unenrollWithPasskey:a}=no(),{app:l,ready:s,data:d,onUserCloseViaDialogOrKeybindRef:u}=R(),{closePrivyModal:m}=M(),{promptMfa:f}=ks(),{initEnrollmentWithTotp:y}=no(),[E,C]=xa(!1),[w,P]=xa(null),[_,T]=xa(null),A=()=>{m({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),P(null)},500)},{initEnrollmentWithPasskey:S,submitEnrollmentWithPasskey:I}=no(),[N,H]=xa(!1),[x,K]=xa(null);u.current=A;let W=e?.mfaMethods.includes("sms"),Q=!!e?.phone,de=e?.mfaMethods.includes("totp"),q=e?.mfaMethods.includes("passkey"),pe=W||de||q,Z=e?.linkedAccounts.filter(le=>le.type==="passkey").map(le=>le.credentialId)??[];Xb(()=>{pe&&C(!0)},[pe]);function ie(){o(null),P(null)}function se(){C(!1)}async function _e(){H(!0);try{await S(),await I({credentialIds:Z})}catch(le){K(le)}finally{H(!1)}}async function be(le){if(await f().catch(K),le==="totp"){P(le),T(null),y().then(et=>{T(et)}).catch(()=>{T(null),ie()});return}if(le==="passkey"&&Z.length===1)return await _e();P(le)}if(!s||!e||!l)return br(Ra,{children:[$(k,{onClose:A},"header"),$(Fe,{children:$(M2,{})}),$(Nr,{children:$(st,{})}),$(J,{})]});async function ye(){o(null);try{await n()}catch{o(null)}}async function ae(){o(null);try{await i()}catch{o(null)}}async function Xe(){o(null);try{await f(),await a()}catch{o(null)}}if(r==="sms")return br(Ra,{children:[$(k,{backFn:ie,onClose:A},"header"),$(Fe,{children:$($e,{children:$(Yb,{})})}),$(ue,{children:"Remove SMS verification?"}),br(fe,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),$(xt,{children:$(F,{warn:!0,onClick:ye,children:"Remove SMS for MFA"})}),$(J,{})]});if(r==="totp")return br(Ra,{children:[$(k,{backFn:ie,onClose:A},"header"),$(Fe,{children:$($e,{children:$(zb,{})})}),$(ue,{children:"Remove Authenticator App verification?"}),br(fe,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),$(xt,{children:$(F,{warn:!0,onClick:ae,children:"Remove Authenticator App for MFA"})}),$(J,{})]});if(r==="passkey")return br(Ra,{children:[$(k,{backFn:ie,onClose:A},"header"),$(Fe,{children:$($e,{children:$(Qb,{})})}),$(ue,{children:"Are you sure you want to remove passkey verification?"}),$(fe,{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."}),$(xt,{children:$(F,{warn:!0,onClick:Xe,children:"Yes, remove"})}),$(J,{})]});if(d.mfaEnrollmentFlow.mfaMethods.length===0&&!pe)return br(Ra,{children:[$(k,{onClose:A},"header"),$(Fe,{children:$($e,{children:$(G2,{})})}),$(ue,{children:"Add more security"}),br(fe,{children:[l?.name," does not have any verification methods enabled."]}),$(xt,{children:$(F,{onClick:A,children:"Close"})}),$(J,{})]});let it=!pe&&!E;return it?br(Ra,{children:[$(k,{onClose:A},"header"),$(Fe,{children:$($e,{children:$(G2,{})})}),$(ue,{children:"Transaction Protection"}),$(fe,{children:"Set up transaction protection to add an extra layer of security to your account"}),br(ei,{children:[br(or,{children:[$(rr,{children:$(qb,{})}),"Enable 2-Step verification for your ",l?.name," wallet."]}),br(or,{children:[$(rr,{children:$(Kb,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),br(xt,{children:[$(F,{onClick:()=>C(!0),children:"Continue"}),$(Jr,{onClick:A,children:"Not now"})]}),$(J,{})]}):w==="sms"?$(F2,{onComplete:A,onReset:ie,onClose:A}):w==="totp"&&_?$(V2,{onComplete:A,onClose:A,onReset:ie,totpInfo:_}):w==="passkey"?$(N2,{onComplete:A,onReset:ie,onClose:A}):$(W2,{showIntro:it,userMfaMethods:e.mfaMethods,appMfaMethods:l.mfa.methods,userHasAuthSms:Q,onBackToIntro:se,handleSelectMethod:be,isTotpLoading:w==="totp"&&!_,isPasskeyLoading:N,error:x,onClose:A,setRemovingMfaMethod:o})};import xE from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import RE from"@heroicons/react/24/outline/FingerPrintIcon";import kE from"@heroicons/react/24/outline/PhoneIcon";import _E from"@heroicons/react/24/outline/ShieldCheckIcon";import IE from"@heroicons/react/24/solid/DevicePhoneMobileIcon";import ME from"@heroicons/react/24/solid/PhoneIcon";import{useEffect as WE,useState as Os}from"react";import{useMemo as CE,useEffect as vE,useState as p3}from"react";import wE from"styled-components";import{calculateTotalGasEstimate as bE,populateTransactionRequest as EE}from"@privy-io/js-sdk-core";import d3 from"styled-components";import K2 from"styled-components";import{jsx as z2,jsxs as jb}from"react/jsx-runtime";var yd=({label:e,children:t,valueStyles:r})=>jb(Zb,{children:[z2("div",{children:e}),z2(Jb,{style:{...r},children:t})]}),Zb=K2.div`
2345
2345
  display: flex;
2346
2346
  align-items: center;
2347
2347
  justify-content: space-between;
@@ -2356,7 +2356,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2356
2356
  color: var(--privy-color-foreground-2);
2357
2357
  text-align: right;
2358
2358
  }
2359
- `,Jb=V2.div`
2359
+ `,Jb=K2.div`
2360
2360
  font-size: 14px;
2361
2361
  line-height: 100%;
2362
2362
  display: flex;
@@ -2365,7 +2365,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2365
2365
  border-radius: var(--privy-border-radius-full);
2366
2366
  background-color: var(--privy-color-background-2);
2367
2367
  padding: 4px 8px;
2368
- `;import Cd from"styled-components";import{Fragment as rE,jsx as gd,jsxs as G2}from"react/jsx-runtime";var q2=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Ba(e),n=t?yo(o,t):void 0,i=bt(o,r);return gd(z2,{children:n||i})},du=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Ba(e),n=t?yo(o,t):void 0,i=bt(o,r);return gd(z2,{children:n?G2(rE,{children:[gd($b,{children:"USD"}),n==="<$0.01"?G2(tE,{children:[gd(eE,{children:"<"}),"$0.01"]}):n]}):i})},z2=Cd.span`
2368
+ `;import Cd from"styled-components";import{Fragment as rE,jsx as gd,jsxs as Y2}from"react/jsx-runtime";var Q2=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Ha(e),n=t?fo(o,t):void 0,i=wt(o,r);return gd(X2,{children:n||i})},fu=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=Ha(e),n=t?fo(o,t):void 0,i=wt(o,r);return gd(X2,{children:n?Y2(rE,{children:[gd($b,{children:"USD"}),n==="<$0.01"?Y2(tE,{children:[gd(eE,{children:"<"}),"$0.01"]}):n]}):i})},X2=Cd.span`
2369
2369
  font-size: 14px;
2370
2370
  line-height: 140%;
2371
2371
  display: flex;
@@ -2380,13 +2380,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
2380
2380
  `,tE=Cd.span`
2381
2381
  display: flex;
2382
2382
  align-items: center;
2383
- `;import pu from"styled-components";import{QuantityToBigNumber as K2}from"@privy-io/js-sdk-core";import{jsx as kn,jsxs as vd}from"react/jsx-runtime";var Y2=({gas:e,tokenPrice:t,tokenSymbol:r})=>vd(cn,{style:{paddingBottom:"12px"},children:[vd(X2,{children:[kn(J2,{children:"Est. Fees"}),kn("div",{children:kn(du,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&kn(Z2,{children:`${bt(e,r)}`})]}),Q2=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=K2(e.value||0).add(K2(t)).toHexString();return vd(cn,{children:[vd(X2,{children:[kn(J2,{children:"Total (including fees)"}),kn("div",{children:kn(du,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&kn(Z2,{children:bt(n,o)})]})},X2=pu.div`
2383
+ `;import hu from"styled-components";import{QuantityToBigNumber as Z2}from"@privy-io/js-sdk-core";import{jsx as _n,jsxs as vd}from"react/jsx-runtime";var J2=({gas:e,tokenPrice:t,tokenSymbol:r})=>vd(dn,{style:{paddingBottom:"12px"},children:[vd($2,{children:[_n(t3,{children:"Est. Fees"}),_n("div",{children:_n(fu,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&_n(e3,{children:`${wt(e,r)}`})]}),j2=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=Z2(e.value||0).add(Z2(t)).toHexString();return vd(dn,{children:[vd($2,{children:[_n(t3,{children:"Total (including fees)"}),_n("div",{children:_n(fu,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&_n(e3,{children:wt(n,o)})]})},$2=hu.div`
2384
2384
  display: flex;
2385
2385
  flex-direction: row;
2386
2386
  justify-content: space-between;
2387
2387
  align-items: center;
2388
2388
  padding-top: 4px;
2389
- `,Z2=pu.div`
2389
+ `,e3=hu.div`
2390
2390
  display: flex;
2391
2391
  flex-direction: row;
2392
2392
  height: 12px;
@@ -2395,23 +2395,23 @@ You will need this password to access your ${e} wallet on a new device. Please k
2395
2395
  line-height: 12px;
2396
2396
  color: var(--privy-color-foreground-3);
2397
2397
  font-weight: 400;
2398
- `,J2=pu.div`
2398
+ `,t3=hu.div`
2399
2399
  font-size: 14px;
2400
2400
  line-height: 22.4px;
2401
2401
  font-weight: 400;
2402
- `;import oE from"@heroicons/react/24/outline/ChevronDownIcon";import{useContext as hi,useState as nE}from"react";import _n from"styled-components";import{createContext as j2,useContext as Vj}from"react";var Pa=j2(void 0);var Ls=j2(void 0);import{Fragment as uE,jsx as so,jsxs as $2}from"react/jsx-runtime";var e3=({defaultValue:e,children:t})=>{let[r,o]=nE(e||null),n=i=>{o(r===i?null:i)};return so(Pa.Provider,{value:{activePanel:r,togglePanel:n},children:so(iE,{children:t})})},t3=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=hi(Pa),n=r===e;return so(Ls.Provider,{value:{onToggle:()=>o(e),value:e},children:so(cE,{isActive:n,"data-open":n,children:t})})},r3=({children:e})=>{let{activePanel:t}=hi(Pa),{onToggle:r,value:o}=hi(Ls),n=t===o;return $2(uE,{children:[$2(aE,{onClick:r,"data-open":n,children:[so(lE,{children:e}),so(pE,{isactive:n,children:so(oE,{height:"16px",width:"16px",strokeWidth:"2"})})]}),so(sE,{})]})},o3=({children:e})=>{let{activePanel:t}=hi(Pa),{value:r}=hi(Ls);return so(dE,{"data-open":t===r,children:so(i3,{children:e})})},n3=({children:e})=>{let{activePanel:t}=hi(Pa),{value:r}=hi(Ls);return so(i3,{children:typeof e=="function"?e({isActive:t===r}):e})},iE=_n.div`
2402
+ `;import oE from"@heroicons/react/24/outline/ChevronDownIcon";import{useContext as vi,useState as nE}from"react";import In from"styled-components";import{createContext as r3,useContext as Hj}from"react";var ka=r3(void 0);var Ls=r3(void 0);import{Fragment as uE,jsx as io,jsxs as o3}from"react/jsx-runtime";var n3=({defaultValue:e,children:t})=>{let[r,o]=nE(e||null),n=i=>{o(r===i?null:i)};return io(ka.Provider,{value:{activePanel:r,togglePanel:n},children:io(iE,{children:t})})},i3=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=vi(ka),n=r===e;return io(Ls.Provider,{value:{onToggle:()=>o(e),value:e},children:io(cE,{isActive:n,"data-open":n,children:t})})},a3=({children:e})=>{let{activePanel:t}=vi(ka),{onToggle:r,value:o}=vi(Ls),n=t===o;return o3(uE,{children:[o3(aE,{onClick:r,"data-open":n,children:[io(lE,{children:e}),io(pE,{isactive:n,children:io(oE,{height:"16px",width:"16px",strokeWidth:"2"})})]}),io(sE,{})]})},s3=({children:e})=>{let{activePanel:t}=vi(ka),{value:r}=vi(Ls);return io(dE,{"data-open":t===r,children:io(c3,{children:e})})},l3=({children:e})=>{let{activePanel:t}=vi(ka),{value:r}=vi(Ls);return io(c3,{children:typeof e=="function"?e({isActive:t===r}):e})},iE=In.div`
2403
2403
  display: flex;
2404
2404
  flex-direction: column;
2405
2405
  width: 100%;
2406
2406
  gap: 8px;
2407
- `,aE=_n.div`
2407
+ `,aE=In.div`
2408
2408
  display: flex;
2409
2409
  justify-content: space-between;
2410
2410
  align-items: center;
2411
2411
  width: 100%;
2412
2412
  cursor: pointer;
2413
2413
  padding-bottom: 8px;
2414
- `,sE=_n.div`
2414
+ `,sE=In.div`
2415
2415
  width: 100%;
2416
2416
 
2417
2417
  && {
@@ -2419,13 +2419,13 @@ You will need this password to access your ${e} wallet on a new device. Please k
2419
2419
  border-color: var(--privy-color-foreground-4);
2420
2420
  }
2421
2421
  padding-bottom: 12px;
2422
- `,lE=_n.div`
2422
+ `,lE=In.div`
2423
2423
  font-size: 14px;
2424
2424
  font-weight: 500;
2425
2425
  line-height: 19.6px;
2426
2426
  width: 100%;
2427
2427
  padding-right: 8px;
2428
- `,cE=_n.div`
2428
+ `,cE=In.div`
2429
2429
  display: flex;
2430
2430
  flex-direction: column;
2431
2431
  width: 100%;
@@ -2437,7 +2437,7 @@ You will need this password to access your ${e} wallet on a new device. Please k
2437
2437
  border-color: var(--privy-color-foreground-4);
2438
2438
  border-radius: var(--privy-border-radius-md);
2439
2439
  }
2440
- `,dE=_n.div`
2440
+ `,dE=In.div`
2441
2441
  position: relative;
2442
2442
  overflow: hidden;
2443
2443
  transition: max-height 25ms ease-out;
@@ -2449,29 +2449,29 @@ You will need this password to access your ${e} wallet on a new device. Please k
2449
2449
  &[data-open='false'] {
2450
2450
  max-height: 0;
2451
2451
  }
2452
- `,i3=_n.div`
2452
+ `,c3=In.div`
2453
2453
  display: flex;
2454
2454
  flex-direction: column;
2455
2455
  gap: 12px;
2456
2456
  flex: 1 1 auto;
2457
2457
  min-height: 1px;
2458
- `,pE=_n.div`
2458
+ `,pE=In.div`
2459
2459
  transform: ${e=>e.isactive?"rotate(180deg)":"rotate(0deg)"};
2460
- `;import mE from"styled-components";import{jsx as hE}from"react/jsx-runtime";var uu=({walletAddress:e,chainId:t=Fo})=>hE(fE,{href:Mm(t,e),target:"_blank",children:Ut(e)}),fE=mE.a`
2460
+ `;import mE from"styled-components";import{jsx as hE}from"react/jsx-runtime";var yu=({walletAddress:e,chainId:t=Uo})=>hE(fE,{href:Lm(t,e),target:"_blank",children:Yr(e)}),fE=mE.a`
2461
2461
  &:hover {
2462
2462
  text-decoration: underline;
2463
2463
  }
2464
- `;import{jsx as Pr,jsxs as mu}from"react/jsx-runtime";var wd=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=r?.value||0,s=Le();return Pr(e3,{...s.render.standalone?{defaultValue:"details"}:{},children:mu(t3,{value:"details",children:[Pr(r3,{children:mu(yE,{children:[Pr("div",{children:o?.title||o?.actionDescription||"Details"}),Pr(gE,{children:Pr(q2,{weiQuantities:[l],tokenPrice:n,tokenSymbol:a})})]})}),mu(o3,{children:[Pr(yd,{label:"From",children:Pr(uu,{walletAddress:e,chainId:r.chainId||Fo})}),Pr(yd,{label:"To",children:Pr(uu,{walletAddress:t,chainId:r.chainId||Fo})}),o&&o.action&&Pr(yd,{label:"Action",children:o.action}),i&&Pr(Y2,{transactionData:r,gas:i,tokenPrice:n,tokenSymbol:a})]}),Pr(n3,{children:({isActive:d})=>Pr(Q2,{transactionData:r,displayFee:d,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},yE=a3.div`
2464
+ `;import{jsx as Er,jsxs as gu}from"react/jsx-runtime";var wd=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:i,tokenSymbol:a})=>{let l=r?.value||0,s=Me();return Er(n3,{...s.render.standalone?{defaultValue:"details"}:{},children:gu(i3,{value:"details",children:[Er(a3,{children:gu(yE,{children:[Er("div",{children:o?.title||o?.actionDescription||"Details"}),Er(gE,{children:Er(Q2,{weiQuantities:[l],tokenPrice:n,tokenSymbol:a})})]})}),gu(s3,{children:[Er(yd,{label:"From",children:Er(yu,{walletAddress:e,chainId:r.chainId||Uo})}),Er(yd,{label:"To",children:Er(yu,{walletAddress:t,chainId:r.chainId||Uo})}),o&&o.action&&Er(yd,{label:"Action",children:o.action}),i&&Er(J2,{transactionData:r,gas:i,tokenPrice:n,tokenSymbol:a})]}),Er(l3,{children:({isActive:d})=>Er(j2,{transactionData:r,displayFee:d,gas:i||"0x0",tokenPrice:n,tokenSymbol:a})})]})})},yE=d3.div`
2465
2465
  display: flex;
2466
2466
  flex-direction: row;
2467
2467
  justify-content: space-between;
2468
- `,gE=a3.div`
2468
+ `,gE=d3.div`
2469
2469
  flex-shrink: 0;
2470
2470
  padding-left: 8px;
2471
- `;import{jsx as l3}from"react/jsx-runtime";var Ns=({pendingTransaction:e})=>{let{getAccessToken:t}=K(),{wallets:r}=Bo(),{walletProxy:o,rpcConfig:n,chains:i,appId:a,nativeTokenSymbolForChainId:l}=L(),[s,d]=s3(null),[u,m]=s3(e),{tokenPrice:f}=_o(u),g=l(e.chainId)||"ETH",v=CE(()=>r.find(C=>C.walletClientType==="privy"),[r]);return vE(()=>{async function C(){if(!await t()||!o||!v)return u;let A=Ir(u.chainId,i,n,{appId:a}),_=await EE(v.address,u,A),{totalGasEstimate:S}=await bE(_,A);return d(S.toHexString()),_}C().then(m).catch(console.error)},[o]),v?l3(TE,{children:l3(wd,{from:v.address,to:u.to,txn:u,gas:s??void 0,tokenPrice:f,tokenSymbol:g})}):null},TE=wE.div`
2471
+ `;import{jsx as u3}from"react/jsx-runtime";var Ns=({pendingTransaction:e})=>{let{getAccessToken:t}=V(),{wallets:r}=Bo(),{walletProxy:o,rpcConfig:n,chains:i,appId:a,nativeTokenSymbolForChainId:l}=M(),[s,d]=p3(null),[u,m]=p3(e),{tokenPrice:f}=Ro(u),y=l(e.chainId)||"ETH",E=CE(()=>r.find(C=>C.walletClientType==="privy"),[r]);return vE(()=>{async function C(){if(!await t()||!o||!E)return u;let P=Rr(u.chainId,i,n,{appId:a}),_=await EE(E.address,u,P),{totalGasEstimate:T}=await bE(_,P);return d(T.toHexString()),_}C().then(m).catch(console.error)},[o]),E?u3(TE,{children:u3(wd,{from:E.address,to:u.to,txn:u,gas:s??void 0,tokenPrice:f,tokenSymbol:y})}):null},TE=wE.div`
2472
2472
  width: 100%;
2473
2473
  padding: 1rem 0;
2474
- `;import SE from"@heroicons/react/24/outline/CalendarIcon";import AE from"@heroicons/react/24/outline/ExclamationTriangleIcon";import PE from"@heroicons/react/24/outline/ShieldCheckIcon";import{Fragment as c3,jsx as Ot,jsxs as xa}from"react/jsx-runtime";var d3=({hasBlockingError:e,error:t,onClose:r,onBack:o,handleSubmit:n,account:i,submitSuccess:a})=>{let{pendingTransaction:l}=L();return xa(c3,{children:[Ot(R,{onClose:r},"header"),Ot(je,{children:xa("div",{children:[Ot(it,{success:a,fail:!!t}),t?Ot(AE,{style:{width:"38px",height:"38px"}}):Ot(si,{style:{width:"38px",height:"38px"}})]})}),Ot(fe,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),xa(Jn,{children:[xa(ar,{children:[Ot(ir,{children:Ot(PE,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),xa(ar,{children:[Ot(ir,{children:Ot(SE,{})}),"You last added a passkey on"," ",i?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),l&&Ot(Fr,{children:Ot(Ns,{pendingTransaction:l})}),t&&xa(c3,{children:[Ot(ec,{style:{marginTop:"1.25rem"},children:t.message}),Ot(F,{disabled:e,onClick:n,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&Ot(es,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),Ot(Z,{})]})};import{Fragment as fu,jsx as Ee,jsxs as lo}from"react/jsx-runtime";var hu=({open:e,onClose:t})=>{let{user:r}=K(),[o,n]=Os(null),{init:i,cancel:a,submit:l}=ks(),[s,d]=Os(!1),[u,m]=Os(!1),[f,g]=Os(null),[v,C]=Os(null);WE(()=>{e&&r?.mfaMethods&&r.mfaMethods.length>0?_(r.mfaMethods[0]):n(null)},[r?.mfaMethods,e]);let b=E=>Tp(E)?(d(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):ni(E)?(d(!1),new Error("The code you entered is not valid")):oi(E)?(d(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(E),d(!1),new Error("Something went wrong."));async function A(E){C(null);try{if(!E||!o)return;await l(o,E),m(!0),d(!1),t()}catch(k){throw b(k)}}async function _(E){if(E==="passkey"){try{n(E);let k=await i(E);if(!k)throw new Error("something went wrong");g(k),await l(E,k),m(!0),d(!1),t()}catch(k){C(b(k))}return}try{n(E),await i(E)}catch(k){console.error(k)}}let S=()=>{n(null),C(null),a(),t()},P=()=>{n(null),C(null)};if(!e||!r)return null;if(o==="passkey"){let E=r.linkedAccounts.filter(k=>k.type==="passkey"&&k.enrolledInMfa).sort((k,D)=>D.firstVerifiedAt.valueOf()-k.firstVerifiedAt.valueOf())[0];return Ee(d3,{account:E,selectedMethod:o,submitSuccess:u,hasBlockingError:s,error:v,onClose:S,onBack:P,handleSubmit:()=>A(f).catch(C)})}return o?Ee(LE,{submitSuccess:u,hasBlockingError:s,handleSubmitCode:A,selectedMethod:o,onClose:S,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):lo(fu,{children:[Ee(R,{onClose:S},"header"),Ee(Fe,{children:Ee(Je,{children:Ee(_E,{})})}),Ee(fe,{children:"Verify your identity"}),Ee(ye,{children:"Choose a verification method"}),lo(Xl,{children:[r.mfaMethods.includes("totp")&&lo(Pe,{onClick:()=>_("totp"),children:[Ee(xE,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&lo(Pe,{onClick:()=>_("sms"),children:[Ee(kE,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&lo(Pe,{onClick:()=>_("passkey"),children:[Ee(RE,{}),"Passkey"]},"passkey")]}),Ee(Z,{})]})},LE=({selectedMethod:e,submitSuccess:t,hasBlockingError:r,onClose:o,onBack:n,handleSubmitCode:i})=>{let{app:a}=x(),{pendingTransaction:l}=L();switch(e){case"sms":return lo(fu,{children:[Ee(R,{onClose:o},"header"),Ee(Fe,{children:Ee(Je,{children:Ee(IE,{})})}),Ee(fe,{children:"Enter verification code"}),lo(Fr,{children:[Ee(mi,{success:t,disabled:r,onChange:i}),lo(ye,{children:["To continue, please enter the 6-digit code sent to your ",Ee("strong",{children:"mobile device"})]}),l&&Ee(Ns,{pendingTransaction:l})]}),n&&Ee(es,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),Ee($r,{onClick:o,children:"Not now"}),Ee(Z,{})]});case"totp":return lo(fu,{children:[Ee(R,{onClose:o},"header"),Ee(Fe,{children:Ee(Je,{children:Ee(ME,{})})}),Ee(fe,{children:"Enter verification code"}),lo(Fr,{children:[Ee(mi,{success:t,disabled:r,onChange:i}),lo(ye,{children:["To continue, please enter the 6-digit code generated from your"," ",Ee("strong",{children:"authenticator app"})]}),l&&Ee(Ns,{pendingTransaction:l})]}),n&&Ee(es,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),Ee($r,{onClick:o,children:"Not now"}),Ee(Z,{})]});default:return null}};import{useEffect as p3,useState as u3}from"react";import NE from"styled-components";import{Fragment as DE,jsx as Wo,jsxs as bd}from"react/jsx-runtime";var m3=()=>{let{authenticated:e,logout:t,ready:r,user:o}=K(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=x(),{getAuthMeta:s,initLoginWithOAuth:d,loginWithOAuth:u,updateWallets:m,setReadyToTrue:f,closePrivyModal:g,createAnalyticsEvent:v}=L(),[C,b]=u3(!1),[A,_]=u3(void 0),S=s()?.provider||"google",{name:P,component:E}=qa(S),k=Ri(),D=We;p3(()=>{u(S).then(X=>{b(!0),f(!0),X&&k("login","onOAuthLoginComplete",X)}).catch(X=>{if(f(!1),X?.privyErrorCode==="allowlist_rejected"){_(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(X?.privyErrorCode==="max_accounts_reached"){console.error(new fo(X).toString()),_(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}if(X?.privyErrorCode==="user_does_not_exist"){_(void 0),l(),a("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:W,detail:Y}=Df(X,S);_({retryable:W,detail:Y,message:"Authentication failed"})}).finally(()=>{zn()})},[P,S]),p3(()=>{if(r&&e&&C&&o){if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let W=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},D);return()=>clearTimeout(W)}if(Et(o,n?.embeddedWallets?.createOnLogin)){let W=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:Y=>{console.error(Y),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Y,provider:S,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},D);return()=>clearTimeout(W)}else{let W=setTimeout(()=>g({shouldCallAuthOnSuccess:!0,isSuccess:!0}),D);return m(),()=>clearTimeout(W)}}},[r,e,C,o]);let H=C?`Successfully connected with ${P}`:A?A.message:`Verifying connection to ${P}`,M="";return C?M="You\u2019re good to go!":A?M=A.detail:M="Just a few moments more",bd(DE,{children:[Wo(R,{}),Wo(oe,{}),bd(OE,{children:[Wo(je,{children:bd("div",{children:[Wo(it,{success:C,fail:!!A}),Wo(E,{style:{width:"38px",height:"38px"}})]})}),bd(Qe,{children:[Wo("h3",{children:H}),Wo("p",{children:M})]}),A&&A?.retryable?Wo(sn,{onClick:()=>{zn(),d(S),_(void 0)},disabled:!C&&!A?.retryable,children:"Retry"}):null]}),Wo(ne,{}),Wo(Z,{})]})},OE=NE.div`
2474
+ `;import SE from"@heroicons/react/24/outline/CalendarIcon";import PE from"@heroicons/react/24/outline/ExclamationTriangleIcon";import AE from"@heroicons/react/24/outline/ShieldCheckIcon";import{Fragment as m3,jsx as Lt,jsxs as _a}from"react/jsx-runtime";var f3=({hasBlockingError:e,error:t,onClose:r,onBack:o,handleSubmit:n,account:i,submitSuccess:a})=>{let{pendingTransaction:l}=M();return _a(m3,{children:[Lt(k,{onClose:r},"header"),Lt(tt,{children:_a("div",{children:[Lt(at,{success:a,fail:!!t}),t?Lt(PE,{style:{width:"38px",height:"38px"}}):Lt(pi,{style:{width:"38px",height:"38px"}})]})}),Lt(ue,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),_a(ei,{children:[_a(or,{children:[Lt(rr,{children:Lt(AE,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),_a(or,{children:[Lt(rr,{children:Lt(SE,{})}),"You last added a passkey on"," ",i?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),l&&Lt(Nr,{children:Lt(Ns,{pendingTransaction:l})}),t&&_a(m3,{children:[Lt($l,{style:{marginTop:"1.25rem"},children:t.message}),Lt(F,{disabled:e,onClick:n,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&Lt(ts,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),Lt(J,{})]})};import{Fragment as Cu,jsx as we,jsxs as ao}from"react/jsx-runtime";var vu=({open:e,onClose:t})=>{let{user:r}=V(),[o,n]=Os(null),{init:i,cancel:a,submit:l}=ks(),[s,d]=Os(!1),[u,m]=Os(!1),[f,y]=Os(null),[E,C]=Os(null);WE(()=>{e&&r?.mfaMethods&&r.mfaMethods.length>0?_(r.mfaMethods[0]):n(null)},[r?.mfaMethods,e]);let w=S=>xp(S)?(d(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):li(S)?(d(!1),new Error("The code you entered is not valid")):si(S)?(d(!0),new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(S),d(!1),new Error("Something went wrong."));async function P(S){C(null);try{if(!S||!o)return;await l(o,S),m(!0),d(!1),t()}catch(I){throw w(I)}}async function _(S){if(S==="passkey"){try{n(S);let I=await i(S);if(!I)throw new Error("something went wrong");y(I),await l(S,I),m(!0),d(!1),t()}catch(I){C(w(I))}return}try{n(S),await i(S)}catch(I){console.error(I)}}let T=()=>{n(null),C(null),a(),t()},A=()=>{n(null),C(null)};if(!e||!r)return null;if(o==="passkey"){let S=r.linkedAccounts.filter(I=>I.type==="passkey"&&I.enrolledInMfa).sort((I,N)=>N.firstVerifiedAt.valueOf()-I.firstVerifiedAt.valueOf())[0];return we(f3,{account:S,selectedMethod:o,submitSuccess:u,hasBlockingError:s,error:E,onClose:T,onBack:A,handleSubmit:()=>P(f).catch(C)})}return o?we(LE,{submitSuccess:u,hasBlockingError:s,handleSubmitCode:P,selectedMethod:o,onClose:T,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):ao(Cu,{children:[we(k,{onClose:T},"header"),we(Fe,{children:we($e,{children:we(_E,{})})}),we(ue,{children:"Verify your identity"}),we(fe,{children:"Choose a verification method"}),ao(Ql,{children:[r.mfaMethods.includes("totp")&&ao(Te,{onClick:()=>_("totp"),children:[we(xE,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&ao(Te,{onClick:()=>_("sms"),children:[we(kE,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&ao(Te,{onClick:()=>_("passkey"),children:[we(RE,{}),"Passkey"]},"passkey")]}),we(J,{})]})},LE=({selectedMethod:e,submitSuccess:t,hasBlockingError:r,onClose:o,onBack:n,handleSubmitCode:i})=>{let{app:a}=R(),{pendingTransaction:l}=M();switch(e){case"sms":return ao(Cu,{children:[we(k,{onClose:o},"header"),we(Fe,{children:we($e,{children:we(ME,{})})}),we(ue,{children:"Enter verification code"}),ao(Nr,{children:[we(gi,{success:t,disabled:r,onChange:i}),ao(fe,{children:["To continue, please enter the 6-digit code sent to your ",we("strong",{children:"mobile device"})]}),l&&we(Ns,{pendingTransaction:l})]}),n&&we(ts,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),we(Jr,{onClick:o,children:"Not now"}),we(J,{})]});case"totp":return ao(Cu,{children:[we(k,{onClose:o},"header"),we(Fe,{children:we($e,{children:we(IE,{})})}),we(ue,{children:"Enter verification code"}),ao(Nr,{children:[we(gi,{success:t,disabled:r,onChange:i}),ao(fe,{children:["To continue, please enter the 6-digit code generated from your"," ",we("strong",{children:"authenticator app"})]}),l&&we(Ns,{pendingTransaction:l})]}),n&&we(ts,{theme:a?.appearance.palette.colorScheme,onClick:n,children:"Choose another method"}),we(Jr,{onClick:o,children:"Not now"}),we(J,{})]});default:return null}};import{useEffect as h3,useState as y3}from"react";import NE from"styled-components";import{Fragment as DE,jsx as Io,jsxs as bd}from"react/jsx-runtime";var g3=()=>{let{authenticated:e,logout:t,ready:r,user:o}=V(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=R(),{getAuthMeta:s,initLoginWithOAuth:d,loginWithOAuth:u,updateWallets:m,setReadyToTrue:f,closePrivyModal:y,createAnalyticsEvent:E}=M(),[C,w]=y3(!1),[P,_]=y3(void 0),T=s()?.provider||"google",{name:A,component:S}=za(T),I=Mi(),N=Ie;h3(()=>{u(T).then(K=>{w(!0),f(!0),K&&I("login","onOAuthLoginComplete",K)}).catch(K=>{if(f(!1),K?.privyErrorCode==="allowlist_rejected"){_(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(K?.privyErrorCode==="max_accounts_reached"){console.error(new uo(K).toString()),_(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}if(K?.privyErrorCode==="user_does_not_exist"){_(void 0),l(),a("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:W,detail:Q}=Hf(K,T);_({retryable:W,detail:Q,message:"Authentication failed"})}).finally(()=>{Xn()})},[A,T]),h3(()=>{if(r&&e&&C&&o){if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let W=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},N);return()=>clearTimeout(W)}if(vt(o,n?.embeddedWallets?.createOnLogin)){let W=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:Q=>{console.error(Q),E({eventName:"embedded_wallet_creation_failure_logout",payload:{error:Q,provider:T,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},N);return()=>clearTimeout(W)}else{let W=setTimeout(()=>y({shouldCallAuthOnSuccess:!0,isSuccess:!0}),N);return m(),()=>clearTimeout(W)}}},[r,e,C,o]);let H=C?`Successfully connected with ${A}`:P?P.message:`Verifying connection to ${A}`,x="";return C?x="You\u2019re good to go!":P?x=P.detail:x="Just a few moments more",bd(DE,{children:[Io(k,{}),Io(te,{}),bd(OE,{children:[Io(tt,{children:bd("div",{children:[Io(at,{success:C,fail:!!P}),Io(S,{style:{width:"38px",height:"38px"}})]})}),bd(Je,{children:[Io("h3",{children:H}),Io("p",{children:x})]}),P&&P?.retryable?Io(ln,{onClick:()=>{Xn(),d(T),_(void 0)},disabled:!C&&!P?.retryable,children:"Retry"}):null]}),Io(re,{}),Io(J,{})]})},OE=NE.div`
2475
2475
  display: flex;
2476
2476
  flex-direction: column;
2477
2477
  align-items: center;
@@ -2479,17 +2479,17 @@ You will need this password to access your ${e} wallet on a new device. Please k
2479
2479
  margin-left: 27px;
2480
2480
  margin-right: 27px;
2481
2481
  gap: 24px;
2482
- `;import{useEffect as yu,useRef as UE,useState as f3}from"react";import h3 from"styled-components";import{Fragment as BE,jsx as Xo,jsxs as Ed}from"react/jsx-runtime";var y3=()=>{let{lastScreen:e,currentScreen:t,navigateBack:r}=x(),{loginWithPasskey:o,closePrivyModal:n}=L(),i=We,[a,l]=f3("loading"),[s,d]=f3(null),u=UE([]),m=b=>{u.current=[b,...u.current]};yu(()=>()=>{u.current.forEach(b=>clearTimeout(b)),u.current=[]},[]);let f=()=>{switch(a){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}},g=()=>{switch(a){case"loading":return`Please follow prompts to verify your passkey.
2483
- 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 jt){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.
2482
+ `;import{useEffect as wu,useRef as UE,useState as C3}from"react";import v3 from"styled-components";import{Fragment as BE,jsx as Zo,jsxs as Ed}from"react/jsx-runtime";var w3=()=>{let{lastScreen:e,currentScreen:t,navigateBack:r}=R(),{loginWithPasskey:o,closePrivyModal:n}=M(),i=Ie,[a,l]=C3("loading"),[s,d]=C3(null),u=UE([]),m=w=>{u.current=[w,...u.current]};wu(()=>()=>{u.current.forEach(w=>clearTimeout(w)),u.current=[]},[]);let f=()=>{switch(a){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}},y=()=>{switch(a){case"loading":return`Please follow prompts to verify your passkey.
2483
+ 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 Zt){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.
2484
2484
  You will have to sign up with another method first to register a passkey for your account.`}return`An unknown error occurred.
2485
- 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 Xo(F,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return Xo(F,{onClick:C,disabled:!1,children:"Retry"})}},C=async()=>{l("loading");try{await o(),l("success")}catch(b){d(b),l("error")}};return yu(()=>{a==="success"&&m(setTimeout(()=>{n({shouldCallAuthOnSuccess:!0,isSuccess:!0})},i))},[a]),yu(()=>{C()},[]),Ed(BE,{children:[Xo(R,{backFn:!e||t===e?void 0:r}),Ed(FE,{children:[Xo(je,{children:Ed("div",{children:[Xo(it,{success:a==="success",fail:a==="error"}),Xo(li,{style:{width:"38px",height:"38px"}})]})}),Ed(Qe,{children:[Xo("h3",{children:f()}),Xo("p",{style:{whiteSpace:"pre-wrap"},children:g()})]}),v()]}),Xo(Z,{})]})},FE=h3.div`
2485
+ You will have to sign up with another method first to register a passkey for your account.`}},E=()=>{switch(a){case"loading":case"success":return Zo(F,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return Zo(F,{onClick:C,disabled:!1,children:"Retry"})}},C=async()=>{l("loading");try{await o(),l("success")}catch(w){d(w),l("error")}};return wu(()=>{a==="success"&&m(setTimeout(()=>{n({shouldCallAuthOnSuccess:!0,isSuccess:!0})},i))},[a]),wu(()=>{C()},[]),Ed(BE,{children:[Zo(k,{backFn:!e||t===e?void 0:r}),Ed(FE,{children:[Zo(tt,{children:Ed("div",{children:[Zo(at,{success:a==="success",fail:a==="error"}),Zo(ui,{style:{width:"38px",height:"38px"}})]})}),Ed(Je,{children:[Zo("h3",{children:f()}),Zo("p",{style:{whiteSpace:"pre-wrap"},children:y()})]}),E()]}),Zo(J,{})]})},FE=v3.div`
2486
2486
  display: flex;
2487
2487
  flex-direction: column;
2488
2488
  align-items: center;
2489
2489
  justify-content: center;
2490
2490
  gap: 24px;
2491
2491
  width: 100%;
2492
- `,Dee=h3.div`
2492
+ `,Oee=v3.div`
2493
2493
  display: flex;
2494
2494
  align-items: center;
2495
2495
  justify-content: center;
@@ -2505,9 +2505,9 @@ You will have to sign up with another method first to register a passkey for you
2505
2505
  stroke: var(--privy-color-accent) !important;
2506
2506
  fill: var(--privy-color-accent) !important;
2507
2507
  }
2508
- `;import{useEffect as VE,useState as C3}from"react";import GE from"styled-components";import{isMobile as HE}from"react-device-detect";var g3=(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(!en()&&HE)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};import{Fragment as zE,jsx as Zo,jsxs as v3}from"react/jsx-runtime";var w3=()=>{let{forkSession:e,ready:t,authenticated:r}=K(),[o,n]=C3(""),[i,a]=C3(!1);VE(()=>{t&&r&&e().then(n)},[t,r]);let l=g3(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."),v3(zE,{children:[Zo(R,{},"header"),Zo(oe,{}),Zo(Ao,{title:s.title,description:s.description}),v3(lr,{children:[Zo(qE,{children:Zo(bo,{style:{width:"72px",height:"72px"}})}),Zo(zl,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?Zo("p",{children:s.footnote}):null]}),Zo(ne,{}),Zo(G,{})]})},qE=GE(St)`
2508
+ `;import{useEffect as VE,useState as E3}from"react";import GE from"styled-components";import{isMobile as HE}from"react-device-detect";var b3=(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(!tn()&&HE)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${o}?ref=${o}`};import{Fragment as zE,jsx as Jo,jsxs as T3}from"react/jsx-runtime";var S3=()=>{let{forkSession:e,ready:t,authenticated:r}=V(),[o,n]=E3(""),[i,a]=E3(!1);VE(()=>{t&&r&&e().then(n)},[t,r]);let l=b3(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."),T3(zE,{children:[Jo(k,{},"header"),Jo(te,{}),Jo(To,{title:s.title,description:s.description}),T3(ir,{children:[Jo(qE,{children:Jo(vo,{style:{width:"72px",height:"72px"}})}),Jo(ql,{href:l,onClick:()=>{setTimeout(()=>a(!0),1e3)},loading:t&&!l,children:i?"Go to App Store":"Continue"}),s.footnote?Jo("p",{children:s.footnote}):null]}),Jo(re,{}),Jo(B,{})]})},qE=GE(Et)`
2509
2509
  margin: 16px auto;
2510
- `;import KE from"@heroicons/react/24/outline/ShieldCheckIcon";import{useEffect as YE,useState as Td}from"react";import Sd,{css as QE}from"styled-components";import{Fragment as $E,jsx as Yt,jsxs as yi}from"react/jsx-runtime";var b3=()=>{let[e,t]=Td(!0),{authenticated:r,getAccessToken:o}=K(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=L(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:d}=x(),[u,m]=Td(void 0),[f,g]=Td(""),[v,C]=Td(!1),{privyWallet:b,onCompleteNavigateTo:A,onSuccess:_,onFailure:S}=s.recoverWallet,P=(D="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),S(typeof D=="string"?new fr(D):D)};d.current=P,YE(()=>{if(!r||!b)return P("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let E=D=>{D&&m(D)};return yi($E,{children:[Yt(R,{onClose:P}),Yt(oe,{}),yi(ZE,{children:[yi(XE,{children:[Yt(KE,{height:48,width:48,stroke:"var(--privy-color-accent)"}),Yt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),Yt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),yi("div",{children:[yi(hn,{children:[Yt(la,{type:e?"password":"text",onChange:D=>E(D.target.value),disabled:v,style:{paddingRight:"2.3rem"}}),Yt(ca,{style:{right:"0.75rem"},children:e?Yt(da,{onClick:()=>t(!1)}):Yt(pa,{onClick:()=>t(!0)})})]}),!!f&&Yt(JE,{children:f})]}),yi("div",{children:[yi(Th,{children:[Yt("h4",{children:"Why is this necessary?"}),Yt("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),Yt(jE,{loading:v||!n,disabled:!u,onClick:async()=>{C(!0);let D=await o();if(D&&b&&u!==null)try{a({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:b.address}}),await n?.recover({address:b.address,accessToken:D,recoveryPin:u,recoveryMethod:b.recoveryMethod}),g(""),A?l(A):i({shouldCallAuthOnSuccess:!1}),_?.(b),a({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:b.address}})}catch(H){ly(H)?g("Invalid recovery password, please try again."):g("An error has occurred, please try again.")}finally{C(!1)}else return P("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!b&&v,children:"Recover your account"})]})]}),Yt(ne,{}),Yt(G,{})]})},XE=Sd.div`
2510
+ `;import KE from"@heroicons/react/24/outline/ShieldCheckIcon";import{useEffect as YE,useState as Td}from"react";import Sd,{css as QE}from"styled-components";import{Fragment as $E,jsx as zt,jsxs as wi}from"react/jsx-runtime";var P3=()=>{let[e,t]=Td(!0),{authenticated:r,getAccessToken:o}=V(),{walletProxy:n,closePrivyModal:i,createAnalyticsEvent:a}=M(),{navigate:l,data:s,onUserCloseViaDialogOrKeybindRef:d}=R(),[u,m]=Td(void 0),[f,y]=Td(""),[E,C]=Td(!1),{privyWallet:w,onCompleteNavigateTo:P,onSuccess:_,onFailure:T}=s.recoverWallet,A=(N="User exited before their wallet could be recovered")=>{i({shouldCallAuthOnSuccess:!1}),T(typeof N=="string"?new dr(N):N)};d.current=A,YE(()=>{if(!r||!w)return A("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let S=N=>{N&&m(N)};return wi($E,{children:[zt(k,{onClose:A}),zt(te,{}),wi(ZE,{children:[wi(XE,{children:[zt(KE,{height:48,width:48,stroke:"var(--privy-color-accent)"}),zt("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),zt("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),wi("div",{children:[wi(yn,{children:[zt(pa,{type:e?"password":"text",onChange:N=>S(N.target.value),disabled:E,style:{paddingRight:"2.3rem"}}),zt(ua,{style:{right:"0.75rem"},children:e?zt(ma,{onClick:()=>t(!1)}):zt(fa,{onClick:()=>t(!0)})})]}),!!f&&zt(JE,{children:f})]}),wi("div",{children:[wi(Ah,{children:[zt("h4",{children:"Why is this necessary?"}),zt("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),zt(jE,{loading:E||!n,disabled:!u,onClick:async()=>{C(!0);let N=await o();if(N&&w&&u!==null)try{a({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:w.address}}),await n?.recover({address:w.address,accessToken:N,recoveryPin:u,recoveryMethod:w.recoveryMethod}),y(""),P?l(P):i({shouldCallAuthOnSuccess:!1}),_?.(w),a({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:w.address}})}catch(H){uy(H)?y("Invalid recovery password, please try again."):y("An error has occurred, please try again.")}finally{C(!1)}else return A("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!w&&E,children:"Recover your account"})]})]}),zt(re,{}),zt(B,{})]})},XE=Sd.div`
2511
2511
  display: flex;
2512
2512
  flex-direction: column;
2513
2513
  align-items: center;
@@ -2548,21 +2548,21 @@ You will have to sign up with another method first to register a passkey for you
2548
2548
  transition: none;
2549
2549
  }
2550
2550
  `}
2551
- `;import{useCallback as eT,useEffect as P3,useState as gu}from"react";import{jsx as Ad,jsxs as E3}from"react/jsx-runtime";var Pd=e=>E3("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...e,children:[Ad("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"}),Ad("defs",{children:E3("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[Ad("stop",{stopColor:"#3E82F4"}),Ad("stop",{offset:1,stopColor:"#93DCF7"})]})})]});import{jsx as Jo,jsxs as T3}from"react/jsx-runtime";var xd=({style:e,...t})=>T3("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[T3("g",{clipPath:"url(#clip0_2115_829)",children:[Jo("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"}),Jo("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"}),Jo("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"}),Jo("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"}),Jo("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"}),Jo("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"})]}),Jo("defs",{children:Jo("clipPath",{id:"clip0_2115_829",children:Jo("rect",{width:"16",height:"14",fill:"white"})})})]});import S3 from"styled-components";var Ds=S3.div`
2551
+ `;import{useCallback as eT,useEffect as _3,useState as bu}from"react";import{jsx as Pd,jsxs as A3}from"react/jsx-runtime";var Ad=e=>A3("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...e,children:[Pd("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"}),Pd("defs",{children:A3("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[Pd("stop",{stopColor:"#3E82F4"}),Pd("stop",{offset:1,stopColor:"#93DCF7"})]})})]});import{jsx as jo,jsxs as x3}from"react/jsx-runtime";var xd=({style:e,...t})=>x3("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[x3("g",{clipPath:"url(#clip0_2115_829)",children:[jo("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"}),jo("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"}),jo("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"}),jo("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"}),jo("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"}),jo("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"})]}),jo("defs",{children:jo("clipPath",{id:"clip0_2115_829",children:jo("rect",{width:"16",height:"14",fill:"white"})})})]});import R3 from"styled-components";var Ds=R3.div`
2552
2552
  display: flex;
2553
2553
  flex-direction: column;
2554
2554
  gap: 12px;
2555
2555
  padding-top: 24px;
2556
2556
  padding-bottom: 24px;
2557
- `,A3=S3.div`
2557
+ `,k3=R3.div`
2558
2558
  padding-bottom: 24px;
2559
- `;import{Fragment as R3,jsx as Mn,jsxs as Rd}from"react/jsx-runtime";var x3={"google-drive":{name:"Google Drive",component:xd},icloud:{name:"iCloud",component:Pd}},k3=()=>{let{logout:e}=K(),{navigate:t,setModalData:r,data:o}=x(),{recoveryOAuthFlow:n,closePrivyModal:i,createAnalyticsEvent:a}=L(),[l,s]=gu(!1),{provider:d,action:u,isInAccountCreateFlow:m}=o?.recoveryOAuthStatus,[f,g]=gu(void 0),[v,C]=gu(u==="create-wallet");if(d==="user-passcode")throw new Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let b=x3[d].name,A=x3[d].component,_=o?.recoverWallet?.onCompleteNavigateTo,S=new Ye(async(X="create-wallet")=>(C(!0),new Promise((W,Y)=>{setTimeout(async()=>{try{let Ce=window.open();await n(d,X,Ce),s(!0),W()}catch{g({message:`${X==="recover"?"Recovery":"Back up"} with ${b} unsuccessful`,detail:u==="recover"?`Please verify that you are selecting the ${b} account associated with your backup.`:"",retryable:!0}),Y()}},0)})));P3(()=>{u!=="recover"&&S.execute(m?"create-wallet":"set-recovery")},[]),P3(()=>{if(!l)return;let X=setTimeout(()=>{m?(r({createWallet:{onSuccess:()=>{},onFailure:W=>{a({eventName:"embedded_wallet_creation_failure_logout",payload:{error:W,screen:"RecoveryOAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_CREATED_SCREEN")):i({shouldCallAuthOnSuccess:!1})},We);return()=>clearTimeout(X)},[l]);let P=eT(async()=>{await S.execute("recover"),_?t(_):s(!0)},[]),E=d==="google-drive"?"Google Drive":"Apple iCloud",k=u==="recover"?"recovered":"backed up",D=u==="recover"?"Recovering":"Backing up",H=l&&`Successfully ${k} with ${E}.`||f&&f.message||`${D} with ${E}...`,M=f?f.detail:"";return Rd(R3,{children:[Mn(R,{}),v?Mn(R3,{children:Rd(Ds,{children:[Mn(ve,{title:H,icon:Mn(A,{style:{width:"38px",height:"38px"}}),description:M}),f&&f?.retryable?Mn(F,{onClick:()=>{zn(),g(void 0),u==="create-wallet"?S.execute("create-wallet"):P()},disabled:!l&&!f?.retryable,children:"Try again"}):null]})}):Rd(Ds,{children:[Mn(ve,{title:"Confirm it's really you",icon:Mn(A,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${E} where your account is backed up.`}),Rd(F,{onClick:P,children:["Confirm with ",E]})]}),Mn(G,{})]})};import{useEffect as _3,useState as Us}from"react";import{jsx as tT}from"react/jsx-runtime";var M3=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=x(),[n,i]=Us(""),[a,l]=Us(!1),[s,d]=Us(),[u,m]=Us(null),{authenticated:f}=K(),{closePrivyModal:g,isNewUserThisSession:v,initializeWalletProxy:C}=L(),{onSuccess:b,onFailure:A,callAuthOnSuccessOnClose:_}=r.createWallet,{createWallet:S}=Cc(),[P,E]=Us(null),k=new Ye(async()=>{try{let M=await S(s);if(!M)return;E(M),v?t("EMBEDDED_WALLET_CREATED_SCREEN"):(b(M),g({shouldCallAuthOnSuccess:_}))}catch(M){i(M.message)}});_3(()=>{u||C(3e4).then(M=>m(M))},[u]),_3(()=>{if(!f){t("LANDING"),A(new Error("User must be authenticated before creating a Privy wallet"));return}},[f]);let D=()=>{P&&P?.recoveryMethod!=="user-passcode"?(A(new fr("User created a wallet but failed to set a password for it")),g({shouldCallAuthOnSuccess:!1})):P?(b(P),g({shouldCallAuthOnSuccess:_})):(A(new fr("User wallet creation failed")),g({shouldCallAuthOnSuccess:!1}))};o.current=()=>null;let H=async()=>{l(!0);let M=250;return k.execute().then(()=>new Promise(X=>setTimeout(X,M))).finally(()=>l(!1))};return tT(Ec,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!u,buttonLoading:a,buttonHideAnimations:!P&&a,isResettingPassword:!1,error:n,password:s||"",onClose:D,onPasswordChange:d,onPasswordGenerate:()=>d(bc()),onSubmit:H})};import rT from"@heroicons/react/24/outline/LockClosedIcon";import oT from"@heroicons/react/24/outline/PencilSquareIcon";import nT from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import{useState as iT}from"react";import aT from"styled-components";import{Fragment as vu,jsx as Ct,jsxs as In}from"react/jsx-runtime";var Cu=aT.div`
2559
+ `;import{Fragment as M3,jsx as Mn,jsxs as Rd}from"react/jsx-runtime";var I3={"google-drive":{name:"Google Drive",component:xd},icloud:{name:"iCloud",component:Ad}},W3=()=>{let{logout:e}=V(),{navigate:t,setModalData:r,data:o}=R(),{recoveryOAuthFlow:n,closePrivyModal:i,createAnalyticsEvent:a}=M(),[l,s]=bu(!1),{provider:d,action:u,isInAccountCreateFlow:m}=o?.recoveryOAuthStatus,[f,y]=bu(void 0),[E,C]=bu(u==="create-wallet");if(d==="user-passcode")throw new Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let w=I3[d].name,P=I3[d].component,_=o?.recoverWallet?.onCompleteNavigateTo,T=new Ze(async(K="create-wallet")=>(C(!0),new Promise((W,Q)=>{setTimeout(async()=>{try{let de=window.open();await n(d,K,de),s(!0),W()}catch{y({message:`${K==="recover"?"Recovery":"Back up"} with ${w} unsuccessful`,detail:u==="recover"?`Please verify that you are selecting the ${w} account associated with your backup.`:"",retryable:!0}),Q()}},0)})));_3(()=>{u!=="recover"&&T.execute(m?"create-wallet":"set-recovery")},[]),_3(()=>{if(!l)return;let K=setTimeout(()=>{m?(r({createWallet:{onSuccess:()=>{},onFailure:W=>{a({eventName:"embedded_wallet_creation_failure_logout",payload:{error:W,screen:"RecoveryOAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_CREATED_SCREEN")):i({shouldCallAuthOnSuccess:!1})},Ie);return()=>clearTimeout(K)},[l]);let A=eT(async()=>{await T.execute("recover"),_?t(_):s(!0)},[]),S=d==="google-drive"?"Google Drive":"Apple iCloud",I=u==="recover"?"recovered":"backed up",N=u==="recover"?"Recovering":"Backing up",H=l&&`Successfully ${I} with ${S}.`||f&&f.message||`${N} with ${S}...`,x=f?f.detail:"";return Rd(M3,{children:[Mn(k,{}),E?Mn(M3,{children:Rd(Ds,{children:[Mn(ge,{title:H,icon:Mn(P,{style:{width:"38px",height:"38px"}}),description:x}),f&&f?.retryable?Mn(F,{onClick:()=>{Xn(),y(void 0),u==="create-wallet"?T.execute("create-wallet"):A()},disabled:!l&&!f?.retryable,children:"Try again"}):null]})}):Rd(Ds,{children:[Mn(ge,{title:"Confirm it's really you",icon:Mn(P,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${S} where your account is backed up.`}),Rd(F,{onClick:A,children:["Confirm with ",S]})]}),Mn(B,{})]})};import{useEffect as L3,useState as Us}from"react";import{jsx as tT}from"react/jsx-runtime";var N3=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=R(),[n,i]=Us(""),[a,l]=Us(!1),[s,d]=Us(),[u,m]=Us(null),{authenticated:f}=V(),{closePrivyModal:y,isNewUserThisSession:E,initializeWalletProxy:C}=M(),{onSuccess:w,onFailure:P,callAuthOnSuccessOnClose:_}=r.createWallet,{createWallet:T}=gc(),[A,S]=Us(null),I=new Ze(async()=>{try{let x=await T(s);if(!x)return;S(x),E?t("EMBEDDED_WALLET_CREATED_SCREEN"):(w(x),y({shouldCallAuthOnSuccess:_}))}catch(x){i(x.message)}});L3(()=>{u||C(3e4).then(x=>m(x))},[u]),L3(()=>{if(!f){t("LANDING"),P(new Error("User must be authenticated before creating a Privy wallet"));return}},[f]);let N=()=>{A&&A?.recoveryMethod!=="user-passcode"?(P(new dr("User created a wallet but failed to set a password for it")),y({shouldCallAuthOnSuccess:!1})):A?(w(A),y({shouldCallAuthOnSuccess:_})):(P(new dr("User wallet creation failed")),y({shouldCallAuthOnSuccess:!1}))};o.current=()=>null;let H=async()=>{l(!0);let x=250;return I.execute().then(()=>new Promise(K=>setTimeout(K,x))).finally(()=>l(!1))};return tT(bc,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!u,buttonLoading:a,buttonHideAnimations:!A&&a,isResettingPassword:!1,error:n,password:s||"",onClose:N,onPasswordChange:d,onPasswordGenerate:()=>d(wc()),onSubmit:H})};import rT from"@heroicons/react/24/outline/LockClosedIcon";import oT from"@heroicons/react/24/outline/PencilSquareIcon";import nT from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import{useState as iT}from"react";import aT from"styled-components";import{Fragment as Tu,jsx as Ct,jsxs as Wn}from"react/jsx-runtime";var Eu=aT.div`
2560
2560
  width: 24px;
2561
2561
  height: 24px;
2562
2562
  display: flex;
2563
2563
  justify-content: center;
2564
2564
  align-items: center;
2565
- `,sT={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},lT=({onClose:e})=>In(A3,{children:[Ct(ve,{title:"Why do I need to secure my account?",icon:Ct(nT,{width:48}),description:In(vu,{children:[Ct("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),Ct("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."})]})}),Ct(F,{onClick:e,children:"Select backup method"})]}),I3=()=>{let[e,t]=iT(!1),{navigate:r,lastScreen:o,navigateBack:n,setModalData:i,data:a,onUserCloseViaDialogOrKeybindRef:l}=x(),{user:s}=K(),{embeddedWallets:d}=Le(),{closePrivyModal:u}=L(),m=Me(s),f=m===null,{isInAccountCreateFlow:g,isResettingPassword:v}=a.recoverySelection,C=m&&m.recoveryMethod!=="privy",b=C?"Update backup method":"Secure your account",A=C?In("span",{children:["Your account is currently secured using"," ",Ct("strong",{children:sT[m?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function _(P){i({recoveryOAuthStatus:{provider:P,action:f?"create-wallet":"set-recovery",isInAccountCreateFlow:g}}),r("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")}function S(){a?.setWalletPassword?.onFailure(new Error("User exited set recovery flow")),u({shouldCallAuthOnSuccess:a?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return l.current=S,In(vu,{children:[Ct(R,{onClose:S,backFn:e?()=>t(!1):o?n:void 0,infoFn:o||e?void 0:()=>t(!0)},"header"),e?Ct(lT,{onClose:()=>t(!1)}):In(vu,{children:[Ct(ve,{title:b,icon:Ct(rT,{width:48}),description:A}),Ct(Ds,{children:d.userOwnedRecoveryOptions.filter(P=>["icloud","google-drive"].includes(m?.recoveryMethod||"")?P!==m?.recoveryMethod:!0).sort().map(P=>{switch(P){case"google-drive":return In(Pe,{onClick:()=>_("google-drive"),children:[Ct(Cu,{children:Ct(xd,{style:{width:18}})}),"Back up to Google Drive"]},P);case"icloud":return In(Pe,{onClick:()=>_("icloud"),children:[Ct(Cu,{children:Ct(Pd,{style:{width:24}})}),"Back up to Apple iCloud"]},P);case"user-passcode":return In(Pe,{onClick:()=>{let E=Sp({isCreatingWallet:f,skipSplashScreen:!0});r(E)},children:[Ct(Cu,{children:Ct(oT,{style:{width:18}})}),v?"Reset your":"Set a"," password"]},P);default:return null}})})]}),Ct(G,{})]})};import dT from"@heroicons/react/24/outline/ExclamationTriangleIcon";import pT from"@heroicons/react/24/outline/LockClosedIcon";import{useState as wu}from"react";import cT from"styled-components";var W3=cT.div`
2565
+ `,sT={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},lT=({onClose:e})=>Wn(k3,{children:[Ct(ge,{title:"Why do I need to secure my account?",icon:Ct(nT,{width:48}),description:Wn(Tu,{children:[Ct("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),Ct("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."})]})}),Ct(F,{onClick:e,children:"Select backup method"})]}),O3=()=>{let[e,t]=iT(!1),{navigate:r,lastScreen:o,navigateBack:n,setModalData:i,data:a,onUserCloseViaDialogOrKeybindRef:l}=R(),{user:s}=V(),{embeddedWallets:d}=Me(),{closePrivyModal:u}=M(),m=Ue(s),f=m===null,{isInAccountCreateFlow:y,isResettingPassword:E}=a.recoverySelection,C=m&&m.recoveryMethod!=="privy",w=C?"Update backup method":"Secure your account",P=C?Wn("span",{children:["Your account is currently secured using"," ",Ct("strong",{children:sT[m?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function _(A){i({recoveryOAuthStatus:{provider:A,action:f?"create-wallet":"set-recovery",isInAccountCreateFlow:y}}),r("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")}function T(){a?.setWalletPassword?.onFailure(new Error("User exited set recovery flow")),u({shouldCallAuthOnSuccess:a?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return l.current=T,Wn(Tu,{children:[Ct(k,{onClose:T,backFn:e?()=>t(!1):o?n:void 0,infoFn:o||e?void 0:()=>t(!0)},"header"),e?Ct(lT,{onClose:()=>t(!1)}):Wn(Tu,{children:[Ct(ge,{title:w,icon:Ct(rT,{width:48}),description:P}),Ct(Ds,{children:d.userOwnedRecoveryOptions.filter(A=>["icloud","google-drive"].includes(m?.recoveryMethod||"")?A!==m?.recoveryMethod:!0).sort().map(A=>{switch(A){case"google-drive":return Wn(Te,{onClick:()=>_("google-drive"),children:[Ct(Eu,{children:Ct(xd,{style:{width:18}})}),"Back up to Google Drive"]},A);case"icloud":return Wn(Te,{onClick:()=>_("icloud"),children:[Ct(Eu,{children:Ct(Ad,{style:{width:24}})}),"Back up to Apple iCloud"]},A);case"user-passcode":return Wn(Te,{onClick:()=>{let S=Rp({isCreatingWallet:f,skipSplashScreen:!0});r(S)},children:[Ct(Eu,{children:Ct(oT,{style:{width:18}})}),E?"Reset your":"Set a"," password"]},A);default:return null}})})]}),Ct(B,{})]})};import dT from"@heroicons/react/24/outline/ExclamationTriangleIcon";import pT from"@heroicons/react/24/outline/LockClosedIcon";import{useState as Su}from"react";import cT from"styled-components";var D3=cT.div`
2566
2566
  && {
2567
2567
  border-width: 4px;
2568
2568
  }
@@ -2575,9 +2575,9 @@ You will have to sign up with another method first to register a passkey for you
2575
2575
  border-style: solid;
2576
2576
  border-color: ${e=>e.$color??"var(--privy-color-accent)"};
2577
2577
  border-radius: 50%;
2578
- `;import{Fragment as L3,jsx as ur,jsxs as N3}from"react/jsx-runtime";var O3=()=>{let{user:e,getAccessToken:t}=K(),r=Me(e),{walletProxy:o,refreshUser:n,closePrivyModal:i}=L(),a=x(),[l,s]=wu(!1),[d,u]=wu(null),[m,f]=wu(null);function g(){if(!l){if(m){a.data?.setWalletPassword?.onFailure(m),i();return}if(!d){a.data?.setWalletPassword?.onFailure(new Error("User exited set recovery flow")),i();return}}}a.onUserCloseViaDialogOrKeybindRef.current=g;async function v(){s(!0);try{let b=await t();if(!b||!o||!r)return;if(!(await o.setRecovery({recoveryMethod:"privy",address:r.address,accessToken:b})).address)throw new Error("Unable to set recovery on wallet");let _=await n();if(!_)throw new Error("Unable to set recovery on wallet");let S=Me(_);if(!S)throw new Error("Unabled to set recovery on wallet");u(!!_),setTimeout(()=>{a.data?.setWalletPassword?.onSuccess(S),i()},We)}catch(b){f(b)}finally{s(!1)}}let C=!!(l||d);return m?N3(L3,{children:[ur(R,{onClose:g},"header"),ur(W3,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:ur(dT,{height:38,width:38,stroke:"var(--privy-color-error)"})}),ur(no,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),ur(gr,{style:{minHeight:"2rem"}}),ur(Go,{onClick:()=>f(null),children:"Try again"}),ur(G,{})]}):N3(L3,{children:[ur(R,{onClose:g},"header"),ur(pT,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),ur(no,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),ur(Hr,{style:{marginTop:"1rem"},children:"When you log into a new device, you\u2019ll only need to authenticate to access your account. Never get logged out if you forget your password."}),ur(gr,{style:{minHeight:"2rem"}}),ur(Go,{loading:l,disabled:C,onClick:()=>v(),children:d?"Success":"Confirm"}),ur(G,{})]})};import{useEffect as eS,useMemo as Tu,useState as Fs}from"react";import{ProviderErrors as j3,QuantityToBigNumber as Z3}from"@privy-io/js-sdk-core";import{EtherscanProvider as Dre}from"@ethersproject/providers";import{QuantityToBigNumber as uT}from"@privy-io/js-sdk-core";async function kd({accessToken:e,rootWallet:t,transactingWallet:r,walletProxy:o,transactionRequest:n,provider:i,requesterAppId:a}){n=Object.assign({chainId:Fo},n),mT(n);let s=(await o.rpc({address:t.address,hdWalletIndex:r.walletIndex??void 0,accessToken:e,requesterAppId:a,request:{method:"eth_signTransaction",params:[n]}})).response.data;return await i.sendTransaction(s)}async function _d(e,t,r,o){let n=await o.getBalance(e),i=t.value||0,l=!n.sub(uT(i)).sub(r).isNegative();return{balance:n,hasSufficientFunds:l}}function mT(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!fT(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 fT(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&hT(e);return t||r||o}function hT(e){return/^-?0x[a-f0-9]+$/i.test(e)}function Md(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 bu=["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"],D3={["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"},yT={moonpay:"MOONPAY_PROMPT_SCREEN","coinbase-onramp":"COINBASE_ONRAMP_STATUS_SCREEN",external:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};function Id({fundingMethods:e}){if(e.length===0)throw new Error("Wallet funding is not enabled");return e.length===1?yT[e[0]]:"FUNDING_METHOD_SELECTION_SCREEN"}import U3 from"styled-components";import{Fragment as bT,jsx as ze,jsxs as Lo}from"react/jsx-runtime";var F3=({img:e,submitError:t,prepareError:r,onClose:o,action:n,amount:i,title:a,subtitle:l,total:s,to:d,network:u,hasFunds:m,fee:f,from:g,cta:v,chain:C,isSubmitting:b,isPreparing:A,isTokenPriceLoading:_,isTokenContractInfoLoading:S,symbol:P,balance:E,onClick:k,spender:D})=>Lo(bT,{children:[ze(R,{onClose:o}),e&&ze(wT,{children:e}),ze(no,{style:{marginTop:e?"1.5rem":0},children:a}),ze(Hr,{children:l}),Lo(Wc,{style:{marginTop:"2rem"},children:[s&&Lo(Wt,{children:[ze(Lt,{children:"Total"}),ze(Vt,{$isLoading:A||_,children:s})]}),n&&n!=="transaction"&&Lo(Wt,{children:[ze(Lt,{children:"Action"}),ze(Vt,{children:n})]}),i?Lo(Wt,{children:[ze(Lt,{children:"Amount"}),Lo(Vt,{$isLoading:S,children:[vT(i)," ",P]})]}):null,D?Lo(Wt,{children:[ze(Lt,{children:"Spender"}),ze(Vt,{children:ze(Fa,{address:D,url:C?.blockExplorers?.default?.url,showCopyIcon:!1})})]}):null,d&&Lo(Wt,{children:[ze(Lt,{children:"To"}),ze(Vt,{children:ze(Fa,{address:d,url:C?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),Lo(Wt,{children:[ze(Lt,{children:"Network"}),ze(Vt,{children:u})]}),Lo(Wt,{children:[ze(Lt,{children:"Estimated fee"}),ze(Vt,{$isLoading:A||_,children:f})]})]}),ze(gr,{}),t?ze(Ua,{style:{marginTop:"2rem"},children:t.message}):r?ze(Ua,{style:{marginTop:"2rem"},children:CT}):null,ze(gT,{$useSmallMargins:!!(r||t),address:g,balance:E,isLoading:A||_,errMsg:!A&&!r&&!t&&!m?`Add funds on ${C?.name} to complete transaction.`:void 0}),ze(Go,{style:{marginTop:"1rem"},loading:b,disabled:A,onClick:k,children:v}),ze(G,{})]}),gT=U3(_i)`
2578
+ `;import{Fragment as U3,jsx as cr,jsxs as F3}from"react/jsx-runtime";var B3=()=>{let{user:e,getAccessToken:t}=V(),r=Ue(e),{walletProxy:o,refreshUser:n,closePrivyModal:i}=M(),a=R(),[l,s]=Su(!1),[d,u]=Su(null),[m,f]=Su(null);function y(){if(!l){if(m){a.data?.setWalletPassword?.onFailure(m),i();return}if(!d){a.data?.setWalletPassword?.onFailure(new Error("User exited set recovery flow")),i();return}}}a.onUserCloseViaDialogOrKeybindRef.current=y;async function E(){s(!0);try{let w=await t();if(!w||!o||!r)return;if(!(await o.setRecovery({recoveryMethod:"privy",address:r.address,accessToken:w})).address)throw new Error("Unable to set recovery on wallet");let _=await n();if(!_)throw new Error("Unable to set recovery on wallet");let T=Ue(_);if(!T)throw new Error("Unabled to set recovery on wallet");u(!!_),setTimeout(()=>{a.data?.setWalletPassword?.onSuccess(T),i()},Ie)}catch(w){f(w)}finally{s(!1)}}let C=!!(l||d);return m?F3(U3,{children:[cr(k,{onClose:y},"header"),cr(D3,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:cr(dT,{height:38,width:38,stroke:"var(--privy-color-error)"})}),cr(ro,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),cr(mr,{style:{minHeight:"2rem"}}),cr(Go,{onClick:()=>f(null),children:"Try again"}),cr(B,{})]}):F3(U3,{children:[cr(k,{onClose:y},"header"),cr(pT,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),cr(ro,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),cr(Dr,{style:{marginTop:"1rem"},children:"When you log into a new device, you\u2019ll only need to authenticate to access your account. Never get logged out if you forget your password."}),cr(mr,{style:{minHeight:"2rem"}}),cr(Go,{loading:l,disabled:C,onClick:()=>E(),children:d?"Success":"Confirm"}),cr(B,{})]})};import{useEffect as eS,useMemo as ku,useState as Fs}from"react";import{ProviderErrors as o0,QuantityToBigNumber as t0}from"@privy-io/js-sdk-core";import{EtherscanProvider as Ore}from"@ethersproject/providers";import{QuantityToBigNumber as uT}from"@privy-io/js-sdk-core";async function kd({accessToken:e,rootWallet:t,transactingWallet:r,walletProxy:o,transactionRequest:n,provider:i,requesterAppId:a}){n=Object.assign({chainId:Uo},n),mT(n);let s=(await o.rpc({address:t.address,hdWalletIndex:r.walletIndex??void 0,accessToken:e,requesterAppId:a,request:{method:"eth_signTransaction",params:[n]}})).response.data;return await i.sendTransaction(s)}async function _d(e,t,r,o){let n=await o.getBalance(e),i=t.value||0,l=!n.sub(uT(i)).sub(r).isNegative();return{balance:n,hasSufficientFunds:l}}function mT(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!fT(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 fT(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&hT(e);return t||r||o}function hT(e){return/^-?0x[a-f0-9]+$/i.test(e)}function Id(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}}function Md(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 Pu={[_r.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[vm.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[mo.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[gm.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[Ir.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[Cm.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[kr.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[hm.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[il.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[fm.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[Qr.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[mm.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"},H3=(e,t)=>e===Pu[t.id];var Au=({address:e,appConfig:t,fundWalletConfig:r,methodScreen:o,chainIdOverride:n,comingFromSendTransactionScreen:i=!1})=>{if(!t.fundingConfig||t.fundingConfig.methods.length===0)return;let a;n?a=n:zc(r)&&r.chain?a=r.chain.id:a=Md(t.fundingConfig.defaultRecommendedCurrency.chain);let l=t.chains.find(f=>f.id===a);if(!l)throw new v(`Funding chain ${a} is not in PrivyProvider chains list`);let s=zc(r)&&r.amount?r.amount:t.fundingConfig.defaultRecommendedAmount,d,u=!1;function m(){if(!a)return;let f=Pu[a];t.fundingConfig?.methods.includes("external")&&!f&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),d=f,u=!0}return zc(r)&&"asset"in r?r.asset==="USDC"?m():typeof r.asset!="string"&&"erc20"in r.asset&&(d=r.asset.erc20,u=H3(d,l)):t.fundingConfig.defaultRecommendedCurrency.asset==="USDC"&&m(),{address:e,amount:s,chain:l,erc20Address:d,erc20ContractInfo:u?{symbol:"USDC",decimals:6}:void 0,isUSDC:u,methodScreen:o,comingFromSendTransactionScreen:i,...P1(r)?{moonpayConfigOverride:r.config}:{}}};var xu=["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"],V3={["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"},yT={moonpay:"MOONPAY_PROMPT_SCREEN","coinbase-onramp":"COINBASE_ONRAMP_STATUS_SCREEN",external:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};function Wd({fundingMethods:e}){if(e.length===0)throw new Error("Wallet funding is not enabled");return e.length===1?yT[e[0]]:"FUNDING_METHOD_SELECTION_SCREEN"}import G3 from"styled-components";import{Fragment as bT,jsx as Qe,jsxs as Mo}from"react/jsx-runtime";var q3=({img:e,submitError:t,prepareError:r,onClose:o,action:n,amount:i,title:a,subtitle:l,total:s,to:d,network:u,hasFunds:m,fee:f,from:y,cta:E,chain:C,isSubmitting:w,isPreparing:P,isTokenPriceLoading:_,isTokenContractInfoLoading:T,symbol:A,balance:S,onClick:I,spender:N})=>Mo(bT,{children:[Qe(k,{onClose:o}),e&&Qe(wT,{children:e}),Qe(ro,{style:{marginTop:e?"1.5rem":0},children:a}),Qe(Dr,{children:l}),Mo(Mc,{style:{marginTop:"2rem"},children:[s&&Mo(It,{children:[Qe(Mt,{children:"Total"}),Qe(Bt,{$isLoading:P||_,children:s})]}),n&&n!=="transaction"&&Mo(It,{children:[Qe(Mt,{children:"Action"}),Qe(Bt,{children:n})]}),i?Mo(It,{children:[Qe(Mt,{children:"Amount"}),Mo(Bt,{$isLoading:T,children:[vT(i)," ",A]})]}):null,N?Mo(It,{children:[Qe(Mt,{children:"Spender"}),Qe(Bt,{children:Qe(Fo,{address:N,url:C?.blockExplorers?.default?.url,showCopyIcon:!1})})]}):null,d&&Mo(It,{children:[Qe(Mt,{children:"To"}),Qe(Bt,{children:Qe(Fo,{address:d,url:C?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),Mo(It,{children:[Qe(Mt,{children:"Network"}),Qe(Bt,{children:u})]}),Mo(It,{children:[Qe(Mt,{children:"Estimated fee"}),Qe(Bt,{$isLoading:P||_,children:f})]})]}),Qe(mr,{}),t?Qe(Ba,{style:{marginTop:"2rem"},children:t.message}):r?Qe(Ba,{style:{marginTop:"2rem"},children:CT}):null,Qe(gT,{$useSmallMargins:!!(r||t),address:y,balance:S,isLoading:P||_,errMsg:!P&&!r&&!t&&!m?`Add funds on ${C?.name} to complete transaction.`:void 0}),Qe(Go,{style:{marginTop:"1rem"},loading:w,disabled:P,onClick:I,children:E}),Qe(B,{})]}),gT=G3(Li)`
2579
2579
  ${e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;"}
2580
- `,CT="There was an error preparing your transaction. Your transaction request will likely fail.",vT=e=>e.toLocaleString(),wT=U3.div`
2580
+ `,CT="There was an error preparing your transaction. Your transaction request will likely fail.",vT=e=>e.toLocaleString(),wT=G3.div`
2581
2581
  display: flex;
2582
2582
  width: 100%;
2583
2583
  justify-content: center;
@@ -2587,12 +2587,12 @@ You will have to sign up with another method first to register a passkey for you
2587
2587
  object-fit: contain;
2588
2588
  border-radius: var(--privy-border-radius-sm);
2589
2589
  }
2590
- `;import TT from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import ST from"@heroicons/react/24/outline/ClipboardDocumentIcon";import AT from"@heroicons/react/24/outline/ExclamationCircleIcon";import{useState as PT}from"react";import xr from"styled-components";import{ErrorCode as Wd}from"@ethersproject/logger";var ET=new Set([Wd.CALL_EXCEPTION,Wd.NONCE_EXPIRED,Wd.REPLACEMENT_UNDERPRICED,Wd.TRANSACTION_REPLACED]),B3=e=>{let t;return e.code&&e.code!==-32e3&&ET.has(e.code)&&(t=e.transactionHash),t},H3=e=>e.code==="SERVER_ERROR"?e.error?.message??e.reason??e.message??"unknown error":e.error?.code==="SERVER_ERROR"?e.error?.error?.message??e.reason??e.message??"unknown error":e.reason??e.message??"unknown error";import{Fragment as BT,jsx as Dt,jsxs as gi}from"react/jsx-runtime";var xT=e=>{let t=e.code?e.code?.toString().charAt(0)+e.code?.toString().slice(1).replace("_"," ").toLowerCase():"Something went wrong.",r=B3(e),o=H3(e);return{errorCode:t,transactionHash:r,errorMessage:o}},RT=()=>gi(IT,{children:[Dt(LT,{}),Dt(WT,{})]}),z3=({transactionError:e,chainId:t,onClose:r,onRetry:o})=>{let{chains:n}=L(),[i,a]=PT(!1),{errorCode:l,transactionHash:s,errorMessage:d}=xT(e),u=n.find(m=>m.id===t)?.blockExplorers?.default.url??"https://etherscan.io";return gi(BT,{children:[Dt(R,{onClose:r}),gi(kT,{children:[Dt(RT,{}),Dt(_T,{children:l}),Dt(MT,{children:"Please try again."}),gi(G3,{children:[Dt(V3,{children:"Error message"}),Dt(q3,{clickable:!1,children:d})]}),s&&gi(G3,{children:[Dt(V3,{children:"Transaction hash"}),gi(OT,{children:["Copy this hash to view details about the transaction on a"," ",Dt("u",{children:Dt("a",{href:u,children:"block explorer"})}),"."]}),gi(q3,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(s),a(!0)},children:[s,Dt(FT,{clicked:i})]})]}),Dt(NT,{onClick:()=>o({resetNonce:!!s}),children:"Retry transaction"})]}),Dt(Z,{})]})},kT=xr.div`
2590
+ `;import TT from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import ST from"@heroicons/react/24/outline/ClipboardDocumentIcon";import PT from"@heroicons/react/24/outline/ExclamationCircleIcon";import{useState as AT}from"react";import Tr from"styled-components";import{ErrorCode as Ld}from"@ethersproject/logger";var ET=new Set([Ld.CALL_EXCEPTION,Ld.NONCE_EXPIRED,Ld.REPLACEMENT_UNDERPRICED,Ld.TRANSACTION_REPLACED]),z3=e=>{let t;return e.code&&e.code!==-32e3&&ET.has(e.code)&&(t=e.transactionHash),t},K3=e=>e.code==="SERVER_ERROR"?e.error?.message??e.reason??e.message??"unknown error":e.error?.code==="SERVER_ERROR"?e.error?.error?.message??e.reason??e.message??"unknown error":e.reason??e.message??"unknown error";import{Fragment as BT,jsx as Nt,jsxs as bi}from"react/jsx-runtime";var xT=e=>{let t=e.code?e.code?.toString().charAt(0)+e.code?.toString().slice(1).replace("_"," ").toLowerCase():"Something went wrong.",r=z3(e),o=K3(e);return{errorCode:t,transactionHash:r,errorMessage:o}},RT=()=>bi(MT,{children:[Nt(LT,{}),Nt(WT,{})]}),Z3=({transactionError:e,chainId:t,onClose:r,onRetry:o})=>{let{chains:n}=M(),[i,a]=AT(!1),{errorCode:l,transactionHash:s,errorMessage:d}=xT(e),u=n.find(m=>m.id===t)?.blockExplorers?.default.url??"https://etherscan.io";return bi(BT,{children:[Nt(k,{onClose:r}),bi(kT,{children:[Nt(RT,{}),Nt(_T,{children:l}),Nt(IT,{children:"Please try again."}),bi(Q3,{children:[Nt(Y3,{children:"Error message"}),Nt(X3,{clickable:!1,children:d})]}),s&&bi(Q3,{children:[Nt(Y3,{children:"Transaction hash"}),bi(OT,{children:["Copy this hash to view details about the transaction on a"," ",Nt("u",{children:Nt("a",{href:u,children:"block explorer"})}),"."]}),bi(X3,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(s),a(!0)},children:[s,Nt(FT,{clicked:i})]})]}),Nt(NT,{onClick:()=>o({resetNonce:!!s}),children:"Retry transaction"})]}),Nt(J,{})]})},kT=Tr.div`
2591
2591
  display: flex;
2592
2592
  flex-direction: column;
2593
2593
  align-items: center;
2594
2594
  justify-content: center;
2595
- `,_T=xr.span`
2595
+ `,_T=Tr.span`
2596
2596
  color: var(--privy-color-foreground);
2597
2597
  text-align: center;
2598
2598
  font-size: 1.125rem;
@@ -2600,7 +2600,7 @@ You will have to sign up with another method first to register a passkey for you
2600
2600
  line-height: 1.25rem; /* 111.111% */
2601
2601
  text-align: center;
2602
2602
  margin: 10px;
2603
- `,MT=xr.span`
2603
+ `,IT=Tr.span`
2604
2604
  margin-top: 4px;
2605
2605
  margin-bottom: 10px;
2606
2606
  color: var(--privy-color-foreground-3);
@@ -2611,7 +2611,7 @@ You will have to sign up with another method first to register a passkey for you
2611
2611
  font-weight: 400;
2612
2612
  line-height: 20px; /* 142.857% */
2613
2613
  letter-spacing: -0.008px;
2614
- `,IT=xr.div`
2614
+ `,MT=Tr.div`
2615
2615
  position: relative;
2616
2616
  width: 60px;
2617
2617
  height: 60px;
@@ -2619,37 +2619,37 @@ You will have to sign up with another method first to register a passkey for you
2619
2619
  display: flex;
2620
2620
  justify-content: center;
2621
2621
  align-items: center;
2622
- `,WT=xr(AT)`
2622
+ `,WT=Tr(PT)`
2623
2623
  position: absolute;
2624
2624
  width: 35px;
2625
2625
  height: 35px;
2626
2626
  color: var(--privy-color-error);
2627
- `,LT=xr.div`
2627
+ `,LT=Tr.div`
2628
2628
  position: absolute;
2629
2629
  width: 60px;
2630
2630
  height: 60px;
2631
2631
  border-radius: 50%;
2632
2632
  background-color: var(--privy-color-error);
2633
2633
  opacity: 0.1;
2634
- `,NT=xr(F)`
2634
+ `,NT=Tr(F)`
2635
2635
  && {
2636
2636
  margin-top: 24px;
2637
2637
  }
2638
2638
  transition: color 350ms ease, background-color 350ms ease;
2639
- `,V3=xr.span`
2639
+ `,Y3=Tr.span`
2640
2640
  width: 100%;
2641
2641
  text-align: left;
2642
2642
  font-size: 0.825rem;
2643
2643
  color: var(--privy-color-foreground);
2644
2644
  padding: 4px;
2645
- `,G3=xr.div`
2645
+ `,Q3=Tr.div`
2646
2646
  width: 100%;
2647
2647
  margin: 5px;
2648
2648
  display: flex;
2649
2649
  flex-direction: column;
2650
2650
  justify-content: center;
2651
2651
  align-items: center;
2652
- `,OT=xr.text`
2652
+ `,OT=Tr.text`
2653
2653
  position: relative;
2654
2654
  width: 100%;
2655
2655
  padding: 5px;
@@ -2657,7 +2657,7 @@ You will have to sign up with another method first to register a passkey for you
2657
2657
  color: var(--privy-color-foreground-3);
2658
2658
  text-align: left;
2659
2659
  word-wrap: break-word;
2660
- `,q3=xr.span`
2660
+ `,X3=Tr.span`
2661
2661
  position: relative;
2662
2662
  width: 100%;
2663
2663
  background-color: var(--privy-color-background-2);
@@ -2675,31 +2675,31 @@ You will have to sign up with another method first to register a passkey for you
2675
2675
  &:hover {
2676
2676
  background-color: var(--privy-color-foreground-4);
2677
2677
  }`}
2678
- `,DT=xr(ST)`
2678
+ `,DT=Tr(ST)`
2679
2679
  position: absolute;
2680
2680
  top: 13px;
2681
2681
  right: 13px;
2682
2682
  width: 24px;
2683
2683
  height: 24px;
2684
- `,UT=xr(TT)`
2684
+ `,UT=Tr(TT)`
2685
2685
  position: absolute;
2686
2686
  top: 13px;
2687
2687
  right: 13px;
2688
2688
  width: 24px;
2689
2689
  height: 24px;
2690
- `,FT=({clicked:e})=>e?Dt(UT,{}):Dt(DT,{});import{BigNumber as Eu}from"@ethersproject/bignumber";import HT from"styled-components";import{Fragment as qT,jsx as Ci,jsxs as zT}from"react/jsx-runtime";var VT=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=Eu.from(e.gasUsed),o=Eu.from(e.effectiveGasPrice),n=r.mul(o);if(t){let i=Eu.from(t);n=n.add(i)}return n.toString()}catch{return}else return},K3=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a,receiptHeader:l,receiptDescription:s})=>zT(qT,{children:[Ci(R,{onClose:o}),Ci($n,{title:l??"Transaction complete!",description:s??"You're all set."}),Ci(wd,{tokenPrice:n,from:t.from,to:t.to,gas:VT(t,a),txn:e,transactionInfo:r,tokenSymbol:i}),Ci(gr,{}),Ci(GT,{loading:!1,onClick:o,children:"All Done"}),Ci(ne,{}),Ci(G,{})]}),GT=HT(F)`
2690
+ `,FT=({clicked:e})=>e?Nt(UT,{}):Nt(DT,{});import{BigNumber as Ru}from"@ethersproject/bignumber";import HT from"styled-components";import{Fragment as qT,jsx as Ei,jsxs as zT}from"react/jsx-runtime";var VT=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=Ru.from(e.gasUsed),o=Ru.from(e.effectiveGasPrice),n=r.mul(o);if(t){let i=Ru.from(t);n=n.add(i)}return n.toString()}catch{return}else return},J3=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:i,l1GasEstimate:a,receiptHeader:l,receiptDescription:s})=>zT(qT,{children:[Ei(k,{onClose:o}),Ei(ri,{title:l??"Transaction complete!",description:s??"You're all set."}),Ei(wd,{tokenPrice:n,from:t.from,to:t.to,gas:VT(t,a),txn:e,transactionInfo:r,tokenSymbol:i}),Ei(mr,{}),Ei(GT,{loading:!1,onClick:o,children:"All Done"}),Ei(re,{}),Ei(B,{})]}),GT=HT(F)`
2691
2691
  && {
2692
2692
  margin-top: 24px;
2693
2693
  }
2694
2694
  transition: color 350ms ease, background-color 350ms ease;
2695
- `;import{decodeFunctionData as Y3}from"viem";var Q3=e=>{let t=YT(e);if(t)return{action:"approve",isErc20Ish:!0,functionName:t.functionName,spender:t.args[0],amount:t.args[1]};let r=QT(e);return r?{action:"transfer",isErc20Ish:!0,functionName:r.functionName,amount:r.args[1]}:{action:"transaction",isErc20Ish:!1}},KT=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],YT=e=>{try{return Y3({abi:KT,data:e})}catch{return null}},QT=e=>{try{return Y3({abi:fs,data:e})}catch{return null}};import{BigNumber as XT}from"@ethersproject/bignumber";import{useEffect as ZT,useState as JT}from"react";import{calculateTotalGasEstimate as jT,populateTransactionRequest as $T}from"@privy-io/js-sdk-core";var X3=(e,t,r)=>{let[o,n]=JT(null),{getAccessToken:i}=K(),{walletProxy:a}=L(),l=async()=>{if(!await i()||!a||!t)return null;let d=[],u=await $T(t.address,e,r).catch(C=>(d.push(C),e)),{totalGasEstimate:m,l1ExecutionFeeEstimate:f}=await jT(u,r).catch(C=>(d.push(C),{totalGasEstimate:null,l1ExecutionFeeEstimate:null})),{balance:g,hasSufficientFunds:v}=await _d(t.address,u,m??XT.from(0),r).catch(C=>(d.push(C),{balance:null,hasSufficientFunds:!1}));return{tx:u,totalGasEstimate:m,l1ExecutionFeeEstimate:f,balance:g,hasFunds:v,errors:d}};return ZT(()=>{o&&n(null),l().then(n)},[e]),o};import{jsx as Bs}from"react/jsx-runtime";var J3=new Tt(new Dr("There was an issue preparing your transaction",j3.E32603_DEFAULT_INTERNAL_ERROR.eipCode)),$3=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t,setModalData:r,navigate:o}=x(),{rpcConfig:n,chains:i,closePrivyModal:a,walletProxy:l}=L(),{getAccessToken:s,user:d}=K(),u=Le(),[m,f]=Fs(e?.sendTransaction?.transactionRequest),[g,v]=Fs(null),[C,b]=Fs(!1),[A,_]=Fs(null),[S,P]=Fs(null);if(!m||!e?.sendTransaction||!e?.sendTransaction.transactingWallet)return Bs(ai,{error:new Error("Invalid transaction request"),onClick:()=>{e?.sendTransaction?.onFailure(J3),a({shouldCallAuthOnSuccess:!1})}});let E=e.sendTransaction.rootWallet,k=e.sendTransaction.transactingWallet,D=Tu(()=>i.find(B=>Number(B.id)===Number(m.chainId)),[m.chainId]),H=D?.nativeCurrency.symbol??"ETH",{action:M,amount:X,spender:W,isErc20Ish:Y}=Tu(()=>Q3(m.data),[m.data]);eS(()=>{m.to&&D&&Y&&qc({address:m.to,chain:D,rpcConfig:u.rpcConfig,privyAppId:u.id}).then(v).catch(console.error)},[m.to,D]);let{tokenPrice:Ce,isTokenPriceLoading:q}=_o(m),pe=Tu(()=>Ir(Number(m.chainId),i,n,{appId:u.id}),[m.chainId,n]),Q=X3(m,k,pe),ee=()=>{if(!C)return A?(e?.sendTransaction?.onSuccess(A.response),a({shouldCallAuthOnSuccess:!1})):!S&&!Q?.errors[0]?(e?.sendTransaction?.onFailure(new Tt(new Dr("The user rejected the request",j3.E4001_USER_REJECTED_REQUEST.eipCode))),a({shouldCallAuthOnSuccess:!1})):(e?.sendTransaction?.onFailure(S??Q?.errors[0]??J3),a({shouldCallAuthOnSuccess:!1}))};t.current=ee;let ue=async()=>{b(!0);try{let B=await s();if(C||!B||!k||!l||!d)return;let se=await kd({accessToken:B,transactingWallet:k,rootWallet:E,walletProxy:l,transactionRequest:Q?.tx??m,provider:pe,requesterAppId:e.sendTransaction?.requesterAppId}),rt=await se.wait();_({receipt:Md(rt),response:se})}catch(B){console.warn({transaction:Q?.tx??m,error:B}),P(B)}finally{b(!1)}},me=async()=>{if(!k)return;if(!u.fundingConfig||u.fundingConfig.methods.length===0||!e.funding)throw new Error("Funding wallet is not enabled");let B=Id({fundingMethods:u.fundingConfig?.methods});r({...e,funding:{...e?.funding,methodScreen:B}}),o(B)},Te=u.embeddedWallets.priceDisplay.primary==="fiat-currency",ce=Z3(Q?.tx.value??0).add(Z3(Q?.totalGasEstimate?.toBigInt()??0)).toHexString(),Se=bt(ce,H),ft=Te&&Ce?yo(ce,Ce):void 0,tt=bt(Q?.totalGasEstimate?.toString()??0,H),le=Te&&Ce?yo(Q?.totalGasEstimate?.toString()??0,Ce):void 0,nt=bt(Q?.balance?.toString()??0,H,void 0,!0),mr=Te&&Ce?yo(Q?.balance?.toString()??0,Ce):void 0,vt=e.sendTransaction?.uiOptions?.transactionInfo?.title||(M==="approve"?"Confirm address":`Approve ${M}`),I=e.sendTransaction?.uiOptions?.description||`${u.name} wants your permission to approve the following transaction.`,Ke=e.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?Bs("img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,Qt=Q&&!Q.errors[0]&&!Q.hasFunds&&u.fundingConfig&&u.fundingConfig.methods.length>0,U=Qt?"Add funds":e.sendTransaction?.uiOptions?.buttonText||"Approve";return A?.receipt?Bs(K3,{txn:Q?.tx??m,onClose:ee,receipt:A.receipt,transactionInfo:e.sendTransaction?.uiOptions.transactionInfo,tokenPrice:Ce,tokenSymbol:H,l1GasEstimate:Q?.l1ExecutionFeeEstimate?.toString(),receiptHeader:e.sendTransaction?.uiOptions.successHeader,receiptDescription:e.sendTransaction?.uiOptions.successDescription}):S?Bs(z3,{transactionError:S,chainId:Q?.tx.chainId??m.chainId,onClose:ee,onRetry:({resetNonce:B})=>{P(null);let se={...Q?.tx??m};B&&(se.nonce=void 0),f(se)}}):Bs(F3,{isSubmitting:C,submitError:S,isPreparing:!Q,isTokenPriceLoading:q,isTokenContractInfoLoading:!g,prepareError:Q?.errors[0],symbol:g?.symbol,chain:D,img:Ke,title:vt,subtitle:I,spender:W,total:m.value?ft??Se:void 0,fee:le??tt,to:m.to,network:u.chains.find(B=>B.id===m.chainId)?.name??"",from:k?.address??"",cta:U,hasFunds:Q?.hasFunds,action:M,balance:mr??nt,amount:X&&g?Ic({amount:X,decimals:g.decimals}):X,onClose:ee,onClick:Qt?me:ue})};import{isHexString as rS}from"@ethersproject/bytes";import{toUtf8String as oS}from"@ethersproject/strings";import{useEffect as t0,useState as Hs}from"react";import Ra from"styled-components";import{ProviderErrors as Su}from"@privy-io/js-sdk-core";import tS from"styled-components";var e0=tS.img`
2695
+ `;import{decodeFunctionData as j3}from"viem";var $3=e=>{let t=YT(e);if(t)return{action:"approve",isErc20Ish:!0,functionName:t.functionName,spender:t.args[0],amount:t.args[1]};let r=QT(e);return r?{action:"transfer",isErc20Ish:!0,functionName:r.functionName,amount:r.args[1]}:{action:"transaction",isErc20Ish:!1}},KT=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],YT=e=>{try{return j3({abi:KT,data:e})}catch{return null}},QT=e=>{try{return j3({abi:hs,data:e})}catch{return null}};import{BigNumber as XT}from"@ethersproject/bignumber";import{useEffect as ZT,useState as JT}from"react";import{calculateTotalGasEstimate as jT,populateTransactionRequest as $T}from"@privy-io/js-sdk-core";var e0=(e,t,r)=>{let[o,n]=JT(null),{getAccessToken:i}=V(),{walletProxy:a}=M(),l=async()=>{if(!await i()||!a||!t)return null;let d=[],u=await $T(t.address,e,r).catch(C=>(d.push(C),e)),{totalGasEstimate:m,l1ExecutionFeeEstimate:f}=await jT(u,r).catch(C=>(d.push(C),{totalGasEstimate:null,l1ExecutionFeeEstimate:null})),{balance:y,hasSufficientFunds:E}=await _d(t.address,u,m??XT.from(0),r).catch(C=>(d.push(C),{balance:null,hasSufficientFunds:!1}));return{tx:u,totalGasEstimate:m,l1ExecutionFeeEstimate:f,balance:y,hasFunds:E,errors:d}};return ZT(()=>{o&&n(null),l().then(n)},[e]),o};import{jsx as Bs}from"react/jsx-runtime";var r0=new bt(new Wr("There was an issue preparing your transaction",o0.E32603_DEFAULT_INTERNAL_ERROR.eipCode)),n0=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t,setModalData:r,navigate:o}=R(),{rpcConfig:n,chains:i,closePrivyModal:a,walletProxy:l}=M(),{getAccessToken:s,user:d}=V(),u=Me(),[m,f]=Fs(e?.sendTransaction?.transactionRequest),[y,E]=Fs(null),[C,w]=Fs(!1),[P,_]=Fs(null),[T,A]=Fs(null);if(!m||!e?.sendTransaction||!e?.sendTransaction.transactingWallet)return Bs(di,{error:new Error("Invalid transaction request"),onClick:()=>{e?.sendTransaction?.onFailure(r0),a({shouldCallAuthOnSuccess:!1})}});let S=e.sendTransaction.rootWallet,I=e.sendTransaction.transactingWallet,N=ku(()=>i.find(Y=>Number(Y.id)===Number(m.chainId)),[m.chainId]),H=N?.nativeCurrency.symbol??"ETH",{action:x,amount:K,spender:W,isErc20Ish:Q}=ku(()=>$3(m.data),[m.data]);eS(()=>{m.to&&N&&Q&&Gc({address:m.to,chain:N,rpcConfig:u.rpcConfig,privyAppId:u.id}).then(E).catch(console.error)},[m.to,N]);let{tokenPrice:de,isTokenPriceLoading:q}=Ro(m),pe=ku(()=>Rr(Number(m.chainId),i,n,{appId:u.id}),[m.chainId,n]),Z=e0(m,I,pe),ie=()=>{if(!C)return P?(e?.sendTransaction?.onSuccess(P.response),a({shouldCallAuthOnSuccess:!1})):!T&&!Z?.errors[0]?(e?.sendTransaction?.onFailure(new bt(new Wr("The user rejected the request",o0.E4001_USER_REJECTED_REQUEST.eipCode))),a({shouldCallAuthOnSuccess:!1})):(e?.sendTransaction?.onFailure(T??Z?.errors[0]??r0),a({shouldCallAuthOnSuccess:!1}))};t.current=ie;let se=async()=>{w(!0);try{let Y=await s();if(C||!Y||!I||!l||!d)return;let j=await kd({accessToken:Y,transactingWallet:I,rootWallet:S,walletProxy:l,transactionRequest:Z?.tx??m,provider:pe,requesterAppId:e.sendTransaction?.requesterAppId}),Oe=await j.wait();_({receipt:Id(Oe),response:j})}catch(Y){console.warn({transaction:Z?.tx??m,error:Y}),A(Y)}finally{w(!1)}},_e=async()=>{if(!I)return;if(!u.fundingConfig||u.fundingConfig.methods.length===0||!e.funding)throw new Error("Funding wallet is not enabled");let Y=Wd({fundingMethods:u.fundingConfig?.methods});r({...e,funding:{...e?.funding,methodScreen:Y}}),o(Y)},be=u.embeddedWallets.priceDisplay.primary==="fiat-currency",ye=t0(Z?.tx.value??0).add(t0(Z?.totalGasEstimate?.toBigInt()??0)).toHexString(),ae=wt(ye,H),Xe=be&&de?fo(ye,de):void 0,it=wt(Z?.totalGasEstimate?.toString()??0,H),le=be&&de?fo(Z?.totalGasEstimate?.toString()??0,de):void 0,et=wt(Z?.balance?.toString()??0,H,void 0,!0),Ot=be&&de?fo(Z?.balance?.toString()??0,de):void 0,zr=e.sendTransaction?.uiOptions?.transactionInfo?.title||(x==="approve"?"Confirm address":`Approve ${x}`),L=e.sendTransaction?.uiOptions?.description||`${u.name} wants your permission to approve the following transaction.`,Se=e.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?Bs("img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,qe=Z&&!Z.errors[0]&&!Z.hasFunds&&u.fundingConfig&&u.fundingConfig.methods.length>0,U=qe?"Add funds":e.sendTransaction?.uiOptions?.buttonText||"Approve";return P?.receipt?Bs(J3,{txn:Z?.tx??m,onClose:ie,receipt:P.receipt,transactionInfo:e.sendTransaction?.uiOptions.transactionInfo,tokenPrice:de,tokenSymbol:H,l1GasEstimate:Z?.l1ExecutionFeeEstimate?.toString(),receiptHeader:e.sendTransaction?.uiOptions.successHeader,receiptDescription:e.sendTransaction?.uiOptions.successDescription}):T?Bs(Z3,{transactionError:T,chainId:Z?.tx.chainId??m.chainId,onClose:ie,onRetry:({resetNonce:Y})=>{A(null);let j={...Z?.tx??m};Y&&(j.nonce=void 0),f(j)}}):Bs(q3,{isSubmitting:C,submitError:T,isPreparing:!Z,isTokenPriceLoading:q,isTokenContractInfoLoading:!y,prepareError:Z?.errors[0],symbol:y?.symbol,chain:N,img:Se,title:zr,subtitle:L,spender:W,total:m.value?Xe??ae:void 0,fee:le??it,to:m.to,network:u.chains.find(Y=>Y.id===m.chainId)?.name??"",from:I?.address??"",cta:U,hasFunds:Z?.hasFunds,action:x,balance:Ot??et,amount:K&&y?Ic({amount:K,decimals:y.decimals}):K,onClose:ie,onClick:qe?_e:se})};import{isHexString as rS}from"@ethersproject/bytes";import{toUtf8String as oS}from"@ethersproject/strings";import{useEffect as a0,useState as Hs}from"react";import Ia from"styled-components";import{ProviderErrors as _u}from"@privy-io/js-sdk-core";import tS from"styled-components";var i0=tS.img`
2696
2696
  && {
2697
2697
  height: ${e=>e.size==="sm"?"65px":"140px"};
2698
2698
  width: ${e=>e.size==="sm"?"65px":"140px"};
2699
2699
  border-radius: 16px;
2700
2700
  margin-bottom: 12px;
2701
2701
  }
2702
- `;import{Fragment as o0,jsx as et,jsxs as Vs}from"react/jsx-runtime";var nS=e=>{if(!rS(e))return e;try{return oS(e)}catch{return e}},iS=e=>JSON.stringify(e,null,2),aS=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?et(lS,{children:Object.entries(r).map(([o,n])=>Vs("li",{children:[Vs("strong",{children:[o,":"]})," ",t(n)]},o))}):et("span",{children:String(r)});return et("div",{children:t(e)})},sS=e=>{let{types:t,primaryType:r,...o}=e.typedData;return Vs(o0,{children:[et(Au,{children:et(aS,{data:o})}),et(gn,{text:iS(e.typedData),itemName:"full payload to clipboard"})," "]})},r0=()=>{let{authenticated:e}=K(),{initializeWalletProxy:t,closePrivyModal:r}=L(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:i}=x(),[a,l]=Hs(!0),[s,d]=Hs(""),[u,m]=Hs(),[f,g]=Hs(null),[v,C]=Hs(!1),b=f!==null;t0(()=>{e||o("LANDING")},[e]),t0(()=>{t(Pi).then(M=>{l(!1),M||(d("An error has occurred, please try again."),m(new Tt(new Dr(s,Su.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:A,data:_,confirmAndSign:S,onSuccess:P,onFailure:E,uiOptions:k}=n.signMessage,D={title:k.title||"Sign message",description:k.description||"Signing this message will not cost you any fees.",buttonText:k.buttonText||"Sign and continue"},H=M=>{M?P(M):E(u||new Tt(new Dr("The user rejected the request.",Su.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout(()=>{g(null),d(""),m(void 0)},200)};return i.current=()=>{H(f)},Vs(o0,{children:[et(R,{onClose:()=>H(f)}),et(oe,{}),k.iconUrl&&typeof k.iconUrl=="string"?et(pS,{children:et(e0,{size:"sm",src:k.iconUrl,alt:"app image"})}):null,et(no,{children:D.title}),et(Hr,{children:D.description}),A==="personal_sign"&&et(Au,{children:nS(_)}),A==="eth_signTypedData_v4"&&et(sS,{typedData:_}),A==="solana_signMessage"&&et(Au,{children:_}),et(uS,{}),et(cS,{fail:!0,children:s}),et(Go,{disabled:v||b||a,loading:v,onClick:async()=>{C(!0),d("");try{let M=await S();g(M),C(!1),setTimeout(()=>{H(M)},We)}catch(M){console.error(M),d("An error has occurred, please try again."),m(new Tt(new Dr(s,Su.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),C(!1)}},children:v?"Signing...":b?Vs(dS,{children:[et(ua,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",et("span",{children:"Success"})]}):D.buttonText}),et(ne,{}),et(G,{})]})},Au=Ra.div`
2702
+ `;import{Fragment as l0,jsx as ot,jsxs as Vs}from"react/jsx-runtime";var nS=e=>{if(!rS(e))return e;try{return oS(e)}catch{return e}},iS=e=>JSON.stringify(e,null,2),aS=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?ot(lS,{children:Object.entries(r).map(([o,n])=>Vs("li",{children:[Vs("strong",{children:[o,":"]})," ",t(n)]},o))}):ot("span",{children:String(r)});return ot("div",{children:t(e)})},sS=e=>{let{types:t,primaryType:r,...o}=e.typedData;return Vs(l0,{children:[ot(Iu,{children:ot(aS,{data:o})}),ot(Cn,{text:iS(e.typedData),itemName:"full payload to clipboard"})," "]})},s0=()=>{let{authenticated:e}=V(),{initializeWalletProxy:t,closePrivyModal:r}=M(),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:i}=R(),[a,l]=Hs(!0),[s,d]=Hs(""),[u,m]=Hs(),[f,y]=Hs(null),[E,C]=Hs(!1),w=f!==null;a0(()=>{e||o("LANDING")},[e]),a0(()=>{t(ki).then(x=>{l(!1),x||(d("An error has occurred, please try again."),m(new bt(new Wr(s,_u.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:P,data:_,confirmAndSign:T,onSuccess:A,onFailure:S,uiOptions:I}=n.signMessage,N={title:I.title||"Sign message",description:I.description||"Signing this message will not cost you any fees.",buttonText:I.buttonText||"Sign and continue"},H=x=>{x?A(x):S(u||new bt(new Wr("The user rejected the request.",_u.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout(()=>{y(null),d(""),m(void 0)},200)};return i.current=()=>{H(f)},Vs(l0,{children:[ot(k,{onClose:()=>H(f)}),ot(te,{}),I.iconUrl&&typeof I.iconUrl=="string"?ot(pS,{children:ot(i0,{size:"sm",src:I.iconUrl,alt:"app image"})}):null,ot(ro,{children:N.title}),ot(Dr,{children:N.description}),P==="personal_sign"&&ot(Iu,{children:nS(_)}),P==="eth_signTypedData_v4"&&ot(sS,{typedData:_}),P==="solana_signMessage"&&ot(Iu,{children:_}),ot(uS,{}),ot(cS,{fail:!0,children:s}),ot(Go,{disabled:E||w||a,loading:E,onClick:async()=>{C(!0),d("");try{let x=await T();y(x),C(!1),setTimeout(()=>{H(x)},Ie)}catch(x){console.error(x),d("An error has occurred, please try again."),m(new bt(new Wr(s,_u.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),C(!1)}},children:E?"Signing...":w?Vs(dS,{children:[ot(ha,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",ot("span",{children:"Success"})]}):N.buttonText}),ot(re,{}),ot(B,{})]})},Iu=Ia.div`
2703
2703
  margin-top: 1.5rem;
2704
2704
  background-color: var(--privy-color-background-2);
2705
2705
  border-radius: var(--privy-border-radius-md);
@@ -2718,7 +2718,7 @@ You will have to sign up with another method first to register a passkey for you
2718
2718
  display: none; /* Safari and Chrome */
2719
2719
  }
2720
2720
  }
2721
- `,lS=Ra.ul`
2721
+ `,lS=Ia.ul`
2722
2722
  margin-left: 12px !important;
2723
2723
  white-space: nowrap;
2724
2724
 
@@ -2730,7 +2730,7 @@ You will have to sign up with another method first to register a passkey for you
2730
2730
  font-weight: 500 !important;
2731
2731
  }
2732
2732
  }
2733
- `,cS=Ra.div`
2733
+ `,cS=Ia.div`
2734
2734
  line-height: 20px;
2735
2735
  height: 20px;
2736
2736
  font-size: 13px;
@@ -2740,20 +2740,20 @@ You will have to sign up with another method first to register a passkey for you
2740
2740
  width: 100%;
2741
2741
  margin-top: 16px;
2742
2742
  margin-bottom: 4px;
2743
- `,dS=Ra.span`
2743
+ `,dS=Ia.span`
2744
2744
  display: flex;
2745
2745
  align-items: center;
2746
2746
  gap: 8px;
2747
- `,pS=Ra.div`
2747
+ `,pS=Ia.div`
2748
2748
  display: flex;
2749
2749
  flex-direction: column;
2750
2750
  justify-content: center;
2751
2751
  align-items: center;
2752
2752
  width: 100%;
2753
2753
  height: 82px;
2754
- `,uS=Ra.div`
2754
+ `,uS=Ia.div`
2755
2755
  flex-grow: 1;
2756
- `;import{useEffect as n0,useState as i0}from"react";import mS from"styled-components";import{Fragment as hS,jsx as No,jsxs as Ld}from"react/jsx-runtime";var a0=()=>{let{authenticated:e,logout:t,ready:r,user:o}=K(),{app:n,setModalData:i,navigate:a,resetNavigation:l}=x(),{initLoginWithTelegram:s,loginWithTelegram:d,updateWallets:u,setReadyToTrue:m,closePrivyModal:f,createAnalyticsEvent:g}=L(),[v,C]=i0(!1),[b,A]=i0(void 0),_=We;async function S(){try{await d(),C(!0),m(!0)}catch(k){if(k?.privyErrorCode==="allowlist_rejected"){A(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(k?.privyErrorCode==="max_accounts_reached"){console.error(new fo(k).toString()),A(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}if(k?.privyErrorCode==="user_does_not_exist"){A(void 0),l(),a("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:D,detail:H}=Zd(k);A({retryable:D,detail:H,message:"Authentication failed"})}}n0(()=>{S()},[]),n0(()=>{if(!(r&&e&&v&&o))return;if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let H=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},_);return()=>clearTimeout(H)}if(Et(o,n?.embeddedWallets?.createOnLogin)){let H=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:M=>{console.error(M),g({eventName:"embedded_wallet_creation_failure_logout",payload:{error:M,provider:"telegram",screen:"TelegramAuthScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},_);return()=>clearTimeout(H)}u();let D=setTimeout(()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0}),_);return()=>clearTimeout(D)},[r,e,v,o]);let P=v?"Successfully connected with Telegram":b?b.message:"Verifying connection to Telegram",E="";return v?E="You\u2019re good to go!":b?E=b.detail:E="Just a few moments more",Ld(hS,{children:[No(R,{}),No(oe,{}),Ld(fS,{children:[No(je,{children:Ld("div",{children:[No(it,{success:v,fail:!!b}),No(sd,{style:{width:"38px",height:"38px"}})]})}),Ld(Qe,{children:[No("h3",{children:P}),No("p",{children:E})]}),b&&b?.retryable?No(sn,{onClick:()=>{s().then(async()=>S()).catch(k=>{let{retryable:D,detail:H}=Zd(k);A({retryable:D,detail:H,message:"Authentication failed"})}),A(void 0)},disabled:!v&&!b?.retryable,children:"Retry"}):null]}),No(ne,{}),No(Z,{})]})},fS=mS.div`
2756
+ `;import{useEffect as c0,useState as d0}from"react";import mS from"styled-components";import{Fragment as hS,jsx as Wo,jsxs as Nd}from"react/jsx-runtime";var p0=()=>{let{authenticated:e,logout:t,ready:r,user:o}=V(),{app:n,setModalData:i,navigate:a,resetNavigation:l,data:s}=R(),{initLoginWithTelegram:d,loginWithTelegram:u,updateWallets:m,setReadyToTrue:f,closePrivyModal:y,createAnalyticsEvent:E}=M(),[C,w]=d0(!1),[P,_]=d0(void 0),T=Ie;async function A(){try{await u(),w(!0),f(!0)}catch(N){if(N?.privyErrorCode==="allowlist_rejected"){_(void 0),l(),a("ALLOWLIST_REJECTION_SCREEN");return}if(N?.privyErrorCode==="max_accounts_reached"){console.error(new uo(N).toString()),_(void 0),l(),a("USER_LIMIT_REACHED_SCREEN");return}if(N?.privyErrorCode==="user_does_not_exist"){_(void 0),l(),a("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:H,detail:x}=tp(N);_({retryable:H,detail:x,message:"Authentication failed"})}}c0(()=>{A()},[]),c0(()=>{if(!(r&&e&&C&&o))return;if(n?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let x=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},T);return()=>clearTimeout(x)}if(vt(o,n?.embeddedWallets?.createOnLogin)){let x=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:K=>{console.error(K),E({eventName:"embedded_wallet_creation_failure_logout",payload:{error:K,provider:"telegram",screen:"TelegramAuthScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},T);return()=>clearTimeout(x)}m();let H=setTimeout(()=>y({shouldCallAuthOnSuccess:!0,isSuccess:!0}),T);return()=>clearTimeout(H)},[r,e,C,o]);let S=C?"Successfully connected with Telegram":P?P.message:"Verifying connection to Telegram",I="";return C?I="You\u2019re good to go!":P?I=P.detail:I="Just a few moments more",Nd(hS,{children:[Wo(k,{}),Wo(te,{}),Nd(fS,{children:[Wo(tt,{children:Nd("div",{children:[Wo(at,{success:C,fail:!!P}),Wo(sd,{style:{width:"38px",height:"38px"}})]})}),Nd(Je,{children:[Wo("h3",{children:S}),Wo("p",{children:I})]}),P&&P?.retryable?Wo(ln,{onClick:()=>{d(void 0,s?.login?.disableSignup).then(async()=>A()).catch(N=>{let{retryable:H,detail:x}=tp(N);_({retryable:H,detail:x,message:"Authentication failed"})}),_(void 0)},disabled:!C&&!P?.retryable,children:"Retry"}):null]}),Wo(re,{}),Wo(J,{})]})},fS=mS.div`
2757
2757
  display: flex;
2758
2758
  flex-direction: column;
2759
2759
  align-items: center;
@@ -2761,9 +2761,9 @@ You will have to sign up with another method first to register a passkey for you
2761
2761
  margin-left: 27px;
2762
2762
  margin-right: 27px;
2763
2763
  gap: 24px;
2764
- `;import bS from"@heroicons/react/24/outline/EnvelopeIcon";import yS from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as gS,useState as s0}from"react";import c0 from"styled-components";import{Fragment as wS,jsx as Gs,jsxs as l0}from"react/jsx-runtime";var d0=gS((e,t)=>{let[r,o]=s0(""),[n,i]=s0(!1),{authenticated:a,user:l}=K(),{initUpdateEmail:s}=L(),{navigate:d,setModalData:u,currentScreen:m}=x(),{enabled:f,token:g}=Ae(),v=Js(r),C=n,b=n||!v,A=async S=>{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,S),d("AWAITING_PASSWORDLESS_CODE")}catch(P){u({errorModalData:{error:P,previousScreen:m||"LANDING"}})}i(!1)},_=()=>{f&&!g&&!a?(u({captchaModalData:{callback:S=>{if(!l?.email)throw new Error("User is required to have an email address to update it.");return s(l.email.address,r,S)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),d("CAPTCHA_SCREEN")):A(g)};return l0(wS,{children:[Gs(CS,{children:l0(vS,{children:[Gs(yS,{}),Gs("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:S=>o(S.target.value),onKeyUp:S=>{S.key==="Enter"&&_()},value:r,autoComplete:"email"}),e.stacked?null:Gs(Ki,{isSubmitting:C,onClick:_,disabled:b,children:"Submit"})]})}),e.stacked?Gs(F,{loadingText:null,loading:C,disabled:b,onClick:_,children:"Submit"}):null]})}),CS=c0.div`
2764
+ `;import bS from"@heroicons/react/24/outline/EnvelopeIcon";import yS from"@heroicons/react/24/outline/EnvelopeIcon";import{forwardRef as gS,useState as u0}from"react";import f0 from"styled-components";import{Fragment as wS,jsx as Gs,jsxs as m0}from"react/jsx-runtime";var h0=gS((e,t)=>{let[r,o]=u0(""),[n,i]=u0(!1),{authenticated:a,user:l}=V(),{initUpdateEmail:s}=M(),{navigate:d,setModalData:u,currentScreen:m}=R(),{enabled:f,token:y}=Ee(),E=Zs(r),C=n,w=n||!E,P=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),d("AWAITING_PASSWORDLESS_CODE")}catch(A){u({errorModalData:{error:A,previousScreen:m||"LANDING"}})}i(!1)},_=()=>{f&&!y&&!a?(u({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"}}),d("CAPTCHA_SCREEN")):P(y)};return m0(wS,{children:[Gs(CS,{children:m0(vS,{children:[Gs(yS,{}),Gs("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:T=>o(T.target.value),onKeyUp:T=>{T.key==="Enter"&&_()},value:r,autoComplete:"email"}),e.stacked?null:Gs(Zi,{isSubmitting:C,onClick:_,disabled:w,children:"Submit"})]})}),e.stacked?Gs(F,{loadingText:null,loading:C,disabled:w,onClick:_,children:"Submit"}):null]})}),CS=f0.div`
2765
2765
  width: 100%;
2766
- `,vS=c0.label`
2766
+ `,vS=f0.label`
2767
2767
  display: block;
2768
2768
  position: relative;
2769
2769
  width: 100%;
@@ -2821,7 +2821,7 @@ You will have to sign up with another method first to register a passkey for you
2821
2821
  && > input::placeholder {
2822
2822
  color: var(--privy-color-foreground-3);
2823
2823
  }
2824
- `;import{Fragment as ES,jsx as Wn,jsxs as TS}from"react/jsx-runtime";var p0=()=>TS(ES,{children:[Wn(R,{},"header"),Wn(oe,{}),Wn(ve,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:Wn(bS,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),Wn(lr,{children:Wn(d0,{stacked:!0})}),Wn(ne,{}),Wn(G,{})]});import SS from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as AS,jsx as Ln,jsxs as PS}from"react/jsx-runtime";var u0=()=>{let{currentScreen:e,data:t,navigate:r,setModalData:o}=x(),{user:n}=K(),{initUpdatePhone:i}=L();async function a({qualifiedPhoneNumber:l}){try{if(!n?.phone?.number)throw new Error("User is required to have an phone number to update it.");await i(n?.phone?.number,l),r("AWAITING_PASSWORDLESS_CODE")}catch(s){o({errorModalData:{error:s,previousScreen:t?.errorModalData?.previousScreen||e||"LINK_PHONE_SCREEN"}}),r("ERROR_SCREEN")}}return PS(AS,{children:[Ln(R,{},"header"),Ln(oe,{}),Ln(ve,{title:"Update your phone number",description:"Add the phone number you'd like to use going forward. We'll send you a confirmation code",icon:Ln(SS,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),Ln(lr,{children:Ln(Sn,{stacked:!0,onSubmit:a,hideRecent:!0})}),Ln(ne,{}),Ln(G,{})]})};import xu from"styled-components";import{jsx as m0}from"react/jsx-runtime";var f0=({style:e,...t})=>m0("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:m0("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})});import{Fragment as _S,jsx as vi,jsxs as Pu}from"react/jsx-runtime";var h0=()=>{let{navigate:e}=x();return Pu(_S,{children:[vi(R,{}),Pu(xS,{children:[vi(RS,{children:vi(f0,{})}),Pu(kS,{children:[vi("h3",{children:"Unable to sign in"}),vi("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),vi(F,{onClick:()=>{e("LANDING")},children:"Go back"})]}),vi(G,{})]})},xS=xu.div`
2824
+ `;import{Fragment as ES,jsx as Ln,jsxs as TS}from"react/jsx-runtime";var y0=()=>TS(ES,{children:[Ln(k,{},"header"),Ln(te,{}),Ln(ge,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:Ln(bS,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),Ln(ir,{children:Ln(h0,{stacked:!0})}),Ln(re,{}),Ln(B,{})]});import SS from"@heroicons/react/24/outline/PhoneIcon";import{Fragment as PS,jsx as Nn,jsxs as AS}from"react/jsx-runtime";var g0=()=>{let{currentScreen:e,data:t,navigate:r,setModalData:o}=R(),{user:n}=V(),{initUpdatePhone:i}=M();async function a({qualifiedPhoneNumber:l}){try{if(!n?.phone?.number)throw new Error("User is required to have an phone number to update it.");await i(n?.phone?.number,l),r("AWAITING_PASSWORDLESS_CODE")}catch(s){o({errorModalData:{error:s,previousScreen:t?.errorModalData?.previousScreen||e||"LINK_PHONE_SCREEN"}}),r("ERROR_SCREEN")}}return AS(PS,{children:[Nn(k,{},"header"),Nn(te,{}),Nn(ge,{title:"Update your phone number",description:"Add the phone number you'd like to use going forward. We'll send you a confirmation code",icon:Nn(SS,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),Nn(ir,{children:Nn(Pn,{stacked:!0,onSubmit:a,hideRecent:!0})}),Nn(re,{}),Nn(B,{})]})};import Wu from"styled-components";import{jsx as C0}from"react/jsx-runtime";var v0=({style:e,...t})=>C0("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:C0("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})});import{Fragment as _S,jsx as Ti,jsxs as Mu}from"react/jsx-runtime";var w0=()=>{let{navigate:e}=R();return Mu(_S,{children:[Ti(k,{}),Mu(xS,{children:[Ti(RS,{children:Ti(v0,{})}),Mu(kS,{children:[Ti("h3",{children:"Unable to sign in"}),Ti("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),Ti(F,{onClick:()=>{e("LANDING")},children:"Go back"})]}),Ti(B,{})]})},xS=Wu.div`
2825
2825
  display: flex;
2826
2826
  flex-direction: column;
2827
2827
  align-items: center;
@@ -2830,7 +2830,7 @@ You will have to sign up with another method first to register a passkey for you
2830
2830
  width: 100%;
2831
2831
  padding-top: 8px;
2832
2832
  padding-bottom: 32px;
2833
- `,RS=xu.div`
2833
+ `,RS=Wu.div`
2834
2834
  display: flex;
2835
2835
  align-items: center;
2836
2836
  justify-content: center;
@@ -2839,11 +2839,11 @@ You will have to sign up with another method first to register a passkey for you
2839
2839
  color: var(--privy-color-error);
2840
2840
  background-color: var(--privy-color-error-light);
2841
2841
  border-radius: 50%;
2842
- `,kS=xu.div`
2842
+ `,kS=Wu.div`
2843
2843
  display: flex;
2844
2844
  flex-direction: column;
2845
2845
  gap: 8px;
2846
- `;import IS,{createGlobalStyle as WS}from"styled-components";var MS=`
2846
+ `;import MS,{createGlobalStyle as WS}from"styled-components";var IS=`
2847
2847
  *,
2848
2848
  ::before,
2849
2849
  ::after {
@@ -3073,7 +3073,7 @@ You will have to sign up with another method first to register a passkey for you
3073
3073
  [hidden] {
3074
3074
  display: none;
3075
3075
  }
3076
- `,y0=MS;var g0=WS`
3076
+ `,b0=IS;var E0=WS`
3077
3077
  :root {
3078
3078
  // Borders
3079
3079
  --privy-border-radius-sm: 6px;
@@ -3108,10 +3108,10 @@ You will have to sign up with another method first to register a passkey for you
3108
3108
  --privy-height-modal-full: 620px;
3109
3109
  --privy-height-modal-compact: 480px;
3110
3110
  };
3111
- `,Ru=IS.div`
3111
+ `,Lu=MS.div`
3112
3112
  // css normalize only the privy application to avoid conflicts
3113
3113
  // with consuming application
3114
- ${y0}
3114
+ ${b0}
3115
3115
 
3116
3116
  // Privy styles
3117
3117
  color: var(--privy-color-foreground-2);
@@ -3162,7 +3162,7 @@ You will have to sign up with another method first to register a passkey for you
3162
3162
  opacity: 1;
3163
3163
  }
3164
3164
  }
3165
- `;import{Dialog as C0,Transition as ku}from"@headlessui/react";import _u from"react";import qs from"styled-components";import{jsx as ka,jsxs as US}from"react/jsx-runtime";var v0=({children:e,open:t,onClick:r,...o})=>ka(ku,{show:t,as:_u.Fragment,children:US(C0,{onClose:r,...o,as:NS,children:[ka(ku.Child,{as:_u.Fragment,enterFrom:"entering",leaveTo:"leaving",children:ka(LS,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),ka(OS,{children:ka(ku.Child,{as:_u.Fragment,enterFrom:"entering",leaveTo:"leaving",children:ka(C0.Panel,{as:DS,children:e})})})]})}),LS=qs.div`
3165
+ `;import{Dialog as T0,Transition as Nu}from"@headlessui/react";import Ou from"react";import qs from"styled-components";import{jsx as Ma,jsxs as US}from"react/jsx-runtime";var S0=({children:e,open:t,onClick:r,...o})=>Ma(Nu,{show:t,as:Ou.Fragment,children:US(T0,{onClose:r,...o,as:NS,children:[Ma(Nu.Child,{as:Ou.Fragment,enterFrom:"entering",leaveTo:"leaving",children:Ma(LS,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),Ma(OS,{children:Ma(Nu.Child,{as:Ou.Fragment,enterFrom:"entering",leaveTo:"leaving",children:Ma(T0.Panel,{as:DS,children:e})})})]})}),LS=qs.div`
3166
3166
  position: fixed;
3167
3167
  inset: 0;
3168
3168
 
@@ -3233,13 +3233,13 @@ You will have to sign up with another method first to register a passkey for you
3233
3233
  box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
3234
3234
  border-radius: var(--privy-border-radius-lg);
3235
3235
  }
3236
- `,w0=qs.div`
3236
+ `,P0=qs.div`
3237
3237
  display: flex;
3238
3238
  flex-direction: column;
3239
3239
  align-items: center;
3240
3240
  justify-content: center;
3241
3241
  height: 100%;
3242
- `;import{Fragment as E0,jsx as lt,jsxs as T0}from"react/jsx-runtime";var VS={["LANDING"]:v2,["CONNECT_OR_CREATE"]:g2,["AWAITING_PASSWORDLESS_CODE"]:_h,["AWAITING_CONNECTION"]:$h,["AWAITING_CONNECT_ONLY_CONNECTION"]:ry,["AWAITING_FARCASTER_CONNECTION"]:sg,["AWAITING_FARCASTER_SIGNER"]:mg,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:y3,["PHANTOM_INTERSTITIAL_SCREEN"]:w3,["LOGIN_FAILED_SCREEN"]:P2,["AWAITING_OAUTH_SCREEN"]:m3,["CROSS_APP_AUTH_SCREEN"]:ay,["ALLOWLIST_REJECTION_SCREEN"]:bh,["ACCOUNT_NOT_FOUND_SCREEN"]:hh,["USER_LIMIT_REACHED_SCREEN"]:h0,["INSTALL_PHANTOM_SCREEN"]:K1,["LINK_EMAIL_SCREEN"]:w2,["LINK_PHONE_SCREEN"]:b2,["LINK_WALLET_SCREEN"]:E2,["LINK_PASSKEY_SCREEN"]:Yg,["UPDATE_EMAIL_SCREEN"]:p0,["UPDATE_PHONE_SCREEN"]:u0,["CONNECT_ONLY_LANDING_SCREEN"]:Qh,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:Yh,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:by,["EMBEDDED_WALLET_CREATED_SCREEN"]:fy,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:uy,["EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN"]:b3,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:I3,["EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN"]:O3,["EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN"]:k3,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:Cy,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:r0,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:$3,["FUNDING_METHOD_SELECTION_SCREEN"]:k1,["MOONPAY_PROMPT_SCREEN"]:N1,["MOONPAY_STATUS_SCREEN"]:D1,["COINBASE_ONRAMP_STATUS_SCREEN"]:h1,["FUNDING_TRANSFER_FROM_WALLET_SCREEN"]:B1,["FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"]:a1,["FUNDING_MANUAL_TRANSFER_SCREEN"]:_1,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:Yy,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:Ky,["EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN"]:M3,["MFA_ENROLLMENT_FLOW_SCREEN"]:B2,["CAPTCHA_SCREEN"]:Lh,["ERROR_SCREEN"]:Xy,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:H1,["AFFIRMATIVE_CONSENT_SCREEN"]:Ch,["TELEGRAM_AUTH_SCREEN"]:a0},GS=["LANDING","AWAITING_CONNECTION"],A0=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=K(),{headless:n}=Le(),{ready:i,currentScreen:a}=x(),{status:l,execute:s,reset:d,enabled:u}=Ae(),m=o&&a&&GS.includes(a)&&!n&&l==="ready";if(b0(()=>{m&&s()},[m]),b0(()=>{!o&&u&&d()},[o,u]),(!r||!i)&&a!=="AWAITING_OAUTH_SCREEN"&&a!=="CROSS_APP_AUTH_SCREEN"&&a!=="TELEGRAM_AUTH_SCREEN")return T0(E0,{children:[lt(R,{}),lt(oe,{}),lt(w0,{children:lt(at,{})}),lt(ne,{}),lt(Z,{})]});if(!a&&e)return lt(hu,{open:e,onClose:t});if(!a)return null;let f=VS[a];return T0(E0,{children:[lt(eo,{if:!!e,children:lt(f,{})}),lt(eo,{if:!e,children:lt(hu,{open:e,onClose:t})})]})},qS=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let r=BS(null),o=Em(r);return lt(KS,{style:{height:o},id:"privy-modal-content",children:lt("div",{ref:r,children:lt(A0,{isMfaVerifying:e,onMfaVerificationComplete:t})})})},zS=()=>{let{closePrivyModal:e}=L(),{onUserCloseViaDialogOrKeybindRef:t}=x();return{gracefulClosePrivyModal:FS(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},Mu=({open:e})=>{let{app:t}=x(),{gracefulClosePrivyModal:r}=zS(),[o,n]=HS(!1);np({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=e||o;return t.render.standalone?lt(Ru,{children:lt(P0,{id:"privy-modal-content",children:lt(A0,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})}):lt(v0,{open:i,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:lt(Ru,{children:lt(qS,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})})},P0=S0.div`
3242
+ `;import{Fragment as x0,jsx as ct,jsxs as R0}from"react/jsx-runtime";var VS={["LANDING"]:E2,["CONNECT_OR_CREATE"]:w2,["AWAITING_PASSWORDLESS_CODE"]:Wh,["AWAITING_CONNECTION"]:oy,["AWAITING_CONNECT_ONLY_CONNECTION"]:ay,["AWAITING_FARCASTER_CONNECTION"]:pg,["AWAITING_FARCASTER_SIGNER"]:gg,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:w3,["PHANTOM_INTERSTITIAL_SCREEN"]:S3,["LOGIN_FAILED_SCREEN"]:_2,["AWAITING_OAUTH_SCREEN"]:g3,["CROSS_APP_AUTH_SCREEN"]:dy,["ALLOWLIST_REJECTION_SCREEN"]:Sh,["ACCOUNT_NOT_FOUND_SCREEN"]:Ch,["USER_LIMIT_REACHED_SCREEN"]:w0,["INSTALL_PHANTOM_SCREEN"]:X1,["LINK_EMAIL_SCREEN"]:T2,["LINK_PHONE_SCREEN"]:S2,["LINK_WALLET_SCREEN"]:A2,["LINK_PASSKEY_SCREEN"]:Jg,["UPDATE_EMAIL_SCREEN"]:y0,["UPDATE_PHONE_SCREEN"]:g0,["CONNECT_ONLY_LANDING_SCREEN"]:jh,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:Zh,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:Py,["EMBEDDED_WALLET_CREATED_SCREEN"]:Cy,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:yy,["EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN"]:P3,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:O3,["EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN"]:B3,["EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN"]:W3,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:Ey,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:s0,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:n0,["FUNDING_METHOD_SELECTION_SCREEN"]:M1,["MOONPAY_PROMPT_SCREEN"]:U1,["MOONPAY_STATUS_SCREEN"]:B1,["COINBASE_ONRAMP_STATUS_SCREEN"]:v1,["FUNDING_TRANSFER_FROM_WALLET_SCREEN"]:G1,["FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"]:d1,["FUNDING_MANUAL_TRANSFER_SCREEN"]:W1,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:Jy,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:Zy,["EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN"]:N3,["MFA_ENROLLMENT_FLOW_SCREEN"]:q2,["CAPTCHA_SCREEN"]:Dh,["ERROR_SCREEN"]:$y,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:q1,["AFFIRMATIVE_CONSENT_SCREEN"]:bh,["TELEGRAM_AUTH_SCREEN"]:p0},GS=["LANDING","AWAITING_CONNECTION"],_0=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=V(),{headless:n}=Me(),{ready:i,currentScreen:a}=R(),{status:l,execute:s,reset:d,enabled:u}=Ee(),m=o&&a&&GS.includes(a)&&!n&&l==="ready";if(A0(()=>{m&&s()},[m]),A0(()=>{!o&&u&&d()},[o,u]),(!r||!i)&&a!=="AWAITING_OAUTH_SCREEN"&&a!=="CROSS_APP_AUTH_SCREEN"&&a!=="TELEGRAM_AUTH_SCREEN")return R0(x0,{children:[ct(k,{}),ct(te,{}),ct(P0,{children:ct(st,{})}),ct(re,{}),ct(J,{})]});if(!a&&e)return ct(vu,{open:e,onClose:t});if(!a)return null;let f=VS[a];return R0(x0,{children:[ct(jr,{if:!!e,children:ct(f,{})}),ct(jr,{if:!e,children:ct(vu,{open:e,onClose:t})})]})},qS=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let r=BS(null),o=Pm(r);return ct(KS,{style:{height:o},id:"privy-modal-content",children:ct("div",{ref:r,children:ct(_0,{isMfaVerifying:e,onMfaVerificationComplete:t})})})},zS=()=>{let{closePrivyModal:e}=M(),{onUserCloseViaDialogOrKeybindRef:t}=R();return{gracefulClosePrivyModal:FS(()=>{if(t?.current)t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},Du=({open:e})=>{let{app:t}=R(),{gracefulClosePrivyModal:r}=zS(),[o,n]=HS(!1);lp({onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||n(!0)}});let i=e||o;return t.render.standalone?ct(Lu,{children:ct(I0,{id:"privy-modal-content",children:ct(_0,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})}):ct(S0,{open:i,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:ct(Lu,{children:ct(qS,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})})},I0=k0.div`
3243
3243
  display: flex;
3244
3244
  flex-direction: column;
3245
3245
  text-align: center;
@@ -3248,7 +3248,7 @@ You will have to sign up with another method first to register a passkey for you
3248
3248
  width: 100%;
3249
3249
  background: var(--privy-color-background);
3250
3250
  padding: 0 16px;
3251
- `,KS=S0(P0)`
3251
+ `,KS=k0(I0)`
3252
3252
  transition: height 150ms ease-out;
3253
3253
  overflow: hidden;
3254
3254
 
@@ -3262,4 +3262,4 @@ You will have to sign up with another method first to register a passkey for you
3262
3262
  box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
3263
3263
  border-radius: var(--privy-border-radius-lg);
3264
3264
  }
3265
- `;import{useRef as x0,useEffect as YS}from"react";import{jsx as XS}from"react/jsx-runtime";function QS({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 R0(e){let t=x0(null),r=x0();return YS(()=>{r.current?.remove(),r.current=QS(e),t.current?.after(r.current)},[e]),XS("div",{ref:t,hidden:!0})}import{useState as ZS}from"react";import{useEffect as k0,useRef as _0}from"react";var Nd=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:create-additional":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 Nn(e,t,r,o,n,i=!1){let a=i,l=async u=>{if(a&&t&&t.length>0){u===(i?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new Oe("missing_or_invalid_mfa","MFA verification failed, retry."));let m=await new Promise((f,g)=>{r.current={resolve:f,reject:g};let v=1e3*60*5;setTimeout(()=>{let C=new Oe("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(C),g(C)},v)});return await e(m)}return await e()},s=4,d=null;for(let u=0;u<s;u++)try{d=await l(u),o.current?.resolve(void 0);break}catch(m){if(m.type==="missing_or_invalid_mfa")a=!0;else throw o.current?.resolve(void 0),m}if(d===null){let u=new Oe("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(u),u}return d}import{jsx as rA}from"react/jsx-runtime";var JS=function(e){return()=>`id-${e++}`}(0);function jS(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function ut(e){return e.error!==void 0}var ct=new Nd,Iu=new Map,$S=(e,t)=>typeof t=="bigint"?t.toString():t,eA=(e,t)=>`${e}${JSON.stringify(t,$S)}`;function mt(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let i=eA(e,t);if(e==="privy:wallet:create"){let l=Iu.get(i);if(l)return l}let a=new Promise((l,s)=>{let d=JS();ct.enqueue(d,{resolve:l,reject:s}),n.postMessage({id:d,event:e,data:t},o)}).finally(()=>{Iu.delete(i)});return Iu.set(i,a),a}function tA(e){switch(e.event){case"privy:iframe:ready":let t=ct.dequeue(e.event,e.id);return ut(e)?t.reject(new Oe(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=ct.dequeue(e.event,e.id);return ut(e)?r.reject(new Oe(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:create-additional":let o=ct.dequeue(e.event,e.id);return ut(e)?o.reject(new Oe(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:import":let n=ct.dequeue(e.event,e.id);return ut(e)?n.reject(new Oe(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:connect":let i=ct.dequeue(e.event,e.id);return ut(e)?i.reject(new Oe(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:recover":let a=ct.dequeue(e.event,e.id);return ut(e)?a.reject(new Oe(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:rpc":let l=ct.dequeue(e.event,e.id);return ut(e)?l.reject(new Oe(e.error.type,e.error.message)):l.resolve(e.data);case"privy:wallet:set-recovery":let s=ct.dequeue(e.event,e.id);return ut(e)?s.reject(new Oe(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:verify":let d=ct.dequeue(e.event,e.id);return ut(e)?d.reject(new Oe(e.error.type,e.error.message)):d.resolve(e.data);case"privy:mfa:init-enrollment":{let g=ct.dequeue(e.event,e.id);return ut(e)?g.reject(new Oe(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:mfa:submit-enrollment":{let g=ct.dequeue(e.event,e.id);return ut(e)?g.reject(new Oe(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:mfa:unenroll":{let g=ct.dequeue(e.event,e.id);return ut(e)?g.reject(new Oe(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:mfa:clear":{let g=ct.dequeue(e.event,e.id);return ut(e)?g.reject(new Oe(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:farcaster:init-signer":{let g=ct.dequeue(e.event,e.id);return ut(e)?g.reject(new Oe(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:farcaster:sign":{let g=ct.dequeue(e.event,e.id);return ut(e)?g.reject(new Oe(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:solana-wallet:create":let u=ct.dequeue(e.event,e.id);return ut(e)?u.reject(new Oe(e.error.type,e.error.message)):u.resolve(e.data);case"privy:solana-wallet:connect":let m=ct.dequeue(e.event,e.id);return ut(e)?m.reject(new Oe(e.error.type,e.error.message)):m.resolve(e.data);case"privy:solana-wallet:recover":let f=ct.dequeue(e.event,e.id);return ut(e)?f.reject(new Oe(e.error.type,e.error.message)):f.resolve(e.data);case"privy:solana-wallet:rpc":{let g=ct.dequeue(e.event,e.id);return ut(e)?g.reject(new Oe(e.error.type,e.error.message)):g.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function M0(e){let t=_0(null),r=_0(e.mfaMethods),o=Ri(),[n,i]=ZS(!1);return k0(()=>{r.current=e.mfaMethods},[e.mfaMethods]),k0(()=>{if(!n)return;let a=t.current;if(!a)return;function l(f){f&&f.origin===e.origin&&jS(f.data)&&tA(f.data)}let s={create(f){return mt("privy:wallet:create",f,a,e.origin)},createAdditional(f){return mt("privy:wallet:create-additional",f,a,e.origin)},import(f){return mt("privy:wallet:import",f,a,e.origin)},connect(f){return mt("privy:wallet:connect",f,a,e.origin)},recover(f){return Nn(g=>mt("privy:wallet:recover",{...f,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!f.recoveryMethod||f.recoveryMethod==="privy")},rpc(f){return Nn(g=>mt("privy:wallet:rpc",{...f,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},createSolana(f){return mt("privy:solana-wallet:create",f,a,e.origin)},connectSolana(f){return mt("privy:solana-wallet:connect",f,a,e.origin)},recoverSolana(f){return mt("privy:solana-wallet:recover",f,a,e.origin)},rpcSolana(f){return mt("privy:solana-wallet:rpc",f,a,e.origin)},setRecovery(f){return Nn(g=>mt("privy:wallet:set-recovery",{...f,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(f){return Nn(g=>mt("privy:mfa:verify",{...f,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(f){return Nn(g=>mt("privy:mfa:init-enrollment",{...f,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(f){return Nn(g=>mt("privy:mfa:submit-enrollment",{...f,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(f){return Nn(g=>mt("privy:mfa:unenroll",{...f,...g},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(f){return mt("privy:mfa:clear",f,a,e.origin)},initFarcasterSigner(f){return mt("privy:farcaster:init-signer",f,a,e.origin)},signFarcasterMessage(f){return mt("privy:farcaster:sign",f,a,e.origin)}};window.addEventListener("message",l);let d=()=>e.onLoad(s),u=(...f)=>{console.warn("Privy iframe failed to load: ",...f),e.onLoadFailed()},m=new AbortController;return Wa(()=>mt("privy:iframe:ready",{},a,e.origin),{abortSignal:m.signal}).then(d,u),()=>{window.removeEventListener("message",l),m.abort()}},[n]),rA("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>i(!0),src:js(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}var Od=class{constructor(t,r){this.walletProxy=t,this.address=r}async handleSignMessage(t){if(!t.params||typeof t.params.message!="string")throw new Error("Message must be provided as a string for Solana signMessage RPC");return await W0({message:t.params.message})}async request(t){if(console.debug("EmbeddedSolanaProvider.request() called with args",t),!await be())throw new Error("User must be authenticated to use embedded Solana wallet");if(!await I0())throw new w("Unable to connect to Solana embedded wallet");switch(t.method){case"signMessage":return await this.handleSignMessage(t);default:throw new Error("Embedded Solana provider does not yet support this RPC method.")}}};function Wu(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.")}async function L0({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",u)}let s,d=setInterval(()=>{t?.closed&&!s&&(l(),clearInterval(d),clearTimeout(a),n(new w("User rejected request")))},300);function u(m){m.data&&(m.data.type==="PRIVY_OAUTH_RESPONSE"&&m.data.stateCode&&m.data.authorizationCode&&(clearTimeout(a),o(m.data),l()),m.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(a),n(new w(m.data.error)),l()),m.data.type==="PRIVY_OAUTH_USE_BROADCAST_CHANNEL"&&(s=new BroadcastChannel("popup-privy-oauth"),s.onmessage=u))}window.addEventListener("message",u)})}var Lu={[Lr.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[ym.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[ho.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[fm.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[Nr.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[hm.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[Wr.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[um.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[nl.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[pm.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[Zr.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[dm.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"},N0=(e,t)=>e===Lu[t.id];var oA="https://cdn.apple-cloudkit.com";async function Nu({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===oA&&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 O0=e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type});import{jsx as Rr,jsxs as D0}from"react/jsx-runtime";var jo;function dA(e){return typeof e=="string"&&e.length===25}function be(){if(!jo){let e=J.get(Fn);return Promise.resolve(e||null)}return jo.getAccessToken()}var U0,Gf=(e,t,r)=>U0(e,t,r),F0,qf=(e,t,r)=>F0(e,t,r),B0,zf=(e,t,r,o)=>B0(e,t,r,o),H0,Kf=()=>H0(),V0,I0=()=>V0(),G0,W0=({message:e})=>G0({message:e}),pA=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;J.put(Na,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},uA=({config:e,...t})=>{if(typeof window<"u"&&["localhost","127.0.0.1"].indexOf(window.location.hostname)<0&&window.location.protocol!=="https:")throw new w("Embedded wallet is only available over HTTPS");if(!dA(t.appId))throw new w("Cannot initialize the Privy provider with an invalid Privy app ID");jo||(jo=new Za({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."),Rr(wm,{client:jo,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:Rr(mA,{...t,client:jo})})},mA=e=>{let t=e.client,[r,o]=dt(!1),[n,i]=dt(!1),[a,l]=dt(!1),[s,d]=dt(null),[u,m]=dt([]),[f,g]=dt(null),v=_a(u),[C,b]=dt(!1),[A,_]=dt(null),[S,P]=dt(!1),[E,k]=dt({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:pt}),[D,H]=dt({status:"initial"}),[M,X]=dt(null),W=Le(),Y=al(),[Ce,q]=dt(!0),[pe,Q]=dt({}),[ee,ue]=dt(null),[me,Te]=dt(null),[ce,Se]=dt(!1),[ft,tt]=dt(!1),[le,nt]=dt(W.customAuth?.enabled?{status:"initial"}:{status:"not-enabled"}),mr=_a(null),vt=_a(null),I=_a(Tm),[Ke,Qt]=dt(!1);t.onStoreToken=c=>{c&&O(I,"accessToken","onAccessTokenGranted",c)},t.onDeleteToken=()=>{d(null),l(!1),O(I,"accessToken","onAccessTokenRemoved")};let U=_a(null),B=_a(null),se=c=>{_(c),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:c}})},rt=c=>{W.embeddedWallets.createOnLogin!=="off"&&q(!0),se(c)};co(()=>{let c=Yn(s);if(!c||!M){g(null);return}let p={address:c.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:xi,id:"io.privy.solana.wallet"},getProvider:async()=>new Od(M,c.address)};g(p)},[M,s]),co(()=>{if(!s){t.connectors?.removeEmbeddedWalletConnectors();return}let c=Me(s),p=Jd(s),h=Wl(s);if((!c||!p.length)&&t.connectors?.removeEmbeddedWalletConnectors(),h||t.connectors?.removeImportedWalletConnector(),!t.connectors){console.debug("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!M){console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized");return}c&&t.connectors.addEmbeddedWalletConnectors({walletProxy:M,rootWallet:c,embeddedWallets:p,defaultChain:W.defaultChain,appId:e.appId}),h&&t.connectors.addImportedWalletConnector(M,h.address,W.defaultChain,e.appId)},[M,s]),co(()=>{M&&me?.(M)},[M]),co(()=>{(async()=>{if(!W.customAuth?.enabled){nt({status:"not-enabled"});return}q(!0),nt({status:"loading"});let{getCustomAccessToken:p,isLoading:h}=W.customAuth;if(!(!n||h))try{let y=await p();if(!y&&a){await Ti.logout(),nt({status:"done"}),O(I,"customAuth","onUnauthenticated");return}if(!y){nt({status:"done"});return}if(a){nt({status:"done"});return}t.startAuthFlow(new Ii(y));let{user:T,isNewUser:N}=await t.authenticate();if(!T){await Ti.logout(),nt({status:"error",error:new w("Failed to sync with custom auth provider")}),O(I,"customAuth","onUnauthenticated");return}N!==void 0&&O(I,"login","onComplete",T,N,!1,"custom",null),O(I,"customAuth","onAuthenticated",{user:T}),nt({status:"done"}),d(T||null),b(N||!1),l(!0),tt(!0)}catch(y){throw console.warn(y),a&&(await Ti.logout(),O(I,"customAuth","onUnauthenticated")),O(I,"login","onError",y.privyErrorCode||"unknown_auth_error"),nt({status:"error",error:y}),y}})()},[W.customAuth?.enabled,W.customAuth?.getCustomAccessToken,W.customAuth?.isLoading,n,a]),co(()=>{ft&&M&&s&&Et(s,W.embeddedWallets.createOnLogin)&&(tt(!1),Ma(s,Pi).catch(console.error))},[ft&&M&&s]),co(()=>{async function c(){let p=On(),h=bi();pA();let y=nA();t.initializeConnectorManager({walletConnectCloudProjectId:W.walletConnectCloudProjectId,rpcConfig:W.rpcConfig,chains:W.chains,defaultChain:W.defaultChain,store:y,walletList:W.appearance.walletList,shouldEnforceDefaultChainOnConnect:W.shouldEnforceDefaultChainOnConnect,externalWalletConfig:W.externalWallets,appName:W.name??"Privy"});let T;t.connectors?.on("connectorInitialized",()=>{T&&clearTimeout(T);let V=t.connectors.walletConnectors.length,re=t.connectors.walletConnectors.reduce((ie,de)=>ie+(de.initialized?1:0),0);re===V?Qt(!0):T=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:re,expected:V}),Qt(!0)},1500)}),t.connectors?.initialize().then(()=>{Oo()});let N=await t.getAuthenticatedUser(),z=!!N;if(W.customAuth?.enabled||(l(!!N),N&&O(I,"login","onComplete",N,!1,!0,null,null),d(N)),p){B.current=z?"link":"login";return}if(h&&!z){B.current="login",rt("TELEGRAM_AUTH_SCREEN");return}te.setReadyToTrue(!!N)}!n&&Y&&c()},[t,ee,n,Y]),co(()=>{if(!n)return;if(!s){Se(!0);return}if(!!!s.linkedAccounts.find(h=>h.type==="wallet"&&h.walletClientType==="privy")){Se(!0);return}let p=!!u.find(h=>h.walletClientType==="privy");Se(p)},[n,s,u]);let On=()=>{let c=za();if(c.inProgress&&c.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(c.authorizationCode==="error"){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."});return}window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:c.stateCode,authorizationCode:c.authorizationCode});return}let p="privy:";function h(y){return y.startsWith(p)}return c.inProgress&&h(c.provider)&&!c.popupFlow&&(new BroadcastChannel("popup-privy-oauth").postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:c.stateCode,authorizationCode:c.authorizationCode}),window.close()),!c.inProgress||c.headless?!1:(t.startAuthFlow(new go(c)),rt("AWAITING_OAUTH_SCREEN"),!0)},bi=()=>{let c=Ff();if(!c||!W.loginMethods.telegram||!W.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let p=new Oi;return t.startAuthFlow(p),c.flowType==="login-url"&&(p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult={id:c.id,first_name:c.first_name,last_name:c.last_name,auth_date:c.auth_date,username:c.username,photo_url:c.photo_url,hash:c.hash}),c.flowType==="web-app"&&(p.meta.telegramAuthResult=void 0,p.meta.telegramWebAppData={query_id:c.query_id,user:c.user,auth_date:c.auth_date,hash:c.hash,chat_instance:c.chat_instance,chat_type:c.chat_type,start_param:c.start_param}),!0},zs=async(c,p,h,y)=>{let T=await t.connectors?.createWalletConnector(c,p)||null;Xr(T,p,h,y)};async function Xr(c,p,h,y){if(c)k({status:"disconnected",connectedWallet:null,connectError:null,connector:c,connectRetry:pt});else return k({status:"disconnected",connectedWallet:null,connectError:new _e("Unable to connect to wallet."),connector:null,connectRetry:pt}),y?.(null,h);c instanceof jr&&p&&await c.resetConnection(p),k({connector:c,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Xr(c,p,h,y)});try{let T=await c.connect({showPrompt:!0});if(W.shouldEnforceDefaultChainOnConnect&&!W.chains.find(N=>N.id===Number(T?.chainId.replace("eip155:","")))&&!(T?.connectorType==="wallet_connect_v2"&&T?.walletClientType==="metamask")){k(N=>({...N,connector:c,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:pt}));try{await T?.switchChain(W.defaultChain.id),T&&(T.chainId=Ai(Un(W.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${W.defaultChain.id}`)}}return k(N=>({...N,status:"connected",connectedWallet:T,connectError:null,connectRetry:pt})),T&&O(I,"connectWallet","onSuccess",T),y?.(T,h)}catch(T){return T instanceof jt?(console.warn(T.cause?T.cause:T.message),O(I,"connectWallet","onError",T.privyErrorCode||"generic_connect_wallet_error")):(console.warn(T),O(I,"connectWallet","onError","unknown_connect_wallet_error")),k(N=>({...N,status:"disconnected",connectedWallet:null,connectError:T})),y?.(null,h)}}let wt=async(c,p)=>{if(c===null)return;let h=new Ho(c,t,p);t.startAuthFlow(h)},Oo=()=>{let c=new URLSearchParams(window.location.search),p=c.get("privy_connector"),h=c.get("privy_wallet_client");if(!p||!h)return;if(h==="phantom"&&!en()&&rt("LOGIN_FAILED_SCREEN"),!t.connectors)throw new w("Connector not initialized");se("AWAITING_CONNECTION");let y=new URL(window.location.href);y.searchParams.delete("privy_connector"),y.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",y),zs(p,h,void 0,wt)};co(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(d)},[n,a,s,t]);let Ue=c=>{if(!a)throw O(I,"linkAccount","onError","must_be_authenticated",{linkMethod:c}),new w("User must be authenticated before linking an account.")},Do=()=>{Ue("siwe"),U.current="siwe",B.current="link",se("LINK_WALLET_SCREEN")},Xt=c=>{if(!a||!s)return!1;if(c.walletClientType==="privy")return!0;for(let p of s.linkedAccounts)if(p.type==="wallet"&&p.address===c.address&&p.walletClientType!=="privy")return!0;return!1},po=async c=>{if(!t.connectors)throw new w("Connector not initialized");let p=t.connectors.findWalletConnector(c.connectorType,c.walletClientType)||null;if(k(h=>({...h,connector:p,status:"connected",connectedWallet:c,connectError:null,connectRetry:pt})),W.captchaEnabled&&!a){let h={callback:y=>wt(c,y),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};Q({captchaModalData:h}),rt("CAPTCHA_SCREEN")}else await wt(c),rt("AWAITING_CONNECTION")},Ei=async(c,p)=>{let{signedUrl:h,externalTransactionId:y}=await T1(t,c,p??{},W.appearance.palette,W.fundingMethodConfig?.moonpay.useSandbox??!1);return{signedUrl:h,externalTransactionId:y}},uo=()=>{m(c=>{let p=t.connectors?.wallets.map(h=>({...h,linked:Xt(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");po(h)},fund:async y=>{await te.fundWallet(h.address,y)},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 y=await t.unlinkWallet(h.address);d(y)}}))||[];return Nl(c,p)?c:p})};co(()=>{uo()},[s?.linkedAccounts,a,n]),co(()=>{if(n){if(!t.connectors)throw new w("Connector not initialized");uo(),t.connectors.on("walletsUpdated",uo)}},[n]);let Xe=c=>{c&&"target"in c&&c&&(c=void 0),Q({externalConnectWallet:{walletList:c?.walletList&&c?.walletList.length>0?c.walletList:void 0,suggestedAddress:c?.suggestedAddress}}),se(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};co(()=>{if(!u[0])return;let c=u[0],p=v.current.find(y=>y.address===c.address),h;if(c.walletClientType==="privy"?h=s?.linkedAccounts.find(y=>y.type==="wallet"&&y.address===c.address&&y.walletClientType==="privy"):h=s?.linkedAccounts.find(y=>y.type==="wallet"&&y.address===c.address&&y.walletClientType!=="privy"),!p&&h){let y=Object.assign({},s);y.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported,walletIndex:h.walletIndex},d(y)}v.current=u},[u]);let Ma=async(c,p,h)=>{let y=Me(c);if(y&&!h?.createAdditional)throw O(I,"createWallet","onError","embedded_wallet_already_exists"),new Error("User already has an embedded wallet.");let[T,N]=await Promise.all([te.initializeWalletProxy(p),be()]);if(!T&&W.customAuth?.enabled)throw O(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!T||!N||W.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((z,V)=>{q(!0),Q({createWallet:{onSuccess:ie=>{O(I,"createWallet","onSuccess",ie),z(ie)},onFailure:ie=>{O(I,"createWallet","onError","unknown_embedded_wallet_error"),V(ie)},callAuthOnSuccessOnClose:!1}}),se("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{if(!y)await T.create({accessToken:N});else{let re=Jd(c),de=(re?.length?Math.max(...re.map(ke=>ke.walletIndex)):y.walletIndex)+1;await te.recoverEmbeddedEthereumWallet(),await T.createAdditional({accessToken:N,primaryWalletAddress:y?.address,hdWalletIndex:de})}let z=await te.refreshUser(),V=Me(z);if(!V)throw O(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return O(I,"createWallet","onSuccess",V),V}},X0=c=>{if(!W.chains.map(p=>p.id).includes(c))throw new _e(`Chain ID ${c} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},Du=(c,p,h,y)=>new Promise(async(T,N)=>{let{requesterAppId:z}=p||{};if(!a||!s){O(I,"sendTransaction","onError","must_be_authenticated"),N(new Error("User must be authenticated before signing with a Privy wallet"));return}let V=y??Me(s)?.address;if(!V)throw new w("User must have an embedded wallet to send a transaction.");let{signingWallet:re,rootWallet:ie}=Ll(s,V);if(!ie||!re){O(I,"sendTransaction","onError","embedded_wallet_not_found"),N(new Error("Must have a Privy wallet before signing"));return}q(!0);let de=Hu.wallets.find(Jt=>Jt.walletClientType==="privy"&&wi(Jt.address)===wi(re.address)),ke=await de?.getEthereumProvider();if(!de||!ke)throw new w(`Cannot sendTransaction before embedded wallet ${re.address} is connected`);let $o=c.chainId?Number(c.chainId):Wu(de.chainId);X0($o);let kr=Object.assign({},c,{chainId:$o}),_r=async()=>{let Jt=await be();if(!Jt||!M){O(I,"sendTransaction","onError","embedded_wallet_not_found"),N(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await te.recoverEmbeddedEthereumWallet()){O(I,"sendTransaction","onError","unknown_connect_wallet_error"),N(new Error("Unable to connect to wallet"));return}let Si=Ir(kr.chainId,W.chains,W.rpcConfig,{appId:e.appId}),mo=await cA(re.address,kr,Si);if(W.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:Z0}=await lA(mo,Si),{hasSufficientFunds:J0}=await _d(re.address,mo,Z0,Si);if(!J0)throw new Tt(new Dr("Wallet has insufficient funds for this transaction.",sA.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let Vu=await kd({accessToken:Jt,rootWallet:ie,transactingWallet:re,walletProxy:M,transactionRequest:mo,provider:Si,requesterAppId:z});O(I,"sendTransaction","onSuccess",Vu),T(Vu)}catch(Qs){O(I,"sendTransaction","onError","transaction_failure"),N(Qs)}};if(W.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),_r();else{let Jt={transactionRequest:kr,transactingWallet:re,rootWallet:ie,onSuccess:mo=>{O(I,"sendTransaction","onSuccess",mo),T(mo)},onFailure:mo=>{O(I,"sendTransaction","onError","transaction_failure"),N(mo)},uiOptions:p||{},fundWalletConfig:h,requesterAppId:z},Qs={address:ie.address,onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:mo=>{O(I,"sendTransaction","onError","unknown_connect_wallet_error"),N(mo)}},Si=Fu({address:re.address,fundWalletConfig:h,chainIdOverride:kr.chainId,comingFromSendTransactionScreen:!0});Q({connectWallet:Qs,sendTransaction:Jt,funding:Si}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function Uu(){return new Promise(async(c,p)=>{let h=await be();if(!h||!M)throw new Error("Must have valid access token to enroll in MFA");try{await M.verifyMfa({accessToken:h}),c()}catch(y){p(y)}})}let Ks=c=>c?.linkedAccounts.filter(p=>p.latestVerifiedAt!==null&&!(p.type==="wallet"&&p.walletClientType==="privy")).sort((p,h)=>h.latestVerifiedAt.getTime()-p.latestVerifiedAt.getTime())[0],Zt=c=>{let p=s?.linkedAccounts.filter(T=>T.type===c).length??0,{displayName:h,loginMethod:y}=Tn(c);if(c==="passkey"&&p>=5||c!=="passkey"&&p>=1)throw O(I,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:y}),new w(`User already has an account of type ${h} linked.`)},Fu=({address:c,fundWalletConfig:p,methodScreen:h,chainIdOverride:y=null,comingFromSendTransactionScreen:T=!1})=>{if(!W.fundingConfig||W.fundingConfig.methods.length===0)return;let N,z,V,re,ie=!1;if(E1(p)&&p.chain){if(N=p.chain.id,z=p.chain,V=p.amount??W.fundingConfig.defaultRecommendedAmount,"asset"in p)if(p.asset==="USDC"){let de=Lu[N];W.fundingConfig.methods.includes("external")&&!de&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),re=de,ie=!0}else typeof p.asset!="string"&&"erc20"in p.asset&&(re=p.asset.erc20,ie=N0(re,p.chain))}else N=Wu(W.fundingConfig.defaultRecommendedCurrency.chain),z=W.chains.find(de=>de.id===N),V=W.fundingConfig.defaultRecommendedAmount;if(y&&W.chains.find(de=>de.id===y)&&(z=W.chains.find(de=>de.id===y)),!z)throw new w("Funding chain is not in PrivyProvider chains list");return{address:c,amount:V,chain:z,erc20Address:re,erc20ContractInfo:ie?{symbol:"USDC",decimals:6}:void 0,isUSDC:ie,methodScreen:h,comingFromSendTransactionScreen:T,...b1(p)?{moonpayConfigOverride:p.config}:{}}};async function Bu({showAutomaticRecovery:c=!1,legacySetWalletPasswordFlow:p=!1}){_(null);let h=p?"setWalletPassword":"setWalletRecovery";if(!a||!s)throw O(I,h,"onError","must_be_authenticated"),new Error("User must be authenticated before adding recovery method to Privy wallet");let y=Me(s);if(!y||!M)throw O(I,h,"onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a recovery method");if(Yn(s))throw new Error("Cannot set user-controlled recovery for user with Solana.");try{await Uu()}catch(N){throw O(I,h,"onError","missing_or_invalid_mfa"),N}return new Promise((N,z)=>{q(!0);let V={onSuccess:ke=>{O(I,h,"onSuccess","user-passcode",ke),N(ke)},onFailure:ke=>{O(I,h,"onError","user_exited_set_password_flow"),z(ke)},callAuthOnSuccessOnClose:!1},re=y.recoveryMethod==="user-passcode",de={onCompleteNavigateTo:hc({walletAction:"update",availableRecoveryMethods:W.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:p,isResettingPassword:re,showAutomaticRecovery:c}),shouldForceMFA:!1,onFailure:ke=>{O(I,h,"onError","unknown_connect_wallet_error"),z(ke)}};Q({setWalletPassword:V,createWallet:V,connectWallet:de,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:re}}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")})}async function Ys({appId:c,action:p}){let h=await be();if(p==="link"&&!h)throw O(I,"linkAccount","onError","must_be_authenticated",{linkMethod:`privy:${c}`}),new w("User must be authenticated before linking an account.");if(p==="login"&&h)throw O(I,"login","onError","unknown_auth_error"),new w("Attempted to log in, but user is already logged in. Use a `link` helper instead.");U.current=`privy:${c}`,B.current=p;let y=window.open(void 0,void 0,bs({w:440,h:680}));return t.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:c}}),new Promise(async(T,N)=>{let{name:z,logoUrl:V}=await Vc({api:t.api,providerAppId:c,requesterAppId:W.id});Q({crossAppAuth:{appId:c,name:z,logoUrl:V,action:p,popup:y,onSuccess:T,onError:N}}),rt("CROSS_APP_AUTH_SCREEN")})}let Ti={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:Xe,importWallet:async({privateKey:c})=>{Ue("siwe");let[p,h]=await Promise.all([te.initializeWalletProxy(15e3),be()]);if(p&&h){await p.import({privateKey:c,accessToken:h});let y=await te.refreshUser(),T=Wl(y);if(!T)throw O(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to import wallet");return O(I,"createWallet","onSuccess",T),T}else throw new w("User is not authenticated")},linkWallet:Do,startCrossAppAuthFlow:Ys,linkEmail:()=>{Ue("email"),Zt("email"),U.current="email",B.current="link",se("LINK_EMAIL_SCREEN")},linkPhone:()=>{Ue("sms"),Zt("phone"),U.current="sms",B.current="link",se("LINK_PHONE_SCREEN")},linkGoogle:async()=>{Ue("google"),Zt("google_oauth"),B.current="link",await te.initLoginWithOAuth("google")},linkTwitter:async()=>{Ue("twitter"),Zt("twitter_oauth"),B.current="link",await te.initLoginWithOAuth("twitter")},linkDiscord:async()=>{Ue("discord"),Zt("discord_oauth"),B.current="link",await te.initLoginWithOAuth("discord")},linkGithub:async()=>{Ue("github"),Zt("github_oauth"),B.current="link",await te.initLoginWithOAuth("github")},linkSpotify:async()=>{Ue("spotify"),Zt("spotify_oauth"),B.current="link",await te.initLoginWithOAuth("spotify")},linkInstagram:async()=>{Ue("instagram"),Zt("instagram_oauth"),B.current="link",await te.initLoginWithOAuth("instagram")},linkTiktok:async()=>{Ue("tiktok"),Zt("tiktok_oauth"),B.current="link",await te.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{Ue("linkedin"),Zt("linkedin_oauth"),B.current="link",await te.initLoginWithOAuth("linkedin")},linkApple:async()=>{Ue("apple"),Zt("apple_oauth"),B.current="link",await te.initLoginWithOAuth("apple")},linkPasskey:async()=>{Ue("passkey"),Zt("passkey"),await te.initLinkWithPasskey(),se("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{Ue("telegram"),Zt("telegram"),B.current="link",U.current="telegram",await te.initLoginWithTelegram(),se("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{Ue("farcaster"),Zt("farcaster"),await te.initLoginWithFarcaster(),B.current="link",U.current="farcaster",se("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(Ue("email"),!s?.email)throw new w("User does not have an email linked to their account.");B.current="link",U.current="email",se("UPDATE_EMAIL_SCREEN")},updatePhone:()=>{if(Ue("sms"),!s?.phone)throw new w("User does not have a phone number linked to their account.");B.current="link",U.current="sms",se("UPDATE_PHONE_SCREEN")},login:async c=>{c&&"target"in c&&c&&(c=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(y=>{ue(T=>y.bind(T))});if(ue(null),h){console.warn(p);return}}if(s&&!s.isGuest){console.warn(p);return}B.current="login",Q({login:c}),rt("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(c=>{ue(()=>c)}),ue(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}rt("CONNECT_OR_CREATE")},logout:async()=>{if(s&&t.clearProviderAcccessTokens(s),_(null),await t.logout(),s&&M)try{await M.clearMfa({userId:s.id})}catch{}d(null),l(!1),O(I,"logout","onSuccess"),B.current=null,U.current=null,o(!1),J.del(Oa),J.del(rl(W.id))},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new Ze;let c=u.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(y=>y.address===c?.address));return!c||!p?new Ze:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new Ou(new vo(new Ze));let c=u.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(y=>y.address===c?.address));return!c||!p?new Ou(new vo(new Ze)):new Ou(new vo(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new nn(new Ze);let c=u.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(y=>y.address===c?.address));return!c||!p?new nn(new Ze):new nn(p.proxyProvider)},unlinkWallet:async c=>{let p=await t.unlinkWallet(c);return d(p),p},unlinkEmail:async c=>{let p=await t.unlinkEmail(c);return d(p),p},unlinkPhone:async c=>{let p=await t.unlinkPhone(c);return d(p),p},unlinkGoogle:async c=>{let p=await t.unlinkOAuth("google",c);return d(p),p},unlinkTwitter:async c=>{let p=await t.unlinkOAuth("twitter",c);return d(p),p},unlinkDiscord:async c=>{let p=await t.unlinkOAuth("discord",c);return d(p),p},unlinkGithub:async c=>{let p=await t.unlinkOAuth("github",c);return d(p),p},unlinkSpotify:async c=>{let p=await t.unlinkOAuth("spotify",c);return d(p),p},unlinkInstagram:async c=>{let p=await t.unlinkOAuth("instagram",c);return d(p),p},unlinkTiktok:async c=>{let p=await t.unlinkOAuth("tiktok",c);return d(p),p},unlinkLinkedIn:async c=>{let p=await t.unlinkOAuth("linkedin",c);return d(p),p},unlinkApple:async c=>{let p=await t.unlinkOAuth("apple",c);return d(p),p},unlinkFarcaster:async c=>{let p=await t.unlinkFarcaster(c);return d(p),p},unlinkTelegram:async c=>{let p=await t.unlinkTelegram(c);return d(p),p},unlinkPasskey:async c=>{let p=await t.unlinkPasskey(c);return d(p),p},unlinkCrossAppAccount:async({subject:c})=>{let p=s?.linkedAccounts.find(y=>y.type==="cross_app"&&y.subject===c)?.providerApp;if(!p)throw new w("Invalid subject");t.storeProviderAccessToken(p.id,null);let h=await t.unlinkOAuth(`privy:${p.id}`,c);return d(h),h},setActiveWallet:async c=>{let p=u.find(y=>wi(y.address)===wi(c)),h=s?.linkedAccounts.find(y=>y.type==="wallet"&&wi(y.address)===wi(c));if(!p||!await p.isConnected())Q({externalConnectWallet:{suggestedAddress:c}}),Do();else if(!p.linked)p.loginOrLink();else{let y=Object.assign({},s);y.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported,walletIndex:h.walletIndex},d(y)}},forkSession:()=>t.forkSession(),createWallet:async c=>{if(c&&"target"in c&&c&&(c=void 0),!a||!s)throw O(I,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return Ma(s,15e3,c)},setWalletRecovery:async c=>Bu({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:c?.showAutomaticRecovery??!1}),setWalletPassword:async()=>Bu({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(c,p,h)=>new Promise(async(y,T)=>{let{requesterAppId:N}=p||{};if(!a||!s){O(I,"signMessage","onError","must_be_authenticated"),T(new Error("User must be authenticated before signing with a Privy wallet"));return}let z=h??Me(s)?.address;if(!z)throw new w("User must have an embedded wallet to sign a message.");let{signingWallet:V,rootWallet:re}=Ll(s,z);if(!V||!re){O(I,"signMessage","onError","embedded_wallet_not_found"),T(new Error("Must have a Privy wallet before signing"));return}if(typeof c!="string"||c.length<1){O(I,"signMessage","onError","invalid_message"),T(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 de=await be();if(!M||!de)throw new Error("Unable to connect to wallet");if(!await te.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:V.address,requesterAppId:N}});let{response:$o}=await M.rpc({accessToken:de,address:re.address,hdWalletIndex:V.walletIndex??void 0,requesterAppId:N,request:{method:"personal_sign",params:[c,V.address]}}),kr=$o.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:V.address,requesterAppId:N}}),kr};if(W.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let de=await ie();O(I,"signMessage","onSuccess",de),y(de)}catch(de){O(I,"signMessage","onError","unable_to_sign"),T(de??new Tt("Unable to sign message"))}}else{let $o={method:"personal_sign",data:c,confirmAndSign:ie,onSuccess:_r=>{O(I,"signMessage","onSuccess",_r),y(_r)},onFailure:_r=>{O(I,"signMessage","onError","unable_to_sign"),T(_r)},uiOptions:p||{}},kr={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:_r=>{O(I,"signMessage","onError","unknown_connect_wallet_error"),T(_r)},address:re.address};Q({signMessage:$o,connectWallet:kr}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(c,p,h)=>new Promise(async(y,T)=>{let{requesterAppId:N}=p||{};if(!a||!s){O(I,"signTypedData","onError","must_be_authenticated"),T(new Error("User must be authenticated before signing with a Privy wallet"));return}let z=h??Me(s)?.address;if(!z)throw new w("User must have an embedded wallet to sign a message.");let{signingWallet:V,rootWallet:re}=Ll(s,z);if(!re||!V){O(I,"signTypedData","onError","embedded_wallet_not_found"),T(new Error("Must have a Privy wallet before signing"));return}q(!0);let ie=La(c),de=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let ke=await be();if(!M||!ke)throw new Error("Unable to connect to wallet");if(!await te.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:V.address,requesterAppId:N}});let{response:kr}=await M.rpc({accessToken:ke,address:re.address,hdWalletIndex:V.walletIndex??void 0,requesterAppId:N,request:{method:"eth_signTypedData_v4",params:[V.address,ie]}}),_r=kr.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:V.address,requesterAppId:N}}),_r};if(W.embeddedWallets.noPromptOnSignature||(W.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let ke=await de();O(I,"signTypedData","onSuccess",ke),y(ke)}catch(ke){O(I,"signTypedData","onError","unable_to_sign"),T(ke??new Tt("Unable to sign message"))}}else{let kr={method:"eth_signTypedData_v4",data:ie,confirmAndSign:de,onSuccess:Jt=>{O(I,"signTypedData","onSuccess",Jt),y(Jt)},onFailure:Jt=>{O(I,"signTypedData","onError","unable_to_sign"),T(Jt)},uiOptions:p||{}},_r={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Jt=>{O(I,"signMessage","onError","unknown_connect_wallet_error"),T(Jt)}};Q({signMessage:kr,connectWallet:_r}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(c,p,h,y)=>{let N=await(await Du(c,p,h,y)).wait();return Md(N)},exportWallet:c=>new Promise(async(p,h)=>{if(!a||!s){h(new Error("User must be authenticated before exporting their Privy wallet"));return}c&&"target"in c&&c&&(c=void 0);let y=c?.address,T=s.linkedAccounts.filter(ie=>ie.type==="wallet"&&ie.walletClientType==="privy"&&ie.chainType==="ethereum"),N=y?T.find(ie=>ie.address===wi(y)):T.find(ie=>!ie.imported)||T[0];if(!N){h(new Error("Must have a Privy wallet before exporting"));return}q(!0);let z={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:h,address:N.address,shouldForceMFA:!0};if(Q(pe),!await be()||!M){h(new Error("Must have valid access token to enroll in MFA"));return}if(!M){h(new Error("Must have a Privy wallet before exporting"));return}let re={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:N,onSuccess:p,onFailure:h};Q({keyExport:re,connectWallet:z}),se("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:Uu,async init(c){switch(c){case"sms":await t.initMfaSmsVerification();return;case"passkey":return await t.initMfaPasskeyVerification();case"totp":return;default:throw new Error(`Unsupported MFA method: ${c}`)}},async submit(c,p){switch(c){case"totp":case"sms":if(typeof p!="string")throw new w("Invalid MFA code");mr.current?.resolve({mfaMethod:c,mfaCode:p,relyingParty:window.origin}),await new Promise((N,z)=>{vt.current={resolve:N,reject:z}});break;case"passkey":if(typeof p=="string")throw new w("Invalid authenticator response");let y=await(await import("@simplewebauthn/browser")).startAuthentication(p),T=O0(y);mr.current?.resolve({mfaMethod:c,mfaCode:T,relyingParty:window.origin}),await new Promise((N,z)=>{vt.current={resolve:N,reject:z}});break;default:throw mr.current?.reject(new w("Unsupported MFA method")),new w(`Unsupported MFA method: ${c}`)}},cancel(){mr.current?.reject(new w("MFA canceled"))},async initEnrollmentWithSms(c){let p=await be();if(!p||!M)throw new Error("Must have valid access token to enroll in MFA");await M.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:c.phoneNumber})},enrollInMfa(c){return new Promise((p,h)=>{if(!c){te.closePrivyModal(),p();return}W.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."),Q({mfaEnrollmentFlow:{mfaMethods:W.mfa.methods,onSuccess:p,onFailure:h}}),se("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let c=await be();if(!c||!M)throw new Error("Must have valid access token to enroll in MFA");let p=await M.initEnrollMfa({method:"totp",accessToken:c});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(c){let p=await be();if(!p||!M)throw new Error("Must have valid access token to enroll in MFA");await M.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:c.phoneNumber,code:c.mfaCode});let h=await t.getAuthenticatedUser();d(h)},async submitEnrollmentWithTotp(c){let p=await be();if(!p||!M)throw new Error("Must have valid access token to enroll in MFA");await M.submitEnrollMfa({method:"totp",accessToken:p,code:c.mfaCode});let h=await t.getAuthenticatedUser();d(h)},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:c}){let p=await be();if(!p||!M)throw new Error("Must have valid access token to enroll in MFA");await M.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:c});let h=await t.getAuthenticatedUser();d(h)},async unenroll(c){let p=await be();if(!p||!M)throw new Error("Must have valid access token to remove MFA");c==="passkey"?await M.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:[]}):await M.unenrollMfa({method:c,accessToken:p});let h=await t.getAuthenticatedUser();d(h)},requestFarcasterSignerFromWarpcast:async()=>{let c=await be(),p=s?.linkedAccounts.find(T=>T.type==="wallet"&&T.walletClientType==="privy");if(!c)throw new Error("Must have valid access token to connect with Farcaster");if(!M||!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 te.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");let y=await M.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:c,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(y.status==="approved"){let T=await t.getAuthenticatedUser();d(T||s||null)}Q({farcasterSigner:y}),se("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let c=await be(),p=s?.linkedAccounts.find(T=>T.type==="wallet"&&T.walletClientType==="privy");if(!c)throw new Error("Must have valid access token to connect with Farcaster");if(!M||!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 te.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(T=>Uint8Array.from(T.match(/.{1,2}/g).map(N=>parseInt(N,16))))(s.farcaster.signerPublicKey.slice(2))},signFarcasterMessage:async c=>{let p=await be(),h=s?.linkedAccounts.find(z=>z.type==="wallet"&&z.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!M||!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 te.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 T=await import("@simplewebauthn/browser"),N=await M.signFarcasterMessage({address:h.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{hash:T.bufferToBase64URLString(c)},fid:BigInt(s.farcaster.fid),relyingParty:window.origin});return new Uint8Array(T.base64URLStringToBuffer(N.signature))},createGuestAccount:async()=>{if(s&&!s.isGuest)throw new Error("User cannot already be authenticated to create a guest account");return s?.isGuest?s:te.loginWithGuestAccountFlow()},isHeadlessOAuthLoading:S,loginWithCode(c){return te.loginWithCode(c)},initLoginWithEmail(c){return te.initLoginWithEmail(c)},initLoginWithSms(c){return te.initLoginWithSms(c)},otpState:D,fundWallet(c,p){return te.fundWallet(c,p)},initLoginWithHeadlessOAuth(c,p){return te.initLoginWithHeadlessOAuth(c,p)},loginWithHeadlessOAuth(c){return te.loginWithHeadlessOAuth(c)},generateSiweMessage({address:c,chainId:p}){return te.generateSiweMessage({address:c,chainId:p})},linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:y,connectorType:T}){return Ue("siwe"),te.linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:y,connectorType:T})},signMessageWithCrossAppWallet(c,{address:p}){return Gc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"personal_sign",params:[c,p]},reconnect:Ys})},signTypedDataWithCrossAppWallet(c,{address:p}){let h=La(c);return Gc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"eth_signTypedData_v4",params:[p,h]},reconnect:Ys})},sendTransactionWithCrossAppWallet(c,{address:p}){return Gc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"eth_sendTransaction",params:[c]},reconnect:Ys})},setCustomMetadata(c){return te.setCustomMetadataForUser(c)},isModalOpen:r,mfaMethods:W.mfa.methods};U0=Ti.signMessage,F0=Ti.signTypedData,B0=async(...c)=>{let p=await Du(...c);return W.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let te=(()=>({isNewUserThisSession:C,pendingTransaction:null,walletConnectionStatus:E,connectors:t.connectors?.walletConnectors??[],rpcConfig:W.rpcConfig,chains:W.chains,appId:e.appId,showFiatPrices:W.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,customAuthStatus:le,nativeTokenSymbolForChainId:c=>W.chains.find(p=>p.id===Number(c))?.nativeCurrency.symbol,initializeWalletProxy:async c=>{if(M)return M;let p=new Promise(T=>{Te(()=>N=>T(N))}),h=new Promise(T=>setTimeout(()=>T(null),c)),y=await Promise.race([p,h]);return Te(null),y},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:async(c={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s,h;p&&U.current&&(h=Ks(s)),B.current==="login"?c.shouldCallAuthOnSuccess&&p&&U.current?(O(I,"login","onComplete",s,C,!1,U.current,h??null),e.onSuccess?.(s,C)):O(I,"login","onError","exited_auth_flow"):B.current==="link"&&h&&(c.isSuccess&&p&&U.current?O(I,"linkAccount","onSuccess",s,U.current,h):U.current&&O(I,"linkAccount","onError","exited_link_flow",{linkMethod:U.current}));let y=A&&bu.includes(A),T=A==="ERROR_SCREEN"&&pe.errorModalData&&bu.includes(pe.errorModalData.previousScreen);if((y||T)&&pe.funding){let N=D3[A]??null,z=Ir(pe.funding.chain.id,W.chains,W.rpcConfig,{appId:e.appId}),V;try{V=(await z.getBalance(pe.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}O(I,"fundWallet","onUserExited",{address:pe.funding.address,chain:pe.funding.chain,fundingMethod:N,balance:V})}Q({...pe,externalConnectWallet:{suggestedAddress:void 0}}),B.current=null,U.current=null,b(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:async({message:c})=>new Promise(async(p,h)=>{let y=async()=>{let T=await t.getAccessToken();if(!T)throw new Error("User must be authenticated to use their embedded wallet.");if(!f)throw new Error("User must have an embedded Solana wallet to sign messages for Solana.");let N=te.walletProxy??await te.initializeWalletProxy(15e3);if(!N)throw new Error("Failed to initialize embedded wallet proxy.");let{response:z}=await N.rpcSolana({accessToken:T,publicKey:f.address,request:{method:"signMessage",params:{message:c}}});return z.data.signature};if(W.embeddedWallets.noPromptOnSignature)try{let T=await y();p({signature:T})}catch(T){h(T)}else Q({signMessage:{method:"solana_signMessage",data:c,confirmAndSign:y,onSuccess:V=>{p({signature:V})},onFailure:V=>{h(V)},uiOptions:{}}}),rt("EMBEDDED_WALLET_SIGN_REQUEST_SCREEN")}),openPrivyModal:se,connectWallet:Xr,initLoginWithWallet:async(c,p)=>{U.current="siwe",wt(c,p)},loginWithWallet:async()=>{if(!n)throw new Dn;if(!(t.authFlow instanceof Ho))throw new w("Must initialize SIWE flow first.");let c=await t.getAccessToken(),p,h;if(c!==null)try{({user:p}=await t.link()),U.current="siwe"}catch(y){throw O(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),y}else try{({user:p,isNewUser:h}=await t.authenticate()),U.current="siwe"}catch(y){throw O(I,"login","onError",y.privyErrorCode||"generic_connect_wallet_error"),y}d(p||s||null),b(h||!1),l(!0)},initLoginWithFarcaster:async c=>{let p=new Ha(c);t.startAuthFlow(p);try{U.current="farcaster",await p.initializeFarcasterConnect()}catch(h){throw B.current==="login"?O(I,"login","onError",h.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(I,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"farcaster"}),h}},loginWithFarcaster:async()=>{if(!n)throw new Dn;if(!(t.authFlow instanceof Ha))throw new w("Must initialize Farcaster flow first.");let c=await t.getAccessToken(),p,h;if(c!==null)try{({user:p}=await t.link()),U.current="farcaster"}catch(y){throw O(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"farcaster"}),y}else try{({user:p,isNewUser:h}=await t.authenticate()),U.current="farcaster"}catch(y){throw O(I,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}d(p||null),b(h||!1),l(!0)},async loginWithGuestAccountFlow(){let c=new Wi(this.appId);t.startAuthFlow(c);try{B.current="login",U.current="guest";let p=await t.authenticate(),{user:h,isNewUser:y}=p;if(y=y||!1,!h)throw new w("Unable to authenticate guest account");if(Et(h,W.embeddedWallets.createOnLogin))try{await Ma(h,15e3),h=await te.refreshUser()}catch{d(h),console.warn("Unable to create embedded wallet for guest account")}else d(h);return b(y),l(!0),O(I,"login","onComplete",h,y,!1,"guest",null),h}catch(p){throw O(I,"login","onError",p.privyErrorCode||"unknown_auth_error"),p}},async crossAppAuthFlow({appId:c,popup:p,action:h}){let y=`privy:${c}`;U.current=y;let{url:T,stateCode:N,codeVerifier:z}=await s1({api:t.api,appId:c});if(!T)throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:c}}),new w("No authorization URL returned for cross-app auth.");try{let V=await L0({url:T,popup:p,provider:y}),re=V.stateCode,ie=V.authorizationCode;if(re!==N)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:y,storedStateCode:N??"",returnedStateCode:re??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let de=await l1({appId:c,codeVerifier:z,stateCode:re,authorizationCode:ie,action:h,client:t});de&&t.storeProviderAccessToken(c,de);let ke=await te.refreshUser();if(!ke)throw new w("Unable to update user");return t.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:c}}),ke}catch(V){throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:V.toString(),provider:y}}),V}},async initLoginWithOAuth(c,p){if(U.current=c,Ia()){if(c==="google"&&$i(window.navigator.userAgent)){rt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{rt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}c==="twitter"&&window.opener&&window.opener.postMessage({type:"PRIVY_OAUTH_USE_BROADCAST_CHANNEL"},"*"),J.del(Vn);let h=new go({provider:c});p&&h.addCaptchaToken(p),t.startAuthFlow(h);let y=await t.authFlow.getAuthorizationUrl();y&&y.url&&(c==="twitter"&&aA&&(y.url=y.url.replace("x.com","twitter.com")),window.location.assign(y.url))},async initLoginWithTelegram(c){if(!n)throw new Dn;U.current="telegram";let p=new Oi(c);t.startAuthFlow(p),p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult=await new Promise((h,y)=>{if(!W.loginConfig.telegramAuthConfiguration)return y(new w("Telegram Auth configuration is not loaded"));if(!window.Telegram)return y(new w("Telegram was not initialized"));window.Telegram.Login.auth({bot_id:W.loginConfig.telegramAuthConfiguration.botId,request_access:!0},T=>T?h(T):y(new w("Telegram auth failed or was canceled by the client")))})},async loginWithTelegram(){if(!(t.authFlow instanceof Oi))throw new w("Must initialize Telegram flow before calling loginWithTelegram");let c,p;if(B.current==="login")try{let h=await t.authenticate();c=h.user,p=h.isNewUser,U.current="telegram"}catch(h){throw O(I,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}else if(B.current==="link")try{c=(await t.link()).user,U.current="telegram"}catch(h){throw O(I,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),h}else throw new w("Unknown auth intent");d(c),b(p||!1),l(!0)},async recoveryOAuthFlow(c,p,h){let y,T;function N(z){if(!z)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:c}}),new w("Recovery OAuth failed")}switch(c){case"google-drive":{let{url:z,codeVerifier:V,stateCode:re}=await Ap({api:jo.api,provider:c});N(z);let ie,de;try{let ke=await Nu({url:z,popup:h,provider:c});if(ie=ke.stateCode,de=ke.authorizationCode,ie!==re)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c,storedStateCode:re??"",returnedStateCode:ie??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected")}catch(ke){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:ke.toString(),provider:c}}),new w("Recovery OAuth failed")}[y,T]=await Promise.all([be(),cy({api:jo.api,provider:c,codeVerifier:V,stateCode:ie,authorizationCode:de})]);break}case"icloud":{let{url:z}=await Ap({api:jo.api,provider:c});N(z);let{ckWebAuthToken:V}=await Nu({url:z,popup:h,provider:c});T=V,y=await be();break}}if(!M)throw new w("Cannot connect to wallet proxy");if(!y)throw new w("Unable to authorize user");switch(p){case"recover":let z=pe.recoverWallet?.privyWallet?.address;if(!z)throw new w("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:z,recoveryMethod:c}}),await M.recover({address:z,accessToken:y,recoveryAccessToken:T,recoveryMethod:c}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:z,recoveryMethod:c}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await M.create({accessToken:y,recoveryAccessToken:T,recoveryMethod:c});let V=await te.refreshUser(),re=Me(V);if(!re)throw O(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:re.address}}),O(I,"createWallet","onSuccess",re);break;case"set-recovery":let ie=Me(s);if(!ie)throw O(I,"setWalletRecovery","onError","embedded_wallet_not_found"),new Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:ie.address,existingRecoveryMethod:ie.recoveryMethod,targetRecoveryMethod:c}}),await M.setRecovery({address:ie.address,accessToken:y,recoveryAccessToken:T,recoveryMethod:c});let de=Me(await te.refreshUser());if(!de)throw O(I,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:ie.address,existingRecoveryMethod:ie.recoveryMethod,targetRecoveryMethod:c}}),O(I,"setWalletRecovery","onSuccess",c,de);break;default:throw new w("Unsupported recovery action")}},async loginWithOAuth(c){if(!(t.authFlow instanceof go))throw new w("Must initialize OAuth flow before calling loginWithOAuth");let p=J.get(Bn),h=t.authFlow.meta.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c,storedStateCode:p??"",returnedStateCode:h??""}}),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let y=await t.getAccessToken(),T,N,z;if(y!==null)try{let V=await t.link();T=V.user,z=V.oAuthTokens,U.current=c}catch(V){throw O(I,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account",{linkMethod:c}),V}else try{let V=await t.authenticate();T=V.user,N=V.isNewUser,z=V.oAuthTokens,U.current=c}catch(V){throw B.current==="login"?O(I,"login","onError",V.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(I,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account",{linkMethod:c}),V}return d(T),b(N||!1),l(!0),z&&T&&O(I,"oAuthAuthorization","onOAuthTokenGrant",z,{user:T}),z},async initLoginWithPasskey(c){let p=new Kn(c);t.startAuthFlow(p),B.current="login";try{U.current="passkey",await p.initAuthenticationFlow()}catch(h){throw O(I,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}},async loginWithPasskey(){if(!n)throw new Dn;if(!(t.authFlow instanceof Kn))throw new w("Must initialize Passkey flow first.");if(U.current!=="passkey")throw new w("Must init login with Passkey flow first.");let c,p;try{U.current="passkey",{user:c,isNewUser:p}=await t.authenticate()}catch(h){throw O(I,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}d(c),b(p||!1),l(!0)},async initLinkWithPasskey(c){let p=new Kn(c);t.startAuthFlow(p),B.current="link",U.current="passkey";try{await p.initLinkFlow()}catch(h){throw O(I,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"passkey"}),h}},async linkWithPasskey(){if(!n)throw new Dn;if(!(t.authFlow instanceof Kn))throw new w("Must initialize Passkey flow first.");if(U.current!=="passkey")throw new w("Must init login with Passkey flow first.");let c;try{U.current="passkey",{user:c}=await t.link()}catch(p){throw O(I,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account",{linkMethod:"passkey"}),p}return d(c||s||null),c},async initLoginWithHeadlessOAuth(c,p){if(Ia()){if(c==="google"&&$i(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 go({provider:c,headless:!0});p&&h.addCaptchaToken(p);let y=await t.startAuthFlow(h).getAuthorizationUrl();y?.url&&window.location.assign(y.url)},async loginWithHeadlessOAuth(c){P(!0),t.startAuthFlow(new go(c));let p=J.get(Bn),h=c.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c.provider,storedStateCode:p??"",returnedStateCode:h??""}}),P(!1),new w("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let y=await t.getAccessToken(),T,N,z;if(y!==null)try{({user:T,oAuthTokens:z}=await t.link()),U.current=c.provider;let V=Ks(T);T&&V&&O(I,"linkAccount","onSuccess",T,U.current,V)}catch(V){throw P(!1),O(I,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account",{linkMethod:c.provider}),V}else try{({user:T,isNewUser:N,oAuthTokens:z}=await t.authenticate()),U.current=c.provider;let V=Ks(T);T&&V&&(B.current==="login"&&N!==void 0?O(I,"login","onComplete",T,N,!1,U.current,V):B.current==="link"&&O(I,"linkAccount","onSuccess",T,U.current,V))}catch(V){throw P(!1),B.current==="login"?O(I,"login","onError",V.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(I,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account",{linkMethod:c.provider}),V}return d(T),b(N||!1),l(!0),P(!1),z&&T&&O(I,"oAuthAuthorization","onOAuthTokenGrant",z,{user:T}),T??void 0},initLoginWithEmail:async(c,p)=>{let h=new tn(c,p);t.startAuthFlow(h);try{U.current="email",await h.sendCodeEmail()}catch(y){throw B.current==="login"?O(I,"login","onError",y.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"email"}),y}},initUpdateEmail:async(c,p,h)=>{let y=new fl(c,p,h);t.startAuthFlow(y),await y.sendCodeEmail()},initUpdatePhone:async(c,p,h)=>{let y=new Il(c,p,h);t.startAuthFlow(y),await y.sendSmsCode()},initLoginWithSms:async(c,p)=>{H({status:"sending-code"});let h=new rn(c,p);t.startAuthFlow(h);try{U.current="sms",await h.sendSmsCode(),H({status:"awaiting-code-input"})}catch(y){throw H({status:"error",error:y}),B.current==="login"?O(I,"login","onError",y.privyErrorCode||"unknown_auth_error"):B.current==="link"&&O(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"sms"}),y}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async c=>{if(H({status:"submitting-code"}),!n){let y=new Dn;throw H({status:"error",error:y}),y}if(t.authFlow instanceof tn)t.authFlow.meta.emailCode=c.trim();else if(t.authFlow instanceof rn)t.authFlow.meta.smsCode=c.trim();else{let y=new w("Must initialize a passwordless code flow first");throw H({status:"error",error:y}),y}await be();let p,h;if(B.current==="link")try{({user:p}=await t.link())}catch(y){throw H({status:"error",error:y}),O(I,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:U.current}),y}else try{({user:p,isNewUser:h}=await t.authenticate())}catch(y){throw H({status:"error",error:y}),O(I,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}d(p||s||null),b(h||!1),l(!0),H({status:"done"})},generateSiweMessage:async({address:c,chainId:p,captchaToken:h})=>{B.current="link",U.current="siwe";let y=await t.generateSiweNonce({address:c,captchaToken:h}),T=p.replace("eip155:","");return Ml({address:c,chainId:T,nonce:y})},linkWithSiwe:async({message:c,signature:p,chainId:h,walletClientType:y,connectorType:T})=>{let N;try{N=await t.linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:y,connectorType:T}),N=await te.refreshUser()??N;let z=Ks(N);z&&O(I,"linkAccount","onSuccess",N,"siwe",z)}catch(z){throw O(I,"linkAccount","onError",z.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),B.current=null,U.current=null,z}d(N||s||null),B.current=null,U.current=null},refreshUser:async()=>{let c=await t.getAuthenticatedUser();return l(!!c),d(c),c},walletProxy:M,createAnalyticsEvent:({eventName:c,payload:p,timestamp:h})=>t.createAnalyticsEvent({eventName:c,payload:p,timestamp:h}),acceptTerms:async()=>{let c=await t.acceptTerms();return d(c),c},getUsdTokenPrice:c=>t.getUsdTokenPrice(c),recoverEmbeddedEthereumWallet:async c=>new Promise(async(p,h)=>{let y=Me(c?.user??s)||Wl(c?.user??s),T=await be();if(!T||!M||!y){h(new Error("Must have valid access token and Privy wallet to recover wallet"));return}q(!0);try{await M.connect({accessToken:T,address:y.address}),p(!0)}catch(N){if(ri(N)&&y.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:y.address}}),(await M.recover({address:y.address,accessToken:T,recoveryMethod:y.recoveryMethod})).address||h(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:y.address}}),p(!0);else if(ri(N)&&y.recoveryMethod!=="privy"){Q({recoverWallet:{privyWallet:y,onFailure:h,onSuccess:()=>p(!0)},recoveryOAuthStatus:{provider:y.recoveryMethod,action:"recover"}});let z=yc(y.recoveryMethod);se(z)}else h(N)}}),embeddedSolanaWallet:f,createEmbeddedSolanaWallet:async()=>{q(!0);let c=await be(),p=await te.refreshUser(),h=Yn(p),y=Me(p);if(!p||!c)throw new w("User must be logged in to create a Solana wallet");if(h)throw new w("User already has an embedded Solana wallet.");if(y)if(y.recoveryMethod==="privy")await te.recoverEmbeddedEthereumWallet({user:p});else throw new w("Cannot create an embedded Solana wallet for a user with an existing Ethereum wallet with user-controlled recovery.");let T=await te.initializeWalletProxy(15e3);if(!T)throw new w("Unable to initialize wallet proxy");t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await T.createSolana({accessToken:c,ethereumAddress:y?.address});let N=await te.refreshUser(),z=Yn(N);if(!z)throw new w("Could not get Solana wallet for user");return t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:z.address}}),z}catch(N){throw t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new w("Failed to create Solana embedded wallet with error ",N)}},exportSolanaWallet:c=>new Promise(async(p,h)=>{if(!a||!s){h(new Error("User must be authenticated before exporting their Privy wallet"));return}let y=c?.address,T=s.linkedAccounts.filter(re=>re.type==="wallet"&&re.walletClientType==="privy"&&re.chainType==="solana"),N=y?T.find(re=>re.address.toLowerCase()===y.toLowerCase()):T.find(re=>!re.imported)||T[0];if(!N){h(new Error("Must have a Privy wallet before exporting"));return}if(q(!0),!await be()||!M){h(new Error("Must have valid access token to enroll in MFA"));return}if(!M){h(new Error("Must have a Privy wallet before exporting"));return}await te.recoverEmbeddedSolanaWallet();let V={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:N,onSuccess:p,onFailure:h};Q({keyExport:V}),se("EMBEDDED_WALLET_KEY_EXPORT_SCREEN")}),recoverEmbeddedSolanaWallet:async()=>new Promise(async(c,p)=>{let h=Yn(s),y=await be();if(!y||!M||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}q(!0);try{await M.connectSolana({accessToken:y,publicKey:h.address}),c(!0)}catch(T){ri(T)&&h.recoveryMethod==="privy"?(t.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:h.address}}),(await M.recoverSolana({publicKey:h.address,accessToken:y})).publicKey||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_solana_wallet_recovery_completed",payload:{walletAddress:h.address}}),c(!0)):p(T)}}),getMoonpaySignedUrl:Ei,initCoinbaseOnRamp:t.initCoinbaseOnRamp.bind(t),getCoinbaseOnRampStatus:t.getCoinbaseOnRampStatus.bind(t),setReadyToTrue:c=>{i(!0),ee?.(c)},updateWallets:()=>uo(),fundWallet:async(c,p)=>{if(!W.fundingConfig||W.fundingConfig.methods.length===0)throw new Error("Wallet funding is not enabled");let h=Id({fundingMethods:W.fundingConfig.methods});Q({funding:Fu({address:c,fundWalletConfig:p,methodScreen:h})}),se(h)},requestFarcasterSignerStatus:async c=>{let p=await be(),h=s?.linkedAccounts.find(T=>T.type==="wallet"&&T.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!M||!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 y=await t.requestFarcasterSignerStatus(c);if(y.status==="approved"){let T=await t.getAuthenticatedUser();d(T||s||null)}return y},connectCoinbaseSmartWallet:async()=>{W.externalWallets.coinbaseWallet.connectionOptions="smartWalletOnly";let c=t.connectors?.findWalletConnector("coinbase_wallet","coinbase_smart_wallet")||t.connectors?.findWalletConnector("coinbase_wallet","coinbase_wallet");if(c)return c.updateConnectionPreference("smartWalletOnly"),Xr(c);await zs("coinbase_wallet","coinbase_smart_wallet")},setCustomMetadataForUser:async c=>{try{let p=await t.setCustomMetadata(c);return d(p),O(I,"setCustomMetadata","onSuccess",p),p}catch(p){throw O(I,"setCustomMetadata","onError",p.privyErrorCode||"unknown_auth_error"),p}}}))();H0=te.recoverEmbeddedEthereumWallet,V0=te.recoverEmbeddedSolanaWallet,G0=te.solanaSignMessage;let Hu=iA(()=>({wallets:u,ready:ce&&Ke}),[u,ce,Ke]);return Rr(xe.Provider,{value:Ti,children:Rr(Sm.Provider,{value:I,children:Rr(_m.Provider,{value:Hu,children:Rr(ah,{...W,children:D0(bm.Provider,{value:te,children:[Rr(Pm,{children:D0($f,{data:pe,setModalData:Q,setInitialScreen:_,initialScreen:A,authenticated:a,open:r,children:[e.children,!W.headless&&W.captchaEnabled&&n&&!a&&Rr(op,{delayedExecution:!1}),Rr(g0,{theme:{...W.appearance.palette||{}}}),!W.render.standalone&&Rr(Mu,{open:r})]})}),Ce&&Y?Rr(M0,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:mr,mfaSubmitPromise:vt,onLoad:X,onLoadFailed:()=>null}):null,W.loginConfig.telegramAuthConfiguration&&Rr(eo,{if:!0,children:Rr(R0,{scriptHost:e.apiUrl||$s,botUsername:W.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};import{useCallback as q0,useEffect as fA}from"react";var hA=e=>{Ne("login",e);let t=Ae(),r=al(),{initLoginWithHeadlessOAuth:o,loginWithHeadlessOAuth:n,isHeadlessOAuthLoading:i,ready:a,user:l}=K(),s=q0(async u=>{if(t.enabled&&t.status!=="success")throw new yr(t.error,null,"captcha_failure");return o(u.provider,t.token)},[o,t]),d=q0(async()=>{let u=za();if(l)return console.warn("Cannot login with OAuth when already logged in"),l;if(!u.inProgress)throw new Error("Cannot login with OAuth because no OAuth flow is in progress");if(!u.popupFlow)try{return await n(u)}catch(m){throw m}finally{zn()}},[n]);return fA(()=>{let u=za();a&&r&&u.inProgress&&u.headless&&!u.popupFlow&&d()},[a,r]),{initOAuth:s,loginWithOAuth:d,loading:i}};import{useCallback as z0}from"react";var yA=()=>{let e=Ae(),{initLoginWithEmail:t,loginWithCode:r}=K(),o=z0(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=z0(async({code:i})=>{if(e.enabled&&e.status==="error")throw new yr(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};import{useCallback as K0}from"react";var gA=()=>{let e=Ae(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=K(),n=K0(async({phoneNumber:a})=>{if(!a)throw new Error("SMS required to send OTP code");return t(a)},[t]),i=K0(async({code:a})=>{if(e.enabled&&e.status!=="success")throw new yr(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:n,loginWithCode:i,state:o}};import{useCallback as Y0}from"react";var CA=()=>{let e=Ae(),{generateSiweMessage:t,linkWithSiwe:r}=K(),o=Y0(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=Y0(async({signature:i,message:a,chainId:l,walletClientType:s,connectorType:d})=>{if(e.enabled&&e.status!=="success")throw new yr(e.error,null,"captcha_failure");return r({message:a,signature:i,chainId:l,walletClientType:s,connectorType:d})},[r,e.status]);return{generateSiweMessage:o,linkWithSiwe:n}};import{useContext as vA}from"react";function wA(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:d,linkTiktok:u,linkSpotify:m,linkInstagram:f,linkTelegram:g,linkFarcaster:v}=vA(xe);return Ne("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:d,linkTiktok:u,linkSpotify:m,linkInstagram:f,linkFarcaster:v,linkTelegram:g}}import{useContext as bA}from"react";function EA(e){let{connectWallet:t}=bA(xe);return Ne("connectWallet",e),{connectWallet:t}}import{useContext as TA}from"react";function SA(e){let{createWallet:t}=TA(xe);return Ne("createWallet",e),{createWallet:t}}var AA=()=>{let{embeddedSolanaWallet:e,exportSolanaWallet:t,createEmbeddedSolanaWallet:r}=L();return{createWallet:r,exportWallet:t,wallets:e?[e]:[]}};var PA=()=>{let{connectCoinbaseSmartWallet:e}=L();return{connectCoinbaseSmartWallet:e}};var xA=()=>{let{startCrossAppAuthFlow:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:n}=K();return{loginWithCrossAppAccount:({appId:i})=>e({appId:i,action:"login"}),linkCrossAppAccount:({appId:i})=>e({appId:i,action:"link"}),unlinkCrossAppAccount:t,signMessage:r,signTypedData:o,sendTransaction:n}};import{useContext as RA}from"react";function kA(e){let{sendTransaction:t}=RA(xe);return Ne("sendTransaction",e),{sendTransaction:t}}import{useContext as _A}from"react";function MA(e){let{setWalletPassword:t}=_A(xe);return Ne("setWalletPassword",e),{setWalletPassword:t}}import{useContext as IA}from"react";function WA(){let{createGuestAccount:e}=IA(xe);return{createGuestAccount:e}}import{useContext as LA}from"react";function NA(e){let{setWalletRecovery:t}=LA(xe);return Ne("setWalletRecovery",e),{setWalletRecovery:t}}import{useContext as OA}from"react";function DA(e){let{signMessage:t}=OA(xe);return Ne("signMessage",e),{signMessage:t}}import{useContext as UA}from"react";function FA(e){let{signTypedData:t}=UA(xe);return Ne("signTypedData",e),{signTypedData:t}}import{useContext as BA}from"react";var HA=()=>{let{isModalOpen:e}=BA(xe);return{isOpen:e}};import{useContext as VA}from"react";function GA(e){let{getAccessToken:t}=VA(xe);return Ne("accessToken",e),{getAccessToken:t}}function qA(e){let{authenticated:t,user:r}=K(),{initLoginWithOAuth:o}=L(),n=Ri();return Ne("oAuthAuthorization",e),{reauthorize:i=>zA(t,r,o,n,i.provider)}}var zA=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 KA=e=>{let{customAuthStatus:t}=L();return Ne("customAuth",e),{status:t}};var YA=Q0;function Q0(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=K();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}import{useContext as QA}from"react";function XA(e){let{setCustomMetadata:t}=QA(xe);return Ne("setCustomMetadata",e),{setCustomMetadata:t}}function ZA(e){return e.find(r=>r.walletClientType==="privy"&&r.connectorType==="embedded"&&!r.imported)??null}export{vo as AsExternalProvider,op as Captcha,Xa as ConnectorManager,Mu as LoginModal,Za as PrivyClient,uA as PrivyProvider,Ze as PrivyProxyProvider,zd as SUPPORTED_CHAINS,Ud as VERSION,tr as WalletConnector,o6 as addRpcUrlOverrideToChain,Tp as errorIndicatesMaxMfaRetries,oi as errorIndicatesMfaTimeout,ni as errorIndicatesMfaVerificationFailed,be as getAccessToken,ZA as getEmbeddedConnectedWallet,PA as useConnectCoinbaseSmartWallet,EA as useConnectWallet,SA as useCreateWallet,xA as useCrossAppAccounts,KA as useCustomAuth,YA as useExperimentalFarcasterSigner,Q0 as useFarcasterSigner,$0 as useFundWallet,WA as useGuestAccounts,wA as useLinkAccount,CA as useLinkWithSiwe,j0 as useLogin,yA as useLoginWithEmail,hA as useLoginWithOAuth,gA as useLoginWithSms,Kd as useLogout,ks as useMfa,ao as useMfaEnrollment,HA as useModalStatus,qA as useOAuthTokens,K as usePrivy,np as useRegisterMfaListener,kA as useSendTransaction,XA as useSetCustomMetadata,MA as useSetWalletPassword,NA as useSetWalletRecovery,DA as useSignMessage,FA as useSignTypedData,AA as useSolanaWallets,GA as useToken,Bo as useWallets};
3265
+ `;import{useRef as M0,useEffect as YS}from"react";import{jsx as XS}from"react/jsx-runtime";function QS({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 W0(e){let t=M0(null),r=M0();return YS(()=>{r.current?.remove(),r.current=QS(e),t.current?.after(r.current)},[e]),XS("div",{ref:t,hidden:!0})}import{useState as ZS}from"react";import{useEffect as L0,useRef as N0}from"react";var Od=class{constructor(){this.callbacks={}}enqueue(t,r){this.callbacks[t]=r}dequeue(t,r){let o=this.callbacks[r];if(!o)throw new Error(`cannot dequeue ${t} event: no event found for id ${r}`);switch(delete this.callbacks[r],t){case"privy:iframe:ready":return o;case"privy:wallet:create":return o;case"privy:wallet:create-additional":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 On(e,t,r,o,n,i=!1){let a=i,l=async u=>{if(a&&t&&t.length>0){u===(i?0:1)?n("configureMfa","onMfaRequired",t):o.current?.reject(new Le("missing_or_invalid_mfa","MFA verification failed, retry."));let m=await new Promise((f,y)=>{r.current={resolve:f,reject:y};let E=1e3*60*5;setTimeout(()=>{let C=new Le("mfa_timeout","Timed out waiting for MFA code");o.current?.reject(C),y(C)},E)});return await e(m)}return await e()},s=4,d=null;for(let u=0;u<s;u++)try{d=await l(u),o.current?.resolve(void 0);break}catch(m){if(m.type==="missing_or_invalid_mfa")a=!0;else throw o.current?.resolve(void 0),m}if(d===null){let u=new Le("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw o.current?.reject(u),u}return d}import{jsx as rP}from"react/jsx-runtime";var JS=function(e){return()=>`id-${e++}`}(0);function jS(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function mt(e){return e.error!==void 0}var dt=new Od,Uu=new Map,$S=(e,t)=>typeof t=="bigint"?t.toString():t,eP=(e,t)=>`${e}${JSON.stringify(t,$S)}`;function ft(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let i=eP(e,t);if(e==="privy:wallet:create"){let l=Uu.get(i);if(l)return l}let a=new Promise((l,s)=>{let d=JS();dt.enqueue(d,{resolve:l,reject:s}),n.postMessage({id:d,event:e,data:t},o)}).finally(()=>{Uu.delete(i)});return Uu.set(i,a),a}function tP(e){switch(e.event){case"privy:iframe:ready":let t=dt.dequeue(e.event,e.id);return mt(e)?t.reject(new Le(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=dt.dequeue(e.event,e.id);return mt(e)?r.reject(new Le(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:create-additional":let o=dt.dequeue(e.event,e.id);return mt(e)?o.reject(new Le(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:import":let n=dt.dequeue(e.event,e.id);return mt(e)?n.reject(new Le(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:connect":let i=dt.dequeue(e.event,e.id);return mt(e)?i.reject(new Le(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:recover":let a=dt.dequeue(e.event,e.id);return mt(e)?a.reject(new Le(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:rpc":let l=dt.dequeue(e.event,e.id);return mt(e)?l.reject(new Le(e.error.type,e.error.message)):l.resolve(e.data);case"privy:wallet:set-recovery":let s=dt.dequeue(e.event,e.id);return mt(e)?s.reject(new Le(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:verify":let d=dt.dequeue(e.event,e.id);return mt(e)?d.reject(new Le(e.error.type,e.error.message)):d.resolve(e.data);case"privy:mfa:init-enrollment":{let y=dt.dequeue(e.event,e.id);return mt(e)?y.reject(new Le(e.error.type,e.error.message)):y.resolve(e.data)}case"privy:mfa:submit-enrollment":{let y=dt.dequeue(e.event,e.id);return mt(e)?y.reject(new Le(e.error.type,e.error.message)):y.resolve(e.data)}case"privy:mfa:unenroll":{let y=dt.dequeue(e.event,e.id);return mt(e)?y.reject(new Le(e.error.type,e.error.message)):y.resolve(e.data)}case"privy:mfa:clear":{let y=dt.dequeue(e.event,e.id);return mt(e)?y.reject(new Le(e.error.type,e.error.message)):y.resolve(e.data)}case"privy:farcaster:init-signer":{let y=dt.dequeue(e.event,e.id);return mt(e)?y.reject(new Le(e.error.type,e.error.message)):y.resolve(e.data)}case"privy:farcaster:sign":{let y=dt.dequeue(e.event,e.id);return mt(e)?y.reject(new Le(e.error.type,e.error.message)):y.resolve(e.data)}case"privy:solana-wallet:create":let u=dt.dequeue(e.event,e.id);return mt(e)?u.reject(new Le(e.error.type,e.error.message)):u.resolve(e.data);case"privy:solana-wallet:connect":let m=dt.dequeue(e.event,e.id);return mt(e)?m.reject(new Le(e.error.type,e.error.message)):m.resolve(e.data);case"privy:solana-wallet:recover":let f=dt.dequeue(e.event,e.id);return mt(e)?f.reject(new Le(e.error.type,e.error.message)):f.resolve(e.data);case"privy:solana-wallet:rpc":{let y=dt.dequeue(e.event,e.id);return mt(e)?y.reject(new Le(e.error.type,e.error.message)):y.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function O0(e){let t=N0(null),r=N0(e.mfaMethods),o=Mi(),[n,i]=ZS(!1);return L0(()=>{r.current=e.mfaMethods},[e.mfaMethods]),L0(()=>{if(!n)return;let a=t.current;if(!a)return;function l(f){f&&f.origin===e.origin&&jS(f.data)&&tP(f.data)}let s={create(f){return ft("privy:wallet:create",f,a,e.origin)},createAdditional(f){return ft("privy:wallet:create-additional",f,a,e.origin)},import(f){return ft("privy:wallet:import",f,a,e.origin)},connect(f){return ft("privy:wallet:connect",f,a,e.origin)},recover(f){return On(y=>ft("privy:wallet:recover",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!f.recoveryMethod||f.recoveryMethod==="privy")},rpc(f){return On(y=>ft("privy:wallet:rpc",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},createSolana(f){return ft("privy:solana-wallet:create",f,a,e.origin)},connectSolana(f){return ft("privy:solana-wallet:connect",f,a,e.origin)},recoverSolana(f){return ft("privy:solana-wallet:recover",f,a,e.origin)},rpcSolana(f){return ft("privy:solana-wallet:rpc",f,a,e.origin)},setRecovery(f){return On(y=>ft("privy:wallet:set-recovery",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(f){return On(y=>ft("privy:mfa:verify",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(f){return On(y=>ft("privy:mfa:init-enrollment",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(f){return On(y=>ft("privy:mfa:submit-enrollment",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(f){return On(y=>ft("privy:mfa:unenroll",{...f,...y},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(f){return ft("privy:mfa:clear",f,a,e.origin)},initFarcasterSigner(f){return ft("privy:farcaster:init-signer",f,a,e.origin)},signFarcasterMessage(f){return ft("privy:farcaster:sign",f,a,e.origin)}};window.addEventListener("message",l);let d=()=>e.onLoad(s),u=(...f)=>{console.warn("Privy iframe failed to load: ",...f),e.onLoadFailed()},m=new AbortController;return Na(()=>ft("privy:iframe:ready",{},a,e.origin),{abortSignal:m.signal}).then(d,u),()=>{window.removeEventListener("message",l),m.abort()}},[n]),rP("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>i(!0),src:Js(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}var Dd=class{constructor(t,r){this.walletProxy=t,this.address=r}async handleSignMessage(t){if(!t.params||typeof t.params.message!="string")throw new Error("Message must be provided as a string for Solana signMessage RPC");return await U0({message:t.params.message})}async request(t){if(console.debug("EmbeddedSolanaProvider.request() called with args",t),!await ve())throw new Error("User must be authenticated to use embedded Solana wallet");if(!await D0())throw new v("Unable to connect to Solana embedded wallet");switch(t.method){case"signMessage":return await this.handleSignMessage(t);default:throw new Error("Embedded Solana provider does not yet support this RPC method.")}}};var Ud="popup-privy-oauth",Fd="PRIVY_OAUTH_USE_BROADCAST_CHANNEL",oP="privy:";function F0(e){return e.startsWith(oP)}async function B0({url:e,popup:t}){return t.location=e,new Promise((o,n)=>{let a=setTimeout(()=>{n(new v("Authorization request timed out after 2 minutes.")),l()},12e4);function l(){t?.close(),window.removeEventListener("message",u)}let s,d=setInterval(()=>{t?.closed&&!s&&(l(),clearInterval(d),clearTimeout(a),n(new v("User rejected request")))},300);function u(m){m.data&&(m.data.type==="PRIVY_OAUTH_RESPONSE"&&m.data.stateCode&&m.data.authorizationCode&&(clearTimeout(a),o(m.data),l()),m.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(a),n(new v(m.data.error)),l()),m.data.type===Fd&&(s=new BroadcastChannel(Ud),s.onmessage=u))}window.addEventListener("message",u)})}var nP="https://cdn.apple-cloudkit.com";async function Fu({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===nP&&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 H0=e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type});import{jsx as Sr,jsxs as V0}from"react/jsx-runtime";var $o;function pP(e){return typeof e=="string"&&e.length===25}function ve(){if(!$o){let e=X.get(Vn);return Promise.resolve(e||null)}return $o.getAccessToken()}var G0,Kf=(e,t,r)=>G0(e,t,r),q0,Yf=(e,t,r)=>q0(e,t,r),z0,Qf=(e,t,r,o)=>z0(e,t,r,o),K0,Xf=()=>K0(),Y0,D0=()=>Y0(),Q0,U0=({message:e})=>Q0({message:e}),uP=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;X.put(Da,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},mP=({config:e,...t})=>{if(typeof window<"u"&&["localhost","127.0.0.1"].indexOf(window.location.hostname)<0&&window.location.protocol!=="https:")throw new v("Embedded wallet is only available over HTTPS");if(!pP(t.appId))throw new v("Cannot initialize the Privy provider with an invalid Privy app ID");$o||($o=new Ja({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."),Sr(Tm,{client:$o,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:Sr(fP,{...t,client:$o})})},fP=e=>{let t=e.client,[r,o]=pt(!1),[n,i]=pt(!1),[a,l]=pt(!1),[s,d]=pt(null),[u,m]=pt([]),[f,y]=pt(null),E=Wa(u),[C,w]=pt(!1),[P,_]=pt(null),[T,A]=pt(!1),[S,I]=pt({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:ut}),[N,H]=pt({status:"initial"}),[x,K]=pt(null),W=Me(),Q=sl(),[de,q]=pt(!0),[pe,Z]=pt({}),[ie,se]=pt(null),[_e,be]=pt(null),[ye,ae]=pt(!1),[Xe,it]=pt(!1),[le,et]=pt(W.customAuth?.enabled?{status:"initial"}:{status:"not-enabled"}),Ot=Wa(null),zr=Wa(null),L=Wa(Am),[Se,qe]=pt(!1);t.onStoreToken=c=>{c&&D(L,"accessToken","onAccessTokenGranted",c)},t.onDeleteToken=()=>{d(null),l(!1),D(L,"accessToken","onAccessTokenRemoved")};let U=Wa(null),Y=Wa(null),j=c=>{_(c),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:c}})},Oe=c=>{W.embeddedWallets.createOnLogin!=="off"&&q(!0),j(c)};so(()=>{let c=_i(s);if(!c||!x){y(null);return}let p={address:c.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:Ii,id:"io.privy.solana.wallet"},getProvider:async()=>new Dd(x,c.address)};y(p)},[x,s]),so(()=>{if(!s){t.connectors?.removeEmbeddedWalletConnectors();return}let c=Ue(s),p=Xd(s),h=ol(s);if((!c||!p.length)&&t.connectors?.removeEmbeddedWalletConnectors(),h||t.connectors?.removeImportedWalletConnector(),!t.connectors){console.debug("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!x){console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized");return}c&&t.connectors.addEmbeddedWalletConnectors({walletProxy:x,rootWallet:c,embeddedWallets:p,defaultChain:W.defaultChain,appId:e.appId}),h&&t.connectors.addImportedWalletConnector(x,h.address,W.defaultChain,e.appId)},[x,s]),so(()=>{x&&_e?.(x)},[x]),so(()=>{(async()=>{if(!W.customAuth?.enabled){et({status:"not-enabled"});return}q(!0),et({status:"loading"});let{getCustomAccessToken:p,isLoading:h}=W.customAuth;if(!(!n||h))try{let g=await p();if(!g&&a){await Ai.logout(),et({status:"done"}),D(L,"customAuth","onUnauthenticated");return}if(!g){et({status:"done"});return}if(a){et({status:"done"});return}t.startAuthFlow(new Oi(g));let{user:b,isNewUser:O}=await t.authenticate();if(!b){await Ai.logout(),et({status:"error",error:new v("Failed to sync with custom auth provider")}),D(L,"customAuth","onUnauthenticated");return}O!==void 0&&D(L,"login","onComplete",b,O,!1,"custom",null),D(L,"customAuth","onAuthenticated",{user:b}),et({status:"done"}),d(b||null),w(O||!1),l(!0),it(!0)}catch(g){throw console.warn(g),a&&(await Ai.logout(),D(L,"customAuth","onUnauthenticated")),D(L,"login","onError",g.privyErrorCode||"unknown_auth_error"),et({status:"error",error:g}),g}})()},[W.customAuth?.enabled,W.customAuth?.getCustomAccessToken,W.customAuth?.isLoading,n,a]),so(()=>{Xe&&x&&s&&vt(s,W.embeddedWallets.createOnLogin)&&(it(!1),ze(s,ki).catch(console.error))},[Xe&&x&&s]),so(()=>{async function c(){let p=Lo(),h=Dn();uP();let g=iP();t.initializeConnectorManager({walletConnectCloudProjectId:W.walletConnectCloudProjectId,rpcConfig:W.rpcConfig,chains:W.chains,defaultChain:W.defaultChain,store:g,walletList:W.appearance.walletList,shouldEnforceDefaultChainOnConnect:W.shouldEnforceDefaultChainOnConnect,externalWalletConfig:W.externalWallets,appName:W.name??"Privy"});let b;t.connectors?.on("connectorInitialized",()=>{b&&clearTimeout(b);let G=t.connectors.walletConnectors.length,oe=t.connectors.walletConnectors.reduce((ce,Pe)=>ce+(Pe.initialized?1:0),0);oe===G?qe(!0):b=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:oe,expected:G}),qe(!0)},1500)}),t.connectors?.initialize().then(()=>{Kt()});let O=await t.getAuthenticatedUser(),z=!!O;if(W.customAuth?.enabled||(l(!!O),O&&D(L,"login","onComplete",O,!1,!0,null,null),d(O)),p){Y.current=z?"link":"login";return}if(h&&!z){Y.current="login",Oe("TELEGRAM_AUTH_SCREEN");return}ee.setReadyToTrue(!!O)}!n&&Q&&c()},[t,ie,n,Q]),so(()=>{if(!n)return;if(!s){ae(!0);return}if(!!!s.linkedAccounts.find(h=>h.type==="wallet"&&h.walletClientType==="privy")){ae(!0);return}let p=!!u.find(h=>h.walletClientType==="privy");ae(p)},[n,s,u]);let Lo=()=>{let c=Ka();if(c.inProgress&&c.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(c.authorizationCode==="error"){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."});return}window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:c.stateCode,authorizationCode:c.authorizationCode});return}return c.inProgress&&F0(c.provider)&&!c.popupFlow&&(new BroadcastChannel(Ud).postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:c.stateCode,authorizationCode:c.authorizationCode}),window.close()),!c.inProgress||c.headless?!1:(t.startAuthFlow(new ho(c)),Oe("AWAITING_OAUTH_SCREEN"),!0)},Dn=()=>{let c=Gf();if(!c||!W.loginMethods.telegram||!W.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let p=new Bi;return t.startAuthFlow(p),c.flowType==="login-url"&&(p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult={id:c.id,first_name:c.first_name,last_name:c.last_name,auth_date:c.auth_date,username:c.username,photo_url:c.photo_url,hash:c.hash}),c.flowType==="web-app"&&(p.meta.telegramAuthResult=void 0,p.meta.telegramWebAppData={query_id:c.query_id,user:c.user,auth_date:c.auth_date,hash:c.hash,chat_instance:c.chat_instance,chat_type:c.chat_type,start_param:c.start_param}),!0},Un=async(c,p,h,g)=>{let b=await t.connectors?.createWalletConnector(c,p)||null;Pi(b,p,h,g)};async function Pi(c,p,h,g){if(c)I({status:"disconnected",connectedWallet:null,connectError:null,connector:c,connectRetry:ut});else return I({status:"disconnected",connectedWallet:null,connectError:new Re("Unable to connect to wallet."),connector:null,connectRetry:ut}),g?.(null,h);c instanceof Zr&&p&&await c.resetConnection(p),I({connector:c,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Pi(c,p,h,g)});try{let b=await c.connect({showPrompt:!0});if(W.shouldEnforceDefaultChainOnConnect&&!W.chains.find(O=>O.id===Number(b?.chainId.replace("eip155:","")))&&!(b?.connectorType==="wallet_connect_v2"&&b?.walletClientType==="metamask")){I(O=>({...O,connector:c,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:ut}));try{await b?.switchChain(W.defaultChain.id),b&&(b.chainId=Ri(Hn(W.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${W.defaultChain.id}`)}}return I(O=>({...O,status:"connected",connectedWallet:b,connectError:null,connectRetry:ut})),b&&D(L,"connectWallet","onSuccess",b),g?.(b,h)}catch(b){return b instanceof Zt?(console.warn(b.cause?b.cause:b.message),D(L,"connectWallet","onError",b.privyErrorCode||"generic_connect_wallet_error")):(console.warn(b),D(L,"connectWallet","onError","unknown_connect_wallet_error")),I(O=>({...O,status:"disconnected",connectedWallet:null,connectError:b})),g?.(null,h)}}let Kr=async(c,p,h)=>{if(c===null)return;let g=new Ho(c,t,p,h);t.startAuthFlow(g)},Kt=()=>{let c=new URLSearchParams(window.location.search),p=c.get("privy_connector"),h=c.get("privy_wallet_client");if(!p||!h)return;if(h==="phantom"&&!tn()&&Oe("LOGIN_FAILED_SCREEN"),!t.connectors)throw new v("Connector not initialized");j("AWAITING_CONNECTION");let g=new URL(window.location.href);g.searchParams.delete("privy_connector"),g.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",g),Un(p,h,void 0,Kr)};so(()=>{n&&a&&s===null&&t.getAuthenticatedUser().then(d)},[n,a,s,t]);let De=c=>{if(!a)throw D(L,"linkAccount","onError","must_be_authenticated",{linkMethod:c}),new v("User must be authenticated before linking an account.")},lo=()=>{De("siwe"),U.current="siwe",Y.current="link",j("LINK_WALLET_SCREEN")},No=c=>{if(!a||!s)return!1;if(c.walletClientType==="privy")return!0;for(let p of s.linkedAccounts)if(p.type==="wallet"&&p.address===c.address&&p.walletClientType!=="privy")return!0;return!1},Yt=async c=>{if(!t.connectors)throw new v("Connector not initialized");let p=t.connectors.findWalletConnector(c.connectorType,c.walletClientType)||null;if(I(h=>({...h,connector:p,status:"connected",connectedWallet:c,connectError:null,connectRetry:ut})),W.captchaEnabled&&!a){let h={callback:g=>Kr(c,g),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};Z({captchaModalData:h}),Oe("CAPTCHA_SCREEN")}else await Kr(c),Oe("AWAITING_CONNECTION")},co=async(c,p)=>{let{signedUrl:h,externalTransactionId:g}=await A1(t,c,p??{},W.appearance.palette,W.fundingMethodConfig?.moonpay.useSandbox??!1);return{signedUrl:h,externalTransactionId:g}},Oo=()=>{m(c=>{let p=t.connectors?.wallets.map(h=>({...h,linked:No(h),loginOrLink:async()=>{if(!await h.isConnected())throw new v("Wallet is not connected");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new v("Cannot link or login with embedded wallet");Yt(h)},fund:async g=>{await ee.fundWallet(h.address,g)},unlink:async()=>{if(!a)throw new v("User is not authenticated.");if(h.connectorType==="embedded"&&h.walletClientType==="privy")throw new v("Cannot unlink an embedded wallet");let g=await t.unlinkWallet(h.address);d(g)}}))||[];return Ll(c,p)?c:p})};so(()=>{Oo()},[s?.linkedAccounts,a,n]),so(()=>{if(n){if(!t.connectors)throw new v("Connector not initialized");Oo(),t.connectors.on("walletsUpdated",Oo)}},[n]);let Fn=c=>{c&&"target"in c&&c&&(c=void 0),Z({externalConnectWallet:{walletList:c?.walletList&&c?.walletList.length>0?c.walletList:void 0,suggestedAddress:c?.suggestedAddress}}),j(a?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};so(()=>{if(!u[0])return;let c=u[0],p=E.current.find(g=>g.address===c.address),h;if(c.walletClientType==="privy"?h=s?.linkedAccounts.find(g=>g.type==="wallet"&&g.address===c.address&&g.walletClientType==="privy"):h=s?.linkedAccounts.find(g=>g.type==="wallet"&&g.address===c.address&&g.walletClientType!=="privy"),!p&&h){let g=Object.assign({},s);g.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported,walletIndex:h.walletIndex},d(g)}E.current=u},[u]);let ze=async(c,p,h)=>{let g=Ue(c);if(g&&!h?.createAdditional)throw D(L,"createWallet","onError","embedded_wallet_already_exists"),new Error("User already has an embedded wallet.");let[b,O]=await Promise.all([ee.initializeWalletProxy(p),ve()]);if(!b&&W.customAuth?.enabled)throw D(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!b||!O||W.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((z,G)=>{q(!0),Z({createWallet:{onSuccess:ce=>{D(L,"createWallet","onSuccess",ce),z(ce)},onFailure:ce=>{D(L,"createWallet","onError","unknown_embedded_wallet_error"),G(ce)},callAuthOnSuccessOnClose:!1}}),j("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{if(!g)await b.create({accessToken:O});else{let oe=Xd(c),Pe=(oe?.length?Math.max(...oe.map(xe=>xe.walletIndex)):g.walletIndex)+1;await ee.recoverEmbeddedEthereumWallet(),await b.createAdditional({accessToken:O,primaryWalletAddress:g?.address,hdWalletIndex:Pe})}let z=await ee.refreshUser(),G=Ue(z);if(!G)throw D(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return D(L,"createWallet","onSuccess",G),G}},Bd=c=>{if(!W.chains.map(p=>p.id).includes(c))throw new Re(`Chain ID ${c} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},Hu=(c,p,h,g)=>new Promise(async(b,O)=>{let{requesterAppId:z}=p||{};if(!a||!s){D(L,"sendTransaction","onError","must_be_authenticated"),O(new Error("User must be authenticated before signing with a Privy wallet"));return}let G=g??Ue(s)?.address;if(!G)throw new v("User must have an embedded wallet to send a transaction.");let{signingWallet:oe,rootWallet:ce}=nl(s,G);if(!ce||!oe){D(L,"sendTransaction","onError","embedded_wallet_not_found"),O(new Error("Must have a Privy wallet before signing"));return}q(!0);let Pe=qu.wallets.find(Xt=>Xt.walletClientType==="privy"&&Si(Xt.address)===Si(oe.address)),xe=await Pe?.getEthereumProvider();if(!Pe||!xe)throw new v(`Cannot sendTransaction before embedded wallet ${oe.address} is connected`);let en=c.chainId?Number(c.chainId):Md(Pe.chainId);Bd(en);let Pr=Object.assign({},c,{chainId:en}),Ar=async()=>{let Xt=await ve();if(!Xt||!x){D(L,"sendTransaction","onError","embedded_wallet_not_found"),O(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await ee.recoverEmbeddedEthereumWallet()){D(L,"sendTransaction","onError","unknown_connect_wallet_error"),O(new Error("Unable to connect to wallet"));return}let xi=Rr(Pr.chainId,W.chains,W.rpcConfig,{appId:e.appId}),po=await dP(oe.address,Pr,xi);if(W.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:eC}=await cP(po,xi),{hasSufficientFunds:tC}=await _d(oe.address,po,eC,xi);if(!tC)throw new bt(new Wr("Wallet has insufficient funds for this transaction.",lP.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let zu=await kd({accessToken:Xt,rootWallet:ce,transactingWallet:oe,walletProxy:x,transactionRequest:po,provider:xi,requesterAppId:z});D(L,"sendTransaction","onSuccess",zu),b(zu)}catch(Ys){D(L,"sendTransaction","onError","transaction_failure"),O(Ys)}};if(W.embeddedWallets.noPromptOnSignature)p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),Ar();else{let Xt={transactionRequest:Pr,transactingWallet:oe,rootWallet:ce,onSuccess:po=>{D(L,"sendTransaction","onSuccess",po),b(po)},onFailure:po=>{D(L,"sendTransaction","onError","transaction_failure"),O(po)},uiOptions:p||{},fundWalletConfig:h,requesterAppId:z},Ys={address:ce.address,onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:po=>{D(L,"sendTransaction","onError","unknown_connect_wallet_error"),O(po)}},xi=Au({address:oe.address,appConfig:W,fundWalletConfig:h,chainIdOverride:Pr.chainId,comingFromSendTransactionScreen:!0});Z({connectWallet:Ys,sendTransaction:Xt,funding:xi}),j("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function Vu(){return new Promise(async(c,p)=>{let h=await ve();if(!h||!x)throw new Error("Must have valid access token to enroll in MFA");try{await x.verifyMfa({accessToken:h}),c()}catch(g){p(g)}})}let zs=c=>c?.linkedAccounts.filter(p=>p.latestVerifiedAt!==null&&!(p.type==="wallet"&&p.walletClientType==="privy")).sort((p,h)=>h.latestVerifiedAt.getTime()-p.latestVerifiedAt.getTime())[0],Qt=c=>{let p=s?.linkedAccounts.filter(b=>b.type===c).length??0,{displayName:h,loginMethod:g}=Sn(c);if(c==="passkey"&&p>=5||c!=="passkey"&&p>=1)throw D(L,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:g}),new v(`User already has an account of type ${h} linked.`)};async function Gu({showAutomaticRecovery:c=!1,legacySetWalletPasswordFlow:p=!1}){_(null);let h=p?"setWalletPassword":"setWalletRecovery";if(!a||!s)throw D(L,h,"onError","must_be_authenticated"),new Error("User must be authenticated before adding recovery method to Privy wallet");let g=Ue(s);if(!g||!x)throw D(L,h,"onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a recovery method");if(_i(s))throw new Error("Cannot set user-controlled recovery for user with Solana.");try{await Vu()}catch(O){throw D(L,h,"onError","missing_or_invalid_mfa"),O}return new Promise((O,z)=>{q(!0);let G={onSuccess:xe=>{D(L,h,"onSuccess","user-passcode",xe),O(xe)},onFailure:xe=>{D(L,h,"onError","user_exited_set_password_flow"),z(xe)},callAuthOnSuccessOnClose:!1},oe=g.recoveryMethod==="user-passcode",Pe={onCompleteNavigateTo:fc({walletAction:"update",availableRecoveryMethods:W.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:p,isResettingPassword:oe,showAutomaticRecovery:c}),shouldForceMFA:!1,onFailure:xe=>{D(L,h,"onError","unknown_connect_wallet_error"),z(xe)}};Z({setWalletPassword:G,createWallet:G,connectWallet:Pe,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:oe}}),j("EMBEDDED_WALLET_CONNECTING_SCREEN")})}async function Ks({appId:c,action:p}){let h=await ve();if(p==="link"&&!h)throw D(L,"linkAccount","onError","must_be_authenticated",{linkMethod:`privy:${c}`}),new v("User must be authenticated before linking an account.");if(p==="login"&&h)throw D(L,"login","onError","unknown_auth_error"),new v("Attempted to log in, but user is already logged in. Use a `link` helper instead.");U.current=`privy:${c}`,Y.current=p;let g=window.open(void 0,void 0,Es({w:440,h:680}));return t.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:c}}),new Promise(async(b,O)=>{let{name:z,logoUrl:G}=await Hc({api:t.api,providerAppId:c,requesterAppId:W.id});Z({crossAppAuth:{appId:c,name:z,logoUrl:G,action:p,popup:g,onSuccess:b,onError:O}}),Oe("CROSS_APP_AUTH_SCREEN")})}let Ai={ready:n,authenticated:a,user:s,walletConnectors:t.connectors||null,connectWallet:Fn,importWallet:async({privateKey:c})=>{De("siwe");let[p,h]=await Promise.all([ee.initializeWalletProxy(15e3),ve()]);if(p&&h){await p.import({privateKey:c,accessToken:h});let g=await ee.refreshUser(),b=ol(g);if(!b)throw D(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to import wallet");return D(L,"createWallet","onSuccess",b),b}else throw new v("User is not authenticated")},linkWallet:lo,startCrossAppAuthFlow:Ks,linkEmail:()=>{De("email"),Qt("email"),U.current="email",Y.current="link",j("LINK_EMAIL_SCREEN")},linkPhone:()=>{De("sms"),Qt("phone"),U.current="sms",Y.current="link",j("LINK_PHONE_SCREEN")},linkGoogle:async()=>{De("google"),Qt("google_oauth"),Y.current="link",await ee.initLoginWithOAuth("google")},linkTwitter:async()=>{De("twitter"),Qt("twitter_oauth"),Y.current="link",await ee.initLoginWithOAuth("twitter")},linkDiscord:async()=>{De("discord"),Qt("discord_oauth"),Y.current="link",await ee.initLoginWithOAuth("discord")},linkGithub:async()=>{De("github"),Qt("github_oauth"),Y.current="link",await ee.initLoginWithOAuth("github")},linkSpotify:async()=>{De("spotify"),Qt("spotify_oauth"),Y.current="link",await ee.initLoginWithOAuth("spotify")},linkInstagram:async()=>{De("instagram"),Qt("instagram_oauth"),Y.current="link",await ee.initLoginWithOAuth("instagram")},linkTiktok:async()=>{De("tiktok"),Qt("tiktok_oauth"),Y.current="link",await ee.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{De("linkedin"),Qt("linkedin_oauth"),Y.current="link",await ee.initLoginWithOAuth("linkedin")},linkApple:async()=>{De("apple"),Qt("apple_oauth"),Y.current="link",await ee.initLoginWithOAuth("apple")},linkPasskey:async()=>{De("passkey"),Qt("passkey"),await ee.initLinkWithPasskey(),j("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{De("telegram"),Qt("telegram"),Y.current="link",U.current="telegram",await ee.initLoginWithTelegram(),j("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{De("farcaster"),Qt("farcaster"),await ee.initLoginWithFarcaster(),Y.current="link",U.current="farcaster",j("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(De("email"),!s?.email)throw new v("User does not have an email linked to their account.");Y.current="link",U.current="email",j("UPDATE_EMAIL_SCREEN")},updatePhone:()=>{if(De("sms"),!s?.phone)throw new v("User does not have a phone number linked to their account.");Y.current="link",U.current="sms",j("UPDATE_PHONE_SCREEN")},login:async c=>{c&&"target"in c&&c&&(c=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(g=>{se(b=>g.bind(b))});if(se(null),h){console.warn(p);return}}if(s&&!s.isGuest){console.warn(p);return}Y.current="login",Z({login:c}),Oe("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(c=>{se(()=>c)}),se(null)),a){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}Oe("CONNECT_OR_CREATE")},logout:async()=>{if(s&&t.clearProviderAcccessTokens(s),_(null),await t.logout(),s&&x)try{await x.clearMfa({userId:s.id})}catch{}d(null),l(!1),D(L,"logout","onSuccess"),Y.current=null,U.current=null,o(!1),X.del(Ua),X.del(tl(W.id))},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!s||!s.wallet)return new je;let c=u.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(g=>g.address===c?.address));return!c||!p?new je:p.proxyProvider},getEthersProvider:()=>{if(!s||!s.wallet)return new Bu(new go(new je));let c=u.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(g=>g.address===c?.address));return!c||!p?new Bu(new go(new je)):new Bu(new go(p.proxyProvider))},getWeb3jsProvider:()=>{if(!s||!s.wallet)return new an(new je);let c=u.find(h=>s.wallet&&h.address===s.wallet.address),p=t.connectors?.walletConnectors.find(h=>h.wallets.find(g=>g.address===c?.address));return!c||!p?new an(new je):new an(p.proxyProvider)},unlinkWallet:async c=>{let p=await t.unlinkWallet(c);return d(p),p},unlinkEmail:async c=>{let p=await t.unlinkEmail(c);return d(p),p},unlinkPhone:async c=>{let p=await t.unlinkPhone(c);return d(p),p},unlinkGoogle:async c=>{let p=await t.unlinkOAuth("google",c);return d(p),p},unlinkTwitter:async c=>{let p=await t.unlinkOAuth("twitter",c);return d(p),p},unlinkDiscord:async c=>{let p=await t.unlinkOAuth("discord",c);return d(p),p},unlinkGithub:async c=>{let p=await t.unlinkOAuth("github",c);return d(p),p},unlinkSpotify:async c=>{let p=await t.unlinkOAuth("spotify",c);return d(p),p},unlinkInstagram:async c=>{let p=await t.unlinkOAuth("instagram",c);return d(p),p},unlinkTiktok:async c=>{let p=await t.unlinkOAuth("tiktok",c);return d(p),p},unlinkLinkedIn:async c=>{let p=await t.unlinkOAuth("linkedin",c);return d(p),p},unlinkApple:async c=>{let p=await t.unlinkOAuth("apple",c);return d(p),p},unlinkFarcaster:async c=>{let p=await t.unlinkFarcaster(c);return d(p),p},unlinkTelegram:async c=>{let p=await t.unlinkTelegram(c);return d(p),p},unlinkPasskey:async c=>{let p=await t.unlinkPasskey(c);return d(p),p},unlinkCrossAppAccount:async({subject:c})=>{let p=s?.linkedAccounts.find(g=>g.type==="cross_app"&&g.subject===c)?.providerApp;if(!p)throw new v("Invalid subject");t.storeProviderAccessToken(p.id,null);let h=await t.unlinkOAuth(`privy:${p.id}`,c);return d(h),h},setActiveWallet:async c=>{let p=u.find(g=>Si(g.address)===Si(c)),h=s?.linkedAccounts.find(g=>g.type==="wallet"&&Si(g.address)===Si(c));if(!p||!await p.isConnected())Z({externalConnectWallet:{suggestedAddress:c}}),lo();else if(!p.linked)p.loginOrLink();else{let g=Object.assign({},s);g.wallet=h&&{address:h.address,chainType:h.chainType,chainId:h.chainId,walletClient:h.walletClient,walletClientType:h.walletClientType,connectorType:h.connectorType,imported:h.imported,walletIndex:h.walletIndex},d(g)}},forkSession:()=>t.forkSession(),createWallet:async c=>{if(c&&"target"in c&&c&&(c=void 0),!a||!s)throw D(L,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return ze(s,15e3,c)},setWalletRecovery:async c=>Gu({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:c?.showAutomaticRecovery??!1}),setWalletPassword:async()=>Gu({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(c,p,h)=>new Promise(async(g,b)=>{let{requesterAppId:O}=p||{};if(!a||!s){D(L,"signMessage","onError","must_be_authenticated"),b(new Error("User must be authenticated before signing with a Privy wallet"));return}let z=h??Ue(s)?.address;if(!z)throw new v("User must have an embedded wallet to sign a message.");let{signingWallet:G,rootWallet:oe}=nl(s,z);if(!G||!oe){D(L,"signMessage","onError","embedded_wallet_not_found"),b(new Error("Must have a Privy wallet before signing"));return}if(typeof c!="string"||c.length<1){D(L,"signMessage","onError","invalid_message"),b(new Error("Message must be a non-empty string"));return}q(!0);let ce=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let Pe=await ve();if(!x||!Pe)throw new Error("Unable to connect to wallet");if(!await ee.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:G.address,requesterAppId:O}});let{response:en}=await x.rpc({accessToken:Pe,address:oe.address,hdWalletIndex:G.walletIndex??void 0,requesterAppId:O,request:{method:"personal_sign",params:[c,G.address]}}),Pr=en.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:G.address,requesterAppId:O}}),Pr};if(W.embeddedWallets.noPromptOnSignature){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Pe=await ce();D(L,"signMessage","onSuccess",Pe),g(Pe)}catch(Pe){D(L,"signMessage","onError","unable_to_sign"),b(Pe??new bt("Unable to sign message"))}}else{let en={method:"personal_sign",data:c,confirmAndSign:ce,onSuccess:Ar=>{D(L,"signMessage","onSuccess",Ar),g(Ar)},onFailure:Ar=>{D(L,"signMessage","onError","unable_to_sign"),b(Ar)},uiOptions:p||{}},Pr={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Ar=>{D(L,"signMessage","onError","unknown_connect_wallet_error"),b(Ar)},address:oe.address};Z({signMessage:en,connectWallet:Pr}),j("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(c,p,h)=>new Promise(async(g,b)=>{let{requesterAppId:O}=p||{};if(!a||!s){D(L,"signTypedData","onError","must_be_authenticated"),b(new Error("User must be authenticated before signing with a Privy wallet"));return}let z=h??Ue(s)?.address;if(!z)throw new v("User must have an embedded wallet to sign a message.");let{signingWallet:G,rootWallet:oe}=nl(s,z);if(!oe||!G){D(L,"signTypedData","onError","embedded_wallet_not_found"),b(new Error("Must have a Privy wallet before signing"));return}q(!0);let ce=Oa(c),Pe=async()=>{if(!a)throw new Error("User must be authenticated before signing with a Privy wallet");let xe=await ve();if(!x||!xe)throw new Error("Unable to connect to wallet");if(!await ee.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:G.address,requesterAppId:O}});let{response:Pr}=await x.rpc({accessToken:xe,address:oe.address,hdWalletIndex:G.walletIndex??void 0,requesterAppId:O,request:{method:"eth_signTypedData_v4",params:[G.address,ce]}}),Ar=Pr.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:G.address,requesterAppId:O}}),Ar};if(W.embeddedWallets.noPromptOnSignature||(W.legacyWalletUiConfig??!1)){p&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let xe=await Pe();D(L,"signTypedData","onSuccess",xe),g(xe)}catch(xe){D(L,"signTypedData","onError","unable_to_sign"),b(xe??new bt("Unable to sign message"))}}else{let Pr={method:"eth_signTypedData_v4",data:ce,confirmAndSign:Pe,onSuccess:Xt=>{D(L,"signTypedData","onSuccess",Xt),g(Xt)},onFailure:Xt=>{D(L,"signTypedData","onError","unable_to_sign"),b(Xt)},uiOptions:p||{}},Ar={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Xt=>{D(L,"signMessage","onError","unknown_connect_wallet_error"),b(Xt)}};Z({signMessage:Pr,connectWallet:Ar}),j("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(c,p,h,g)=>{let O=await(await Hu(c,p,h,g)).wait();return Id(O)},exportWallet:c=>new Promise(async(p,h)=>{if(!a||!s){h(new Error("User must be authenticated before exporting their Privy wallet"));return}c&&"target"in c&&c&&(c=void 0);let g=c?.address,b=s.linkedAccounts.filter(ce=>ce.type==="wallet"&&ce.walletClientType==="privy"&&ce.chainType==="ethereum"),O=g?b.find(ce=>ce.address===Si(g)):b.find(ce=>!ce.imported)||b[0];if(!O){h(new Error("Must have a Privy wallet before exporting"));return}q(!0);let z={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:h,address:O.address,shouldForceMFA:!0};if(Z(pe),!await ve()||!x){h(new Error("Must have valid access token to enroll in MFA"));return}if(!x){h(new Error("Must have a Privy wallet before exporting"));return}let oe={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:O,onSuccess:p,onFailure:h};Z({keyExport:oe,connectWallet:z}),j("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:Vu,async init(c){switch(c){case"sms":await t.initMfaSmsVerification();return;case"passkey":return await t.initMfaPasskeyVerification();case"totp":return;default:throw new Error(`Unsupported MFA method: ${c}`)}},async submit(c,p){switch(c){case"totp":case"sms":if(typeof p!="string")throw new v("Invalid MFA code");Ot.current?.resolve({mfaMethod:c,mfaCode:p,relyingParty:window.origin}),await new Promise((O,z)=>{zr.current={resolve:O,reject:z}});break;case"passkey":if(typeof p=="string")throw new v("Invalid authenticator response");let g=await(await import("@simplewebauthn/browser")).startAuthentication(p),b=H0(g);Ot.current?.resolve({mfaMethod:c,mfaCode:b,relyingParty:window.origin}),await new Promise((O,z)=>{zr.current={resolve:O,reject:z}});break;default:throw Ot.current?.reject(new v("Unsupported MFA method")),new v(`Unsupported MFA method: ${c}`)}},cancel(){Ot.current?.reject(new v("MFA canceled"))},async initEnrollmentWithSms(c){let p=await ve();if(!p||!x)throw new Error("Must have valid access token to enroll in MFA");await x.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:c.phoneNumber})},enrollInMfa(c){return new Promise((p,h)=>{if(!c){ee.closePrivyModal(),p();return}W.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."),Z({mfaEnrollmentFlow:{mfaMethods:W.mfa.methods,onSuccess:p,onFailure:h}}),j("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let c=await ve();if(!c||!x)throw new Error("Must have valid access token to enroll in MFA");let p=await x.initEnrollMfa({method:"totp",accessToken:c});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(c){let p=await ve();if(!p||!x)throw new Error("Must have valid access token to enroll in MFA");await x.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:c.phoneNumber,code:c.mfaCode});let h=await t.getAuthenticatedUser();d(h)},async submitEnrollmentWithTotp(c){let p=await ve();if(!p||!x)throw new Error("Must have valid access token to enroll in MFA");await x.submitEnrollMfa({method:"totp",accessToken:p,code:c.mfaCode});let h=await t.getAuthenticatedUser();d(h)},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:c}){let p=await ve();if(!p||!x)throw new Error("Must have valid access token to enroll in MFA");await x.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:c});let h=await t.getAuthenticatedUser();d(h)},async unenroll(c){let p=await ve();if(!p||!x)throw new Error("Must have valid access token to remove MFA");c==="passkey"?await x.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:[]}):await x.unenrollMfa({method:c,accessToken:p});let h=await t.getAuthenticatedUser();d(h)},requestFarcasterSignerFromWarpcast:async()=>{let c=await ve(),p=s?.linkedAccounts.find(b=>b.type==="wallet"&&b.walletClientType==="privy");if(!c)throw new Error("Must have valid access token to connect with Farcaster");if(!x||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await ee.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");let g=await x.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:c,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(g.status==="approved"){let b=await t.getAuthenticatedUser();d(b||s||null)}Z({farcasterSigner:g}),j("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let c=await ve(),p=s?.linkedAccounts.find(b=>b.type==="wallet"&&b.walletClientType==="privy");if(!c)throw new Error("Must have valid access token to connect with Farcaster");if(!x||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!s?.farcaster?.fid)throw new Error("Must have Farcaster account to use Farcaster signers");if(!await ee.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(b=>Uint8Array.from(b.match(/.{1,2}/g).map(O=>parseInt(O,16))))(s.farcaster.signerPublicKey.slice(2))},signFarcasterMessage:async c=>{let p=await ve(),h=s?.linkedAccounts.find(z=>z.type==="wallet"&&z.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!x||!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 ee.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 b=await import("@simplewebauthn/browser"),O=await x.signFarcasterMessage({address:h.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{hash:b.bufferToBase64URLString(c)},fid:BigInt(s.farcaster.fid),relyingParty:window.origin});return new Uint8Array(b.base64URLStringToBuffer(O.signature))},createGuestAccount:async()=>{if(s&&!s.isGuest)throw new Error("User cannot already be authenticated to create a guest account");return s?.isGuest?s:ee.loginWithGuestAccountFlow()},isHeadlessOAuthLoading:T,loginWithCode(c){return ee.loginWithCode(c)},initLoginWithEmail(c){return ee.initLoginWithEmail(c)},initLoginWithSms(c){return ee.initLoginWithSms(c)},otpState:N,fundWallet(c,p){return ee.fundWallet(c,p)},initLoginWithHeadlessOAuth(c,p){return ee.initLoginWithHeadlessOAuth(c,p)},loginWithHeadlessOAuth(c){return ee.loginWithHeadlessOAuth(c)},generateSiweMessage({address:c,chainId:p}){return ee.generateSiweMessage({address:c,chainId:p})},linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:g,connectorType:b}){return De("siwe"),ee.linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:g,connectorType:b})},signMessageWithCrossAppWallet(c,{address:p}){return Vc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"personal_sign",params:[c,p]},reconnect:Ks})},signTypedDataWithCrossAppWallet(c,{address:p}){let h=Oa(c);return Vc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"eth_signTypedData_v4",params:[p,h]},reconnect:Ks})},sendTransactionWithCrossAppWallet(c,{address:p}){return Vc({user:s,client:t,address:p,requesterAppId:W.id,request:{method:"eth_sendTransaction",params:[c]},reconnect:Ks})},setCustomMetadata(c){return ee.setCustomMetadataForUser(c)},isModalOpen:r,mfaMethods:W.mfa.methods};G0=Ai.signMessage,q0=Ai.signTypedData,z0=async(...c)=>{let p=await Hu(...c);return W.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let ee=(()=>({isNewUserThisSession:C,pendingTransaction:null,walletConnectionStatus:S,connectors:t.connectors?.walletConnectors??[],rpcConfig:W.rpcConfig,chains:W.chains,appId:e.appId,showFiatPrices:W.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,customAuthStatus:le,nativeTokenSymbolForChainId:c=>W.chains.find(p=>p.id===Number(c))?.nativeCurrency.symbol,initializeWalletProxy:async c=>{if(x)return x;let p=new Promise(b=>{be(()=>O=>b(O))}),h=new Promise(b=>setTimeout(()=>b(null),c)),g=await Promise.race([p,h]);return be(null),g},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:async(c={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&a&&s,h;p&&U.current&&(h=zs(s)),Y.current==="login"?c.shouldCallAuthOnSuccess&&p&&U.current?(D(L,"login","onComplete",s,C,!1,U.current,h??null),e.onSuccess?.(s,C)):D(L,"login","onError","exited_auth_flow"):Y.current==="link"&&h&&(c.isSuccess&&p&&U.current?D(L,"linkAccount","onSuccess",s,U.current,h):U.current&&D(L,"linkAccount","onError","exited_link_flow",{linkMethod:U.current}));let g=P&&xu.includes(P),b=P==="ERROR_SCREEN"&&pe.errorModalData&&xu.includes(pe.errorModalData.previousScreen);if((g||b)&&pe.funding){let O=V3[P]??null,z=Rr(pe.funding.chain.id,W.chains,W.rpcConfig,{appId:e.appId}),G;try{G=(await z.getBalance(pe.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}D(L,"fundWallet","onUserExited",{address:pe.funding.address,chain:pe.funding.chain,fundingMethod:O,balance:G})}Z({...pe,externalConnectWallet:{suggestedAddress:void 0}}),Y.current=null,U.current=null,w(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:async({message:c})=>new Promise(async(p,h)=>{let g=async()=>{let b=await t.getAccessToken();if(!b)throw new Error("User must be authenticated to use their embedded wallet.");if(!f)throw new Error("User must have an embedded Solana wallet to sign messages for Solana.");let O=ee.walletProxy??await ee.initializeWalletProxy(15e3);if(!O)throw new Error("Failed to initialize embedded wallet proxy.");let{response:z}=await O.rpcSolana({accessToken:b,publicKey:f.address,request:{method:"signMessage",params:{message:c}}});return z.data.signature};if(W.embeddedWallets.noPromptOnSignature)try{let b=await g();p({signature:b})}catch(b){h(b)}else Z({signMessage:{method:"solana_signMessage",data:c,confirmAndSign:g,onSuccess:G=>{p({signature:G})},onFailure:G=>{h(G)},uiOptions:{}}}),Oe("EMBEDDED_WALLET_SIGN_REQUEST_SCREEN")}),openPrivyModal:j,connectWallet:Pi,initLoginWithWallet:async(c,p,h)=>{U.current="siwe",Kr(c,p,h)},loginWithWallet:async()=>{if(!n)throw new Bn;if(!(t.authFlow instanceof Ho))throw new v("Must initialize SIWE flow first.");let c=await t.getAccessToken(),p,h;if(c!==null)try{({user:p}=await t.link()),U.current="siwe"}catch(g){throw D(L,"linkAccount","onError",g.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),g}else try{({user:p,isNewUser:h}=await t.authenticate()),U.current="siwe"}catch(g){throw D(L,"login","onError",g.privyErrorCode||"generic_connect_wallet_error"),g}d(p||s||null),w(h||!1),l(!0)},initLoginWithFarcaster:async(c,p)=>{let h=new Va(c,p);t.startAuthFlow(h);try{U.current="farcaster",await h.initializeFarcasterConnect()}catch(g){throw Y.current==="login"?D(L,"login","onError",g.privyErrorCode||"unknown_auth_error"):Y.current==="link"&&D(L,"linkAccount","onError",g.privyErrorCode||"unknown_auth_error",{linkMethod:"farcaster"}),g}},loginWithFarcaster:async()=>{if(!n)throw new Bn;if(!(t.authFlow instanceof Va))throw new v("Must initialize Farcaster flow first.");let c=await t.getAccessToken(),p,h;if(c!==null)try{({user:p}=await t.link()),U.current="farcaster"}catch(g){throw D(L,"linkAccount","onError",g.privyErrorCode||"failed_to_link_account",{linkMethod:"farcaster"}),g}else try{({user:p,isNewUser:h}=await t.authenticate()),U.current="farcaster"}catch(g){throw D(L,"login","onError",g.privyErrorCode||"unknown_auth_error"),g}d(p||null),w(h||!1),l(!0)},async loginWithGuestAccountFlow(){let c=new Di(this.appId);t.startAuthFlow(c);try{Y.current="login",U.current="guest";let p=await t.authenticate(),{user:h,isNewUser:g}=p;if(g=g||!1,!h)throw new v("Unable to authenticate guest account");if(vt(h,W.embeddedWallets.createOnLogin))try{await ze(h,15e3),h=await ee.refreshUser()}catch{d(h),console.warn("Unable to create embedded wallet for guest account")}else d(h);return w(g),l(!0),D(L,"login","onComplete",h,g,!1,"guest",null),h}catch(p){throw D(L,"login","onError",p.privyErrorCode||"unknown_auth_error"),p}},async crossAppAuthFlow({appId:c,popup:p,action:h}){let g=`privy:${c}`;U.current=g;let{url:b,stateCode:O,codeVerifier:z}=await p1({api:t.api,appId:c});if(!b)throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:c}}),new v("No authorization URL returned for cross-app auth.");try{let G=await B0({url:b,popup:p,provider:g}),oe=G.stateCode,ce=G.authorizationCode;if(oe!==O)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:g,storedStateCode:O??"",returnedStateCode:oe??""}}),new v("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let Pe=await u1({appId:c,codeVerifier:z,stateCode:oe,authorizationCode:ce,action:h,client:t});Pe&&t.storeProviderAccessToken(c,Pe);let xe=await ee.refreshUser();if(!xe)throw new v("Unable to update user");return t.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:c}}),xe}catch(G){throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:G.toString(),provider:g}}),G}},async initLoginWithOAuth(c,p,h){if(U.current=c,La()){if(c==="google"&&oa(window.navigator.userAgent)){Oe("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{Oe("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}c==="twitter"&&window.opener&&window.opener.postMessage({type:Fd},"*"),X.del(zn),X.del(Kn);let g=new ho({provider:c,disableSignup:!!h});p&&g.addCaptchaToken(p),t.startAuthFlow(g);let b=await t.authFlow.getAuthorizationUrl();b&&b.url&&(c==="twitter"&&sP&&(b.url=b.url.replace("x.com","twitter.com")),window.location.assign(b.url))},async initLoginWithTelegram(c,p){if(!n)throw new Bn;U.current="telegram";let h=new Bi(c,p);t.startAuthFlow(h),h.meta.telegramWebAppData=void 0,h.meta.telegramAuthResult=await new Promise((g,b)=>{if(!W.loginConfig.telegramAuthConfiguration)return b(new v("Telegram Auth configuration is not loaded"));if(!window.Telegram)return b(new v("Telegram was not initialized"));window.Telegram.Login.auth({bot_id:W.loginConfig.telegramAuthConfiguration.botId,request_access:!0},O=>O?g(O):b(new v("Telegram auth failed or was canceled by the client")))})},async loginWithTelegram(){if(!(t.authFlow instanceof Bi))throw new v("Must initialize Telegram flow before calling loginWithTelegram");let c,p;if(Y.current==="login")try{let h=await t.authenticate();c=h.user,p=h.isNewUser,U.current="telegram"}catch(h){throw D(L,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}else if(Y.current==="link")try{c=(await t.link()).user,U.current="telegram"}catch(h){throw D(L,"linkAccount","onError",h.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),h}else throw new v("Unknown auth intent");d(c),w(p||!1),l(!0)},async recoveryOAuthFlow(c,p,h){let g,b;function O(z){if(!z)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:c}}),new v("Recovery OAuth failed")}switch(c){case"google-drive":{let{url:z,codeVerifier:G,stateCode:oe}=await kp({api:$o.api,provider:c});O(z);let ce,Pe;try{let xe=await Fu({url:z,popup:h,provider:c});if(ce=xe.stateCode,Pe=xe.authorizationCode,ce!==oe)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c,storedStateCode:oe??"",returnedStateCode:ce??""}}),new v("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected")}catch(xe){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:xe.toString(),provider:c}}),new v("Recovery OAuth failed")}[g,b]=await Promise.all([ve(),my({api:$o.api,provider:c,codeVerifier:G,stateCode:ce,authorizationCode:Pe})]);break}case"icloud":{let{url:z}=await kp({api:$o.api,provider:c});O(z);let{ckWebAuthToken:G}=await Fu({url:z,popup:h,provider:c});b=G,g=await ve();break}}if(!x)throw new v("Cannot connect to wallet proxy");if(!g)throw new v("Unable to authorize user");switch(p){case"recover":let z=pe.recoverWallet?.privyWallet?.address;if(!z)throw new v("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:z,recoveryMethod:c}}),await x.recover({address:z,accessToken:g,recoveryAccessToken:b,recoveryMethod:c}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:z,recoveryMethod:c}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await x.create({accessToken:g,recoveryAccessToken:b,recoveryMethod:c});let G=await ee.refreshUser(),oe=Ue(G);if(!oe)throw D(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:oe.address}}),D(L,"createWallet","onSuccess",oe);break;case"set-recovery":let ce=Ue(s);if(!ce)throw D(L,"setWalletRecovery","onError","embedded_wallet_not_found"),new Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:ce.address,existingRecoveryMethod:ce.recoveryMethod,targetRecoveryMethod:c}}),await x.setRecovery({address:ce.address,accessToken:g,recoveryAccessToken:b,recoveryMethod:c});let Pe=Ue(await ee.refreshUser());if(!Pe)throw D(L,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:ce.address,existingRecoveryMethod:ce.recoveryMethod,targetRecoveryMethod:c}}),D(L,"setWalletRecovery","onSuccess",c,Pe);break;default:throw new v("Unsupported recovery action")}},async loginWithOAuth(c){if(!(t.authFlow instanceof ho))throw new v("Must initialize OAuth flow before calling loginWithOAuth");let p=X.get(Gn),h=t.authFlow.meta.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c,storedStateCode:p??"",returnedStateCode:h??""}}),new v("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let g=await t.getAccessToken(),b,O,z;if(g!==null)try{let G=await t.link();b=G.user,z=G.oAuthTokens,U.current=c}catch(G){throw D(L,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account",{linkMethod:c}),G}else try{let G=await t.authenticate();b=G.user,O=G.isNewUser,z=G.oAuthTokens,U.current=c}catch(G){throw Y.current==="login"?D(L,"login","onError",G.privyErrorCode||"unknown_auth_error"):Y.current==="link"&&D(L,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account",{linkMethod:c}),G}return d(b),w(O||!1),l(!0),z&&b&&D(L,"oAuthAuthorization","onOAuthTokenGrant",z,{user:b}),z},async initLoginWithPasskey(c){let p=new Zn(c);t.startAuthFlow(p),Y.current="login";try{U.current="passkey",await p.initAuthenticationFlow()}catch(h){throw D(L,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}},async loginWithPasskey(){if(!n)throw new Bn;if(!(t.authFlow instanceof Zn))throw new v("Must initialize Passkey flow first.");if(U.current!=="passkey")throw new v("Must init login with Passkey flow first.");let c,p;try{U.current="passkey",{user:c,isNewUser:p}=await t.authenticate()}catch(h){throw D(L,"login","onError",h.privyErrorCode||"unknown_auth_error"),h}d(c),w(p||!1),l(!0)},async initLinkWithPasskey(c){let p=new Zn(c);t.startAuthFlow(p),Y.current="link",U.current="passkey";try{await p.initLinkFlow()}catch(h){throw D(L,"linkAccount","onError",h.privyErrorCode||"unknown_auth_error",{linkMethod:"passkey"}),h}},async linkWithPasskey(){if(!n)throw new Bn;if(!(t.authFlow instanceof Zn))throw new v("Must initialize Passkey flow first.");if(U.current!=="passkey")throw new v("Must init login with Passkey flow first.");let c;try{U.current="passkey",{user:c}=await t.link()}catch(p){throw D(L,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account",{linkMethod:"passkey"}),p}return d(c||s||null),c},async initLoginWithHeadlessOAuth(c,p){if(La()){if(c==="google"&&oa(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 ho({provider:c,headless:!0,disableSignup:!1});p&&h.addCaptchaToken(p);let g=await t.startAuthFlow(h).getAuthorizationUrl();g?.url&&window.location.assign(g.url)},async loginWithHeadlessOAuth(c){A(!0),t.startAuthFlow(new ho(c));let p=X.get(Gn),h=c.stateCode;if(p!==h)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:c.provider,storedStateCode:p??"",returnedStateCode:h??""}}),A(!1),new v("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let g=await t.getAccessToken(),b,O,z;if(g!==null)try{({user:b,oAuthTokens:z}=await t.link()),U.current=c.provider;let G=zs(b);b&&G&&D(L,"linkAccount","onSuccess",b,U.current,G)}catch(G){throw A(!1),D(L,"linkAccount","onError",G.privyErrorCode||"failed_to_link_account",{linkMethod:c.provider}),G}else try{({user:b,isNewUser:O,oAuthTokens:z}=await t.authenticate()),U.current=c.provider;let G=zs(b);b&&G&&O!==void 0&&Y.current==="login"&&D(L,"login","onComplete",b,O,!1,U.current,G)}catch(G){throw A(!1),D(L,"login","onError",G.privyErrorCode||"unknown_auth_error"),G}return d(b),w(O||!1),l(!0),A(!1),z&&b&&D(L,"oAuthAuthorization","onOAuthTokenGrant",z,{user:b}),b??void 0},initLoginWithEmail:async(c,p,h)=>{let g=new rn(c,p,h);t.startAuthFlow(g);try{U.current="email",await g.sendCodeEmail()}catch(b){throw Y.current==="login"?D(L,"login","onError",b.privyErrorCode||"unknown_auth_error"):Y.current==="link"&&D(L,"linkAccount","onError",b.privyErrorCode||"failed_to_link_account",{linkMethod:"email"}),b}},initUpdateEmail:async(c,p,h)=>{let g=new hl(c,p,h);t.startAuthFlow(g),await g.sendCodeEmail()},initUpdatePhone:async(c,p,h)=>{let g=new Wl(c,p,h);t.startAuthFlow(g),await g.sendSmsCode()},initLoginWithSms:async(c,p,h)=>{H({status:"sending-code"});let g=new on(c,p,h);t.startAuthFlow(g);try{U.current="sms",await g.sendSmsCode(),H({status:"awaiting-code-input"})}catch(b){throw H({status:"error",error:b}),Y.current==="login"?D(L,"login","onError",b.privyErrorCode||"unknown_auth_error"):Y.current==="link"&&D(L,"linkAccount","onError",b.privyErrorCode||"failed_to_link_account",{linkMethod:"sms"}),b}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async c=>{if(H({status:"submitting-code"}),!n){let g=new Bn;throw H({status:"error",error:g}),g}if(t.authFlow instanceof rn)t.authFlow.meta.emailCode=c.trim();else if(t.authFlow instanceof on)t.authFlow.meta.smsCode=c.trim();else{let g=new v("Must initialize a passwordless code flow first");throw H({status:"error",error:g}),g}await ve();let p,h;if(Y.current==="link")try{({user:p}=await t.link())}catch(g){throw H({status:"error",error:g}),D(L,"linkAccount","onError",g.privyErrorCode||"failed_to_link_account",{linkMethod:U.current}),g}else try{({user:p,isNewUser:h}=await t.authenticate())}catch(g){throw H({status:"error",error:g}),D(L,"login","onError",g.privyErrorCode||"unknown_auth_error"),g}d(p||s||null),w(h||!1),l(!0),H({status:"done"})},generateSiweMessage:async({address:c,chainId:p,captchaToken:h})=>{Y.current="link",U.current="siwe";let g=await t.generateSiweNonce({address:c,captchaToken:h}),b=p.replace("eip155:","");return Ml({address:c,chainId:b,nonce:g})},linkWithSiwe:async({message:c,signature:p,chainId:h,walletClientType:g,connectorType:b})=>{let O;try{O=await t.linkWithSiwe({message:c,signature:p,chainId:h,walletClientType:g,connectorType:b}),O=await ee.refreshUser()??O;let z=zs(O);z&&D(L,"linkAccount","onSuccess",O,"siwe",z)}catch(z){throw D(L,"linkAccount","onError",z.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),Y.current=null,U.current=null,z}d(O||s||null),Y.current=null,U.current=null},refreshUser:async()=>{let c=await t.getAuthenticatedUser();return l(!!c),d(c),c},walletProxy:x,createAnalyticsEvent:({eventName:c,payload:p,timestamp:h})=>t.createAnalyticsEvent({eventName:c,payload:p,timestamp:h}),acceptTerms:async()=>{let c=await t.acceptTerms();return d(c),c},getUsdTokenPrice:c=>t.getUsdTokenPrice(c),recoverEmbeddedEthereumWallet:async c=>new Promise(async(p,h)=>{let g=Ue(c?.user??s)||ol(c?.user??s),b=await ve();if(!b||!x||!g){h(new Error("Must have valid access token and Privy wallet to recover wallet"));return}q(!0);try{await x.connect({accessToken:b,address:g.address}),p(!0)}catch(O){if(ai(O)&&g.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:g.address}}),(await x.recover({address:g.address,accessToken:b,recoveryMethod:g.recoveryMethod})).address||h(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:g.address}}),p(!0);else if(ai(O)&&g.recoveryMethod!=="privy"){Z({recoverWallet:{privyWallet:g,onFailure:h,onSuccess:()=>p(!0)},recoveryOAuthStatus:{provider:g.recoveryMethod,action:"recover"}});let z=hc(g.recoveryMethod);j(z)}else h(O)}}),embeddedSolanaWallet:f,createEmbeddedSolanaWallet:async()=>{q(!0);let c=await ve(),p=await ee.refreshUser(),h=_i(p),g=Ue(p);if(!p||!c)throw new v("User must be logged in to create a Solana wallet");if(h)throw new v("User already has an embedded Solana wallet.");if(g)if(g.recoveryMethod==="privy")await ee.recoverEmbeddedEthereumWallet({user:p});else throw new v("Cannot create an embedded Solana wallet for a user with an existing Ethereum wallet with user-controlled recovery.");let b=await ee.initializeWalletProxy(15e3);if(!b)throw new v("Unable to initialize wallet proxy");t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await b.createSolana({accessToken:c,ethereumAddress:g?.address});let O=await ee.refreshUser(),z=_i(O);if(!z)throw new v("Could not get Solana wallet for user");return t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:z.address}}),z}catch(O){throw t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new v("Failed to create Solana embedded wallet with error ",O)}},exportSolanaWallet:c=>new Promise(async(p,h)=>{if(!a||!s){h(new Error("User must be authenticated before exporting their Privy wallet"));return}let g=c?.address,b=s.linkedAccounts.filter(oe=>oe.type==="wallet"&&oe.walletClientType==="privy"&&oe.chainType==="solana"),O=g?b.find(oe=>oe.address.toLowerCase()===g.toLowerCase()):b.find(oe=>!oe.imported)||b[0];if(!O){h(new Error("Must have a Privy wallet before exporting"));return}if(q(!0),!await ve()||!x){h(new Error("Must have valid access token to enroll in MFA"));return}if(!x){h(new Error("Must have a Privy wallet before exporting"));return}await ee.recoverEmbeddedSolanaWallet();let G={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:O,onSuccess:p,onFailure:h};Z({keyExport:G}),j("EMBEDDED_WALLET_KEY_EXPORT_SCREEN")}),recoverEmbeddedSolanaWallet:async()=>new Promise(async(c,p)=>{let h=_i(s),g=await ve();if(!g||!x||!h){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}q(!0);try{await x.connectSolana({accessToken:g,publicKey:h.address}),c(!0)}catch(b){ai(b)&&h.recoveryMethod==="privy"?(t.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:h.address}}),(await x.recoverSolana({publicKey:h.address,accessToken:g})).publicKey||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_solana_wallet_recovery_completed",payload:{walletAddress:h.address}}),c(!0)):p(b)}}),getMoonpaySignedUrl:co,initCoinbaseOnRamp:t.initCoinbaseOnRamp.bind(t),getCoinbaseOnRampStatus:t.getCoinbaseOnRampStatus.bind(t),setReadyToTrue:c=>{i(!0),ie?.(c)},updateWallets:()=>Oo(),fundWallet:async(c,p)=>{if(!W.fundingConfig||W.fundingConfig.methods.length===0)throw new Error("Wallet funding is not enabled");let h=Wd({fundingMethods:W.fundingConfig.methods});Z({funding:Au({address:c,appConfig:W,fundWalletConfig:p,methodScreen:h})}),j(h)},requestFarcasterSignerStatus:async c=>{let p=await ve(),h=s?.linkedAccounts.find(b=>b.type==="wallet"&&b.walletClientType==="privy");if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!x||!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 g=await t.requestFarcasterSignerStatus(c);if(g.status==="approved"){let b=await t.getAuthenticatedUser();d(b||s||null)}return g},connectCoinbaseSmartWallet:async()=>{W.externalWallets.coinbaseWallet.connectionOptions="smartWalletOnly";let c=t.connectors?.findWalletConnector("coinbase_wallet","coinbase_smart_wallet")||t.connectors?.findWalletConnector("coinbase_wallet","coinbase_wallet");if(c)return c.updateConnectionPreference("smartWalletOnly"),Pi(c);await Un("coinbase_wallet","coinbase_smart_wallet")},setCustomMetadataForUser:async c=>{try{let p=await t.setCustomMetadata(c);return d(p),D(L,"setCustomMetadata","onSuccess",p),p}catch(p){throw D(L,"setCustomMetadata","onError",p.privyErrorCode||"unknown_auth_error"),p}}}))();K0=ee.recoverEmbeddedEthereumWallet,Y0=ee.recoverEmbeddedSolanaWallet,Q0=ee.solanaSignMessage;let qu=aP(()=>({wallets:u,ready:ye&&Se}),[u,ye,Se]);return Sr(We.Provider,{value:Ai,children:Sr(xm.Provider,{value:L,children:Sr(Wm.Provider,{value:qu,children:Sr(ch,{...W,children:V0(Sm.Provider,{value:ee,children:[Sr(km,{children:V0(rh,{data:pe,setModalData:Z,setInitialScreen:_,initialScreen:P,authenticated:a,open:r,children:[e.children,!W.headless&&W.captchaEnabled&&n&&!a&&Sr(sp,{delayedExecution:!1}),Sr(E0,{theme:{...W.appearance.palette||{}}}),!W.render.standalone&&Sr(Du,{open:r})]})}),de&&Q?Sr(O0,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:s?.mfaMethods,mfaPromise:Ot,mfaSubmitPromise:zr,onLoad:K,onLoadFailed:()=>null}):null,W.loginConfig.telegramAuthConfiguration&&Sr(jr,{if:!0,children:Sr(W0,{scriptHost:e.apiUrl||js,botUsername:W.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};import{useCallback as X0,useEffect as hP}from"react";var yP=e=>{He("login",e);let t=Ee(),r=sl(),{initLoginWithHeadlessOAuth:o,loginWithHeadlessOAuth:n,isHeadlessOAuthLoading:i,ready:a,user:l}=V(),s=X0(async u=>{if(t.enabled&&t.status!=="success")throw new ur(t.error,null,"captcha_failure");return o(u.provider,t.token)},[o,t]),d=X0(async()=>{let u=Ka();if(l)return console.warn("Cannot login with OAuth when already logged in"),l;if(!u.inProgress)throw new Error("Cannot login with OAuth because no OAuth flow is in progress");if(!u.popupFlow)try{return await n(u)}catch(m){throw m}finally{Xn()}},[n]);return hP(()=>{let u=Ka();a&&r&&u.inProgress&&u.headless&&!u.popupFlow&&d()},[a,r]),{initOAuth:s,loginWithOAuth:d,loading:i}};import{useCallback as Z0}from"react";var gP=()=>{let e=Ee(),{initLoginWithEmail:t,loginWithCode:r}=V(),o=Z0(async({email:i})=>{if(!i)throw new Error("Email required to send OTP code");return t(i)},[t]),n=Z0(async({code:i})=>{if(e.enabled&&e.status==="error")throw new ur(e.error,null,"captcha_failure");return r(i)},[r,e.status]);return{sendCode:o,loginWithCode:n}};import{useCallback as J0}from"react";var CP=()=>{let e=Ee(),{initLoginWithSms:t,loginWithCode:r,otpState:o}=V(),n=J0(async({phoneNumber:a})=>{if(!a)throw new Error("SMS required to send OTP code");return t(a)},[t]),i=J0(async({code:a})=>{if(e.enabled&&e.status!=="success")throw new ur(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:n,loginWithCode:i,state:o}};import{useCallback as j0}from"react";var vP=()=>{let e=Ee(),{generateSiweMessage:t,linkWithSiwe:r}=V(),o=j0(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=j0(async({signature:i,message:a,chainId:l,walletClientType:s,connectorType:d})=>{if(e.enabled&&e.status!=="success")throw new ur(e.error,null,"captcha_failure");return r({message:a,signature:i,chainId:l,walletClientType:s,connectorType:d})},[r,e.status]);return{generateSiweMessage:o,linkWithSiwe:n}};import{useContext as wP}from"react";function bP(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:d,linkTiktok:u,linkSpotify:m,linkInstagram:f,linkTelegram:y,linkFarcaster:E}=wP(We);return He("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:a,linkDiscord:l,linkGithub:s,linkLinkedIn:d,linkTiktok:u,linkSpotify:m,linkInstagram:f,linkFarcaster:E,linkTelegram:y}}import{useContext as EP}from"react";function TP(e){let{createWallet:t}=EP(We);return He("createWallet",e),{createWallet:t}}var SP=()=>{let{embeddedSolanaWallet:e,exportSolanaWallet:t,createEmbeddedSolanaWallet:r}=M();return{createWallet:r,exportWallet:t,wallets:e?[e]:[]}};var PP=()=>{let{connectCoinbaseSmartWallet:e}=M();return{connectCoinbaseSmartWallet:e}};var AP=()=>{let{startCrossAppAuthFlow:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:n}=V();return{loginWithCrossAppAccount:({appId:i})=>e({appId:i,action:"login"}),linkCrossAppAccount:({appId:i})=>e({appId:i,action:"link"}),unlinkCrossAppAccount:t,signMessage:r,signTypedData:o,sendTransaction:n}};import{useContext as xP}from"react";function RP(e){let{sendTransaction:t}=xP(We);return He("sendTransaction",e),{sendTransaction:t}}import{useContext as kP}from"react";function _P(e){let{setWalletPassword:t}=kP(We);return He("setWalletPassword",e),{setWalletPassword:t}}import{useContext as IP}from"react";function MP(){let{createGuestAccount:e}=IP(We);return{createGuestAccount:e}}import{useContext as WP}from"react";function LP(e){let{setWalletRecovery:t}=WP(We);return He("setWalletRecovery",e),{setWalletRecovery:t}}import{useContext as NP}from"react";function OP(e){let{signMessage:t}=NP(We);return He("signMessage",e),{signMessage:t}}import{useContext as DP}from"react";function UP(e){let{signTypedData:t}=DP(We);return He("signTypedData",e),{signTypedData:t}}import{useContext as FP}from"react";var BP=()=>{let{isModalOpen:e}=FP(We);return{isOpen:e}};import{useContext as HP}from"react";function VP(e){let{getAccessToken:t}=HP(We);return He("accessToken",e),{getAccessToken:t}}function GP(e){let{authenticated:t,user:r}=V(),{initLoginWithOAuth:o}=M(),n=Mi();return He("oAuthAuthorization",e),{reauthorize:i=>qP(t,r,o,n,i.provider)}}var qP=async(e,t,r,o,n)=>{if(!e)throw o("linkAccount","onError","must_be_authenticated",{linkMethod:n}),new v("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some(a=>a.type.includes(n)))throw new v(`OAuth account of type ${n} not linked to the account.`);await r(n)};var zP=e=>{let{customAuthStatus:t}=M();return He("customAuth",e),{status:t}};var KP=$0;function $0(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=V();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}import{useContext as YP}from"react";function QP(e){let{setCustomMetadata:t}=YP(We);return He("setCustomMetadata",e),{setCustomMetadata:t}}function XP(e){return e.find(r=>r.walletClientType==="privy"&&r.connectorType==="embedded"&&!r.imported)??null}export{go as AsExternalProvider,sp as Captcha,Za as ConnectorManager,Du as LoginModal,Ja as PrivyClient,mP as PrivyProvider,je as PrivyProxyProvider,Zd as SUPPORTED_CHAINS,Vd as VERSION,jt as WalletConnector,n6 as addRpcUrlOverrideToChain,xp as errorIndicatesMaxMfaRetries,si as errorIndicatesMfaTimeout,li as errorIndicatesMfaVerificationFailed,ve as getAccessToken,XP as getEmbeddedConnectedWallet,PP as useConnectCoinbaseSmartWallet,oC as useConnectWallet,TP as useCreateWallet,AP as useCrossAppAccounts,zP as useCustomAuth,KP as useExperimentalFarcasterSigner,$0 as useFarcasterSigner,nC as useFundWallet,MP as useGuestAccounts,bP as useLinkAccount,vP as useLinkWithSiwe,rC as useLogin,gP as useLoginWithEmail,yP as useLoginWithOAuth,CP as useLoginWithSms,Jd as useLogout,ks as useMfa,no as useMfaEnrollment,BP as useModalStatus,GP as useOAuthTokens,V as usePrivy,lp as useRegisterMfaListener,RP as useSendTransaction,QP as useSetCustomMetadata,_P as useSetWalletPassword,LP as useSetWalletRecovery,OP as useSignMessage,UP as useSignTypedData,SP as useSolanaWallets,VP as useToken,Bo as useWallets};