@privy-io/react-auth 1.84.0 → 1.85.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3281 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } async function _asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkLEABMTNMjs = require('./chunk-LEABMTNM.js');var _chunk3AGMJGHJjs = require('./chunk-3AGMJGHJ.js');var _chunkXKAIXCX7js = require('./chunk-XKAIXCX7.js');var _address = require('@ethersproject/address');var _providers = require('@ethersproject/providers');var _mipd = require('mipd');var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _reactdevicedetect = require('react-device-detect'); var x2 = _interopRequireWildcard(_reactdevicedetect);var _jssdkcore = require('@privy-io/js-sdk-core');var _l="/api/v1/sessions",Ml="/api/v1/sessions/logout",cf="/api/v1/sessions/fork",Il="/api/v1/sessions/fork/recover",df="/api/v1/siwe/init",pf="/api/v1/siwe/authenticate",uf="/api/v1/siwe/link",mf="/api/v1/siwe/link_smart_wallet",ff="/api/v1/siwe/unlink",hf="/api/v1/siws/init",yf="/api/v1/siws/authenticate",gf="/api/v1/siws/link",Cf="/api/v1/siws/unlink",vf="/api/v1/farcaster/init",wf="/api/v1/farcaster/authenticate",bf="/api/v1/farcaster/link",Ef="/api/v1/farcaster/status",Tf="/api/v1/farcaster/unlink",Sf="/api/v1/passwordless/init",Pf="/api/v1/passwordless/authenticate",Af="/api/v1/passwordless/link",xf="/api/v1/passwordless/unlink",kf="/api/v1/passwordless/update",Rf="/api/v1/passwordless_sms/init",_f="/api/v1/passwordless_sms/link",Mf="/api/v1/passwordless_sms/unlink",If="/api/v1/passwordless_sms/authenticate",Wf="/api/v1/passwordless_sms/update",Wl="/api/v1/oauth/init",Ll="/api/v1/oauth/authenticate",Ol="/api/v1/oauth/link",Lf="/api/v1/oauth/unlink",Of="/api/v1/recovery/oauth/init",Nf="/api/v1/recovery/oauth/init_icloud",Df="/api/v1/recovery/oauth/authenticate",Uf="/api/v1/passkeys/link/init",Ff="/api/v1/passkeys/authenticate/init",Bf="/api/v1/passkeys/link",Hf="/api/v1/passkeys/authenticate",Vf="/api/v1/passkeys/unlink",Gf="/api/v1/telegram/authenticate",qf="/api/v1/telegram/link",zf="/api/v1/telegram/unlink";var Kf="/api/v1/mfa/passwordless_sms/init",Yf="/api/v1/mfa/passkeys/init",Qf="/api/v1/users/me/accept_terms",Nl="/api/v1/analytics_events",Xf="/api/v1/custom_jwt_account/authenticate",Zf="/api/v1/guest/authenticate",Jf="/api/v1/plugins/moonpay_on_ramp/sign",jf="/api/v1/funding/coinbase_on_ramp/init",$f="/api/v1/funding/coinbase_on_ramp/status";var za=class{constructor(t){this.meta={token:t}}async authenticate(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");try{let t=await this.api.post(Xf,{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 _chunkXKAIXCX7js.j.call(void 0, t)}}async link(){throw new Error("Unimplemented")}};var cn=class{constructor(t,r,o=!1){this.meta={email:t,captchaToken:r,disableSignup:o}}async authenticate(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new (0, _chunkXKAIXCX7js.g)("Email and email code must be set prior to calling authenticate.");try{let t=await this.api.post(Pf,{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 _chunkXKAIXCX7js.j.call(void 0, t)}}async link(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new (0, _chunkXKAIXCX7js.g)("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(Af,{email:this.meta.email,code:this.meta.emailCode})}catch(t){throw _chunkXKAIXCX7js.j.call(void 0, t)}}async sendCodeEmail(t,r){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");if(t&&(this.meta.email=t),r&&(this.meta.captchaToken=r),!this.meta.email)throw new (0, _chunkXKAIXCX7js.g)("Email must be set when initialzing authentication.");try{return await this.api.post(Sf,{email:this.meta.email,token:this.meta.captchaToken})}catch(o){throw _chunkXKAIXCX7js.j.call(void 0, o)}}},Dl=class extends cn{constructor(r,o,n){super(o,n);this.meta={email:o,captchaToken:n,oldAddress:r,disableSignup:!1}}async link(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new (0, _chunkXKAIXCX7js.g)("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(kf,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(r){throw _chunkXKAIXCX7js.j.call(void 0, r)}}};var Ul=e=>{let t;try{t=new URL(e).hostname}catch (e10){return}for(let[r,o]of Object.entries(Fl))if(t.includes(o.hostname))return{walletClientType:r,entry:o}};var Fl={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 eh(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}function th(e,t){let r=eh(t);if(r.deepLink)return sh(r.deepLink,e);if(r.universalLink)return bp(r.universalLink,e);throw new (0, _chunkXKAIXCX7js.g)(`Unsupported wallet ${t.id}`)}function rh(e,t){let r=eh(t);if(r.universalLink)return bp(r.universalLink,e)}var oh="WALLETCONNECT_DEEPLINK_CHOICE";function nh(){try{localStorage.removeItem(oh)}catch (e11){}}function ah({href:e,name:t}){try{localStorage.setItem(oh,JSON.stringify({href:e,name:t}))}catch (e12){}}function ih(e){return e.startsWith("http://")||e.startsWith("https://")}function sh(e,t){if(ih(e))return bp(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 bp(e,t){if(!ih(e))return sh(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let o=encodeURIComponent(t);return{redirect:`${r}wc?uri=${o}`,href:r}}function Bl(e,t){window.open(e,t,"noreferrer noopener")}var 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 os=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 (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");if(!this.meta.channelToken)throw new (0, _chunkXKAIXCX7js.g)("Auth flow must be initialized first");try{let t=await this.api.post(wf,{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 (0, _chunkXKAIXCX7js.g)("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 _chunkXKAIXCX7js.j.call(void 0, t)}}async link(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");try{return await this.api.post(bf,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(t){throw _chunkXKAIXCX7js.j.call(void 0, t)}}async _startChannelOnce(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");let t=await this.api.post(vf,{token:this.captchaToken});_reactdevicedetect.isMobile&&!_reactdevicedetect.isIOS&&t.connect_uri&&Bl(t.connect_uri,"_blank"),this._meta={...this._meta,connectUri:t.connect_uri,channelToken:t.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");if(!this.meta.channelToken)throw new (0, _chunkXKAIXCX7js.g)("Auth flow must be initialized first");let t=await this.api.get(Ef,{headers:{"farcaster-channel-token":this.meta.channelToken}});return t.state==="completed"?(this.message=t.message,this.signature=t.signature,this.fid=t.fid,!0):!1}};var _jose = require('jose'); var Fh = _interopRequireWildcard(_jose);async function lh(e){let t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return new Uint8Array(r)}function ns(e){return crypto.getRandomValues(new Uint8Array(e))}var Ka=class{constructor(t){this.meta={guestCredential:this.getOrCreateGuestCredential(t)}}getOrCreateGuestCredential(t){let r=_chunkXKAIXCX7js.E.call(void 0, t);if(_chunkLEABMTNMjs.a.call(void 0, )){if(_chunkLEABMTNMjs.b.get(r))return _chunkLEABMTNMjs.b.get(r);{let o=_jose.base64url.encode(ns(32));return _chunkLEABMTNMjs.b.put(r,o),o}}return _jose.base64url.encode(ns(32))}async authenticate(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");try{let t=await this.api.post(Zf,{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 _chunkXKAIXCX7js.j.call(void 0, t)}}async link(){throw new Error("Linking is not supported for the guest flow")}};var K0="S256",Y0="S256";function ea(){return _jose.base64url.encode(ns(36))}function Ya(){return ea()}async function Qa(e,t=K0){if(t==Y0){let r=await lh(e);return _jose.base64url.encode(r)}else return e}function ph(){let e=_chunkLEABMTNMjs.b.get(_chunkXKAIXCX7js.H);if(!e)throw new (0, _chunkXKAIXCX7js.g)("Authentication error.");return e}function Hl(){return!!_chunkLEABMTNMjs.b.get(_chunkXKAIXCX7js.I)}function uh(){return!!_chunkLEABMTNMjs.b.get(_chunkXKAIXCX7js.J)}var bo=class{constructor(t){let r=typeof t.headless=="boolean"?t.headless:Hl();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 (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new (0, _chunkXKAIXCX7js.g)("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if(this.meta.authorizationCode==="undefined")throw new (0, _chunkXKAIXCX7js.g)("User denied confirmation during OAuth flow");let t=ph();try{let r=await this.api.post(Ll,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return _chunkLEABMTNMjs.b.del(_chunkXKAIXCX7js.H),_chunkLEABMTNMjs.b.del(_chunkXKAIXCX7js.I),_chunkLEABMTNMjs.b.del(_chunkXKAIXCX7js.J),{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=_chunkXKAIXCX7js.j.call(void 0, r);throw o.privyErrorCode?new (0, _chunkXKAIXCX7js.g)(o.message||"Invalid code during OAuth flow.",void 0,o.privyErrorCode):o.message==="User denied confirmation during OAuth flow"?new (0, _chunkXKAIXCX7js.g)("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new (0, _chunkXKAIXCX7js.g)("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new (0, _chunkXKAIXCX7js.g)("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if(this.meta.authorizationCode==="undefined")throw new (0, _chunkXKAIXCX7js.g)("User denied confirmation during OAuth flow");let t=_chunkLEABMTNMjs.b.get(_chunkXKAIXCX7js.H);if(!t)throw new (0, _chunkXKAIXCX7js.g)("Authentication error.");try{let r=await this.api.post(Ol,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:t});return _chunkLEABMTNMjs.b.del(_chunkXKAIXCX7js.H),r}catch(r){throw _chunkXKAIXCX7js.j.call(void 0, r)}}async getAuthorizationUrl(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");if(!this.meta.provider)throw new (0, _chunkXKAIXCX7js.g)("Provider must be set when initializing OAuth authentication.");let t=ea();_chunkLEABMTNMjs.b.put(_chunkXKAIXCX7js.H,t);let r=Ya();_chunkLEABMTNMjs.b.put(_chunkXKAIXCX7js.G,r);let o=await Qa(t);this.meta.headless&&_chunkLEABMTNMjs.b.put(_chunkXKAIXCX7js.I,!0),this.meta.disableSignup&&_chunkLEABMTNMjs.b.put(_chunkXKAIXCX7js.J,!0);try{return await this.api.post(Wl,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:o,state_code:r})}catch(n){throw _chunkXKAIXCX7js.j.call(void 0, n)}}};function Ep(e){return e.charAt(0).toUpperCase()+e.slice(1)}var _jsxruntime = require('react/jsx-runtime');var Vl=({style:e,...t})=>_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]});var Gl=({style:e,...t})=>_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "g",{clipPath:"url(#clip0)",children:_jsxruntime.jsx.call(void 0, "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"})}),_jsxruntime.jsx.call(void 0, "defs",{children:_jsxruntime.jsx.call(void 0, "clipPath",{id:"clip0",children:_jsxruntime.jsx.call(void 0, "rect",{width:"71",height:"55",fill:"white"})})})]});var ql=({style:e,...t})=>_jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, "path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})});var _GlobeAltIcon = require('@heroicons/react/24/outline/GlobeAltIcon'); var _GlobeAltIcon2 = _interopRequireDefault(_GlobeAltIcon);var hh=({style:e})=>_jsxruntime.jsx.call(void 0, _GlobeAltIcon2.default,{style:{color:"var(--privy-color-error)",...e}});var Kl=({style:e,...t})=>_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"})]});function Ql(e){return _jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsxs.call(void 0, "defs",{children:[_jsxruntime.jsxs.call(void 0, "linearGradient",{id:"b",children:[_jsxruntime.jsx.call(void 0, "stop",{offset:"0",stopColor:"#3771c8"}),_jsxruntime.jsx.call(void 0, "stop",{stopColor:"#3771c8",offset:".128"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),_jsxruntime.jsxs.call(void 0, "linearGradient",{id:"a",children:[_jsxruntime.jsx.call(void 0, "stop",{offset:"0",stopColor:"#fd5"}),_jsxruntime.jsx.call(void 0, "stop",{offset:".1",stopColor:"#fd5"}),_jsxruntime.jsx.call(void 0, "stop",{offset:".5",stopColor:"#ff543e"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"#c837ab"})]}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"})]}),_jsxruntime.jsx.call(void 0, "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)"}),_jsxruntime.jsx.call(void 0, "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)"}),_jsxruntime.jsx.call(void 0, "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"})]})}function Zl({style:e,...t}){return _jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, "g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:_jsxruntime.jsx.call(void 0, "g",{transform:"scale(5.12,5.12)",children:_jsxruntime.jsx.call(void 0, "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"})})})})}function Jl(e){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"})]})}function jl(e){return _jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}var $l=({style:e,...t})=>_jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, "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 Ch={google:{name:"Google",component:Kl},discord:{name:"Discord",component:Gl},github:{name:"Github",component:ql},linkedin:{name:"LinkedIn",component:Zl},twitter:{name:"Twitter",component:$l},spotify:{name:"Spotify",component:Jl},instagram:{name:"Instagram",component:Ql},tiktok:{name:"Tiktok",component:jl},apple:{name:"Apple",component:Vl}},is=e=>e in Ch?Ch[e]:{name:"Unknown",component:hh};function vh(e,t){let r={detail:"",retryable:!1},o=Ep(t);if(_optionalChain([e, 'optionalAccess', _10 => _10.privyErrorCode])==="linked_to_another_user"&&(r.detail="This account has already been linked to another user."),_optionalChain([e, 'optionalAccess', _11 => _11.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),_optionalChain([e, 'optionalAccess', _12 => _12.privyErrorCode])==="too_many_requests"&&(r.detail="Too many requests. Please wait before trying again."),_optionalChain([e, 'optionalAccess', _13 => _13.privyErrorCode])==="too_many_requests"&&e.message.includes("provider rate limit")){let n=is(t).name;r.detail=`Request limit reached for ${n}. Please wait a moment and try again.`}if(_optionalChain([e, 'optionalAccess', _14 => _14.privyErrorCode])==="oauth_account_suspended"){let n=is(t).name;r.detail=`Your ${n} account is suspended. Please try another login method.`}return _optionalChain([e, 'optionalAccess', _15 => _15.privyErrorCode])==="cannot_link_more_of_type"&&(r.detail="You cannot authorize more than one account for this user."),_optionalChain([e, 'optionalAccess', _16 => _16.privyErrorCode])==="oauth_unexpected"&&t.startsWith("privy:")&&(r.detail="Something went wrong. Please try again."),r}function ss(){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 (e13){}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:o,headless:Hl(),popupFlow:window.opener!==null&&n,disableSignup:uh()}}function ta(){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"),_chunkLEABMTNMjs.b.del(_chunkXKAIXCX7js.G),window.history.replaceState({},"",e)}var ra=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 (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let t=await Promise.resolve().then(() => _interopRequireWildcard(require("@simplewebauthn/browser")));if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new (0, _chunkXKAIXCX7js.g)("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(Hf,{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 (0, _chunkXKAIXCX7js.g)("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):_chunkXKAIXCX7js.j.call(void 0, r)}}async link(){let t=await Promise.resolve().then(() => _interopRequireWildcard(require("@simplewebauthn/browser")));if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");if(!t.browserSupportsWebAuthn())throw new (0, _chunkXKAIXCX7js.g)("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(Bf,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(o)})}catch(r){throw r.name==="NotAllowedError"?new (0, _chunkXKAIXCX7js.g)("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):_chunkXKAIXCX7js.j.call(void 0, r)}}async _initAuthenticateOnce(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");return await this.api.post(Ff,{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");return await this.api.post(Uf,{})}_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:_optionalChain([t, 'access', _17 => _17.exclude_credentials, 'optionalAccess', _18 => _18.map, 'call', _19 => _19(r=>({id:r.id,type:r.type,transports:r.transports}))]),authenticatorSelection:{authenticatorAttachment:_optionalChain([t, 'access', _20 => _20.authenticator_selection, 'optionalAccess', _21 => _21.authenticator_attachment]),requireResidentKey:_optionalChain([t, 'access', _22 => _22.authenticator_selection, 'optionalAccess', _23 => _23.require_resident_key]),residentKey:_optionalChain([t, 'access', _24 => _24.authenticator_selection, 'optionalAccess', _25 => _25.resident_key]),userVerification:_optionalChain([t, 'access', _26 => _26.authenticator_selection, 'optionalAccess', _27 => _27.user_verification])},attestation:t.attestation,extensions:{appid:_optionalChain([t, 'access', _28 => _28.extensions, 'optionalAccess', _29 => _29.app_id]),credProps:_optionalChain([t, 'access', _30 => _30.extensions, 'optionalAccess', _31 => _31.cred_props, 'optionalAccess', _32 => _32.rk]),hmacCreateSecret:_optionalChain([t, 'access', _33 => _33.extensions, 'optionalAccess', _34 => _34.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:_optionalChain([t, 'access', _35 => _35.allow_credentials, 'optionalAccess', _36 => _36.map, 'call', _37 => _37(r=>({id:r.id,type:r.type,transports:r.transports}))])||[],timeout:t.timeout,extensions:{appid:_optionalChain([t, 'access', _38 => _38.extensions, 'optionalAccess', _39 => _39.app_id]),credProps:_optionalChain([t, 'access', _40 => _40.extensions, 'optionalAccess', _41 => _41.cred_props]),hmacCreateSecret:_optionalChain([t, 'access', _42 => _42.extensions, 'optionalAccess', _43 => _43.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 ec=({address:e,chainId:t,nonce:r})=>{let o=window.location.host,n=window.location.origin,a="By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.",i=new Date().toISOString();return`${o} wants you to sign in with your Ethereum account:
2
+ ${e}
3
+
4
+ ${a}
5
+
6
+ URI: ${n}
7
+ Version: 1
8
+ Chain ID: ${t}
9
+ Nonce: ${r}
10
+ Issued At: ${i}
11
+ Resources:
12
+ - https://privy.io`};var zo=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 (0, _chunkXKAIXCX7js.g)("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 _chunkXKAIXCX7js.j.call(void 0, t)}}async link(){if(!this.client)throw new (0, _chunkXKAIXCX7js.g)("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 _chunkXKAIXCX7js.j.call(void 0, t)}}async sign(){if(!this.client)throw new (0, _chunkXKAIXCX7js.g)("SiweFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new (0, _chunkXKAIXCX7js.g)("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 (0, _chunkXKAIXCX7js.g)("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new (0, _chunkXKAIXCX7js.g)("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=ec({address:t,chainId:r,nonce:this.nonce}),this.preparedMessage}};var wh=({address:e,nonce:t})=>{let r=window.location.host,o=window.location.origin,n=`You are proving you own ${e}.`,a=new Date().toISOString();return`${r} wants you to sign in with your Solana account:
13
+ ${e}
14
+
15
+ ${n}
16
+
17
+ URI: ${o}
18
+ Version: 1
19
+ Chain ID: mainnet
20
+ Nonce: ${t}
21
+ Issued At: ${a}
22
+ Resources:
23
+ - https://privy.io`};var oa=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 (0, _chunkXKAIXCX7js.g)("SiwsFlow has no client instance");try{let{message:t,signature:r}=await this.sign(),o=await this.client.authenticateWithSiwsInternal({message:t,signature:r,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 _chunkXKAIXCX7js.j.call(void 0, t)}}async link(){if(!this.client)throw new (0, _chunkXKAIXCX7js.g)("SiwsFlow has no client instance");try{let{message:t,signature:r}=await this.sign();return await this.client.linkWithSiwsInternal({message:t,signature:r,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(t){throw _chunkXKAIXCX7js.j.call(void 0, t)}}async sign(){if(!this.client)throw new (0, _chunkXKAIXCX7js.g)("SiwsFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new (0, _chunkXKAIXCX7js.g)("Could not prepare SIWS message");if(!this.wallet.signMessage)throw new (0, _chunkXKAIXCX7js.g)("Wallet does not support signMessage");let t=await this.wallet.signMessage(Buffer.from(this.preparedMessage));return{message:this.preparedMessage,signature:Buffer.from(t).toString("base64")}}async _getNonceOnce(){if(!this.client)throw new (0, _chunkXKAIXCX7js.g)("SiwsFlow has no client instance");return await this.client.generateSiwsNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new (0, _chunkXKAIXCX7js.g)("SiwsFlow has no client instance");let t=this.wallet.address;return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=wh({address:t,nonce:this.nonce}),this.preparedMessage}};var dn=class{constructor(t,r,o=!1){this.meta={phoneNumber:t,captchaToken:r,disableSignup:o}}async authenticate(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new (0, _chunkXKAIXCX7js.g)("phone number and sms code must be set prior to calling authenticate.");try{let t=await this.api.post(If,{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 _chunkXKAIXCX7js.j.call(void 0, t)}}async link(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new (0, _chunkXKAIXCX7js.g)("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(_f,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(t){throw _chunkXKAIXCX7js.j.call(void 0, t)}}async sendSmsCode(t,r){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");if(t&&(this.meta.phoneNumber=t),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new (0, _chunkXKAIXCX7js.g)("phone nNumber must be set when initialzing authentication.");try{return await this.api.post(Rf,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(o){throw _chunkXKAIXCX7js.j.call(void 0, o)}}},tc=class extends dn{constructor(r,o,n){super(o,n);this.meta={phoneNumber:o,captchaToken:n,oldPhoneNumber:r,disableSignup:!1}}async link(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new (0, _chunkXKAIXCX7js.g)("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(Wf,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(r){throw _chunkXKAIXCX7js.j.call(void 0, r)}}};var Xa=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 (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");try{let t=await this.api.post(Gf,{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 _chunkXKAIXCX7js.j.call(void 0, t)}}async link(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");try{return await this.api.post(qf,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(t){throw _chunkXKAIXCX7js.j.call(void 0, t)}}};function Sp(e){let t={detail:"",retryable:!1};return _optionalChain([e, 'optionalAccess', _44 => _44.privyErrorCode])==="linked_to_another_user"&&(t.detail="This account has already been linked to another user."),_optionalChain([e, 'optionalAccess', _45 => _45.privyErrorCode])==="disallowed_login_method"&&(t.detail="Login with Telegram not allowed."),_optionalChain([e, 'optionalAccess', _46 => _46.privyErrorCode])==="invalid_data"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),_optionalChain([e, 'optionalAccess', _47 => _47.privyErrorCode])==="cannot_link_more_of_type"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),_optionalChain([e, 'optionalAccess', _48 => _48.privyErrorCode])==="invalid_credentials"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),_optionalChain([e, 'optionalAccess', _49 => _49.privyErrorCode])==="too_many_requests"&&(t.detail="Too many requests. Please wait before trying again."),_optionalChain([e, 'optionalAccess', _50 => _50.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 Eh(){let e;if(e=tv(),e)return bh(),{...e,flowType:"login-url"};if(e=rv(),e)return bh(),{...e,flowType:"web-app"}}function tv(){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"),a=e.get("last_name")||void 0,i=e.get("username")||void 0,s=e.get("photo_url")||void 0;if(!(!t||!n||!o||!r))return{id:t,first_name:n,last_name:a,username:i,photo_url:s,auth_date:o,hash:r}}function rv(){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")||""),a=t.get("hash"),i=t.get("chat_instance")||void 0,s=t.get("chat_type")||void 0,c=t.get("start_param")||void 0;if(!(!o||!n||!a))return{query_id:r,user:o,auth_date:n,hash:a,chat_instance:i,chat_type:s,start_param:c}}function bh(){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)}var _uuid = require('uuid');var _bytes = require('@ethersproject/bytes');var _eventemitter3 = require('eventemitter3'); var _eventemitter32 = _interopRequireDefault(_eventemitter3);var _walletsdk = require('@coinbase/wallet-sdk'); var _walletsdk2 = _interopRequireDefault(_walletsdk);var Ko=({style:e,...t})=>_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),_jsxruntime.jsx.call(void 0, "path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});var _logger = require('@ethersproject/logger');var Za=class extends _chunkXKAIXCX7js.i{constructor(){super("Wallet timeout");this.type="wallet_error"}},Ja=class extends _chunkXKAIXCX7js.i{constructor(){super("User rejected connection");this.type="wallet_error"}},Tr=e=>{if(e instanceof _chunkXKAIXCX7js.i)return e;if(_optionalChain([e, 'optionalAccess', _51 => _51.code])&&_optionalChain([e, 'optionalAccess', _52 => _52.reason])){let t=new _t(e);return e.code===_logger.ErrorCode.ACTION_REJECTED&&(t.details=_jssdkcore.ProviderErrors.E4001_USER_REJECTED_REQUEST),t}return _optionalChain([e, 'optionalAccess', _53 => _53.code])?new _t(e):new (0, _chunkXKAIXCX7js.i)("Unknown connector error",e)},Vr=class extends _chunkXKAIXCX7js.e{constructor(r,o,n){super(r);this.type="provider_error";this.code=o,this.data=n}},_t=class extends Vr{constructor(r){let o=r;super(o.message,o.code,o.data);let n=Object.values(_jssdkcore.ProviderErrors).find(a=>a.eipCode===o.code);this.details=n||_jssdkcore.ProviderErrors.UNKNOWN_ERROR,o.code===-32002&&(_optionalChain([o, 'access', _54 => _54.message, 'optionalAccess', _55 => _55.includes, 'call', _56 => _56("already pending for origin")])?_optionalChain([o, 'access', _57 => _57.message, 'optionalAccess', _58 => _58.includes, 'call', _59 => _59("wallet_requestPermissions")])?this.details=_jssdkcore.ProviderErrors.E32002_CONNECTION_ALREADY_PENDING:this.details=_jssdkcore.ProviderErrors.E32002_REQUEST_ALREADY_PENDING:_optionalChain([o, 'access', _60 => _60.message, 'optionalAccess', _61 => _61.includes, 'call', _62 => _62("Already processing")])&&o.message.includes("eth_requestAccounts")&&(this.details=_jssdkcore.ProviderErrors.E32002_WALLET_LOCKED))}},av={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}},Eo={...av,..._jssdkcore.ProviderErrors};var aa=class extends _eventemitter32.default{constructor(r){super();this.walletClientType=r,this.connected=!1,this.initialized=!1}};var sv=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation"],Sh=e=>sv.includes(e);var rt=class{constructor(t,r){this.removeListener=(t,r)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(t,r)}catch (e14){console.warn("Unable to remove wallet provider listener")}};this.walletTimeout=(t=new Za,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=>{_optionalChain([this, 'access', _63 => _63.walletProvider, 'optionalAccess', _64 => _64.on, 'call', _65 => _65(r.eventName,r.listener)])})};this.walletProvider=t,this.rpcTimeoutDuration=r||_chunkXKAIXCX7js.N,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 (0, _chunkXKAIXCX7js.i)(`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 Tr(r)})}},pn=class extends Error{constructor(r,o,n){super(r);this.code=o,this.data=n}},ls=class extends _eventemitter32.default{constructor({walletProxy:r,address:o,rootAddress:n,rpcConfig:a,chains:i,appId:s,chainId:c=1,walletIndex:d}){super();this.walletProxy=r,this.address=o,this.rootAddress=n,this.chainId=c,this.rpcConfig=a,this.chains=i,this.provider=_chunkLEABMTNMjs.s.call(void 0, c,this.chains,a,{appId:s}),this.rpcTimeoutDuration=ja(a,"privy"),this.appId=s,this.walletIndex=d}async handleSendTransaction(r){if(!r.params||!Array.isArray(r.params))throw new pn(`Invalid params for ${r.method}`,4200);let o=r.params[0];if(!await pe()||!this.address)throw new pn("Disconnected",4900);return(await xh(o,void 0,void 0,this.address)).hash}handleSwitchEthereumChain(r){if(!r.params||!Array.isArray(r.params))throw new pn(`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 pn(`Invalid params for ${r.method}`,4200);this.chainId=Number(o),this.provider=_chunkLEABMTNMjs.s.call(void 0, 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 Ph(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 Ah(_chunkLEABMTNMjs.t.call(void 0, 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:_chunkLEABMTNMjs.n.call(void 0, 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(a){throw console.warn(`Gas estimation failed with error: ${a} 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 _chunkLEABMTNMjs.n.call(void 0, 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(Sh(r.method)){let o=await pe();if(await kh(),!o||!this.address)throw new pn("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 pn("Disconnected",4900)}}else return this.provider.send(r.method,r.params)}async connect(){let r=await pe();if(!r||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:r})).address}catch(o){return console.error(o),null}}},To= exports.c =class extends rt{constructor(r){super(r,r.rpcTimeoutDuration)}},un=class extends rt{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 cv=(e,t)=>{switch(t){case"coinbase_wallet":return e.message.includes("addEthereumChain");default:return e.code===4902||_optionalChain([e, 'access', _66 => _66.message, 'optionalAccess', _67 => _67.includes, 'call', _68 => _68("4902")])}};function $a(e){return e.chainType==="ethereum"}function no(e){return e.type==="ethereum"}var lr=class extends aa{constructor(r,o,n,a){super(r);this.chainType="ethereum";this.onAccountsChanged=r=>{r.length===0?this.onDisconnect():this.syncAccounts(r)};this.onChainChanged=r=>{this.wallets.forEach(o=>{o.chainId=_chunkLEABMTNMjs.p.call(void 0, r),this.walletClientType==="privy"&&_chunkLEABMTNMjs.b.put(_chunkXKAIXCX7js.K.call(void 0, 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=a,this.rpcTimeoutDuration=ja(a,r),this.connected=!1,this.initialized=!1}buildConnectedWallet(r,o,n,a){let i=async()=>!!this.wallets.find(s=>_address.getAddress.call(void 0, s.address)===_address.getAddress.call(void 0, r));return{type:"ethereum",address:_address.getAddress.call(void 0, r),chainId:o,meta:n,imported:a,switchChain:async s=>{if(!i)throw new (0, _chunkXKAIXCX7js.i)("Wallet is not currently connected.");let c=_optionalChain([this, 'access', _69 => _69.wallets, 'access', _70 => _70.find, 'call', _71 => _71(g=>_address.getAddress.call(void 0, g.address)===_address.getAddress.call(void 0, r)), 'optionalAccess', _72 => _72.chainId]);if(!c)throw new (0, _chunkXKAIXCX7js.i)("Unable to determine current chainId.");let d,u;if(typeof s=="number"?(d=`0x${s.toString(16)}`,u=s):(d=s,u=Number(s)),c===_chunkLEABMTNMjs.p.call(void 0, d))return;let f=this.chains.find(g=>g.id===u);if(!f)throw new (0, _chunkXKAIXCX7js.i)(`Unsupported chainId: ${s}`);let h=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:d}]})};try{return await h()}catch(g){if(cv(g,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:d,chainName:f.name,nativeCurrency:f.nativeCurrency,rpcUrls:[_nullishCoalesce(_optionalChain([f, 'access', _73 => _73.rpcUrls, 'access', _74 => _74.default, 'optionalAccess', _75 => _75.http, 'access', _76 => _76[0]]), () => (""))],blockExplorerUrls:[_nullishCoalesce(_optionalChain([f, 'access', _77 => _77.blockExplorers, 'optionalAccess', _78 => _78.default, 'access', _79 => _79.url]), () => (""))]}]}),h();throw this.walletClientType==="rainbow"&&_optionalChain([g, 'access', _80 => _80.message, 'optionalAccess', _81 => _81.includes, 'call', _82 => _82("wallet_switchEthereumChain")])?new (0, _chunkXKAIXCX7js.i)(`Rainbow does not support the chainId ${o}`):g}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:i,getEthereumProvider:async()=>{if(!await i())throw new (0, _chunkXKAIXCX7js.i)("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await i())throw new (0, _chunkXKAIXCX7js.i)("Wallet is not currently connected.");return new (0, _providers.Web3Provider)(new To(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await i())throw new (0, _chunkXKAIXCX7js.i)("Wallet is not currently connected.");return new un(this.proxyProvider)},sign:async s=>{if(!await i())throw new (0, _chunkXKAIXCX7js.i)("Wallet is not currently connected.");return await this.sign(s)},disconnect:()=>{this.disconnect()}}}async syncAccounts(r){let o=r;try{if(o===void 0){let d=await _chunkLEABMTNMjs.k.call(void 0, ()=>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],a=_address.getAddress.call(void 0, n),i=[],s;if(this.walletClientType==="privy"){let d=_chunkLEABMTNMjs.b.get(_chunkXKAIXCX7js.K.call(void 0, a));this.chains.find(u=>u.id===Number(d))||(_chunkLEABMTNMjs.b.del(_chunkXKAIXCX7js.K.call(void 0, a)),d=null),s=d||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:s}]})}catch (e15){console.warn(`Unable to switch embedded wallet to chain ID ${s} on initialization`)}}else try{let d=await _chunkLEABMTNMjs.k.call(void 0, ()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,d),typeof d=="string")s=d;else if(typeof d=="number")s=`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 ${_chunkXKAIXCX7js.P}`,d),s=_chunkXKAIXCX7js.P}let c=_chunkLEABMTNMjs.p.call(void 0, s);if(!i.find(d=>_address.getAddress.call(void 0, d.address)===a)){let d={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};i.push(this.buildConnectedWallet(_address.getAddress.call(void 0, n),c,d,this.connectorType==="embedded_imported"))}cs(i,this.wallets)||(this.wallets=i,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=>_address.getAddress.call(void 0, n)===_address.getAddress.call(void 0, 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 (0, _providers.Web3Provider)(new To(this.proxyProvider)).getSigner().signMessage(r)}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}};var pv=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],_h=(e,t)=>e.makeWeb3Provider({options:t}),rc,oc=class extends lr{constructor(r,o,n,a,i,s){super("coinbase_wallet",r,o,n);this.connectorType="coinbase_wallet";this.displayName="Coinbase Wallet";if(this.proxyProvider=new rt(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=_nullishCoalesce(a.coinbaseWallet.connectionOptions, () => ("all")),this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!rc){let c=[o.id].concat(r.map(u=>u.id)),d=this.connectionOptions!=="eoaOnly"?c.filter(u=>!pv.includes(u)):[];d.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${d.join(", ")}`),rc=new (0, _walletsdk2.default)({appName:i,appLogoUrl:s,appChainIds:c})}this.proxyProvider.setWalletProvider(_h(rc,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:Ko,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 (0, _chunkXKAIXCX7js.i)("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([r[0]])}catch(r){throw Tr(r)}}updateConnectionPreference(r){this.connectionOptions=r,this.walletClientType=r==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(_h(rc,this.connectionOptions))}};var ds=class extends lr{constructor({provider:r,chains:o,defaultChain:n,rpcConfig:a,imported:i,walletIndex:s}){super("privy",o,n,a);this.connectorType="embedded";this.proxyProvider=r,this.walletIndex=s,i&&(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:[_chunkLEABMTNMjs.n.call(void 0, _optionalChain([r, 'optionalAccess', _83 => _83.chainId])||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:_chunkLEABMTNMjs.C,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}};var ei=({style:e,...t})=>_jsxruntime.jsx.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:_jsxruntime.jsx.call(void 0, "path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})});var ti=({style:e,...t})=>_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),_jsxruntime.jsx.call(void 0, "path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]});var Po=({style:e,...t})=>_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),_jsxruntime.jsx.call(void 0, "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 oi=class extends lr{constructor(r,o,n,a,i){super(i||"unknown",r,o,n);this.connectorType="injected";this.proxyProvider=new rt(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=a;let s=a.provider;this.proxyProvider.setWalletProvider(s)}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){try{let r=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!r||r.length===0||!r[0])throw new (0, _chunkXKAIXCX7js.i)("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Tr(r)}}},ri,ni=class extends lr{constructor(r,o,n,a,i){super(_nullishCoalesce(i, () => ("unknown")),r,o,n);this.connectorType="injected";_chunkXKAIXCX7js.b.call(void 0, this,ri,void 0);this.proxyProvider=new rt(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(a),i==="metamask"?_chunkXKAIXCX7js.c.call(void 0, this,ri,{name:"MetaMask",icon:ti,id:"io.metamask"}):i==="phantom"&&_chunkXKAIXCX7js.c.call(void 0, this,ri,{name:"Phantom",icon:Po,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 _nullishCoalesce(_chunkXKAIXCX7js.a.call(void 0, this,ri), () => ({name:"Browser Extension",icon:ei,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 (0, _chunkXKAIXCX7js.i)("Unable to retrieve accounts");await this.syncAccounts([r[0]])}catch(r){throw Tr(r)}}};ri=new WeakMap;var nc=class extends oi{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{_reactdevicedetect.isMobile||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let t=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!t||t.length===0||!t[0])throw new (0, _chunkXKAIXCX7js.i)("Unable to retrieve accounts");await this.syncAccounts([t[0]])}catch(t){throw Tr(t)}}};var ac=class extends lr{constructor(r,o){super(r,[],o,{});this.connectorType="null";this.proxyProvider=new rt(void 0,_chunkXKAIXCX7js.N);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 ic=class extends ac{constructor(t){super("phantom",t)}get walletBranding(){return{name:"Phantom",icon:Po,id:"phantom"}}};var hv=["privy"],yv=["metamask","phantom","brave_wallet","rainbow","uniswap_wallet_extension","uniswap_extension","rabby_wallet","crypto.com_wallet_extension"],gv=["coinbase_wallet","coinbase_smart_wallet"],Cv=["metamask","trust","safe","rainbow","uniswap","zerion","argent","spot","omni","cryptocom","blockchain","safepal","bitkeep","zengo","1inch","binance","exodus","mew_wallet","alphawallet","keyring_pro","mathwallet","unstoppable","obvious","ambire","internet_money_wallet","coin98","abc_wallet","arculus_wallet","haha","cling_wallet","broearn","copiosa","burrito_wallet","enjin_wallet","plasma_wallet","avacus","bee","pitaka","pltwallet","minerva","kryptogo","prema","slingshot","kriptonio","timeless","secux","bitizen","blocto","okx_wallet","safemoon","rabby_wallet"],vv=["unknown"],wv=["phantom","solflare","glow"],bv=[...yv,...gv,...Cv,...hv,...vv,...wv];function Wh(e){return bv.includes(e)}function Oh(e){return e.chainType==="solana"}function Pp(e){return e.type==="solana"}var Lh=class extends aa{constructor(r,o){let n=Wh(r.name.toLowerCase())?r.name.toLowerCase():"unknown";super(n);this.chainType="solana";this.connectorType="solana_adapter";this.disconnect=()=>{this.adapter.disconnect().then(()=>this.onDisconnect()).catch(r=>console.error("Error disconnecting",r))};this.promptConnection=async()=>{try{await this.adapter.connect()}catch(r){throw Tr(r)}};this.onDisconnect=()=>{this.syncAccounts()};this.onConnect=r=>{this.syncAccounts()};this.onError=r=>{this.syncAccounts()};this.onReadyStateChange=r=>{r!=="Installed"&&(this.connected=!1),this.syncAccounts()};this.adapter=r,this.shouldAutoConnect=o,this.wallets=[]}get isInstalled(){return this.adapter.readyState==="Installed"}buildConnectedWallet(r,o){if(r.readyState!=="Installed"||!r.publicKey)throw Error("Wallet is not connected.");let n;"signMessage"in r&&(n=async(...s)=>{if(!r.connected)throw Error("Wallet is not connected.");return await r.signMessage(s[0])});let a;"sendTransaction"in r&&(a=async(...s)=>await r.sendTransaction(s[0],s[1],s[2]));let i;return"signTransaction"in r&&(i=async s=>await r.signTransaction(s)),{type:"solana",address:r.publicKey.toBase58(),meta:o,imported:!1,connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:async()=>r.connected,disconnect:()=>{try{r.disconnect()}catch (e16){console.error("Wallet does not support programmatic disconnect")}},getProvider:_chunkXKAIXCX7js.W,signMessage:n,sendTransaction:a,signTransaction:i}}async syncAccounts(){if(this.adapter.readyState!=="Installed"||!this.adapter.publicKey)this.wallets.length>0&&(this.wallets=[],this.emit("walletsUpdated"));else{let r={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};this.wallets.find(o=>this.adapter.publicKey&&o.address===this.adapter.publicKey.toBase58())||(this.wallets=[this.buildConnectedWallet(this.adapter,r)],this.emit("walletsUpdated"))}}get walletBranding(){return{id:this.adapter.name,name:this.adapter.name,icon:this.adapter.icon}}async initialize(){this.subscribeListeners(),await this.syncAccounts(),this.shouldAutoConnect&&await this.adapter.autoConnect().catch(console.error),this.initialized=!0,this.emit("initialized")}async connect(r){return r.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}async getConnectedWallet(){return this.wallets.sort((r,o)=>o.connectedAt-r.connectedAt)[0]||null}async isConnected(){return this.adapter.connected&&["Installed"].includes(this.adapter.readyState)}subscribeListeners(){this.adapter.addListener("disconnect",this.onDisconnect),this.adapter.addListener("connect",this.onConnect),this.adapter.addListener("error",this.onError),this.adapter.addListener("readyStateChange",this.onReadyStateChange)}unsubscribeListeners(){this.adapter.removeAllListeners()}};var _ethereumprovider = require('@walletconnect/ethereum-provider');var ps=({style:e,...t})=>{let{app:r}=_chunk3AGMJGHJjs.b.call(void 0, );return _jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "rect",{width:"28",height:"28",rx:"3",fill:_optionalChain([r, 'optionalAccess', _84 => _84.appearance, 'access', _85 => _85.palette, 'access', _86 => _86.colorScheme])==="dark"?"#3396ff":"#141414"}),_jsxruntime.jsx.call(void 0, "g",{clipPath:"url(#clip0_1765_9946)",children:_jsxruntime.jsx.call(void 0, "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"})}),_jsxruntime.jsx.call(void 0, "defs",{children:_jsxruntime.jsx.call(void 0, "clipPath",{id:"clip0_1765_9946",children:_jsxruntime.jsx.call(void 0, "rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};var ao=class extends lr{constructor(r,o,n,a,i,s,c,d){super(d||"unknown",n,a,o);this.connectorType="wallet_connect_v2";this.privyAppId=s,this.privyAppName=c,this.walletConnectCloudProjectId=r,this.rpcConfig=o,this.shouldEnforceDefaultChainOnConnect=i,this.proxyProvider=new rt(void 0,this.rpcTimeoutDuration),d&&(this.walletEntry=Fl[d],this.walletClientType=d)}async initialize(){let r=await this.createProvider();if(this.provider=r,this.proxyProvider.setWalletProvider(r),this.subscribeListeners(),r.session){if(_optionalChain([this, 'access', _87 => _87.walletProvider, 'optionalAccess', _88 => _88.session, 'optionalAccess', _89 => _89.peer, 'access', _90 => _90.metadata, 'access', _91 => _91.url])){let n=Ul(_optionalChain([this, 'access', _92 => _92.walletProvider, 'optionalAccess', _93 => _93.session, 'optionalAccess', _94 => _94.peer, 'access', _95 => _95.metadata, 'access', _96 => _96.url]));this.walletEntry=_optionalChain([n, 'optionalAccess', _97 => _97.entry]),this.walletClientType=_optionalChain([n, 'optionalAccess', _98 => _98.walletClientType])||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:o}=await Promise.resolve().then(() => _interopRequireWildcard(require("@walletconnect/modal")));this.modal=new o({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(n=>{!n.open&&!_optionalChain([this, 'access', _99 => _99.walletProvider, 'optionalAccess', _100 => _100.session])&&this.onQrModalClosed&&this.onQrModalClosed()})}async connect(r){return r.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!_optionalChain([this, 'access', _101 => _101.walletProvider, 'optionalAccess', _102 => _102.connected])}get walletBranding(){return this.walletClientType==="metamask"?{name:"MetaMask",icon:ti,id:"io.metamask"}:{name:_chunkLEABMTNMjs.m.call(void 0, _optionalChain([this, 'access', _103 => _103.walletProvider, 'optionalAccess', _104 => _104.session, 'optionalAccess', _105 => _105.peer, 'access', _106 => _106.metadata, 'access', _107 => _107.name])||"")||"WalletConnect",icon:_optionalChain([this, 'access', _108 => _108.walletProvider, 'optionalAccess', _109 => _109.session, 'optionalAccess', _110 => _110.peer, 'access', _111 => _111.metadata, 'access', _112 => _112.icons, 'optionalAccess', _113 => _113[0]])||ps,id:_optionalChain([this, 'access', _114 => _114.walletProvider, 'optionalAccess', _115 => _115.session, 'optionalAccess', _116 => _116.peer, 'access', _117 => _117.metadata, 'access', _118 => _118.name, 'access', _119 => _119.toLowerCase, 'call', _120 => _120()])||"wallet_connect_v2"}}async resetConnection(r){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletEntry=Fl[r],this.walletClientType=r,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,nh(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((r,o)=>{let n=()=>{o(new Ja)};this.onQrModalClosed=n,(async()=>{let i="",s=await Promise.race([_optionalChain([this, 'access', _121 => _121.walletProvider, 'optionalAccess', _122 => _122.enable, 'call', _123 => _123()]),this.proxyProvider.walletTimeout()]);if(_optionalChain([s, 'optionalAccess', _124 => _124.length])&&(i=s[0]),!i||i==="")throw new (0, _chunkXKAIXCX7js.i)("Unable to retrieve address");if(_optionalChain([this, 'access', _125 => _125.walletProvider, 'optionalAccess', _126 => _126.session, 'optionalAccess', _127 => _127.peer, 'access', _128 => _128.metadata, 'access', _129 => _129.url])){let c=Ul(_optionalChain([this, 'access', _130 => _130.walletProvider, 'optionalAccess', _131 => _131.session, 'optionalAccess', _132 => _132.peer, 'access', _133 => _133.metadata, 'access', _134 => _134.url]));this.walletEntry=_optionalChain([c, 'optionalAccess', _135 => _135.entry]),this.walletClientType=_optionalChain([c, 'optionalAccess', _136 => _136.walletClientType])||"unknown",this.proxyProvider.rpcTimeoutDuration=ja(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(s),r()})().catch(i=>{if(i){o(Tr(i));return}o(new (0, _chunkXKAIXCX7js.i)("Unknown error during connection"))}).finally(()=>_optionalChain([this, 'access', _137 => _137.modal, 'optionalAccess', _138 => _138.closeModal, 'call', _139 => _139()]))})}disconnect(){_optionalChain([this, 'access', _140 => _140.walletProvider, 'optionalAccess', _141 => _141.disconnect, 'call', _142 => _142(), 'access', _143 => _143.then, 'call', _144 => _144(()=>this.onDisconnect()), 'access', _145 => _145.catch, 'call', _146 => _146(()=>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 i of this.chains){let s=_chunkLEABMTNMjs.q.call(void 0, i.id,this.chains,this.rpcConfig,this.privyAppId);s&&(r[i.id]=s)}let o=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(i=>i.id),a=await _ethereumprovider.EthereumProvider.init({projectId:this.walletConnectCloudProjectId,chains:o,optionalChains:n,optionalEvents:_ethereumprovider.OPTIONAL_EVENTS,optionalMethods:_ethereumprovider.OPTIONAL_METHODS,rpcMap:r,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return a.on("display_uri",i=>{if(a.signer.abortPairingAttempt(),_reactdevicedetect.isMobile&&this.walletEntry){let{redirect:s,href:c}=th(i,this.walletEntry);ah({href:c,name:this.walletEntry.displayName}),this.redirectUri=s;let d=rh(i,this.walletEntry);_optionalChain([d, 'optionalAccess', _147 => _147.redirect])&&(this.fallbackUniversalRedirectUri=d.redirect),Bl(s,"_self")}else _optionalChain([this, 'access', _148 => _148.modal, 'optionalAccess', _149 => _149.openModal, 'call', _150 => _150({uri:i,chains:[this.defaultChain.id]})])}),a.on("connect",()=>{if(_optionalChain([this, 'access', _151 => _151.modal, 'optionalAccess', _152 => _152.closeModal, 'call', _153 => _153()]),_optionalChain([a, 'access', _154 => _154.session, 'optionalAccess', _155 => _155.peer, 'access', _156 => _156.metadata, 'access', _157 => _157.url])){let i=Ul(_optionalChain([a, 'access', _158 => _158.session, 'optionalAccess', _159 => _159.peer, 'access', _160 => _160.metadata, 'access', _161 => _161.url]));this.walletEntry=_optionalChain([i, 'optionalAccess', _162 => _162.entry]),this.walletClientType=_optionalChain([i, 'optionalAccess', _163 => _163.walletClientType])||"unknown"}}),a}async enableProvider(){return _optionalChain([this, 'access', _164 => _164.walletProvider, 'optionalAccess', _165 => _165.connected])?Promise.resolve(this.walletProvider.accounts):await _optionalChain([this, 'access', _166 => _166.walletProvider, 'optionalAccess', _167 => _167.enable, 'call', _168 => _168()])}};var xp=e=>{let t=_optionalChain([localStorage, 'access', _169 => _169.getItem, 'call', _170 => _170("-walletlink:https://www.walletlink.org:Addresses"), 'optionalAccess', _171 => _171.split, 'call', _172 => _172(" "), 'access', _173 => _173.filter, 'call', _174 => _174(o=>_bytes.isHexString.call(void 0, o)), 'access', _175 => _175.map, 'call', _176 => _176(o=>_address.getAddress.call(void 0, o))]);return _optionalChain([t, 'optionalAccess', _177 => _177.length])?!!_optionalChain([e, 'optionalAccess', _178 => _178.linkedAccounts, 'access', _179 => _179.filter, 'call', _180 => _180(o=>o.type=="wallet"&&t.includes(o.address)), 'access', _181 => _181.length]):!1},ja=(e,t)=>e.rpcTimeouts?e.rpcTimeouts[t]||_chunkXKAIXCX7js.N:_chunkXKAIXCX7js.N,us= exports.f =class extends _eventemitter32.default{constructor(r,o,n,a,i,s,c,d,u,f,h){super();this.addSolanaWalletConnector=async r=>{this.findWalletConnector("solana_adapter",r.walletClientType)||this.addWalletConnector(r)};this.getEthereumProvider=()=>{let r=this.wallets[0],o=this.walletConnectors.find(n=>n.wallets.find(a=>a.address===_optionalChain([r, 'optionalAccess', _182 => _182.address])));return!r||!o?new rt:o.proxyProvider};this.privyAppId=r,this.walletConnectCloudProjectId=o,this.rpcConfig=n,this.chains=a,this.defaultChain=i,this.walletConnectors=[],this.initialized=!1,this.store=s,this.walletList=c,this.shouldEnforceDefaultChainOnConnect=d,this.externalWalletConfig=u,this.privyAppName=f,this.privyAppLogo=h,this.storedConnections=Ap()}get wallets(){let r=new Set,o=this.walletConnectors.flatMap(a=>a.wallets).sort((a,i)=>a.connectedAt&&i.connectedAt?i.connectedAt-a.connectedAt:0).filter(a=>{let i=`${a.address}${a.walletClientType}${a.connectorType}`;return r.has(i)?!1:(r.add(i),!0)}),n=o.findIndex(a=>a.address===(this.activeWallet?this.activeWallet:"unknown"));return n>=0&&o.unshift(o.splice(n,1)[0]),o}async initialize(){if(this.initialized)return;_chunkLEABMTNMjs.b.get(_chunkXKAIXCX7js.L)&&(_chunkLEABMTNMjs.b.getKeys().forEach(o=>{o.startsWith("walletconnect")&&_chunkLEABMTNMjs.b.del(o)}),_chunkLEABMTNMjs.b.del(_chunkXKAIXCX7js.L));let r=_chunkLEABMTNMjs.o.call(void 0, this.store,this.walletList,this.externalWalletConfig).then(o=>{o.forEach(({type:n,eip6963InjectedProvider:a,legacyInjectedProvider:i})=>{this.createEthereumWalletConnector("injected",n,{eip6963InjectedProvider:a,legacyInjectedProvider:i})})});this.walletList.includes("coinbase_wallet")&&this.createEthereumWalletConnector("coinbase_wallet","coinbase_wallet"),!_chunkLEABMTNMjs.c.call(void 0, )&&this.walletList.includes("phantom")&&this.createEthereumWalletConnector("phantom","phantom"),this.externalWalletConfig.walletConnect.enabled&&this.createEthereumWalletConnector("wallet_connect_v2","unknown"),_optionalChain([this, 'access', _183 => _183.externalWalletConfig, 'access', _184 => _184.solana, 'access', _185 => _185.connectors, 'optionalAccess', _186 => _186.get, 'call', _187 => _187(), 'access', _188 => _188.forEach, 'call', _189 => _189(this.addSolanaWalletConnector)]),_optionalChain([this, 'access', _190 => _190.externalWalletConfig, 'access', _191 => _191.solana, 'access', _192 => _192.connectors, 'optionalAccess', _193 => _193._setOnConnectorsUpdated, 'optionalCall', _194 => _194(o=>{_optionalChain([o, 'optionalAccess', _195 => _195.forEach, 'call', _196 => _196(this.addSolanaWalletConnector)])})]),await r,this.initialized=!0}findWalletConnector(r,o){return r==="wallet_connect_v2"?_nullishCoalesce(this.walletConnectors.filter($a).find(n=>n.connectorType===r), () => (null)):_nullishCoalesce(this.walletConnectors.filter($a).find(n=>n.connectorType===r&&n.walletClientType===o), () => (null))}findSolanaWalletConnector(r,o){return _nullishCoalesce(this.walletConnectors.filter(Oh).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(a=>a.address===o.address&&a.connectorType===o.connectorType&&a.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:a,appId:i}){for(let s of n){let c=this.findEmbeddedWalletConnectors().find(d=>d.walletIndex===s.walletIndex);if(c&&$a(c))c.proxyProvider.walletProxy=r;else{let d=new ls({walletProxy:r,address:s.address,rootAddress:o.address,rpcConfig:this.rpcConfig,chains:this.chains,appId:i,chainId:a.id,walletIndex:s.walletIndex}),u=new ds({provider:d,chains:this.chains,defaultChain:a,rpcConfig:this.rpcConfig,imported:!1,walletIndex:s.walletIndex});this.addWalletConnector(u)}}}addImportedWalletConnector(r,o,n,a){let i=this.findWalletConnector("embedded_imported","privy");if(i&&$a(i))i.proxyProvider.walletProxy=r;else{let s=new ls({walletProxy:r,rootAddress:o,address:o,walletIndex:0,rpcConfig:this.rpcConfig,chains:this.chains,appId:a,chainId:n.id}),c=new ds({provider:s,chains:this.chains,walletIndex:0,defaultChain:n,rpcConfig:this.rpcConfig,imported:!0});this.addWalletConnector(c)}}removeEmbeddedWalletConnectors(){this.walletConnectors=this.walletConnectors.filter(r=>r.connectorType!=="embedded"),this.saveConnectionHistory(),this.storedConnections=Ap(),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=Ap(),this.emit("walletsUpdated")}}async createEthereumWalletConnector(r,o,n){let a=this.findWalletConnector(r,o);if(a&&$a(a))return a instanceof ao&&a.resetConnection(o),a;let s=(()=>{if(r==="injected"){if(o==="metamask"&&_optionalChain([n, 'optionalAccess', _197 => _197.eip6963InjectedProvider]))return new nc(this.chains,this.defaultChain,this.rpcConfig,_optionalChain([n, 'optionalAccess', _198 => _198.eip6963InjectedProvider]),"metamask");if(o==="metamask"&&_optionalChain([n, 'optionalAccess', _199 => _199.legacyInjectedProvider]))return new ni(this.chains,this.defaultChain,this.rpcConfig,_optionalChain([n, 'optionalAccess', _200 => _200.legacyInjectedProvider]),"metamask");if(o==="phantom"&&_optionalChain([n, 'optionalAccess', _201 => _201.legacyInjectedProvider]))return new ni(this.chains,this.defaultChain,this.rpcConfig,_optionalChain([n, 'optionalAccess', _202 => _202.legacyInjectedProvider]),"phantom");if(_optionalChain([n, 'optionalAccess', _203 => _203.legacyInjectedProvider])&&o==="unknown_browser_extension")return new ni(this.chains,this.defaultChain,this.rpcConfig,_optionalChain([n, 'optionalAccess', _204 => _204.legacyInjectedProvider]));if(_optionalChain([n, 'optionalAccess', _205 => _205.eip6963InjectedProvider]))return new oi(this.chains,this.defaultChain,this.rpcConfig,_optionalChain([n, 'optionalAccess', _206 => _206.eip6963InjectedProvider]),o)}else return r==="coinbase_wallet"?new oc(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):r==="phantom"?new ic(this.defaultChain):new ao(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,o)})();return s&&this.addWalletConnector(s),s||null}addWalletConnector(r){this.walletConnectors.push(r),r.on("initialized",()=>this.onInitialized(r)),r.on("walletsUpdated",()=>this.onWalletsUpdated(r)),r.initialize().catch(o=>{console.debug("Failed to initialize connector",o)})}saveConnectionHistory(){let r=this.wallets.map(o=>({address:o.address,connectorType:o.connectorType,walletClientType:o.walletClientType,connectedAt:o.connectedAt}));_chunkLEABMTNMjs.b.put(_chunkXKAIXCX7js.M,r)}async activeWalletSign(r){let o=this.wallets,n=o.length>0?o[0]:null;return!n||!no(n)?null:n.sign(r)}setActiveWallet(r){this.activeWallet=_address.getAddress.call(void 0, r),this.emit("walletsUpdated")}};function cs(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(_optionalChain([o, 'optionalAccess', _207 => _207.address])!==_optionalChain([n, 'optionalAccess', _208 => _208.address])||o&&n&&no(o)&&no(n)&&_optionalChain([o, 'optionalAccess', _209 => _209.chainId])!==_optionalChain([n, 'optionalAccess', _210 => _210.chainId])||_optionalChain([o, 'optionalAccess', _211 => _211.connectorType])!==_optionalChain([n, 'optionalAccess', _212 => _212.connectorType])||_optionalChain([o, 'optionalAccess', _213 => _213.connectedAt])!==_optionalChain([n, 'optionalAccess', _214 => _214.connectedAt])||_optionalChain([o, 'optionalAccess', _215 => _215.walletClientType])!==_optionalChain([n, 'optionalAccess', _216 => _216.walletClientType])||_optionalChain([o, 'optionalAccess', _217 => _217.isConnected])!==_optionalChain([n, 'optionalAccess', _218 => _218.isConnected])||_optionalChain([o, 'optionalAccess', _219 => _219.linked])!==_optionalChain([n, 'optionalAccess', _220 => _220.linked]))return!1}return!0}var Rv=e=>e&&typeof e.address=="string"&&typeof e.connectorType=="string"&&typeof e.walletClientType=="string"&&typeof e.connectedAt=="number",Ap=()=>{let e=_chunkLEABMTNMjs.b.get(_chunkXKAIXCX7js.M);return e&&Array.isArray(e)&&e.map(o=>Rv(o)).every(Boolean)?e:[]};var _ofetch = require('ofetch');var Mv=[_l,Il,Ml,Nl],sc=class{constructor({appId:t,appClientId:r,client:o,defaults:n}){this.appId=t,this.appClientId=r,this.clientAnalyticsId=o.clientAnalyticsId,this.sdkVersion=_chunkXKAIXCX7js.u,this.client=o,this.defaults=n,this.fallbackApiUrl=o.fallbackApiUrl,this.baseFetch=_ofetch.ofetch.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:a,options:i})=>{let s=new Headers(i.headers);s.set("privy-app-id",this.appId),this.appClientId&&s.set("privy-client-id",this.appClientId),s.set("privy-ca-id",this.clientAnalyticsId||""),s.set("privy-client",`react-auth:${this.sdkVersion}`);let c=Mv.includes(a.toString());if(!s.has("authorization")){let d=await this.client.getAccessToken({disableAutoRefresh:c});d!==null&&s.set("authorization",`Bearer ${d}`)}i.headers=s,i.retryDelay&&(i.retryDelay=i.retryDelay*3)},onRequestError:({error:a})=>{if(a instanceof DOMException&&a.name==="AbortError")throw new _chunkXKAIXCX7js.h}})}async get(t,r){try{return await this.baseFetch(t,r)}catch(o){throw _chunkXKAIXCX7js.j.call(void 0, o)}}async post(t,r,o){try{return await this.baseFetch(t,{method:"POST",...r?{body:r}:{},...o})}catch(n){throw _chunkXKAIXCX7js.j.call(void 0, n)}}async delete(t,r){try{return await this.baseFetch(t,{method:"DELETE",...r})}catch(o){throw _chunkXKAIXCX7js.j.call(void 0, o)}}};var Dh=e=>({challenge:e.challenge,allowCredentials:_optionalChain([e, 'access', _221 => _221.allow_credentials, 'optionalAccess', _222 => _222.map, 'call', _223 => _223(t=>({id:t.id,type:t.type,transports:t.transports}))])||[],timeout:e.timeout,extensions:{appid:_optionalChain([e, 'access', _224 => _224.extensions, 'optionalAccess', _225 => _225.app_id]),credProps:_optionalChain([e, 'access', _226 => _226.extensions, 'optionalAccess', _227 => _227.cred_props]),hmacCreateSecret:_optionalChain([e, 'access', _228 => _228.extensions, 'optionalAccess', _229 => _229.hmac_create_secret])},userVerification:e.user_verification});var _jscookie = require('js-cookie'); var _jscookie2 = _interopRequireDefault(_jscookie);function Uh(e){return e instanceof cn?"email":e instanceof dn?"sms":e instanceof zo?"siwe":e instanceof Ka?"guest":e instanceof za?"custom_auth":e instanceof bo?e.meta.provider:null}function lc(){return!(_reactdevicedetect.isSafari&&window.location.origin.startsWith("http://localhost"))}var Gr=class{static parse(t){try{return new Gr(t)}catch (e17){return null}}constructor(t){this.value=t,this._decoded=Fh.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 Wv=30,cc=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=_chunkLEABMTNMjs.b.get(_chunkXKAIXCX7js.v);return typeof t=="string"?new Gr(t).value:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get refreshToken(){try{let t=_chunkLEABMTNMjs.b.get(_chunkXKAIXCX7js.x);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}get forkedToken(){try{let t=_chunkLEABMTNMjs.b.get(_chunkXKAIXCX7js.C);return typeof t=="string"?t:null}catch(t){return console.error(t),this.destroyLocalState(),null}}getProviderAccessToken(t){try{let r=_chunkLEABMTNMjs.b.get(_chunkXKAIXCX7js.F.call(void 0, t));if(typeof r=="string"){let o=new Gr(r);return o.isExpired()?(_chunkLEABMTNMjs.b.del(_chunkXKAIXCX7js.F.call(void 0, t)),null):o.value}else return null}catch(r){return console.error(r),null}}get mightHaveServerCookies(){try{let t=_jscookie2.default.get(_chunkXKAIXCX7js.B);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!==_chunkXKAIXCX7js.V}hasRecoveryCredentials(){return typeof this.forkedToken=="string"}hasActiveToken(){let t=Gr.parse(this.token);return t!==null&&!t.isExpired(Wv)}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"?_chunkLEABMTNMjs.b.put(_chunkXKAIXCX7js.F.call(void 0, t),r):_chunkLEABMTNMjs.b.del(_chunkXKAIXCX7js.F.call(void 0, t))}async _authenticate(t){try{let r=await t.authenticate(),{user:o,is_new_user:n,oauth_tokens:a}=r;this.handleTokenResponse(r);let i=a,s=i?{provider:i.provider,accessToken:i.access_token,accessTokenExpiresInSeconds:i.access_token_expires_in_seconds,refreshToken:i.refresh_token,refreshTokenExpiresInSeconds:a.refresh_token_expires_in_seconds,scopes:i.scopes}:void 0,c=Uh(t);return c&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:c,isNewUser:n}}),c==="siwe"&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:t.meta.connectorType,walletClientType:t.meta.walletClientType}}),{user:_chunkLEABMTNMjs.B.call(void 0, o),isNewUser:n,oAuthTokens:s}}catch(r){throw console.warn("Error authenticating session"),_chunkXKAIXCX7js.k.call(void 0, 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:_chunkLEABMTNMjs.B.call(void 0, r),oAuthTokens:n}}catch(r){throw console.warn("Error linking account"),_chunkXKAIXCX7js.k.call(void 0, r)}}async _refresh(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Session has no API instance");if(!this.client)throw new (0, _chunkXKAIXCX7js.g)("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 a={};t&&(a.authorization=`Bearer ${t}`);let i=r?{refresh_token:r}:{};n=await this.api.post(_l,i,{headers:a}),o&&this.clearForkedToken()}else if(o)n=await this.api.post(Il,{refresh_token:o}),this.clearForkedToken();else return null;return this.handleTokenResponse(n),_chunkLEABMTNMjs.B.call(void 0, n.user)}catch(n){if(n instanceof _chunkXKAIXCX7js.f&&n.privyErrorCode==="missing_or_invalid_token")return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw _chunkXKAIXCX7js.k.call(void 0, 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 _optionalChain([this, 'access', _230 => _230.api, 'optionalAccess', _231 => _231.post, 'call', _232 => _232(Ml,{refresh_token:this.refreshToken})])}catch (e18){console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Session has no API instance");let t=this.refreshToken;try{let r=await this.api.post(cf,{refresh_token:t});return this.storeRefreshToken(r.refresh_token),this.storeToken(r.token),r.new_session_refresh_token}catch(r){throw _chunkXKAIXCX7js.k.call(void 0, r)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeToken(t){if(typeof t=="string"){let r=_chunkLEABMTNMjs.b.get(_chunkXKAIXCX7js.v);if(_chunkLEABMTNMjs.b.put(_chunkXKAIXCX7js.v,t),!_optionalChain([this, 'access', _233 => _233.client, 'optionalAccess', _234 => _234.useServerCookies])){let o=_optionalChain([Gr, 'access', _235 => _235.parse, 'call', _236 => _236(t), 'optionalAccess', _237 => _237.expiration]);_jscookie2.default.set(_chunkXKAIXCX7js.w,t,{sameSite:"Strict",secure:lc(),expires:o?new Date(o*1e3):void 0})}r!==t&&_optionalChain([this, 'access', _238 => _238.client, 'optionalAccess', _239 => _239.onStoreToken, 'optionalCall', _240 => _240(t)])}else _chunkLEABMTNMjs.b.del(_chunkXKAIXCX7js.v),_jscookie2.default.remove(_chunkXKAIXCX7js.w),_optionalChain([this, 'access', _241 => _241.client, 'optionalAccess', _242 => _242.onDeleteToken, 'optionalCall', _243 => _243()])}storeRefreshToken(t){typeof t=="string"?(_chunkLEABMTNMjs.b.put(_chunkXKAIXCX7js.x,t),_optionalChain([this, 'access', _244 => _244.client, 'optionalAccess', _245 => _245.useServerCookies])||_jscookie2.default.set(_chunkXKAIXCX7js.B,"t",{sameSite:"Strict",secure:lc(),expires:30})):(_chunkLEABMTNMjs.b.del(_chunkXKAIXCX7js.x),_jscookie2.default.remove(_chunkXKAIXCX7js.y),_jscookie2.default.remove(_chunkXKAIXCX7js.B))}storeIdentityToken(t){if(_optionalChain([this, 'access', _246 => _246.client, 'optionalAccess', _247 => _247.useServerCookies]))return;_chunkLEABMTNMjs.b.put(_chunkXKAIXCX7js.z,t);let r=_optionalChain([Gr, 'access', _248 => _248.parse, 'call', _249 => _249(t), 'optionalAccess', _250 => _250.expiration]);_jscookie2.default.set(_chunkXKAIXCX7js.A,t,{sameSite:"Strict",secure:lc(),expires:r?new Date(r*1e3):void 0})}clearIdentityToken(){_chunkLEABMTNMjs.b.del(_chunkXKAIXCX7js.z),_jscookie2.default.remove(_chunkXKAIXCX7js.A)}clearForkedToken(){_chunkLEABMTNMjs.b.del(_chunkXKAIXCX7js.C)}};var kp,dc,Bh,ms= exports.g =class{constructor(t){_chunkXKAIXCX7js.b.call(void 0, this,dc);this.apiUrl=t.apiUrl||_chunkXKAIXCX7js.p,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!t.apiUrl&&t.apiUrl.startsWith("https://privy."),this.timeout=t.timeout||_chunkXKAIXCX7js.q,this.appId=t.appId,this.appClientId=t.appClientId,this.clientAnalyticsId=_chunkXKAIXCX7js.d.call(void 0, this,dc,Bh).call(this),kp||(kp=new cc),this.session=kp,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:t,rpcConfig:r,chains:o,defaultChain:n,store:a,walletList:i,shouldEnforceDefaultChainOnConnect:s,externalWalletConfig:c,appName:d}){this.connectors||(this.connectors=new us(this.appId,t,r,o,n,a,i,s,c,d))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let t=new sc({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 (0, _chunkXKAIXCX7js.g)("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new (0, _chunkXKAIXCX7js.g)("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(Kf,{action:"verify"})}catch(t){throw _chunkXKAIXCX7js.j.call(void 0, t)}}async initMfaPasskeyVerification(){try{let t=await this.api.post(Yf,{});return Dh(t.options)}catch(t){throw _chunkXKAIXCX7js.j.call(void 0, t)}}async acceptTerms(){try{let t=await this.api.post(Qf,{});return _chunkLEABMTNMjs.B.call(void 0, t)}catch(t){throw _chunkXKAIXCX7js.k.call(void 0, t)}}async unlinkEmail(t){try{let r=await this.api.post(xf,{address:t});return await _asyncNullishCoalesce(await this.getAuthenticatedUser(), async () => (_chunkLEABMTNMjs.B.call(void 0, r)))}catch(r){throw _chunkXKAIXCX7js.k.call(void 0, r)}}async unlinkPhone(t){try{let r=await this.api.post(Mf,{phoneNumber:t});return await _asyncNullishCoalesce(await this.getAuthenticatedUser(), async () => (_chunkLEABMTNMjs.B.call(void 0, r)))}catch(r){throw _chunkXKAIXCX7js.k.call(void 0, r)}}async unlinkEthereumWallet(t){try{let r=await this.api.post(ff,{address:t});return await _asyncNullishCoalesce(await this.getAuthenticatedUser(), async () => (_chunkLEABMTNMjs.B.call(void 0, r)))}catch(r){throw _chunkXKAIXCX7js.k.call(void 0, r)}}async unlinkSolanaWallet(t){try{let r=await this.api.post(Cf,{address:t});return await _asyncNullishCoalesce(await this.getAuthenticatedUser(), async () => (_chunkLEABMTNMjs.B.call(void 0, r)))}catch(r){throw _chunkXKAIXCX7js.k.call(void 0, r)}}async unlinkOAuth(t,r){try{let o=await this.api.post(Lf,{provider:t,subject:r});return await _asyncNullishCoalesce(await this.getAuthenticatedUser(), async () => (_chunkLEABMTNMjs.B.call(void 0, o)))}catch(o){throw _chunkXKAIXCX7js.k.call(void 0, o)}}async unlinkFarcaster(t){try{let r=await this.api.post(Tf,{fid:t});return await _asyncNullishCoalesce(await this.getAuthenticatedUser(), async () => (_chunkLEABMTNMjs.B.call(void 0, r)))}catch(r){throw _chunkXKAIXCX7js.k.call(void 0, r)}}async unlinkTelegram(t){try{let r=await this.api.post(zf,{telegram_user_id:t});return await _asyncNullishCoalesce(await this.getAuthenticatedUser(), async () => (_chunkLEABMTNMjs.B.call(void 0, r)))}catch(r){throw _chunkXKAIXCX7js.k.call(void 0, r)}}async unlinkPasskey(t){try{let r=await this.api.post(Vf,{credential_id:t});return await _asyncNullishCoalesce(await this.getAuthenticatedUser(), async () => (_chunkLEABMTNMjs.B.call(void 0, r)))}catch(r){throw _chunkXKAIXCX7js.k.call(void 0, 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(Nl,{event_name:t,client_id:this.clientAnalyticsId,payload:{...r||{},clientTimestamp:o?o.toISOString():new Date().toISOString()}},{retry:-1,keepalive:_nullishCoalesce(_optionalChain([n, 'optionalAccess', _251 => _251.keepAlive]), () => (!1))})}catch (e19){}}async signMoonpayOnRampUrl(t){try{return this.api.post(Jf,t)}catch(r){throw _chunkXKAIXCX7js.k.call(void 0, r)}}async initCoinbaseOnRamp(t){try{return this.api.post(jf,t)}catch(r){throw _chunkXKAIXCX7js.k.call(void 0, r)}}async getCoinbaseOnRampStatus({partnerUserId:t}){try{return this.api.get(`${$f}?partnerUserId=${t}`)}catch(r){throw _chunkXKAIXCX7js.k.call(void 0, r)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(t){return this.session.hasActiveToken()?this.session.hasRefreshCredentials()?_optionalChain([Gr, 'access', _252 => _252.parse, 'call', _253 => _253(this.session.token), 'optionalAccess', _254 => _254.audience])!==this.appId?(await this.logout(),null):this.session.token:(this.session.destroyLocalState(),null):!_optionalChain([t, 'optionalAccess', _255 => _255.disableAutoRefresh])&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getSmartWalletsConfig(){try{let t={},r=this.session.token;r&&(t.authorization=`Bearer ${r}`);let o=await this.api.get(`/api/v1/apps/${this.appId}/smart_wallets`,{baseURL:this.fallbackApiUrl,headers:t});return o.enabled?{enabled:o.enabled,smartWalletType:o.smart_wallet_type,configuredNetworks:o.configured_networks.map(n=>({chainId:n.chain_id,bundlerUrl:n.bundler_url,paymasterUrl:n.paymaster_url}))}:{enabled:o.enabled}}catch(t){throw _chunkXKAIXCX7js.k.call(void 0, t)}}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,a=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:_optionalChain([o, 'access', _256 => _256.embedded_wallet_config, 'optionalAccess', _257 => _257.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:a}}catch(t){throw _chunkXKAIXCX7js.k.call(void 0, t)}}async getUsdTokenPrice(t){try{return(await this.api.get(`/api/v1/token_price?chainId=${t.id}&tokenSymbol=${t.nativeCurrency.symbol}`)).usd}catch (e20){console.error(`Unable to fetch token price for chain with id ${t.id}`);return}}async getUsdPriceForSol(){try{return(await this.api.get("/api/v1/token_price?chainId=0&tokenSymbol=SOL")).usd}catch (e21){console.error("Unable to fetch token price for SOL");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(df,{address:t,token:r})).nonce}catch(o){throw _chunkXKAIXCX7js.k.call(void 0, o)}}async authenticateWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:a,mode:i}){return await this.api.post(pf,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:a,mode:i})}async linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:a}){return await this.api.post(uf,{message:t,signature:r,chainId:o,walletClientType:n,connectorType:a})}async linkSmartWallet({message:t,signature:r,smartWalletType:o}){try{let n=await this.api.post(mf,{message:t,signature:r,smart_wallet_type:o});return _chunkLEABMTNMjs.B.call(void 0, n)}catch(n){throw _chunkXKAIXCX7js.k.call(void 0, n)}}async linkWithSiwe({message:t,signature:r,chainId:o,walletClientType:n,connectorType:a}){try{let i=await this.linkWithSiweInternal({message:t,signature:r,chainId:o,walletClientType:n,connectorType:a});return _chunkLEABMTNMjs.B.call(void 0, i)}catch(i){throw _chunkXKAIXCX7js.k.call(void 0, i)}}async generateSiwsNonce({address:t,captchaToken:r}){try{return(await this.api.post(hf,{address:t,token:r})).nonce}catch(o){throw _chunkXKAIXCX7js.k.call(void 0, o)}}async authenticateWithSiwsInternal({message:t,signature:r,walletClientType:o,connectorType:n,mode:a}){return await this.api.post(yf,{message:t,signature:r,walletClientType:o,connectorType:n,mode:a})}async linkWithSiwsInternal({message:t,signature:r,walletClientType:o,connectorType:n}){return await this.api.post(gf,{message:t,signature:r,walletClientType:o,connectorType:n})}async linkWithSiws({message:t,signature:r,walletClientType:o,connectorType:n}){try{let a=await this.linkWithSiwsInternal({message:t,signature:r,walletClientType:o,connectorType:n});return _chunkLEABMTNMjs.B.call(void 0, a)}catch(a){throw _chunkXKAIXCX7js.k.call(void 0, a)}}};dc=new WeakSet,Bh=function(){if(typeof window>"u")return null;try{let r=_chunkLEABMTNMjs.b.get(_chunkXKAIXCX7js.D);if(typeof r=="string"&&r.length>0)return r}catch (e22){}let t=_uuid.v4.call(void 0, );try{return _chunkLEABMTNMjs.b.put(_chunkXKAIXCX7js.D,t),t}catch (e23){return t}};var _reactturnstile = require('@marsidev/react-turnstile');var Hh=_react.createContext.call(void 0, {siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:_chunkXKAIXCX7js.W,setError:_chunkXKAIXCX7js.W,setExecuting:_chunkXKAIXCX7js.W,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:_chunkXKAIXCX7js.W,reset:_chunkXKAIXCX7js.W,execute:_chunkXKAIXCX7js.W}),Qt=class extends _chunkXKAIXCX7js.e{constructor(r,o,n){super(r||"Captcha failed");this.type="Captcha";o instanceof Error&&(this.cause=o),this.privyErrorCode=n}},Vh=({children:e,id:t,captchaSiteKey:r,captchaEnabled:o})=>{let n=_react.useRef.call(void 0, null),[a,i]=_react.useState.call(void 0, ),[s,c]=_react.useState.call(void 0, ),[d,u]=_react.useState.call(void 0, !1),f=_react.useMemo.call(void 0, ()=>o?!d&&!a&&!s?{status:"ready"}:d&&!a&&!s?{status:"loading"}:a&&!s?{status:"success",token:a}:s?{status:"error",error:s}:{status:"ready"}:{status:"disabled"},[o,a,s,d]);return _jsxruntime.jsx.call(void 0, Hh.Provider,{value:{...f,ref:n,enabled:o,siteKey:r,appId:t,setToken:i,setError:c,setExecuting:u,remove(){o&&(_optionalChain([n, 'access', _258 => _258.current, 'optionalAccess', _259 => _259.remove, 'call', _260 => _260()]),u(!1),c(void 0),i(void 0))},reset(){o&&(_optionalChain([n, 'access', _261 => _261.current, 'optionalAccess', _262 => _262.reset, 'call', _263 => _263()]),u(!1),c(void 0),i(void 0))},execute(){o&&(u(!0),_optionalChain([n, 'access', _264 => _264.current, 'optionalAccess', _265 => _265.execute, 'call', _266 => _266()]))},async waitForResult(){if(!o)return"";try{return await _chunkLEABMTNMjs.j.call(void 0, ()=>_optionalChain([n, 'access', _267 => _267.current, 'optionalAccess', _268 => _268.getResponse, 'call', _269 => _269()]),{interval:200,timeout:2e4})}catch (e24){throw new Qt("Captcha failed",null,"captcha_timeout")}}},children:e})},Pe=()=>_react.useContext.call(void 0, Hh);var _p=e=>{let{enabled:t,siteKey:r,appId:o,setError:n,setToken:a,setExecuting:i,ref:s}=Pe(),[,c]=_react.useMemo.call(void 0, ()=>_optionalChain([r, 'optionalAccess', _270 => _270.split, 'call', _271 => _271("t:")])||[],[r]);if(_react.useEffect.call(void 0, ()=>_optionalChain([s, 'access', _272 => _272.current, 'optionalAccess', _273 => _273.remove]),[]),!t)return null;if(!c)throw new Error("Unsupported captcha site key");return _jsxruntime.jsx.call(void 0, "div",{className:"hidden h-0 w-0",children:_jsxruntime.jsx.call(void 0, _reactturnstile.Turnstile,{...e,ref:s,siteKey:c,options:{action:o,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{_optionalChain([e, 'access', _274 => _274.onUnsupported, 'optionalCall', _275 => _275()]),console.warn("Browser does not support Turnstile.")},onError:()=>{_optionalChain([e, 'access', _276 => _276.onError, 'optionalCall', _277 => _277()]),n("Captcha failed"),i(!1)},onSuccess:d=>{_optionalChain([e, 'access', _278 => _278.onSuccess, 'optionalCall', _279 => _279(d)]),a(d),i(!1)},onExpire:()=>{_optionalChain([e, 'access', _280 => _280.onExpire, 'optionalCall', _281 => _281()]);try{_optionalChain([s, 'access', _282 => _282.current, 'optionalAccess', _283 => _283.reset, 'call', _284 => _284()]),n(void 0),a(void 0)}catch (e25){n("expired_and_failed_reset")}}})})};var _styledcomponents = require('styled-components'); var _styledcomponents2 = _interopRequireDefault(_styledcomponents);function Mp(e){_chunkLEABMTNMjs.G.call(void 0, "configureMfa",e)}var _QuestionMarkCircleIcon = require('@heroicons/react/24/outline/QuestionMarkCircleIcon'); var _QuestionMarkCircleIcon2 = _interopRequireDefault(_QuestionMarkCircleIcon);var ut=({success:e,fail:t})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, mt,{className:e?"success":t?"fail":""}),_jsxruntime.jsx.call(void 0, fs,{className:e?"success":t?"fail":""})]}),mt=_styledcomponents2.default.span`
24
+ && {
25
+ width: 82px;
26
+ height: 82px;
27
+ border-width: 4px;
28
+ border-style: solid;
29
+ border-color: ${e=>_nullishCoalesce(e.color, () => ("var(--privy-color-accent)"))};
30
+ border-bottom-color: transparent;
31
+ border-radius: 50%;
32
+ display: inline-block;
33
+ box-sizing: border-box;
34
+ animation: rotation 1.2s linear infinite;
35
+ transition: border-color 800ms;
36
+ }
37
+
38
+ @keyframes rotation {
39
+ 0% {
40
+ transform: rotate(0deg);
41
+ }
42
+ 100% {
43
+ transform: rotate(360deg);
44
+ }
45
+ }
46
+
47
+ &&&.success {
48
+ border-color: var(--privy-color-success);
49
+ border-bottom-color: var(--privy-color-success);
50
+ }
51
+
52
+ &&&.fail {
53
+ border-color: var(--privy-color-error);
54
+ border-bottom-color: var(--privy-color-error);
55
+ }
56
+ `,fs=_styledcomponents2.default.call(void 0, mt)`
57
+ && {
58
+ border-bottom-color: ${e=>_nullishCoalesce(e.color, () => ("var(--privy-color-accent)"))};
59
+ animation: none;
60
+ opacity: 0.5;
61
+ }
62
+ `,Ao=e=>_jsxruntime.jsx.call(void 0, Gv,{color:e.color||"var(--privy-color-foreground-3)"}),Gv=_styledcomponents2.default.call(void 0, mt)`
63
+ && {
64
+ height: 1rem;
65
+ width: 1rem;
66
+ margin: 2px 0;
67
+ border-width: 1.5px;
68
+
69
+ /* Override default Loader to match button transitions */
70
+ transition: border-color 200ms ease;
71
+ }
72
+ `;var hs=_styledcomponents2.default.button`
73
+ display: flex;
74
+ flex-direction: row;
75
+ align-items: center;
76
+ justify-content: center;
77
+ user-select: none;
78
+
79
+ & {
80
+ width: 100%;
81
+ cursor: pointer;
82
+ border-radius: var(--privy-border-radius-md);
83
+
84
+ font-size: 1rem;
85
+ font-style: normal;
86
+ font-weight: 500;
87
+ line-height: 22px; /* 137.5% */
88
+ letter-spacing: -0.016px;
89
+ }
90
+
91
+ && {
92
+ padding: 12px 16px;
93
+ }
94
+ `,U=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>_jsxruntime.jsx.call(void 0, zh,{disabled:t||r,...n,children:t?_jsxruntime.jsxs.call(void 0, "span",{children:[_jsxruntime.jsx.call(void 0, Ao,{}),o?_jsxruntime.jsx.call(void 0, "span",{children:o}):null]}):e}),sa=({children:e,loading:t,disabled:r,...o})=>_jsxruntime.jsx.call(void 0, Kv,{disabled:r,...o,children:t?_jsxruntime.jsx.call(void 0, Ao,{color:"var(--privy-color-foreground-accent)"}):e}),Kv=_styledcomponents2.default.call(void 0, hs)`
95
+ position: relative;
96
+
97
+ && {
98
+ background-color: var(--privy-color-accent);
99
+ color: var(--privy-color-foreground-accent);
100
+
101
+ transition: background-color 200ms ease;
102
+ }
103
+
104
+ &:hover {
105
+ background-color: var(--privy-color-accent-dark);
106
+ }
107
+
108
+ &:active {
109
+ background-color: var(--privy-color-accent-dark);
110
+ }
111
+
112
+ &:disabled,
113
+ &:hover:disabled,
114
+ &:active:disabled {
115
+ cursor: not-allowed;
116
+ pointer-events: none;
117
+ color: var(--privy-color-foreground-accent);
118
+ background-color: var(--privy-color-accent-dark);
119
+ }
120
+ `,pc=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>_jsxruntime.jsx.call(void 0, zh,{as:"a",disabled:t||r,...n,children:t?_jsxruntime.jsxs.call(void 0, "span",{children:[_jsxruntime.jsx.call(void 0, Ao,{}),o?_jsxruntime.jsx.call(void 0, "span",{children:o}):null]}):e}),zh=_styledcomponents2.default.call(void 0, hs)`
121
+ position: relative;
122
+
123
+ && {
124
+ background-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-accent)"};
125
+ color: var(--privy-color-foreground-accent);
126
+
127
+ transition: background-color 200ms ease;
128
+ }
129
+
130
+ &:hover {
131
+ background-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-accent-dark)"};
132
+ }
133
+
134
+ &:active {
135
+ background-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-accent-dark)"};
136
+ }
137
+
138
+ &:hover:disabled,
139
+ &:active:disabled {
140
+ background-color: var(--privy-color-background-2);
141
+ color: var(--privy-color-foreground-3);
142
+ cursor: not-allowed;
143
+ }
144
+
145
+ /* If an anchor tag, :disabled isn't a thing, so manually set state */
146
+ ${e=>e.disabled?_styledcomponents.css`
147
+ &&&,
148
+ &&&:hover,
149
+ &&&:active {
150
+ background-color: var(--privy-color-background-2);
151
+ color: var(--privy-color-foreground-3);
152
+ cursor: not-allowed;
153
+ pointer-events: none;
154
+ }
155
+ `:""}
156
+
157
+ > span {
158
+ display: flex;
159
+ align-items: center;
160
+ gap: 8px;
161
+
162
+ opacity: 1;
163
+ animation: fadein 200ms ease;
164
+ }
165
+ `,io=({children:e,loading:t,disabled:r,loadingText:o="Loading...",...n})=>_jsxruntime.jsx.call(void 0, Yv,{disabled:t||r,...n,children:t?_jsxruntime.jsxs.call(void 0, "span",{children:[_jsxruntime.jsx.call(void 0, Ao,{}),o?_jsxruntime.jsx.call(void 0, "span",{children:o}):null]}):e}),Yv=_styledcomponents2.default.call(void 0, hs)`
166
+ && {
167
+ border-width: 1px;
168
+ border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"};
169
+ color: var(--privy-color-foreground);
170
+
171
+ transition: border-color 200ms ease;
172
+ }
173
+
174
+ &:hover,
175
+ &:active {
176
+ border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
177
+ }
178
+
179
+ &:hover:disabled,
180
+ &:active:disabled {
181
+ border-color: var(--privy-color-foreground-accent);
182
+ color: var(--privy-color-foreground-3);
183
+ cursor: not-allowed;
184
+ }
185
+
186
+ > span {
187
+ display: flex;
188
+ align-items: center;
189
+ gap: 8px;
190
+
191
+ opacity: 1;
192
+ animation: fadein 200ms ease;
193
+ }
194
+ `,fn=_styledcomponents2.default.button`
195
+ && {
196
+ padding: 12px 16px;
197
+ font-weight: 500;
198
+ text-align: center;
199
+ color: var(--privy-color-foreground-accent);
200
+ background-color: var(--privy-color-accent);
201
+ border-radius: var(--privy-border-radius-sm);
202
+ min-width: 144px;
203
+ opacity: ${e=>e.invisible?"0":"1"};
204
+ transition: opacity 200ms ease, background-color 200ms ease, color 200ms ease;
205
+ user-select: none;
206
+
207
+ ${e=>e.invisible&&_styledcomponents.css`
208
+ pointer-events: none;
209
+ `}
210
+
211
+ &:hover {
212
+ background-color: var(--privy-color-accent-dark);
213
+ }
214
+ &:active {
215
+ background-color: var(--privy-color-accent-dark);
216
+ }
217
+
218
+ &:hover:disabled,
219
+ &:active:disabled {
220
+ background-color: var(--privy-color-background-2);
221
+ color: var(--privy-color-foreground-3);
222
+ cursor: not-allowed;
223
+ }
224
+ }
225
+ `,zM=_styledcomponents2.default.div`
226
+ /* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */
227
+ height: 44px;
228
+ `,ii=({children:e,onClick:t,disabled:r,isSubmitting:o,...n})=>_jsxruntime.jsxs.call(void 0, Qv,{isSubmitting:o,onClick:t,disabled:r,...n,children:[_jsxruntime.jsx.call(void 0, "span",{children:e}),_jsxruntime.jsx.call(void 0, "span",{children:_jsxruntime.jsx.call(void 0, Ao,{})})]}),Qv=_styledcomponents2.default.button`
229
+ && {
230
+ color: var(--privy-color-accent);
231
+ font-size: 16px;
232
+ font-style: normal;
233
+ font-weight: 500;
234
+ line-height: 24px;
235
+ cursor: pointer;
236
+ border-radius: 0px var(--privy-border-radius-mdlg) var(--privy-border-radius-mdlg) 0px;
237
+ border: none;
238
+ transition: color 200ms ease;
239
+
240
+ /* Tablet and Up */
241
+ @media (min-width: 441px) {
242
+ font-size: 14px;
243
+ }
244
+
245
+ :hover {
246
+ color: var(--privy-color-accent-dark);
247
+ }
248
+
249
+ && > :first-child {
250
+ opacity: ${e=>e.isSubmitting?0:1};
251
+ }
252
+
253
+ && > :last-child {
254
+ position: absolute;
255
+ display: flex;
256
+ top: 50%;
257
+ left: 50%;
258
+ transform: translate3d(-50%, -50%, 0);
259
+
260
+ /** Will map to the opposite of first span */
261
+ opacity: ${e=>e.isSubmitting?1:0};
262
+ }
263
+
264
+ :disabled,
265
+ :hover:disabled {
266
+ color: var(--privy-color-foreground-3);
267
+ cursor: not-allowed;
268
+ }
269
+ }
270
+ `;var mc=_styledcomponents2.default.span`
271
+ && {
272
+ width: 82px;
273
+ height: 82px;
274
+ border-width: 4px;
275
+ border-style: solid;
276
+ border-color: ${e=>_nullishCoalesce(e.color, () => ("var(--privy-color-accent)"))};
277
+ background-color: ${e=>_nullishCoalesce(e.color, () => ("var(--privy-color-accent)"))};
278
+ border-radius: 50%;
279
+ display: inline-block;
280
+ box-sizing: border-box;
281
+ }
282
+ `;var _ArrowLeftIcon = require('@heroicons/react/24/outline/ArrowLeftIcon'); var _ArrowLeftIcon2 = _interopRequireDefault(_ArrowLeftIcon);var _XMarkIcon = require('@heroicons/react/24/outline/XMarkIcon'); var _XMarkIcon2 = _interopRequireDefault(_XMarkIcon);var $v=({backFn:e})=>_jsxruntime.jsx.call(void 0, "div",{children:_jsxruntime.jsx.call(void 0, Lp,{onClick:e,children:_jsxruntime.jsx.call(void 0, _ArrowLeftIcon2.default,{height:"16px",width:"16px",strokeWidth:2})})}),ew=({infoFn:e})=>_jsxruntime.jsx.call(void 0, "div",{children:_jsxruntime.jsx.call(void 0, rw,{"aria-label":"info",onClick:e,children:_jsxruntime.jsx.call(void 0, _QuestionMarkCircleIcon2.default,{height:"22px",width:"22px",strokeWidth:2})})}),tw=e=>_jsxruntime.jsx.call(void 0, "div",{children:_jsxruntime.jsx.call(void 0, Lp,{"aria-label":"close modal",onClick:e.onClose,children:_jsxruntime.jsx.call(void 0, _XMarkIcon2.default,{height:"16px",width:"16px",strokeWidth:2})})});var k=({backFn:e,infoFn:t,onClose:r,title:o,closeable:n=!0})=>{let{closePrivyModal:a}=_chunkXKAIXCX7js.ra.call(void 0, ),i=_chunkXKAIXCX7js.oa.call(void 0, );return _jsxruntime.jsxs.call(void 0, ow,{children:[_jsxruntime.jsxs.call(void 0, nw,{children:[e&&_jsxruntime.jsx.call(void 0, $v,{backFn:e}),t&&_jsxruntime.jsx.call(void 0, ew,{infoFn:t})]}),o&&_jsxruntime.jsx.call(void 0, iw,{id:"privy-dialog-title",children:o}),_jsxruntime.jsx.call(void 0, aw,{children:!i.render.standalone&&n&&_jsxruntime.jsx.call(void 0, tw,{onClose:r||(()=>a())})})]})},Lp=_styledcomponents2.default.button`
283
+ && {
284
+ cursor: pointer;
285
+ display: flex;
286
+ opacity: 0.6;
287
+
288
+ background-color: var(--privy-color-background-2);
289
+ border-radius: var(--privy-border-radius-full);
290
+ padding: 4px;
291
+
292
+ > svg {
293
+ margin: auto;
294
+ color: var(--privy-color-foreground);
295
+ }
296
+
297
+ :hover {
298
+ opacity: 1;
299
+ }
300
+ }
301
+ `,rw=_styledcomponents2.default.call(void 0, Lp)`
302
+ && {
303
+ background-color: transparent;
304
+ }
305
+ `,ow=_styledcomponents2.default.div`
306
+ padding: 16px 0;
307
+ display: flex;
308
+ align-items: center;
309
+ justify-content: space-between;
310
+
311
+ h2 {
312
+ font-size: 16px;
313
+ line-height: 24px;
314
+ font-weight: 600;
315
+ color: var(--privy-color-foreground);
316
+ }
317
+ `,nw=_styledcomponents2.default.div`
318
+ flex: 1;
319
+ align-items: center;
320
+ display: flex;
321
+ gap: 8px;
322
+ `,aw=_styledcomponents2.default.div`
323
+ flex: 1;
324
+ display: flex;
325
+ justify-content: flex-end;
326
+ `,iw=_styledcomponents2.default.div`
327
+ overflow: hidden;
328
+ white-space: nowrap;
329
+ max-width: 100%;
330
+ text-overflow: ellipsis;
331
+ text-align: center;
332
+ color: var(--privy-color-foreground-2);
333
+ `;var lw=_styledcomponents2.default.div`
334
+ display: flex;
335
+ flex-direction: column;
336
+ justify-content: center;
337
+ align-items: center;
338
+ width: 100%;
339
+ height: 82px;
340
+
341
+ > div {
342
+ position: relative;
343
+ }
344
+
345
+ > div > span {
346
+ position: absolute;
347
+ left: -41px;
348
+ top: -41px;
349
+ }
350
+
351
+ > div > :last-child {
352
+ position: absolute;
353
+ left: -19px;
354
+ top: -19px;
355
+ }
356
+ `,et=lw;var Xt=_styledcomponents2.default.div`
357
+ text-align: left;
358
+ flex-grow: 1;
359
+ `,fc=_styledcomponents2.default.div`
360
+ display: flex;
361
+ flex-direction: column;
362
+ justify-content: flex-end;
363
+ flex-grow: 1;
364
+ `,pr=_styledcomponents2.default.div`
365
+ display: flex;
366
+ flex-direction: column;
367
+ gap: 12px;
368
+
369
+ /* for Internet Explorer, Edge */
370
+ -ms-overflow-style: none;
371
+
372
+ /* for Firefox */
373
+ scrollbar-width: none;
374
+
375
+ /* for Chrome, Safari, and Opera */
376
+ &::-webkit-scrollbar {
377
+ display: none;
378
+ }
379
+ `,Yh=_styledcomponents2.default.call(void 0, pr)`
380
+ ${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;"}}
381
+
382
+ background-repeat: no-repeat;
383
+ background-size: 100% 32px, 100% 16px;
384
+ background-attachment: local, scroll;
385
+ `,Qh=_styledcomponents.css`
386
+ && {
387
+ width: 100%;
388
+ font-size: 16px;
389
+ line-height: 24px;
390
+
391
+ /* Tablet and Up */
392
+ @media (min-width: 440px) {
393
+ font-size: 14px;
394
+ }
395
+
396
+ display: flex;
397
+ gap: 12px;
398
+ align-items: center;
399
+
400
+ padding: 12px 16px;
401
+ border: 1px solid var(--privy-color-foreground-4) !important;
402
+ border-radius: var(--privy-border-radius-mdlg);
403
+ transition: background-color 200ms ease;
404
+
405
+ cursor: pointer;
406
+
407
+ &:hover {
408
+ background-color: var(--privy-color-background-2);
409
+ }
410
+
411
+ &:disabled {
412
+ cursor: pointer;
413
+ background-color: var(--privy-color-background-2);
414
+ }
415
+
416
+ svg {
417
+ height: 24px;
418
+ max-height: 24px;
419
+ max-width: 24px;
420
+ }
421
+ }
422
+ `,hc=_styledcomponents2.default.div`
423
+ text-align: center;
424
+ font-size: 14px;
425
+ margin-bottom: 24px;
426
+ `,Ae=_styledcomponents2.default.button`
427
+ ${Qh}
428
+ `,Op=_styledcomponents2.default.a`
429
+ ${Qh}
430
+ `,so=_styledcomponents2.default.div`
431
+ width: 100%;
432
+ height: 100%;
433
+ min-height: inherit;
434
+ display: flex;
435
+ flex-direction: column;
436
+ ${e=>e.if?"display: none;":""}
437
+ `;var Zh=()=>{let{navigate:e,app:t}=_chunk3AGMJGHJjs.b.call(void 0, );return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{}),_jsxruntime.jsxs.call(void 0, pw,{children:[_jsxruntime.jsx.call(void 0, et,{children:_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, mc,{color:"var(--privy-color-warn-light)"}),_jsxruntime.jsx.call(void 0, _QuestionMarkCircleIcon2.default,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),_jsxruntime.jsxs.call(void 0, uw,{children:[_jsxruntime.jsx.call(void 0, "h3",{children:"Account not found"}),_jsxruntime.jsxs.call(void 0, "p",{children:["Please try logging in again or go to ",t.name," to create an account."]})]}),_jsxruntime.jsx.call(void 0, Xt,{}),_jsxruntime.jsx.call(void 0, U,{onClick:()=>e("LANDING"),children:"Try logging in again"})]})]})},pw=_styledcomponents2.default.div`
438
+ display: flex;
439
+ flex-direction: column;
440
+ align-items: center;
441
+ justify-content: center;
442
+ gap: 24px;
443
+ width: 100%;
444
+ padding-bottom: 16px;
445
+ margin-top: 24px;
446
+ `,uw=_styledcomponents2.default.div`
447
+ display: flex;
448
+ flex-direction: column;
449
+ gap: 8px;
450
+ `;var _ArrowTopRightOnSquareIcon = require('@heroicons/react/24/outline/ArrowTopRightOnSquareIcon'); var _ArrowTopRightOnSquareIcon2 = _interopRequireDefault(_ArrowTopRightOnSquareIcon);var _DocumentCheckIcon = require('@heroicons/react/24/solid/DocumentCheckIcon'); var _DocumentCheckIcon2 = _interopRequireDefault(_DocumentCheckIcon);var He=_styledcomponents2.default.div`
451
+ display: flex;
452
+ flex-direction: column;
453
+ align-items: center;
454
+ padding: 0px 0px 30px;
455
+ @media (max-width: 440px) {
456
+ padding: 10px 10px 20px;
457
+ }
458
+ `,me=_styledcomponents2.default.div`
459
+ font-size: 18px;
460
+ line-height: 30px;
461
+ text-align: center;
462
+ font-weight: 600;
463
+ margin-bottom: 10px;
464
+ `,ge=_styledcomponents2.default.div`
465
+ font-size: 0.875rem;
466
+
467
+ text-align: center;
468
+ `,qr=_styledcomponents2.default.div`
469
+ display: flex;
470
+ flex-direction: column;
471
+ align-items: center;
472
+ gap: 10px;
473
+ flex-grow: 1;
474
+ padding: 20px 0;
475
+ @media (max-width: 440px) {
476
+ padding: 10px 10px 20px;
477
+ }
478
+ `,ca=_styledcomponents2.default.div`
479
+ display: flex;
480
+ flex-direction: column;
481
+ align-items: stretch;
482
+ gap: 0.75rem;
483
+ padding: 1rem 0rem 0rem;
484
+ flex-grow: 1;
485
+ width: 100%;
486
+ `,ur=_styledcomponents2.default.div`
487
+ width: 25px;
488
+ display: flex;
489
+ align-items: center;
490
+ justify-content: flex-start;
491
+
492
+ > svg {
493
+ z-index: 2;
494
+ height: 25px !important;
495
+ width: 25px !important;
496
+ color: var(--privy-color-accent);
497
+ }
498
+ `,mr=_styledcomponents2.default.div`
499
+ display: flex;
500
+ align-items: center;
501
+ gap: 10px;
502
+ font-size: 0.875rem;
503
+ line-height: 1rem;
504
+ text-align: left;
505
+ `,Bt=_styledcomponents2.default.div`
506
+ display: flex;
507
+ flex-direction: column;
508
+ gap: 10px;
509
+ padding-top: 20px;
510
+ `,yc=_styledcomponents2.default.div`
511
+ display: flex;
512
+ flex-direction: column;
513
+ align-items: stretch;
514
+ gap: 1rem;
515
+ padding: 1rem 0rem 0rem;
516
+ flex-grow: 1;
517
+ width: 100%;
518
+ `,gc=_styledcomponents2.default.div`
519
+ display: flex;
520
+ gap: 5px;
521
+ width: 100%;
522
+ `,Cc=_styledcomponents2.default.button`
523
+ && {
524
+ background-color: transparent;
525
+ color: var(--privy-color-foreground-3);
526
+ padding: 0 10px;
527
+ display: flex;
528
+ align-items: center;
529
+
530
+ > svg {
531
+ z-index: 2;
532
+ height: 20px !important;
533
+ width: 20px !important;
534
+ }
535
+ }
536
+
537
+ &&:hover {
538
+ color: var(--privy-color-error);
539
+ }
540
+ `,vc=_styledcomponents2.default.div`
541
+ display: flex;
542
+ align-items: center;
543
+ gap: 0.5rem;
544
+
545
+ > svg {
546
+ z-index: 2;
547
+ height: 20px !important;
548
+ width: 20px !important;
549
+ }
550
+ `,da=_styledcomponents2.default.div`
551
+ display: flex;
552
+ align-items: center;
553
+ gap: 6px;
554
+ font-weight: 400 !important;
555
+ color: ${e=>e.isAccent?"var(--privy-color-accent)":"var(--privy-color-foreground-3)"};
556
+
557
+ > svg {
558
+ z-index: 2;
559
+ height: 18px !important;
560
+ width: 18px !important;
561
+ display: flex !important;
562
+ align-items: flex-end;
563
+ }
564
+ `,wc=_styledcomponents2.default.div`
565
+ width: 100%;
566
+ display: flex;
567
+ justify-content: space-between;
568
+ `,Jh=_styledcomponents2.default.p`
569
+ text-align: left;
570
+ width: 100%;
571
+ color: var(--privy-color-foreground-3) !important;
572
+ `,gs=_styledcomponents2.default.button`
573
+ display: flex;
574
+ flex-direction: row;
575
+ align-items: center;
576
+ justify-content: center;
577
+ user-select: none;
578
+
579
+ & {
580
+ width: 100%;
581
+ cursor: pointer;
582
+ border-radius: var(--privy-border-radius-md);
583
+
584
+ font-size: 0.875rem;
585
+ line-height: 1rem;
586
+ font-style: normal;
587
+ font-weight: 500;
588
+ line-height: 22px; /* 137.5% */
589
+ letter-spacing: -0.016px;
590
+ }
591
+
592
+ && {
593
+ color: ${e=>e.theme==="dark"?"var(--privy-color-foreground-2)":"var(--privy-color-accent)"};
594
+ background-color: transparent;
595
+
596
+ padding: 0.5rem 0px;
597
+ }
598
+
599
+ &:hover {
600
+ text-decoration: underline;
601
+ }
602
+ `,ot=_styledcomponents2.default.div`
603
+ display: flex;
604
+ align-items: center;
605
+ justify-content: center;
606
+ width: 90px;
607
+ height: 90px;
608
+ border-radius: 50%;
609
+ background-color: ${({status:e})=>e==="success"?"var(--privy-color-success)":"var(--privy-color-accent)"};
610
+
611
+ > svg {
612
+ z-index: 2;
613
+ height: 50px !important;
614
+ width: auto !important;
615
+ color: white;
616
+ }
617
+ `,bc=_styledcomponents2.default.div`
618
+ color: var(--privy-color-error);
619
+ `;var $h=()=>{let{user:e,logout:t}=_chunkXKAIXCX7js.ta.call(void 0, ),{app:r,onUserCloseViaDialogOrKeybindRef:o,setModalData:n,navigate:a}=_chunk3AGMJGHJjs.b.call(void 0, ),{acceptTerms:i,closePrivyModal:s,createAnalyticsEvent:c}=_chunkXKAIXCX7js.ra.call(void 0, ),d=f=>{_optionalChain([f, 'optionalAccess', _285 => _285.preventDefault, 'call', _286 => _286()]),s({shouldCallAuthOnSuccess:!1}),t()};o.current=d;let u=async f=>{f.preventDefault(),await i(),e&&_chunkLEABMTNMjs.A.call(void 0, e,_optionalChain([r, 'optionalAccess', _287 => _287.embeddedWallets, 'optionalAccess', _288 => _288.createOnLogin]))?(n({createWallet:{onSuccess:()=>{},onFailure:h=>{console.error(h),c({eventName:"embedded_wallet_creation_failure_logout",payload:{error:h,screen:"AffirmativeConsentScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):s()};return _jsxruntime.jsx.call(void 0, yw,{termsAndConditionsUrl:_optionalChain([r, 'optionalAccess', _289 => _289.legal, 'access', _290 => _290.termsAndConditionsUrl]),privacyPolicyUrl:_optionalChain([r, 'optionalAccess', _291 => _291.legal, 'access', _292 => _292.privacyPolicyUrl]),onAccept:u,onDecline:d})},yw=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:o})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{closeable:!1}),_jsxruntime.jsx.call(void 0, _DocumentCheckIcon2.default,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),_jsxruntime.jsx.call(void 0, me,{style:{marginTop:24},children:"One last step"}),_jsxruntime.jsx.call(void 0, ge,{children:"By signing up, you agree to our terms and privacy policy."}),_jsxruntime.jsxs.call(void 0, pr,{style:{marginTop:24},children:[e&&_jsxruntime.jsxs.call(void 0, Op,{target:"_blank",href:e,children:["View Terms ",_jsxruntime.jsx.call(void 0, _ArrowTopRightOnSquareIcon2.default,{style:{marginLeft:"auto"}})]}),t&&_jsxruntime.jsxs.call(void 0, Op,{target:"_blank",href:t,children:["View Privacy Policy ",_jsxruntime.jsx.call(void 0, _ArrowTopRightOnSquareIcon2.default,{style:{marginLeft:"auto"}})]})]}),_jsxruntime.jsxs.call(void 0, gw,{style:{marginTop:24},children:[_jsxruntime.jsx.call(void 0, io,{onClick:o,children:"No thanks"}),_jsxruntime.jsx.call(void 0, U,{onClick:r,children:"Accept"})]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]}),gw=_styledcomponents2.default.div`
620
+ display: flex;
621
+ gap: 10px;
622
+ `;var Ec=_styledcomponents2.default.span`
623
+ && {
624
+ width: 82px;
625
+ height: 82px;
626
+ border-width: 4px;
627
+ border-style: solid;
628
+ border-color: ${e=>_nullishCoalesce(e.color, () => ("var(--privy-color-accent)"))};
629
+ border-bottom-color: transparent;
630
+ border-radius: 50%;
631
+ display: inline-block;
632
+ box-sizing: border-box;
633
+ animation: rotation 1.2s linear infinite;
634
+ transition: border-color 800ms;
635
+ border-bottom-color: ${e=>_nullishCoalesce(e.color, () => ("var(--privy-color-accent)"))};
636
+ }
637
+ `;var Tc=({style:e,...t})=>_jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, "path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})});var ry=()=>{let{navigate:e,app:t}=_chunk3AGMJGHJjs.b.call(void 0, ),r=_optionalChain([t, 'optionalAccess', _293 => _293.allowlistConfig, 'access', _294 => _294.errorTitle])||"You don't have access to this app",o=_optionalChain([t, 'optionalAccess', _295 => _295.allowlistConfig, 'access', _296 => _296.errorDetail])||"Have you been invited?",n=_optionalChain([t, 'optionalAccess', _297 => _297.allowlistConfig, 'access', _298 => _298.errorCtaText])||"Try another account";return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{}),_jsxruntime.jsxs.call(void 0, ww,{children:[_jsxruntime.jsx.call(void 0, et,{children:_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, Ec,{}),_jsxruntime.jsx.call(void 0, Tc,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),_jsxruntime.jsxs.call(void 0, bw,{children:[typeof r=="string"?_jsxruntime.jsx.call(void 0, "h3",{children:r}):_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:r}),typeof o=="string"?_jsxruntime.jsx.call(void 0, "p",{children:o}):_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:o})]}),_optionalChain([t, 'optionalAccess', _299 => _299.allowlistConfig, 'access', _300 => _300.errorCtaLink])?_jsxruntime.jsx.call(void 0, U,{as:"a",href:t.allowlistConfig.errorCtaLink,children:n}):_jsxruntime.jsx.call(void 0, U,{onClick:()=>{e("LANDING")},children:n})]})]})},ww=_styledcomponents2.default.div`
638
+ display: flex;
639
+ flex-direction: column;
640
+ align-items: center;
641
+ justify-content: center;
642
+ gap: 24px;
643
+ width: 100%;
644
+ padding-bottom: 16px;
645
+ `,bw=_styledcomponents2.default.div`
646
+ display: flex;
647
+ flex-direction: column;
648
+ gap: 8px;
649
+ `;var _CheckIcon = require('@heroicons/react/20/solid/CheckIcon'); var _CheckIcon2 = _interopRequireDefault(_CheckIcon);var _EnvelopeIcon = require('@heroicons/react/24/outline/EnvelopeIcon'); var _EnvelopeIcon2 = _interopRequireDefault(_EnvelopeIcon);var _PhoneIcon = require('@heroicons/react/24/outline/PhoneIcon'); var _PhoneIcon2 = _interopRequireDefault(_PhoneIcon);var hr=_styledcomponents2.default.div`
650
+ display: flex;
651
+ flex-direction: column;
652
+ align-items: flex-start;
653
+ justify-content: flex-end;
654
+ margin-top: auto;
655
+ gap: 16px;
656
+ flex-grow: 100;
657
+ `,Mt=_styledcomponents2.default.div`
658
+ display: flex;
659
+ flex-direction: column;
660
+ align-items: center;
661
+ justify-content: center;
662
+ flex-grow: 1;
663
+ width: 100%;
664
+ `,oy=_styledcomponents2.default.div`
665
+ display: flex;
666
+ flex-direction: column;
667
+ align-items: center;
668
+ width: 100%;
669
+ `,li=_styledcomponents2.default.call(void 0, Mt)`
670
+ padding: 20px 0;
671
+ `,Pr=_styledcomponents2.default.call(void 0, Mt)`
672
+ gap: 16px;
673
+ `,yn=_styledcomponents2.default.div`
674
+ display: flex;
675
+ flex-direction: column;
676
+ width: 100%;
677
+ `,tt=_styledcomponents2.default.div`
678
+ display: flex;
679
+ flex-direction: column;
680
+ gap: 8px;
681
+ `,QI=_styledcomponents2.default.div`
682
+ display: flex;
683
+ flex-direction: column;
684
+ justify-content: space-between;
685
+ height: 100%;
686
+ `,ny=_styledcomponents2.default.div`
687
+ display: flex;
688
+ flex-direction: column;
689
+ justify-content: flex-start;
690
+ align-items: flex-start;
691
+ text-align: left;
692
+ gap: 8px;
693
+ padding: 16px;
694
+ margin-top: 16px;
695
+ margin-bottom: 16px;
696
+ width: 100%;
697
+ background: var(--privy-color-background-2);
698
+ border-radius: var(--privy-border-radius-md);
699
+ && h4 {
700
+ color: var(--privy-color-foreground-3);
701
+ font-size: 14px;
702
+ text-decoration: underline;
703
+ font-weight: medium;
704
+ }
705
+ && p {
706
+ color: var(--privy-color-foreground-3);
707
+ font-size: 14px;
708
+ }
709
+ `,ne=_styledcomponents2.default.div`
710
+ height: 16px;
711
+ `,ae=_styledcomponents2.default.div`
712
+ height: 12px;
713
+ `,ay=_styledcomponents2.default.div`
714
+ position: relative;
715
+ `,ci=_styledcomponents2.default.div`
716
+ height: ${e=>_nullishCoalesce(e.height, () => ("12"))}px;
717
+ `,iy=_styledcomponents2.default.div`
718
+ background-color: var(--privy-color-accent);
719
+ display: flex;
720
+ justify-content: center;
721
+ align-items: center;
722
+ border-radius: 50%;
723
+ border-color: white;
724
+ border-width: 2px !important;
725
+ `;var pa=({title:e,description:t,children:r,...o})=>_jsxruntime.jsx.call(void 0, sy,{...o,children:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "h3",{children:e}),typeof t=="string"?_jsxruntime.jsx.call(void 0, "p",{children:t}):t,r]})}),Ro=_styledcomponents2.default.call(void 0, pa)`
726
+ margin-bottom: 24px;
727
+ `,Ce=({title:e,description:t,icon:r,children:o,...n})=>_jsxruntime.jsxs.call(void 0, Ew,{...n,children:[r||null,_jsxruntime.jsx.call(void 0, "h3",{children:e}),t&&typeof t=="string"?_jsxruntime.jsx.call(void 0, "p",{children:t}):t,o]}),sy=_styledcomponents2.default.div`
728
+ display: flex;
729
+ flex-direction: column;
730
+ justify-content: flex-start;
731
+ align-items: flex-start;
732
+ text-align: left;
733
+ gap: 8px;
734
+ width: 100%;
735
+ margin-bottom: 24px;
736
+
737
+ && h3 {
738
+ font-size: 17px;
739
+ color: var(--privy-color-foreground);
740
+ }
741
+
742
+ /* Sugar assuming children are paragraphs. Otherwise, handling styling on your own */
743
+ && p {
744
+ color: var(--privy-color-foreground-2);
745
+ font-size: 14px;
746
+ }
747
+ `,Ew=_styledcomponents2.default.call(void 0, sy)`
748
+ align-items: center;
749
+ text-align: center;
750
+ gap: 16px;
751
+
752
+ h3 {
753
+ margin-bottom: 24px;
754
+ }
755
+ `;var Fp=6,cy=new Array(Fp).fill(""),kw=1400,Rw=30;var py=()=>{let{app:e,navigate:t,lastScreen:r,navigateBack:o,setModalData:n,onUserCloseViaDialogOrKeybindRef:a}=_chunk3AGMJGHJjs.b.call(void 0, ),{closePrivyModal:i,resendEmailCode:s,resendSmsCode:c,getAuthMeta:d,loginWithCode:u,updateWallets:f,createAnalyticsEvent:h}=_chunkXKAIXCX7js.ra.call(void 0, ),{authenticated:g,logout:w,user:v}=_chunkXKAIXCX7js.ta.call(void 0, ),[E,_]=_react.useState.call(void 0, cy),[A,T]=_react.useState.call(void 0, !1),[P,S]=_react.useState.call(void 0, null),[R,D]=_react.useState.call(void 0, null),[F,B]=_react.useState.call(void 0, 0);a.current=()=>null;let K=_optionalChain([d, 'call', _301 => _301(), 'optionalAccess', _302 => _302.email])?0:1,W=_chunkXKAIXCX7js.r,X=W-500;_react.useEffect.call(void 0, ()=>{if(F){let $=setTimeout(()=>{B(F-1)},1e3);return()=>clearTimeout($)}},[F]),_react.useEffect.call(void 0, ()=>{if(g&&A&&v){if(_optionalChain([e, 'optionalAccess', _303 => _303.legal, 'access', _304 => _304.requireUsersAcceptTerms])&&!v.hasAcceptedTerms){let Y=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},X);return()=>clearTimeout(Y)}if(_chunkLEABMTNMjs.A.call(void 0, v,_optionalChain([e, 'optionalAccess', _305 => _305.embeddedWallets, 'optionalAccess', _306 => _306.createOnLogin]))){let Y=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:ke=>{console.error(ke),h({eventName:"embedded_wallet_creation_failure_logout",payload:{error:ke,screen:"AwaitingPasswordlessCodeScreen"}}),w()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},X);return()=>clearTimeout(Y)}else{f();let Y=setTimeout(()=>i({shouldCallAuthOnSuccess:!0,isSuccess:!0}),W);return()=>clearTimeout(Y)}}},[g,A,v]),_react.useEffect.call(void 0, ()=>{if(P&&R===0){let $=setTimeout(()=>{_(cy),S(null),_optionalChain([document, 'access', _307 => _307.querySelector, 'call', _308 => _308("input[name=code-0]"), 'optionalAccess', _309 => _309.focus, 'call', _310 => _310()])},kw);return()=>clearTimeout($)}},[P]);let L=$=>{$.preventDefault();let Y=$.currentTarget.value.replace(" ","");if(Y==="")return;if(isNaN(Number(Y))){S("Code should be numeric"),D(1);return}S(null),D(null);let ke=Number(_optionalChain([$, 'access', _311 => _311.currentTarget, 'access', _312 => _312.name, 'optionalAccess', _313 => _313.charAt, 'call', _314 => _314(5)])),ye=[...Y||[""]].slice(0,Fp-ke),te=[...E.slice(0,ke),...ye,...E.slice(ke+ye.length)];_(te);let se=ye.length,Ge=Math.min(Math.max(ke+se,0),Fp-1);isNaN(Number($.currentTarget.value))||_optionalChain([document, 'access', _315 => _315.querySelector, 'call', _316 => _316(`input[name=code-${Ge}]`), 'optionalAccess', _317 => _317.focus, 'call', _318 => _318()]),te.every(Qe=>Qe&&!isNaN(+Qe))&&(_optionalChain([document, 'access', _319 => _319.querySelector, 'call', _320 => _320(`input[name=code-${Ge}]`), 'optionalAccess', _321 => _321.blur, 'call', _322 => _322()]),u(te.join("")).then(()=>T(!0)).catch(ce=>{if(ce instanceof _chunkXKAIXCX7js.f&&ce.privyErrorCode==="invalid_credentials")S("Invalid or expired verification code");else if(ce instanceof _chunkXKAIXCX7js.f&&ce.privyErrorCode==="cannot_link_more_of_type")S(ce.message);else if(ce instanceof _chunkXKAIXCX7js.f&&ce.privyErrorCode==="max_accounts_reached"){console.error(new (0, _chunkXKAIXCX7js.o)(ce).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else if(ce instanceof _chunkXKAIXCX7js.f&&ce.privyErrorCode==="user_does_not_exist"){t("ACCOUNT_NOT_FOUND_SCREEN");return}else if(ce instanceof _chunkXKAIXCX7js.f&&ce.privyErrorCode==="linked_to_another_user"){n({errorModalData:{error:ce,previousScreen:_nullishCoalesce(r, () => ("AWAITING_PASSWORDLESS_CODE"))}}),t("ERROR_SCREEN",!1);return}else S("Issue verifying code");D(0)}))},Q=$=>{R===1&&(S(null),D(null));let Y=[...E.slice(0,$),"",...E.slice($+1)];_(Y),$>0&&_optionalChain([document, 'access', _323 => _323.querySelector, 'call', _324 => _324(`input[name=code-${$-1}]`), 'optionalAccess', _325 => _325.focus, 'call', _326 => _326()])},xe=K==0?_jsxruntime.jsx.call(void 0, _EnvelopeIcon2.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):_jsxruntime.jsx.call(void 0, _PhoneIcon2.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),he=K==0?_jsxruntime.jsxs.call(void 0, "p",{children:["Please check ",_jsxruntime.jsx.call(void 0, dy,{children:_optionalChain([d, 'call', _327 => _327(), 'optionalAccess', _328 => _328.email])})," for an email from privy.io and enter your code below."]}):_jsxruntime.jsxs.call(void 0, "p",{children:["Please check ",_jsxruntime.jsx.call(void 0, dy,{children:_optionalChain([d, 'call', _329 => _329(), 'optionalAccess', _330 => _330.phoneNumber])})," for a message from ",_optionalChain([e, 'optionalAccess', _331 => _331.name])||"Privy"," and enter your code below."]});return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:()=>o()},"header"),_jsxruntime.jsxs.call(void 0, _w,{children:[_jsxruntime.jsx.call(void 0, Ce,{title:"Enter confirmation code",description:he,icon:xe}),_jsxruntime.jsxs.call(void 0, oy,{children:[_jsxruntime.jsxs.call(void 0, Mw,{children:[_jsxruntime.jsx.call(void 0, Iw,{fail:!!P,success:A,children:_jsxruntime.jsx.call(void 0, "span",{children:P||(A?"Success!":"")})}),_jsxruntime.jsx.call(void 0, "div",{children:E.map(($,Y)=>_jsxruntime.jsx.call(void 0, "input",{name:`code-${Y}`,type:"text",value:E[Y],onChange:L,onKeyUp:ke=>{ke.key==="Backspace"&&Q(Y)},inputMode:"numeric",autoFocus:Y===0,pattern:"[0-9]",className:`${A?"success":""} ${P?"fail":""}`,autoComplete:_reactdevicedetect.isMobile?"one-time-code":"off"},Y))})]}),_jsxruntime.jsxs.call(void 0, Ww,{children:[_jsxruntime.jsxs.call(void 0, "span",{children:["Didn't get ",K==0?"an email":"a message","?"]}),F?_jsxruntime.jsxs.call(void 0, Ow,{children:[_jsxruntime.jsx.call(void 0, _CheckIcon2.default,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),_jsxruntime.jsx.call(void 0, "span",{children:"Code sent"})]}):_jsxruntime.jsx.call(void 0, Lw,{children:_jsxruntime.jsx.call(void 0, "button",{onClick:async()=>{B(Rw),K==0?await s():await c()},children:"Resend code"})})]})]})]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})},_w=_styledcomponents2.default.div`
756
+ display: flex;
757
+ flex-direction: column;
758
+ align-items: flex-start;
759
+ justify-content: center;
760
+ margin: auto;
761
+ gap: 16px;
762
+ flex-grow: 1;
763
+ `,Mw=_styledcomponents2.default.div`
764
+ display: flex;
765
+ flex-direction: column;
766
+ width: 100%;
767
+ gap: 8px;
768
+
769
+ > div:last-child {
770
+ display: flex;
771
+ justify-content: center;
772
+ gap: 0.5rem;
773
+ width: 100%;
774
+ border-radius: var(--privy-border-radius-md);
775
+
776
+ > input {
777
+ border: 1px solid var(--privy-color-foreground-4);
778
+ background: var(--privy-color-background);
779
+ border-radius: var(--privy-border-radius-md);
780
+ padding: 8px 10px;
781
+ height: 58px;
782
+ width: 46px;
783
+ text-align: center;
784
+ font-size: 18px;
785
+ }
786
+
787
+ > input:focus {
788
+ border: 1px solid var(--privy-color-accent);
789
+ }
790
+
791
+ > input:invalid {
792
+ border: 1px solid var(--privy-color-error);
793
+ }
794
+
795
+ > input.success {
796
+ border: 1px solid var(--privy-color-success);
797
+ }
798
+
799
+ > input.fail {
800
+ border: 1px solid var(--privy-color-error);
801
+ animation: shake 180ms;
802
+ animation-iteration-count: 2;
803
+ }
804
+ }
805
+
806
+ @keyframes shake {
807
+ 0% {
808
+ transform: translate(1px, 0px);
809
+ }
810
+ 33% {
811
+ transform: translate(-1px, 0px);
812
+ }
813
+ 67% {
814
+ transform: translate(-1px, 0px);
815
+ }
816
+ 100% {
817
+ transform: translate(1px, 0px);
818
+ }
819
+ }
820
+ `,Iw=_styledcomponents2.default.div`
821
+ line-height: 20px;
822
+ height: 20px;
823
+ font-size: 13px;
824
+ color: ${e=>e.success?"var(--privy-color-success)":e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
825
+ display: flex;
826
+ justify-content: flex-end;
827
+ width: 100%;
828
+ `,Ww=_styledcomponents2.default.div`
829
+ font-size: 13px;
830
+ color: var(--privy-color-foreground);
831
+ display: flex;
832
+ gap: 8px;
833
+ align-items: center;
834
+ width: 100%;
835
+ margin-top: 16px;
836
+ // Equal opposing size buffer to account for auto margining when the
837
+ // success/fail text does not show up
838
+ padding-bottom: 32px;
839
+ `,Lw=_styledcomponents2.default.div`
840
+ color: var(--privy-color-accent);
841
+ padding: 2px 0;
842
+ > button {
843
+ text-decoration: underline;
844
+ }
845
+ `,Ow=_styledcomponents2.default.div`
846
+ display: flex;
847
+ align-items: center;
848
+ justify-content: center;
849
+ border-radius: var(--privy-border-radius-sm);
850
+ padding: 2px 8px;
851
+ gap: 4px;
852
+ background: var(--privy-color-background-2);
853
+ color: var(--privy-color-foreground-2);
854
+ `,dy=_styledcomponents2.default.span`
855
+ font-weight: 500;
856
+ word-break: break-all;
857
+ `;var _CheckCircleIcon = require('@heroicons/react/24/solid/CheckCircleIcon'); var _CheckCircleIcon2 = _interopRequireDefault(_CheckCircleIcon);var _XCircleIcon = require('@heroicons/react/24/solid/XCircleIcon'); var _XCircleIcon2 = _interopRequireDefault(_XCircleIcon);var uy=({icon:e})=>{let t=e;return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:_jsxruntime.jsx.call(void 0, Uw,{children:_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, ut,{}),typeof t=="string"?_jsxruntime.jsx.call(void 0, "span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?_jsxruntime.jsx.call(void 0, t,{style:{width:"38px",height:"38px"}}):_jsxruntime.jsx.call(void 0, "span",{})]})})})},Uw=_styledcomponents2.default.div`
858
+ display: flex;
859
+ flex-direction: column;
860
+ justify-content: center;
861
+ align-items: center;
862
+ width: 100%;
863
+ height: 82px;
864
+
865
+ > div {
866
+ position: relative;
867
+ }
868
+
869
+ > div > span {
870
+ position: absolute;
871
+ left: -41px;
872
+ top: -41px;
873
+ }
874
+
875
+ > div > :last-child {
876
+ position: absolute;
877
+ left: -19px;
878
+ top: -19px;
879
+ }
880
+ `;var fy=500,my=fy*2,hy=()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:o,navigate:n,setModalData:a}=_chunk3AGMJGHJjs.b.call(void 0, ),{status:i,token:s,waitForResult:c,reset:d,execute:u}=Pe(),f=_react.useRef.call(void 0, []),h=X=>{f.current=[X,...f.current]},[g,w]=_react.useState.call(void 0, !0);_react.useEffect.call(void 0, ()=>{let X=setTimeout(w,my,!1);return h(X),()=>{f.current.forEach(L=>clearTimeout(L)),f.current=[]}},[]);let[v,E]=_react.useState.call(void 0, ""),[_,A]=_react.useState.call(void 0, "Checking that you are a human..."),[T,P]=_react.useState.call(void 0, _jsxruntime.jsx.call(void 0, U,{onClick:()=>{},disabled:!0,children:"Continue"})),[S,R]=_react.useState.call(void 0, !1),[D,F]=_react.useState.call(void 0, 3),B=_optionalChain([r, 'optionalAccess', _332 => _332.captchaModalData]),K=async X=>{try{await _optionalChain([B, 'optionalAccess', _333 => _333.callback, 'call', _334 => _334(X)]),_optionalChain([B, 'optionalAccess', _335 => _335.onSuccessNavigateTo])&&n(_optionalChain([B, 'optionalAccess', _336 => _336.onSuccessNavigateTo]),!1)}catch(L){if(L instanceof Qt)return;{let Q={error:L,previousScreen:e||"LANDING"};a({errorModalData:Q}),n(_optionalChain([B, 'optionalAccess', _337 => _337.onErrorNavigateTo])||"ERROR_SCREEN",!1)}}};_react.useEffect.call(void 0, ()=>{if(i==="success"){let X=setTimeout(async()=>{let L=await c();!L||_optionalChain([B, 'optionalAccess', _338 => _338.userIntentRequired])||K(L)},my);h(X)}else if(i==="ready"){let X=setTimeout(()=>{i==="ready"&&u()},fy);h(X)}},[i]),_react.useEffect.call(void 0, ()=>{if(!g)switch(i){case"success":E("Success!"),A("CAPTCHA passed successfully."),P(_jsxruntime.jsx.call(void 0, U,{onClick:()=>{R(!0),K(s)},disabled:!_optionalChain([B, 'optionalAccess', _339 => _339.userIntentRequired]),loading:S,children:_optionalChain([B, 'optionalAccess', _340 => _340.userIntentRequired])?"Continue":"Continuing..."}));break;case"loading":E(""),A("Checking that you are a human..."),P(_jsxruntime.jsx.call(void 0, U,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":E("Something went wrong"),D<=0?(A("If you use an adblocker or VPN, try disabling and re-attempting."),P(null)):(A("You did not pass CAPTCHA. Please try again."),P(_jsxruntime.jsx.call(void 0, U,{onClick:W,children:"Retry"})));break;case"ready":default:break}},[i,g,S]);let W=async()=>{if(D<=0)return;F(L=>L-1),d(),u();let X=await c();!X||_optionalChain([B, 'optionalAccess', _341 => _341.userIntentRequired])||K(X)};return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:!e||t===e?void 0:o}),_jsxruntime.jsxs.call(void 0, zw,{children:[i==="success"?_jsxruntime.jsx.call(void 0, _CheckCircleIcon2.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):i==="error"?_jsxruntime.jsx.call(void 0, _XCircleIcon2.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):_jsxruntime.jsx.call(void 0, uy,{}),_jsxruntime.jsxs.call(void 0, tt,{children:[v?_jsxruntime.jsx.call(void 0, "h3",{children:v}):null,_jsxruntime.jsx.call(void 0, "p",{children:_})]}),T]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]})},zw=_styledcomponents2.default.div`
881
+ display: flex;
882
+ flex-direction: column;
883
+ align-items: center;
884
+ justify-content: center;
885
+ gap: 24px;
886
+ width: 100%;
887
+ `;var _WalletIcon = require('@heroicons/react/24/outline/WalletIcon'); var _WalletIcon2 = _interopRequireDefault(_WalletIcon);var Pc=({icon:e,name:t})=>typeof e=="string"?_jsxruntime.jsx.call(void 0, "img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):typeof e===void 0?_jsxruntime.jsx.call(void 0, _WalletIcon2.default,{}):e?_jsxruntime.jsx.call(void 0, e,{}):null;var gy=({...e})=>_jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[_jsxruntime.jsx.call(void 0, "defs",{children:_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "stop",{offset:"0",stopColor:"#f1562b"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"0.3",stopColor:"#f1542b"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"0.41",stopColor:"#f04d2a"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"0.49",stopColor:"#ef4229"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"0.5",stopColor:"#ef4029"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"0.56",stopColor:"#e83e28"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"0.67",stopColor:"#e13c26"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"#df3c26"})]})}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]});var Cy=({style:e,...t})=>_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:_jsxruntime.jsx.call(void 0, "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"})}),_jsxruntime.jsxs.call(void 0, "g",{mask:"url(#mask0_16909_31415)",children:[_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}}),_jsxruntime.jsx.call(void 0, "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"}})]}),_jsxruntime.jsxs.call(void 0, "defs",{children:[_jsxruntime.jsxs.call(void 0, "linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[_jsxruntime.jsx.call(void 0, "stop",{stopColor:"#002D72"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),_jsxruntime.jsxs.call(void 0, "linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[_jsxruntime.jsx.call(void 0, "stop",{stopColor:"#002D72",stopOpacity:"0.01"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"#002D72"})]})]})]});var vy=e=>_jsxruntime.jsxs.call(void 0, "svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[_jsxruntime.jsx.call(void 0, "rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),_jsxruntime.jsx.call(void 0, "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)"}),_jsxruntime.jsx.call(void 0, "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)"}),_jsxruntime.jsx.call(void 0, "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)"}),_jsxruntime.jsx.call(void 0, "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)"}),_jsxruntime.jsxs.call(void 0, "defs",{children:[_jsxruntime.jsxs.call(void 0, "linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[_jsxruntime.jsx.call(void 0, "stop",{stopColor:"white"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"white"})]}),_jsxruntime.jsxs.call(void 0, "linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[_jsxruntime.jsx.call(void 0, "stop",{stopColor:"#8697FF"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),_jsxruntime.jsxs.call(void 0, "linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[_jsxruntime.jsx.call(void 0, "stop",{stopColor:"#8697FF"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),_jsxruntime.jsxs.call(void 0, "linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[_jsxruntime.jsx.call(void 0, "stop",{stopColor:"white"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]});var wy=({style:e,...t})=>_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "g",{clipPath:"url(#clip0_5_32)",children:_jsxruntime.jsxs.call(void 0, "g",{clipPath:"url(#clip1_5_32)",children:[_jsxruntime.jsx.call(void 0, "mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:_jsxruntime.jsx.call(void 0, "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"})}),_jsxruntime.jsx.call(void 0, "g",{mask:"url(#mask0_5_32)",children:_jsxruntime.jsx.call(void 0, "rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),_jsxruntime.jsx.call(void 0, "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)"}),_jsxruntime.jsx.call(void 0, "path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),_jsxruntime.jsx.call(void 0, "path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),_jsxruntime.jsx.call(void 0, "path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),_jsxruntime.jsx.call(void 0, "path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),_jsxruntime.jsx.call(void 0, "path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),_jsxruntime.jsx.call(void 0, "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)"}),_jsxruntime.jsx.call(void 0, "path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),_jsxruntime.jsx.call(void 0, "path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),_jsxruntime.jsxs.call(void 0, "defs",{children:[_jsxruntime.jsxs.call(void 0, "linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[_jsxruntime.jsx.call(void 0, "stop",{stopColor:"#174299"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"#001E59"})]}),_jsxruntime.jsxs.call(void 0, "radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[_jsxruntime.jsx.call(void 0, "stop",{offset:"0.770277",stopColor:"#FF4000"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"#8754C9"})]}),_jsxruntime.jsxs.call(void 0, "linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[_jsxruntime.jsx.call(void 0, "stop",{stopColor:"#FF4000"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"#8754C9"})]}),_jsxruntime.jsxs.call(void 0, "linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[_jsxruntime.jsx.call(void 0, "stop",{stopColor:"#8754C9"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"#FF4000"})]}),_jsxruntime.jsxs.call(void 0, "radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[_jsxruntime.jsx.call(void 0, "stop",{offset:"0.723929",stopColor:"#FFF700"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"#FF9901"})]}),_jsxruntime.jsxs.call(void 0, "linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[_jsxruntime.jsx.call(void 0, "stop",{stopColor:"#FFF700"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"#FF9901"})]}),_jsxruntime.jsxs.call(void 0, "linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[_jsxruntime.jsx.call(void 0, "stop",{stopColor:"#FFF700"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"#FF9901"})]}),_jsxruntime.jsxs.call(void 0, "radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[_jsxruntime.jsx.call(void 0, "stop",{offset:"0.59513",stopColor:"#00AAFF"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"#01DA40"})]}),_jsxruntime.jsxs.call(void 0, "radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[_jsxruntime.jsx.call(void 0, "stop",{stopColor:"#00AAFF"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"#01DA40"})]}),_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "stop",{stopColor:"#00AAFF"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"#01DA40"})]}),_jsxruntime.jsx.call(void 0, "clipPath",{id:"clip0_5_32",children:_jsxruntime.jsx.call(void 0, "rect",{width:"120",height:"120",fill:"white"})}),_jsxruntime.jsx.call(void 0, "clipPath",{id:"clip1_5_32",children:_jsxruntime.jsx.call(void 0, "rect",{width:"120",height:"120",fill:"white"})})]})]});var by=({style:e,...t})=>_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "rect",{width:"28",height:"28",rx:"3",fill:"#12FF80"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"})]});var Ty=({style:e,...t})=>_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),_jsxruntime.jsxs.call(void 0, "g",{children:[_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]});var Py=({style:e,...t})=>_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsxs.call(void 0, "g",{clipPath:"url(#clip0_1704_1423)",children:[_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"})]}),_jsxruntime.jsx.call(void 0, "defs",{children:_jsxruntime.jsx.call(void 0, "clipPath",{id:"clip0_1704_1423",children:_jsxruntime.jsx.call(void 0, "rect",{width:"176",height:"176",fill:"white"})})})]});var zr={coinbase_wallet:{logo:Ko,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:Ko,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:ti,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:Po,displayName:"Phantom"},rainbow:{logo:wy,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:ps,displayName:"WalletConnect"},zerion:{logo:Py,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:gy,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:Cy,displayName:"Crypto.com DeFi Wallet",rdns:"com.crypto.wallet"},uniswap:{logo:Ty,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:vy,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"},safe:{displayName:"Safe",logo:by}},gn=(e,t,r)=>{if(_optionalChain([zr, 'access', _342 => _342[e], 'optionalAccess', _343 => _343.displayName]))return e==="coinbase_wallet"?zr[r].displayName:zr[e].displayName;if(t==="wallet_connect_v2"&&e==="wallet_connect")return"Wallet Connect"},xc=(e,t,r)=>{if(_optionalChain([zr, 'access', _344 => _344[e], 'optionalAccess', _345 => _345.logo]))return e==="coinbase_wallet"?zr[r].logo:zr[e].logo;if(t==="wallet_connect_v2"&&e==="wallet_connect")return ps};function mi(e){let t=e.toLowerCase();return!!_optionalChain([window, 'optionalAccess', _346 => _346.webkit, 'optionalAccess', _347 => _347.messageHandlers, 'optionalAccess', _348 => _348.ReactNativeWebView])||!!_optionalChain([window, 'optionalAccess', _349 => _349.ReactNativeWebView])||["fbav","fban","instagram","snapchat","linkedinapp"].some(n=>t.includes(n))}var ma=({provider:e,displayName:t,logo:r,connectOnly:o,connector:n})=>{let{navigate:a}=_chunk3AGMJGHJjs.b.call(void 0, ),{connectWallet:i}=_chunkXKAIXCX7js.ra.call(void 0, ),s=_chunkLEABMTNMjs.P.call(void 0, ),c=n.connectorType==="wallet_connect_v2"?e:n.walletClientType,d=window.matchMedia("(display-mode: standalone)").matches,u;return n.connectorType==="phantom"||n.connectorType==="solana_adapter"&&n.walletClientType==="phantom"?u=()=>{_chunkLEABMTNMjs.c.call(void 0, )||n.chainType==="solana"&&"isInstalled"in n&&n.isInstalled?(i(n,c),a(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):a(_reactdevicedetect.isMobile?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:n.connectorType==="coinbase_wallet"&&n.connectionOptions==="eoaOnly"&&_reactdevicedetect.isMobile&&!d&&!_chunkLEABMTNMjs.d.call(void 0, )?u=()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`}:u=()=>{mi(window.navigator.userAgent)&&!_optionalChain([event, 'optionalAccess', _350 => _350.isTrusted])||(i(n,c),a(o?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION"))},_jsxruntime.jsxs.call(void 0, Xw,{onClick:u,children:[_jsxruntime.jsx.call(void 0, Pc,{icon:_nullishCoalesce(xc(e,n.connectorType,n.walletClientType), () => (r)),name:n.walletClientType}),_jsxruntime.jsx.call(void 0, "span",{children:gn(e,n.connectorType,n.walletClientType)||t||n.walletClientType}),_jsxruntime.jsxs.call(void 0, Zw,{id:"chip-container",children:[_optionalChain([s, 'optionalAccess', _351 => _351.connectorType])===n.connectorType&&_optionalChain([s, 'optionalAccess', _352 => _352.walletClientType])===c?_jsxruntime.jsx.call(void 0, xy,{color:"gray",children:"Recent"}):_jsxruntime.jsx.call(void 0, "span",{id:"connect-text",children:"Connect"}),n.connectorType==="solana_adapter"&&_jsxruntime.jsx.call(void 0, xy,{color:"gray",children:"Solana"})]})]})},Xw=_styledcomponents2.default.call(void 0, Ae)`
888
+ /* Show "Connect" on hover */
889
+ > #chip-container > #connect-text {
890
+ font-weight: 500;
891
+ color: var(--privy-color-accent);
892
+ opacity: 0;
893
+ transition: opacity 0.1s ease-out;
894
+ }
895
+
896
+ :hover > #chip-container > #connect-text {
897
+ opacity: 1;
898
+ }
899
+
900
+ @media (max-width: 440px) {
901
+ > #chip-container > #connect-text {
902
+ display: none;
903
+ }
904
+ }
905
+ `,xy=_styledcomponents2.default.call(void 0, _chunkLEABMTNMjs.N)`
906
+ margin-left: auto;
907
+ `,Zw=_styledcomponents2.default.div`
908
+ display: flex;
909
+ flex-wrap: wrap;
910
+ gap: 8px;
911
+ margin-left: auto;
912
+ `;var Jw=["coinbase_wallet"],jw=["metamask","okx_wallet","rainbow","uniswap","uniswap_extension","zerion","rabby_wallet","cryptocom"],$w=["safe"],e4=["phantom"],hi=({connectOnly:e})=>{let{connectors:t}=_chunkXKAIXCX7js.ra.call(void 0, ),{app:r,data:o}=_chunk3AGMJGHJjs.b.call(void 0, ),n=Cn(_nullishCoalesce(_optionalChain([o, 'optionalAccess', _353 => _353.externalConnectWallet, 'optionalAccess', _354 => _354.walletList]), () => (r.appearance.walletList)),r.appearance.walletChainType,t,e,r.appearance.walletList,r.externalWallets.walletConnect.enabled);return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[...n]})},Cn=(e,t,r,o,n,a)=>{let i=[],s=[],c=[];r=r.filter(u=>t==="ethereum-only"?u.chainType==="ethereum":t==="solana-only"?u.chainType==="solana":!0);let d=r.find(u=>u.connectorType==="wallet_connect_v2");for(let u of e)if(u==="detected_wallets"){let f=r.filter(({chainType:h,connectorType:g,walletClientType:w})=>w==="uniswap_wallet_extension"||w==="uniswap_extension"?!n.includes("uniswap"):w==="crypto.com_wallet_extension"?!n.includes("cryptocom"):h==="solana"?t!=="ethereum-only":g==="injected"&&!n.includes(w));for(let[h,g]of f.entries()){let{walletClientType:w,walletBranding:v}=g;(w==="unknown"?s:i).push(_jsxruntime.jsx.call(void 0, ma,{connectOnly:o,provider:w,logo:v.icon,displayName:v.name,connector:g},`${u}-${w}-${g.chainType}-${h}`))}}else if(e4.includes(u)){let f=r.find(h=>h.connectorType==="injected"&&h.walletClientType===u||h.connectorType===u);f&&i.push(_jsxruntime.jsx.call(void 0, ma,{connectOnly:o,provider:u,connector:f},u))}else if(jw.includes(u)){let f=r.find(h=>u==="uniswap"?h.walletClientType==="uniswap_wallet_extension"||h.walletClientType==="uniswap_extension":u==="cryptocom"?h.walletClientType==="crypto.com_wallet_extension":h.connectorType==="injected"&&h.walletClientType===u);a&&!f&&(f=d),f&&i.push(_jsxruntime.jsx.call(void 0, ma,{connectOnly:o,provider:u,connector:f,logo:f.connectorType==="injected"?f.walletBranding.icon:void 0,displayName:f.connectorType==="injected"?f.walletBranding.name:void 0},u))}else if(Jw.includes(u)){let f=r.find(({connectorType:h})=>h===u);f&&i.push(_jsxruntime.jsx.call(void 0, ma,{connectOnly:o,provider:u,connector:f},u))}else $w.includes(u)?d&&c.push(_jsxruntime.jsx.call(void 0, ma,{connectOnly:o,provider:u,connector:d},u)):u==="wallet_connect"&&d&&c.push(_jsxruntime.jsx.call(void 0, ma,{connectOnly:o,provider:u,connector:d},u));return[...s,...i,...c]};var Ry=()=>{let{app:e,data:t}=_chunk3AGMJGHJjs.b.call(void 0, ),r=_optionalChain([t, 'optionalAccess', _355 => _355.externalConnectWallet, 'optionalAccess', _356 => _356.suggestedAddress]),o=r?`Connect the wallet with address ${_chunkLEABMTNMjs.h.call(void 0, r)} ${_optionalChain([e, 'optionalAccess', _357 => _357.name])?`to ${e.name}.`:"."}`:`Connect a wallet to ${_optionalChain([e, 'optionalAccess', _358 => _358.name])}`;return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{},"header"),_jsxruntime.jsx.call(void 0, Ro,{title:"Connect your wallet",description:o}),_jsxruntime.jsx.call(void 0, pr,{children:_jsxruntime.jsx.call(void 0, hi,{connectOnly:!0})}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})};var My=()=>{let{app:e,data:t}=_chunk3AGMJGHJjs.b.call(void 0, ),r=_optionalChain([t, 'optionalAccess', _359 => _359.externalConnectWallet, 'optionalAccess', _360 => _360.suggestedAddress]),o=r?_jsxruntime.jsxs.call(void 0, "span",{children:["Connect the wallet with address ",_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.Q,{showCopyIcon:!1,address:r})," ",_optionalChain([e, 'optionalAccess', _361 => _361.name])?`to ${e.name}.`:"."]}):`Connect a wallet to your ${_optionalChain([e, 'optionalAccess', _362 => _362.name])} account`;return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{},"header"),_jsxruntime.jsx.call(void 0, pa,{title:"Connect your wallet",description:o}),_jsxruntime.jsx.call(void 0, pr,{children:_jsxruntime.jsx.call(void 0, hi,{connectOnly:!0})}),e&&_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.J,{app:e,alwaysShowImplicitConsent:!0}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})};var s4=(e,t)=>{let r=_react.useRef.call(void 0, ()=>{});_react.useEffect.call(void 0, ()=>{r.current=e}),_react.useEffect.call(void 0, ()=>{if(t!==null){let o=setInterval(()=>r.current(),t||0);return()=>clearInterval(o)}},[t])},Wy=s4;function Ly(){let[e,t]=_react.useState.call(void 0, !1),r=_react.useCallback.call(void 0, ()=>{document.hidden&&t(!0)},[]);return _react.useEffect.call(void 0, ()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}var zp=2,Yp=e=>_optionalChain([e, 'optionalAccess', _363 => _363.privyErrorCode])==="linked_to_another_user"?Eo.ERROR_USER_EXISTS:e instanceof _t&&!e.details.default?e.details:e instanceof Za?Eo.ERROR_TIMED_OUT:e instanceof Ja?Eo.ERROR_USER_REJECTED_CONNECTION:_optionalChain([e, 'optionalAccess', _364 => _364.privyErrorCode])==="cannot_link_more_of_type"?Eo.ERROR_USER_LIMIT_REACHED:Eo.ERROR_WALLET_CONNECTION,Ny=()=>{let[e,t]=_react.useState.call(void 0, !1),[r,o]=_react.useState.call(void 0, !1),[n,a]=_react.useState.call(void 0, void 0),{authenticated:i,logout:s}=_chunkXKAIXCX7js.ta.call(void 0, ),{app:c,navigate:d,navigateBack:u,lastScreen:f,currentScreen:h,setModalData:g,data:w}=_chunk3AGMJGHJjs.b.call(void 0, ),{getAuthFlow:v,walletConnectionStatus:E,closePrivyModal:_,initLoginWithWallet:A,loginWithWallet:T,updateWallets:P,createAnalyticsEvent:S}=_chunkXKAIXCX7js.ra.call(void 0, ),{walletConnectors:R}=_chunkXKAIXCX7js.ta.call(void 0, ),[D,F]=_react.useState.call(void 0, 0),{user:B}=_chunkXKAIXCX7js.ta.call(void 0, ),[K]=_react.useState.call(void 0, _optionalChain([B, 'optionalAccess', _365 => _365.linkedAccounts, 'access', _366 => _366.length])||0),[W,X]=_react.useState.call(void 0, ""),[L,Q]=_react.useState.call(void 0, ""),[xe,he]=_react.useState.call(void 0, !1),{hasTabbedAway:$}=Ly(),{enabled:Y,token:ke}=Pe(),ye=_reactdevicedetect.isMobile&&_optionalChain([E, 'optionalAccess', _367 => _367.connector, 'optionalAccess', _368 => _368.connectorType])==="wallet_connect_v2"||_reactdevicedetect.isMobile&&_optionalChain([E, 'optionalAccess', _369 => _369.connector, 'optionalAccess', _370 => _370.connectorType])==="coinbase_wallet"||_reactdevicedetect.isMobile&&_optionalChain([E, 'optionalAccess', _371 => _371.connector, 'optionalAccess', _372 => _372.connectorType])==="injected"&&_optionalChain([E, 'optionalAccess', _373 => _373.connector, 'optionalAccess', _374 => _374.walletClientType])==="phantom",te=_optionalChain([E, 'optionalAccess', _375 => _375.status])==="connected",se=_optionalChain([E, 'optionalAccess', _376 => _376.status])==="switching_to_supported_chain";_react.useEffect.call(void 0, ()=>{let G=v(),J=G instanceof zo||G instanceof oa?G:void 0;if(te&&!J&&(Y&&!ke&&!i?(g({captchaModalData:{callback:Lt=>A(E.connectedWallet,Lt,_optionalChain([w, 'optionalAccess', _377 => _377.login, 'optionalAccess', _378 => _378.disableSignup])).then(()=>{he(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),d("CAPTCHA_SCREEN",!1)):A(E.connectedWallet,ke,_optionalChain([w, 'optionalAccess', _379 => _379.login, 'optionalAccess', _380 => _380.disableSignup])).then(()=>{he(!0)})),J&&ye&&te&&!J.preparedMessage){J.buildMessage();return}!J||ye||!te||r||(async()=>{o(!0),a(void 0);try{_optionalChain([E, 'optionalAccess', _381 => _381.connector, 'optionalAccess', _382 => _382.connectorType])==="wallet_connect_v2"&&_optionalChain([E, 'optionalAccess', _383 => _383.connector, 'optionalAccess', _384 => _384.walletClientType])==="metamask"&&await _chunkLEABMTNMjs.i.call(void 0, 2500),await Qe()}catch(Lt){console.warn("Auto-prompted signature failed",Lt)}finally{o(!1)}})()},[D,te,xe]),_react.useEffect.call(void 0, ()=>{if(B&&e){let J=_chunkXKAIXCX7js.r-500;if(_optionalChain([c, 'optionalAccess', _385 => _385.legal, 'access', _386 => _386.requireUsersAcceptTerms])&&!B.hasAcceptedTerms){let we=setTimeout(()=>{d("AFFIRMATIVE_CONSENT_SCREEN")},J);return()=>clearTimeout(we)}if(_chunkLEABMTNMjs.A.call(void 0, B,_optionalChain([c, 'optionalAccess', _387 => _387.embeddedWallets, 'optionalAccess', _388 => _388.createOnLogin]))){let we=setTimeout(()=>{g({createWallet:{onSuccess:()=>{},onFailure:gt=>{console.error(gt),S({eventName:"embedded_wallet_creation_failure_logout",payload:{error:gt,screen:"ConnectionStatusScreen"}}),s()},callAuthOnSuccessOnClose:!0}}),d("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},J);return()=>clearTimeout(we)}P();let Lt=setTimeout(()=>_({shouldCallAuthOnSuccess:!0,isSuccess:!0}),_chunkXKAIXCX7js.r);return()=>clearTimeout(Lt)}},[B,e]);let Ge=G=>{if(_optionalChain([G, 'optionalAccess', _389 => _389.privyErrorCode])==="allowlist_rejected"){d("ALLOWLIST_REJECTION_SCREEN");return}else if(_optionalChain([G, 'optionalAccess', _390 => _390.privyErrorCode])==="max_accounts_reached"){console.error(new (0, _chunkXKAIXCX7js.o)(G).toString()),d("USER_LIMIT_REACHED_SCREEN");return}else if(_optionalChain([G, 'optionalAccess', _391 => _391.privyErrorCode])==="user_does_not_exist"){d("ACCOUNT_NOT_FOUND_SCREEN");return}a(Yp(G))};async function Qe(){try{await T(),t(!0)}catch(G){Ge(G)}finally{o(!1)}}_react.useEffect.call(void 0, ()=>{_optionalChain([E, 'optionalAccess', _392 => _392.connectError])&&Ge(_optionalChain([E, 'optionalAccess', _393 => _393.connectError]))},[E]),Wy(()=>{let G=ce==="wallet_connect_v2"&&_optionalChain([E, 'optionalAccess', _394 => _394.connector]) instanceof ao?E.connector.redirectUri:void 0;G&&X(G);let J=ce==="wallet_connect_v2"&&_optionalChain([E, 'optionalAccess', _395 => _395.connector]) instanceof ao?E.connector.fallbackUniversalRedirectUri:void 0;J&&Q(J)},_optionalChain([E, 'optionalAccess', _396 => _396.connector]) instanceof ao&&!W?500:null);let ce=_optionalChain([E, 'optionalAccess', _397 => _397.connector, 'optionalAccess', _398 => _398.connectorType])||"injected",pt=_optionalChain([E, 'optionalAccess', _399 => _399.connector, 'optionalAccess', _400 => _400.walletClientType])||"unknown",or=_optionalChain([zr, 'access', _401 => _401[pt], 'optionalAccess', _402 => _402.displayName])||_optionalChain([E, 'optionalAccess', _403 => _403.connector, 'optionalAccess', _404 => _404.walletBranding, 'access', _405 => _405.name])||"Browser Extension",wt=_optionalChain([zr, 'access', _406 => _406[pt], 'optionalAccess', _407 => _407.logo])||_optionalChain([E, 'optionalAccess', _408 => _408.connector, 'optionalAccess', _409 => _409.walletBranding, 'access', _410 => _410.icon])||(G=>_jsxruntime.jsx.call(void 0, ei,{...G})),Ee=or==="Browser Extension"?or.toLowerCase():or,ue;e?ue=`Successfully connected with ${Ee}`:n?ue=n.message:se?ue="Switching networks":te?ue=r&&ye?"Signing":"Sign to verify":ue=`Waiting for ${Ee}`;let M="Don\u2019t see your wallet? Check your other browser windows.";if(e){let G=_optionalChain([B, 'optionalAccess', _411 => _411.linkedAccounts, 'access', _412 => _412.length])||0;K===G?M="Wallet was already linked.":M="You\u2019re good to go!"}else D>=zp&&n?M="Unable to connect wallet":n?M=n.detail:se?M="Switch your wallet to the requested network.":te&&ye?M="Sign the message in your wallet to verify it belongs to you.":pt==="metamask"&&_reactdevicedetect.isMobile?M="Click continue to open and connect MetaMask.":pt==="metamask"?M="For the best experience, connect only one wallet at a time.":ce==="wallet_connect"?M="Open your mobile wallet app to continue":ce==="coinbase_wallet"&&(_chunkLEABMTNMjs.d.call(void 0, )||(xp(B)?M="Continue with the Coinbase app. Not the right wallet? Reset your connection below.":M="Open the Coinbase app on your phone to continue."));let le=_optionalChain([R, 'optionalAccess', _413 => _413.walletConnectors, 'optionalAccess', _414 => _414.find, 'call', _415 => _415(G=>G.walletClientType==="coinbase_wallet")]),nn=pt==="coinbase_wallet"&&(xp(B)||n===Eo.ERROR_USER_EXISTS);return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:!f||h===f?void 0:u}),_jsxruntime.jsxs.call(void 0, p4,{children:[_jsxruntime.jsx.call(void 0, Qp,{walletLogo:wt,success:e,fail:!!n}),_jsxruntime.jsxs.call(void 0, tt,{children:[_jsxruntime.jsx.call(void 0, "h3",{children:ue}),_jsxruntime.jsx.call(void 0, "p",{children:M}),!te&&W&&!$?_jsxruntime.jsxs.call(void 0, "p",{children:["Still here?"," ",_jsxruntime.jsx.call(void 0, "a",{href:W,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),L&&_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[" ","or"," ",_jsxruntime.jsx.call(void 0, "a",{href:L,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]}):null]}),nn?_jsxruntime.jsx.call(void 0, U,{onClick:()=>le&&_optionalChain([le, 'optionalAccess', _416 => _416.disconnect, 'call', _417 => _417()]),disabled:e,children:"Use a different wallet"}):n==Eo.ERROR_USER_EXISTS&&h!==f?_jsxruntime.jsx.call(void 0, U,{onClick:u,children:"Use a different wallet"}):te&&!e&&ye?_jsxruntime.jsx.call(void 0, U,{onClick:()=>{o(!0),Qe()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&_optionalChain([n, 'optionalAccess', _418 => _418.retryable])&&D<zp?_jsxruntime.jsx.call(void 0, U,{onClick:()=>{F(D+1),a(void 0),te?(o(!0),Qe()):_optionalChain([E, 'optionalAccess', _419 => _419.connectRetry, 'call', _420 => _420()])},disabled:!e&&(!_optionalChain([n, 'optionalAccess', _421 => _421.retryable])||D>=zp),children:"Retry"}):!e&&!n?_jsxruntime.jsx.call(void 0, U,{onClick:()=>{},disabled:!0,children:"Connecting"}):null]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]})},p4=_styledcomponents2.default.div`
913
+ display: flex;
914
+ flex-direction: column;
915
+ align-items: center;
916
+ justify-content: center;
917
+ gap: 24px;
918
+ width: 100%;
919
+ `,u4=_styledcomponents2.default.div`
920
+ display: flex;
921
+ flex-direction: column;
922
+ justify-content: center;
923
+ align-items: center;
924
+ width: 100%;
925
+ height: 82px;
926
+
927
+ > div {
928
+ position: relative;
929
+ }
930
+
931
+ > div > span {
932
+ position: absolute;
933
+ left: -41px;
934
+ top: -41px;
935
+ }
936
+
937
+ > div > :last-child {
938
+ position: absolute;
939
+ left: -19px;
940
+ top: -19px;
941
+ }
942
+ `,Qp=e=>{let t=e.walletLogo;return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:_jsxruntime.jsx.call(void 0, u4,{children:_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, ut,{success:e.success,fail:e.fail}),typeof t=="string"?_jsxruntime.jsx.call(void 0, "span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):_jsxruntime.jsx.call(void 0, t,{style:{width:"38px",height:"38px"}})]})})})};var Rc=2,Fy=()=>{let{navigateBack:e,navigate:t,lastScreen:r,currentScreen:o,data:n}=_chunk3AGMJGHJjs.b.call(void 0, ),{walletConnectionStatus:a,closePrivyModal:i}=_chunkXKAIXCX7js.ra.call(void 0, ),[s,c]=_react.useState.call(void 0, void 0),[d,u]=_react.useState.call(void 0, 0),f=_optionalChain([a, 'optionalAccess', _422 => _422.status])==="connected",h=_optionalChain([a, 'optionalAccess', _423 => _423.status])==="switching_to_supported_chain";_react.useEffect.call(void 0, ()=>{if(f){let S;if(_optionalChain([n, 'optionalAccess', _424 => _424.externalConnectWallet, 'optionalAccess', _425 => _425.onCompleteNavigateTo])){let R=n.externalConnectWallet.onCompleteNavigateTo;S=setTimeout(()=>{t(R)},_chunkXKAIXCX7js.r)}else S=setTimeout(i,_chunkXKAIXCX7js.r);return()=>clearTimeout(S)}},[f]);let g=S=>{c(Yp(S))};_react.useEffect.call(void 0, ()=>{_optionalChain([a, 'optionalAccess', _426 => _426.connectError])&&g(_optionalChain([a, 'optionalAccess', _427 => _427.connectError]))},[a]);let w=_optionalChain([a, 'optionalAccess', _428 => _428.connector, 'optionalAccess', _429 => _429.connectorType])||"injected",v=_optionalChain([a, 'optionalAccess', _430 => _430.connector, 'optionalAccess', _431 => _431.walletClientType])||"unknown",E=_optionalChain([zr, 'access', _432 => _432[v], 'optionalAccess', _433 => _433.displayName])||_optionalChain([a, 'optionalAccess', _434 => _434.connector, 'optionalAccess', _435 => _435.walletBranding, 'access', _436 => _436.name])||"Browser Extension",_=_optionalChain([zr, 'access', _437 => _437[v], 'optionalAccess', _438 => _438.logo])||_optionalChain([a, 'optionalAccess', _439 => _439.connector, 'optionalAccess', _440 => _440.walletBranding, 'access', _441 => _441.icon])||(S=>_jsxruntime.jsx.call(void 0, ei,{...S})),A=E==="Browser Extension"?E.toLowerCase():E,T;f?T=`Successfully connected with ${A}`:s?T=s.message:h?T="Switching networks":T=`Waiting for ${A}`;let P="Don\u2019t see your wallet? Check your other browser windows.";return f?P="You\u2019re good to go!":d>=Rc&&s?P="Unable to connect wallet":s?P=s.detail:h?P="Switch your wallet to the requested network.":v==="metamask"&&_reactdevicedetect.isMobile?P="Click to continue to open and connect MetaMask.":v==="metamask"?P="For the best experience, connect only one wallet at a time.":w==="wallet_connect_v2"?P="Open your mobile wallet app to continue":w==="coinbase_wallet"&&(P="Open the Coinbase app on your phone to continue."),_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:o===r?void 0:e}),_jsxruntime.jsxs.call(void 0, h4,{children:[_jsxruntime.jsx.call(void 0, Qp,{walletLogo:_,success:f,fail:!!s}),_jsxruntime.jsxs.call(void 0, tt,{children:[_jsxruntime.jsx.call(void 0, "h3",{children:T}),_jsxruntime.jsx.call(void 0, "p",{children:P})]}),s==Eo.ERROR_USER_EXISTS?_jsxruntime.jsx.call(void 0, U,{onClick:e,children:"Use a different wallet"}):!f&&_optionalChain([s, 'optionalAccess', _442 => _442.retryable])&&d<Rc?_jsxruntime.jsx.call(void 0, U,{onClick:()=>{u(d+1),c(void 0),_optionalChain([a, 'optionalAccess', _443 => _443.connectRetry, 'call', _444 => _444()])},disabled:!f&&(!_optionalChain([s, 'optionalAccess', _445 => _445.retryable])||d>=Rc),children:"Retry"}):!f&&s&&d>=Rc?_jsxruntime.jsx.call(void 0, U,{onClick:e,children:"Use a different wallet"}):null]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]})},h4=_styledcomponents2.default.div`
943
+ display: flex;
944
+ flex-direction: column;
945
+ align-items: center;
946
+ justify-content: center;
947
+ gap: 24px;
948
+ width: 100%;
949
+ `;var Hy=({name:e,logoUrl:t})=>{let r=`${_nullishCoalesce(e, () => ("Provider app"))} logo`;return typeof t=="string"?_jsxruntime.jsx.call(void 0, "img",{src:t,alt:r,style:{width:"38px",height:"38px",maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):_jsxruntime.jsx.call(void 0, "span",{})};var Gy=()=>{let e=_chunkXKAIXCX7js.oa.call(void 0, ),{data:t,navigate:r,setModalData:o,onUserCloseViaDialogOrKeybindRef:n}=_chunk3AGMJGHJjs.b.call(void 0, ),{crossAppAuthFlow:a,updateWallets:i,closePrivyModal:s,createAnalyticsEvent:c}=_chunkXKAIXCX7js.ra.call(void 0, ),{logout:d}=_chunkLEABMTNMjs.R.call(void 0, ),[u,f]=_react.useState.call(void 0, {}),h=_optionalChain([t, 'optionalAccess', _446 => _446.crossAppAuth]),g={id:h.appId,name:h.name,logoUrl:h.logoUrl},w=_chunkXKAIXCX7js.r,v=new (0, _chunkXKAIXCX7js.g)(`There was an issue connecting your ${g.name} account. Please try again.`),E=new ze(async P=>{if(!h.popup){f({error:v});return}try{let S=await a({appId:P,popup:h.popup,action:h.action});f({data:S})}catch(S){S instanceof _chunkXKAIXCX7js.g?f({error:S}):S instanceof _chunkXKAIXCX7js.f?(h.popup&&h.popup.close(),f({error:v})):f({error:v})}}),_=()=>{u.data&&(i(),h.onSuccess(u.data),s({shouldCallAuthOnSuccess:!0,isSuccess:!0})),h.onError(_nullishCoalesce(u.error, () => (new (0, _chunkXKAIXCX7js.g)("User canceled flow")))),s({shouldCallAuthOnSuccess:!1,isSuccess:!1})};n.current=_,_react.useEffect.call(void 0, ()=>{g.id.length&&E.execute(g.id)},[g.id]),_react.useEffect.call(void 0, ()=>{if(!u.data)return;let P=u.data;if(e.legal.requireUsersAcceptTerms&&!P.hasAcceptedTerms){let R=setTimeout(()=>{r("AFFIRMATIVE_CONSENT_SCREEN")},w);return()=>clearTimeout(R)}if(_chunkLEABMTNMjs.A.call(void 0, P,_optionalChain([e, 'access', _447 => _447.embeddedWallets, 'optionalAccess', _448 => _448.createOnLogin]))){let R=setTimeout(()=>{o({createWallet:{onSuccess:()=>{},onFailure:D=>{console.error(D),c({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")},w);return()=>clearTimeout(R)}let S=setTimeout(_,w);return()=>clearTimeout(S)},[u.data]);let{title:A,subtitle:T}=_react.useMemo.call(void 0, ()=>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 _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:_}),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsxs.call(void 0, w4,{children:[_jsxruntime.jsx.call(void 0, et,{children:_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, ut,{success:!!u.data,fail:!!u.error}),_jsxruntime.jsx.call(void 0, Hy,{name:g.name,logoUrl:g.logoUrl})]})}),_jsxruntime.jsxs.call(void 0, tt,{children:[_jsxruntime.jsx.call(void 0, "h3",{children:A}),_jsxruntime.jsx.call(void 0, "p",{children:T})]})]}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]})},w4=_styledcomponents2.default.div`
950
+ display: flex;
951
+ flex-direction: column;
952
+ align-items: center;
953
+ justify-content: center;
954
+ margin-left: 27px;
955
+ margin-right: 27px;
956
+ gap: 24px;
957
+ `;var Ic=()=>_jsxruntime.jsx.call(void 0, E4,{children:_jsxruntime.jsxs.call(void 0, T4,{children:[_jsxruntime.jsx.call(void 0, S4,{}),_jsxruntime.jsx.call(void 0, P4,{})]})}),E4=_styledcomponents2.default.div`
958
+ display: flex;
959
+ justify-content: center;
960
+ align-items: center;
961
+ flex-grow: 1;
962
+
963
+ margin: 12px;
964
+ padding: 16px;
965
+
966
+ @media all and (display-mode: standalone) {
967
+ margin-bottom: 30px;
968
+ }
969
+ `,T4=_styledcomponents2.default.div`
970
+ position: relative;
971
+ height: 140px;
972
+ width: 140px;
973
+
974
+ opacity: 1;
975
+ animation: fadein 200ms ease;
976
+ `,S4=_styledcomponents2.default.div`
977
+ position: absolute;
978
+ top: 0;
979
+ right: 0;
980
+ bottom: 0;
981
+ left: 0;
982
+ width: 140px;
983
+ height: 140px;
984
+
985
+ && {
986
+ border: 4px solid var(--privy-color-accent-light);
987
+ border-radius: 50%;
988
+ }
989
+ `,P4=_styledcomponents2.default.div`
990
+ position: absolute;
991
+ top: 0;
992
+ right: 0;
993
+ bottom: 0;
994
+ left: 0;
995
+ width: 140px;
996
+ height: 140px;
997
+ animation: spin 1200ms linear infinite;
998
+
999
+ && {
1000
+ border: 4px solid;
1001
+ border-color: var(--privy-color-accent) transparent transparent transparent;
1002
+ border-radius: 50%;
1003
+ }
1004
+
1005
+ @keyframes spin {
1006
+ from {
1007
+ transform: rotate(0deg);
1008
+ }
1009
+ to {
1010
+ transform: rotate(360deg);
1011
+ }
1012
+ }
1013
+ `;var qy=["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 Ue=class extends Error{constructor(r,o){super(o);this.type=r}};function gi(e){let t=e.type;return typeof t=="string"&&qy.includes(t)}function x4(e){let t=e.type;return typeof t=="string"&&t==="client_error"}function ha(e){return gi(e)&&e.type==="wallet_not_on_device"}function zy(e){return gi(e)&&(e.type==="invalid_recovery_pin"||e.type==="invalid_request_arguments")}function ya(e){return!!(gi(e)&&e.type==="mfa_timeout")}function ga(e){return!!(gi(e)&&e.type==="missing_or_invalid_mfa")}function Jp(e){return!!(gi(e)&&e.type==="mfa_verification_max_attempts_reached")}function Wc(e){return!!(gi(e)&&e.message.includes("code 429"))}function Lc(e){return!!(x4(e)&&e.message==="MFA canceled")}function jp({isCreatingWallet:e,skipSplashScreen:t}){return e?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":t?"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function Oc({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r,isResettingPassword:o,showAutomaticRecovery:n}){return n?"EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN":r||t.length===1?jp({isCreatingWallet:e==="create",skipSplashScreen:o}):"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"}function Nc(e){switch(e){case"user-passcode":return"EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN";case"google-drive":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";case"icloud":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";default:throw new Error("Recovery method not supported")}}async function $p({api:e,provider:t}){let r=ea(),o=Ya(),n=await Qa(r);try{return t==="icloud"?{url:(await e.post(Nf,{client_type:"web"})).url}:{url:(await e.post(Of,{redirect_to:window.location.href,code_challenge:n,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(a){throw _chunkXKAIXCX7js.j.call(void 0, a)}}async function Ky({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:n}){if(!n||!r)throw new (0, _chunkXKAIXCX7js.g)("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(n==="undefined")throw new (0, _chunkXKAIXCX7js.g)("User denied confirmation during OAuth flow");try{return(await e.post(Df,{authorization_code:n,state_code:r,code_verifier:o,provider:t})).access_token}catch(a){let i=_chunkXKAIXCX7js.j.call(void 0, a);throw i.privyErrorCode?new (0, _chunkXKAIXCX7js.g)(i.message||"Invalid code during OAuth flow.",void 0,i.privyErrorCode):i.message==="User denied confirmation during OAuth flow"?new (0, _chunkXKAIXCX7js.g)("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new (0, _chunkXKAIXCX7js.g)("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}var Yy=1,Xy=()=>{let{authenticated:e,user:t,getAccessToken:r}=_chunkXKAIXCX7js.ta.call(void 0, ),{closePrivyModal:o,createAnalyticsEvent:n,walletProxy:a}=_chunkXKAIXCX7js.ra.call(void 0, ),{navigate:i,data:s,setModalData:c,onUserCloseViaDialogOrKeybindRef:d}=_chunk3AGMJGHJjs.b.call(void 0, ),u=_react.useMemo.call(void 0, ()=>Date.now(),[]),[f,h]=_react.useState.call(void 0, !1),{onCompleteNavigateTo:g,onFailure:w,shouldForceMFA:v,address:E}=_optionalChain([s, 'optionalAccess', _449 => _449.connectWallet]),_=T=>{f||(h(!0),w(typeof T=="string"?new Error(T):T))};_react.useEffect.call(void 0, ()=>{let T=E?_optionalChain([t, 'optionalAccess', _450 => _450.linkedAccounts, 'access', _451 => _451.find, 'call', _452 => _452(R=>R.type==="wallet"&&R.walletClientType==="privy"&&R.address===E)]):_chunkLEABMTNMjs.v.call(void 0, t),P;return!e||!T?_("User must be authenticated and have a Privy wallet before it can be connected"):a?((async()=>{let R=await r();if(!R)return _("User must be authenticated and have a Privy wallet before it can be connected");try{await a.connect({accessToken:R,address:T.address}),v&&await a.verifyMfa({accessToken:R});let D=(Date.now()-u)/1e3;g==="EMBEDDED_WALLET_KEY_EXPORT_SCREEN"&&D<Yy?P=setTimeout(()=>{i(g,!1)},(Yy-D)*1e3):i(g,!1)}catch(D){if(ha(D)&&T.recoveryMethod==="privy"){let F=await r();if(!F)return _("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 _asyncOptionalChain([(await _optionalChain([a, 'optionalAccess', _453 => _453.recover, 'call', _454 => _454({address:T.address,accessToken:F,recoveryMethod:T.recoveryMethod})])), 'optionalAccess', async _455 => _455.address])||_(new Error("Unable to recover wallet")),g?i(g):o({shouldCallAuthOnSuccess:!1}),n({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:T.address}}),i(g)}catch (e26){_("An error has occurred, please try again.")}}else if(ha(D)&&T.recoveryMethod!=="privy"){c({...s,recoverWallet:{privyWallet:T,onCompleteNavigateTo:g,onFailure:w},recoveryOAuthStatus:{provider:T.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}});let F=Nc(T.recoveryMethod);i(F)}else _(D)}})(),()=>clearTimeout(P)):void 0},[e,t,a]);let A=()=>{_("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return d.current=A,_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:A}),f?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, Pr,{children:[_jsxruntime.jsx.call(void 0, _XCircleIcon2.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),_jsxruntime.jsx.call(void 0, Ce,{title:"Something went wrong",description:"We\u2019re on it. Please try again later."})]}),_jsxruntime.jsx.call(void 0, U,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):_jsxruntime.jsx.call(void 0, Ic,{}),_jsxruntime.jsx.call(void 0, W4,{})]})},W4=_styledcomponents2.default.div`
1014
+ height: 44px;
1015
+ `;var Jy=()=>{let{user:e}=_chunkXKAIXCX7js.ta.call(void 0, ),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:o}=_chunkXKAIXCX7js.ra.call(void 0, ),{app:n,data:a,onUserCloseViaDialogOrKeybindRef:i}=_chunk3AGMJGHJjs.b.call(void 0, ),{onSuccess:s,onFailure:c,callAuthOnSuccessOnClose:d}=a.createWallet,u=()=>{let f=_chunkLEABMTNMjs.v.call(void 0, e);f?(o(),s(f)):c(new Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:d})};return _react.useEffect.call(void 0, ()=>{let f=setTimeout(u,_chunkXKAIXCX7js.s);return()=>clearTimeout(f)},[]),i.current=u,_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:u}),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsxs.call(void 0, Pr,{children:[_jsxruntime.jsx.call(void 0, _CheckCircleIcon2.default,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),_jsxruntime.jsx.call(void 0, Ce,{title:r?`Welcome${_optionalChain([n, 'optionalAccess', _456 => _456.name])?` to ${_optionalChain([n, 'optionalAccess', _457 => _457.name])}`:""}`:"All set!",description:r?"You\u2019ve successfully created an account.":"Your account is secured."})]}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})};var _outline = require('@heroicons/react/24/outline');var jy=({children:e,theme:t})=>_jsxruntime.jsxs.call(void 0, F4,{$theme:t,children:[_jsxruntime.jsx.call(void 0, _outline.ExclamationTriangleIcon,{width:"1.25rem",color:t==="dark"?"#FDE68A":"var(--privy-color-warn)"}),e]}),F4=_styledcomponents2.default.div`
1016
+ display: flex;
1017
+ gap: 0.5rem;
1018
+ background-color: ${e=>e.$theme==="dark"?"var(--privy-color-background-2)":"var(--privy-color-warn-light)"};
1019
+
1020
+ ${e=>e.$theme==="dark"?"color: #FDE68A;":""}
1021
+
1022
+ align-items: flex-start;
1023
+ text-align: left;
1024
+ padding: 0.5rem 0.75rem;
1025
+
1026
+ font-size: 0.8125rem;
1027
+ font-weight: 400;
1028
+ line-height: 1.125rem; /* 150% */
1029
+
1030
+ padding: 0.75rem;
1031
+
1032
+ && {
1033
+ border-radius: var(--privy-border-radius-sm);
1034
+ }
1035
+ `;var Kr=_styledcomponents2.default.span`
1036
+ margin-top: 4px;
1037
+ color: var(--privy-color-foreground);
1038
+ text-align: center;
1039
+
1040
+ font-size: 0.875rem;
1041
+ font-weight: 400;
1042
+ line-height: 1.375rem; /* 157.143% */
1043
+
1044
+ && a {
1045
+ color: var(--privy-color-accent);
1046
+ }
1047
+ `;var uo=_styledcomponents2.default.span`
1048
+ color: var(--privy-color-foreground);
1049
+ font-size: 1.125rem;
1050
+ font-weight: 600;
1051
+ line-height: 1.875rem; /* 166.667% */
1052
+ text-align: center;
1053
+ `;var tg=()=>{let[e,t]=_react.useState.call(void 0, null),{authenticated:r,user:o,getAccessToken:n}=_chunkXKAIXCX7js.ta.call(void 0, ),{closePrivyModal:a,createAnalyticsEvent:i,clientAnalyticsId:s}=_chunkXKAIXCX7js.ra.call(void 0, ),c=_chunkXKAIXCX7js.oa.call(void 0, ),{data:d,onUserCloseViaDialogOrKeybindRef:u}=_chunk3AGMJGHJjs.b.call(void 0, ),{onFailure:f,onSuccess:h,origin:g,appId:w,appClientId:v,wallet:E}=d.keyExport,_=T=>{a({shouldCallAuthOnSuccess:!1}),f(typeof T=="string"?new Error(T):T)},A=()=>{a({shouldCallAuthOnSuccess:!1}),h(),i({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:E.address}})};return _react.useEffect.call(void 0, ()=>{if(!r||!E)return _("User must be authenticated before exporting their wallet");n().then(t,_)},[r,o]),u.current=A,_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:A}),_jsxruntime.jsxs.call(void 0, K4,{children:[_jsxruntime.jsx.call(void 0, uo,{children:"Transfer wallet"}),_jsxruntime.jsxs.call(void 0, Kr,{children:["Either copy your private key or seed phrase to transfer your wallet."," ",_jsxruntime.jsx.call(void 0, "a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),_jsxruntime.jsx.call(void 0, jy,{theme:c.appearance.palette.colorScheme,children:"Never share your private key or seed phrase with anyone."}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.V,{isLoading:!1,isPulsing:!1,title:"Your wallet",address:E.address,showIcon:!0}),_jsxruntime.jsx.call(void 0, "div",{style:{width:"100%"},children:e&&_jsxruntime.jsx.call(void 0, z4,{origin:g,appId:w,appClientId:v,accessToken:e,clientAnalyticsId:s,wallet:E,dimensions:{height:"44px"}})})]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})};function z4(e){let[t,r]=_react.useState.call(void 0, e.dimensions.width),[o,n]=_react.useState.call(void 0, void 0),a=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{if(a.current&&t===void 0){let{width:c}=a.current.getBoundingClientRect();r(c)}let s=getComputedStyle(document.documentElement);n({background:s.getPropertyValue("--privy-color-background"),background2:s.getPropertyValue("--privy-color-background-2"),foreground3:s.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:s.getPropertyValue("--privy-color-foreground-accent"),accent:s.getPropertyValue("--privy-color-accent"),accentDark:s.getPropertyValue("--privy-color-accent-dark"),success:s.getPropertyValue("--privy-color-success")})},[]);let i=e.wallet.chainType==="ethereum"&&!e.wallet.imported;return _jsxruntime.jsx.call(void 0, "div",{ref:a,children:t&&_jsxruntime.jsxs.call(void 0, Y4,{children:[_jsxruntime.jsx.call(void 0, "iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:_chunkLEABMTNMjs.l.call(void 0, e.origin,`/apps/${e.appId}/embedded-wallets/export`,{client_id:e.appClientId,address:e.wallet.address,width:`${t}px`,caid:e.clientAnalyticsId,phrase_export:i,...o},{token:e.accessToken})}),_jsxruntime.jsx.call(void 0, $y,{children:"Loading..."}),i&&_jsxruntime.jsx.call(void 0, $y,{children:"Loading..."})]})})}var K4=_styledcomponents2.default.div`
1054
+ display: flex;
1055
+ flex-direction: column;
1056
+ gap: 1.25rem;
1057
+ text-align: left;
1058
+ `,Y4=_styledcomponents2.default.div`
1059
+ overflow: visible;
1060
+ position: relative;
1061
+ overflow: none;
1062
+ height: 44px;
1063
+ display: flex;
1064
+ gap: 12px;
1065
+ `,$y=_styledcomponents2.default.div`
1066
+ display: flex;
1067
+ align-items: center;
1068
+ justify-content: center;
1069
+ width: 100%;
1070
+ height: 100%;
1071
+ font-size: 16px;
1072
+ font-weight: 500;
1073
+ border-radius: var(--privy-border-radius-md);
1074
+ background-color: var(--privy-color-background-2);
1075
+ color: var(--privy-color-foreground-3);
1076
+ `;function Uc(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=_chunkXKAIXCX7js.ra.call(void 0, ),o=_react.useRef.call(void 0, !1);return{createWallet:_react.useCallback.call(void 0, async a=>{let i=await pe();if(!i)throw t({eventName:"embedded_wallet_creation_failed",payload:{error:"Missing access token for user."}}),new Error("An error has occured, please login again.");try{t({eventName:"embedded_wallet_creation_started"});let s=await r(_chunkXKAIXCX7js.Q);if(!s)throw new Error("walletProxy does not exist.");let c=2e4,d=new Promise((g,w)=>{setTimeout(()=>{w(new Error("walletProxy.create timed out."))},c)});if(!await Promise.race([s.create({accessToken:i,recoveryPassword:a}),d]))throw new Error("walletProxy.create did not send a response.");let f=await e();if(!f)throw new Error("Failed to refresh user.");let h=_chunkLEABMTNMjs.v.call(void 0, f);if(!h)throw new Error("Updated user is missing embedded wallet.");return t({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:h.address}}),o.current=!0,h}catch(s){if(o.current)return;throw t({eventName:"embedded_wallet_creation_failed",payload:{error:s.toString()}}),console.warn(s),s}},[])}}var ng=()=>{let{app:e,setModalData:t,navigate:r,data:o,onUserCloseViaDialogOrKeybindRef:n}=_chunk3AGMJGHJjs.b.call(void 0, ),[a,i]=_react.useState.call(void 0, ""),{embeddedWallets:s}=_chunkXKAIXCX7js.oa.call(void 0, ),{authenticated:c}=_chunkXKAIXCX7js.ta.call(void 0, ),{closePrivyModal:d}=_chunkXKAIXCX7js.ra.call(void 0, ),{onSuccess:u,onFailure:f,callAuthOnSuccessOnClose:h}=o.createWallet,g=_optionalChain([e, 'optionalAccess', _458 => _458.embeddedWallets, 'access', _459 => _459.requireUserOwnedRecoveryOnCreate])===!0,{createWallet:w}=Uc(),[v,E]=_react.useState.call(void 0, null),_=new ze(async()=>{try{let T=await w();if(!T)return;E(T),r("EMBEDDED_WALLET_CREATED_SCREEN")}catch(T){i(T.message)}});_react.useEffect.call(void 0, ()=>{if(!c){r("LANDING"),f(new Error("User must be authenticated before creating a Privy wallet"));return}if(g){t({...o,recoverySelection:{..._optionalChain([o, 'optionalAccess', _460 => _460.recoverySelection]),isInAccountCreateFlow:!0}});let T=Oc({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:s.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1});return r(T)}_.execute()},[g,c]);let A=()=>{v?(u(v),d({shouldCallAuthOnSuccess:h})):(f(new (0, _chunkXKAIXCX7js.m)("User wallet creation failed")),d({shouldCallAuthOnSuccess:!1}))};return n.current=()=>null,a?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{closeable:!1}),_jsxruntime.jsxs.call(void 0, Pr,{children:[_jsxruntime.jsx.call(void 0, _XCircleIcon2.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),_jsxruntime.jsx.call(void 0, Ce,{title:"Something went wrong",description:a})]}),_jsxruntime.jsx.call(void 0, U,{onClick:A,children:"Close"}),_jsxruntime.jsx.call(void 0, e5,{})]}):_jsxruntime.jsx.call(void 0, Ic,{})},e5=_styledcomponents2.default.div`
1077
+ height: 44px;
1078
+ `;var _ExclamationTriangleIcon = require('@heroicons/react/24/outline/ExclamationTriangleIcon'); var _ExclamationTriangleIcon2 = _interopRequireDefault(_ExclamationTriangleIcon);var _ArrowPathIcon = require('@heroicons/react/24/outline/ArrowPathIcon'); var _ArrowPathIcon2 = _interopRequireDefault(_ArrowPathIcon);var _EyeIcon = require('@heroicons/react/24/outline/EyeIcon'); var _EyeIcon2 = _interopRequireDefault(_EyeIcon);var _EyeSlashIcon = require('@heroicons/react/24/outline/EyeSlashIcon'); var _EyeSlashIcon2 = _interopRequireDefault(_EyeSlashIcon);var a5=_styledcomponents.css`
1079
+ font-size: 14px;
1080
+ font-style: normal;
1081
+ font-weight: 400;
1082
+ line-height: 20px;
1083
+ letter-spacing: -0.008px;
1084
+ text-align: left;
1085
+ transition: color 0.1s ease-in;
1086
+ `,Fc=_styledcomponents2.default.span`
1087
+ ${a5}
1088
+ transition: color 0.1s ease-in;
1089
+ color: ${({error:e})=>e?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
1090
+ text-transform: ${({error:e})=>e?"":"capitalize"};
1091
+
1092
+ &[aria-hidden='true'] {
1093
+ visibility: hidden;
1094
+ }
1095
+ `,wn=_styledcomponents2.default.div`
1096
+ display: flex;
1097
+ flex-direction: column;
1098
+ justify-content: center;
1099
+ flex-grow: 1;
1100
+ `,bn=_styledcomponents2.default.call(void 0, U)`
1101
+ ${e=>e.hideAnimations&&_styledcomponents.css`
1102
+ && {
1103
+ transition: none;
1104
+ }
1105
+ `}
1106
+ `,ag=_styledcomponents.css`
1107
+ && {
1108
+ width: 100%;
1109
+ border-width: 1px;
1110
+ border-radius: var(--privy-border-radius-md);
1111
+ border-color: var(--privy-color-foreground-3);
1112
+ background: var(--privy-color-background);
1113
+ color: var(--privy-color-foreground);
1114
+
1115
+ padding: 12px;
1116
+ font-size: 16px;
1117
+ font-style: normal;
1118
+ font-weight: 300;
1119
+ line-height: 22px; /* 137.5% */
1120
+ }
1121
+ `,bi=_styledcomponents2.default.input`
1122
+ ${ag}
1123
+
1124
+ &::placeholder {
1125
+ color: var(--privy-color-foreground-3);
1126
+ font-style: italic;
1127
+ font-size: 14px;
1128
+ }
1129
+
1130
+ overflow: hidden;
1131
+ text-overflow: ellipsis;
1132
+ white-space: nowrap;
1133
+ `,ig=_styledcomponents2.default.div`
1134
+ ${ag}
1135
+ `,En=_styledcomponents2.default.div`
1136
+ position: relative;
1137
+ width: 100%;
1138
+ display: flex;
1139
+ align-items: center;
1140
+ justify-content: ${({centered:e})=>e?"center":"space-between"};
1141
+ `,Tn=_styledcomponents2.default.div`
1142
+ display: flex;
1143
+ flex-direction: column;
1144
+ align-items: center;
1145
+ justify-content: center;
1146
+ margin: 32px 0;
1147
+ gap: 4px;
1148
+
1149
+ & h3 {
1150
+ font-size: 18px;
1151
+ font-style: normal;
1152
+ font-weight: 600;
1153
+ line-height: 24px;
1154
+ }
1155
+
1156
+ & p {
1157
+ max-width: 300px;
1158
+ font-size: 14px;
1159
+ font-style: normal;
1160
+ font-weight: 400;
1161
+ line-height: 20px;
1162
+ }
1163
+ `,Ps=_styledcomponents2.default.div`
1164
+ display: flex;
1165
+ flex-direction: column;
1166
+ gap: 10px;
1167
+ padding-bottom: 1rem;
1168
+ `,As=_styledcomponents2.default.div`
1169
+ display: flex;
1170
+ text-align: left;
1171
+ align-items: center;
1172
+
1173
+ gap: 8px;
1174
+ max-width: 300px;
1175
+
1176
+ font-size: 14px;
1177
+ font-style: normal;
1178
+ font-weight: 400;
1179
+ line-height: 20px;
1180
+ letter-spacing: -0.008px;
1181
+
1182
+ margin: 0 8px;
1183
+ color: var(--privy-color-foreground-2);
1184
+
1185
+ > :first-child {
1186
+ min-width: 24px;
1187
+ }
1188
+ `,qD=_styledcomponents2.default.div`
1189
+ height: var(--privy-height-modal-full);
1190
+
1191
+ @media (max-width: 440px) {
1192
+ height: var(--privy-height-modal-compact);
1193
+ }
1194
+ `,nu=_styledcomponents2.default.call(void 0, hs)`
1195
+ display: flex;
1196
+ flex: 1;
1197
+ gap: 4px;
1198
+ justify-content: center;
1199
+
1200
+ && {
1201
+ background: var(--privy-color-background);
1202
+ border-radius: var(--privy-border-radius-md);
1203
+ border-color: var(--privy-color-foreground-3);
1204
+ border-width: 1px;
1205
+ }
1206
+ `,Ei=_styledcomponents2.default.div`
1207
+ position: absolute;
1208
+ right: 0.5rem;
1209
+
1210
+ display: flex;
1211
+ flex-direction: row;
1212
+ justify-content: space-around;
1213
+ align-items: center;
1214
+ `,sg=_styledcomponents2.default.call(void 0, _ArrowPathIcon2.default)`
1215
+ height: 1.25rem;
1216
+ width: 1.25rem;
1217
+ stroke: var(--privy-color-accent);
1218
+ cursor: pointer;
1219
+
1220
+ :active {
1221
+ stroke: var(--privy-color-accent-light);
1222
+ }
1223
+ `,Ti=_styledcomponents2.default.call(void 0, _EyeSlashIcon2.default)`
1224
+ height: 1.25rem;
1225
+ width: 1.25rem;
1226
+ stroke: var(--privy-color-accent);
1227
+ cursor: pointer;
1228
+
1229
+ :active {
1230
+ stroke: var(--privy-color-accent-light);
1231
+ }
1232
+ `,Si=_styledcomponents2.default.call(void 0, _EyeIcon2.default)`
1233
+ height: 1.25rem;
1234
+ width: 1.25rem;
1235
+ stroke: var(--privy-color-accent);
1236
+ cursor: pointer;
1237
+
1238
+ :active {
1239
+ stroke: var(--privy-color-accent-light);
1240
+ }
1241
+ `,lg=_styledcomponents2.default.progress`
1242
+ height: 4px;
1243
+ width: 100%;
1244
+ margin: 8px 0;
1245
+
1246
+ /* border-radius: 9999px; */
1247
+ ::-webkit-progress-bar {
1248
+ border-radius: 8px;
1249
+ background: var(--privy-color-foreground-4);
1250
+ }
1251
+
1252
+ ::-webkit-progress-value {
1253
+ border-radius: 8px;
1254
+ transition: all 0.1s ease-out;
1255
+ background: ${({label:e})=>e==="Strong"&&"#78dca6"||e==="Medium"&&"var(--privy-color-warn)"||"var(--privy-color-error)"};
1256
+ }
1257
+ `;var cg=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:o,onBack:n})=>{let[a,i]=_react.useState.call(void 0, !0),[s,c]=_react.useState.call(void 0, !1),[d,u]=_react.useState.call(void 0, ""),f=r===d;return _react.useEffect.call(void 0, ()=>{d&&!s&&c(!0)},[d]),_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{closeable:!1,backFn:n}),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsxs.call(void 0, wn,{children:[_jsxruntime.jsxs.call(void 0, Tn,{children:[_jsxruntime.jsx.call(void 0, _ExclamationTriangleIcon2.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),_jsxruntime.jsx.call(void 0, "h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),_jsxruntime.jsx.call(void 0, "p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),_jsxruntime.jsxs.call(void 0, En,{children:[_jsxruntime.jsx.call(void 0, bi,{value:d,onChange:h=>u(h.target.value),onKeyUp:h=>{h.key==="Enter"&&o()},onBlur:()=>c(!0),placeholder:"confirm your password",type:a?"password":"text",style:{paddingRight:"2.3rem"}}),_jsxruntime.jsx.call(void 0, Ei,{style:{right:"0.75rem"},children:a?_jsxruntime.jsx.call(void 0, Ti,{onClick:()=>i(!1)}):_jsxruntime.jsx.call(void 0, Si,{onClick:()=>i(!0)})})]}),_jsxruntime.jsx.call(void 0, Fc,{"aria-hidden":!s||f,error:!0,children:"Passwords do not match"})]}),_jsxruntime.jsx.call(void 0, bn,{onClick:o,loading:t,disabled:!f,hideAnimations:e,children:"Continue"}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})};var dg=({className:e,checked:t,color:r="var(--privy-color-accent)",...o})=>_jsxruntime.jsx.call(void 0, "label",{children:_jsxruntime.jsxs.call(void 0, c5,{className:e,children:[_jsxruntime.jsx.call(void 0, ug,{checked:t,...o}),_jsxruntime.jsx.call(void 0, d5,{color:r,checked:t,children:_jsxruntime.jsx.call(void 0, pg,{viewBox:"0 0 24 24",children:_jsxruntime.jsx.call(void 0, "polyline",{points:"20 6 9 17 4 12"})})})]})});var rU=_styledcomponents2.default.label`
1258
+ && {
1259
+ cursor: pointer;
1260
+ display: flex;
1261
+ align-items: center;
1262
+ gap: 0.75rem;
1263
+ padding: 0.75rem 1rem;
1264
+ text-align: left;
1265
+ border-radius: 0.5rem;
1266
+ border: 1px solid var(--privy-color-foreground-4);
1267
+ width: 100%;
1268
+ }
1269
+ `,c5=_styledcomponents2.default.div`
1270
+ display: inline-block;
1271
+ vertical-align: middle;
1272
+ `,pg=_styledcomponents2.default.svg`
1273
+ fill: none;
1274
+ stroke: white;
1275
+ stroke-width: 3px;
1276
+ `,ug=_styledcomponents2.default.input.attrs({type:"checkbox"})`
1277
+ border: 0;
1278
+ clip: rect(0 0 0 0);
1279
+ clippath: inset(50%);
1280
+ height: 1px;
1281
+ margin: -1px;
1282
+ overflow: hidden;
1283
+ padding: 0;
1284
+ position: absolute;
1285
+ white-space: nowrap;
1286
+ width: 1px;
1287
+ `,d5=_styledcomponents2.default.div`
1288
+ display: inline-block;
1289
+ width: 18px;
1290
+ height: 18px;
1291
+ transition: all 150ms;
1292
+ cursor: pointer;
1293
+ border-color: ${e=>e.color};
1294
+ border-radius: 3px;
1295
+ background: ${e=>e.checked?e.color:"var(--privy-color-background)"};
1296
+
1297
+ && {
1298
+ /* This is necessary to override css reset for border width */
1299
+ border-width: 1px;
1300
+ }
1301
+
1302
+ ${ug}:focus + & {
1303
+ box-shadow: 0 0 0 1px ${e=>e.color};
1304
+ }
1305
+
1306
+ ${pg} {
1307
+ visibility: ${e=>e.checked?"visible":"hidden"};
1308
+ }
1309
+ `;var fg=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:o,config:n})=>{let[a,i]=_react.useState.call(void 0, !1);return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{closeable:!1,backFn:o}),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsxs.call(void 0, wn,{children:[_jsxruntime.jsxs.call(void 0, Tn,{children:[_jsxruntime.jsx.call(void 0, _ExclamationTriangleIcon2.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),_jsxruntime.jsx.call(void 0, "h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),_jsxruntime.jsx.call(void 0, "p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),_jsxruntime.jsx.call(void 0, Ps,{children:_jsxruntime.jsxs.call(void 0, As,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:s=>{s.preventDefault(),i(c=>!c)},children:[_jsxruntime.jsx.call(void 0, dg,{color:"var(--privy-color-error)",readOnly:!0,checked:a}),_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),_jsxruntime.jsxs.call(void 0, h5,{children:[n.initiatedBy==="user"&&_jsxruntime.jsx.call(void 0, io,{onClick:n.onCancel,disabled:t,children:"Cancel"}),_jsxruntime.jsx.call(void 0, bn,{onClick:r,loading:t,hideAnimations:e,disabled:!a,children:"Set Password"})]}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})},h5=_styledcomponents2.default.div`
1310
+ display: flex;
1311
+ gap: 10px;
1312
+ `;var _KeyIcon = require('@heroicons/react/24/outline/KeyIcon'); var _KeyIcon2 = _interopRequireDefault(_KeyIcon);var _fastpasswordentropy = require('fast-password-entropy'); var _fastpasswordentropy2 = _interopRequireDefault(_fastpasswordentropy);var _securepasswordutilities = require('secure-password-utilities'); var hg = _interopRequireWildcard(_securepasswordutilities);var _wordlists = require('secure-password-utilities/wordlists');var C5=95,v5=8,w5=3,b5=.3,E5=/[a-z]/,T5=/[A-Z]/,S5=/[0-9]/,P5="a-zA-Z0-9",yg="!@#$%^&*()\\-_+.",gg=`${P5}${yg}`,A5=new RegExp(`[${yg}]`),x5=new RegExp(`[${gg}]`),Cg=new RegExp(`^[${gg}]{6,}$`),vg=(e="")=>{let t=e.split("").filter(r=>!x5.test(r)).map(r=>r.replace(" ","SPACE"));return[...new Set(t)]},Hc=()=>hg.generatePassphrase(4,_wordlists.DEFAULT_WORDLIST);function k5(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function R5(e){if(e.length<v5)return 0;let t=0;E5.test(e)&&(t+=1),T5.test(e)&&(t+=1),S5.test(e)&&(t+=1),A5.test(e)&&(t+=1);let r=t/w5;return Math.max(0,Math.min(1,r))}function _5(e=""){let t=R5(e),r=_fastpasswordentropy2.default.call(void 0, e)/C5;return(t*b5+r)/2}function wg(e=""){let t=_5(e);return{value:t,label:k5(t)}}var Sg=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:o,isResettingPassword:n,onSubmit:a,onClose:i,onBack:s,onPasswordChange:c,onPasswordGenerate:d})=>{let[u,f]=_react.useState.call(void 0, !1),[h,g]=_react.useState.call(void 0, !1);_react.useEffect.call(void 0, ()=>{r&&!h&&g(!0)},[r]);let w=_react.useMemo.call(void 0, ()=>h?(_optionalChain([r, 'optionalAccess', _461 => _461.length])||0)<6?"Password must be at least 6 characters":Cg.test(r||"")?null:`Invalid characters used ( ${vg(r).join(" ")} )`:null,[r,h]),v=_react.useMemo.call(void 0, ()=>w?{value:0,label:"Weak"}:wg(r),[r,w]),E=_react.useMemo.call(void 0, ()=>!!(!_optionalChain([r, 'optionalAccess', _462 => _462.length])||w),[w,r]);return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:i,closeable:o.initiatedBy==="user",backFn:s}),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsxs.call(void 0, wn,{children:[_jsxruntime.jsxs.call(void 0, Tn,{children:[_jsxruntime.jsx.call(void 0, _KeyIcon2.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),_jsxruntime.jsxs.call(void 0, "h3",{style:{color:"var(--privy-color-foreground)"},children:[n?"Reset":"Set"," your password"]}),_jsxruntime.jsx.call(void 0, "p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),_jsxruntime.jsxs.call(void 0, En,{children:[_jsxruntime.jsx.call(void 0, bi,{value:r,onChange:_=>c(_.target.value),onKeyUp:_=>{_.key==="Enter"&&a()},placeholder:"enter or generate a strong password",type:u?"password":"text",style:{paddingRight:"3.8rem"}}),_jsxruntime.jsxs.call(void 0, Ei,{style:{width:"3.5rem"},children:[u?_jsxruntime.jsx.call(void 0, Ti,{onClick:()=>f(!1)}):_jsxruntime.jsx.call(void 0, Si,{onClick:()=>f(!0)}),_jsxruntime.jsx.call(void 0, sg,{onClick:d})]})]}),_jsxruntime.jsx.call(void 0, lg,{value:v.value===0?.01:v.value,label:v.label}),_jsxruntime.jsx.call(void 0, Fc,{error:!!w,children:w||`Password Strength: ${h?v.label:"--"}`}),_jsxruntime.jsxs.call(void 0, L5,{children:[_jsxruntime.jsx.call(void 0, W5,{children:_jsxruntime.jsxs.call(void 0, Ps,{children:[_jsxruntime.jsxs.call(void 0, As,{children:[_jsxruntime.jsx.call(void 0, _CheckCircleIcon2.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),_jsxruntime.jsxs.call(void 0, As,{children:[_jsxruntime.jsx.call(void 0, _CheckCircleIcon2.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),_jsxruntime.jsx.call(void 0, bn,{onClick:a,loading:t,disabled:E,hideAnimations:e,children:"Continue"})]})]}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})},W5=_styledcomponents2.default.call(void 0, Ps)`
1313
+ flex: 1;
1314
+ padding-top: 1rem;
1315
+ `,L5=_styledcomponents2.default.div`
1316
+ display: flex;
1317
+ flex-direction: column;
1318
+ height: 100%;
1319
+ `;var _ArrowDownTrayIcon = require('@heroicons/react/24/outline/ArrowDownTrayIcon'); var _ArrowDownTrayIcon2 = _interopRequireDefault(_ArrowDownTrayIcon);var _ClipboardDocumentCheckIcon = require('@heroicons/react/24/outline/ClipboardDocumentCheckIcon'); var _ClipboardDocumentCheckIcon2 = _interopRequireDefault(_ClipboardDocumentCheckIcon);var _DocumentDuplicateIcon = require('@heroicons/react/24/outline/DocumentDuplicateIcon'); var _DocumentDuplicateIcon2 = _interopRequireDefault(_DocumentDuplicateIcon);var Ag=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:o,onSubmit:n,onBack:a})=>{let[i,s]=_react.useState.call(void 0, !1),c=_react.useCallback.call(void 0, ()=>{s(!0),o&&navigator.clipboard.writeText(o)},[o]),d=_react.useCallback.call(void 0, ()=>{let u=document.createElement("a"),f=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),h=new Blob([H5(r,o)],{type:"text/plain"}),g=URL.createObjectURL(h);u.href=g,u.target="_blank",u.download=`${f}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(g)},5e3)},[o]);return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:a,closeable:!1}),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsxs.call(void 0, wn,{children:[_jsxruntime.jsxs.call(void 0, Tn,{children:[_jsxruntime.jsx.call(void 0, _ExclamationTriangleIcon2.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),_jsxruntime.jsx.call(void 0, "h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),_jsxruntime.jsx.call(void 0, "p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),_jsxruntime.jsx.call(void 0, En,{centered:!0,children:_jsxruntime.jsx.call(void 0, ig,{children:o})}),_jsxruntime.jsxs.call(void 0, "div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[_jsxruntime.jsx.call(void 0, nu,{onClick:c,children:i?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _ClipboardDocumentCheckIcon2.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _DocumentDuplicateIcon2.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),_jsxruntime.jsxs.call(void 0, nu,{onClick:d,children:[_jsxruntime.jsx.call(void 0, _ArrowDownTrayIcon2.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),_jsxruntime.jsx.call(void 0, bn,{onClick:n,loading:t,hideAnimations:e,children:"Continue"}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})},H5=(e,t)=>`Your wallet recovery password for ${e} is
1320
+
1321
+ ${t}
1322
+
1323
+ You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;var xg=({error:e,onClose:t})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{closeable:!1}),_jsxruntime.jsx.call(void 0, ne,{}),e?_jsxruntime.jsxs.call(void 0, Pr,{children:[_jsxruntime.jsx.call(void 0, _XCircleIcon2.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),_jsxruntime.jsx.call(void 0, Ce,{title:"Something went wrong",description:e})]}):_jsxruntime.jsxs.call(void 0, Pr,{children:[_jsxruntime.jsx.call(void 0, _CheckCircleIcon2.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),_jsxruntime.jsx.call(void 0, Ce,{title:"Success"})]}),_jsxruntime.jsx.call(void 0, U,{onClick:t,children:"Close"}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]});var K5=(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}},kg=()=>{let[e,t]=_react.useReducer.call(void 0, K5,"creating");return{send:t,state:e}};var Vc=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:o}=_chunk3AGMJGHJjs.b.call(void 0, ),{send:n,state:a}=kg(),i=_react.useCallback.call(void 0, async()=>{a==="finalizing"&&await e(),n("next")},[a,n,e]);_react.useEffect.call(void 0, ()=>{let d;return a==="done"&&t.config.initiatedBy==="automatic"&&(d=setTimeout(()=>_optionalChain([t, 'access', _463 => _463.onClose, 'optionalCall', _464 => _464()]),_chunkXKAIXCX7js.r)),()=>{d&&clearTimeout(d)}},[a,t.config.initiatedBy,t.onClose]);let s=_react.useCallback.call(void 0, ()=>{n("back")},[n]),c=_react.useCallback.call(void 0, ()=>{o("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,o]);return a==="creating"?_jsxruntime.jsx.call(void 0, Sg,{...t,onSubmit:i,onBack:r==="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"?c:void 0}):a==="saving"?_jsxruntime.jsx.call(void 0, Ag,{...t,onSubmit:i,onBack:s}):a==="confirming"?_jsxruntime.jsx.call(void 0, cg,{...t,onSubmit:i,onBack:s}):a==="finalizing"?_jsxruntime.jsx.call(void 0, fg,{...t,onSubmit:i,onBack:s}):a==="done"?_jsxruntime.jsx.call(void 0, xg,{...t,onSubmit:i}):null};var Rg=()=>{let[e,t]=_react.useState.call(void 0, null),[r,o]=_react.useState.call(void 0, !1),[n,a]=_react.useState.call(void 0, null),[i,s]=_react.useState.call(void 0, ""),{authenticated:c,getAccessToken:d,user:u}=_chunkXKAIXCX7js.ta.call(void 0, ),{walletProxy:f,refreshUser:h,closePrivyModal:g,createAnalyticsEvent:w}=_chunkXKAIXCX7js.ra.call(void 0, ),{app:v,navigate:E,data:_,onUserCloseViaDialogOrKeybindRef:A}=_chunk3AGMJGHJjs.b.call(void 0, ),{onSuccess:T,onFailure:P}=_.createWallet,S=_chunkLEABMTNMjs.v.call(void 0, u),R=_optionalChain([e, 'optionalAccess', _465 => _465.recoveryMethod])==="user-passcode",D=_optionalChain([S, 'optionalAccess', _466 => _466.recoveryMethod])==="user-passcode";_react.useEffect.call(void 0, ()=>{c||(E("LANDING"),P(new (0, _chunkXKAIXCX7js.n)("User must be authenticated before setting a password on a Privy wallet")))},[c]);let F=()=>{if(n){P(n),g({shouldCallAuthOnSuccess:!1});return}if(!R){P(new (0, _chunkXKAIXCX7js.m)("Exited before password was added to wallet")),g({shouldCallAuthOnSuccess:!1});return}T(e),g({shouldCallAuthOnSuccess:!1})};A.current=F;let B=async()=>{let W=await d();if(W&&_optionalChain([S, 'optionalAccess', _467 => _467.address])&&i&&f)try{if(w({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:S.address,existingRecoveryMethod:S.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:D}}),!(await f.setRecovery({accessToken:W,address:S.address,recoveryPassword:i,recoveryMethod:"user-passcode"})).address){a(new (0, _chunkXKAIXCX7js.m)("Error setting password on privy wallet")),w({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:S.address,existingRecoveryMethod:S.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:D,reason:"error setting password"}});return}let L=await h(),Q=_chunkLEABMTNMjs.v.call(void 0, L);if(!Q){a(new (0, _chunkXKAIXCX7js.m)("Error setting password on privy wallet")),w({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:S.address,existingRecoveryMethod:S.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:D,reason:"wallet disconnected"}});return}t(Q),w({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:S.address,existingRecoveryMethod:S.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:D}})}catch(X){console.warn(X),a(X instanceof Error?X:new Error("Error setting password on privy wallet")),w({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:S.address,reason:X}})}},K=async()=>{R?(T(e),g({shouldCallAuthOnSuccess:!1})):(o(!0),a(null),await B(),o(!1))};return _jsxruntime.jsx.call(void 0, Vc,{appName:_optionalChain([v, 'optionalAccess', _468 => _468.name])||"privy",config:{initiatedBy:"user",onCancel:F},error:n?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:i,isResettingPassword:D,onPasswordGenerate:()=>s(Hc()),onPasswordChange:s,onSubmit:K,onClose:F})};var _UserCircleIcon = require('@heroicons/react/24/outline/UserCircleIcon'); var _UserCircleIcon2 = _interopRequireDefault(_UserCircleIcon);var _LockClosedIcon = require('@heroicons/react/24/solid/LockClosedIcon'); var _LockClosedIcon2 = _interopRequireDefault(_LockClosedIcon);var _g=()=>{let{closePrivyModal:e}=_chunkXKAIXCX7js.ra.call(void 0, ),{data:t,setModalData:r,navigate:o,onUserCloseViaDialogOrKeybindRef:n}=_chunk3AGMJGHJjs.b.call(void 0, ),{onSuccess:a,onFailure:i}=t.setWalletPassword,s=()=>{i(new (0, _chunkXKAIXCX7js.m)("Exited before password was added to wallet")),e({shouldCallAuthOnSuccess:!1})};return n.current=s,_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:s}),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsxs.call(void 0, Pr,{children:[_jsxruntime.jsxs.call(void 0, ay,{children:[_jsxruntime.jsx.call(void 0, _UserCircleIcon2.default,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),_jsxruntime.jsx.call(void 0, iy,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:_jsxruntime.jsx.call(void 0, _LockClosedIcon2.default,{width:"12px",height:"12px",fill:"white"})})]}),_jsxruntime.jsxs.call(void 0, Ce,{title:"Secure Your Account",children:["Please set a password to secure your account.",_jsxruntime.jsx.call(void 0, "p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),_jsxruntime.jsx.call(void 0, U,{onClick:()=>{r({createWallet:{onFailure:i,onSuccess:a,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),o("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})};var t6=(e,t)=>{let r=_jsxruntime.jsx.call(void 0, _ExclamationTriangleIcon2.default,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof _chunkXKAIXCX7js.g)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 Ue&&e.type==="twilio_verification_failed")return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:_jsxruntime.jsx.call(void 0, _PhoneIcon2.default,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(e instanceof _chunkXKAIXCX7js.e)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:_jsxruntime.jsx.call(void 0, 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:_jsxruntime.jsx.call(void 0, "span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:_jsxruntime.jsx.call(void 0, "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 _chunkXKAIXCX7js.f&&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}}},Ig=()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:o,currentScreen:n}=_chunk3AGMJGHJjs.b.call(void 0, ),a=_optionalChain([r, 'optionalAccess', _469 => _469.errorModalData, 'optionalAccess', _470 => _470.previousScreen])||(o===n?void 0:o);return _jsxruntime.jsx.call(void 0, jo,{error:_optionalChain([r, 'optionalAccess', _471 => _471.errorModalData, 'optionalAccess', _472 => _472.error])||new Error,backFn:()=>a?e(a,!1):t(),onClick:()=>e(a||"LANDING",!1)})},jo=({error:e,backFn:t,onClick:r})=>{let{reset:o}=Pe(),{app:n}=_chunk3AGMJGHJjs.b.call(void 0, ),a=t6(e,n.allowlistConfig),i=()=>{if(e instanceof _chunkXKAIXCX7js.e&&(e.privyErrorCode==="invalid_captcha"&&o(),e.privyErrorCode==="allowlist_rejected"&&n.allowlistConfig.errorCtaLink)){window.location.href=n.allowlistConfig.errorCtaLink;return}_optionalChain([r, 'optionalCall', _473 => _473()])};return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:t}),_jsxruntime.jsxs.call(void 0, r6,{children:[_jsxruntime.jsx.call(void 0, et,{children:_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, Ec,{color:"var(--privy-color-error)"}),a.icon]})}),_jsxruntime.jsxs.call(void 0, o6,{children:[_jsxruntime.jsx.call(void 0, "h3",{children:a.title}),_jsxruntime.jsx.call(void 0, "p",{children:a.detail})]}),_jsxruntime.jsx.call(void 0, U,{color:"var(--privy-color-error)",onClick:i,children:a.ctaText})]})]})},r6=_styledcomponents2.default.div`
1324
+ display: flex;
1325
+ flex-direction: column;
1326
+ align-items: center;
1327
+ justify-content: center;
1328
+ gap: 24px;
1329
+ width: 100%;
1330
+ padding-bottom: 16px;
1331
+ `,o6=_styledcomponents2.default.div`
1332
+ display: flex;
1333
+ flex-direction: column;
1334
+ gap: 8px;
1335
+ `;var Pi=({style:e,color:t,...r})=>_jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, "path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})});var Sn=e=>{let[t,r]=_react.useState.call(void 0, !1);return _jsxruntime.jsxs.call(void 0, s6,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?_jsxruntime.jsx.call(void 0, Pi,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.W,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},s6=_styledcomponents2.default.button`
1336
+ display: flex;
1337
+ align-items: center;
1338
+ gap: 6px;
1339
+
1340
+ && {
1341
+ margin: 8px 2px;
1342
+ font-size: 14px;
1343
+ color: ${e=>e.justCopied?"var(--privy-color-foreground)":e.color||"var(--privy-color-foreground-3)"};
1344
+ font-weight: ${e=>e.justCopied?"medium":"normal"};
1345
+ transition: color 350ms ease;
1346
+
1347
+ :focus,
1348
+ :active {
1349
+ background-color: transparent;
1350
+ border: none;
1351
+ outline: none;
1352
+ box-shadow: none;
1353
+ }
1354
+
1355
+ :hover {
1356
+ color: ${e=>e.justCopied?"var(--privy-color-foreground)":"var(--privy-color-foreground-2)"};
1357
+ }
1358
+
1359
+ :active {
1360
+ color: 'var(--privy-color-foreground)';
1361
+ font-weight: medium;
1362
+ }
1363
+
1364
+ @media (max-width: 440px) {
1365
+ margin: 12px 2px;
1366
+ }
1367
+ }
1368
+
1369
+ svg {
1370
+ width: 14px;
1371
+ height: 14px;
1372
+ }
1373
+ `;var Kc=e=>{let[t,r]=_react.useState.call(void 0, !1);return _jsxruntime.jsx.call(void 0, p6,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},p6=_styledcomponents2.default.a`
1374
+ display: flex;
1375
+ align-items: center;
1376
+ gap: 6px;
1377
+
1378
+ && {
1379
+ margin: 8px 2px;
1380
+ font-size: 14px;
1381
+ color: ${e=>e.justOpened?"var(--privy-color-foreground)":e.color||"var(--privy-color-foreground-3)"};
1382
+ font-weight: ${e=>e.justOpened?"medium":"normal"};
1383
+ transition: color 350ms ease;
1384
+
1385
+ :focus,
1386
+ :active {
1387
+ background-color: transparent;
1388
+ border: none;
1389
+ outline: none;
1390
+ box-shadow: none;
1391
+ }
1392
+
1393
+ :hover {
1394
+ color: ${e=>e.justOpened?"var(--privy-color-foreground)":"var(--privy-color-foreground-2)"};
1395
+ }
1396
+
1397
+ :active {
1398
+ color: 'var(--privy-color-foreground)';
1399
+ font-weight: medium;
1400
+ }
1401
+
1402
+ @media (max-width: 440px) {
1403
+ margin: 12px 2px;
1404
+ }
1405
+ }
1406
+
1407
+ svg {
1408
+ width: 14px;
1409
+ height: 14px;
1410
+ }
1411
+ `;var _qrcode = require('qrcode'); var _qrcode2 = _interopRequireDefault(_qrcode);var Ng=()=>_jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, "rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});var Rr=7,du=(e,t,r,o,n)=>{for(let a=t;a<t+o;a++)for(let i=r;i<r+n;i++){let s=_optionalChain([e, 'optionalAccess', _474 => _474[i]]);s&&s[a]&&(s[a]=0)}return e},y6=(e,t)=>{let r=_qrcode2.default.create(e,{errorCorrectionLevel:t}).modules,o=_chunkLEABMTNMjs.g.call(void 0, Array.from(r.data),r.size);return o=du(o,0,0,Rr,Rr),o=du(o,o.length-Rr,0,Rr,Rr),o=du(o,0,o.length-Rr,Rr,Rr),o},g6=({x:e,y:t,cellSize:r,bgColor:o,fgColor:n})=>_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:[0,1,2].map(a=>_jsxruntime.jsx.call(void 0, "circle",{r:r*(Rr-a*2)/2,cx:e+r*Rr/2,cy:t+r*Rr/2,fill:a%2!==0?o:n},`finder-${e}-${t}-${a}`))}),C6=({cellSize:e,matrixSize:t,bgColor:r,fgColor:o})=>{let n=[[0,0],[(t-Rr)*e,0],[0,(t-Rr)*e]];return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:n.map(([a,i])=>_jsxruntime.jsx.call(void 0, g6,{x:a,y:i,cellSize:e,bgColor:r,fgColor:o},`finder-${a}-${i}`))})},v6=({matrix:e,cellSize:t,color:r})=>_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:e.map((a,i)=>a.map((s,c)=>s?_jsxruntime.jsx.call(void 0, "rect",{height:t-.2*2,width:t-.2*2,x:i*t+t*(.2/2),y:c*t+t*(.2/2),rx:t*.5,ry:t*.5,fill:r},`cell-${i}-${c}`):_jsxruntime.jsx.call(void 0, _react2.default.Fragment,{},`circle-${i}-${c}`)))}),w6=({cellSize:e,matrixSize:t,element:r,sizePercentage:o,bgColor:n})=>{if(!r)return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{});let a=t*(o||.14),i=Math.floor(t/2-a/2),s=Math.floor(t/2+a/2);(s-i)%2!==t%2&&(s+=1);let c=(s-i)*e,d=.1,u=c-c*d*2,f=r,h=i*e;return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "rect",{x:i*e,y:i*e,width:c,height:c,fill:n}),_jsxruntime.jsx.call(void 0, f,{x:h+c*d,y:h+c*d,height:u,width:u})]})},b6=e=>{let t=e.outputSize,r=y6(e.url,e.errorCorrectionLevel),o=t/r.length,n=_chunkLEABMTNMjs.u.call(void 0, o*2,{min:t*.025,max:t*.036});return _jsxruntime.jsxs.call(void 0, "svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%",padding:`${n}px`},children:[_jsxruntime.jsx.call(void 0, v6,{matrix:r,cellSize:o,color:e.fgColor}),_jsxruntime.jsx.call(void 0, C6,{cellSize:o,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),_jsxruntime.jsx.call(void 0, w6,{cellSize:o,element:_optionalChain([e, 'access', _475 => _475.logo, 'optionalAccess', _476 => _476.element]),bgColor:e.bgColor,matrixSize:r.length})]})},E6=_styledcomponents2.default.div`
1412
+ display: flex;
1413
+ justify-content: center;
1414
+ align-items: center;
1415
+ height: ${e=>`${e.size}px`};
1416
+ width: ${e=>`${e.size}px`};
1417
+ margin: auto;
1418
+ background-color: ${e=>e.bgColor};
1419
+
1420
+ && {
1421
+ border-width: 2px;
1422
+ border-color: ${e=>e.borderColor};
1423
+ border-radius: var(--privy-border-radius-md);
1424
+ }
1425
+ `,Pn=e=>{let{appearance:t}=_chunkXKAIXCX7js.oa.call(void 0, ),r=e.bgColor||"#FFFFFF",o=e.fgColor||"#000000",n=e.size||160,a=t.palette.colorScheme==="dark"?r:o;return _jsxruntime.jsx.call(void 0, E6,{size:n,bgColor:r,fgColor:o,borderColor:a,children:_jsxruntime.jsx.call(void 0, b6,{url:e.url,logo:{element:_nullishCoalesce(e.squareLogoElement, () => (Ng))},outputSize:n,bgColor:r,fgColor:o,errorCorrectionLevel:e.errorCorrectionLevel||"Q"})})};var Io=({style:e,...t})=>_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});var Bg="#8a63d2",Gg=1e3,A6=Gg*2,x6=Gg*120,qg=()=>{let{authenticated:e,logout:t,ready:r,user:o}=_chunkXKAIXCX7js.ta.call(void 0, ),{lastScreen:n,navigate:a,navigateBack:i,setModalData:s,app:c}=_chunk3AGMJGHJjs.b.call(void 0, ),{getAuthFlow:d,loginWithFarcaster:u,closePrivyModal:f,createAnalyticsEvent:h}=_chunkXKAIXCX7js.ra.call(void 0, ),[g,w]=_react.useState.call(void 0, void 0),[v,E]=_react.useState.call(void 0, !1),[_,A]=_react.useState.call(void 0, !1),T=_react.useRef.call(void 0, []),P=_chunkXKAIXCX7js.r,S=d(),R=_optionalChain([S, 'optionalAccess', _477 => _477.meta, 'access', _478 => _478.connectUri]);return _react.useEffect.call(void 0, ()=>{let D=Date.now(),F=setInterval(async()=>{let B=await S.pollForReady.execute(),K=Date.now()-D;if(B){clearInterval(F),E(!0);try{await u(),A(!0)}catch(W){let X={retryable:!1,message:"Authentication failed"};if(_optionalChain([W, 'optionalAccess', _479 => _479.privyErrorCode])==="allowlist_rejected"){a("ALLOWLIST_REJECTION_SCREEN");return}else if(_optionalChain([W, 'optionalAccess', _480 => _480.privyErrorCode])==="max_accounts_reached"){console.error(new (0, _chunkXKAIXCX7js.o)(W).toString()),a("USER_LIMIT_REACHED_SCREEN");return}else if(_optionalChain([W, 'optionalAccess', _481 => _481.privyErrorCode])==="user_does_not_exist"){a("ACCOUNT_NOT_FOUND_SCREEN");return}else _optionalChain([W, 'optionalAccess', _482 => _482.privyErrorCode])==="linked_to_another_user"?X.detail=W.message||"This account has already been linked to another user.":_optionalChain([W, 'optionalAccess', _483 => _483.privyErrorCode])==="invalid_credentials"?(X.retryable=!0,X.detail="Something went wrong. Try again."):_optionalChain([W, 'optionalAccess', _484 => _484.privyErrorCode])==="too_many_requests"&&(X.detail="Too many requests. Please wait before trying again.");w(X)}}else K>x6&&(clearInterval(F),w({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},A6);return()=>{clearInterval(F),T.current.forEach(B=>clearTimeout(B))}},[]),_react.useEffect.call(void 0, ()=>{if(r&&e&&_&&o){if(_optionalChain([c, 'optionalAccess', _485 => _485.legal, 'access', _486 => _486.requireUsersAcceptTerms])&&!o.hasAcceptedTerms){let F=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},P);return()=>clearTimeout(F)}_&&(_chunkLEABMTNMjs.A.call(void 0, o,_optionalChain([c, 'optionalAccess', _487 => _487.embeddedWallets, 'access', _488 => _488.createOnLogin]))?T.current.push(setTimeout(()=>{s({createWallet:{onSuccess:()=>{},onFailure:F=>{console.error(F),h({eventName:"embedded_wallet_creation_failure_logout",payload:{error:F,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},P)):T.current.push(setTimeout(()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0}),P)))}},[_,r,e,o]),_reactdevicedetect.isMobile||v?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:n?i:void 0,onClose:f},"header"),_jsxruntime.jsx.call(void 0, ne,{}),_reactdevicedetect.isIOS?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:_jsxruntime.jsxs.call(void 0, k6,{children:[_jsxruntime.jsx.call(void 0, et,{children:_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, ut,{success:_,fail:!!g}),_jsxruntime.jsx.call(void 0, Io,{style:{width:"38px",height:"38px"}})]})}),_jsxruntime.jsxs.call(void 0, tt,{children:[_jsxruntime.jsx.call(void 0, me,{children:g?g.message:"Sign in with Farcaster"}),_jsxruntime.jsx.call(void 0, ge,{children:g?g.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),R&&_jsxruntime.jsx.call(void 0, U,{onClick:D=>{D.preventDefault(),window.location.href=R},children:"Open Warpcast app"})]})}):_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:_jsxruntime.jsxs.call(void 0, Hg,{children:[_jsxruntime.jsx.call(void 0, et,{children:_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, ut,{success:_,fail:!!g}),_jsxruntime.jsx.call(void 0, Io,{style:{width:"38px",height:"38px"}})]})}),_jsxruntime.jsxs.call(void 0, tt,{children:[_jsxruntime.jsx.call(void 0, me,{children:g?g.message:"Signing in with Farcaster"}),_jsxruntime.jsx.call(void 0, ge,{children:g?g.detail:"This should only take a moment"}),_jsxruntime.jsx.call(void 0, Mt,{children:R&&_reactdevicedetect.isMobile&&_jsxruntime.jsx.call(void 0, Kc,{text:"Take me to Warpcast",url:R,color:Bg})})]})]})}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:n?i:void 0,onClose:f},"header"),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsx.call(void 0, Hg,{children:_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, me,{children:"Sign in with Farcaster"}),_jsxruntime.jsx.call(void 0, ge,{children:"Scan with your phone's camera to continue."}),_jsxruntime.jsx.call(void 0, li,{children:R?_jsxruntime.jsx.call(void 0, Pn,{url:R,size:275,squareLogoElement:Io}):_jsxruntime.jsx.call(void 0, mt,{})}),_jsxruntime.jsxs.call(void 0, Mt,{children:[_jsxruntime.jsx.call(void 0, ge,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),R&&_jsxruntime.jsx.call(void 0, Sn,{text:R,itemName:"link",color:Bg})]})]})}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]})},Hg=_styledcomponents2.default.div`
1426
+ display: flex;
1427
+ flex-direction: column;
1428
+ align-items: center;
1429
+ justify-content: center;
1430
+ margin-left: 27px;
1431
+ margin-right: 27px;
1432
+ gap: 24px;
1433
+ `,k6=_styledcomponents2.default.div`
1434
+ display: flex;
1435
+ flex-direction: column;
1436
+ align-items: center;
1437
+ justify-content: center;
1438
+ gap: 24px;
1439
+ width: 100%;
1440
+ `;var Kg="#8a63d2",Xg=1e3,I6=Xg*2,W6=Xg*300,Zg=()=>{let{lastScreen:e,navigateBack:t,data:r,app:o}=_chunk3AGMJGHJjs.b.call(void 0, ),{requestFarcasterSignerStatus:n,closePrivyModal:a}=_chunkXKAIXCX7js.ra.call(void 0, ),[i,s]=_react.useState.call(void 0, void 0),[c,d]=_react.useState.call(void 0, !1),[u,f]=_react.useState.call(void 0, !1),h=_react.useRef.call(void 0, []),g=_chunkXKAIXCX7js.r,w=_optionalChain([r, 'optionalAccess', _489 => _489.farcasterSigner]);_react.useEffect.call(void 0, ()=>{let E=Date.now(),_=setInterval(async()=>{if(!_optionalChain([w, 'optionalAccess', _490 => _490.public_key])){clearInterval(_),s({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}w.status==="approved"&&(clearInterval(_),d(!1),f(!0),h.current.push(setTimeout(()=>a({shouldCallAuthOnSuccess:!1,isSuccess:!0}),g)));let A=await n(_optionalChain([w, 'optionalAccess', _491 => _491.public_key])),T=Date.now()-E;A.status==="approved"?(clearInterval(_),d(!1),f(!0),h.current.push(setTimeout(()=>a({shouldCallAuthOnSuccess:!1,isSuccess:!0}),g))):T>W6?(clearInterval(_),s({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):A.status==="revoked"&&(clearInterval(_),s({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},I6);return()=>{clearInterval(_),h.current.forEach(A=>clearTimeout(A))}},[]);let v=_optionalChain([w, 'optionalAccess', _492 => _492.status])==="pending_approval"?w.signer_approval_url:void 0;return _reactdevicedetect.isMobile||c?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:e?t:void 0,onClose:a},"header"),_jsxruntime.jsx.call(void 0, ne,{}),_reactdevicedetect.isIOS?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:_jsxruntime.jsxs.call(void 0, L6,{children:[_jsxruntime.jsx.call(void 0, et,{children:_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, ut,{success:u,fail:!!i}),_jsxruntime.jsx.call(void 0, Io,{style:{width:"38px",height:"38px"}})]})}),_jsxruntime.jsxs.call(void 0, tt,{children:[_jsxruntime.jsx.call(void 0, me,{children:i?i.message:"Add a signer to Farcaster"}),_jsxruntime.jsx.call(void 0, ge,{children:i?i.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),v&&_jsxruntime.jsx.call(void 0, U,{onClick:E=>{E.preventDefault(),window.location.href=v},children:"Open Warpcast app"})]})}):_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:_jsxruntime.jsxs.call(void 0, Yg,{children:[_jsxruntime.jsx.call(void 0, et,{children:_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, ut,{success:u,fail:!!i}),_jsxruntime.jsx.call(void 0, Io,{style:{width:"38px",height:"38px"}})]})}),_jsxruntime.jsxs.call(void 0, tt,{children:[_jsxruntime.jsx.call(void 0, me,{children:i?i.message:"Requesting signer from Farcaster"}),_jsxruntime.jsx.call(void 0, ge,{children:i?i.detail:"This should only take a moment"}),_jsxruntime.jsx.call(void 0, Mt,{children:v&&_reactdevicedetect.isMobile&&_jsxruntime.jsx.call(void 0, Kc,{text:"Take me to Warpcast",url:v,color:Kg})})]})]})}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:e?t:void 0,onClose:a},"header"),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsx.call(void 0, Yg,{children:_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, me,{children:"Add a signer to Farcaster"}),_jsxruntime.jsxs.call(void 0, ge,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),_jsxruntime.jsx.call(void 0, li,{children:_optionalChain([w, 'optionalAccess', _493 => _493.status])==="pending_approval"?_jsxruntime.jsx.call(void 0, Pn,{url:w.signer_approval_url,size:275,squareLogoElement:Io}):_jsxruntime.jsx.call(void 0, mt,{})}),_jsxruntime.jsxs.call(void 0, Mt,{children:[_jsxruntime.jsx.call(void 0, ge,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),_optionalChain([w, 'optionalAccess', _494 => _494.status])==="pending_approval"&&_jsxruntime.jsx.call(void 0, Sn,{text:w.signer_approval_url,itemName:"link",color:Kg})]})]})}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]})},Yg=_styledcomponents2.default.div`
1441
+ display: flex;
1442
+ flex-direction: column;
1443
+ align-items: center;
1444
+ justify-content: center;
1445
+ margin-left: 27px;
1446
+ margin-right: 27px;
1447
+ gap: 24px;
1448
+ `,L6=_styledcomponents2.default.div`
1449
+ display: flex;
1450
+ flex-direction: column;
1451
+ align-items: center;
1452
+ justify-content: center;
1453
+ gap: 24px;
1454
+ width: 100%;
1455
+ `;var _CheckCircleIcon3 = require('@heroicons/react/24/outline/CheckCircleIcon'); var _CheckCircleIcon4 = _interopRequireDefault(_CheckCircleIcon3);var _viem = require('viem');function Gt({title:e}){let{currentScreen:t,navigateBack:r,navigate:o,data:n}=_chunk3AGMJGHJjs.b.call(void 0, ),a;return t==="FUNDING_MANUAL_TRANSFER_SCREEN"?a=r:t===_optionalChain([n, 'optionalAccess', _495 => _495.funding, 'optionalAccess', _496 => _496.methodScreen])?n.funding.comingFromSendTransactionScreen?a=()=>o("EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"):a=void 0:a=_optionalChain([n, 'optionalAccess', _497 => _497.funding, 'optionalAccess', _498 => _498.methodScreen])?()=>o(n.funding.methodScreen):void 0,_jsxruntime.jsx.call(void 0, k,{title:e,backFn:a})}var Ai=({size:e})=>_jsxruntime.jsx.call(void 0, N6,{$size:e,children:_jsxruntime.jsxs.call(void 0, D6,{children:[_jsxruntime.jsx.call(void 0, U6,{}),_jsxruntime.jsx.call(void 0, F6,{})]})}),N6=_styledcomponents2.default.div`
1456
+ --spinner-size: ${e=>e.$size?e.$size:"96px"};
1457
+
1458
+ display: flex;
1459
+ justify-content: center;
1460
+ align-items: center;
1461
+ flex-grow: 1;
1462
+
1463
+ @media all and (display-mode: standalone) {
1464
+ margin-bottom: 30px;
1465
+ }
1466
+ `,D6=_styledcomponents2.default.div`
1467
+ position: relative;
1468
+ height: var(--spinner-size);
1469
+ width: var(--spinner-size);
1470
+
1471
+ opacity: 1;
1472
+ animation: fadein 200ms ease;
1473
+ `,U6=_styledcomponents2.default.div`
1474
+ position: absolute;
1475
+ top: 0;
1476
+ right: 0;
1477
+ bottom: 0;
1478
+ left: 0;
1479
+ width: var(--spinner-size);
1480
+ height: var(--spinner-size);
1481
+
1482
+ && {
1483
+ border: 4px solid #f1f2f9;
1484
+ border-radius: 50%;
1485
+ }
1486
+ `,F6=_styledcomponents2.default.div`
1487
+ position: absolute;
1488
+ top: 0;
1489
+ right: 0;
1490
+ bottom: 0;
1491
+ left: 0;
1492
+ width: var(--spinner-size);
1493
+ height: var(--spinner-size);
1494
+ animation: spin 1200ms linear infinite;
1495
+
1496
+ && {
1497
+ border: 4px solid;
1498
+ border-color: #cbcde1 transparent transparent transparent;
1499
+ border-radius: 50%;
1500
+ }
1501
+
1502
+ @keyframes spin {
1503
+ from {
1504
+ transform: rotate(0deg);
1505
+ }
1506
+ to {
1507
+ transform: rotate(360deg);
1508
+ }
1509
+ }
1510
+ `;var Lo=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:o}=_chunkXKAIXCX7js.ra.call(void 0, ),[n,a]=_react.useState.call(void 0, !0),[i,s]=_react.useState.call(void 0, void 0),[c,d]=_react.useState.call(void 0, void 0);return _react.useEffect.call(void 0, ()=>{let u=e.chainId||_chunkXKAIXCX7js.O,h=_chunk3AGMJGHJjs.d.call(void 0, o).find(w=>w.id===Number(u));(async()=>{if(!t){a(!1);return}if(!h){a(!1),s(new Error(`Unable to fetch token price on chain id ${u}`));return}try{a(!0);let w=await r(h);w?d(w):s(new Error(`Unable to fetch token price on chain id ${h.id}`))}catch(w){s(w)}finally{a(!1)}})()},[e.chainId]),{tokenPrice:c,isTokenPriceLoading:n,tokenPriceError:i}};var Is=[{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}];var Jc=({amount:e,decimals:t})=>Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(e/10n**BigInt(t));var $o="sdk_fiat_on_ramp_completed_with_status";var Jg="0x0000000000000000000000000000000000000000",jg=({destinationCurrency:e,...t})=>({tradeType:"EXACT_OUTPUT",originCurrency:Jg,destinationCurrency:_nullishCoalesce(e, () => (Jg)),...t}),V6="https://api.testnets.relay.link/execute/swap",G6="https://api.relay.link/execute/swap",$g=async({input:e,isTestnet:t})=>{let r=await fetch(t?V6:G6,{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(_nullishCoalesce(o.message, () => ("Error fetching quote from relay")));return o},e1=e=>{let t=_optionalChain([e, 'access', _499 => _499.steps, 'access', _500 => _500[0], 'optionalAccess', _501 => _501.items, 'optionalAccess', _502 => _502[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}};var t1=({chains:e,appId:t,address:r,rpcConfig:o})=>Promise.all(e.map(async n=>({balance:await _viem.createPublicClient.call(void 0, {chain:n,transport:_viem.http.call(void 0, _chunkLEABMTNMjs.r.call(void 0, n,o,t))}).getBalance({address:r}).catch(()=>0n),chain:n})));var r1=async({chain:e,address:t,appId:r,rpcConfig:o,erc20Address:n})=>({balance:await _viem.createPublicClient.call(void 0, {chain:e,transport:_viem.http.call(void 0, _chunkLEABMTNMjs.r.call(void 0, e,o,r))}).readContract({address:n,abi:Q6,functionName:"balanceOf",args:[t]}).catch(()=>0n),chain:e}),Q6=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];var xi=_styledcomponents2.default.span`
1511
+ display: flex;
1512
+ flex-direction: column;
1513
+ gap: 0.35rem;
1514
+ width: 100%;
1515
+ `,nt=_styledcomponents2.default.span`
1516
+ display: flex;
1517
+ width: 100%;
1518
+ justify-content: space-between;
1519
+ gap: 0.5rem;
1520
+ `;var at=_styledcomponents2.default.span`
1521
+ color: var(--privy-color-foreground-3);
1522
+ font-size: 0.875rem;
1523
+ font-weight: 400;
1524
+ line-height: 1.375rem; /* 157.143% */
1525
+ `;var ct=_styledcomponents2.default.span`
1526
+ color: var(--privy-color-foreground);
1527
+ font-size: 0.875rem;
1528
+ font-weight: 500;
1529
+ line-height: 1.375rem; /* 157.143% */
1530
+ word-break: break-all;
1531
+ text-align: right;
1532
+
1533
+ ${_chunkLEABMTNMjs.M}
1534
+ `;var n1=e=>_jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, "g",{id:"Layer_x0020_1",children:_jsxruntime.jsxs.call(void 0, "g",{id:"_2405588477232",children:[_jsxruntime.jsx.call(void 0, "rect",{fill:"none",width:"2500",height:"2500"}),_jsxruntime.jsx.call(void 0, "g",{children:_jsxruntime.jsxs.call(void 0, "g",{children:[_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "g",{children:_jsxruntime.jsxs.call(void 0, "g",{children:[_jsxruntime.jsx.call(void 0, "g",{children:_jsxruntime.jsx.call(void 0, "path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),_jsxruntime.jsx.call(void 0, "g",{children:_jsxruntime.jsx.call(void 0, "path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),_jsxruntime.jsx.call(void 0, "g",{children:_jsxruntime.jsx.call(void 0, "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"})}),_jsxruntime.jsx.call(void 0, "polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),_jsxruntime.jsxs.call(void 0, "g",{children:[_jsxruntime.jsx.call(void 0, "path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),_jsxruntime.jsx.call(void 0, "path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})});var i1=e=>_jsxruntime.jsxs.call(void 0, "svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[_jsxruntime.jsx.call(void 0, "rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),_jsxruntime.jsx.call(void 0, "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"})]});var l1=e=>_jsxruntime.jsxs.call(void 0, "svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[_jsxruntime.jsx.call(void 0, "circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),_jsxruntime.jsx.call(void 0, "path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]});var d1=e=>_jsxruntime.jsxs.call(void 0, "svg",{fill:"none",height:"400",viewBox:"0 0 400 400",width:"400",xmlns:"http://www.w3.org/2000/svg",...e,children:[_jsxruntime.jsx.call(void 0, "path",{d:"m0 0h400v400h-400z",fill:"#fcff52"}),_jsxruntime.jsx.call(void 0, "path",{d:"m300 100h-200v200h199.996v-69.813h-33.191c-11.442 25.468-37.194 43.206-66.665 43.206-40.63 0-73.533-33.187-73.533-73.533s32.903-73.249 73.533-73.249c30.043 0 55.795 18.313 67.24 44.349h32.62z",fill:"#000"})]});var u1=e=>_jsxruntime.jsxs.call(void 0, "svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[_jsxruntime.jsx.call(void 0, "rect",{width:"199.4",height:"207.623",fill:"#121212"}),_jsxruntime.jsxs.call(void 0, "g",{"clip-path":"url(#clip0_2303_643)",children:[_jsxruntime.jsx.call(void 0, "path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),_jsxruntime.jsx.call(void 0, "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"})]}),_jsxruntime.jsx.call(void 0, "defs",{children:_jsxruntime.jsx.call(void 0, "clipPath",{id:"clip0_2303_643",children:_jsxruntime.jsx.call(void 0, "rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]});var m1=e=>_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),_jsxruntime.jsx.call(void 0, "path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),_jsxruntime.jsx.call(void 0, "path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),_jsxruntime.jsx.call(void 0, "path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),_jsxruntime.jsx.call(void 0, "path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]});var f1=e=>_jsxruntime.jsxs.call(void 0, "svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[_jsxruntime.jsx.call(void 0, "circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"})]});var y1=e=>_jsxruntime.jsxs.call(void 0, "svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[_jsxruntime.jsx.call(void 0, "rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),_jsxruntime.jsx.call(void 0, "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"})]});var C1=e=>_jsxruntime.jsxs.call(void 0, "svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[_jsxruntime.jsx.call(void 0, "rect",{width:"30",height:"30",fill:"url(#pattern0)"}),_jsxruntime.jsxs.call(void 0, "defs",{children:[_jsxruntime.jsx.call(void 0, "pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:_jsxruntime.jsx.call(void 0, "use",{xlinkHref:"#image0_1_18",transform:"scale(0.00041841)"})}),_jsxruntime.jsx.call(void 0, "image",{id:"image0_1_18",width:"2390",height:"2390",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAACXBIWXMAAAsTAAALEwEAmpwYAAABZWlDQ1BEaXNwbGF5IFAzAAB4nHWQvUvDUBTFT6tS0DqIDh0cMolD1NIKdnFoKxRFMFQFq1OafgltfCQpUnETVyn4H1jBWXCwiFRwcXAQRAcR3Zw6KbhoeN6XVNoi3sfl/Ticc7lcwBtQGSv2AijplpFMxKS11Lrke4OHnlOqZrKooiwK/v276/PR9d5PiFlNu3YQ2U9cl84ul3aeAlN//V3Vn8maGv3f1EGNGRbgkYmVbYsJ3iUeMWgp4qrgvMvHgtMunzuelWSc+JZY0gpqhrhJLKc79HwHl4plrbWD2N6f1VeXxRzqUcxhEyYYilBRgQQF4X/8044/ji1yV2BQLo8CLMpESRETssTz0KFhEjJxCEHqkLhz634PrfvJbW3vFZhtcM4v2tpCAzidoZPV29p4BBgaAG7qTDVUR+qh9uZywPsJMJgChu8os2HmwiF3e38M6Hvh/GMM8B0CdpXzryPO7RqFn4Er/QfBIQM2AAA/9UlEQVR4Ad19baxm13XWWvuc984kDeLmB2lSqHppoaRNk1z+gKlock3jyu2fjqUCUYVk5w9NiFBsIaqChGZGlagwBTtSQeWXJxJC4g+xBRJtQ/CEorY/KnlQo2LSr1v4USdF6lSI2HPfc/Zir7WetfY+1zP+HH9x7DPn4z33fc/Zz15rPetj78P0/8Fy8tAzh/P8wjHzwRHP80eF+bCU+YhKOeJSqPDUjouubZ+pTG3lQvNUTpn5Zttvq9xsp/9bmdq+0I33rPONx6+89ya9wxemd9hycumLh/Sei8ck83GZdx+vPJ1M88EhlbnhOVNDr/2v20JT2zeA9ZwCW3Qttp0NbPLzbJfTFPtolXZ8WorcmAp9pX3jjZ/9+3/qOr3DlncEwAbqvDzE8+5HaTo4Ft4d8nRAuooCq4Cyb1nBNGAnk9RpaltyYKcJoLZ/JoA7G+gNTHKQi25Z7DO9hkmI2Ruq/d3NQnK9nXvqoOyuX3nkvaf0Nl/etgBfuvTE4c1VQb2ooJ7IdKGh0ADlBuyu7ZddA3DXjhuw89zAg/QquFwMWFYApwDWpXNScA1QP55NXYsD3cCcmn62DmEgA1hIte4r4NoRpNq56+3iL9T1/z555ZE/+7ZU5287gD9x/2Mntcyfk/niCU0XDmW62NC4QAowK6BFJfcCVPGuCW4DllwtlwnquHRQdauqV0E1EE1q2z7OGcjFpXYyoL1RTMJ1WwAqWkrPMfZ1I7aqlPO1ds3nf/Kz77tBb6PlbQPwJz7xMw3Q+XItF04UVJnf1Vq+bYuCe9CkVEFtEqygqvQ2YNlU82TSG7bWgDX7qwCWBDQkdzapBcBMkF49FjtWkFNlQ3L1XEiyLibJQFfIO0DVQ+F2H3JdRL7w9z77gWv0NljecoDv+2v/8KGVDi7z/O4jBbUquFibem7rBaq8M4Cr2dudSTInoZqMTIVKNolNIsUObDu/m6gDDKk14A1gMUBnU88CifbrCncJZgVaHNywyyK+6mIgkwPd9k+ryNVH3mKg3zKA7/+rD58s0+6ylHc1iW3Azu9urf2uJrkXbVXpJW5SuzswFa021yXXwS2zAjqZWg6bWwabO7Gr5HmU3Lbdlb41cCHBsa9A7qCyZ4Abkh6Sa40mDrigCQXSvGJbG8irAc+n7QYe+OzffmtU95sO8P33fPpoYX6CD77lZCUFswG7ezcpyFvVfGB2VyVXmTJDck2Cg0jNvp1n2F2TYJfaXTsOKc21Pe1BgUou0iUZUjxDHU9GtrBvtjgk2PfHRtNzkqD6Cd2utnIC3dZr7SuvfuYzHzilN3F5UwG+7y8/9LkG3BWZ3t3cHgX1W5pKVkDfhe1FA1rVMplKVkBVemcjUybBaXcLfFq4Qxa4aBLbENvBp7UtpPVA7W6DYTc5oDs7Lym5KdHFr0twsVVpNRdK/5FBkrGsUNMK9mpyT7SsbPtr09cL1HY7/vzf+Yn3P05v0vKmAHz/PZ88WtfpiVDHMn8LbQDeBcjqCl00cKlJqrpFppphcydTz6W7QvNk9nZkyrvJJXc3OYlSEA8A3sEEYAGoSu1uIFn6uUuw/124SvqZIlZgm9mZVRItXeogxZVCipmW6up6sZV8rXy9XfypN0Oa33CAf/D40udaQOKKlC611ABW1RyrAWuq+UJXz+bfuvSa3VWmzE6mXGqdTBmJmlx6dwhgKLgzJPQAEqvrhQA4QXaAd1MH1QhXSDHYtLJuFU31kQ3oYNM8ECzpqlqVeIC5Vgd7X12aFfB9A3u/8mmT+quf/cwbS8LeMIAvHV86/D+0f4z44kM0vdtBnRxQmt/jNreBKjtnzkawNDo1X3A/13xeRKdgd80dapJbDNBOqjxY4UzZ1TGnhB4AaJdkXwNglViT3BI2GHY47TIh8EFQ026Ds+HQesGkK56921+V1mLHLrkOtK4q0WfV4mSPf/on3v8IvUHLGwLw/cf3Hy1Vvih84Zh2DUy+aKAayDuAu3PWbODu3N911XyAYIYTKpPgyUOP0wyAm+Tumlh5mJHBliG57PY2pHdnarqa9B5AYg8A/gUAG2o8yVdxohXs2n1hf7YyhC+zBQFmqmiQLAeYU1XvxffPVj9/ZmC381RucJUH3giVfdcBPvnQ9x8XuvhFKhePXHKhlnfvAcgK6rsd4BnM2SQ2olUHyZpJo1Nmg1VKt8GM2WyvSlqhg9lV88HsTHk3OWC+VpPUA4B4ANV8MFUHPDuBgHR18hXulblICHNaJEtDleLnTJ5TPTegq59TQE2Sa7fFIbkGqq5roTMJoPmURe692yAXuovLyQfvebDJ1tMtWHxEAM1Ik0onXzDJrKX7tS1pYBJq+8XZsWjrNRB132ztDFLVAHWAi6X62NRnSeLjbk13h5JEFQcwXSTu4NpK0qW7+P6FmaxTXJi80+h6od2qnt/NuG52TXGh/eiF9uUH8Tezd7ALs/99XOcrfnPyzqfX7cJEsBy1jvDMY//iG8d0F5e7BvDHPviXHmxfd01kOlSC1G7dQ4sAtAaIKqklGPLc7NZs56UBanFlZIJ4UiVpjompZVPN3LNC05A8GAGeBt92x+HuOChBtKyhTY2H3e4gO9PuINuqAE5Otmy/9ZidgY118u0BjpUDGA/AZ/ad0WE2pkLy2H5/lsO51Gd+7l9940G6S8tdAfhj3338IFe6pik7lUr1V7ltDWTd6rGRp4vGjpVAKbAaeqRZZWgysHPLDq7aXmKX3AB5SN0BZE4b6YmDCFRI+sA7NGTYW1PJLB1ABD+6tEHKAOSBSu0I4A5AQ3J3O5fi3RzA9+uzw0xhBrCdBtsfvjhAr2u99s//5d0B+XUD/LHv/siDDcFrpmrZgxHErooZ6b1QxxLqmPvWpBTqmeDfqjvExcEFnEZhNdZs/xmjdYfUAhEA+0Vqemi43Tm2vAspR6MbiBPU5jRKpgN3EADuPFI2tz+yddbgCtlWPzNQd2WQXv+ueRqkuXROsBu0RrptxtzrtZ/9udcP8usC+Ae+63suVZVclTyZXAIhxQ7ggatpdr+2MtS2XoN0n0qrsqWQWpM/A9PBLaXfIgNklV6HHaqaPAgRGaGwvxmlmrokpx8cjRqghs1WVTx7nngHUDxCNqwJrO8rsLOuU2zRMSYAH0AHyGD8O2iV0aTo35qpsSeWxx99nTb5NQP8/X/+Q8cNzCeKSq1J5GxqmQCiAWxM2HO4ek6lu5YpJdbs7uRSzCBWyph9n001m4rmKLUZy2zYWHSm9BAvjhyvBy66+oswZIA7c5ccSx+WDqbZZrUkMwAb1jg3fja1P55Mojk7wxTgzg72PA0dbabBPYtgC3gEScbG2+eHUuXpn3nsD47oNS6vCeB7jj54xEv9olQ61NSYMV+TPLefpm4N7NkJlZGr+GyGilaCVRzclF52lS0uwUKcfi/T4HhKT8g7qD3qFKRqGmPLkUBAjLmHKmkj0aFGd4O0GqGbfFsgsdPOt8rwFdyQ6AB62vw9JBrbSHwchKQW5wvu3vVoWgRa2noopTSQ/+iIXsMyv8rr6eTo6PCM69Ptto4YwNqq0mc2uEurqWhyu2xsOQH2v2NIsYBIUUhs2wp7wj5ydFyiMG7Ix2ZCXtV06y7I50ZGaMwSRQBj3gQ0eiPPAMDB9K1VX5bY6q0xYtDcyzpsaWnD6nFL9YNN41TdH6Jeeo2YJfNgCPz2um9+crvP2u5hXf1Z9H6bi9ySFYJaMT7ay/JE272XXuXyqiX4Vi2X2y0fcbowDiyF3Q1ZCWkuM8iVE6vKBUy5JLCFJ/+uAlIFW0sEmwty5ZLNKKPpEhx1UuEmuQRLhhbLEIacg5gFGYO9NYkvlCB7wZ6rYjsOid3BN7/duiuQYjZpD0mO75jgas2mLcAXJs9bT3lPkvxhyioTbQo5+UeP/eFj9CqXVwXwX/nO7/xca62HtaFdtYIFp1qeDMSeCQK4NA2qO8D0/SrFsi+hnkMtgy8bqLYE0P3Q7S8h6yNRZiOdTQNEV92DtEaMeYhY2XoeVFsdOCssaH9oHGE3rLOvBvC0BVwlXr/LOl9oh/gtVHNG5UjvfN38jOlKGLGHf/Jnv36JXsXyigG+5+joqP3WFQdXm97VafqvcH04mDGkl2F/uXQyZdJLXSXb9xV3hdTeSgLe1SE09VZyoS571aPAqlNX1WVrkyfelszG8VQ4Y9uplieXRAMV4CWg9pnuc54j6wBsa/5tQWcp23XkCiU4hHY+kuykHWzXUPrsLTT7xE+9Cnv8igFut/p0szOHpiYBrgiaksMOO3Fy+xuuD/qeiZxZSmfQKEIlqGoUq5o0U5Krrq519QoYyocdy1nHRskaKoJkF8ni9mDaUXdlpD6io7l1gBxYzlVbmwE41EA7BvOfz0n55J3WtwEseEShrM2O/HPknu0zdNAhCjCYIzpcFrPHdw/g7z86utx+78ikCrYxmG7TwWaHtWVCbRNYcrfDkHBGZMps7wzpJWfJsL8Mu0thg4f0XIAqMoIcJa2SwFrF5FBmw5tol2z+LgrhOTqOdqYR5DIABv0aEk0JfCcAm04BIHnq4EYny+2wz7S9t+yw8Rmes/1/8nf/8XMPvxLsXhZgVc1tcyWyJnkbIcGwscGkJYAc1TH3rUssZ2Lcrsl0W0h18E7aqmcmlMtwls34HTn7DCCFgmChsUYnDHaYs2G5N2LhlLhxjUiK++hJvZP5J/iJGDRPcZAZhMGO4zy5xohOy9RNTdy39mTvkP15IiQ7TdPlh6/80eHL4feyAJe6XpbQjV2OyFUz3BruwQuOjBB8W5dsTmntf99JFY2MGeUSnJqCaGTWDMALtlEyk26yUKb3xrop3vzy0Dk4wObsWx1USCW2MtqFUAnTxk4kkFuguxbh0CChLfJSV8kKqt2f9K9l3t4zrjvcX1wu08vh91If/sDRt19qD/VQi6bYUI1QzZ1Fh9R2huz2dHJbzN2VomTbALWU3twArqaSGoHD0w31x7GI9EZyAGXYfzGoJVqOxvbvvYDRgkzD+UF9cIjR6IiPDvmARHTGfgyNxbzRPNGPGSfANTfPUfIWJa8zTlLl4U//9B+e0GsFeKX6mKAUNBrUG8IBsyiWQM3arwZ7dvVckTQ4L6mjxJoCAjOnUVOMjUQxgqA/POV+VibT8NcAsfNxxh8X6oAKHmr8zs0X8NAY58Aee1B2DB7+aLw+v8OfIjpQ/widLtog76erp1GKRfqztiDJS0rxHQH+ge/69odacxyZXMA+OthTui/OdCfc0dQllSITVLxWmDilOfzccIMKd1IVanIcLdA7FdFom8XJBpl2EY8ScTZXynPvVFABWaoe1zNnsdyLlvPqn25//KK/PX89ziX+3P8oeYVtaldYMlzvT9v7zqaD0slDV+4sxXeW4FovZyOTs9uSkSaoVy7pefKgejncHuwTD6o3O4o3fs1KRBSOD08QKo5TusU1xthohTe21v9Otr0ELTUGDumc9Lx4/9xpuc1+ft5P8Et+TbtXdEbravgu8xWGe+ydlfP37LgO3zN0mBbkvEx3WG4L8EmT3vYjR1XQoNnLC37WQY4k/CgtIT3xN6Od3XSO4brI89rf196GwdzHNg01yJv27Z0mGmj8Dus8vZUT+7EPjADe9nzeiGx/oEq/Trpm2T4EASS5Tf/g23ax8f5qPhPnz9XNM/DJ37ryByd0m+W2ADdVcTlsoqm/KgCSnGSlrYDvikS9xZapR6KSOXMZ3CB8hXSIEiDptlZoUJ1DG3aJ3/KC1GsSQ0hwTeg26Y0ZNn/EztU9vk8G9R9lkjAF3uK6Vl/jePyMwmxsvye/H7/plwvW+IyzQwqP/YP74LZ47sG+t0TFZXolAH/iz/2Zk9YAR72nDSo1v9RVcTZeqOdBkt0eb6Xa9vH3AgCkK6OBsHCeZe73sQGDeomqfRfGAeX3nr8G57KDQFXW6MQiCa4BUTtwMtTCytoBpwSubjrDeI2gzFLG36lyTsiZIgQ8xgM6Bue20eGjU7hdOPmxn/pfJ/RyADcAHhTpbpG4L6J1QqEOEmQJslQpbbQ791P/PqGuoanToLQtIyWWLeHJRifqNot7D47GcTWGni99qyWrFT1/rFXuq6f0QhAl9kewNtuaoEmAvVZ8ebV1e13vLPEssa4p/LyppR7VsvcNdNxBwvMZCZ24Oi4t23jpJQG+/4NHR+1GHhpJQ4hQxoJpq2Y8tOfqucJtIurSGWrSVLhQ2tpNB0gtQfFPVw7Mg0rlbJjobCGlut0ASNQlYnN+OFeHQvUV3zOAWgeplbX27RLAovh5ud11XborgA6tvulkVTb356MiBJ1TVznXKb2z12hn6byjeSQPXrrye4d3BHil9USCCKB3Z++r0sFhkCXu0txpD5tkuJbhdG/OF4ozwBtdAiiLjQqq1f9gJD7Zc6lLgWSnwkOHZBBlY/VC9D60s9YQQkjzGlsHSrd1BHdcl75fc1+Gv0MbrprMj+/ufWOBhllDYnOoqZsyvz9oIDpHtqiDrY1nHaHSIX1zOrkjwEXkwVCTAZoH/7dgigwiJonr4PDzxgVw/3OwoRxqtasCyb8TMF7YbXwWgNNgp2RUb6HybJDXFsQFa6hDHRAGjYp9r6aoKxp/hUQHWAvAxErnju3c2vfrKMUAtaYml/xtA3v1e1jW6ID+XGtIM8UY426jR61k6n4NU6bfvX7utgBfOj46apsTZ37cCQGBcODYm7ar2WTXRLDXDmIZNHEK9HCdoAtV6r5jlrhwvybBxN9WiPEq/bNRRY/gYqhmdoAFDdXBDTWJBoXEhbStS5fMOgBdGxp1X/u6jKvkVv9+jW37+2WRDiwkGNqdFsK9SR+V6Pc+aCI8Xx3t+SBngOn40sNdTWdN1rpfT1y1Qa4kJC/CfFH4xgmiuySac5UNYQqbEJ1CT9fBrnNqCAAJhAsYMGsvntCxptLt5dRtqKm+AqlgkBU8vDWOluhIB3vFvS4VeYLq6bj96r/tYeb220s8QbScz8tR2g14UCXsS38eGp41SNUKG7xCG+ixgbr6by4jyOho+3NjifVZfRgqVPWgsSo02zpIMoTp8IxWJVvXNgC3zx8MZegqWRJUAdDaIAFsiiUNtpNow8/iEpPMAsBKbz6z65Mfl42dFvKigu4q4M5SWj0K5oBpJcYa+8xJTlY00L56inBfkR6sPtFZwbB83V9AYfvjeSGdldyYUhNPC3KAPPSDoUMHoXItAJVs0gsw16499rVL6tnaZwIwTVM5pbuTr4FIDmRtZOcuyfXjLwK43fYxheirGyAM1yThSEBCJYRqTWJkEjcEBEgGxi3Y9G1o9+gEWtpiv1HYji3DBIkztcb4DA86uTUBsGhALbaAakaW2pL/epz5YY2hty8sACtdON1CopPNL96xTWirdOJIL8IYhJSg5sPGioE6SqwCewazsJc+dlg75L76vXdzEvtbph3k0TjLsLqrJyrBn7LOq//82PHRSbvycCN+1KH3uw9aXjsVxjYMvIR9Dk7L/fyGgINydd9wkFyRDMfF3VS0t5zrrdmjyRtBmacP1RwlACqv9tUGYWNI5wKCYw2/qPoUbPXY7abZTgVq7/Y0j82++vmlIbNvW11NWg1YcXW8Evb7d+u5GCccgO7XDmao7nU0MwN3MHDDuyDYZYK5a1iePPzMUZfgSicJJ9waAtkK/RsAWFFchfQJMrgeFbHeIly7tKrdmhxQGXyfUGckg/QAtIprKDoBhcSH67DtyZO4tFeG1OpWxB5MG2VvHIGhntt+jWkKefC4ORuLBpNUVVuo9phgo8O1g4oOOY9OKt4kLsEKCJixuUQrO7DQLiq5CugeA8GDFIZ0x2DxJTqihEsl6SI57xC4ktQjcArsrZ1K8eMGcAPr4111OjD9QfOkD3yGmuaRFnMAh0jOBPBNta6p/WpF+KF4T3M/OD3vjeSHqtNqx3CHVLqZuoouAjvctqqu1bYu7OU72lBGjsgrKZUIKnmLsp3QSgHy2J3mIXigRM5+C9pHKyDjz2MZrdDWJdoSKbe1tBkMfpYq24FdpGzYtEu3d5j92u3vOpiCNYMl3n5VcZD60S7BJMeJlQhlqWpmhMQHhJmqdbC9SQCOXVQBAIDibm/tOqk4L0O3R5SHq+eVrXNw2nX/VgKT7QkCa3D0ZgW5gGCpDXf15jWaWou8r6h10v+sfrrdZ6W8r8F5o14bBps21C5HsX2GA0aA0WYeCevaZYEd7kBhjo4VE7HUAHgwG5DiRWIuD0wDMarrYNDUYwmrhZKlr+tyYgA/dHx0+E2Sw+yLzPB7aWuSJUCr0NzeUyZrmEYP9ElmD80NwV1fKdQxCJh+PpAxV/cOfnSQKoIOAzfJJNYBL1B/ZeogT2gYk7ImBQqkukJWl4xrqPr3FfbQloRtD8mQHjZ0Zt7dqdW+G/VUYVaya/CWxQ5g1BrECaoZgJ4B+AD3LLZQ2x3cmOejB0kiKBLmQJLQimtJPz6yidJpno8bQ+iBC/JGUXU2Ahvqq0CVMVpCmgqeJj4HYrXzDHWmatpsc6lpy8nsc9wYpWqvMMSRrwjpiH7BBb43O7hcEdyAa2p+Lu6z4FypQewKudViulCcYmhL1UKDdtBh6xwOAVQ8YS5pJNqHMiHJJuJMEISvHkGWBfZ2gZqNCVkMzJDUyrDJlJ1gqbQlXWaPEQAysOsmklUhmBZJM3O4Hs3rtDSA0Q8l1CrjgpI9I9S3gqXl6bW1WgG5MjDFpdckudROoiAqBcEOMZs8W8t3dwq/NahmdErrtTPUdoWq5rTJHpZk2F4GsItJsYPPozMjQd1gJVTt1iBY7hpO8K9XHW1QKSdeMd+5wIaPyj3NGHWApfvoek6nUloGVX0GsIJMnW1UNKeKHm1wMOq0wRVJCPAaAzvWVE/747k1wlH2SBCfIFmdPhCN2clwf7zFqqnqGN1XjVy52jZb3XQp72CDJdwjV+NGtqDXjKGz+3HOxBl6mVNiGSpwDSll6oF4CXXd7m9FcR2FyXdIGDq+W11KclJLsb/XAQsr7LuNFapOrOz3qxO40GybyF1+FyPtF6FH3oDbZ9kpUMVkM+2M0yop0eqS3H1o63gGNuLbIMEuyXCTRvO4rodzmafv4CVT8narBQ/LEvbFdaa6Q+wMDa6RgC1Xj9CbdK4uycWl3cNAbotNPUKCw+5KnLOQJK6FpDijhvqBeKMwMR19nigzMgYmXLhF/Np9iFZKcLgXFWFObbRCO3FVHek6VWozpHdGQCaIFqHD0dhRaEgEUNhMuDfibtGaAPfJ0PT8GdRzV92SHSEidBEg6W6iOHsOvhT5AvLYuWIxcVPRk9RDZ4e9CDskNf71ISrVittNmkCSjJ2Qq90yaWiuhcyL/kBrnrLavkFj9rYm4N4B0FG4q3+T+DJQVKb0TdN1GsiWgrtC2D3S5PxhjJQID19WHGzRL1ibzuFqoKYWcErXwHZJNX+aPdpkxUk1SnG7mo92QjsnEzdegFRfRKXSrtYeb96fU8/GqmUkZZKsPLRXgEuC1CaErkb4DCq62eI/2USJDpnDBYC0gjRkUGJwexwQ6HqA7JWCIO0SP7Cek9wgVT6u32xH2GGXJzOKjN9zh91psQLCUHvoDXhadp+bPaBv+9WBZNhoY+aCDlSHPKoNq/KgTTh9FVxBwYgR9qoBctA5bVe7FR6AHYC29J501eyzzvLGDqvmMMkG4YrEwjKo5z3Us0nySj1vTSO4UM2potH+VI/UD+4Ak3T2SfFQ3O2kQJWyN7KpVgN0tS8ssL1uf+2Rui02Jo3USlkwJmlFS0+gyCBmBTa7TlDlISqSdq5A8hg2dTXjjnyXUHeDqOemI/tkc8bg85Uj24Rxw4J4NpsSgg/MfbAN89YPDm0SuexRRUtn0WNUahM+lXGCUtq4RmFre3hSQN56YKMCUIEgVW3/pkGt3LEuTUUXPhqHYUYajMcAACE8lxxUAVtsmkHdkrHoFSra9x2g1eyztBycjTqUsLfeOewc/OhigFdImrsy4UY5GgXM2QMaRtaL22YOyV4JCQzOTLc1BhhkNZXr11qKEUBq4CDIUIxMXPAVBrRQTydCmrdBgm7b0xanqwSgaQhaSFfbIa1LSrJksGZNcuYq2cKU1e2tApngVqhoDYJXaEx1fVsbzzYoinzAlAM9EBwhGDGXqJS6sKXh7+Z2ccBVUgXAA/Ae9KjeEWaIkZGuyVWL2V9n8KoN9AHMJiu4SDUSYs9mMuBdoe/5OeCbnldr0B2kS3WtqePqo+lN97TPZpAts7vs8W11L7QtTEX7aK8McjAEQEJFA+u0w9Sld5WeyHeXibNUJ9KFTqaGfHCFW5Tb7hpZjZdEWrJmYClAtjZXTsQuhHOMeLP6SATSnSFWHx659sxPBj2s4QEwpJkBqP3AtLikltUBh6Tz5Co7fGMhV9Fs6nuyffs7G5XoUyyE2EqklML+svvNGikKOxjYLjXYv6tdQiBDv2uC36qTnOzciNj+BMmd/adpzyUHDnr+mDJ2Hjn/+MEazQJzEISobkAeskIS+WukDGtPB+7XyBx1cjWmAoM5bwF2k2guKQRQ1bS2qwNsQ0wq9Sos+HjV7Y4E4TLQCsjRSpFNIgoJhnpWFq2lEeKrNqMFR+rqoAJ4Hz+MmyxhSwoImro5JX7d5KIi2ODA+j0aKaq9wfVPdcqilZxUeeeA/V2dPInlnf07tAGCPautXcGUJ0hnf1EWD5IrgwEDo2Ya3KQt6VqkJ0jWALN9ayQiOuC0KSXySo/qciMgg8Fn4MGYlmvA2nhOriC9oTX3+nzcJ7sulGNrzUhnWYp3WYlYMVibFLe7U/Ee1IxAJ1hQ12xgrga4nmOZkuVZL1Px0pnuqhtQjnhkqHRxvagSni6cbHgXJKkgCMlINtDAqmG72AHR+qp4bmEP9U1IFqxwg3KKB9h3HzXaB+9Y3f9ghhFhpYhLJ5uu3U+PFJ+BSLRNINQAVFJNW8jR1L0LwYo0lYMOMOHgrUqsKniQYgKQZ30fX3u2Q5+1VTCb3Aqf2POh3poefzbLZQ8KIjWwZrfPe5+jMqTZpLhZMpldsrXVTcInSlfKiNeELZvddEmpqOColg3S3sroicA9Q5amIcIdiDhz2OEVgDBIuzhYFSVBhfrcGLG1FGSYr/haCIJA4VDv/hTUFO4p9FpI41hLNYBu7g5v0ooG6Ip8NNTzGmYyGbP/SIVKdhOp4O6hLdu55awJy9401s0G8mFMD+ghR8+4pKsUEsOBNn6kfXFVJty201RTcsmI1h5EazFAmdeBYUPaMSjchrnosanfySNjkGB3idgfBqMbVf2VgWS5BUHUeVDZQa61k064NuLDlmd2OmGCbpkjfD4BTJNmtEuEJl1Nd01Cg/0Ppk40JB6k2+ZU2QBS/VqXUMkMlNvw8HHFKzoHV8iPQXTFCavXB4EDtWNRoL3db87jPBXnJwNxn7IikkXwtcCqzXWf3e+t3ovUHdIf4lDNq2apdub32o8aW9aJWfY2CQvDh64m5cWPzU6zqf+YTaCuLjpGtIwIqsoqNLIrbzzJAfjwkqwRU3rx2QQgJpAr1+LiiQuK/DH17ypD0IR6UIiCm4xqWvyX1wC/oupCRtLlfqzVQNMA7ApQpcea/TgSCR7+ZXGQC1R0asuK9tci3HrW7n9/U2fEP20PdOQqGtP9sM/L5BmUYjarO/LdZ7XgRtQwNnVgE7DUHezv3qZTMvW8+kx4VeftU4nVmWn1cx3OosEMo0RLdqtsRtUistK2hsJVuHjg2d6XBNyzWK+UGF0B3QoEEKeBemckGcCOBZJLzj8i52vgulXK+UMEtDnIaPy+DOrZbH0N2xzpTsG+21gawK3BkKXndQXgVqgCB7Jm7MHsLgHYNThOa9fVtWdd9n+sfvDvx9vCpqF6wSWa4RJwsgYPYa6Ujqi5OItPmVRArtYzC2IYiOvuHMFy8PVlzgK7EYYzpmVydwlSq8ED9asnvw/QAfLEvQ+KY0w5LDWFKtWkqeG1aycbKMc+EZklXMgJFoN86Z1M3D2JKEDxWLcghuIsHK0Bz71rEqHOD02L1G6jnXghB47sEIFk5XAh2NkakULbh+sJCQ62rO1Xwk3VtrT1rF3XJFiW0xaokZtRFhozvsV8kFo37CU8lKqpgkVb09RiqlqMKWvkZPbVwF2sJ5k6VrWsP6jzdkQEDETLkwOTdQJZAbTKUIGb1G68gHh566JJFVyQLoF7FUXpqgo5Z9pxKVw9nmiquiBDZa7PCqLNXZLT9iKIEoUD6TRyL9ofsofpq0XiPSpwBbbXJLaOrhRkJEKO0A6C2H6QqnVd03y5gKzp+3KFtlRgVXCM97S2bmsLoZzO0zTdqEaS+pR745RP/sZNTrI15oUd7k6IFFQ1+qXZ3KKqQnYGrAB4rlDZjIme1wKAJgPTCZQbTKvBUsBtHq7qtRiVs14sAiI6stFneBXqMbgKYuT62X1bNwSMxi5w+7LgnjjfFSxgTgXIFfRweLzEQ1hFouND0gkkz5/FrwuAfVywm5H4JKXWNM1ApiI7BGBr7RFB4zPiTLlIEKy9tbkst1yi1WTS2alOtnpa7Q1i/iD+tk53lQrCd9X5rrPciq6XmaDVpNJtK1g01LTX9OlUf+3HVp8kzSYMUxtsoOqNpdXzOakq9rkn5RRo4zhwj92Iulp299mBN/ZcUHlZe+c0DSDhHlHa6Eg2uFpGcTwAMqlfHc7QYJSz5IRCRrYtPh/sb/wehfRKB3XN5I2TKELxIVEnVJlAGBI3FkE0SV2S52g7uzC5emZR9+hW229Ar2sD+OLFG/vnv5lZE5vAusQ0tmzAL5UGCa4RLXbpba1Qy0JhQ832aqDbXibpPrDdjMA2GHiapdz7lA8xGWnO5eH21wXQCZcOGZG0ew60kymimJ+5QoWHtqEN4XEUMgom2+SK11JT+sZ6UVk7aybqfA19znkArvX7GqRaZAOwqeahhwnsbRQumgsWZIplE34MzehhyKWbPjVd2a4KuoPK2sZtq2r6S9d/+ka58uSNZoP51Gc2pywwC+JVOEiHq+Q0HJH3jdwcgXAJ7LHdzJlvm9rg6jaCbXUnXG9Q9+0GZfCbsc2QW9J/BFTCVVjDTUAYlbyRfNB1BcC99itYqn62rNUDDcjaRJnrgkFiZxiZEGk6z+awjU7YDCRbhuQ8/r6PSIj0Xk2feFnw22tNl0jEj70aI4gVYsoA12IOSwiLq2ST2LW3JwW4Kr2y2PuKrS66gXij4XsUTDreYGIzsa5MMWexJ8p7D3RKumLejcUDFub7Fjf66vc2cCeV6nVwkVZM2rK61BYr15lMXUftY5+YpYuBQHoFlRmRzPeRFvB/tBusMeVThT2F+hGX0CBfQr2ik5HzXWXwrtjBpXS1JLo5EWICQuFdQCqxDTfMb1yozwECMiU+JDUERZDmc1K1eEFjhcSSA1wItnawudUEpPEcBbW65JrQ0FkHuDX2V6ZJLumLluf2XXPTV3PrURrmWicMkJZeKuNVDx4aSpJlkrSAJOlE39q7fDb3qqpDkVmhnu2cz5RHUM82JcEUfrCPnvAEvoMdXlmQGouLqz9efd9psZcXFRhrZ9MgZUF68Na0qBwx+21I+vAXbw/vBHXtvzeq6M6ehXpAK2mTXbfAj43rncgRRWZMAS0Ufq5rIvMKMmixpv0NEsWQXLW7k4Kr4UhziW45qLa9BXV99pUEuBGMG1bFbzlQ2OJg0wXHCjKjho5R3gSQzXZZAt8zQalCLBAM5lxnGM8pba+neHxWPCV2aUcNzNJ9icnJ0zb5MaeLElYWbAZF9ZiZAOzbC/nAgAcfdXR1KLJV5LbdYu6lE6YAKcICIZ0RBJKOtnfTJFEA2G8S34Nym4rXScPnFUSkCogVB4cByC7Be0iqA8tme2+5a1R9v11gEmzl5de/9r9P7/0L3/pw600XfQqBiIVGuOzFvhv6eqq5OA6JdMEBG+bIwfSplZz0xByWpROY2JNwKztpGueupIFIhfpkSN9myGt+D4HJAgGRdK0C6B76xMiKdGkk1S9RBzv83ajqErRX/G6CnvVSAWKk/GBrqfYwY8TpK0iUEqoVbqf5ux7EcEDV7r7QhE9Bfb59/ryp6Qby6Zd+9ef/QUqwtVeRG41oneyajtaRcD26xTkV/kqYuBAhQTS/q2lTgaup6HV16TWm3EAt9jP6l7ccWEx1aN7tzOlW6D4SlR4AEWSWoB8rpMzeTEqwGeQZLq6Y7RZqWCy/XChlNaZUtFv1+HpFJCKk1Ep9UwI9xOiSCIeNnTiFvc0AikjO/VxRHJDDSarXe4caqCCoYW97VAomTmMS1PeDmEqS1NaGi0uqNHC5rbZ1tez7cnY9cE2AG7hPtY52MrWG0QyEvxmkmk1eMQYoKhOsGJyCoQ62GEl99zOLjRpQMKvGmy0yNJkUq/o1UqSqc4Vfye7vBsTh+hT4vubfmoMqsHO7pDz2PghGxWfMyx9jWaxmu6QPC9VivKJwuE2RNuw+rqtbTjerdxWXV1P9EarSK9au9sP1CXE322q762B7w+6iYFH6tlavxkivQz9b951AqUoWbHWtL2xXWp96EcCVdtdKOXtsakRralTe3yPk7+BbLdnsIbw1fU/pcWpxKbI0IHs0SntgrT51v8AeW1ZXpcGG43vFG2O6Qw4pRptFFUmsBjyHLROfhMwyXR7p8onIIb3eI4xAWLgTxMHHNpPb5wHsnNsL2Z2NWo/n435o1ST9ow7yaCpIuqcRWsbu3VWzF054qDHcotiPuHKQKoILlOCqGpYmwUaoXjA1bStY9LuX56+n4MbO9Wefe+EHv/d9J+37jyIe6jFSdyMq7FH09uSNQTNjS90Su4Aw9XG43POrDECxH6+v65YO31P8u/TBXZXCJlIv5UksKOLm3uAssUX4S/p5PnccjLYPgfVub+6LPR+kMMGVBCoK+K34JyJR0Gh2LsqZ4OeGC0QDoBZPriBVEVMGqHYMFezbF1xyF1fRJrVKrKSBLMu1//jMv/u3L5JgMhmjp5rQnkx4/968+rv4Vn19m0qx1iyVHqWp3N0CB1u8USwR4bVOk0WsQt16lCr8X4tQIRzoBg5sOfhOFDJZxP/A4h/2Mg9xtq9SbO8+ND+2whZXNw8T2Dr5OyEKRlSk1MasQdEJOTk2JDWZmd8j80DooMIHqZU6dPvQOiG9UbmCzhZpP0YoUiKHnjVtGvQ5Q+IgskN7I1MCUEkU6OdTgqU+b0A3j+WpEdNpPPjYB//0s00Nfrrd7MUMipsmqb0URRAwT1Z5jkmn0xilAb5v4AougF87qskgLgFughxSTmOFSaht3MGgxgUkpgwuFKVN7FJNkL6o93ZJxXmB7Q6Jxm/ZNTJKJ0CM70ewIoByItWL4GxFWWtWvlTP/sQxww0q9SxtLpskO5DuGr3QwL+Vqjlizy24cfqfb/z7z9wRYFPT3/OnPtCa+54KRCsyIO4CVMpJ0nCug8uDmxHS7PXW0c4B5DB3WpKa/vLnHsrPae8DvASGqftqoaJrV8kAmtMG9nerhYQ5iDiuFSnBqBJds0NER6iQwkJDJ6hDyFa8yD8K4XKgXa4LbCxqxpGsZ9jaUM2c4dtucwnkyfzcdbC5ZncBsHaAun/y977xOxsJftHLKee5PNka53Nta/FR26p6trdyTsb6VhSf1zJKs0tfReM6Ml73bG1Bbnvt88WnV4DVpAwWYNQDQyLsO7WIYOpDM0JqK8dICGRb7GVc1UOhUec1VSNZPpe1E7FK3T9XUzG+Byp5BfeuZzBz5xXR2ZIRRrKAKDsDkaBQMLRHTSJltt7UcXWWTJHE3w/q2f1dzxAN4UcFdHH1LLC9SqxEnFXX/dnV83hO5098+Te/capkq939kRfW9fjq+Sn0BP/kOabeSJuFkx77BGfxx7RRz5GdIerRpR7XCJtXUz0HyaKRTI2qN6czgERJl9S8jrpf6gmLIbJEtV/rtoq6D7v2z+qQ0oOEliFJYnY0XKG6h73dZ1yZ4Q45iXIwJYhUukODOq6dNSubdpDXa9f/+9NfON/yt3297DTtrgrtT+ZaslZIidZO47Wzl69G/a6N95FQn+k3IKlI54iJN1/ULFsh5oJoJdmHYLOIJGE0YoxJNm8b/m5kj6wxGwHTAL0SLisQsEaOV/ggwTGWBNH5d0mwF//TUNhHg0sgo/XJWFh2LhfkdYhP103nIGTaYhvRKqtny3KbM+sgoZ49HHkro1bu+2qQ4xZR2N/2eRXEoKV+4bZY3u7kl3/zudP7vudbT1pDH4XNDUGpwRqDcMnoI8ngOqVjBKYqnVh1rmo2WkbXRLx7QBlAfVsLevQI4I4SSam+sY9G9YqMNc8lQQr3BlNPlBzAXtEFa1+lb6mOowZctZodHTI+kdYMIsU5rAeSG0RKP1sjduzqWIH0igzPDrnUOls20mXquTHm5XkHWZyINZV+/SvP/srV22F5xxdEN3N1deZyojZ3Z/ZY/JXl6v5USHGNeJZHsrxATlDdBpWeEuC1U9VKOgclrrMLIORYKIIbLv1sRcrV44F84KpRG09Lcdv+pEkFy6POLr3mz8wWydJqTbXfhfsb2uyzSELIhEjWQlGe6x2wdGmN2Dd6bTclRH2GoCgfIlSYiudvk6CNanzx401HQEmxeKSqZEgSIFcHsi6ursVcIU0H7u1ztdeVl6t3wnG60wdqi+/73m89abtH+TDUfcGwy+Oxa+khEIK4cKjtbmep/1EZJRq+Ig0gp1uE4oLR/g4qMNhwMOGNm5IsOuzr4r9VoSIzSBHuTTDlPjQ2JHRUr+HaFNhdzjztOkjr0t0dFMcxxTHU63oG+wqJNMl9PklUECvzd9eQ3Fvk1an12i8/++ufvxOOL/2K9x1dbf38ZNahFDsil2YPWvhs5B4WdCa9YlCXg2XVE4zgOkdCgigGTYU6t7Yprl6NeU6CyVSQVsNoRZ4utM7a9ucuCSKzPUKZD1zdFrztlJBzbp97DTde1BWvk7egCuwxe0w8S28l9rtvzxgFkaMKQ4ohuRl4qX3kZJqNCGoQBuWJu0cUZa4VQ3s0UZBhSeR0pUu2gE1biY6uNrDVOt7Vl4JweqkPv/zVb5z+0Pe977jtfjDOwX2EdFIPcATtCPeBzgU7cI07VpzSLAg+uGtF+ByhSMS7kwDQ6NsOjLYOsV1T4f4dPkbWJdCrbXtlYvq8smwCEXkMCR1rkMtYQoRxQDzEjMOPLUP5akqvdKbMGYK8BX/3Vh6zZ4N6bBlbAeESsnJY7yBcr/2X/3HjCy+F4UtLsDbtND8y1+WkCeShlmBGdMvHwEZpzTq4TmwfqvSGHXMp15l7nEN7nyg2ZMVqq9jTbV7i5aG8CSSqFvcRbTjqfMEbd/KRvVomRBO2ZQ87vPO4rqYU62yD1iiK8E2C2X1kE8WJ4v2JkU40my2dNveiAspcMyMuPZqWQsHsw52S1DScpTfVy20y9rxkKpCjhq2GJLsEW3WqSWwM4lus3ZpqPp3KdPXl8Jte7oIvf/W5m/d96P232rPdv3kmuDOpys5L8vYQZyCxIztGJwj2TCHRFF8aejKCHT36FPNx+UDx3rgx44ATmS6lBSrT7KZph4VotK8UNnMo+qsxKmMIJUo/56FEL1cdiwopqy18vyCXK5HiAwOW5ZtmUwURKYE7JCa5uEYGkG1Avbmpj/zyb/3GdXqZhekVLo/+zQ8/fXZWT3Re5LPGbve3FjrTfTtuiuNspVuLz4d8tqxt1YrDSvEGmj5buSnPpFMmTWb3ZpP+afL3EOvoh9KksOBt4sacWe2tntvZrAGWKtTt5K+Ut7FQYNFW0qPnrVxnxufuFxNeqGlJf2wp3suYpgbGBcUA0UmdVffY9siWezx7TTPCGLNbbAKahXxEyB7M2TtJXb361OqtDHgdp+VS7lILLQUvou1f+5Xf/dqnXgluL6uiY1l5+lTLDT/Tfu3QZKgWqGRyF6lGqg/uEiGuvCIKZe0gqf64djUo+EzHK60qIRxJdbFxSSZ9NuVNA6z1oDrB5pUYLTGbq2RBjgnnIg/NXq1pBXorgFxBusrkFZwgXZwJEcr0pb5gI1Ofw1CZjHfTkC6sqKkKBm8jJV1F1yxWRzzawNSKlwhPLqmm/b5rqnLYW9dYVE9bW7+sao7lZVV0LKqqf+gj3/b19muXwq+NLDhTHMMQE+JAY7wxgM36q8EXxmVjLphS/Uc9U+Rl18FlQj1TujZRCQF/M2wd95KYrK9GXbFHk7oNZNhIs42Lq8ZwdYr02m6KhICc9eNBNScTxtb82ubuiPRyG48p+7WqmqXi2KpTAXSwZRviaBUhD/za6ddu0N0GWJcvffW5G/d9+P3vbX3/nk2R2vmqB8AVg7QimbDJAuVnmxgY9c4R6g8r3JCYYSAJjakzgW/b1WPUNEVgwccwI7gvo12FhEgfwJUgR/DBit9umcTZqIJ1YMUagEDQwUAEM/YI1AuDi/OCqWILViy3hg7RghggVAFsgKrP4OlMB7h19qu/dvo71+hVLK/YBo/Lo3/jI8+s63qs7zTYN990f6bvK3B7rHb3bL+6nW5ZI933dxUIJtbsIwmM3qwxZpY84pRhDNRtScHbTSekFKdcixXf4XMbA7WjmDHAzhUfG5WvtIUdjinrbURi8dGMNFSZEFKXuh+vMKAYiyUZxsnOGpku1zRepeFzjtTMHFUETSgTEhgBot+7hkrG5yiacErqY8TaP0/+6u/+zgP0KpdXbIPHZS3lgfbYT88tVi2plsUbGwy5NwJTTM+kocfI8TKGptqMSUQozY1hbmHX3Re2McDsgQxmn03Ghqwuq5O0Woyc+RwgBbZ5ovGt5P7CzIJJT/3N5exjSTcdKwsAEWDz9GIMVcW+zdbH5BO2eTQt/ffay2AFRCtH5UuvvzLwbeI4MkJFEjPnwD8Pr8HDuKcXKr0iUnV+eU0SrMvPfPL4aKrrM01iD228jUosJHmvLNq2zqj3YNT+JpMV43gkZ3CrHtuxZ19hw0OqifugtMgGlSmYt4OmYNmAcpXFgnjzFAAPWgDXc8Sm83uDKTP11/gROmrflzQZRMGeE1jp8Wf/Oy+uy3IdTB6X47comDbW4BRRhGBZM+tUpxeE7r1+enpKr2F5zQDr8uiPf+iYlulpB3nFq2VcTftWTEUvpsqrDejax+tmVF03ycx5oqxy0xmtvzKGMpBCSMp7yo87SHCzQu1yHEMlx4urfbjKjM9jNCNBVZeUWjsV0jxG5CgKEurw9J0AUoRhq0fRag312vPMMvjthCBOlAVRlArZ71UMgbU4wc0LF/kvXn/2tYGry6siWeeXL/3GHz5334ff9/WWlblEcCV08YnVgl3jHNHmnEMGdQ2nqmQjx99EMGQshwPhwnGPcYc0hKsGOxf2ECPjBXYuhoi4W+MxYUn3BWNvaydhdTlLVh4rgYQFSdNzFfFkc4FA1uwcSFPY3bgHY8cGKhmwBYkPm95qx/f+8tdOn6XXsbwugHX50le/ceOHPvptv9/k4pIBZhoubHDYX07ba/N+AOCCgdsdaP/bfm0ZQIdRNCCDjSNWHSWs8FVDdYba68NEYogm/NEcQYAOYTMU7JOB92GwrlIFIUcPQgBsECL/u32SJ6FQw0uSqiBP3glRPYICBlfH1aeNaJJLc7n3V37r9BW7Q3daXjfAunzpN55zkEVO2uHFICM0SKwpvnjnAcZ5MA9zYzAnzVFgphzSEHakdrcLESbOwFPUZVAmLZzJ1iGcuqIjYO4Llgw61EGaQ316pwgJHyR3kESbRCakFd8xao8RWL9/1y4OopNFn2it5uQ3c5PcOt0dcIlepw0+v6hN5nV6utlWJ157H+xsWyNZeAWcDYKG6xTv9sM5t8mSIc5x4jBL3+K2K/xvyaQH9THCaZ8x1yX7iIaYSC3suHce72mM3PWYs87kAvcsWPjmm6AM9QhXsAe7FB0pw5skkdOw/YLyNB/FaYPtT9s9PnD9LoHrLXWXl8cau26W6Om6rEc2Gn4f7/qreBcggLQY9ur7i+C1q9LnSdZabB3yjGEzlq4XH0aTb/wWAtCRAYp4MmIjlguOJ406Kx5mzJMeqCEQLO8J5IPLUi90oCOixh3sJNrQJMRR9RFFCzGDr5+3KGmaqZg6o5w2b+/e10OobrfcFRU9Lr/YQpo/8n0feKo9yUl7mPd7TBeztUIthwqP6RPzgWGj/aH9TSlhh4OMKUg63YRBFDadKG21M1ceVDdseiYHIGUDKeMY/UddpYeUJRmi7sb49278VLDgXj/mpihUMUDOqTFcarV4wseA8fU/ccb3/sJvnz5Hd3m56xI8Lv/kkx+50lrhcjXJXW3WGo182UTXKr02zaJL9R4q3I51yl1zoQRv+ZLhZRTsc14QpwSvmCHeI04l1bgg+JJxmIhWYcoHkTs0BYRzVNF93LGk9xRs34r/+lAK7Et25phknVkoZxQE0G336i89+z+v0Bu03HUJHpf/9NWvX//hRr7awx7rhKddPfk0CiGFKeVhiwjXFc75uko0FAsIiUtxXD/h75lH6e+kLF5qFcTOlwrpxz6+20pwCmXAwffx+RTXEqRUNvdmc42xj4QEafJ3QajEtuCLzlqkRYy7iU/blQ/84rO/f43ewOUNBViXX2oM+0c+/G1PtVZ7L0/lOCyhqd7SwQ3wpzifM/wQxYSpBh5zlwJk/2zyNj431yaYe0y0Gh2GpIOac2OnpLmEqgng4bMC0lQGiZxgO6MjKXCTzTdGubr69e1uVwzog4NJj588+Cb/8H/47dfn476S5Q1V0eeXf/bjH35oXflyiy0f2VRE65rvt1c17W/L9u24b8w6XlaxShbj91nRCVMWEcU7Hcy6IpZckXuWgYAFC7YCe46COzDuiKUHe06CxIN6BjGTrim8k45vLC3JL4w3NP+2Bc8+9eSN0yfpTVreVIB1UZa9cL1SV3nQgAKwNQGtAN3Zdmzd1gbY1So7Lbyp51fKkRZGi9ao9KRk2z6E1UHyV9oS9Toy33G7vAXXGykGzQXb7mtcW0AIQ1O4qejTYLT7+3wLiV9p4N6kN3F50wGOxYCm9YkWTzhxgH1isjW3BLD9xYt5XId3Ca21vygZ2/CVYxKZ8JGNI0cddynDRGmUgdCsNgm/FShGI2UAx6PiGWzhwYw4l+gmpH3z9Ul2j/ybG79113zbV7O8ZQDH8uiPHz9U1nq5AXdkPi7Us20HwP1t15LAxrEl5NaYMR0zAtU+M1CMa45Jyawwvw4JISIaotx3CG74EpOrhYuXKjm3wQssFn+9pSOv/utf/+3r9BYubznAsfzTT37fScscXW6Nf2Lu0FIhkQPQeE9u2GibOX2U6AFcf3lUV9uplmNQO21tsQtvwaRqw41xJFFGaS2DCxQxc3SABmy7+Oq1X3trgY3lbQNwLJpnnqleabHgjzef96hidoHYrkvMHdLXmArfknM4FoBt46YEM6hTl2gSopgtJ/Hk/AfHvNktQ5CmS6zN4HOzkejPl4P52s+3UBS9jZa3HcDj8ugnP/xQQ+FHG3iX6jpMzAYmbS+KMimmnDCmYuLPUMsdaMSfxKs+dfEKnDGqzFtQ9Z/ieyUJVUTh6KYUviGrXP35//r2kNbbLW9rgGO5cun48F0H60kD7lJr2483YI98jPIAKFGq65idL9Vxuk3SkxNESBroAsaMqYjtHIfr05lz+/dmCz1+oUXYnpxpufH49TeXEb+W5R0B8PlFs1Yt/XpcpJw0YD7a8DuOV79F1kkg2V42M9hciOs4iQwRbdyjWNqpxnxZ2e9X9hNdf/wX3l7q95Us70iAb7c8+tc/dLzUctQCD8eV6yFL+Y4G4mFD8VDHVek1FcUCIn3ccts9bTb0tNntP2aeT1ti4ebBAV2/8uQ7D8zbLf8PId13OkxFIl4AAAAASUVORK5CYII="})]})]});var n7={[_chunkXKAIXCX7js.X.id]:n1,[_chunkXKAIXCX7js.Z.id]:i1,[_chunkXKAIXCX7js.$.id]:l1,[_chunkXKAIXCX7js.ba.id]:d1,[_chunkXKAIXCX7js.ca.id]:u1,[_chunkXKAIXCX7js.da.id]:m1,[_chunkXKAIXCX7js.ea.id]:f1,[_chunkXKAIXCX7js.ga.id]:y1,[_chunkXKAIXCX7js.ja.id]:C1},Ri=({chainId:e,...t})=>{let r=n7[e];return r?_jsxruntime.jsx.call(void 0, r,{...t}):_jsxruntime.jsx.call(void 0, _GlobeAltIcon2.default,{...t})};var E1=({balance:e,className:t,chain:r})=>_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.U,{className:t,$state:void 0,children:_jsxruntime.jsx.call(void 0, ed,{balance:e,chain:r})}),ed=({balance:e,chain:t})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, a7,{children:[_jsxruntime.jsx.call(void 0, i7,{chainId:t.id}),_jsxruntime.jsx.call(void 0, ct,{children:t.name})]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.N,{isLoading:!1,isPulsing:!1,color:"gray",children:e})]}),a7=_styledcomponents2.default.div`
1535
+ display: flex;
1536
+ align-items: center;
1537
+ `,i7=_styledcomponents2.default.call(void 0, Ri)`
1538
+ height: 1.25rem;
1539
+ width: 1.25rem;
1540
+ display: inline-block;
1541
+ margin-right: 0.5rem;
1542
+ border-radius: 4px;
1543
+ `;var _react3 = require('@headlessui/react');var S1=({options:e,onSelect:t,selected:r,className:o})=>_jsxruntime.jsxs.call(void 0, _react3.Menu,{as:c7,children:[_jsxruntime.jsxs.call(void 0, _react3.Menu.Button,{as:u7,children:[_jsxruntime.jsx.call(void 0, ed,{balance:r.balance,chain:r.chain}),_jsxruntime.jsx.call(void 0, yu,{height:16})]}),_jsxruntime.jsx.call(void 0, _react3.Menu.Items,{as:d7,className:o,anchor:"bottom",children:e.map((n,a)=>_jsxruntime.jsx.call(void 0, _react3.Menu.Item,{as:p7,onClick:()=>t(a),children:_jsxruntime.jsx.call(void 0, ed,{balance:n.balance,chain:n.chain})},a))})]}),c7=_styledcomponents2.default.div`
1544
+ width: 100%;
1545
+ position: relative;
1546
+ `,d7=_styledcomponents2.default.div`
1547
+ width: 100%;
1548
+ margin-top: 0.5rem;
1549
+ position: absolute;
1550
+ background-color: var(--privy-color-background);
1551
+ border-radius: var(--privy-border-radius-md);
1552
+ overflow: hidden;
1553
+ box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
1554
+
1555
+ && {
1556
+ border: solid 1px var(--privy-color-foreground-4);
1557
+ }
1558
+
1559
+ z-index: 1;
1560
+ `,p7=_styledcomponents2.default.button`
1561
+ width: 100%;
1562
+ display: flex;
1563
+ justify-content: space-between;
1564
+
1565
+ && {
1566
+ padding: 1rem;
1567
+ }
1568
+
1569
+ :not(:last-child) {
1570
+ border-bottom: solid 1px var(--privy-color-foreground-4);
1571
+ }
1572
+
1573
+ :hover {
1574
+ background: var(--privy-color-background-2);
1575
+ }
1576
+ `,yu=_styledcomponents2.default.call(void 0, _outline.ChevronDownIcon)`
1577
+ height: 1rem;
1578
+ margin-left: 0.5rem;
1579
+ `,u7=_styledcomponents2.default.button`
1580
+ ${_chunkLEABMTNMjs.T}
1581
+
1582
+ /* Push the chip all the way to the right */
1583
+ span {
1584
+ margin-left: auto;
1585
+ }
1586
+
1587
+ ${yu} {
1588
+ transition: rotate 100ms ease-in;
1589
+ }
1590
+
1591
+ &[aria-expanded='true'] {
1592
+ ${yu} {
1593
+ rotate: -180deg;
1594
+ }
1595
+ }
1596
+ `;var _ClockIcon = require('@heroicons/react/24/outline/ClockIcon'); var _ClockIcon2 = _interopRequireDefault(_ClockIcon);var _TrashIcon = require('@heroicons/react/24/outline/TrashIcon'); var _TrashIcon2 = _interopRequireDefault(_TrashIcon);var _CheckBadgeIcon = require('@heroicons/react/24/solid/CheckBadgeIcon'); var _CheckBadgeIcon2 = _interopRequireDefault(_CheckBadgeIcon);var va=({style:e,...t})=>_jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, "path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})});var wa=({style:e,...t})=>_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsxs.call(void 0, "g",{clipPath:"url(#clip0_113_33841)",children:[_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"})]}),_jsxruntime.jsx.call(void 0, "defs",{children:_jsxruntime.jsx.call(void 0, "clipPath",{id:"clip0_113_33841",children:_jsxruntime.jsx.call(void 0, "rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});var x1=({passkeys:e,expanded:t,onUnlink:r,onExpand:o})=>{let[n,a]=_react.useState.call(void 0, []),i=t?e.length:2,s=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",c=async d=>{a(u=>u.concat([d])),await r(d),a(u=>u.filter(f=>f!==d))};return _jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, S7,{children:"Your passkeys"}),_jsxruntime.jsxs.call(void 0, M1,{children:[e.slice(0,i).map(d=>_jsxruntime.jsxs.call(void 0, x7,{children:[_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, P7,{children:s(d)}),_jsxruntime.jsxs.call(void 0, A7,{children:["Last used: ",(_nullishCoalesce(d.latestVerifiedAt, () => (d.verifiedAt))).toLocaleString()]})]}),_jsxruntime.jsx.call(void 0, R7,{disabled:n.includes(d.credentialId),onClick:()=>c(d.credentialId),children:n.includes(d.credentialId)?_jsxruntime.jsx.call(void 0, Ao,{}):_jsxruntime.jsx.call(void 0, _TrashIcon2.default,{height:"1.6em"})})]},d.credentialId)),e.length>2&&!t&&_jsxruntime.jsx.call(void 0, Cu,{onClick:o,children:"View all"})]})]})},v7=()=>_jsxruntime.jsxs.call(void 0, M1,{children:[_jsxruntime.jsxs.call(void 0, mr,{children:[_jsxruntime.jsx.call(void 0, ur,{children:_jsxruntime.jsx.call(void 0, _CheckBadgeIcon2.default,{})}),"Log in with Touch ID, Face ID, or a security key."]}),_jsxruntime.jsxs.call(void 0, mr,{children:[_jsxruntime.jsx.call(void 0, ur,{children:_jsxruntime.jsx.call(void 0, _LockClosedIcon2.default,{})}),"More secure than a password."]}),_jsxruntime.jsxs.call(void 0, mr,{children:[_jsxruntime.jsx.call(void 0, ur,{children:_jsxruntime.jsx.call(void 0, _ClockIcon2.default,{})}),"Takes seconds to set up and use."]})]}),_1=()=>{let{user:e,unlinkPasskey:t}=_chunkXKAIXCX7js.ta.call(void 0, ),{linkWithPasskey:r,closePrivyModal:o}=_chunkXKAIXCX7js.ra.call(void 0, ),n=_optionalChain([e, 'optionalAccess', _503 => _503.linkedAccounts, 'access', _504 => _504.filter, 'call', _505 => _505(v=>v.type==="passkey")]),[a,i]=_react.useState.call(void 0, !1),[s,c]=_react.useState.call(void 0, ""),[d,u]=_react.useState.call(void 0, !1),[f,h]=_react.useState.call(void 0, !1);_react.useEffect.call(void 0, ()=>{n.length===0&&h(!1)},[n.length]);let g=()=>{i(!0),r().then(()=>u(!0)).catch(v=>{if(v instanceof _chunkXKAIXCX7js.e){if(v.privyErrorCode==="cannot_link_more_of_type"){c("Cannot link more passkeys to account.");return}else if(v.privyErrorCode==="passkey_not_allowed"){c("Passkey request timed out or rejected by user.");return}}c("Unknown error occurred.")}).finally(()=>{i(!1)})},w=async v=>(i(!0),await t(v).then(()=>u(!0)).catch(E=>{if(E instanceof _chunkXKAIXCX7js.e&&E.privyErrorCode==="missing_or_invalid_mfa"){c("Cannot unlink a passkey enrolled in MFA");return}c("Unknown error occurred.")}).finally(()=>{i(!1)}));return d?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:()=>o()},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsx.call(void 0, ot,{status:"success",children:_jsxruntime.jsx.call(void 0, _CheckCircleIcon2.default,{})})}),_jsxruntime.jsx.call(void 0, k1,{children:"Passkey added"}),_jsxruntime.jsx.call(void 0, E7,{children:"From now on, you can use your passkey to log in."}),_jsxruntime.jsx.call(void 0, Bt,{children:_jsxruntime.jsx.call(void 0, U,{onClick:()=>o(),children:"Done"})}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]}):f?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:()=>h(!1),onClose:()=>o()},"header"),_jsxruntime.jsx.call(void 0, x1,{passkeys:n,expanded:f,onUnlink:w,onExpand:()=>h(!0)}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:()=>o()},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsxs.call(void 0, rd,{children:[_jsxruntime.jsx.call(void 0, va,{}),_jsxruntime.jsx.call(void 0, wa,{})]})}),_jsxruntime.jsx.call(void 0, k1,{children:"Secure your account with a passkey"}),_jsxruntime.jsx.call(void 0, T7,{}),n.length===0?_jsxruntime.jsx.call(void 0, v7,{}):_jsxruntime.jsx.call(void 0, x1,{passkeys:n,expanded:f,onUnlink:w,onExpand:()=>h(!0)}),_jsxruntime.jsxs.call(void 0, Bt,{style:{marginTop:"12px"},children:[s&&_jsxruntime.jsx.call(void 0, w7,{fail:!0,children:s}),_jsxruntime.jsx.call(void 0, U,{onClick:g,loading:a,children:"Add new passkey"})]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]})},rd=_styledcomponents2.default.div`
1597
+ display: flex;
1598
+ align-items: center;
1599
+ justify-content: center;
1600
+ width: 180px;
1601
+ height: 90px;
1602
+ border-radius: 50%;
1603
+ svg + svg {
1604
+ margin-left: 12px;
1605
+ }
1606
+ > svg {
1607
+ z-index: 2;
1608
+ color: var(--privy-color-accent) !important;
1609
+ stroke: var(--privy-color-accent) !important;
1610
+ fill: var(--privy-color-accent) !important;
1611
+ }
1612
+ `,w7=_styledcomponents2.default.div`
1613
+ line-height: 20px;
1614
+ height: 20px;
1615
+ font-size: 13px;
1616
+ color: ${e=>e.success?"var(--privy-color-success)":e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
1617
+ display: flex;
1618
+ justify-content: flex-beginngin;
1619
+ width: 100%;
1620
+ `,b7=_styledcomponents.css`
1621
+ && {
1622
+ width: 100%;
1623
+ font-size: 0.875rem;
1624
+ line-height: 1rem;
1625
+
1626
+ /* Tablet and Up */
1627
+ @media (min-width: 440px) {
1628
+ font-size: 14px;
1629
+ }
1630
+
1631
+ display: flex;
1632
+ gap: 12px;
1633
+ justify-content: center;
1634
+
1635
+ padding: 6px 8px;
1636
+ background-color: var(--privy-color-background);
1637
+ transition: background-color 200ms ease;
1638
+ color: var(--privy-color-accent) !important;
1639
+
1640
+ :focus {
1641
+ outline: none;
1642
+ box-shadow: none;
1643
+ }
1644
+ }
1645
+ `,Cu=_styledcomponents2.default.button`
1646
+ ${b7}
1647
+ `,M1=_styledcomponents2.default.div`
1648
+ display: flex;
1649
+ flex-direction: column;
1650
+ align-items: stretch;
1651
+ gap: 0.8rem;
1652
+ padding: 0.5rem 0rem 0rem;
1653
+ flex-grow: 1;
1654
+ width: 100%;
1655
+ `,k1=_styledcomponents2.default.div`
1656
+ font-size: 18px;
1657
+ line-height: 18px;
1658
+ text-align: center;
1659
+ font-weight: 600;
1660
+ `,E7=_styledcomponents2.default.div`
1661
+ font-size: 0.875rem;
1662
+ text-align: center;
1663
+ margin-top: 10px;
1664
+ `,T7=_styledcomponents2.default.div`
1665
+ height: 32px;
1666
+ `,S7=_styledcomponents2.default.div`
1667
+ line-height: 20px;
1668
+ height: 20px;
1669
+ font-size: 1em;
1670
+ font-weight: 450;
1671
+ display: flex;
1672
+ justify-content: flex-beginning;
1673
+ width: 100%;
1674
+ `,P7=_styledcomponents2.default.div`
1675
+ font-size: 1em;
1676
+ line-height: 1.3em;
1677
+ font-weight: 500;
1678
+ color: var(--privy-color-foreground-2);
1679
+ padding: 0.2em 0;
1680
+ `,A7=_styledcomponents2.default.div`
1681
+ font-size: 0.875rem;
1682
+ line-height: 1rem;
1683
+ color: #64668b;
1684
+ padding: 0.2em 0;
1685
+ `,x7=_styledcomponents2.default.div`
1686
+ display: flex;
1687
+ align-items: center;
1688
+ justify-content: space-between;
1689
+ padding: 1em;
1690
+ gap: 10px;
1691
+ font-size: 0.875rem;
1692
+ line-height: 1rem;
1693
+ text-align: left;
1694
+ border-radius: 8px;
1695
+ border: 1px solid #e2e3f0 !important;
1696
+ width: 100%;
1697
+ height: 5em;
1698
+ `,k7=_styledcomponents.css`
1699
+ :focus,
1700
+ :hover,
1701
+ :active {
1702
+ outline: none;
1703
+ }
1704
+ display: flex;
1705
+ width: 2em;
1706
+ height: 2em;
1707
+ justify-content: center;
1708
+ align-items: center;
1709
+ svg {
1710
+ color: var(--privy-color-error);
1711
+ }
1712
+ svg:hover {
1713
+ color: var(--privy-color-foreground-3);
1714
+ }
1715
+ `,R7=_styledcomponents2.default.button`
1716
+ ${k7}
1717
+ `;var I1=_styledcomponents2.default.div`
1718
+ display: flex;
1719
+ flex-direction: column;
1720
+ gap: 12px;
1721
+ padding-top: 24px;
1722
+ padding-bottom: 24px;
1723
+ `,od=_styledcomponents2.default.div`
1724
+ width: 24px;
1725
+ height: 24px;
1726
+ display: flex;
1727
+ justify-content: center;
1728
+ align-items: center;
1729
+
1730
+ svg {
1731
+ border-radius: var(--privy-border-radius-sm);
1732
+ }
1733
+ `,_i=_styledcomponents2.default.div`
1734
+ display: flex;
1735
+ flex-direction: column;
1736
+ justify-content: center;
1737
+ align-items: center;
1738
+ gap: 8px;
1739
+ `,Mi=_styledcomponents2.default.div`
1740
+ display: flex;
1741
+ align-items: baseline;
1742
+ gap: 4px;
1743
+ `,nd=_styledcomponents2.default.div`
1744
+ font-size: 42px !important;
1745
+ `,W1=_styledcomponents2.default.input`
1746
+ font-size: 42px !important;
1747
+ text-align: right;
1748
+ background-color: var(--privy-color-background);
1749
+
1750
+ // HACK: The only way this is centerable is to set a content-based width.
1751
+ // The --funding-input-length is updated via the component.
1752
+ // Note that 'ch' has 98.25% global browser adoption
1753
+ width: calc(1ch * var(--funding-input-length));
1754
+
1755
+ &:focus {
1756
+ outline: none !important;
1757
+ border: none !important;
1758
+ box-shadow: none !important;
1759
+ }
1760
+ `,L1=_styledcomponents2.default.div`
1761
+ cursor: pointer;
1762
+ padding-left: 4px;
1763
+ `,Ii=_styledcomponents2.default.div`
1764
+ font-size: 18px;
1765
+ `,Wi=_styledcomponents2.default.div`
1766
+ font-size: 12px;
1767
+ color: var(--privy-color-foreground-3);
1768
+ // we need this container to maintain a static height if there's no content
1769
+ height: 20px;
1770
+ `,O1=_styledcomponents2.default.div`
1771
+ display: flex;
1772
+ flex-direction: row;
1773
+ line-height: 22px;
1774
+ font-size: 16px;
1775
+ text-align: center;
1776
+ svg {
1777
+ margin-right: 6px;
1778
+ margin: auto;
1779
+ }
1780
+ `,N1=_styledcomponents2.default.call(void 0, Cu)`
1781
+ margin-top: 16px;
1782
+ `,M7=_styledcomponents.keyframes`
1783
+ from {
1784
+ opacity: 0;
1785
+ }
1786
+ to {
1787
+ opacity: 1;
1788
+ }
1789
+ `,D1=_styledcomponents2.default.call(void 0, fn)`
1790
+ border-radius: var(--privy-border-radius-md) !important;
1791
+ animation: ${M7} 0.3s ease-in-out;
1792
+ `;var U1=({displayName:e,errorMessage:t,configuredFundingChain:r,formattedBalance:o,fundingAmount:n,fundingCurrency:a,fundingAmountInUsd:i,options:s,selectedOption:c,isPreparing:d,isSubmitting:u,onSubmit:f,onSelect:h})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, Gt,{}),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsx.call(void 0, uo,{children:"Transfer from another network"}),_jsxruntime.jsxs.call(void 0, Kr,{children:["You need more funds on the ",r.name," network. Bridge from another blockchain network."]}),_jsxruntime.jsxs.call(void 0, _i,{style:{marginTop:"2rem"},children:[_jsxruntime.jsxs.call(void 0, Mi,{children:[_jsxruntime.jsx.call(void 0, nd,{children:n}),_jsxruntime.jsx.call(void 0, Ii,{children:a})]}),i&&_jsxruntime.jsx.call(void 0, Wi,{children:i})]}),_jsxruntime.jsx.call(void 0, nt,{style:{marginTop:"1.5rem"},children:_jsxruntime.jsx.call(void 0, at,{children:"From"})}),_jsxruntime.jsx.call(void 0, S1,{selected:{chain:c.chain,balance:_chunkLEABMTNMjs.Z.call(void 0, c.balance,c.chain.nativeCurrency.symbol,3,!0)},options:s.map(({chain:g,balance:w})=>({chain:g,balance:_chunkLEABMTNMjs.Z.call(void 0, w,g.nativeCurrency.symbol,3,!0)})),onSelect:h}),_jsxruntime.jsx.call(void 0, nt,{children:_jsxruntime.jsx.call(void 0, at,{style:{marginTop:"1.5rem"},children:"To"})}),_jsxruntime.jsx.call(void 0, E1,{chain:r,balance:o}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.S,{style:{marginTop:"1rem"},children:t}),_jsxruntime.jsxs.call(void 0, sa,{style:{marginTop:"1rem"},loading:u||d,disabled:d||u,onClick:f,children:["Confirm with ",e]}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]});var F1=({wallet:e,displayName:t,addressToFund:r,chain:o,isBridging:n,isErc20Flow:a,totalPriceInNativeCurrency:i,totalPriceInUsd:s,gasPriceInNativeCurrency:c,gasPriceInUsd:d})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, Gt,{}),_jsxruntime.jsx.call(void 0, Ai,{}),_jsxruntime.jsx.call(void 0, Mt,{style:{marginTop:"16px"},children:_jsxruntime.jsx.call(void 0, Pc,{icon:xc(e.walletClientType,e.connectorType,e.walletClientType),name:e.walletClientType})}),_jsxruntime.jsx.call(void 0, Ce,{style:{marginTop:"8px",marginBottom:"12px"},title:`${n?"Bridging":"Confirming"} with ${t}`}),!n&&!a&&_jsxruntime.jsxs.call(void 0, xi,{children:[_jsxruntime.jsxs.call(void 0, nt,{children:[_jsxruntime.jsx.call(void 0, at,{children:"Total"}),_jsxruntime.jsx.call(void 0, ct,{children:s||i})]}),_jsxruntime.jsxs.call(void 0, nt,{children:[_jsxruntime.jsx.call(void 0, at,{children:"To"}),_jsxruntime.jsx.call(void 0, ct,{children:_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.Q,{address:r,showCopyIcon:!1})})]}),_jsxruntime.jsxs.call(void 0, nt,{children:[_jsxruntime.jsx.call(void 0, at,{children:"Network"}),_jsxruntime.jsx.call(void 0, ct,{children:_jsxruntime.jsxs.call(void 0, L7,{children:[_jsxruntime.jsx.call(void 0, Ri,{chainId:o.id,height:16,width:16})," ",o.name]})})]}),c&&_jsxruntime.jsxs.call(void 0, nt,{children:[_jsxruntime.jsx.call(void 0, at,{children:"Estimated fee"}),_jsxruntime.jsx.call(void 0, ct,{children:d||c})]})]}),_jsxruntime.jsx.call(void 0, ci,{height:24}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]}),L7=_styledcomponents2.default.div`
1793
+ display: flex;
1794
+ flex-direction: row;
1795
+ align-items: center;
1796
+ gap: 4px;
1797
+ `;var G1=()=>{let{rpcConfig:e,appId:t,closePrivyModal:r,createAnalyticsEvent:o}=_chunkXKAIXCX7js.ra.call(void 0, ),{navigate:n,setModalData:a,app:i,data:s}=_chunk3AGMJGHJjs.b.call(void 0, ),{wallets:c}=_chunkXKAIXCX7js.va.call(void 0, ),[d,u]=_react.useState.call(void 0, !1),[f,h]=_react.useState.call(void 0, 0n),[g,w]=_react.useState.call(void 0, !1),[v,E]=_react.useState.call(void 0, null),[_,A]=_react.useState.call(void 0, null),[T,P]=_react.useState.call(void 0, []),[S,R]=_react.useState.call(void 0, 0),[D,F]=_react.useState.call(void 0, !1),[B,K]=_react.useState.call(void 0, !1),[W,X]=_react.useState.call(void 0, !1),[L,Q]=_react.useState.call(void 0, !1),{erc20ContractInfo:xe,erc20Address:he,address:$,chain:Y,amount:ke}=s.funding;_react.useEffect.call(void 0, ()=>{he&&!xe&&E(new Error("Unable to fetch token details"))},[]);let ye=!!he&&!!xe,te=ye?BigInt(parseFloat(ke)*10**xe.decimals):_viem.parseEther.call(void 0, ke),se=c[0],[Ge,Qe]=_react.useState.call(void 0, null);_react.useEffect.call(void 0, ()=>{(async()=>{if(!se)return;let Pt=await se.getEthereumProvider(),Yt=_viem.createWalletClient.call(void 0, {account:se.address,transport:_viem.custom.call(void 0, Pt)}).extend(_viem.publicActions);Qe(Yt)})().catch(console.error)},[se]);let[ce,pt]=_react.useState.call(void 0, 0n);_react.useEffect.call(void 0, ()=>{_viem.createPublicClient.call(void 0, {chain:Y,transport:_viem.http.call(void 0, _chunkLEABMTNMjs.r.call(void 0, Y,e,t))}).getBalance({address:$}).then(pt).catch(console.error)},[]);let[or,wt]=_react.useState.call(void 0, 0n);_react.useEffect.call(void 0, ()=>{ye&&r1({chain:Y,address:$,appId:t,rpcConfig:e,erc20Address:he}).then(_e=>wt(_e.balance)).catch(console.error)},[]);let{tokenPrice:Ee}=Lo({chainId:Y.id}),[ue,M]=_react.useState.call(void 0, {to:$,chain:Y,value:te,data:void 0});_react.useEffect.call(void 0, ()=>{(async()=>{if(!Ge||!se||D||W)return;F(!0);let Pt,Yt=_viem.createPublicClient.call(void 0, {chain:ue.chain,transport:_viem.http.call(void 0, _chunkLEABMTNMjs.r.call(void 0, ue.chain,e,t))});if(ye&&!ue.data){if(!await Yt.simulateContract({address:he,chain:ue.chain,abi:Is,functionName:"transfer",args:[$,te],account:se.address}).catch(Le=>{console.warn("Simulated token transfer failed with error, fetching bridge options.",Le)})){F(!1),w(!0);return}F(!1),M({to:he,chain:ue.chain,data:_viem.encodeFunctionData.call(void 0, {abi:Is,functionName:"transfer",args:[$,te]}),value:"0x0"});return}try{Pt=await Yt.prepareTransactionRequest({account:se.address,to:ue.to,chain:ue.chain,data:ue.data,value:BigInt(_nullishCoalesce(ue.value, () => (0)))})}catch(nr){console.error(nr),T.length>1&&A(_nullishCoalesce(nr.shortMessage, () => ("Something went wrong")))}if(!Pt){F(!1),w(!0);return}F(!1),X(!0),u(!0),h(Pt.gas);try{await Ge.switchChain({id:ue.chain.id})}catch (e27){await Ge.addChain({chain:ue.chain}),await Ge.switchChain({id:ue.chain.id})}let br;try{br=await Ge.sendTransaction(Pt),o({eventName:$o,payload:{provider:"external",status:"success",address:se.address,chainId:ue.chain.id,value:_optionalChain([ue, 'access', _506 => _506.value, 'optionalAccess', _507 => _507.toString, 'call', _508 => _508()]),txHash:br}})}catch(nr){console.error(nr);let Le=nr;Le.name==="TransactionExecutionError"&&(T.length<1?E(new (0, _chunkXKAIXCX7js.g)(Le.shortMessage,void 0,"transaction_failure")):A(_nullishCoalesce(nr.shortMessage, () => ("Something went wrong"))))}if(!br){X(!1);return}await Ge.waitForTransactionReceipt({hash:br}),X(!1),Q(!0)})().catch(console.error)},[Ge,ue]),_react.useEffect.call(void 0, ()=>{(async()=>{if(!g||!Ge||!se)return;let Yt=_chunk3AGMJGHJjs.d.call(void 0, i.chains).filter($e=>$e.id!==s.funding.chain.id&&!!$e.testnet==!!s.funding.chain.testnet);ye&&Yt.unshift(s.funding.chain);let br=await t1({chains:Yt,address:se.address,appId:t,rpcConfig:e}),nr=ye?br.filter($e=>$e.balance>0n):br.filter($e=>$e.balance>te);if(nr.length<1){E(new (0, _chunkXKAIXCX7js.g)(`Wallet ${_chunkLEABMTNMjs.h.call(void 0, se.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}nr.sort(($e,cp)=>Number(cp.balance-$e.balance));let Le=(await Promise.allSettled(nr.map(async $e=>({quote:await $g({isTestnet:!!_optionalChain([s, 'access', _509 => _509.funding, 'optionalAccess', _510 => _510.chain, 'access', _511 => _511.testnet]),input:jg({amount:te.toString(),user:se.address,recipient:$,destinationChainId:Y.id,destinationCurrency:he,originChainId:$e.chain.id})}),...$e})))).filter($e=>$e.status==="fulfilled").map($e=>$e.value);if(Le.length<1){E(new (0, _chunkXKAIXCX7js.g)(`Wallet ${_chunkLEABMTNMjs.h.call(void 0, se.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}let Gn=Le.map($e=>({bridgeTx:e1($e.quote),balance:$e.balance,chain:$e.chain})).filter($e=>!!$e.bridgeTx);if(Gn.length>1){P(Gn);return}let an=Gn[0];if(!an){E(new (0, _chunkXKAIXCX7js.g)(`Wallet ${_chunkLEABMTNMjs.h.call(void 0, se.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}K(!0),M({data:an.bridgeTx.data,to:an.bridgeTx.to,value:an.bridgeTx.value,chain:an.chain})})().catch(console.error)},[g]),_react.useEffect.call(void 0, ()=>{if(!v)return;let _e={error:v,previousScreen:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};a({funding:_optionalChain([s, 'optionalAccess', _512 => _512.funding]),sendTransaction:_optionalChain([s, 'optionalAccess', _513 => _513.sendTransaction]),errorModalData:_e}),n("ERROR_SCREEN",!1)},[v]);let le=se?gn(se.walletClientType,se.connectorType,se.walletClientType)||"wallet":null,nn=!ye&&Ee?_chunkLEABMTNMjs.X.call(void 0, _nullishCoalesce(_optionalChain([s, 'optionalAccess', _514 => _514.funding, 'optionalAccess', _515 => _515.amount]), () => ("0")),Ee):void 0,G=ye?f:_chunkLEABMTNMjs._.call(void 0, [f,te]),J=G&&Ee?_chunkLEABMTNMjs.Y.call(void 0, G,Ee):void 0,Lt=G?_chunkLEABMTNMjs.Z.call(void 0, G,"ETH"):void 0,we=f&&Ee?_chunkLEABMTNMjs.Y.call(void 0, f,Ee):void 0,gt=f?_chunkLEABMTNMjs.Z.call(void 0, f,"ETH"):void 0;if(_react.useEffect.call(void 0, ()=>{if(!L)return;let _e=setTimeout(r,_chunkXKAIXCX7js.t);return()=>clearTimeout(_e)},[L]),L)return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, Gt,{}),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsxs.call(void 0, Pr,{children:[_jsxruntime.jsx.call(void 0, _CheckCircleIcon4.default,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),_jsxruntime.jsx.call(void 0, Ce,{title:"Success!",description:`You\u2019ve successfully added ${ke} ${ye?xe.symbol:Y.nativeCurrency.symbol} to your ${i.name} wallet. It may take a minute before the funds are available to use.`})]}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]});let Qi=ye?`${Jc({amount:or,decimals:xe.decimals})} ${xe.symbol}`:_chunkLEABMTNMjs.Z.call(void 0, ce,Y.nativeCurrency.symbol,3,!0),Bo=T[S];return T.length>1&&Bo?_jsxruntime.jsx.call(void 0, U1,{displayName:le,configuredFundingChain:Y,formattedBalance:Qi,fundingAmount:ke,fundingCurrency:ye?xe.symbol:Y.nativeCurrency.symbol,fundingAmountInUsd:nn,options:T,selectedOption:Bo,isPreparing:D,isSubmitting:W,errorMessage:_,onSubmit:()=>{M({to:Bo.bridgeTx.to,data:Bo.bridgeTx.data,value:Bo.bridgeTx.value,chain:Bo.chain})},onSelect:_e=>{_e!==S&&(A(null),R(_e))}}):d&&f&&se&&_optionalChain([s, 'optionalAccess', _516 => _516.funding])?_jsxruntime.jsx.call(void 0, F1,{wallet:se,displayName:le,addressToFund:$,isBridging:B,isErc20Flow:ye,totalPriceInUsd:J,totalPriceInNativeCurrency:Lt,gasPriceInUsd:we,gasPriceInNativeCurrency:gt,chain:s.funding.chain}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, Gt,{}),_jsxruntime.jsx.call(void 0, Ai,{}),_jsxruntime.jsx.call(void 0, "div",{style:{marginTop:"1rem"}}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})};var _ArrowsRightLeftIcon = require('@heroicons/react/24/solid/ArrowsRightLeftIcon'); var _ArrowsRightLeftIcon2 = _interopRequireDefault(_ArrowsRightLeftIcon);var ad=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 (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");try{return await this.api.post(Ll,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(t){throw _chunkXKAIXCX7js.j.call(void 0, t)}}async link(){if(!this.api)throw new (0, _chunkXKAIXCX7js.g)("Auth flow has no API instance");try{return await this.api.post(Ol,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(t){throw _chunkXKAIXCX7js.j.call(void 0, t)}}};async function id({api:e,requesterAppId:t,providerAppId:r}){let n=(await e.get(`/api/v1/apps/${t}/cross-app/connections`)).connections.find(a=>a.provider_app_id===r);if(!n)throw new (0, _chunkXKAIXCX7js.g)("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 q1({api:e,appId:t}){let r=ea(),o=Ya(),n=await Qa(r);try{let{url:a}=await e.post(Wl,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:n,state_code:o});return{url:a,stateCode:o,codeVerifier:r}}catch(a){throw _chunkXKAIXCX7js.j.call(void 0, a)}}async function z1({appId:e,stateCode:t,codeVerifier:r,authorizationCode:o,action:n,client:a}){if(!o||!t)throw new (0, _chunkXKAIXCX7js.g)("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(o==="undefined")throw new (0, _chunkXKAIXCX7js.g)("User denied confirmation during cross-app auth flow");try{let i=new ad({authorizationCode:o,stateCode:t,codeVerifier:r,provider:`privy:${e}`});a.startAuthFlow(i);let c=await _asyncOptionalChain([(n==="link"?await a.link():await a.authenticate()), 'access', async _517 => _517.oAuthTokens, 'optionalAccess', async _518 => _518.accessToken]);return console.debug(),c}catch(i){let s=_chunkXKAIXCX7js.j.call(void 0, i);throw s.privyErrorCode?new (0, _chunkXKAIXCX7js.g)(s.message||"Invalid code during cross-app auth flow.",void 0,s.privyErrorCode):s.message==="User denied confirmation during cross-app auth flow"?new (0, _chunkXKAIXCX7js.g)("Invalid code during cross-app auth flow.",void 0,"oauth_user_denied"):new (0, _chunkXKAIXCX7js.g)("Invalid code during cross-app auth flow.",void 0,"unknown_auth_error")}}var sd=async({user:e,address:t,client:r,request:o,requesterAppId:n,reconnect:a})=>{r.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:t,method:o.method}});let i=_optionalChain([e, 'optionalAccess', _519 => _519.linkedAccounts, 'access', _520 => _520.find, 'call', _521 => _521(h=>!!(h.type==="cross_app"&&h.embeddedWallets.find(g=>g.address===t)))]);if(!e||!i)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Cannot request a signature with this wallet address",address:t}}),new (0, _chunkXKAIXCX7js.g)("Cannot request a signature with this wallet address");let s=r.getProviderAccessToken(i.providerApp.id),c=await id({api:r.api,requesterAppId:n,providerAppId:i.providerApp.id});if(!s){if(c.readOnly)throw console.error("cannot transact against a read-only provider app"),new (0, _chunkXKAIXCX7js.g)("Cannot transact against a read-only provider app");await a({appId:i.providerApp.id,action:"link"})&&(s=r.getProviderAccessToken(i.providerApp.id))}if(!s)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Transactions require a valid token",address:t}}),new (0, _chunkXKAIXCX7js.g)("Transactions require a valid token");let d=window.open(void 0,void 0,Fs({w:400,h:680}));if(!d)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:t}}),new (0, _chunkXKAIXCX7js.g)("Failed to initialize signature request");let u=new URL(`${c.apiUrl}/oauth/transact`);return u.searchParams.set("token",s||""),u.searchParams.set("request",V7(o)),d.location=u.href,new Promise((h,g)=>{let v=setTimeout(()=>{A(),g(new (0, _chunkXKAIXCX7js.g)("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})},12e4),E=setInterval(()=>{d.closed&&(A(),g(new (0, _chunkXKAIXCX7js.g)("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))},300),_=T=>{T.data&&(_optionalChain([T, 'access', _522 => _522.data, 'access', _523 => _523.token, 'optionalAccess', _524 => _524.action])==="set"&&_optionalChain([T, 'access', _525 => _525.data, 'access', _526 => _526.token, 'optionalAccess', _527 => _527.value])!==void 0?r.storeProviderAccessToken(i.providerApp.id,T.data.token.value):_optionalChain([T, 'access', _528 => _528.data, 'access', _529 => _529.token, 'optionalAccess', _530 => _530.action])==="clear"&&r.storeProviderAccessToken(i.providerApp.id,null),T.data.type==="PRIVY_CROSS_APP_ACTION_RESPONSE"&&T.data.result&&(A(),h(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&&(A(),g(T.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:T.data.error,address:t}})))};window.addEventListener("message",_);let A=()=>{d.close(),clearInterval(E),clearTimeout(v),window.removeEventListener("message",_)}})},V7=e=>JSON.stringify({content:{request:{request:e}},timestamp:Date.now(),callbackUrl:window.origin}),Fs=({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,a=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,i=n/window.screen.availWidth,s=a/window.screen.availHeight,c=(n-e)/2/i+r,d=(a-t)/2/s+o;return`toolbar=0,location=0,menubar=0,height=${t},width=${e},popup=1,left=${c},top=${d}`};var G7=new Set([_chunkXKAIXCX7js.da.id,_chunkXKAIXCX7js.$.id,_chunkXKAIXCX7js.ea.id,_chunkXKAIXCX7js.ga.id,_chunkXKAIXCX7js.X.id]),q7=new Set([_chunkXKAIXCX7js.da.id,_chunkXKAIXCX7js.$.id,_chunkXKAIXCX7js.ga.id,_chunkXKAIXCX7js.ea.id]),z7={[_chunkXKAIXCX7js.da.id]:"ethereum",[_chunkXKAIXCX7js.$.id]:"base",[_chunkXKAIXCX7js.ea.id]:"optimism",[_chunkXKAIXCX7js.ga.id]:"polygon",[_chunkXKAIXCX7js.X.id]:"arbitrum"},K1=(e,t)=>{switch(t){case"native-currency":return G7.has(e);case"USDC":return q7.has(e);default:return console.warn("Unknown asset passed to Coinbase Onramp"),!1}};function Y1(e){let t=z7[e];if(!t)throw new (0, _chunkXKAIXCX7js.g)(`Unsupported chainId: ${e} for Coinbase Onramp`);return t}function K7(e){return e.startsWith(".")?`0${e}`:e}var Q1=({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",K7(t)),o.searchParams.set("defaultNetwork",r),o.searchParams.set("partnerUserId",e.partner_user_id),{url:o}};var J7=240,J1=1500,j7=Math.floor(J7*1e3/J1),j1=()=>{let{data:e,setModalData:t,navigate:r}=_chunk3AGMJGHJjs.b.call(void 0, ),{closePrivyModal:o,createAnalyticsEvent:n,initCoinbaseOnRamp:a,getCoinbaseOnRampStatus:i}=_chunkXKAIXCX7js.ra.call(void 0, ),s=_optionalChain([e, 'optionalAccess', _531 => _531.funding]),c=s.isUSDC?"USDC":"ETH",[d,u]=_react.useState.call(void 0, !1),[f,h]=_react.useState.call(void 0, !1);return _react.useEffect.call(void 0, ()=>{if(d)return;u(!0);let g=async()=>{try{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp",value:s.amount,chainId:s.chain.id}});let v=window.open(void 0,void 0,Fs({w:440,h:680})),E=Y1(s.chain.id),_=await a({addresses:[{address:s.address,blockchains:[E]}],assets:[c]}),{url:A}=Q1({input:_,amount:s.amount,blockchain:E});if(!v)throw new Error("Unable to initiate Coinbase Onramp flow.");v.location=A.toString();let T=0,P=!1;for(;T<j7;){T++;let{status:S}=await i({partnerUserId:_.partner_user_id});if(S==="success"){P=!0;break}if(S==="failure")throw new Error("There was an error completing Coinbase Onramp flow.");if(v.closed)throw new Error("User exited Coinbase Onramp flow before transaction response.");await new Promise(R=>setTimeout(R,J1))}if(!P)throw new Error("Timed out waiting for transaction response from Coinbase Onramp.");h(!0)}catch(v){console.error(v),n({eventName:$o,payload:{status:"failure",provider:"coinbase-onramp",error:v.message}}),t({funding:{...s,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)}},w=setTimeout(()=>void g(),500);return()=>clearTimeout(w)},[]),_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{title:"Fund account"},"header"),_jsxruntime.jsx.call(void 0, eb,{isSucccess:f,onClickCta:o}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})},$7=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:""},eb=({isSucccess:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=_react.useMemo.call(void 0, ()=>$7(e),[e]);return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, ab,{children:[_jsxruntime.jsx.call(void 0, ob,{isSucccess:e}),_jsxruntime.jsxs.call(void 0, tt,{children:[_jsxruntime.jsx.call(void 0, "h3",{children:r}),_jsxruntime.jsx.call(void 0, nb,{children:o})]})]}),n&&_jsxruntime.jsx.call(void 0, U,{onClick:t,children:n})]})},tb=e=>e?"var(--privy-color-success)":"var(--privy-color-foreground-4)",rb=e=>e?_CheckCircleIcon2.default:()=>_jsxruntime.jsx.call(void 0, _ArrowsRightLeftIcon2.default,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),ob=({isSucccess:e})=>{if(!e){let o="var(--privy-color-foreground-4)";return _jsxruntime.jsxs.call(void 0, "div",{style:{position:"relative"},children:[_jsxruntime.jsx.call(void 0, mt,{color:o,style:{position:"absolute"}}),_jsxruntime.jsx.call(void 0, fs,{color:o}),_jsxruntime.jsx.call(void 0, Ko,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let t=rb(e),r=tb(e);return _jsxruntime.jsx.call(void 0, "div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&_jsxruntime.jsx.call(void 0, t,{width:"4rem",height:"4rem",color:r})})},nb=_styledcomponents2.default.p`
1798
+ font-size: 1rem;
1799
+ color: var(--privy-color-foreground-3);
1800
+ margin-bottom: 1rem;
1801
+ display: flex;
1802
+ flex-direction: column;
1803
+ gap: 1rem;
1804
+ `,ab=_styledcomponents2.default.div`
1805
+ display: flex;
1806
+ flex-direction: column;
1807
+ align-items: center;
1808
+ justify-content: center;
1809
+ margin-left: 1.75rem;
1810
+ margin-right: 1.75rem;
1811
+ padding: 2rem 0;
1812
+ `;var _PencilIcon = require('@heroicons/react/24/outline/PencilIcon'); var _PencilIcon2 = _interopRequireDefault(_PencilIcon);var e2=({children:e})=>_jsxruntime.jsxs.call(void 0, lb,{children:[_jsxruntime.jsx.call(void 0, _outline.ExclamationTriangleIcon,{width:"3rem",color:"var(--privy-color-error)"}),e]}),lb=_styledcomponents2.default.div`
1813
+ display: flex;
1814
+ gap: 0.5rem;
1815
+ background-color: var(--privy-color-error-light);
1816
+
1817
+ align-items: flex-start;
1818
+ text-align: left;
1819
+ padding: 0.5rem 0.75rem;
1820
+
1821
+ font-size: 0.75rem;
1822
+ font-weight: 400;
1823
+ line-height: 1.125rem; /* 150% */
1824
+
1825
+ padding: 0.5rem 0.75rem;
1826
+
1827
+ && {
1828
+ border: 1px solid var(--privy-color-error);
1829
+ border-radius: var(--privy-border-radius-sm);
1830
+ }
1831
+ `;var ld=async({address:e,chain:t,rpcConfig:r,privyAppId:o})=>{try{let n=_viem.createPublicClient.call(void 0, {chain:t,transport:_viem.http.call(void 0, _chunkLEABMTNMjs.r.call(void 0, t,r,o))}),[a,i]=await Promise.all([n.readContract({abi:t2,address:e,functionName:"symbol"}),n.readContract({abi:t2,address:e,functionName:"decimals"})]);return{decimals:i,symbol:a}}catch(n){return console.log(n),null}},t2=[{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"}];var cd="moonpay",gb=new Set([_chunkXKAIXCX7js.da.id,_chunkXKAIXCX7js.X.id,_chunkXKAIXCX7js.$.id,_chunkXKAIXCX7js.ga.id]),Cb=new Set([_chunkXKAIXCX7js.da.id,_chunkXKAIXCX7js.X.id,_chunkXKAIXCX7js.ea.id,_chunkXKAIXCX7js.$.id,_chunkXKAIXCX7js.ga.id]);function r2(e,t){switch(e){case _chunkXKAIXCX7js.X.id:return t==="native-currency"?"ETH_ARBITRUM":"USDC_ARBITRUM";case 43114:return"AVAX_CCHAIN";case _chunkXKAIXCX7js.$.id:return t==="native-currency"?"ETH_BASE":"USDC_BASE";case _chunkXKAIXCX7js.ba.id:return"CELO_CELO";case _chunkXKAIXCX7js.ga.id:return t==="native-currency"?"MATIC_POLYGON":"USDC_POLYGON";case _chunkXKAIXCX7js.da.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 o2(e){return parseFloat(e)}function n2(e){return!!e&&e.config!==void 0&&e.provider!==void 0}function dd(e){return!!e&&(e.chain!==void 0||e.amount!==void 0)}async function a2(e,t,r,o,n=!1){let a=r.currencyCode?{}:{defaultCurrencyCode:"ETH_ETHEREUM"},i=r.uiConfig||{accentColor:o.accent,theme:o.colorScheme};return e.signMoonpayOnRampUrl({address:t,useSandbox:n,config:{...r,...a,...i}})}async function vb(e,t){let r=t?_chunkXKAIXCX7js.S:_chunkXKAIXCX7js.R,o=t?_chunkXKAIXCX7js.U:_chunkXKAIXCX7js.T;return _ofetch.ofetch.call(void 0, `${r}/transactions/ext/${e}`,{query:{apiKey:o}})}function i2(e,t=!1){let[r,o]=_react.useState.call(void 0, null),{createAnalyticsEvent:n}=_chunkXKAIXCX7js.ra.call(void 0, ),{data:a,navigate:i,setModalData:s}=_chunk3AGMJGHJjs.b.call(void 0, ),c=_optionalChain([a, 'optionalAccess', _532 => _532.funding]),d=_react.useRef.call(void 0, 0);return _react.useEffect.call(void 0, ()=>{let u=setInterval(async()=>{if(e)try{let[f]=await vb(e,t),h=f.status==="waitingAuthorization"&&f.paymentMethod==="credit_debit_card"?"pending":f.status;if(["failed","completed","awaitingAuthorization"].includes(h)&&(n({eventName:$o,payload:{status:h,provider:cd,paymentMethod:f.paymentMethod,cardPaymentType:f.cardPaymentType,currency:_optionalChain([f, 'access', _533 => _533.currency, 'optionalAccess', _534 => _534.code]),baseCurrencyAmount:f.baseCurrencyAmount,quoteCurrencyAmount:f.quoteCurrencyAmount,feeAmount:f.feeAmount,extraFeeAmount:f.extraFeeAmount,networkFeeAmount:f.networkFeeAmount,isSandbox:t}}),clearInterval(u)),h==="failed"||h==="serviceFailure"){s({funding:{...c,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),i("FUNDING_METHOD_SELECTION_SCREEN");return}o(h)}catch(f){_optionalChain([f, 'access', _535 => _535.response, 'optionalAccess', _536 => _536.status])!==404&&(d.current+=1),d.current>=3&&(n({eventName:$o,payload:{status:"serviceFailure",provider:cd}}),clearInterval(u),s({funding:{...c,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),i("FUNDING_METHOD_SELECTION_SCREEN"))}},3e3);return()=>clearInterval(u)},[e,d]),r}var s2=(e,t)=>{switch(t){case"native-currency":return gb.has(e);case"USDC":return Cb.has(e);default:return console.warn("Unknown asset passed to MoonPay Onramp"),!1}};var Li=({size:e=61,...t})=>_jsxruntime.jsx.call(void 0, "svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:_jsxruntime.jsxs.call(void 0, "g",{id:"moonpay_symbol_wht 2",children:[_jsxruntime.jsx.call(void 0, "rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),_jsxruntime.jsx.call(void 0, "path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});var p2=()=>{let{wallets:e}=_chunkXKAIXCX7js.va.call(void 0, ),{navigate:t,data:r,setModalData:o}=_chunk3AGMJGHJjs.b.call(void 0, ),n=_chunkXKAIXCX7js.oa.call(void 0, ),a=_optionalChain([r, 'optionalAccess', _537 => _537.funding]),i=_react.useRef.call(void 0, null),[s,c]=_react.useState.call(void 0, !1);_react.useEffect.call(void 0, ()=>{i.current&&i.current.style.setProperty("--funding-input-length",Math.max(a.amount.length,1).toString())},[a.amount,i.current]);let d=_nullishCoalesce(_optionalChain([n, 'access', _538 => _538.fundingConfig, 'optionalAccess', _539 => _539.methods, 'access', _540 => _540.slice, 'call', _541 => _541()]), () => ([])),{tokenPrice:u}=Lo({chainId:a.chain.id});_react.useEffect.call(void 0, ()=>{a.erc20Address&&a.chain&&!a.erc20ContractInfo&&ld({address:a.erc20Address,chain:a.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)},[a.erc20Address,a.chain]);let f=u?_chunkLEABMTNMjs.X.call(void 0, a.amount,u):void 0,h=e.find(S=>_address.getAddress.call(void 0, S.address)===_address.getAddress.call(void 0, a.address)),g=h&&h.walletClientType!=="privy"?gn(h.walletClientType,h.connectorType,h.walletClientType):n.name,w=parseFloat(a.amount),v=!isNaN(w)&&w>0,E=!!(a.erc20Address&&!a.erc20ContractInfo),_=a.isUSDC?"USDC":a.erc20Address?void 0:"native-currency",A=_&&s2(Number(a.chain.id),_),T=_&&K1(Number(a.chain.id),_),P=a.erc20Address||!a.erc20Address&&!a.isUSDC;return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, Gt,{}),_jsxruntime.jsxs.call(void 0, "h3",{children:["Add funds to your"," ",_optionalChain([g, 'optionalAccess', _542 => _542.toLowerCase, 'call', _543 => _543(), 'access', _544 => _544.endsWith, 'call', _545 => _545("wallet")])?g:g+" wallet"]}),_jsxruntime.jsx.call(void 0, yn,{style:{marginTop:"32px"},children:_jsxruntime.jsx.call(void 0, _i,{children:E?_jsxruntime.jsx.call(void 0, Ai,{size:"50px"}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, Mi,{onClick:()=>_optionalChain([i, 'access', _546 => _546.current, 'optionalAccess', _547 => _547.focus, 'call', _548 => _548()]),children:[_jsxruntime.jsx.call(void 0, W1,{ref:i,value:a.amount,onFocus:()=>c(!0),onBlur:()=>c(!1),onChange:S=>{let R=S.target.value;/^[0-9.]*$/.test(R)&&R.split(".").length-1<=1&&o({...r,funding:{...a,amount:R}})}}),_jsxruntime.jsx.call(void 0, Ii,{children:a.erc20Address?_optionalChain([a, 'access', _549 => _549.erc20ContractInfo, 'optionalAccess', _550 => _550.symbol]):a.chain.nativeCurrency.symbol}),!s&&_jsxruntime.jsx.call(void 0, L1,{children:_jsxruntime.jsx.call(void 0, _PencilIcon2.default,{width:12,height:12})})]}),!a.erc20Address&&_jsxruntime.jsx.call(void 0, Wi,{children:f&&v?f:""})]})})}),_jsxruntime.jsxs.call(void 0, I1,{children:[a.errorMessage&&_jsxruntime.jsx.call(void 0, e2,{children:a.errorMessage}),d.sort().map(S=>{switch(S){case"moonpay":return A?_jsxruntime.jsxs.call(void 0, Ae,{disabled:!v||E,onClick:()=>{t("MOONPAY_PROMPT_SCREEN")},children:[_jsxruntime.jsx.call(void 0, od,{children:_jsxruntime.jsx.call(void 0, Li,{style:{width:24}})}),"Moonpay"]},S):null;case"coinbase-onramp":return T?_jsxruntime.jsxs.call(void 0, Ae,{disabled:!v||E,onClick:()=>{t("COINBASE_ONRAMP_STATUS_SCREEN")},children:[_jsxruntime.jsx.call(void 0, od,{children:_jsxruntime.jsx.call(void 0, Ko,{style:{width:24}})}),"Coinbase Onramp"]},S):null;case"external":return P?_jsxruntime.jsxs.call(void 0, Ae,{disabled:!v||E,onClick:()=>{t("FUNDING_TRANSFER_FROM_WALLET_SCREEN")},children:[_jsxruntime.jsx.call(void 0, od,{children:_jsxruntime.jsx.call(void 0, _WalletIcon2.default,{style:{width:24}})}),"Transfer from wallet"]},S):null}}),_jsxruntime.jsx.call(void 0, N1,{disabled:!v,onClick:()=>t("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})};var _units = require('@ethersproject/units');var _InformationCircleIcon = require('@heroicons/react/24/outline/InformationCircleIcon'); var _InformationCircleIcon2 = _interopRequireDefault(_InformationCircleIcon);var _QrCodeIcon = require('@heroicons/react/24/outline/QrCodeIcon'); var _QrCodeIcon2 = _interopRequireDefault(_QrCodeIcon);var Mb=2e3,u2=()=>{let{wallets:e}=_chunkXKAIXCX7js.va.call(void 0, ),{app:t,data:r,setModalData:o,navigate:n,lastScreen:a}=_chunk3AGMJGHJjs.b.call(void 0, ),{chains:i,rpcConfig:s,appId:c,closePrivyModal:d,createAnalyticsEvent:u}=_chunkXKAIXCX7js.ra.call(void 0, ),[f,h]=_react.useState.call(void 0, "default"),[g,w]=_react.useState.call(void 0, void 0),v=_optionalChain([r, 'optionalAccess', _551 => _551.funding]),{tokenPrice:E}=Lo({chainId:v.chain.id}),_=E?_chunkLEABMTNMjs.X.call(void 0, v.amount,E):void 0,A=e.find(R=>_chunkLEABMTNMjs.h.call(void 0, R.address)===_chunkLEABMTNMjs.h.call(void 0, v.address)),T=A&&A.walletClientType!=="privy"?gn(A.walletClientType,A.connectorType,A.walletClientType):t.name;if(!v)return o({errorModalData:{error:new Error("Couldn't find funding config"),previousScreen:a||"FUNDING_METHOD_SELECTION_SCREEN"},funding:_optionalChain([r, 'optionalAccess', _552 => _552.funding]),sendTransaction:_optionalChain([r, 'optionalAccess', _553 => _553.sendTransaction])}),n("ERROR_SCREEN"),_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{});_react.useEffect.call(void 0, ()=>{let R=_chunkLEABMTNMjs.s.call(void 0, v.chain.id,i,s,{appId:c});function D(){R.getBalance(v.address).then(B=>{let K=parseFloat(_units.formatUnits.call(void 0, B,"ether"));w(W=>(W&&K>W&&u({eventName:$o,payload:{provider:"manual",status:"success",address:_optionalChain([A, 'optionalAccess', _554 => _554.address]),value:(K-W).toString()}}),K))}).catch(()=>w(void 0))}let F=setInterval(D,Mb);return D(),()=>clearInterval(F)},[]);let P=_react.useMemo.call(void 0, ()=>g!==void 0?g>=parseFloat(v.amount):!1,[g,v.amount]),S=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.V,{title:"Your wallet",errMsg:void 0,isLoading:!v||g===void 0,isPulsing:!P,balance:`${g!==void 0?g.toPrecision(2):""} ETH`,address:v.address,statusColor:P?"green":"gray"}),P&&_jsxruntime.jsx.call(void 0, D1,{onClick:()=>d(),children:"Close"})]});return f==="qr-code"?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:()=>h("default")}),_jsxruntime.jsxs.call(void 0, yn,{style:{gap:"24px",marginBottom:"24px"},children:[_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, me,{children:"Scan QR code"}),_jsxruntime.jsxs.call(void 0, ge,{children:["Scan this code using your mobile wallet to send funds to your ",T," ","wallet."]})]}),_jsxruntime.jsx.call(void 0, Pn,{url:v.address,size:200,squareLogoElement:Ib}),S]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, Gt,{}),_jsxruntime.jsx.call(void 0, Ce,{title:"Send funds",description:"Send funds directly to your wallet by copying your wallet address or scanning a QR code."}),_jsxruntime.jsxs.call(void 0, yn,{style:{gap:"16px"},children:[_jsxruntime.jsxs.call(void 0, Ob,{children:[_jsxruntime.jsx.call(void 0, _InformationCircleIcon2.default,{height:"20px",width:"20px",color:"var(--privy-color-accent-light)"}),_jsxruntime.jsxs.call(void 0, Nb,{children:["Make sure to send on ",v.chain.name,"."]})]}),_jsxruntime.jsxs.call(void 0, Db,{children:[_jsxruntime.jsx.call(void 0, ci,{height:16}),_jsxruntime.jsxs.call(void 0, _i,{children:[_jsxruntime.jsxs.call(void 0, Mi,{children:[_jsxruntime.jsx.call(void 0, nd,{children:v.amount}),_jsxruntime.jsx.call(void 0, Ii,{children:v.chain.nativeCurrency.symbol})]}),_jsxruntime.jsx.call(void 0, Wi,{children:_?`${_} USD`:"..."}),_jsxruntime.jsxs.call(void 0, O1,{children:[_jsxruntime.jsx.call(void 0, Ri,{chainId:v.chain.id,height:16,width:16})," ",v.chain.name]})]}),_jsxruntime.jsx.call(void 0, ci,{height:8}),_jsxruntime.jsxs.call(void 0, Lb,{children:[_jsxruntime.jsx.call(void 0, Wb,{text:v.address}),_jsxruntime.jsx.call(void 0, f2,{onClick:()=>h("qr-code"),children:_jsxruntime.jsxs.call(void 0, m2,{children:[_jsxruntime.jsx.call(void 0, _QrCodeIcon2.default,{height:"16px",width:"16px"}),"Scan code"]})})]})]}),S]}),_jsxruntime.jsx.call(void 0, ci,{height:16}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})},Ib=({...e})=>_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.C,{color:"black",...e}),Wb=e=>{let[t,r]=_react.useState.call(void 0, !1);return _jsxruntime.jsx.call(void 0, f2,{onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},children:_jsxruntime.jsxs.call(void 0, m2,{children:[t?_jsxruntime.jsx.call(void 0, Pi,{style:{height:"16px",width:"16px"},strokeWidth:"2"}):_jsxruntime.jsx.call(void 0, _DocumentDuplicateIcon2.default,{style:{height:"16px",width:"16px"}}),t?"Copied":"Copy address"]})})},Lb=_styledcomponents2.default.div`
1832
+ display: flex;
1833
+ flex-direction: row;
1834
+ gap: 8px;
1835
+ `,Ob=_styledcomponents2.default.div`
1836
+ display: flex;
1837
+ flex-direction: row;
1838
+ padding: 8px;
1839
+ background-color: var(--privy-color-background-2);
1840
+ border-radius: var(--privy-border-radius-md);
1841
+ svg {
1842
+ margin-right: 12px;
1843
+ }
1844
+ `,Nb=_styledcomponents2.default.div`
1845
+ line-height: 20px;
1846
+ font-size: 18px
1847
+ text-align: center;
1848
+ `,Db=_styledcomponents2.default.div`
1849
+ display: flex;
1850
+ flex-direction: column;
1851
+ background-color: var(--privy-color-background-2);
1852
+ border-radius: var(--privy-border-radius-md);
1853
+ svg {
1854
+ margin-right: 6px;
1855
+ }
1856
+ padding: 16px;
1857
+ gap: 8px;
1858
+ `,m2=_styledcomponents2.default.span`
1859
+ display: flex;
1860
+ align-items: center;
1861
+ margin: auto;
1862
+ `,f2=_styledcomponents2.default.button`
1863
+ display: flex;
1864
+ align-items: center;
1865
+ width: 100%;
1866
+
1867
+ && {
1868
+ border-radius: var(--privy-border-radius-md);
1869
+ border: 1px solid var(--privy-color-foreground-4);
1870
+ background-color: white;
1871
+ line-height: 18px;
1872
+ text-align: center;
1873
+ padding: 8px;
1874
+ font-size: 14px;
1875
+ background-color: var(--privy-color-background);
1876
+ color: ${e=>e.justCopied?"var(--privy-color-foreground-2)":"var(--privy-color-foreground-accent-dark)"};
1877
+ font-weight: ${e=>e.justCopied?"medium":"normal"};
1878
+ transition: color 350ms ease;
1879
+
1880
+ :active {
1881
+ outline: none;
1882
+ box-shadow: none;
1883
+ }
1884
+
1885
+ :hover {
1886
+ color: ${e=>e.justCopied?"var(--privy-color-foreground-2)":"var(--privy-color-foreground-accent-dark)"};
1887
+ }
1888
+
1889
+ :active {
1890
+ color: 'var(--privy-color-foreground-accent-dark)';
1891
+ font-weight: medium;
1892
+ }
1893
+ }
1894
+
1895
+ svg {
1896
+ width: 18px;
1897
+ height: 18px;
1898
+ }
1899
+ `;var _LinkIcon = require('@heroicons/react/24/outline/LinkIcon'); var _LinkIcon2 = _interopRequireDefault(_LinkIcon);var Eu=({title:e,desc:t,icon:r})=>_jsxruntime.jsxs.call(void 0, Kb,{children:[_jsxruntime.jsx.call(void 0, Qb,{children:r}),_jsxruntime.jsxs.call(void 0, Yb,{children:[_jsxruntime.jsx.call(void 0, qb,{children:e}),_jsxruntime.jsx.call(void 0, zb,{children:t})]})]}),y2=({app:e,signedUrl:t,onContinue:r})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, Vb,{children:[_jsxruntime.jsx.call(void 0, Li,{size:"3.75rem"}),_jsxruntime.jsxs.call(void 0, Gb,{children:[_optionalChain([e, 'optionalAccess', _555 => _555.name])," uses ",_jsxruntime.jsx.call(void 0, "span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),_jsxruntime.jsxs.call(void 0, Xb,{children:[_jsxruntime.jsx.call(void 0, Eu,{icon:_jsxruntime.jsx.call(void 0, _LinkIcon2.default,{width:"1rem"}),title:"Purchase assets to fund your account",desc:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:["Connect a payment method (",_jsxruntime.jsx.call(void 0, "strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),_jsxruntime.jsx.call(void 0, Eu,{icon:_jsxruntime.jsx.call(void 0, _ClockIcon2.default,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),_jsxruntime.jsx.call(void 0, Eu,{icon:_jsxruntime.jsx.call(void 0, _EyeSlashIcon2.default,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),_jsxruntime.jsx.call(void 0, Zb,{className:"mobile-only"})]}),_jsxruntime.jsx.call(void 0, Hb,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),_jsxruntime.jsx.call(void 0, pc,{disabled:!t,href:_nullishCoalesce(t, () => ("#")),target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),Hb=_styledcomponents2.default.span`
1900
+ display: inline-block;
1901
+ color: var(--privy-color-foreground-3);
1902
+ text-align: center;
1903
+ font-size: 0.625rem;
1904
+ font-style: normal;
1905
+ font-weight: 400;
1906
+ line-height: 140%; /* 0.875rem */
1907
+ margin-bottom: 0.25rem;
1908
+ `,Vb=_styledcomponents2.default.div`
1909
+ display: flex;
1910
+ flex-direction: column;
1911
+ align-items: center;
1912
+ justify-content: center;
1913
+ padding: 1.5rem 0;
1914
+ `,Gb=_styledcomponents2.default.span`
1915
+ color: var(--privy-color-foreground);
1916
+ text-align: center;
1917
+ font-size: 1.125rem;
1918
+ font-weight: 500;
1919
+ line-height: 1.25rem; /* 111.111% */
1920
+ margin: 1.5rem 0;
1921
+ text-align: center;
1922
+ max-width: 19.5rem;
1923
+ `,qb=_styledcomponents2.default.span`
1924
+ color: var(--privy-color-foreground);
1925
+ font-size: 0.875rem;
1926
+ font-weight: 500;
1927
+ line-height: 1.225rem;
1928
+ width: 100%;
1929
+ `,zb=_styledcomponents2.default.span`
1930
+ color: var(--privy-color-foreground-2);
1931
+ font-size: 0.875rem;
1932
+ font-weight: 400;
1933
+ line-height: 1.225rem;
1934
+ `,Kb=_styledcomponents2.default.div`
1935
+ display: flex;
1936
+ align-items: flex-start;
1937
+ gap: 0.5rem;
1938
+ align-self: stretch;
1939
+ `,Yb=_styledcomponents2.default.div`
1940
+ display: flex;
1941
+ flex-direction: column;
1942
+ gap: 0.25rem;
1943
+ align-items: flex-start;
1944
+ text-align: left;
1945
+ flex: 1 0 0;
1946
+ `,Qb=_styledcomponents2.default.div`
1947
+ padding-top: 2px;
1948
+ `,Xb=_styledcomponents2.default.div`
1949
+ display: flex;
1950
+ flex-direction: column;
1951
+ gap: 1.25rem;
1952
+ margin: 0 0.5rem;
1953
+ `,Zb=_styledcomponents2.default.div`
1954
+ margin: 30px 0;
1955
+ `;var g2=()=>{let{app:e,data:t,navigate:r,setModalData:o}=_chunk3AGMJGHJjs.b.call(void 0, ),{createAnalyticsEvent:n,getMoonpaySignedUrl:a}=_chunkXKAIXCX7js.ra.call(void 0, ),[i,s]=_react.useState.call(void 0, null),c=_optionalChain([t, 'optionalAccess', _556 => _556.funding]),d=c.isUSDC?"USDC":"native-currency";return _react.useEffect.call(void 0, ()=>{if(i||!c)return;async function u(){if(!e.fundingConfig)return;let{signedUrl:f,externalTransactionId:h}=await a(c.address,{...e.fundingMethodConfig.moonpay,...c.moonpayConfigOverride,currencyCode:_nullishCoalesce(_optionalChain([c, 'access', _557 => _557.moonpayConfigOverride, 'optionalAccess', _558 => _558.currencyCode]), () => (r2(c.chain.id,d))),quoteCurrencyAmount:_nullishCoalesce(_optionalChain([c, 'access', _559 => _559.moonpayConfigOverride, 'optionalAccess', _560 => _560.quoteCurrencyAmount]), () => (o2(c.amount)))});s(f),o({moonpayStatus:{externalTransactionId:h},funding:_optionalChain([t, 'optionalAccess', _561 => _561.funding])})}u()},[i,c]),_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, Gt,{}),_jsxruntime.jsx.call(void 0, y2,{app:e,signedUrl:i,onContinue:()=>{n({eventName:"sdk_fiat_on_ramp_started",payload:{provider:cd}}),r("MOONPAY_STATUS_SCREEN")}}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})};var v2=()=>{let{app:e,data:t}=_chunk3AGMJGHJjs.b.call(void 0, ),{closePrivyModal:r}=_chunkXKAIXCX7js.ra.call(void 0, ),{externalTransactionId:o}=_optionalChain([t, 'optionalAccess', _562 => _562.moonpayStatus]),n=i2(o||null,_nullishCoalesce(e.fundingMethodConfig.moonpay.useSandbox, () => (!1)));return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{title:"Fund account"},"header"),_jsxruntime.jsx.call(void 0, aE,{status:n,onClickCta:r}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})},nE=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:""}}},aE=({status:e,onClickCta:t})=>{let{title:r,body:o,cta:n}=_react.useMemo.call(void 0, ()=>nE(e),[e]);return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, dE,{children:[_jsxruntime.jsx.call(void 0, lE,{status:e}),_jsxruntime.jsxs.call(void 0, tt,{children:[_jsxruntime.jsx.call(void 0, "h3",{children:r}),_jsxruntime.jsx.call(void 0, cE,{children:o})]})]}),n&&_jsxruntime.jsx.call(void 0, U,{onClick:t,children:n})]})},iE=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)",sE=e=>{switch(e){case"completed":return _CheckCircleIcon2.default;case"waitingAuthorization":return()=>_jsxruntime.jsx.call(void 0, _ArrowsRightLeftIcon2.default,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}},lE=({status:e})=>{if(!e||e==="pending"){let o="var(--privy-color-foreground-4)";return _jsxruntime.jsxs.call(void 0, "div",{style:{position:"relative"},children:[_jsxruntime.jsx.call(void 0, mt,{color:o,style:{position:"absolute"}}),_jsxruntime.jsx.call(void 0, fs,{color:o}),_jsxruntime.jsx.call(void 0, Li,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=sE(e),r=iE(e);return _jsxruntime.jsx.call(void 0, "div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&_jsxruntime.jsx.call(void 0, t,{width:"4rem",height:"4rem",color:r})})},cE=_styledcomponents2.default.p`
1956
+ font-size: 1rem;
1957
+ color: var(--privy-color-foreground-3);
1958
+ margin-bottom: 1rem;
1959
+ display: flex;
1960
+ flex-direction: column;
1961
+ gap: 1rem;
1962
+ `,dE=_styledcomponents2.default.div`
1963
+ display: flex;
1964
+ flex-direction: column;
1965
+ align-items: center;
1966
+ justify-content: center;
1967
+ margin-left: 1.75rem;
1968
+ margin-right: 1.75rem;
1969
+ padding: 2rem 0;
1970
+ `;var ud=()=>{let{enabled:e,token:t}=Pe(),{navigate:r,setModalData:o}=_chunk3AGMJGHJjs.b.call(void 0, ),{initLoginWithPasskey:n}=_chunkXKAIXCX7js.ra.call(void 0, );return _jsxruntime.jsx.call(void 0, Su,{onClick:async()=>{e&&!t?(o({captchaModalData:{callback:i=>n(i),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"})},mE=_styledcomponents.css`
1971
+ && {
1972
+ width: 100%;
1973
+ font-size: 0.875rem;
1974
+ line-height: 1rem;
1975
+
1976
+ /* Tablet and Up */
1977
+ @media (min-width: 440px) {
1978
+ font-size: 14px;
1979
+ }
1980
+
1981
+ display: flex;
1982
+ gap: 12px;
1983
+ justify-content: center;
1984
+
1985
+ padding: 6px 8px;
1986
+ background-color: var(--privy-color-background);
1987
+ transition: background-color 200ms ease;
1988
+ color: var(--privy-color-accent) !important;
1989
+
1990
+ :focus {
1991
+ outline: none;
1992
+ box-shadow: none;
1993
+ }
1994
+ }
1995
+ `,Su=_styledcomponents2.default.button`
1996
+ ${mE}
1997
+ `;var _ChevronRightIcon = require('@heroicons/react/24/outline/ChevronRightIcon'); var _ChevronRightIcon2 = _interopRequireDefault(_ChevronRightIcon);var md=({onClick:e,text:t})=>_jsxruntime.jsxs.call(void 0, Ae,{onClick:e,children:[_jsxruntime.jsx.call(void 0, _WalletIcon2.default,{}),_jsxruntime.jsx.call(void 0, Xt,{children:t}),_jsxruntime.jsx.call(void 0, _ChevronRightIcon2.default,{})]});var E2=()=>{let{connectors:e}=_chunkXKAIXCX7js.ra.call(void 0, ),{app:t,setModalData:r,data:o,navigate:n}=_chunk3AGMJGHJjs.b.call(void 0, ),[a,i]=_react.useState.call(void 0, "default"),s=Cn(t.appearance.walletList,"ethereum-only",e,!0,t.appearance.walletList,t.externalWallets.walletConnect.enabled),c=_jsxruntime.jsx.call(void 0, md,{text:"More wallets",onClick:()=>i("overflow")});return _react.useEffect.call(void 0, ()=>{r({...o,externalConnectWallet:{onCompleteNavigateTo:"FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"}})},[]),a==="overflow"?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:()=>i("default")},"header"),_jsxruntime.jsxs.call(void 0, pr,{children:[_jsxruntime.jsx.call(void 0, Kr,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),s]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, Gt,{}),_jsxruntime.jsx.call(void 0, Ce,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),_jsxruntime.jsxs.call(void 0, pr,{children:[...s.length>3?s.slice(0,2):s,s.length>3&&c,_jsxruntime.jsx.call(void 0, Su,{onClick:()=>n("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})};var T2=()=>{let{closePrivyModal:e}=_chunkXKAIXCX7js.ra.call(void 0, );return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{},"header"),_jsxruntime.jsx.call(void 0, EE,{children:_jsxruntime.jsx.call(void 0, _ArrowTopRightOnSquareIcon2.default,{style:{width:32,height:32}})}),_jsxruntime.jsx.call(void 0, Ro,{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"}}),_jsxruntime.jsx.call(void 0, hr,{children:_jsxruntime.jsx.call(void 0, U,{onClick:()=>e(),children:"Close"})}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})},EE=_styledcomponents2.default.div`
1998
+ border-radius: 50%;
1999
+ height: 68px;
2000
+ width: 68px;
2001
+ display: flex;
2002
+ align-items: center;
2003
+ justify-content: center;
2004
+ background-color: var(--privy-color-accent);
2005
+ color: white;
2006
+ margin: 0 auto 24px auto;
2007
+ `;var P2=({style:e,...t})=>_jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, "path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})});var A2=_styledcomponents2.default.div`
2008
+ display: flex;
2009
+ flex-direction: column;
2010
+ justify-content: flex-start;
2011
+ gap: 4px;
2012
+ `,xu=_styledcomponents2.default.div`
2013
+ &&& {
2014
+ margin-left: 7px; /* TODO: This is a total hack */
2015
+ border-left: 2px solid var(--privy-color-foreground-4);
2016
+ height: 12px;
2017
+ }
2018
+ `,hd=({children:e})=>_jsxruntime.jsxs.call(void 0, PE,{children:[_jsxruntime.jsx.call(void 0, P2,{style:{width:"16px",height:"16px"}}),e]}),PE=_styledcomponents2.default.div`
2019
+ display: flex;
2020
+ justify-content: flex-start;
2021
+ justify-items: center;
2022
+ text-align: left;
2023
+ gap: 8px;
2024
+
2025
+ && {
2026
+ a {
2027
+ text-decoration: underline;
2028
+ color: var(--privy-color-accent);
2029
+ }
2030
+
2031
+ svg {
2032
+ margin-top: auto;
2033
+ margin-bottom: auto;
2034
+ }
2035
+ }
2036
+ `;var RE=()=>_jsxruntime.jsxs.call(void 0, _E,{children:[_jsxruntime.jsx.call(void 0, pa,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),_jsxruntime.jsx.call(void 0, Mt,{children:_jsxruntime.jsx.call(void 0, Po,{style:{width:"152px",height:"152px"}})}),_jsxruntime.jsxs.call(void 0, A2,{children:[_jsxruntime.jsx.call(void 0, hd,{children:_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "span",{children:"Install the "}),_jsxruntime.jsx.call(void 0, "a",{href:x2.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"})]})}),_jsxruntime.jsx.call(void 0, xu,{}),_jsxruntime.jsx.call(void 0, hd,{children:"Set up your first wallet"}),_jsxruntime.jsx.call(void 0, xu,{}),_jsxruntime.jsx.call(void 0, hd,{children:"Store your recovery phrase in a safe place!"})]}),_jsxruntime.jsx.call(void 0, fn,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),k2=()=>{let{navigateBack:e}=_chunk3AGMJGHJjs.b.call(void 0, );return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:e},"header"),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsx.call(void 0, RE,{}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsxs.call(void 0, _chunkLEABMTNMjs.L,{children:[_jsxruntime.jsx.call(void 0, "span",{children:"Still not sure? "}),_jsxruntime.jsx.call(void 0, "a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},_E=_styledcomponents2.default.call(void 0, Mt)`
2037
+ gap: 30px;
2038
+
2039
+ > :first-child > svg {
2040
+ margin-top: 20px;
2041
+ }
2042
+ `;var IE={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",smart_wallet:"siwe",cross_app:"privy:",guest:"guest"},_n=e=>{let t=IE[e];return e==="wallet"||e==="phone"?{displayName:e,loginMethod:t}:{displayName:t,loginMethod:t}};var R2=()=>{let{app:e}=_chunk3AGMJGHJjs.b.call(void 0, ),t=_optionalChain([e, 'optionalAccess', _563 => _563.appearance, 'optionalAccess', _564 => _564.logo]),r=`${_optionalChain([e, 'optionalAccess', _565 => _565.name])} logo`,o={maxHeight:"90px",maxWidth:"180px"};return t?typeof t=="string"?_jsxruntime.jsx.call(void 0, "img",{src:t,alt:r,style:o}):t.type==="svg"||t.type==="img"?_react2.default.cloneElement(t,{alt:r,style:o}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null};var yd=e=>{let{app:t}=_chunk3AGMJGHJjs.b.call(void 0, );return _optionalChain([t, 'optionalAccess', _566 => _566.appearance, 'access', _567 => _567.logo])?_jsxruntime.jsx.call(void 0, NE,{...e,children:_jsxruntime.jsx.call(void 0, R2,{})}):null},NE=_styledcomponents2.default.div`
2043
+ display: flex;
2044
+ flex-direction: column;
2045
+ align-items: center;
2046
+ padding: 24px 0;
2047
+ flex-grow: 1;
2048
+ justify-content: center;
2049
+ `;var gd=_react.forwardRef.call(void 0, (e,t)=>{let[r,o]=_react.useState.call(void 0, e.defaultValue||""),[n,a]=_react.useState.call(void 0, !1),{authenticated:i}=_chunkXKAIXCX7js.ta.call(void 0, ),{initLoginWithEmail:s}=_chunkXKAIXCX7js.ra.call(void 0, ),{navigate:c,setModalData:d,currentScreen:u,data:f}=_chunk3AGMJGHJjs.b.call(void 0, ),{enabled:h,token:g}=Pe(),[w,v]=_react.useState.call(void 0, !1),{accountType:E}=_chunkLEABMTNMjs.P.call(void 0, ),_=_chunkLEABMTNMjs.f.call(void 0, r),A=n,T=n||!_,P=R=>{a(!0),s(r,R,_optionalChain([f, 'optionalAccess', _568 => _568.login, 'optionalAccess', _569 => _569.disableSignup])).then(()=>{c("AWAITING_PASSWORDLESS_CODE")}).catch(D=>{d({errorModalData:{error:D,previousScreen:u||"LANDING"}}),c("ERROR_SCREEN")}).finally(()=>{a(!1)})},S=()=>{h&&!g&&!i?(d({captchaModalData:{callback:R=>s(r,R),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN")):P(g)};return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, FE,{children:_jsxruntime.jsxs.call(void 0, BE,{stacked:e.stacked,children:[_jsxruntime.jsx.call(void 0, _EnvelopeIcon2.default,{}),_jsxruntime.jsx.call(void 0, "input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onFocus:()=>v(!0),onChange:R=>o(R.target.value),onKeyUp:R=>{R.key==="Enter"&&S()},value:r,autoComplete:"email"}),E==="email"&&!w?_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.N,{color:"gray",children:"Recent"}):e.stacked?_jsxruntime.jsx.call(void 0, "span",{}):_jsxruntime.jsx.call(void 0, ii,{isSubmitting:A,onClick:S,disabled:T,children:"Submit"})]})}),e.stacked?_jsxruntime.jsx.call(void 0, U,{loadingText:null,loading:A,disabled:T,onClick:S,children:"Submit"}):null]})}),FE=_styledcomponents2.default.div`
2050
+ width: 100%;
2051
+ `,BE=_styledcomponents2.default.label`
2052
+ display: block;
2053
+ position: relative;
2054
+ width: 100%;
2055
+
2056
+ > svg {
2057
+ position: absolute;
2058
+ margin: 13px 17px;
2059
+ height: 24px;
2060
+ width: 24px;
2061
+ color: var(--privy-color-foreground-3);
2062
+ }
2063
+
2064
+ && > input {
2065
+ font-size: 16px;
2066
+ line-height: 24px;
2067
+
2068
+ overflow: hidden;
2069
+ white-space: nowrap;
2070
+ text-overflow: ellipsis;
2071
+
2072
+ padding: 12px 88px 12px 52px;
2073
+ padding-right: ${e=>e.stacked?"16px":"88px"};
2074
+ flex-grow: 1;
2075
+ background: var(--privy-color-background);
2076
+ border: 1px solid var(--privy-color-foreground-4);
2077
+ border-radius: var(--privy-border-radius-mdlg);
2078
+ width: 100%;
2079
+
2080
+ /* Tablet and Up */
2081
+ @media (min-width: 441px) {
2082
+ font-size: 14px;
2083
+ padding-right: 78px;
2084
+ }
2085
+
2086
+ :focus {
2087
+ outline: none;
2088
+ border-color: var(--privy-color-accent);
2089
+ }
2090
+
2091
+ :autofill,
2092
+ :-webkit-autofill {
2093
+ background: var(--privy-color-background);
2094
+ }
2095
+ }
2096
+
2097
+ && > :last-child {
2098
+ right: 16px;
2099
+ position: absolute;
2100
+ top: 50%;
2101
+ transform: translate(0, -50%);
2102
+ }
2103
+
2104
+ && > button:last-child {
2105
+ right: 0px;
2106
+ line-height: 24px;
2107
+ padding: 13px 17px;
2108
+
2109
+ :focus {
2110
+ outline: none;
2111
+ border-color: var(--privy-color-accent);
2112
+ }
2113
+ }
2114
+
2115
+ && > input::placeholder {
2116
+ color: var(--privy-color-foreground-3);
2117
+ }
2118
+ `;var vd=({isEditable:e,setIsEditable:t,defaultValue:r})=>{let o=_react.useRef.call(void 0, null);return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, so,{if:!e,children:_jsxruntime.jsx.call(void 0, gd,{ref:o,defaultValue:r})}),_jsxruntime.jsx.call(void 0, so,{if:e,children:_jsxruntime.jsxs.call(void 0, Ae,{onClick:()=>{t(),setTimeout(()=>{_optionalChain([o, 'access', _570 => _570.current, 'optionalAccess', _571 => _571.focus, 'call', _572 => _572()])},0)},children:[_jsxruntime.jsx.call(void 0, _EnvelopeIcon2.default,{})," Continue with Email"]})})]})};var wd=()=>{let[e,t]=_react.useState.call(void 0, !1),{currentScreen:r,navigate:o,setModalData:n,data:a}=_chunk3AGMJGHJjs.b.call(void 0, ),{enabled:i,token:s}=Pe(),{initLoginWithFarcaster:c}=_chunkXKAIXCX7js.ra.call(void 0, ),{accountType:d}=_chunkLEABMTNMjs.P.call(void 0, );return _jsxruntime.jsxs.call(void 0, Ae,{onClick:async()=>{t(!0);try{i&&!s?(n({captchaModalData:{callback:f=>c(f,_optionalChain([a, 'optionalAccess', _573 => _573.login, 'optionalAccess', _574 => _574.disableSignup])),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):(await c(s,_optionalChain([a, 'optionalAccess', _575 => _575.login, 'optionalAccess', _576 => _576.disableSignup])),o("AWAITING_FARCASTER_CONNECTION"))}catch(f){n({errorModalData:{error:f,previousScreen:r||"LANDING"}}),o("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[_jsxruntime.jsx.call(void 0, Io,{})," Farcaster",e&&_jsxruntime.jsx.call(void 0, Ao,{}),d==="farcaster"&&_jsxruntime.jsx.call(void 0, YE,{color:"gray",children:"Recent"})]})},YE=_styledcomponents2.default.call(void 0, _chunkLEABMTNMjs.N)`
2119
+ margin-left: auto;
2120
+ `;var _examplesmobilejson = require('libphonenumber-js/examples.mobile.json'); var _examplesmobilejson2 = _interopRequireDefault(_examplesmobilejson);var _min = require('libphonenumber-js/min');var Gs=(e,t)=>_min.isPossiblePhoneNumber.call(void 0, String(e),t),Ed=(e,t)=>`+${_min.getCountryCallingCode.call(void 0, t)} ${e}`,O2=e=>`*${e.replaceAll("-","").slice(-4)}`,N2=e=>new (0, _min.AsYouType)(e),$E=_min.getCountries.call(void 0, ).map(e=>({code:e,callCode:_min.getCountryCallingCode.call(void 0, e)})),D2=e=>{let t=_optionalChain([_min.getExampleNumber.call(void 0, e,_examplesmobilejson2.default), 'optionalAccess', _577 => _577.formatInternational, 'call', _578 => _578()]);return _optionalChain([t, 'optionalAccess', _579 => _579.substring, 'call', _580 => _580(t.indexOf(" ")+1)])},U2=({value:e,onChange:t})=>_jsxruntime.jsx.call(void 0, "select",{value:e,onChange:t,children:$E.map(r=>_jsxruntime.jsxs.call(void 0, "option",{value:r.code,children:[r.code," +",r.callCode]},r.code))}),F2=e=>{let t=new _min.AsYouType;t.input(e);let r=t.getCountry()||"US",o=t.getCallingCode()||"1";return{countryCode:r,phone:e.replace("+"+o,"")}};var Mn=_react.forwardRef.call(void 0, (e,t)=>{let{app:r}=_chunk3AGMJGHJjs.b.call(void 0, ),[o,n]=_react.useState.call(void 0, !1),{accountType:a}=_chunkLEABMTNMjs.P.call(void 0, ),[i,s]=_react.useState.call(void 0, ""),[c,d]=_react.useState.call(void 0, _nullishCoalesce(_optionalChain([r, 'optionalAccess', _581 => _581.intl, 'access', _582 => _582.defaultCountry]), () => ("US"))),u=Gs(i,c),f=N2(c),h=D2(c),g=_min.getCountryCallingCode.call(void 0, c),w=!u,[v,E]=_react.useState.call(void 0, !1),_=g.length,A=S=>{let R=S.target.value;d(R),s(""),e.onChange&&e.onChange({rawPhoneNumber:i,qualifiedPhoneNumber:Ed(i,R),countryCode:R,isValid:Gs(i,c)})},T=(S,R)=>{try{let D=S.replace(/\D/g,""),F=i.replace(/\D/g,""),B=D===F?S:f.input(S);s(B),e.onChange&&e.onChange({rawPhoneNumber:B,qualifiedPhoneNumber:Ed(S,R),countryCode:R,isValid:Gs(S,R)})}catch(D){console.error("Error processing phone number:",D)}},P=()=>{E(!0);let S=Ed(i,c);e.onSubmit({rawPhoneNumber:i,qualifiedPhoneNumber:S,countryCode:c,isValid:Gs(i,c)}).finally(()=>E(!1))};return _react.useEffect.call(void 0, ()=>{if(e.defaultValue){let S=F2(e.defaultValue);f.reset(),A({target:{value:S.countryCode}}),T(S.phone,S.countryCode)}},[e.defaultValue]),_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, n8,{children:_jsxruntime.jsxs.call(void 0, a8,{callingCodeLength:_,stacked:e.stacked,children:[_jsxruntime.jsx.call(void 0, U2,{value:c,onChange:A}),_jsxruntime.jsx.call(void 0, "input",{ref:t,id:"phone-number-input",type:"tel",placeholder:h,onFocus:()=>n(!0),onChange:S=>{T(S.target.value,c)},onKeyUp:S=>{S.key==="Enter"&&P()},value:i,autoComplete:"tel"}),a==="phone"&&!o&&!e.hideRecent?_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.N,{color:"gray",children:"Recent"}):!e.stacked&&!e.noIncludeSubmitButton?_jsxruntime.jsx.call(void 0, ii,{isSubmitting:v,onClick:P,disabled:w,children:"Submit"}):_jsxruntime.jsx.call(void 0, "span",{})]})}),e.stacked&&!e.noIncludeSubmitButton?_jsxruntime.jsx.call(void 0, U,{loading:v,loadingText:null,onClick:P,disabled:w,children:"Submit"}):null]})}),n8=_styledcomponents2.default.div`
2121
+ width: 100%;
2122
+ `,a8=_styledcomponents2.default.label`
2123
+ --country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.callingCodeLength}px));
2124
+ --phone-input-extra-padding-left: calc(12px + calc(3 * ${e=>e.callingCodeLength}px));
2125
+ display: block;
2126
+ position: relative;
2127
+ width: 100%;
2128
+
2129
+ /* Tablet and Up */
2130
+ @media (min-width: 441px) {
2131
+ --country-code-dropdown-width: calc(52px + calc(10 * ${e=>e.callingCodeLength}px));
2132
+ }
2133
+
2134
+ && > select {
2135
+ font-size: 16px;
2136
+ height: 24px;
2137
+ position: absolute;
2138
+ margin: 13px calc(var(--country-code-dropdown-width) / 4);
2139
+ line-height: 24px;
2140
+ width: var(--country-code-dropdown-width);
2141
+ background-color: var(--privy-color-background);
2142
+ background-size: auto;
2143
+ background-position-x: right;
2144
+ cursor: pointer;
2145
+
2146
+ /* Tablet and Up */
2147
+ @media (min-width: 441px) {
2148
+ font-size: 14px;
2149
+ width: var(--country-code-dropdown-width);
2150
+ }
2151
+
2152
+ :focus {
2153
+ outline: none;
2154
+ box-shadow: none;
2155
+ }
2156
+ }
2157
+
2158
+ && > input {
2159
+ font-size: 16px;
2160
+ line-height: 24px;
2161
+
2162
+ overflow: hidden;
2163
+ white-space: nowrap;
2164
+ text-overflow: ellipsis;
2165
+
2166
+ width: calc(100% - var(--country-code-dropdown-width));
2167
+
2168
+ padding: 12px 88px 12px
2169
+ calc(var(--country-code-dropdown-width) + var(--phone-input-extra-padding-left));
2170
+ padding-right: ${e=>e.stacked?"16px":"88px"};
2171
+ flex-grow: 1;
2172
+ background: var(--privy-color-background);
2173
+ border: 1px solid var(--privy-color-foreground-4);
2174
+ border-radius: var(--privy-border-radius-mdlg);
2175
+ width: 100%;
2176
+
2177
+ :focus {
2178
+ outline: none;
2179
+ border-color: var(--privy-color-accent);
2180
+ }
2181
+
2182
+ :autofill,
2183
+ :-webkit-autofill {
2184
+ background: var(--privy-color-background);
2185
+ }
2186
+
2187
+ /* Tablet and Up */
2188
+ @media (min-width: 441px) {
2189
+ font-size: 14px;
2190
+ padding-right: 78px;
2191
+ }
2192
+ }
2193
+
2194
+ && > :last-child {
2195
+ right: 16px;
2196
+ position: absolute;
2197
+ top: 50%;
2198
+ transform: translate(0, -50%);
2199
+ }
2200
+
2201
+ && > button:last-child {
2202
+ right: 0px;
2203
+ line-height: 24px;
2204
+ padding: 13px 17px;
2205
+
2206
+ :focus {
2207
+ outline: none;
2208
+ border-color: var(--privy-color-accent);
2209
+ }
2210
+ }
2211
+
2212
+ && > input::placeholder {
2213
+ color: var(--privy-color-foreground-3);
2214
+ }
2215
+ `;var Pd=({isEditable:e,setIsEditable:t,defaultValue:r})=>{let o=_react.useRef.call(void 0, null),{authenticated:n}=_chunkXKAIXCX7js.ta.call(void 0, ),{navigate:a,setModalData:i,currentScreen:s,data:c}=_chunk3AGMJGHJjs.b.call(void 0, ),{initLoginWithSms:d}=_chunkXKAIXCX7js.ra.call(void 0, ),{enabled:u,token:f}=Pe();async function h({qualifiedPhoneNumber:g}){if(u&&!f&&!n)i({captchaModalData:{callback:w=>d(g,w,_optionalChain([c, 'optionalAccess', _583 => _583.login, 'optionalAccess', _584 => _584.disableSignup])),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),a("CAPTCHA_SCREEN");else try{await d(g,f,_optionalChain([c, 'optionalAccess', _585 => _585.login, 'optionalAccess', _586 => _586.disableSignup])),a("AWAITING_PASSWORDLESS_CODE")}catch(w){i({errorModalData:{error:w,previousScreen:s||"LANDING"}}),a("ERROR_SCREEN")}}return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, so,{if:!e,children:_jsxruntime.jsx.call(void 0, Mn,{ref:o,onSubmit:h,defaultValue:r})}),_jsxruntime.jsx.call(void 0, so,{if:e,children:_jsxruntime.jsxs.call(void 0, Ae,{onClick:()=>{t(),setTimeout(()=>{_optionalChain([o, 'access', _587 => _587.current, 'optionalAccess', _588 => _588.focus, 'call', _589 => _589()])},0)},children:[_jsxruntime.jsx.call(void 0, _PhoneIcon2.default,{})," Continue with SMS"]})})]})};var u8={apple:{logo:_jsxruntime.jsx.call(void 0, Vl,{}),displayName:"Apple"},discord:{logo:_jsxruntime.jsx.call(void 0, Gl,{}),displayName:"Discord"},github:{logo:_jsxruntime.jsx.call(void 0, ql,{}),displayName:"GitHub"},google:{logo:_jsxruntime.jsx.call(void 0, Kl,{}),displayName:"Google"},linkedin:{logo:_jsxruntime.jsx.call(void 0, Zl,{}),displayName:"LinkedIn"},spotify:{logo:_jsxruntime.jsx.call(void 0, Jl,{}),displayName:"Spotify"},instagram:{logo:_jsxruntime.jsx.call(void 0, Ql,{}),displayName:"Instagram"},twitter:{logo:_jsxruntime.jsx.call(void 0, $l,{}),displayName:"Twitter"},tiktok:{logo:_jsxruntime.jsx.call(void 0, jl,{}),displayName:"TikTok"}},ft=({provider:e})=>{let{enabled:t,token:r}=Pe(),{navigate:o,setModalData:n,data:a}=_chunk3AGMJGHJjs.b.call(void 0, ),[i,s]=_react.useState.call(void 0, !1),{initLoginWithOAuth:c}=_chunkXKAIXCX7js.ra.call(void 0, ),{accountType:d}=_chunkLEABMTNMjs.P.call(void 0, ),u=d?_n(d):null,{displayName:f,logo:h}=u8[e];return _jsxruntime.jsxs.call(void 0, Ae,{onClick:()=>{s(!0),t&&!r?(n({captchaModalData:{callback:w=>c(e,w,_optionalChain([a, 'optionalAccess', _590 => _590.login, 'optionalAccess', _591 => _591.disableSignup])),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),o("CAPTCHA_SCREEN")):c(e,void 0,_optionalChain([a, 'optionalAccess', _592 => _592.login, 'optionalAccess', _593 => _593.disableSignup]))},disabled:i,children:[h," ",f,_optionalChain([u, 'optionalAccess', _594 => _594.loginMethod])===e&&_jsxruntime.jsx.call(void 0, m8,{color:"gray",children:"Recent"})]})},m8=_styledcomponents2.default.call(void 0, _chunkLEABMTNMjs.N)`
2216
+ margin-left: auto;
2217
+ `;function Ad(e){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...e,children:[_jsxruntime.jsx.call(void 0, "defs",{children:_jsxruntime.jsxs.call(void 0, "linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[_jsxruntime.jsx.call(void 0, "stop",{offset:"0",stopColor:"#1d93d2"}),_jsxruntime.jsx.call(void 0, "stop",{offset:"1",stopColor:"#38b0e3"})]})}),_jsxruntime.jsx.call(void 0, "title",{children:"Telegram_logo"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "path",{d:"M81.486,130.178,52.2,120.636s-3.5-1.42-2.373-4.64c.232-.664.7-1.229,2.1-2.2,6.489-4.523,120.106-45.36,120.106-45.36s3.208-1.081,5.1-.362a2.766,2.766,0,0,1,1.885,2.055,9.357,9.357,0,0,1,.254,2.585c-.009.752-.1,1.449-.169,2.542-.692,11.165-21.4,94.493-21.4,94.493s-1.239,4.876-5.678,5.043A8.13,8.13,0,0,1,146.1,172.5c-8.711-7.493-38.819-27.727-45.472-32.177a1.27,1.27,0,0,1-.546-.9c-.093-.469.417-1.05.417-1.05s52.426-46.6,53.821-51.492c.108-.379-.3-.566-.848-.4-3.482,1.281-63.844,39.4-70.506,43.607A3.21,3.21,0,0,1,81.486,130.178Z",fill:"#fff"})]})}var xd=()=>{let{enabled:e,token:t}=Pe(),{navigate:r,setModalData:o,data:n}=_chunk3AGMJGHJjs.b.call(void 0, ),[a,i]=_react.useState.call(void 0, !1),{initLoginWithTelegram:s}=_chunkXKAIXCX7js.ra.call(void 0, ),{accountType:c}=_chunkLEABMTNMjs.P.call(void 0, );async function d(f){try{await s(f,_optionalChain([n, 'optionalAccess', _595 => _595.login, 'optionalAccess', _596 => _596.disableSignup])),r("TELEGRAM_AUTH_SCREEN")}catch(h){console.error(h),i(!1)}}async function u(){if(i(!0),e&&!t){o({captchaModalData:{callback:d,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN");return}await d()}return _jsxruntime.jsxs.call(void 0, Ae,{onClick:u,disabled:a,children:[_jsxruntime.jsx.call(void 0, Ad,{}),"Telegram",c==="telegram"&&_jsxruntime.jsx.call(void 0, g8,{color:"gray",children:"Recent"})]})},g8=_styledcomponents2.default.call(void 0, _chunkLEABMTNMjs.N)`
2218
+ margin-left: auto;
2219
+ `;var kd=({onClick:e,text:t,icon:r})=>_jsxruntime.jsxs.call(void 0, Ae,{onClick:e,children:[r,_jsxruntime.jsx.call(void 0, Xt,{children:t}),_jsxruntime.jsx.call(void 0, _ChevronRightIcon2.default,{})]});var Md=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=_chunkXKAIXCX7js.ra.call(void 0, ),{app:o,onUserCloseViaDialogOrKeybindRef:n,data:a}=_chunk3AGMJGHJjs.b.call(void 0, ),{appearance:{palette:{colorScheme:i}}}=_chunkXKAIXCX7js.oa.call(void 0, ),{accountType:s,walletClientType:c}=_chunkLEABMTNMjs.P.call(void 0, ),d=s?_n(s):null,u=_nullishCoalesce(_optionalChain([o, 'access', _597 => _597.loginMethodsAndOrder, 'optionalAccess', _598 => _598.primary]), () => ([])),f=_nullishCoalesce(_optionalChain([o, 'access', _599 => _599.loginMethodsAndOrder, 'optionalAccess', _600 => _600.overflow]), () => ([])),h=[...u,...f],g=o.loginMethods.passkey,w=_optionalChain([a, 'optionalAccess', _601 => _601.login]),v=[];c&&h.includes(c)?v.push(c):s&&h.includes(_optionalChain([d, 'optionalAccess', _602 => _602.loginMethod]))&&v.push(_optionalChain([d, 'optionalAccess', _603 => _603.loginMethod]));let[E,_]=_react.useState.call(void 0, "default"),[A,T]=_react.useState.call(void 0, s==="phone"?"sms":"email");_react.useEffect.call(void 0, ()=>{s==="phone"&&T("sms");let Q=h.indexOf("sms"),xe=h.indexOf("email");Q>-1&&Q<xe&&T("sms")},[s,u,f]);let P=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{_("default")},150)};n.current=P;let S=Q=>Q==="email"?_jsxruntime.jsx.call(void 0, vd,{isEditable:A==="email",setIsEditable:()=>{T("email")},defaultValue:_optionalChain([w, 'optionalAccess', _604 => _604.prefill, 'optionalAccess', _605 => _605.type])==="email"?w.prefill.value:void 0},Q):Q==="sms"?_jsxruntime.jsx.call(void 0, Pd,{isEditable:A==="sms",setIsEditable:()=>{T("sms")},defaultValue:_optionalChain([w, 'optionalAccess', _606 => _606.prefill, 'optionalAccess', _607 => _607.type])==="phone"?w.prefill.value:void 0},Q):Q==="apple"?_jsxruntime.jsx.call(void 0, ft,{provider:"apple"},Q):Q==="discord"?_jsxruntime.jsx.call(void 0, ft,{provider:"discord"},Q):Q==="farcaster"?_jsxruntime.jsx.call(void 0, wd,{},Q):Q==="github"?_jsxruntime.jsx.call(void 0, ft,{provider:"github"},Q):Q==="google"?_jsxruntime.jsx.call(void 0, ft,{provider:"google"},Q):Q==="linkedin"?_jsxruntime.jsx.call(void 0, ft,{provider:"linkedin"},Q):Q==="spotify"?_jsxruntime.jsx.call(void 0, ft,{provider:"spotify"},Q):Q==="instagram"?_jsxruntime.jsx.call(void 0, ft,{provider:"instagram"},Q):Q==="tiktok"?_jsxruntime.jsx.call(void 0, ft,{provider:"tiktok"},Q):Q==="twitter"?_jsxruntime.jsx.call(void 0, ft,{provider:"twitter"},Q):Q==="telegram"?_jsxruntime.jsx.call(void 0, xd,{},Q):Cn([Q],o.appearance.walletChainType,r,e,h,o.externalWallets.walletConnect.enabled),R=v.flatMap(S),D=u.filter(Q=>Q!==c&&Q!==_optionalChain([d, 'optionalAccess', _608 => _608.loginMethod])).flatMap(S),F=f.filter(Q=>Q!==c&&Q!==_optionalChain([d, 'optionalAccess', _609 => _609.loginMethod])).flatMap(S),B=[...R,...D,...F],K=S8({primary:D.length+R.length,overflow:F.length}),[W,X]=_chunkLEABMTNMjs.e.call(void 0, B,K),L=E==="default"?void 0:()=>{_("default")};return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{title:o.appearance.landingHeader,onClose:P,backFn:L}),E==="default"&&_jsxruntime.jsx.call(void 0, P8,{}),E==="default"&&(typeof o.appearance.loginMessage=="string"?_jsxruntime.jsx.call(void 0, hc,{children:o.appearance.loginMessage}):o.appearance.loginMessage),_jsxruntime.jsx.call(void 0, fc,{style:{overflow:"hidden"},children:_jsxruntime.jsxs.call(void 0, Yh,{colorScheme:i,style:{maxHeight:400,overflowY:"scroll",padding:2},children:[E==="default"&&_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[...W,X.length>0&&_jsxruntime.jsx.call(void 0, kd,{text:"More options",icon:_jsxruntime.jsx.call(void 0, _UserCircleIcon2.default,{}),onClick:()=>_("overflow")})]}),E==="overflow"&&_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[...X]}),g&&E==="default"&&_jsxruntime.jsx.call(void 0, ud,{})]})}),o&&_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.J,{app:o}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})},Rd=5,S8=({primary:e,overflow:t})=>e<Rd?e:e===Rd&&t===0?Rd:Rd-1,P8=_styledcomponents2.default.call(void 0, yd)`
2220
+ margin-bottom: 16px;
2221
+ `;var Q2=({...e})=>_jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[_jsxruntime.jsxs.call(void 0, "g",{clipPath:"url(#clip0_2856_1743)",children:[_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"})]}),_jsxruntime.jsx.call(void 0, "defs",{children:_jsxruntime.jsx.call(void 0, "clipPath",{id:"clip0_2856_1743",children:_jsxruntime.jsx.call(void 0, "rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]});var Id=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=_chunkXKAIXCX7js.ra.call(void 0, ),{data:o,onUserCloseViaDialogOrKeybindRef:n}=_chunk3AGMJGHJjs.b.call(void 0, ),a=_chunkXKAIXCX7js.oa.call(void 0, ),{accountType:i,walletClientType:s}=_chunkLEABMTNMjs.P.call(void 0, ),c=i?_n(i):null,d=_optionalChain([o, 'optionalAccess', _610 => _610.login]),u=_react.useMemo.call(void 0, ()=>_optionalChain([d, 'optionalAccess', _611 => _611.loginMethods])?_jssdkcore.toObjectKeys.call(void 0, d.loginMethods,!0):null,[d]),{email:f,sms:h,google:g,twitter:w,discord:v,github:E,spotify:_,instagram:A,tiktok:T,linkedin:P,apple:S,wallet:R,farcaster:D,telegram:F}=_nullishCoalesce(u, () => (a.loginMethods)),{passkey:B}=a.loginMethods,K=[f&&"email",h&&"sms",g&&"google",w&&"twitter",v&&"discord",E&&"github",_&&"spotify",A&&"instagram",T&&"tiktok",P&&"linkedin",S&&"apple",D&&"farcaster",F&&"telegram"].filter(le=>!!le),W=K.length>0,X=_react.useMemo.call(void 0, ()=>R&&!W?"web3-first":R&&_optionalChain([a, 'optionalAccess', _612 => _612.appearance, 'access', _613 => _613.loginGroupPriority])||"web2-first",[R,W,_optionalChain([a, 'optionalAccess', _614 => _614.appearance, 'access', _615 => _615.loginGroupPriority])]),L=_optionalChain([a, 'optionalAccess', _616 => _616.appearance, 'access', _617 => _617.hideDirectWeb2Inputs]),[Q,xe]=_react.useState.call(void 0, "default"),[he,$]=_react.useState.call(void 0, J2({mostRecentlyUsedAccountType:i,smsAvailable:h,emailAvailable:f,prefilledType:_optionalChain([d, 'optionalAccess', _618 => _618.prefill, 'optionalAccess', _619 => _619.type])}));_react.useEffect.call(void 0, ()=>{$(J2({mostRecentlyUsedAccountType:i,smsAvailable:h,emailAvailable:f,prefilledType:_optionalChain([d, 'optionalAccess', _620 => _620.prefill, 'optionalAccess', _621 => _621.type])}))},[f,h,i]);let Y=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{xe("default")},150)};n.current=Y;let ke=[];s&&R?ke.push(s):_optionalChain([c, 'optionalAccess', _622 => _622.loginMethod])&&K.includes(c.loginMethod)&&ke.push(c.loginMethod);let ye=le=>le==="email"?_jsxruntime.jsx.call(void 0, vd,{isEditable:he==="email",setIsEditable:()=>{$("email")},defaultValue:_optionalChain([d, 'optionalAccess', _623 => _623.prefill, 'optionalAccess', _624 => _624.type])==="email"?d.prefill.value:void 0},le):le==="sms"?_jsxruntime.jsx.call(void 0, Pd,{isEditable:he==="sms",setIsEditable:()=>{$("sms")},defaultValue:_optionalChain([d, 'optionalAccess', _625 => _625.prefill, 'optionalAccess', _626 => _626.type])==="phone"?d.prefill.value:void 0},le):le==="apple"?_jsxruntime.jsx.call(void 0, ft,{provider:"apple"},le):le==="discord"?_jsxruntime.jsx.call(void 0, ft,{provider:"discord"},le):le==="farcaster"?_jsxruntime.jsx.call(void 0, wd,{},le):le==="github"?_jsxruntime.jsx.call(void 0, ft,{provider:"github"},le):le==="google"?_jsxruntime.jsx.call(void 0, ft,{provider:"google"},le):le==="linkedin"?_jsxruntime.jsx.call(void 0, ft,{provider:"linkedin"},le):le==="tiktok"?_jsxruntime.jsx.call(void 0, ft,{provider:"tiktok"},le):le==="spotify"?_jsxruntime.jsx.call(void 0, ft,{provider:"spotify"},le):le==="instagram"?_jsxruntime.jsx.call(void 0, ft,{provider:"instagram"},le):le==="twitter"?_jsxruntime.jsx.call(void 0, ft,{provider:"twitter"},le):le==="telegram"?_jsxruntime.jsx.call(void 0, xd,{},le):Cn([le],a.appearance.walletChainType,r,e,[],a.externalWallets.walletConnect.enabled),te=Cn(a.appearance.walletList.filter(le=>le!==s),a.appearance.walletChainType,r,e,[...a.appearance.walletList,s],a.externalWallets.walletConnect.enabled),se=K.filter(le=>le!==_optionalChain([c, 'optionalAccess', _627 => _627.loginMethod])).flatMap(ye),Ge=ke.flatMap(ye);X==="web3-first"&&Q==="default"?te.unshift(...Ge):X==="web2-first"&&se.unshift(...Ge);let Qe=Q==="default"?void 0:()=>{xe("default")},ce=K.filter(le=>le!=="email"&&le!=="sms"),pt=W8({priority:X,email:f,sms:h,social:ce}),or=L8({priority:X,email:f,sms:h,social:ce}),wt=O8({priority:X}),Ee=_jsxruntime.jsx.call(void 0, md,{text:wt,onClick:()=>xe("web3-overflow")}),ue=_jsxruntime.jsx.call(void 0, kd,{text:pt,icon:or,onClick:()=>xe("web2-overflow")}),M=L?0:1;return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{title:a.appearance.landingHeader,onClose:Y,backFn:Qe}),Q==="default"&&_jsxruntime.jsx.call(void 0, I8,{}),Q==="default"&&(typeof a.appearance.loginMessage=="string"?_jsxruntime.jsx.call(void 0, hc,{children:a.appearance.loginMessage}):a.appearance.loginMessage),_jsxruntime.jsx.call(void 0, fc,{style:{overflow:"hidden",padding:2},children:_jsxruntime.jsxs.call(void 0, pr,{children:[Q==="default"&&X==="web2-first"&&_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[...se.length>4?se.slice(0,3):se,se.length>4&&ue,R&&Ee]}),Q==="default"&&X==="web3-first"&&_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[R&&_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[...te.length>4?te.slice(0,3):te,te.length>4&&Ee]}),se.length>M&&ue,se.length===M&&se[0]]}),Q==="web2-overflow"&&_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[...X==="web3-first"?se:se.slice(3)]}),...Q==="web3-overflow"?te:[],B&&Q==="default"&&_jsxruntime.jsx.call(void 0, ud,{})]})}),a&&_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.J,{app:a}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})},I8=_styledcomponents2.default.call(void 0, yd)`
2222
+ margin-bottom: 16px;
2223
+ `,W8=({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",L8=({priority:e,email:t,sms:r,social:o})=>e==="web2-first"||o.length>0?_jsxruntime.jsx.call(void 0, _UserCircleIcon2.default,{}):t&&r?_jsxruntime.jsx.call(void 0, Q2,{}):t?_jsxruntime.jsx.call(void 0, _EnvelopeIcon2.default,{}):r?_jsxruntime.jsx.call(void 0, _PhoneIcon2.default,{}):null,O8=({priority:e})=>e==="web2-first"?"Continue with a wallet":"Other wallets",J2=({mostRecentlyUsedAccountType:e,smsAvailable:t,emailAvailable:r,prefilledType:o})=>r&&(e==="email"&&o!=="phone"||o==="email")?"email":t&&(e==="phone"||o==="phone")?"sms":"email";var $2=()=>{let{app:e}=_chunk3AGMJGHJjs.b.call(void 0, );return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?_jsxruntime.jsx.call(void 0, Md,{connectOnly:!0}):_jsxruntime.jsx.call(void 0, Id,{connectOnly:!0})};var tC=()=>{let{app:e}=_chunk3AGMJGHJjs.b.call(void 0, );return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?_jsxruntime.jsx.call(void 0, Md,{connectOnly:!1}):_jsxruntime.jsx.call(void 0, Id,{connectOnly:!1})};var rC=()=>{let{app:e}=_chunk3AGMJGHJjs.b.call(void 0, );return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{},"header"),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsx.call(void 0, Ce,{title:"Connect your email",description:`Add your email to your ${_optionalChain([e, 'optionalAccess', _628 => _628.name])} account`,icon:_jsxruntime.jsx.call(void 0, _EnvelopeIcon2.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),_jsxruntime.jsx.call(void 0, hr,{children:_jsxruntime.jsx.call(void 0, gd,{stacked:!0})}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})};var oC=()=>{let{app:e,currentScreen:t,data:r,navigate:o,setModalData:n}=_chunk3AGMJGHJjs.b.call(void 0, ),{initLoginWithSms:a}=_chunkXKAIXCX7js.ra.call(void 0, );async function i({qualifiedPhoneNumber:s}){try{await a(s),o("AWAITING_PASSWORDLESS_CODE")}catch(c){n({errorModalData:{error:c,previousScreen:_optionalChain([r, 'optionalAccess', _629 => _629.errorModalData, 'optionalAccess', _630 => _630.previousScreen])||t||"LINK_PHONE_SCREEN"}}),o("ERROR_SCREEN")}}return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{},"header"),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsx.call(void 0, Ce,{title:"Connect your phone",description:`Add your number to your ${_optionalChain([e, 'optionalAccess', _631 => _631.name])} account`,icon:_jsxruntime.jsx.call(void 0, _PhoneIcon2.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),_jsxruntime.jsx.call(void 0, hr,{children:_jsxruntime.jsx.call(void 0, Mn,{stacked:!0,onSubmit:i,hideRecent:!0})}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})};var aC=()=>{let{app:e,data:t}=_chunk3AGMJGHJjs.b.call(void 0, ),r=_optionalChain([t, 'optionalAccess', _632 => _632.externalConnectWallet, 'optionalAccess', _633 => _633.suggestedAddress]),o=r?_jsxruntime.jsxs.call(void 0, "span",{children:["Link the wallet with address ",_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.Q,{showCopyIcon:!1,address:r})," ",_optionalChain([e, 'optionalAccess', _634 => _634.name])?`to ${e.name}.`:"."]}):`Link a wallet to your ${_optionalChain([e, 'optionalAccess', _635 => _635.name])} account`;return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{},"header"),_jsxruntime.jsx.call(void 0, Ro,{title:"Link your wallet",description:o}),_jsxruntime.jsx.call(void 0, pr,{children:_jsxruntime.jsx.call(void 0, hi,{connectOnly:!1})}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})};var sC=({style:e,...t})=>_jsxruntime.jsxs.call(void 0, "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:[_jsxruntime.jsx.call(void 0, "circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),_jsxruntime.jsx.call(void 0, "path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});var cC=()=>{let{closePrivyModal:e}=_chunkXKAIXCX7js.ra.call(void 0, ),{navigate:t}=_chunk3AGMJGHJjs.b.call(void 0, );return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{},"header"),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsx.call(void 0, sC,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),_jsxruntime.jsx.call(void 0, Ro,{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"}}),_jsxruntime.jsxs.call(void 0, hr,{children:[_jsxruntime.jsx.call(void 0, U,{onClick:()=>t("LANDING"),children:"Try again"}),_jsxruntime.jsx.call(void 0, io,{onClick:()=>e(),children:"Cancel"})]}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})};var _DevicePhoneMobileIcon = require('@heroicons/react/24/solid/DevicePhoneMobileIcon'); var _DevicePhoneMobileIcon2 = _interopRequireDefault(_DevicePhoneMobileIcon);var _IdentificationIcon = require('@heroicons/react/24/solid/IdentificationIcon'); var _IdentificationIcon2 = _interopRequireDefault(_IdentificationIcon);var _PhoneIcon3 = require('@heroicons/react/24/solid/PhoneIcon'); var _PhoneIcon4 = _interopRequireDefault(_PhoneIcon3);var _QuestionMarkCircleIcon3 = require('@heroicons/react/24/solid/QuestionMarkCircleIcon'); var _QuestionMarkCircleIcon4 = _interopRequireDefault(_QuestionMarkCircleIcon3);var _ShieldCheckIcon = require('@heroicons/react/24/solid/ShieldCheckIcon'); var _ShieldCheckIcon2 = _interopRequireDefault(_ShieldCheckIcon);function Ks(){let{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}=_react.useContext.call(void 0, _chunkXKAIXCX7js.sa);return{promptMfa:e,init:t,submit:r,cancel:o,mfaMethods:n}}function fo(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:a,unenroll:i,enrollInMfa:s}=_react.useContext.call(void 0, _chunkXKAIXCX7js.sa);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:o,submitEnrollmentWithTotp:n,submitEnrollmentWithPasskey:a,unenrollWithSms:()=>i("sms"),unenrollWithTotp:()=>i("totp"),unenrollWithPasskey:()=>i("passkey"),showMfaEnrollmentModal:()=>s(!0),closeMfaEnrollmentModal:()=>s(!1)}}var pC=e=>_jsxruntime.jsxs.call(void 0, Q8,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[_jsxruntime.jsx.call(void 0, "rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),_jsxruntime.jsx.call(void 0, "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"})]}),Q8=_styledcomponents2.default.svg`
2224
+ height: 90px;
2225
+ width: 90px;
2226
+
2227
+ > rect {
2228
+ ${e=>e.color==="success"?"fill: var(--privy-color-success);":"fill: var(--privy-color-accent);"}
2229
+ }
2230
+
2231
+ > path {
2232
+ fill: white;
2233
+ }
2234
+ `;var _DevicePhoneMobileIcon3 = require('@heroicons/react/24/outline/DevicePhoneMobileIcon'); var _DevicePhoneMobileIcon4 = _interopRequireDefault(_DevicePhoneMobileIcon3);var _FingerPrintIcon = require('@heroicons/react/24/outline/FingerPrintIcon'); var _FingerPrintIcon2 = _interopRequireDefault(_FingerPrintIcon);var uC=({showIntro:e,userMfaMethods:t,appMfaMethods:r,userHasAuthSms:o,isTotpLoading:n,isPasskeyLoading:a,error:i,onClose:s,onBackToIntro:c,handleSelectMethod:d,setRemovingMfaMethod:u})=>{let f=t.reduce((g,w)=>({...g,[w]:!0}),{}),h=r.reduce((g,w)=>({...g,[w]:!0}),{});return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:e?c:void 0,onClose:s},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsx.call(void 0, ot,{children:_jsxruntime.jsx.call(void 0, _ShieldCheckIcon2.default,{})})}),_jsxruntime.jsx.call(void 0, me,{children:"Choose a verification method"}),t.length>0?_jsxruntime.jsx.call(void 0, ge,{children:"To add or delete verification methods, verification is required."}):_jsxruntime.jsx.call(void 0, ge,{children:"How would you like to verify your identity? You can change this later."}),i&&_jsxruntime.jsx.call(void 0, bc,{style:{marginTop:"1.25rem"},children:i.message}),_jsxruntime.jsxs.call(void 0, yc,{children:[(h.totp||f.totp)&&_jsxruntime.jsxs.call(void 0, gc,{children:[_jsxruntime.jsx.call(void 0, Ae,{style:{justifyContent:"center"},disabled:f.totp||n,onClick:()=>d("totp"),children:n?_jsxruntime.jsx.call(void 0, mt,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):_jsxruntime.jsxs.call(void 0, wc,{children:[_jsxruntime.jsxs.call(void 0, vc,{children:[_jsxruntime.jsx.call(void 0, _DevicePhoneMobileIcon4.default,{}),"Authenticator App"]}),f.totp?_jsxruntime.jsxs.call(void 0, da,{children:[_jsxruntime.jsx.call(void 0, _CheckIcon2.default,{}),"Added"]}):_jsxruntime.jsx.call(void 0, da,{children:"Recommended"})]})}),f.totp&&_jsxruntime.jsx.call(void 0, Cc,{onClick:()=>u("totp"),children:_jsxruntime.jsx.call(void 0, _TrashIcon2.default,{})})]},"totp"),(h.sms||f.sms)&&_jsxruntime.jsxs.call(void 0, gc,{children:[_jsxruntime.jsx.call(void 0, Ae,{disabled:f.sms||o,onClick:()=>d("sms"),children:_jsxruntime.jsxs.call(void 0, wc,{children:[_jsxruntime.jsxs.call(void 0, vc,{children:[_jsxruntime.jsx.call(void 0, _PhoneIcon2.default,{}),"SMS"]}),f.sms&&_jsxruntime.jsxs.call(void 0, da,{children:[_jsxruntime.jsx.call(void 0, _CheckIcon2.default,{}),"Added"]}),o&&_jsxruntime.jsx.call(void 0, da,{children:"Disabled"})]})}),f.sms&&_jsxruntime.jsx.call(void 0, Cc,{onClick:()=>u("sms"),children:_jsxruntime.jsx.call(void 0, _TrashIcon2.default,{})})]},"sms"),(h.passkey||f.passkey)&&_jsxruntime.jsxs.call(void 0, gc,{children:[_jsxruntime.jsx.call(void 0, Ae,{style:{justifyContent:"center"},onClick:()=>d("passkey"),disabled:f.passkey||a,children:a?_jsxruntime.jsx.call(void 0, mt,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):_jsxruntime.jsxs.call(void 0, wc,{children:[_jsxruntime.jsxs.call(void 0, vc,{children:[_jsxruntime.jsx.call(void 0, _FingerPrintIcon2.default,{}),"Passkey"]}),f.passkey?_jsxruntime.jsxs.call(void 0, da,{children:[_jsxruntime.jsx.call(void 0, _CheckIcon2.default,{}),"Added"]}):_jsxruntime.jsx.call(void 0, da,{isAccent:!0,children:_jsxruntime.jsx.call(void 0, _ChevronRightIcon2.default,{})})]})}),f.passkey&&_jsxruntime.jsx.call(void 0, Cc,{onClick:()=>u("passkey"),children:_jsxruntime.jsx.call(void 0, _TrashIcon2.default,{})})]},"passkey")]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]})};var _ArrowRightEndOnRectangleIcon = require('@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon'); var _ArrowRightEndOnRectangleIcon2 = _interopRequireDefault(_ArrowRightEndOnRectangleIcon);var _ShieldCheckIcon3 = require('@heroicons/react/24/outline/ShieldCheckIcon'); var _ShieldCheckIcon4 = _interopRequireDefault(_ShieldCheckIcon3);var fC=({onComplete:e,onClose:t,onReset:r})=>{let{user:o}=_chunkXKAIXCX7js.ta.call(void 0, ),{data:n}=_chunk3AGMJGHJjs.b.call(void 0, ),{initLinkWithPasskey:a,linkWithPasskey:i}=_chunkXKAIXCX7js.ra.call(void 0, ),{initEnrollmentWithPasskey:s,submitEnrollmentWithPasskey:c}=fo(),[d,u]=_react.useState.call(void 0, !1),[f,h]=_react.useState.call(void 0, !1),[g,w]=_react.useState.call(void 0, !1),[v,E]=_react.useState.call(void 0, null),_=_react.useMemo.call(void 0, ()=>_nullishCoalesce(_optionalChain([o, 'optionalAccess', _636 => _636.linkedAccounts, 'access', _637 => _637.filter, 'call', _638 => _638(S=>S.type==="passkey")]), () => ([])),[o]),A=()=>{_optionalChain([n, 'optionalAccess', _639 => _639.mfaEnrollmentFlow, 'optionalAccess', _640 => _640.onSuccess, 'call', _641 => _641()]),e()},T=async S=>{u(!0);try{await s(),await c({credentialIds:S}),w(!0)}catch(R){E(R)}finally{u(!1)}},P=async()=>{h(!0),E(null);try{await a();let R=await _asyncNullishCoalesce(await _asyncOptionalChain([(await i()), 'optionalAccess', async _642 => _642.linkedAccounts, 'access', async _643 => _643.filter, 'call', async _644 => _644(D=>D.type==="passkey"), 'access', async _645 => _645.map, 'call', async _646 => _646(D=>D.credentialId)]), async () => ([]));await T(R)}catch(S){E(S)}finally{h(!1)}};return _.length===0||f?_jsxruntime.jsx.call(void 0, s9,{onReset:r,onClose:t,onClick:P,isCreating:f}):g?_jsxruntime.jsx.call(void 0, c9,{onClick:A,onClose:A}):v?_jsxruntime.jsx.call(void 0, jo,{error:v,backFn:()=>E(null),onClick:()=>E(null)}):_jsxruntime.jsx.call(void 0, l9,{passkeys:_,isSubmitting:d,isCreating:f,onReset:r,onClose:t,onSubmitEnrollment:()=>T(_.map(S=>S.credentialId)),onAddPasskey:P})},s9=({onReset:e,onClose:t,onClick:r,isCreating:o})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:e,onClose:t},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsxs.call(void 0, rd,{children:[_jsxruntime.jsx.call(void 0, va,{}),_jsxruntime.jsx.call(void 0, wa,{})]})}),_jsxruntime.jsx.call(void 0, me,{children:"Set up passkey verification"}),_jsxruntime.jsxs.call(void 0, ca,{children:[_jsxruntime.jsxs.call(void 0, mr,{children:[_jsxruntime.jsx.call(void 0, ur,{children:_jsxruntime.jsx.call(void 0, _ShieldCheckIcon4.default,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),_jsxruntime.jsxs.call(void 0, mr,{children:[_jsxruntime.jsx.call(void 0, ur,{children:_jsxruntime.jsx.call(void 0, _ClockIcon2.default,{})}),"Takes seconds to set up and use"]}),_jsxruntime.jsxs.call(void 0, mr,{children:[_jsxruntime.jsx.call(void 0, ur,{children:_jsxruntime.jsx.call(void 0, _ArrowRightEndOnRectangleIcon2.default,{})}),"Use your passkey to verify transactions and login to your account"]})]}),_jsxruntime.jsx.call(void 0, U,{style:{marginTop:"2.25rem"},onClick:r,loading:o,children:"Add a new passkey"}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]}),l9=({onReset:e,onClose:t,onAddPasskey:r,onSubmitEnrollment:o,passkeys:n,isSubmitting:a,isCreating:i})=>{let[s,c]=_react.useState.call(void 0, !1),d=s?n.length:n.length>3?2:3;return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:s?()=>c(!1):e,onClose:t},"header"),!s&&_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsxs.call(void 0, rd,{children:[_jsxruntime.jsx.call(void 0, va,{}),_jsxruntime.jsx.call(void 0, wa,{})]})}),_jsxruntime.jsx.call(void 0, me,{children:"Enable your passkeys for verification"}),_jsxruntime.jsxs.call(void 0, ca,{children:[n.slice(0,d).map(u=>_jsxruntime.jsxs.call(void 0, d9,{children:[_jsxruntime.jsx.call(void 0, p9,{children:m9(u)}),_jsxruntime.jsxs.call(void 0, u9,{children:["Last used: ",_optionalChain([u, 'access', _647 => _647.latestVerifiedAt, 'optionalAccess', _648 => _648.toLocaleString, 'call', _649 => _649()])]})]},u.credentialId)),!s&&n.length>3&&_jsxruntime.jsx.call(void 0, mC,{onClick:()=>c(!0),children:"View All"})]}),_jsxruntime.jsx.call(void 0, U,{style:{marginTop:"1.5rem"},onClick:o,loading:a,children:"Enable passkeys"}),n.length<5&&_jsxruntime.jsx.call(void 0, mC,{style:{marginTop:"0.5rem"},onClick:r,disabled:i,children:i?_jsxruntime.jsx.call(void 0, mt,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]})},c9=({onClick:e,onClose:t})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:t},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsx.call(void 0, ot,{status:"success",children:_jsxruntime.jsx.call(void 0, _CheckCircleIcon2.default,{})})}),_jsxruntime.jsx.call(void 0, me,{children:"Passkey verification added"}),_jsxruntime.jsx.call(void 0, ge,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),_jsxruntime.jsx.call(void 0, Bt,{children:_jsxruntime.jsx.call(void 0, U,{onClick:e,children:"Done"})}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]}),d9=_styledcomponents2.default.div`
2235
+ && {
2236
+ padding: 0.75rem 1rem;
2237
+ text-align: left;
2238
+ border-radius: 0.5rem;
2239
+ border: 1px solid var(--privy-color-foreground-4);
2240
+ width: 100%;
2241
+ }
2242
+ `,p9=_styledcomponents2.default.div`
2243
+ font-size: 0.875rem;
2244
+ line-height: 1.375rem;
2245
+ font-weight: 500;
2246
+
2247
+ color: var(--privy-color-foreground-1);
2248
+ `,u9=_styledcomponents2.default.div`
2249
+ font-size: 0.75rem;
2250
+ font-weight: 400;
2251
+ line-height: 1.125rem;
2252
+
2253
+ color: var(--privy-color-foreground-2);
2254
+ `,m9=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",mC=_styledcomponents2.default.button`
2255
+ && {
2256
+ width: 100%;
2257
+ font-size: 0.875rem;
2258
+ line-height: 1rem;
2259
+
2260
+ /* Tablet and Up */
2261
+ @media (min-width: 440px) {
2262
+ font-size: 14px;
2263
+ }
2264
+
2265
+ display: flex;
2266
+ gap: 12px;
2267
+ justify-content: center;
2268
+
2269
+ padding: 0.75rem 1rem;
2270
+ background-color: var(--privy-color-background);
2271
+ transition: background-color 200ms ease;
2272
+ color: var(--privy-color-accent);
2273
+
2274
+ :focus {
2275
+ outline: none;
2276
+ box-shadow: none;
2277
+ }
2278
+ }
2279
+ `;var Xs=6,h9=new Array(Xs).fill("");function y9(e){return e.replace(/\s+/g,"")}function Ou(e){return/^[0-9]{1}$/.test(e)}function hC(e){return e.length===Xs&&e.every(Ou)}function g9(e,t){return e.reduce((r,o)=>r+Number(t(o)),0)}var Pa=({onChange:e,disabled:t,errorReasonOverride:r,success:o})=>{let[n,a]=_react.useState.call(void 0, h9),[i,s]=_react.useState.call(void 0, null),[c,d]=_react.useState.call(void 0, null),u=async w=>{w.preventDefault();let v=y9(w.currentTarget.value);if(v==="")return;let E=g9(n,Ou),_=v.split(""),A=!_.every(Ou),T=_.length+E>Xs;if(A){s("Passcode can only be numbers"),d(1);return}if(T){s("Passcode must be exactly 6 numbers"),d(1);return}s(null),d(null);let P=Number(_optionalChain([w, 'access', _650 => _650.currentTarget, 'access', _651 => _651.name, 'optionalAccess', _652 => _652.charAt, 'call', _653 => _653(4)])),S=[...v||[""]].slice(0,Xs-P),R=[...n.slice(0,P),...S,...n.slice(P+S.length)];a(R);let D=S.length,F=Math.min(Math.max(P+D,0),Xs-1);if(_optionalChain([document, 'access', _654 => _654.querySelector, 'call', _655 => _655(`input[name=pin-${F}]`), 'optionalAccess', _656 => _656.focus, 'call', _657 => _657()]),hC(R))try{await e(R.join("")),_optionalChain([document, 'access', _658 => _658.querySelector, 'call', _659 => _659(`input[name=pin-${F}]`), 'optionalAccess', _660 => _660.blur, 'call', _661 => _661()])}catch(K){d(1),s(K.message)}else try{await e(null)}catch(K){d(1),s(K.message)}},f=w=>{c===1&&(s(null),d(null));let v=[...n.slice(0,w),"",...n.slice(w+1)];a(v),w>0&&_optionalChain([document, 'access', _662 => _662.querySelector, 'call', _663 => _663(`input[name=pin-${w-1}]`), 'optionalAccess', _664 => _664.focus, 'call', _665 => _665()]),hC(v)?e(v.join("")):e(null)},g=o?"success":!!(r||i)?"fail":"";return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:_jsxruntime.jsxs.call(void 0, C9,{children:[_jsxruntime.jsx.call(void 0, "div",{children:n.map((w,v)=>_jsxruntime.jsx.call(void 0, "input",{name:`pin-${v}`,type:"text",value:n[v],onChange:u,onKeyUp:E=>{E.key==="Backspace"&&f(v)},inputMode:"numeric",autoFocus:v===0,pattern:"[0-9]",className:g,autoComplete:_reactdevicedetect.isMobile?"one-time-code":"off",disabled:t},v))}),_jsxruntime.jsx.call(void 0, "div",{children:_jsxruntime.jsx.call(void 0, v9,{fail:!!r||!!i,children:r||i})})]})})},C9=_styledcomponents2.default.div`
2280
+ display: flex;
2281
+ flex-direction: column;
2282
+ width: 100%;
2283
+ gap: 8px;
2284
+
2285
+ @media (max-width: 440px) {
2286
+ margin-top: 8px;
2287
+ margin-bottom: 8px;
2288
+ }
2289
+
2290
+ > div:nth-child(1) {
2291
+ display: flex;
2292
+ justify-content: center;
2293
+ gap: 0.5rem;
2294
+ width: 100%;
2295
+ border-radius: var(--privy-border-radius-md);
2296
+
2297
+ > input {
2298
+ border: 1px solid var(--privy-color-foreground-4);
2299
+ background: var(--privy-color-background);
2300
+ border-radius: var(--privy-border-radius-md);
2301
+ padding: 8px 10px;
2302
+ height: 58px;
2303
+ width: 46px;
2304
+ text-align: center;
2305
+ font-size: 18px;
2306
+ }
2307
+
2308
+ > input:disabled {
2309
+ /* Use light-theme-bg-2 instead of disabled-bg for consistency with
2310
+ the callout bubble */
2311
+ background: var(--privy-color-background-2);
2312
+ }
2313
+
2314
+ > input:focus {
2315
+ border: 1px solid var(--privy-color-accent);
2316
+ }
2317
+
2318
+ > input:invalid {
2319
+ border: 1px solid var(--privy-color-error);
2320
+ }
2321
+
2322
+ > input.success {
2323
+ border: 1px solid var(--privy-color-success);
2324
+ }
2325
+
2326
+ > input.fail {
2327
+ border: 1px solid var(--privy-color-error);
2328
+ animation: shake 180ms;
2329
+ animation-iteration-count: 2;
2330
+ }
2331
+ }
2332
+
2333
+ @keyframes shake {
2334
+ 0% {
2335
+ transform: translate(1px, 0px);
2336
+ }
2337
+ 33% {
2338
+ transform: translate(-1px, 0px);
2339
+ }
2340
+ 67% {
2341
+ transform: translate(-1px, 0px);
2342
+ }
2343
+ 100% {
2344
+ transform: translate(1px, 0px);
2345
+ }
2346
+ }
2347
+ `,v9=_styledcomponents2.default.div`
2348
+ line-height: 20px;
2349
+ font-size: 13px;
2350
+ display: flex;
2351
+ justify-content: flex-start;
2352
+ width: 100%;
2353
+
2354
+ color: ${e=>e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
2355
+ `;var CC=({onComplete:e,onReset:t,onClose:r})=>{let[o,n]=_react.useState.call(void 0, ""),[a,i]=_react.useState.call(void 0, !1),[s,c]=_react.useState.call(void 0, null),[d,u]=_react.useState.call(void 0, "enroll"),{initEnrollmentWithSms:f,submitEnrollmentWithSms:h}=fo(),{app:g,data:w}=_chunk3AGMJGHJjs.b.call(void 0, );function v(){_optionalChain([w, 'optionalAccess', _666 => _666.mfaEnrollmentFlow, 'optionalAccess', _667 => _667.onSuccess, 'call', _668 => _668()]),e()}async function E({qualifiedPhoneNumber:T}){try{await f({phoneNumber:T}),n(T),u("verify")}catch(P){c(P)}}async function _(T){try{if(!T)return;await h({phoneNumber:o,mfaCode:T}),i(!0)}catch(P){throw Wc(P)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):ga(P)?new Error("The code you entered is not valid"):ya(P)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):Lc(P)?new Error("Verification canceled"):new Error("Unknown error")}}function A(){d==="verify"?u("enroll"):t()}return s?_jsxruntime.jsx.call(void 0, jo,{error:s,backFn:()=>c(null),onClick:()=>c(null)}):d==="enroll"?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:t,onClose:r},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsx.call(void 0, ot,{children:_jsxruntime.jsx.call(void 0, _PhoneIcon4.default,{})})}),_jsxruntime.jsx.call(void 0, me,{children:"Set up SMS verification"}),_jsxruntime.jsx.call(void 0, ge,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),_jsxruntime.jsxs.call(void 0, qr,{children:[_jsxruntime.jsx.call(void 0, Mn,{onSubmit:E,hideRecent:!0}),_jsxruntime.jsxs.call(void 0, Jh,{children:["By providing your mobile number, you agree to receive text messages from ",_optionalChain([g, 'optionalAccess', _669 => _669.name]),". Some carrier charges may apply"]})]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]}):a?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:v},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsx.call(void 0, ot,{status:"success",children:_jsxruntime.jsx.call(void 0, _CheckCircleIcon2.default,{})})}),_jsxruntime.jsx.call(void 0, me,{children:"SMS verification added"}),_jsxruntime.jsx.call(void 0, ge,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),_jsxruntime.jsx.call(void 0, Bt,{children:_jsxruntime.jsx.call(void 0, U,{onClick:v,children:"Done"})}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:A,onClose:r},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsx.call(void 0, ot,{children:_jsxruntime.jsx.call(void 0, _PhoneIcon4.default,{})})}),_jsxruntime.jsx.call(void 0, me,{children:"Enter enrollment code"}),_jsxruntime.jsxs.call(void 0, qr,{children:[_jsxruntime.jsx.call(void 0, Pa,{onChange:_}),_jsxruntime.jsxs.call(void 0, ge,{children:["To continue, enter the 6-digit code sent to ",_jsxruntime.jsx.call(void 0, "strong",{children:O2(o)})]})]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]})};var vC=({size:e,authUrl:t})=>_jsxruntime.jsx.call(void 0, Pn,{url:t,squareLogoElement:_ShieldCheckIcon2.default,size:e,fgColor:"#1F1F1F"});var bC=({onComplete:e,onClose:t,onReset:r,totpInfo:o})=>{let[n,a]=_react.useState.call(void 0, "enroll"),[i,s]=_react.useState.call(void 0, !1),{submitEnrollmentWithTotp:c}=fo(),{data:d}=_chunk3AGMJGHJjs.b.call(void 0, );function u(){_optionalChain([d, 'optionalAccess', _670 => _670.mfaEnrollmentFlow, 'optionalAccess', _671 => _671.onSuccess, 'call', _672 => _672()]),e()}function f(){a("verify")}async function h(w){try{if(!w)return;await c({mfaCode:w}),s(!0)}catch(v){throw Wc(v)?new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):ga(v)?new Error("The code you entered is not valid"):ya(v)?new Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):Lc(v)?new Error("Verification canceled"):new Error("Unknown error")}}function g(){n==="verify"?a("enroll"):r()}return n==="enroll"?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:r,onClose:t},"header"),_jsxruntime.jsx.call(void 0, me,{children:"Scan QR code"}),_jsxruntime.jsx.call(void 0, ge,{children:"Open your authenticator app and scan the QR code to continue."}),_jsxruntime.jsx.call(void 0, li,{children:_jsxruntime.jsx.call(void 0, vC,{authUrl:o.authUrl,size:200})}),_jsxruntime.jsxs.call(void 0, Bt,{children:[_jsxruntime.jsx.call(void 0, Mt,{children:_jsxruntime.jsx.call(void 0, Sn,{itemName:"secret",text:o.secret})}),_jsxruntime.jsx.call(void 0, U,{onClick:f,children:"Continue"})]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]}):i?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:u},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsx.call(void 0, ot,{status:"success",children:_jsxruntime.jsx.call(void 0, _CheckCircleIcon2.default,{})})}),_jsxruntime.jsx.call(void 0, me,{children:"Authenticator app verification added"}),_jsxruntime.jsx.call(void 0, ge,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),_jsxruntime.jsx.call(void 0, Bt,{children:_jsxruntime.jsx.call(void 0, U,{onClick:u,children:"Done"})}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:g,onClose:t},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsx.call(void 0, ot,{children:_jsxruntime.jsx.call(void 0, _DevicePhoneMobileIcon2.default,{})})}),_jsxruntime.jsx.call(void 0, me,{children:"Enter enrollment code"}),_jsxruntime.jsx.call(void 0, qr,{children:_jsxruntime.jsx.call(void 0, Pa,{onChange:h})}),_jsxruntime.jsxs.call(void 0, ge,{children:["To continue, enter the 6-digit code generated from your ",_jsxruntime.jsx.call(void 0, "strong",{children:"authenticator app"})]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]})};var TC=()=>{let{user:e,enrollInMfa:t}=_chunkXKAIXCX7js.ta.call(void 0, ),[r,o]=_react.useState.call(void 0, null),{unenrollWithSms:n,unenrollWithTotp:a,unenrollWithPasskey:i}=fo(),{app:s,ready:c,data:d,onUserCloseViaDialogOrKeybindRef:u}=_chunk3AGMJGHJjs.b.call(void 0, ),{closePrivyModal:f}=_chunkXKAIXCX7js.ra.call(void 0, ),{promptMfa:h}=Ks(),{initEnrollmentWithTotp:g}=fo(),[w,v]=_react.useState.call(void 0, !1),[E,_]=_react.useState.call(void 0, null),[A,T]=_react.useState.call(void 0, null),P=()=>{f({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{o(null),_(null)},500)},{initEnrollmentWithPasskey:S,submitEnrollmentWithPasskey:R}=fo(),[D,F]=_react.useState.call(void 0, !1),[B,K]=_react.useState.call(void 0, null);u.current=P;let W=_optionalChain([e, 'optionalAccess', _673 => _673.mfaMethods, 'access', _674 => _674.includes, 'call', _675 => _675("sms")]),X=!!_optionalChain([e, 'optionalAccess', _676 => _676.phone]),L=_optionalChain([e, 'optionalAccess', _677 => _677.mfaMethods, 'access', _678 => _678.includes, 'call', _679 => _679("totp")]),Q=_optionalChain([e, 'optionalAccess', _680 => _680.mfaMethods, 'access', _681 => _681.includes, 'call', _682 => _682("passkey")]),xe=W||L||Q,he=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _683 => _683.linkedAccounts, 'access', _684 => _684.filter, 'call', _685 => _685(ce=>ce.type==="passkey"), 'access', _686 => _686.map, 'call', _687 => _687(ce=>ce.credentialId)]), () => ([]));_react.useEffect.call(void 0, ()=>{xe&&v(!0)},[xe]);function $(){o(null),_(null)}function Y(){v(!1)}async function ke(){F(!0);try{await S(),await R({credentialIds:he})}catch(ce){K(ce)}finally{F(!1)}}async function ye(ce){if(await h().catch(K),ce==="totp"){_(ce),T(null),g().then(pt=>{T(pt)}).catch(()=>{T(null),$()});return}if(ce==="passkey"&&he.length===1)return await ke();_(ce)}if(!c||!e||!s)return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:P},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsx.call(void 0, pC,{})}),_jsxruntime.jsx.call(void 0, qr,{children:_jsxruntime.jsx.call(void 0, mt,{})}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]});async function te(){o(null);try{await n()}catch (e28){o(null)}}async function se(){o(null);try{await a()}catch (e29){o(null)}}async function Ge(){o(null);try{await h(),await i()}catch (e30){o(null)}}if(r==="sms")return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:$,onClose:P},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsx.call(void 0, ot,{children:_jsxruntime.jsx.call(void 0, _PhoneIcon4.default,{})})}),_jsxruntime.jsx.call(void 0, me,{children:"Remove SMS verification?"}),_jsxruntime.jsxs.call(void 0, ge,{children:["MFA adds an extra layer of security to your ",_optionalChain([s, 'optionalAccess', _688 => _688.name])," account. Make sure you have other methods to secure your account."]}),_jsxruntime.jsx.call(void 0, Bt,{children:_jsxruntime.jsx.call(void 0, U,{warn:!0,onClick:te,children:"Remove SMS for MFA"})}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]});if(r==="totp")return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:$,onClose:P},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsx.call(void 0, ot,{children:_jsxruntime.jsx.call(void 0, _DevicePhoneMobileIcon2.default,{})})}),_jsxruntime.jsx.call(void 0, me,{children:"Remove Authenticator App verification?"}),_jsxruntime.jsxs.call(void 0, ge,{children:["MFA adds an extra layer of security to your ",_optionalChain([s, 'optionalAccess', _689 => _689.name])," account. Make sure you have other methods to secure your account."]}),_jsxruntime.jsx.call(void 0, Bt,{children:_jsxruntime.jsx.call(void 0, U,{warn:!0,onClick:se,children:"Remove Authenticator App for MFA"})}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]});if(r==="passkey")return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:$,onClose:P},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsx.call(void 0, ot,{children:_jsxruntime.jsx.call(void 0, _QuestionMarkCircleIcon4.default,{})})}),_jsxruntime.jsx.call(void 0, me,{children:"Are you sure you want to remove passkey verification?"}),_jsxruntime.jsx.call(void 0, ge,{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."}),_jsxruntime.jsx.call(void 0, Bt,{children:_jsxruntime.jsx.call(void 0, U,{warn:!0,onClick:Ge,children:"Yes, remove"})}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]});if(d.mfaEnrollmentFlow.mfaMethods.length===0&&!xe)return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:P},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsx.call(void 0, ot,{children:_jsxruntime.jsx.call(void 0, _ShieldCheckIcon2.default,{})})}),_jsxruntime.jsx.call(void 0, me,{children:"Add more security"}),_jsxruntime.jsxs.call(void 0, ge,{children:[_optionalChain([s, 'optionalAccess', _690 => _690.name])," does not have any verification methods enabled."]}),_jsxruntime.jsx.call(void 0, Bt,{children:_jsxruntime.jsx.call(void 0, U,{onClick:P,children:"Close"})}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]});let Qe=!xe&&!w;return Qe?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:P},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsx.call(void 0, ot,{children:_jsxruntime.jsx.call(void 0, _ShieldCheckIcon2.default,{})})}),_jsxruntime.jsx.call(void 0, me,{children:"Transaction Protection"}),_jsxruntime.jsx.call(void 0, ge,{children:"Set up transaction protection to add an extra layer of security to your account"}),_jsxruntime.jsxs.call(void 0, ca,{children:[_jsxruntime.jsxs.call(void 0, mr,{children:[_jsxruntime.jsx.call(void 0, ur,{children:_jsxruntime.jsx.call(void 0, _CheckBadgeIcon2.default,{})}),"Enable 2-Step verification for your ",_optionalChain([s, 'optionalAccess', _691 => _691.name])," wallet."]}),_jsxruntime.jsxs.call(void 0, mr,{children:[_jsxruntime.jsx.call(void 0, ur,{children:_jsxruntime.jsx.call(void 0, _IdentificationIcon2.default,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),_jsxruntime.jsxs.call(void 0, Bt,{children:[_jsxruntime.jsx.call(void 0, U,{onClick:()=>v(!0),children:"Continue"}),_jsxruntime.jsx.call(void 0, io,{onClick:P,children:"Not now"})]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]}):E==="sms"?_jsxruntime.jsx.call(void 0, CC,{onComplete:P,onReset:$,onClose:P}):E==="totp"&&A?_jsxruntime.jsx.call(void 0, bC,{onComplete:P,onClose:P,onReset:$,totpInfo:A}):E==="passkey"?_jsxruntime.jsx.call(void 0, fC,{onComplete:P,onReset:$,onClose:P}):_jsxruntime.jsx.call(void 0, uC,{showIntro:Qe,userMfaMethods:e.mfaMethods,appMfaMethods:s.mfa.methods,userHasAuthSms:X,onBackToIntro:Y,handleSelectMethod:ye,isTotpLoading:E==="totp"&&!A,isPasskeyLoading:D,error:B,onClose:P,setRemovingMfaMethod:o})};var Od=({label:e,children:t,valueStyles:r})=>_jsxruntime.jsxs.call(void 0, W9,{children:[_jsxruntime.jsx.call(void 0, "div",{children:e}),_jsxruntime.jsx.call(void 0, L9,{style:{...r},children:t})]}),W9=_styledcomponents2.default.div`
2356
+ display: flex;
2357
+ align-items: center;
2358
+ justify-content: space-between;
2359
+ width: 100%;
2360
+
2361
+ > :first-child {
2362
+ color: var(--privy-color-foreground-3);
2363
+ text-align: left;
2364
+ }
2365
+
2366
+ > :last-child {
2367
+ color: var(--privy-color-foreground-2);
2368
+ text-align: right;
2369
+ }
2370
+ `,L9=_styledcomponents2.default.div`
2371
+ font-size: 14px;
2372
+ line-height: 100%;
2373
+ display: flex;
2374
+ align-items: center;
2375
+ justify-content: center;
2376
+ border-radius: var(--privy-border-radius-full);
2377
+ background-color: var(--privy-color-background-2);
2378
+ padding: 4px 8px;
2379
+ `;var N9="11111111111111111111111111111111",D9="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",U9=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function Bi(e,t=6,r=!1){let a=(parseFloat(e.toString())/1e9).toFixed(t).replace(/0+$/,"").replace(/\.$/,"");return r?`${a} SOL`:`${a==="0"?"<0.001":a} SOL`}function Hi(e,t){let r=parseFloat(e.toString())/1e9,o=U9.format(t*r);return o==="$0.00"?"<$0.01":o}function xa(e){return"version"in e}function Js(e,t,r=0){let o=t==="from"?0:t==="to"?1:2;if(xa(e)){let a=e.message.getAccountKeys(),i=_optionalChain([e, 'access', _692 => _692.message, 'access', _693 => _693.compiledInstructions, 'access', _694 => _694.at, 'call', _695 => _695(r), 'optionalAccess', _696 => _696.accountKeyIndexes, 'access', _697 => _697[o]]);if(i==null)throw new Error("Transaction does not contain a public key");let s=a.get(i);if(!s)throw new Error("Transaction does not contain a public key");return s}let n=_optionalChain([e, 'access', _698 => _698.instructions, 'access', _699 => _699.at, 'call', _700 => _700(r), 'optionalAccess', _701 => _701.keys, 'access', _702 => _702.at, 'call', _703 => _703(o), 'optionalAccess', _704 => _704.pubkey]);if(n==null)throw new Error("Transaction does not contain a public key");return n}function F9(e,t=!1,r=0){let o=t?1:4;if(xa(e)){let a=_optionalChain([e, 'access', _705 => _705.message, 'access', _706 => _706.compiledInstructions, 'access', _707 => _707.at, 'call', _708 => _708(r), 'optionalAccess', _709 => _709.data]);if(!a)throw new Error("Transaction does not contain data");return Buffer.from(a).readBigInt64LE(o)}let n=_optionalChain([e, 'access', _710 => _710.instructions, 'access', _711 => _711.at, 'call', _712 => _712(r), 'optionalAccess', _713 => _713.data, 'access', _714 => _714.readBigInt64LE, 'call', _715 => _715(o)]);if(n==null)throw new Error("Transaction does not contain lamports");return n}function B9(e,t=0){let r;if(xa(e)){let o=_optionalChain([e, 'access', _716 => _716.message, 'access', _717 => _717.compiledInstructions, 'access', _718 => _718.at, 'call', _719 => _719(t), 'optionalAccess', _720 => _720.programIdIndex]);if(o==null)throw new Error("Transaction does not contain a Program ID");r=_optionalChain([e, 'access', _721 => _721.message, 'access', _722 => _722.getAccountKeys, 'call', _723 => _723(), 'access', _724 => _724.get, 'call', _725 => _725(o), 'optionalAccess', _726 => _726.toBase58, 'call', _727 => _727()])}else r=_optionalChain([e, 'access', _728 => _728.instructions, 'access', _729 => _729.at, 'call', _730 => _730(t), 'optionalAccess', _731 => _731.programId, 'access', _732 => _732.toBase58, 'call', _733 => _733()]);if(!r)throw new Error("Transaction does not contain a Program ID");if(r===D9)return"approve";if(r===N9)return"transfer";throw new Error("Unsupported Program ID")}async function H9(e,t){return xa(e)?(await t.getFeeForMessage(e.message)).value:await e.getEstimatedFee(t)}function Nd(e,t){return{signature:e,parsedTransaction:t,fees:BigInt(_optionalChain([t, 'optionalAccess', _734 => _734.meta, 'optionalAccess', _735 => _735.fee])||0)}}async function Dd(e,t){let r=[],o=xa(e)?e.message.compiledInstructions.length:e.instructions.length,n={},a=await H9(e,t),i=BigInt(a||0);for(let s=0;s<o;s++){let c=B9(e,s),d=Js(e,"from",s),u=Js(e,"to",s),f=F9(e,c==="approve",s),h=c==="transfer"?void 0:Js(e,"owner",s);n[d.toBase58()]==null&&(n[d.toBase58()]=BigInt(await t.getBalance(d)));let g=n[d.toBase58()]||0n;r.push({from:d,to:u,spender:h,action:c,amount:f,balance:g,hasFunds:g>=f})}return{fees:i,instructions:r}}var AC=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=_chunkLEABMTNMjs._.call(void 0, e),n=t?_chunkLEABMTNMjs.Y.call(void 0, o,t):void 0,a=_chunkLEABMTNMjs.Z.call(void 0, o,r);return _jsxruntime.jsx.call(void 0, Hu,{children:n||a})},Fu=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let o=_chunkLEABMTNMjs._.call(void 0, e),n=t?_chunkLEABMTNMjs.Y.call(void 0, o,t):void 0,a=_chunkLEABMTNMjs.Z.call(void 0, o,r);return _jsxruntime.jsx.call(void 0, Hu,{children:n?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, V9,{children:"USD"}),n==="<$0.01"?_jsxruntime.jsxs.call(void 0, kC,{children:[_jsxruntime.jsx.call(void 0, xC,{children:"<"}),"$0.01"]}):n]}):a})},Bu=({quantities:e,tokenPrice:t})=>{let r=e.reduce((a,i)=>a+i,0n),o=t?Hi(r,t):void 0,n=Bi(r);return _jsxruntime.jsx.call(void 0, Hu,{children:o?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:o==="<$0.01"?_jsxruntime.jsxs.call(void 0, kC,{children:[_jsxruntime.jsx.call(void 0, xC,{children:"<"}),"$0.01"]}):o}):n})},Hu=_styledcomponents2.default.span`
2380
+ font-size: 14px;
2381
+ line-height: 140%;
2382
+ display: flex;
2383
+ gap: 4px;
2384
+ align-items: center;
2385
+ `,V9=_styledcomponents2.default.span`
2386
+ font-size: 12px;
2387
+ line-height: 12px;
2388
+ color: var(--privy-color-foreground-3);
2389
+ `,xC=_styledcomponents2.default.span`
2390
+ font-size: 10px;
2391
+ `,kC=_styledcomponents2.default.span`
2392
+ display: flex;
2393
+ align-items: center;
2394
+ `;var MC=({gas:e,tokenPrice:t,tokenSymbol:r})=>_jsxruntime.jsxs.call(void 0, yn,{style:{paddingBottom:"12px"},children:[_jsxruntime.jsxs.call(void 0, WC,{children:[_jsxruntime.jsx.call(void 0, OC,{children:"Est. Fees"}),_jsxruntime.jsx.call(void 0, "div",{children:_jsxruntime.jsx.call(void 0, Fu,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&_jsxruntime.jsx.call(void 0, LC,{children:`${_chunkLEABMTNMjs.Z.call(void 0, e,r)}`})]}),IC=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:o})=>{let n=_jssdkcore.QuantityToBigNumber.call(void 0, e.value||0).add(_jssdkcore.QuantityToBigNumber.call(void 0, t)).toHexString();return _jsxruntime.jsxs.call(void 0, yn,{children:[_jsxruntime.jsxs.call(void 0, WC,{children:[_jsxruntime.jsx.call(void 0, OC,{children:"Total (including fees)"}),_jsxruntime.jsx.call(void 0, "div",{children:_jsxruntime.jsx.call(void 0, Fu,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:o})})]}),r&&_jsxruntime.jsx.call(void 0, LC,{children:_chunkLEABMTNMjs.Z.call(void 0, n,o)})]})},WC=_styledcomponents2.default.div`
2395
+ display: flex;
2396
+ flex-direction: row;
2397
+ justify-content: space-between;
2398
+ align-items: center;
2399
+ padding-top: 4px;
2400
+ `,LC=_styledcomponents2.default.div`
2401
+ display: flex;
2402
+ flex-direction: row;
2403
+ height: 12px;
2404
+
2405
+ font-size: 12px;
2406
+ line-height: 12px;
2407
+ color: var(--privy-color-foreground-3);
2408
+ font-weight: 400;
2409
+ `,OC=_styledcomponents2.default.div`
2410
+ font-size: 14px;
2411
+ line-height: 22.4px;
2412
+ font-weight: 400;
2413
+ `;var _ChevronDownIcon = require('@heroicons/react/24/outline/ChevronDownIcon'); var _ChevronDownIcon2 = _interopRequireDefault(_ChevronDownIcon);var Vi=_react.createContext.call(void 0, void 0);var js=_react.createContext.call(void 0, void 0);var UC=({defaultValue:e,children:t})=>{let[r,o]=_react.useState.call(void 0, e||null),n=a=>{o(r===a?null:a)};return _jsxruntime.jsx.call(void 0, Vi.Provider,{value:{activePanel:r,togglePanel:n},children:_jsxruntime.jsx.call(void 0, z9,{children:t})})},FC=({value:e,children:t})=>{let{activePanel:r,togglePanel:o}=_react.useContext.call(void 0, Vi),n=r===e;return _jsxruntime.jsx.call(void 0, js.Provider,{value:{onToggle:()=>o(e),value:e},children:_jsxruntime.jsx.call(void 0, X9,{isActive:n,"data-open":n,children:t})})},BC=({children:e})=>{let{activePanel:t}=_react.useContext.call(void 0, Vi),{onToggle:r,value:o}=_react.useContext.call(void 0, js),n=t===o;return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, K9,{onClick:r,"data-open":n,children:[_jsxruntime.jsx.call(void 0, Q9,{children:e}),_jsxruntime.jsx.call(void 0, J9,{isactive:n,children:_jsxruntime.jsx.call(void 0, _ChevronDownIcon2.default,{height:"16px",width:"16px",strokeWidth:"2"})})]}),_jsxruntime.jsx.call(void 0, Y9,{})]})},HC=({children:e})=>{let{activePanel:t}=_react.useContext.call(void 0, Vi),{value:r}=_react.useContext.call(void 0, js);return _jsxruntime.jsx.call(void 0, Z9,{"data-open":t===r,children:_jsxruntime.jsx.call(void 0, GC,{children:e})})},VC=({children:e})=>{let{activePanel:t}=_react.useContext.call(void 0, Vi),{value:r}=_react.useContext.call(void 0, js);return _jsxruntime.jsx.call(void 0, GC,{children:typeof e=="function"?e({isActive:t===r}):e})},z9=_styledcomponents2.default.div`
2414
+ display: flex;
2415
+ flex-direction: column;
2416
+ width: 100%;
2417
+ gap: 8px;
2418
+ `,K9=_styledcomponents2.default.div`
2419
+ display: flex;
2420
+ justify-content: space-between;
2421
+ align-items: center;
2422
+ width: 100%;
2423
+ cursor: pointer;
2424
+ padding-bottom: 8px;
2425
+ `,Y9=_styledcomponents2.default.div`
2426
+ width: 100%;
2427
+
2428
+ && {
2429
+ border-top: 1px solid;
2430
+ border-color: var(--privy-color-foreground-4);
2431
+ }
2432
+ padding-bottom: 12px;
2433
+ `,Q9=_styledcomponents2.default.div`
2434
+ font-size: 14px;
2435
+ font-weight: 500;
2436
+ line-height: 19.6px;
2437
+ width: 100%;
2438
+ padding-right: 8px;
2439
+ `,X9=_styledcomponents2.default.div`
2440
+ display: flex;
2441
+ flex-direction: column;
2442
+ width: 100%;
2443
+ overflow: hidden;
2444
+ padding: 12px;
2445
+
2446
+ && {
2447
+ border: 1px solid;
2448
+ border-color: var(--privy-color-foreground-4);
2449
+ border-radius: var(--privy-border-radius-md);
2450
+ }
2451
+ `,Z9=_styledcomponents2.default.div`
2452
+ position: relative;
2453
+ overflow: hidden;
2454
+ transition: max-height 25ms ease-out;
2455
+
2456
+ &[data-open='true'] {
2457
+ max-height: 700px;
2458
+ }
2459
+
2460
+ &[data-open='false'] {
2461
+ max-height: 0;
2462
+ }
2463
+ `,GC=_styledcomponents2.default.div`
2464
+ display: flex;
2465
+ flex-direction: column;
2466
+ gap: 12px;
2467
+ flex: 1 1 auto;
2468
+ min-height: 1px;
2469
+ `,J9=_styledcomponents2.default.div`
2470
+ transform: ${e=>e.isactive?"rotate(180deg)":"rotate(0deg)"};
2471
+ `;function Bd(e){return e.includes("mainnet")?"mainnet":e.includes("testnet")?"testnet":"devnet"}function qC(e,t){return`https://explorer.solana.com/tx/${e}?cluster=${t}`}function zC(e,t){return`https://explorer.solana.com/account/${e}?cluster=${t}`}var Gi=({walletAddress:e,chainId:t=_chunkXKAIXCX7js.O,network:r,rpcEndpoint:o})=>{let n=r==="ethereum"?_chunkLEABMTNMjs.$.call(void 0, t,e):zC(e,Bd(o||""));return _jsxruntime.jsx.call(void 0, eT,{href:n,target:"_blank",children:_chunkLEABMTNMjs.h.call(void 0, e)})},eT=_styledcomponents2.default.a`
2472
+ &:hover {
2473
+ text-decoration: underline;
2474
+ }
2475
+ `;var Hd=({from:e,to:t,txn:r,transactionInfo:o,tokenPrice:n,gas:a,tokenSymbol:i})=>{let s=_optionalChain([r, 'optionalAccess', _736 => _736.value])||0,c=_chunkXKAIXCX7js.oa.call(void 0, );return _jsxruntime.jsx.call(void 0, UC,{...c.render.standalone?{defaultValue:"details"}:{},children:_jsxruntime.jsxs.call(void 0, FC,{value:"details",children:[_jsxruntime.jsx.call(void 0, BC,{children:_jsxruntime.jsxs.call(void 0, rT,{children:[_jsxruntime.jsx.call(void 0, "div",{children:_optionalChain([o, 'optionalAccess', _737 => _737.title])||_optionalChain([o, 'optionalAccess', _738 => _738.actionDescription])||"Details"}),_jsxruntime.jsx.call(void 0, oT,{children:_jsxruntime.jsx.call(void 0, AC,{weiQuantities:[s],tokenPrice:n,tokenSymbol:i})})]})}),_jsxruntime.jsxs.call(void 0, HC,{children:[_jsxruntime.jsx.call(void 0, Od,{label:"From",children:_jsxruntime.jsx.call(void 0, Gi,{walletAddress:e,chainId:r.chainId||_chunkXKAIXCX7js.O,network:"ethereum"})}),_jsxruntime.jsx.call(void 0, Od,{label:"To",children:_jsxruntime.jsx.call(void 0, Gi,{walletAddress:t,chainId:r.chainId||_chunkXKAIXCX7js.O,network:"ethereum"})}),o&&o.action&&_jsxruntime.jsx.call(void 0, Od,{label:"Action",children:o.action}),a&&_jsxruntime.jsx.call(void 0, MC,{transactionData:r,gas:a,tokenPrice:n,tokenSymbol:i})]}),_jsxruntime.jsx.call(void 0, VC,{children:({isActive:d})=>_jsxruntime.jsx.call(void 0, IC,{transactionData:r,displayFee:d,gas:a||"0x0",tokenPrice:n,tokenSymbol:i})})]})})},rT=_styledcomponents2.default.div`
2476
+ display: flex;
2477
+ flex-direction: row;
2478
+ justify-content: space-between;
2479
+ `,oT=_styledcomponents2.default.div`
2480
+ flex-shrink: 0;
2481
+ padding-left: 8px;
2482
+ `;var $s=({pendingTransaction:e})=>{let{getAccessToken:t}=_chunkXKAIXCX7js.ta.call(void 0, ),{wallets:r}=_chunkXKAIXCX7js.va.call(void 0, ),{walletProxy:o,rpcConfig:n,chains:a,appId:i,nativeTokenSymbolForChainId:s}=_chunkXKAIXCX7js.ra.call(void 0, ),[c,d]=_react.useState.call(void 0, null),[u,f]=_react.useState.call(void 0, e),{tokenPrice:h}=Lo(u),g=s(e.chainId)||"ETH",w=_react.useMemo.call(void 0, ()=>r.find(v=>v.walletClientType==="privy"),[r]);return _react.useEffect.call(void 0, ()=>{async function v(){if(!await t()||!o||!w)return u;let _=_chunkLEABMTNMjs.s.call(void 0, u.chainId,a,n,{appId:i}),A=await _jssdkcore.populateTransactionRequest.call(void 0, w.address,u,_),{totalGasEstimate:T}=await _jssdkcore.calculateTotalGasEstimate.call(void 0, A,_);return d(T.toHexString()),A}v().then(f).catch(console.error)},[o]),w?_jsxruntime.jsx.call(void 0, cT,{children:_jsxruntime.jsx.call(void 0, Hd,{from:w.address,to:u.to,txn:u,gas:_nullishCoalesce(c, () => (void 0)),tokenPrice:h,tokenSymbol:g})}):null},cT=_styledcomponents2.default.div`
2483
+ width: 100%;
2484
+ padding: 1rem 0;
2485
+ `;var _CalendarIcon = require('@heroicons/react/24/outline/CalendarIcon'); var _CalendarIcon2 = _interopRequireDefault(_CalendarIcon);var ZC=({hasBlockingError:e,error:t,onClose:r,onBack:o,handleSubmit:n,account:a,submitSuccess:i})=>{let{pendingTransaction:s}=_chunkXKAIXCX7js.ra.call(void 0, );return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:r},"header"),_jsxruntime.jsx.call(void 0, et,{children:_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, ut,{success:i,fail:!!t}),t?_jsxruntime.jsx.call(void 0, _ExclamationTriangleIcon2.default,{style:{width:"38px",height:"38px"}}):_jsxruntime.jsx.call(void 0, va,{style:{width:"38px",height:"38px"}})]})}),_jsxruntime.jsx.call(void 0, me,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),_jsxruntime.jsxs.call(void 0, ca,{children:[_jsxruntime.jsxs.call(void 0, mr,{children:[_jsxruntime.jsx.call(void 0, ur,{children:_jsxruntime.jsx.call(void 0, _ShieldCheckIcon4.default,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),_jsxruntime.jsxs.call(void 0, mr,{children:[_jsxruntime.jsx.call(void 0, ur,{children:_jsxruntime.jsx.call(void 0, _CalendarIcon2.default,{})}),"You last added a passkey on"," ",_optionalChain([a, 'optionalAccess', _739 => _739.firstVerifiedAt, 'optionalAccess', _740 => _740.toLocaleDateString, 'call', _741 => _741(void 0,{month:"short",day:"numeric",year:"numeric"})]),"."]})]}),s&&_jsxruntime.jsx.call(void 0, qr,{children:_jsxruntime.jsx.call(void 0, $s,{pendingTransaction:s})}),t&&_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, bc,{style:{marginTop:"1.25rem"},children:t.message}),_jsxruntime.jsx.call(void 0, U,{disabled:e,onClick:n,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&_jsxruntime.jsx.call(void 0, gs,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]})};var zu=({open:e,onClose:t})=>{let{user:r}=_chunkXKAIXCX7js.ta.call(void 0, ),[o,n]=_react.useState.call(void 0, null),{init:a,cancel:i,submit:s}=Ks(),[c,d]=_react.useState.call(void 0, !1),[u,f]=_react.useState.call(void 0, !1),[h,g]=_react.useState.call(void 0, null),[w,v]=_react.useState.call(void 0, null);_react.useEffect.call(void 0, ()=>{e&&_optionalChain([r, 'optionalAccess', _742 => _742.mfaMethods])&&r.mfaMethods.length>0?A(r.mfaMethods[0]):n(null)},[_optionalChain([r, 'optionalAccess', _743 => _743.mfaMethods]),e]);let E=S=>Jp(S)?(d(!0),new Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):ga(S)?(d(!1),new Error("The code you entered is not valid")):ya(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 _(S){v(null);try{if(!S||!o)return;await s(o,S),f(!0),d(!1),t()}catch(R){throw E(R)}}async function A(S){if(S==="passkey"){try{n(S);let R=await a(S);if(!R)throw new Error("something went wrong");g(R),await s(S,R),f(!0),d(!1),t()}catch(R){v(E(R))}return}try{n(S),await a(S)}catch(R){console.error(R)}}let T=()=>{n(null),v(null),i(),t()},P=()=>{n(null),v(null)};if(!e||!r)return null;if(o==="passkey"){let S=r.linkedAccounts.filter(R=>R.type==="passkey"&&R.enrolledInMfa).sort((R,D)=>D.firstVerifiedAt.valueOf()-R.firstVerifiedAt.valueOf())[0];return _jsxruntime.jsx.call(void 0, ZC,{account:S,selectedMethod:o,submitSuccess:u,hasBlockingError:c,error:w,onClose:T,onBack:P,handleSubmit:()=>_(h).catch(v)})}return o?_jsxruntime.jsx.call(void 0, wT,{submitSuccess:u,hasBlockingError:c,handleSubmitCode:_,selectedMethod:o,onClose:T,onBack:r.mfaMethods.length>1?()=>n(null):void 0}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:T},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsx.call(void 0, ot,{children:_jsxruntime.jsx.call(void 0, _ShieldCheckIcon4.default,{})})}),_jsxruntime.jsx.call(void 0, me,{children:"Verify your identity"}),_jsxruntime.jsx.call(void 0, ge,{children:"Choose a verification method"}),_jsxruntime.jsxs.call(void 0, yc,{children:[r.mfaMethods.includes("totp")&&_jsxruntime.jsxs.call(void 0, Ae,{onClick:()=>A("totp"),children:[_jsxruntime.jsx.call(void 0, _DevicePhoneMobileIcon4.default,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&_jsxruntime.jsxs.call(void 0, Ae,{onClick:()=>A("sms"),children:[_jsxruntime.jsx.call(void 0, _PhoneIcon2.default,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&_jsxruntime.jsxs.call(void 0, Ae,{onClick:()=>A("passkey"),children:[_jsxruntime.jsx.call(void 0, _FingerPrintIcon2.default,{}),"Passkey"]},"passkey")]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]})},wT=({selectedMethod:e,submitSuccess:t,hasBlockingError:r,onClose:o,onBack:n,handleSubmitCode:a})=>{let{app:i}=_chunk3AGMJGHJjs.b.call(void 0, ),{pendingTransaction:s}=_chunkXKAIXCX7js.ra.call(void 0, );switch(e){case"sms":return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:o},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsx.call(void 0, ot,{children:_jsxruntime.jsx.call(void 0, _PhoneIcon4.default,{})})}),_jsxruntime.jsx.call(void 0, me,{children:"Enter verification code"}),_jsxruntime.jsxs.call(void 0, qr,{children:[_jsxruntime.jsx.call(void 0, Pa,{success:t,disabled:r,onChange:a}),_jsxruntime.jsxs.call(void 0, ge,{children:["To continue, please enter the 6-digit code sent to your ",_jsxruntime.jsx.call(void 0, "strong",{children:"mobile device"})]}),s&&_jsxruntime.jsx.call(void 0, $s,{pendingTransaction:s})]}),n&&_jsxruntime.jsx.call(void 0, gs,{theme:_optionalChain([i, 'optionalAccess', _744 => _744.appearance, 'access', _745 => _745.palette, 'access', _746 => _746.colorScheme]),onClick:n,children:"Choose another method"}),_jsxruntime.jsx.call(void 0, io,{onClick:o,children:"Not now"}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]});case"totp":return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:o},"header"),_jsxruntime.jsx.call(void 0, He,{children:_jsxruntime.jsx.call(void 0, ot,{children:_jsxruntime.jsx.call(void 0, _DevicePhoneMobileIcon2.default,{})})}),_jsxruntime.jsx.call(void 0, me,{children:"Enter verification code"}),_jsxruntime.jsxs.call(void 0, qr,{children:[_jsxruntime.jsx.call(void 0, Pa,{success:t,disabled:r,onChange:a}),_jsxruntime.jsxs.call(void 0, ge,{children:["To continue, please enter the 6-digit code generated from your"," ",_jsxruntime.jsx.call(void 0, "strong",{children:"authenticator app"})]}),s&&_jsxruntime.jsx.call(void 0, $s,{pendingTransaction:s})]}),n&&_jsxruntime.jsx.call(void 0, gs,{theme:_optionalChain([i, 'optionalAccess', _747 => _747.appearance, 'access', _748 => _748.palette, 'access', _749 => _749.colorScheme]),onClick:n,children:"Choose another method"}),_jsxruntime.jsx.call(void 0, io,{onClick:o,children:"Not now"}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]});default:return null}};var $C=()=>{let{authenticated:e,logout:t,ready:r,user:o}=_chunkXKAIXCX7js.ta.call(void 0, ),{app:n,setModalData:a,navigate:i,resetNavigation:s}=_chunk3AGMJGHJjs.b.call(void 0, ),{getAuthMeta:c,initLoginWithOAuth:d,loginWithOAuth:u,updateWallets:f,setReadyToTrue:h,closePrivyModal:g,createAnalyticsEvent:w}=_chunkXKAIXCX7js.ra.call(void 0, ),[v,E]=_react.useState.call(void 0, !1),[_,A]=_react.useState.call(void 0, void 0),T=_optionalChain([c, 'call', _750 => _750(), 'optionalAccess', _751 => _751.provider])||"google",{name:P,component:S}=is(T),R=_chunkLEABMTNMjs.I.call(void 0, ),D=_chunkXKAIXCX7js.r;_react.useEffect.call(void 0, ()=>{u(T).then(K=>{E(!0),h(!0),K&&R("login","onOAuthLoginComplete",K)}).catch(K=>{if(h(!1),_optionalChain([K, 'optionalAccess', _752 => _752.privyErrorCode])==="allowlist_rejected"){A(void 0),s(),i("ALLOWLIST_REJECTION_SCREEN");return}if(_optionalChain([K, 'optionalAccess', _753 => _753.privyErrorCode])==="max_accounts_reached"){console.error(new (0, _chunkXKAIXCX7js.o)(K).toString()),A(void 0),s(),i("USER_LIMIT_REACHED_SCREEN");return}if(_optionalChain([K, 'optionalAccess', _754 => _754.privyErrorCode])==="user_does_not_exist"){A(void 0),s(),i("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:W,detail:X}=vh(K,T);A({retryable:W,detail:X,message:"Authentication failed"})}).finally(()=>{ta()})},[P,T]),_react.useEffect.call(void 0, ()=>{if(r&&e&&v&&o){if(_optionalChain([n, 'optionalAccess', _755 => _755.legal, 'access', _756 => _756.requireUsersAcceptTerms])&&!o.hasAcceptedTerms){let W=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},D);return()=>clearTimeout(W)}if(_chunkLEABMTNMjs.A.call(void 0, o,_optionalChain([n, 'optionalAccess', _757 => _757.embeddedWallets, 'optionalAccess', _758 => _758.createOnLogin]))){let W=setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:X=>{console.error(X),w({eventName:"embedded_wallet_creation_failure_logout",payload:{error:X,provider:T,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},D);return()=>clearTimeout(W)}else{let W=setTimeout(()=>g({shouldCallAuthOnSuccess:!0,isSuccess:!0}),D);return f(),()=>clearTimeout(W)}}},[r,e,v,o]);let F=v?`Successfully connected with ${P}`:_?_.message:`Verifying connection to ${P}`,B="";return v?B="You\u2019re good to go!":_?B=_.detail:B="Just a few moments more",_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{}),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsxs.call(void 0, ET,{children:[_jsxruntime.jsx.call(void 0, et,{children:_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, ut,{success:v,fail:!!_}),_jsxruntime.jsx.call(void 0, S,{style:{width:"38px",height:"38px"}})]})}),_jsxruntime.jsxs.call(void 0, tt,{children:[_jsxruntime.jsx.call(void 0, "h3",{children:F}),_jsxruntime.jsx.call(void 0, "p",{children:B})]}),_&&_optionalChain([_, 'optionalAccess', _759 => _759.retryable])?_jsxruntime.jsx.call(void 0, fn,{onClick:()=>{ta(),d(T),A(void 0)},disabled:!v&&!_optionalChain([_, 'optionalAccess', _760 => _760.retryable]),children:"Retry"}):null]}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]})},ET=_styledcomponents2.default.div`
2486
+ display: flex;
2487
+ flex-direction: column;
2488
+ align-items: center;
2489
+ justify-content: center;
2490
+ margin-left: 27px;
2491
+ margin-right: 27px;
2492
+ gap: 24px;
2493
+ `;var r3=()=>{let{lastScreen:e,currentScreen:t,navigateBack:r}=_chunk3AGMJGHJjs.b.call(void 0, ),{loginWithPasskey:o,closePrivyModal:n}=_chunkXKAIXCX7js.ra.call(void 0, ),a=_chunkXKAIXCX7js.r,[i,s]=_react.useState.call(void 0, "loading"),[c,d]=_react.useState.call(void 0, null),u=_react.useRef.call(void 0, []),f=E=>{u.current=[E,...u.current]};_react.useEffect.call(void 0, ()=>()=>{u.current.forEach(E=>clearTimeout(E)),u.current=[]},[]);let h=()=>{switch(i){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}},g=()=>{switch(i){case"loading":return`Please follow prompts to verify your passkey.
2494
+ You will have to sign up with another method first to register a passkey for your account.`;case"success":return"You've successfully logged in with your passkey.";case"error":if(c instanceof _chunkXKAIXCX7js.e){if(c.privyErrorCode==="cannot_link_more_of_type")return"Cannot link more passkeys to account.";if(c.privyErrorCode==="passkey_not_allowed")return`Passkey request timed out or rejected by user.
2495
+ You will have to sign up with another method first to register a passkey for your account.`}return`An unknown error occurred.
2496
+ You will have to sign up with another method first to register a passkey for your account.`}},w=()=>{switch(i){case"loading":case"success":return _jsxruntime.jsx.call(void 0, U,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return _jsxruntime.jsx.call(void 0, U,{onClick:v,disabled:!1,children:"Retry"})}},v=async()=>{s("loading");try{await o(),s("success")}catch(E){d(E),s("error")}};return _react.useEffect.call(void 0, ()=>{i==="success"&&f(setTimeout(()=>{n({shouldCallAuthOnSuccess:!0,isSuccess:!0})},a))},[i]),_react.useEffect.call(void 0, ()=>{v()},[]),_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{backFn:!e||t===e?void 0:r}),_jsxruntime.jsxs.call(void 0, PT,{children:[_jsxruntime.jsx.call(void 0, et,{children:_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, ut,{success:i==="success",fail:i==="error"}),_jsxruntime.jsx.call(void 0, wa,{style:{width:"38px",height:"38px"}})]})}),_jsxruntime.jsxs.call(void 0, tt,{children:[_jsxruntime.jsx.call(void 0, "h3",{children:h()}),_jsxruntime.jsx.call(void 0, "p",{style:{whiteSpace:"pre-wrap"},children:g()})]}),w()]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]})},PT=_styledcomponents2.default.div`
2497
+ display: flex;
2498
+ flex-direction: column;
2499
+ align-items: center;
2500
+ justify-content: center;
2501
+ gap: 24px;
2502
+ width: 100%;
2503
+ `,Bte=_styledcomponents2.default.div`
2504
+ display: flex;
2505
+ align-items: center;
2506
+ justify-content: center;
2507
+ width: 180px;
2508
+ height: 90px;
2509
+ border-radius: 50%;
2510
+ svg + svg {
2511
+ margin-left: 12px;
2512
+ }
2513
+ > svg {
2514
+ z-index: 2;
2515
+ color: var(--privy-color-accent) !important;
2516
+ stroke: var(--privy-color-accent) !important;
2517
+ fill: var(--privy-color-accent) !important;
2518
+ }
2519
+ `;var o3=(e,t,r)=>{let o=new URL(window.location.href),n=encodeURIComponent(o.href.replace(/\/$/g,"")+`?privy_token=${e}&privy_connector=${r?"solana_adapter":"injected"}&privy_wallet_client=${r?"phantom_solana":"phantom"}`);if(!_chunkLEABMTNMjs.c.call(void 0, )&&_reactdevicedetect.isMobile)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${n}?ref=${n}`};var i3=()=>{let{forkSession:e,ready:t,authenticated:r}=_chunkXKAIXCX7js.ta.call(void 0, ),{walletConnectionStatus:o}=_chunkXKAIXCX7js.ra.call(void 0, ),[n,a]=_react.useState.call(void 0, ""),[i,s]=_react.useState.call(void 0, !1);_react.useEffect.call(void 0, ()=>{t&&r&&e().then(a)},[t,r]);let c=_optionalChain([o, 'optionalAccess', _761 => _761.connector, 'optionalAccess', _762 => _762.chainType])==="solana"||!1,d=o3(n,!i,c),u={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&&(u.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",u.footnote="Once you're done, you can always return here and refresh to view your updated account."),i&&(u.title="Still here?",u.description="You may need to install the Phantom mobile app.",u.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{},"header"),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsx.call(void 0, Ro,{title:u.title,description:u.description}),_jsxruntime.jsxs.call(void 0, hr,{children:[_jsxruntime.jsx.call(void 0, _T,{children:_jsxruntime.jsx.call(void 0, Po,{style:{width:"72px",height:"72px"}})}),_jsxruntime.jsx.call(void 0, pc,{href:d,onClick:()=>{setTimeout(()=>s(!0),1e3)},loading:t&&!d,children:i?"Go to App Store":"Continue"}),u.footnote?_jsxruntime.jsx.call(void 0, "p",{children:u.footnote}):null]}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})},_T=_styledcomponents2.default.call(void 0, Mt)`
2520
+ margin: 16px auto;
2521
+ `;var s3=()=>{let[e,t]=_react.useState.call(void 0, !0),{authenticated:r,getAccessToken:o}=_chunkXKAIXCX7js.ta.call(void 0, ),{walletProxy:n,closePrivyModal:a,createAnalyticsEvent:i}=_chunkXKAIXCX7js.ra.call(void 0, ),{navigate:s,data:c,onUserCloseViaDialogOrKeybindRef:d}=_chunk3AGMJGHJjs.b.call(void 0, ),[u,f]=_react.useState.call(void 0, void 0),[h,g]=_react.useState.call(void 0, ""),[w,v]=_react.useState.call(void 0, !1),{privyWallet:E,onCompleteNavigateTo:_,onSuccess:A,onFailure:T}=c.recoverWallet,P=(D="User exited before their wallet could be recovered")=>{a({shouldCallAuthOnSuccess:!1}),T(typeof D=="string"?new (0, _chunkXKAIXCX7js.m)(D):D)};d.current=P,_react.useEffect.call(void 0, ()=>{if(!r||!E)return P("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let S=D=>{D&&f(D)};return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:P}),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsxs.call(void 0, NT,{children:[_jsxruntime.jsxs.call(void 0, OT,{children:[_jsxruntime.jsx.call(void 0, _ShieldCheckIcon4.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),_jsxruntime.jsx.call(void 0, "h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),_jsxruntime.jsx.call(void 0, "p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsxs.call(void 0, En,{children:[_jsxruntime.jsx.call(void 0, bi,{type:e?"password":"text",onChange:D=>S(D.target.value),disabled:w,style:{paddingRight:"2.3rem"}}),_jsxruntime.jsx.call(void 0, Ei,{style:{right:"0.75rem"},children:e?_jsxruntime.jsx.call(void 0, Ti,{onClick:()=>t(!1)}):_jsxruntime.jsx.call(void 0, Si,{onClick:()=>t(!0)})})]}),!!h&&_jsxruntime.jsx.call(void 0, DT,{children:h})]}),_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsxs.call(void 0, ny,{children:[_jsxruntime.jsx.call(void 0, "h4",{children:"Why is this necessary?"}),_jsxruntime.jsx.call(void 0, "p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),_jsxruntime.jsx.call(void 0, UT,{loading:w||!n,disabled:!u,onClick:async()=>{v(!0);let D=await o();if(D&&E&&u!==null)try{i({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:E.address}}),await _optionalChain([n, 'optionalAccess', _763 => _763.recover, 'call', _764 => _764({address:E.address,accessToken:D,recoveryPin:u,recoveryMethod:E.recoveryMethod})]),g(""),_?s(_):a({shouldCallAuthOnSuccess:!1}),_optionalChain([A, 'optionalCall', _765 => _765(E)]),i({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:E.address}})}catch(F){zy(F)?g("Invalid recovery password, please try again."):g("An error has occurred, please try again.")}finally{v(!1)}else return P("User must be authenticated and have a Privy wallet before it can be recovered")},warn:!1,hideAnimations:!E&&w,children:"Recover your account"})]})]}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})},OT=_styledcomponents2.default.div`
2522
+ display: flex;
2523
+ flex-direction: column;
2524
+ align-items: center;
2525
+ justify-content: center;
2526
+ margin: 20px 0;
2527
+ gap: 4px;
2528
+
2529
+ & h3 {
2530
+ font-size: 18px;
2531
+ font-style: normal;
2532
+ font-weight: 600;
2533
+ line-height: 24px;
2534
+ }
2535
+
2536
+ & p {
2537
+ max-width: 300px;
2538
+ font-size: 14px;
2539
+ font-style: normal;
2540
+ font-weight: 400;
2541
+ line-height: 20px;
2542
+ }
2543
+ `,NT=_styledcomponents2.default.div`
2544
+ display: flex;
2545
+ flex-direction: column;
2546
+ justify-content: space-between;
2547
+ `,DT=_styledcomponents2.default.div`
2548
+ line-height: 20px;
2549
+ height: 20px;
2550
+ font-size: 13px;
2551
+ color: var(--privy-color-error);
2552
+ text-align: left;
2553
+ margin-top: 0.5rem;
2554
+ `,UT=_styledcomponents2.default.call(void 0, U)`
2555
+ ${e=>e.hideAnimations&&_styledcomponents.css`
2556
+ && {
2557
+ // Remove animations because the recoverWallet task on the iframe partially
2558
+ // blocks the renderer, so the animation stutters and doesn't look good
2559
+ transition: none;
2560
+ }
2561
+ `}
2562
+ `;var Yd=e=>_jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...e,children:[_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "defs",{children:_jsxruntime.jsxs.call(void 0, "linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[_jsxruntime.jsx.call(void 0, "stop",{stopColor:"#3E82F4"}),_jsxruntime.jsx.call(void 0, "stop",{offset:1,stopColor:"#93DCF7"})]})})]});var Qd=({style:e,...t})=>_jsxruntime.jsxs.call(void 0, "svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[_jsxruntime.jsxs.call(void 0, "g",{clipPath:"url(#clip0_2115_829)",children:[_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"}),_jsxruntime.jsx.call(void 0, "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"})]}),_jsxruntime.jsx.call(void 0, "defs",{children:_jsxruntime.jsx.call(void 0, "clipPath",{id:"clip0_2115_829",children:_jsxruntime.jsx.call(void 0, "rect",{width:"16",height:"14",fill:"white"})})})]});var tl=_styledcomponents2.default.div`
2563
+ display: flex;
2564
+ flex-direction: column;
2565
+ gap: 12px;
2566
+ padding-top: 24px;
2567
+ padding-bottom: 24px;
2568
+ `,p3=_styledcomponents2.default.div`
2569
+ padding-bottom: 24px;
2570
+ `;var m3={"google-drive":{name:"Google Drive",component:Qd},icloud:{name:"iCloud",component:Yd}},h3=()=>{let{logout:e}=_chunkXKAIXCX7js.ta.call(void 0, ),{navigate:t,setModalData:r,data:o}=_chunk3AGMJGHJjs.b.call(void 0, ),{recoveryOAuthFlow:n,closePrivyModal:a,createAnalyticsEvent:i}=_chunkXKAIXCX7js.ra.call(void 0, ),[s,c]=_react.useState.call(void 0, !1),{provider:d,action:u,isInAccountCreateFlow:f}=_optionalChain([o, 'optionalAccess', _766 => _766.recoveryOAuthStatus]),[h,g]=_react.useState.call(void 0, void 0),[w,v]=_react.useState.call(void 0, u==="create-wallet");if(d==="user-passcode")throw new Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let E=m3[d].name,_=m3[d].component,A=_optionalChain([o, 'optionalAccess', _767 => _767.recoverWallet, 'optionalAccess', _768 => _768.onCompleteNavigateTo]),T=new ze(async(K="create-wallet")=>(v(!0),new Promise((W,X)=>{setTimeout(async()=>{try{let L=window.open();await n(d,K,L),c(!0),W()}catch (e31){g({message:`${K==="recover"?"Recovery":"Back up"} with ${E} unsuccessful`,detail:u==="recover"?`Please verify that you are selecting the ${E} account associated with your backup.`:"",retryable:!0}),X()}},0)})));_react.useEffect.call(void 0, ()=>{u!=="recover"&&T.execute(f?"create-wallet":"set-recovery")},[]),_react.useEffect.call(void 0, ()=>{if(!s)return;let K=setTimeout(()=>{f?(r({createWallet:{onSuccess:()=>{},onFailure:W=>{i({eventName:"embedded_wallet_creation_failure_logout",payload:{error:W,screen:"RecoveryOAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_CREATED_SCREEN")):a({shouldCallAuthOnSuccess:!1})},_chunkXKAIXCX7js.r);return()=>clearTimeout(K)},[s]);let P=_react.useCallback.call(void 0, async()=>{await T.execute("recover"),A?t(A):c(!0)},[]),S=d==="google-drive"?"Google Drive":"Apple iCloud",R=u==="recover"?"recovered":"backed up",D=u==="recover"?"Recovering":"Backing up",F=s&&`Successfully ${R} with ${S}.`||h&&h.message||`${D} with ${S}...`,B=h?h.detail:"";return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{}),w?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:_jsxruntime.jsxs.call(void 0, tl,{children:[_jsxruntime.jsx.call(void 0, Ce,{title:F,icon:_jsxruntime.jsx.call(void 0, _,{style:{width:"38px",height:"38px"}}),description:B}),h&&_optionalChain([h, 'optionalAccess', _769 => _769.retryable])?_jsxruntime.jsx.call(void 0, U,{onClick:()=>{ta(),g(void 0),u==="create-wallet"?T.execute("create-wallet"):P()},disabled:!s&&!_optionalChain([h, 'optionalAccess', _770 => _770.retryable]),children:"Try again"}):null]})}):_jsxruntime.jsxs.call(void 0, tl,{children:[_jsxruntime.jsx.call(void 0, Ce,{title:"Confirm it's really you",icon:_jsxruntime.jsx.call(void 0, _,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${S} where your account is backed up.`}),_jsxruntime.jsxs.call(void 0, U,{onClick:P,children:["Confirm with ",S]})]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})};var g3=()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:o}=_chunk3AGMJGHJjs.b.call(void 0, ),[n,a]=_react.useState.call(void 0, ""),[i,s]=_react.useState.call(void 0, !1),[c,d]=_react.useState.call(void 0, ),[u,f]=_react.useState.call(void 0, null),{authenticated:h}=_chunkXKAIXCX7js.ta.call(void 0, ),{closePrivyModal:g,isNewUserThisSession:w,initializeWalletProxy:v}=_chunkXKAIXCX7js.ra.call(void 0, ),{onSuccess:E,onFailure:_,callAuthOnSuccessOnClose:A}=r.createWallet,{createWallet:T}=Uc(),[P,S]=_react.useState.call(void 0, null),R=new ze(async()=>{try{let B=await T(c);if(!B)return;S(B),w?t("EMBEDDED_WALLET_CREATED_SCREEN"):(E(B),g({shouldCallAuthOnSuccess:A}))}catch(B){a(B.message)}});_react.useEffect.call(void 0, ()=>{u||v(3e4).then(B=>f(B))},[u]),_react.useEffect.call(void 0, ()=>{if(!h){t("LANDING"),_(new Error("User must be authenticated before creating a Privy wallet"));return}},[h]);let D=()=>{P&&_optionalChain([P, 'optionalAccess', _771 => _771.recoveryMethod])!=="user-passcode"?(_(new (0, _chunkXKAIXCX7js.m)("User created a wallet but failed to set a password for it")),g({shouldCallAuthOnSuccess:!1})):P?(E(P),g({shouldCallAuthOnSuccess:A})):(_(new (0, _chunkXKAIXCX7js.m)("User wallet creation failed")),g({shouldCallAuthOnSuccess:!1}))};o.current=()=>null;let F=async()=>{s(!0);let B=250;return R.execute().then(()=>new Promise(K=>setTimeout(K,B))).finally(()=>s(!1))};return _jsxruntime.jsx.call(void 0, Vc,{config:{initiatedBy:"automatic"},appName:_optionalChain([e, 'optionalAccess', _772 => _772.name])||"privy",loading:!u,buttonLoading:i,buttonHideAnimations:!P&&i,isResettingPassword:!1,error:n,password:c||"",onClose:D,onPasswordChange:d,onPasswordGenerate:()=>d(Hc()),onSubmit:F})};var _LockClosedIcon3 = require('@heroicons/react/24/outline/LockClosedIcon'); var _LockClosedIcon4 = _interopRequireDefault(_LockClosedIcon3);var _PencilSquareIcon = require('@heroicons/react/24/outline/PencilSquareIcon'); var _PencilSquareIcon2 = _interopRequireDefault(_PencilSquareIcon);var Qu=_styledcomponents2.default.div`
2571
+ width: 24px;
2572
+ height: 24px;
2573
+ display: flex;
2574
+ justify-content: center;
2575
+ align-items: center;
2576
+ `,YT={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},QT=({onClose:e})=>_jsxruntime.jsxs.call(void 0, p3,{children:[_jsxruntime.jsx.call(void 0, Ce,{title:"Why do I need to secure my account?",icon:_jsxruntime.jsx.call(void 0, _QuestionMarkCircleIcon2.default,{width:48}),description:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),_jsxruntime.jsx.call(void 0, "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."})]})}),_jsxruntime.jsx.call(void 0, U,{onClick:e,children:"Select backup method"})]}),C3=()=>{let[e,t]=_react.useState.call(void 0, !1),{navigate:r,lastScreen:o,navigateBack:n,setModalData:a,data:i,onUserCloseViaDialogOrKeybindRef:s}=_chunk3AGMJGHJjs.b.call(void 0, ),{user:c}=_chunkXKAIXCX7js.ta.call(void 0, ),{embeddedWallets:d}=_chunkXKAIXCX7js.oa.call(void 0, ),{closePrivyModal:u}=_chunkXKAIXCX7js.ra.call(void 0, ),f=_chunkLEABMTNMjs.v.call(void 0, c),h=f===null,{isInAccountCreateFlow:g,isResettingPassword:w}=i.recoverySelection,v=f&&f.recoveryMethod!=="privy",E=v?"Update backup method":"Secure your account",_=v?_jsxruntime.jsxs.call(void 0, "span",{children:["Your account is currently secured using"," ",_jsxruntime.jsx.call(void 0, "strong",{children:YT[_optionalChain([f, 'optionalAccess', _773 => _773.recoveryMethod])||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function A(P){a({recoveryOAuthStatus:{provider:P,action:h?"create-wallet":"set-recovery",isInAccountCreateFlow:g}}),r("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")}function T(){_optionalChain([i, 'optionalAccess', _774 => _774.setWalletPassword, 'optionalAccess', _775 => _775.onFailure, 'call', _776 => _776(new Error("User exited set recovery flow"))]),u({shouldCallAuthOnSuccess:_nullishCoalesce(_optionalChain([i, 'optionalAccess', _777 => _777.setWalletPassword, 'optionalAccess', _778 => _778.callAuthOnSuccessOnClose]), () => (!1))})}return s.current=T,_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:T,backFn:e?()=>t(!1):o?n:void 0,infoFn:o||e?void 0:()=>t(!0)},"header"),e?_jsxruntime.jsx.call(void 0, QT,{onClose:()=>t(!1)}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, Ce,{title:E,icon:_jsxruntime.jsx.call(void 0, _LockClosedIcon4.default,{width:48}),description:_}),_jsxruntime.jsx.call(void 0, tl,{children:d.userOwnedRecoveryOptions.filter(P=>["icloud","google-drive"].includes(_optionalChain([f, 'optionalAccess', _779 => _779.recoveryMethod])||"")?P!==_optionalChain([f, 'optionalAccess', _780 => _780.recoveryMethod]):!0).sort().map(P=>{switch(P){case"google-drive":return _jsxruntime.jsxs.call(void 0, Ae,{onClick:()=>A("google-drive"),children:[_jsxruntime.jsx.call(void 0, Qu,{children:_jsxruntime.jsx.call(void 0, Qd,{style:{width:18}})}),"Back up to Google Drive"]},P);case"icloud":return _jsxruntime.jsxs.call(void 0, Ae,{onClick:()=>A("icloud"),children:[_jsxruntime.jsx.call(void 0, Qu,{children:_jsxruntime.jsx.call(void 0, Yd,{style:{width:24}})}),"Back up to Apple iCloud"]},P);case"user-passcode":return _jsxruntime.jsxs.call(void 0, Ae,{onClick:()=>{let S=jp({isCreatingWallet:h,skipSplashScreen:!0});r(S)},children:[_jsxruntime.jsx.call(void 0, Qu,{children:_jsxruntime.jsx.call(void 0, _PencilSquareIcon2.default,{style:{width:18}})}),w?"Reset your":"Set a"," password"]},P);default:return null}})})]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})};var v3=_styledcomponents2.default.div`
2577
+ && {
2578
+ border-width: 4px;
2579
+ }
2580
+
2581
+ display: flex;
2582
+ justify-content: center;
2583
+ align-items: center;
2584
+ padding: 1rem;
2585
+ aspect-ratio: 1;
2586
+ border-style: solid;
2587
+ border-color: ${e=>_nullishCoalesce(e.$color, () => ("var(--privy-color-accent)"))};
2588
+ border-radius: 50%;
2589
+ `;var E3=()=>{let{user:e,getAccessToken:t}=_chunkXKAIXCX7js.ta.call(void 0, ),r=_chunkLEABMTNMjs.v.call(void 0, e),{walletProxy:o,refreshUser:n,closePrivyModal:a}=_chunkXKAIXCX7js.ra.call(void 0, ),i=_chunk3AGMJGHJjs.b.call(void 0, ),[s,c]=_react.useState.call(void 0, !1),[d,u]=_react.useState.call(void 0, null),[f,h]=_react.useState.call(void 0, null);function g(){if(!s){if(f){_optionalChain([i, 'access', _781 => _781.data, 'optionalAccess', _782 => _782.setWalletPassword, 'optionalAccess', _783 => _783.onFailure, 'call', _784 => _784(f)]),a();return}if(!d){_optionalChain([i, 'access', _785 => _785.data, 'optionalAccess', _786 => _786.setWalletPassword, 'optionalAccess', _787 => _787.onFailure, 'call', _788 => _788(new Error("User exited set recovery flow"))]),a();return}}}i.onUserCloseViaDialogOrKeybindRef.current=g;async function w(){c(!0);try{let E=await t();if(!E||!o||!r)return;if(!(await o.setRecovery({recoveryMethod:"privy",address:r.address,accessToken:E})).address)throw new Error("Unable to set recovery on wallet");let A=await n();if(!A)throw new Error("Unable to set recovery on wallet");let T=_chunkLEABMTNMjs.v.call(void 0, A);if(!T)throw new Error("Unabled to set recovery on wallet");u(!!A),setTimeout(()=>{_optionalChain([i, 'access', _789 => _789.data, 'optionalAccess', _790 => _790.setWalletPassword, 'optionalAccess', _791 => _791.onSuccess, 'call', _792 => _792(T)]),a()},_chunkXKAIXCX7js.r)}catch(E){h(E)}finally{c(!1)}}let v=!!(s||d);return f?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:g},"header"),_jsxruntime.jsx.call(void 0, v3,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:_jsxruntime.jsx.call(void 0, _ExclamationTriangleIcon2.default,{height:38,width:38,stroke:"var(--privy-color-error)"})}),_jsxruntime.jsx.call(void 0, uo,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),_jsxruntime.jsx.call(void 0, Xt,{style:{minHeight:"2rem"}}),_jsxruntime.jsx.call(void 0, sa,{onClick:()=>h(null),children:"Try again"}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:g},"header"),_jsxruntime.jsx.call(void 0, _LockClosedIcon4.default,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),_jsxruntime.jsx.call(void 0, uo,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),_jsxruntime.jsx.call(void 0, Kr,{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."}),_jsxruntime.jsx.call(void 0, Xt,{style:{minHeight:"2rem"}}),_jsxruntime.jsx.call(void 0, sa,{loading:s,disabled:v,onClick:()=>w(),children:d?"Success":"Confirm"}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})};var _walletadapterbase = require('@solana/wallet-adapter-base');async function Ju({tx:e,accessToken:t,walletProxy:r}){let o=Js(e,"from"),n=xa(e)?Buffer.from(e.message.serialize()):e.serializeMessage(),{response:a}=await r.rpcSolana({accessToken:t,publicKey:o.toBase58(),request:{method:"signMessage",params:{message:n.toString("base64")}}}),i=a.data.signature;e.addSignature(o,Buffer.from(i,"base64"))}async function Zd({tx:e,connection:t,accessToken:r,walletProxy:o,transactionOptions:n}){let a;try{await Ju({tx:e,accessToken:r,walletProxy:o});let i=e.serialize();a=await t.sendRawTransaction(i,n);let s=await t.confirmTransaction(a);if(s.value.err||s.value.err){let d=s.value.err||s.value.err;throw typeof d=="string"?new Error(d):d}let c=await t.getParsedTransaction(a,{maxSupportedTransactionVersion:0});return{signature:a,receipt:c}}catch(i){throw i.txSignature=a,i}}var T3=()=>{let{showFiatPrices:e,getUsdPriceForSol:t}=_chunkXKAIXCX7js.ra.call(void 0, ),[r,o]=_react.useState.call(void 0, !0),[n,a]=_react.useState.call(void 0, void 0),[i,s]=_react.useState.call(void 0, void 0);return _react.useEffect.call(void 0, ()=>{(async()=>{if(!e){o(!1);return}try{o(!0);let d=await t();d?s(d):a(new Error("Unable to fetch SOL price"))}catch(d){a(d)}finally{o(!1)}})()},[]),{solPrice:i,isSolPriceLoading:r,solPriceError:n}};var $T=({transactionIndex:e,maxIndex:t})=>typeof e!="number"||t===0?"":` (${e+1} / ${t+1})`,Jd=({img:e,submitError:t,prepareError:r,onClose:o,action:n,amount:a,title:i,subtitle:s,total:c,to:d,network:u,missingFunds:f,fee:h,from:g,cta:w,disabled:v,chain:E,isSubmitting:_,isPreparing:A,isTokenPriceLoading:T,isTokenContractInfoLoading:P,isSponsored:S,symbol:R,balance:D,onClick:F,spender:B,transactionIndex:K,maxIndex:W,onBack:X,chainName:L})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:o,backFn:X}),e&&_jsxruntime.jsx.call(void 0, oS,{children:e}),_jsxruntime.jsxs.call(void 0, uo,{style:{marginTop:e?"1.5rem":0},children:[i,_jsxruntime.jsx.call(void 0, $T,{maxIndex:W,transactionIndex:K})]}),_jsxruntime.jsx.call(void 0, Kr,{children:s}),_jsxruntime.jsxs.call(void 0, xi,{style:{marginTop:"2rem"},children:[c&&_jsxruntime.jsxs.call(void 0, nt,{children:[_jsxruntime.jsx.call(void 0, at,{children:"Total"}),_jsxruntime.jsx.call(void 0, ct,{$isLoading:A||T,children:c})]}),n&&n!=="transaction"&&n!=="transfer"&&_jsxruntime.jsxs.call(void 0, nt,{children:[_jsxruntime.jsx.call(void 0, at,{children:"Action"}),_jsxruntime.jsx.call(void 0, ct,{children:n})]}),a?_jsxruntime.jsxs.call(void 0, nt,{children:[_jsxruntime.jsx.call(void 0, at,{children:"Amount"}),_jsxruntime.jsxs.call(void 0, ct,{$isLoading:P,children:[rS(a)," ",R]})]}):null,B?_jsxruntime.jsxs.call(void 0, nt,{children:[_jsxruntime.jsx.call(void 0, at,{children:"Spender"}),_jsxruntime.jsx.call(void 0, ct,{children:_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.Q,{address:B,url:_optionalChain([E, 'optionalAccess', _793 => _793.blockExplorers, 'optionalAccess', _794 => _794.default, 'optionalAccess', _795 => _795.url]),showCopyIcon:!1})})]}):null,d&&_jsxruntime.jsxs.call(void 0, nt,{children:[_jsxruntime.jsx.call(void 0, at,{children:"To"}),_jsxruntime.jsx.call(void 0, ct,{children:_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.Q,{address:d,url:_optionalChain([E, 'optionalAccess', _796 => _796.blockExplorers, 'optionalAccess', _797 => _797.default, 'optionalAccess', _798 => _798.url]),showCopyIcon:!1})})]}),_jsxruntime.jsxs.call(void 0, nt,{children:[_jsxruntime.jsx.call(void 0, at,{children:"Network"}),_jsxruntime.jsx.call(void 0, ct,{children:u})]}),S===!1&&_jsxruntime.jsxs.call(void 0, nt,{children:[_jsxruntime.jsx.call(void 0, at,{children:"Estimated fee"}),_jsxruntime.jsx.call(void 0, ct,{$isLoading:A||T,children:h})]})]}),_jsxruntime.jsx.call(void 0, Xt,{}),t?_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.S,{style:{marginTop:"2rem"},children:t.message}):r?_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.S,{style:{marginTop:"2rem"},children:tS}):null,_jsxruntime.jsx.call(void 0, eS,{$useSmallMargins:!!(r||t),address:g,balance:D,isLoading:A||T,errMsg:!A&&!r&&!t&&f?`Add funds on ${_nullishCoalesce(_optionalChain([E, 'optionalAccess', _799 => _799.name]), () => (L))} to complete transaction.`:void 0}),_jsxruntime.jsx.call(void 0, U,{style:{marginTop:"1rem"},loading:_,disabled:v||A,onClick:F,children:w}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]}),eS=_styledcomponents2.default.call(void 0, _chunkLEABMTNMjs.V)`
2590
+ ${e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;"}
2591
+ `,tS="There was an error preparing your transaction. Your transaction request will likely fail.",rS=e=>e.toLocaleString(),oS=_styledcomponents2.default.div`
2592
+ display: flex;
2593
+ width: 100%;
2594
+ justify-content: center;
2595
+ max-height: 40px;
2596
+
2597
+ > img {
2598
+ object-fit: contain;
2599
+ border-radius: var(--privy-border-radius-sm);
2600
+ }
2601
+ `;var _ClipboardDocumentIcon = require('@heroicons/react/24/outline/ClipboardDocumentIcon'); var _ClipboardDocumentIcon2 = _interopRequireDefault(_ClipboardDocumentIcon);var _ExclamationCircleIcon = require('@heroicons/react/24/outline/ExclamationCircleIcon'); var _ExclamationCircleIcon2 = _interopRequireDefault(_ExclamationCircleIcon);var aS=new Set([_logger.ErrorCode.CALL_EXCEPTION,_logger.ErrorCode.NONCE_EXPIRED,_logger.ErrorCode.REPLACEMENT_UNDERPRICED,_logger.ErrorCode.TRANSACTION_REPLACED]),P3=e=>{let t;return e.code&&e.code!==-32e3&&aS.has(e.code)&&(t=e.transactionHash),t},A3=e=>e.code==="SERVER_ERROR"?_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([e, 'access', _800 => _800.error, 'optionalAccess', _801 => _801.message]), () => (e.reason)), () => (e.message)), () => ("unknown error")):_optionalChain([e, 'access', _802 => _802.error, 'optionalAccess', _803 => _803.code])==="SERVER_ERROR"?_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([e, 'access', _804 => _804.error, 'optionalAccess', _805 => _805.error, 'optionalAccess', _806 => _806.message]), () => (e.reason)), () => (e.message)), () => ("unknown error")):_nullishCoalesce(_nullishCoalesce(e.reason, () => (e.message)), () => ("unknown error"));var dS=(e,t)=>{if(t==="ethereum"){let n=e,a=n.code?_optionalChain([n, 'access', _807 => _807.code, 'optionalAccess', _808 => _808.toString, 'call', _809 => _809(), 'access', _810 => _810.charAt, 'call', _811 => _811(0)])+_optionalChain([n, 'access', _812 => _812.code, 'optionalAccess', _813 => _813.toString, 'call', _814 => _814(), 'access', _815 => _815.slice, 'call', _816 => _816(1), 'access', _817 => _817.replace, 'call', _818 => _818("_"," "), 'access', _819 => _819.toLowerCase, 'call', _820 => _820()]):"Something went wrong.",i=P3(n),s=A3(n);return{errorCode:a,transactionHash:i,errorMessage:s}}let r=e.txSignature,o=_optionalChain([e, 'optionalAccess', _821 => _821.transactionMessage])||"Something went wrong.";if(Array.isArray(e.logs)){let n=e.logs.find(a=>/Transfer: insufficient lamports/gi.test(a));n&&(o=n)}return{transactionHash:r,errorMessage:o}},pS=({chains:e,chainId:t,network:r,connection:o,transactionHash:n})=>r==="ethereum"?_nullishCoalesce(_optionalChain([e, 'access', _822 => _822.find, 'call', _823 => _823(a=>a.id===t), 'optionalAccess', _824 => _824.blockExplorers, 'optionalAccess', _825 => _825.default, 'access', _826 => _826.url]), () => ("https://etherscan.io")):qC(n||"",Bd(_optionalChain([o, 'optionalAccess', _827 => _827.rpcEndpoint])||"")),uS=()=>_jsxruntime.jsxs.call(void 0, yS,{children:[_jsxruntime.jsx.call(void 0, CS,{}),_jsxruntime.jsx.call(void 0, gS,{})]}),$d=({transactionError:e,chainId:t,onClose:r,onRetry:o,network:n,connection:a})=>{let{chains:i}=_chunkXKAIXCX7js.ra.call(void 0, ),[s,c]=_react.useState.call(void 0, !1),{errorCode:d,transactionHash:u,errorMessage:f}=dS(e,n),h=pS({chains:i,chainId:t,network:n,connection:a,transactionHash:u});return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:r}),_jsxruntime.jsxs.call(void 0, mS,{children:[_jsxruntime.jsx.call(void 0, uS,{}),_jsxruntime.jsx.call(void 0, fS,{children:d}),_jsxruntime.jsx.call(void 0, hS,{children:"Please try again."}),_jsxruntime.jsxs.call(void 0, k3,{children:[_jsxruntime.jsx.call(void 0, x3,{children:"Error message"}),_jsxruntime.jsx.call(void 0, R3,{clickable:!1,children:f})]}),u&&_jsxruntime.jsxs.call(void 0, k3,{children:[_jsxruntime.jsx.call(void 0, x3,{children:"Transaction hash"}),_jsxruntime.jsxs.call(void 0, wS,{children:["Copy this hash to view details about the transaction on a"," ",_jsxruntime.jsx.call(void 0, "u",{children:_jsxruntime.jsx.call(void 0, "a",{href:h,children:"block explorer"})}),"."]}),_jsxruntime.jsxs.call(void 0, R3,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(u),c(!0)},children:[u,_jsxruntime.jsx.call(void 0, TS,{clicked:s})]})]}),_jsxruntime.jsx.call(void 0, vS,{onClick:()=>o({resetNonce:!!u}),children:"Retry transaction"})]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]})},mS=_styledcomponents2.default.div`
2602
+ display: flex;
2603
+ flex-direction: column;
2604
+ align-items: center;
2605
+ justify-content: center;
2606
+ `,fS=_styledcomponents2.default.span`
2607
+ color: var(--privy-color-foreground);
2608
+ text-align: center;
2609
+ font-size: 1.125rem;
2610
+ font-weight: 500;
2611
+ line-height: 1.25rem; /* 111.111% */
2612
+ text-align: center;
2613
+ margin: 10px;
2614
+ `,hS=_styledcomponents2.default.span`
2615
+ margin-top: 4px;
2616
+ margin-bottom: 10px;
2617
+ color: var(--privy-color-foreground-3);
2618
+ text-align: center;
2619
+
2620
+ font-size: 0.875rem;
2621
+ font-style: normal;
2622
+ font-weight: 400;
2623
+ line-height: 20px; /* 142.857% */
2624
+ letter-spacing: -0.008px;
2625
+ `,yS=_styledcomponents2.default.div`
2626
+ position: relative;
2627
+ width: 60px;
2628
+ height: 60px;
2629
+ margin: 10px;
2630
+ display: flex;
2631
+ justify-content: center;
2632
+ align-items: center;
2633
+ `,gS=_styledcomponents2.default.call(void 0, _ExclamationCircleIcon2.default)`
2634
+ position: absolute;
2635
+ width: 35px;
2636
+ height: 35px;
2637
+ color: var(--privy-color-error);
2638
+ `,CS=_styledcomponents2.default.div`
2639
+ position: absolute;
2640
+ width: 60px;
2641
+ height: 60px;
2642
+ border-radius: 50%;
2643
+ background-color: var(--privy-color-error);
2644
+ opacity: 0.1;
2645
+ `,vS=_styledcomponents2.default.call(void 0, U)`
2646
+ && {
2647
+ margin-top: 24px;
2648
+ }
2649
+ transition: color 350ms ease, background-color 350ms ease;
2650
+ `,x3=_styledcomponents2.default.span`
2651
+ width: 100%;
2652
+ text-align: left;
2653
+ font-size: 0.825rem;
2654
+ color: var(--privy-color-foreground);
2655
+ padding: 4px;
2656
+ `,k3=_styledcomponents2.default.div`
2657
+ width: 100%;
2658
+ margin: 5px;
2659
+ display: flex;
2660
+ flex-direction: column;
2661
+ justify-content: center;
2662
+ align-items: center;
2663
+ `,wS=_styledcomponents2.default.text`
2664
+ position: relative;
2665
+ width: 100%;
2666
+ padding: 5px;
2667
+ font-size: 0.8rem;
2668
+ color: var(--privy-color-foreground-3);
2669
+ text-align: left;
2670
+ word-wrap: break-word;
2671
+ `,R3=_styledcomponents2.default.span`
2672
+ position: relative;
2673
+ width: 100%;
2674
+ background-color: var(--privy-color-background-2);
2675
+ padding: 8px 12px;
2676
+ border-radius: 10px;
2677
+ margin-top: 5px;
2678
+ font-size: 14px;
2679
+ color: var(--privy-color-foreground-3);
2680
+ text-align: left;
2681
+ word-wrap: break-word;
2682
+ ${e=>e.clickable&&`cursor: pointer;
2683
+ transition: background-color 0.3s;
2684
+ padding-right: 45px;
2685
+
2686
+ &:hover {
2687
+ background-color: var(--privy-color-foreground-4);
2688
+ }`}
2689
+ `,bS=_styledcomponents2.default.call(void 0, _ClipboardDocumentIcon2.default)`
2690
+ position: absolute;
2691
+ top: 13px;
2692
+ right: 13px;
2693
+ width: 24px;
2694
+ height: 24px;
2695
+ `,ES=_styledcomponents2.default.call(void 0, _ClipboardDocumentCheckIcon2.default)`
2696
+ position: absolute;
2697
+ top: 13px;
2698
+ right: 13px;
2699
+ width: 24px;
2700
+ height: 24px;
2701
+ `,TS=({clicked:e})=>e?_jsxruntime.jsx.call(void 0, ES,{}):_jsxruntime.jsx.call(void 0, bS,{});var _3=({from:e,to:t,value:r,fees:o,transactionInfo:n,solPrice:a,rpcEndpoint:i})=>_jsxruntime.jsxs.call(void 0, xi,{children:[_jsxruntime.jsxs.call(void 0, nt,{children:[_jsxruntime.jsx.call(void 0, at,{children:"Total"}),_jsxruntime.jsx.call(void 0, ct,{children:_jsxruntime.jsx.call(void 0, Bu,{quantities:[r,o||0n],tokenPrice:a})})]}),_jsxruntime.jsxs.call(void 0, nt,{children:[_jsxruntime.jsx.call(void 0, at,{children:"From"}),_jsxruntime.jsx.call(void 0, ct,{children:_jsxruntime.jsx.call(void 0, Gi,{walletAddress:e,rpcEndpoint:i,network:"solana"})})]}),_jsxruntime.jsxs.call(void 0, nt,{children:[_jsxruntime.jsx.call(void 0, at,{children:"To"}),_jsxruntime.jsx.call(void 0, ct,{children:_jsxruntime.jsx.call(void 0, Gi,{walletAddress:t,rpcEndpoint:i,network:"solana"})})]}),n&&n.action&&_jsxruntime.jsxs.call(void 0, nt,{children:[_jsxruntime.jsx.call(void 0, at,{children:"Action"}),_jsxruntime.jsx.call(void 0, ct,{children:n.action})]}),o!=null&&_jsxruntime.jsxs.call(void 0, nt,{children:[_jsxruntime.jsx.call(void 0, at,{children:"Fees"}),_jsxruntime.jsx.call(void 0, ct,{children:_jsxruntime.jsx.call(void 0, Bu,{quantities:[o||0n],tokenPrice:a})})]})]});var I3=({from:e,to:t,amount:r,fees:o,onClose:n,receiptHeader:a,receiptDescription:i,transactionInfo:s,solPrice:c,rpcEndpoint:d})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:n}),_jsxruntime.jsx.call(void 0, et,{style:{marginBottom:"16px"},children:_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, mc,{color:"var(--privy-color-success-light)"}),_jsxruntime.jsx.call(void 0, _CheckCircleIcon4.default,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),_jsxruntime.jsx.call(void 0, Ce,{title:_nullishCoalesce(a, () => ("Transaction completed successfully.")),description:_nullishCoalesce(i, () => (""))}),_jsxruntime.jsx.call(void 0, _3,{solPrice:c,from:e,to:t,value:r,fees:o,transactionInfo:s,rpcEndpoint:d}),_jsxruntime.jsx.call(void 0, Xt,{}),_jsxruntime.jsx.call(void 0, xS,{loading:!1,onClick:n,children:"Close"}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]}),xS=_styledcomponents2.default.call(void 0, U)`
2702
+ && {
2703
+ margin-top: 24px;
2704
+ }
2705
+ transition: color 350ms ease, background-color 350ms ease;
2706
+ `;var W3=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t}=_chunk3AGMJGHJjs.b.call(void 0, ),{closePrivyModal:r,walletProxy:o}=_chunkXKAIXCX7js.ra.call(void 0, ),n=_chunkXKAIXCX7js.oa.call(void 0, ),{user:a}=_chunkXKAIXCX7js.ta.call(void 0, ),[i,s]=_react.useState.call(void 0, _optionalChain([e, 'optionalAccess', _828 => _828.sendSolanaTransaction, 'optionalAccess', _829 => _829.transactionRequest])),[c,d]=_react.useState.call(void 0, ),[u,f]=_react.useState.call(void 0, ),[h,g]=_react.useState.call(void 0, 0),[w,v]=_react.useState.call(void 0, !1),[E,_]=_react.useState.call(void 0, ),[A,T]=_react.useState.call(void 0, null),P=_optionalChain([e, 'optionalAccess', _830 => _830.sendSolanaTransaction, 'optionalAccess', _831 => _831.connection]),S=_optionalChain([e, 'optionalAccess', _832 => _832.sendSolanaTransaction, 'optionalAccess', _833 => _833.transactingWallet]),R=_optionalChain([c, 'optionalAccess', _834 => _834.instructions, 'access', _835 => _835.at, 'call', _836 => _836(h)]),D=_nullishCoalesce(_optionalChain([c, 'optionalAccess', _837 => _837.instructions, 'access', _838 => _838.length]), () => (1));if(_react.useEffect.call(void 0, ()=>{async function Ee(){if(i&&P)try{f(void 0);let ue=await Dd(i,P);d(ue),g(0)}catch(ue){console.warn("Failed to prepare transaction",ue),f(ue)}}Ee()},[i,P]),!i||!_optionalChain([e, 'optionalAccess', _839 => _839.sendSolanaTransaction])||!S||!P){let Ee=new Error("Invalid transaction request");return _jsxruntime.jsx.call(void 0, jo,{error:Ee,onClick:()=>{_optionalChain([e, 'optionalAccess', _840 => _840.sendSolanaTransaction, 'optionalAccess', _841 => _841.onFailure, 'call', _842 => _842(Ee)]),r({shouldCallAuthOnSuccess:!1})}})}let{solPrice:F,isSolPriceLoading:B}=T3(),K=()=>{if(!w)return E?(_optionalChain([e, 'optionalAccess', _843 => _843.sendSolanaTransaction, 'optionalAccess', _844 => _844.onSuccess, 'call', _845 => _845(E)]),r({shouldCallAuthOnSuccess:!1})):(_optionalChain([e, 'optionalAccess', _846 => _846.sendSolanaTransaction, 'optionalAccess', _847 => _847.onFailure, 'call', _848 => _848(_nullishCoalesce(_nullishCoalesce(A, () => (u)), () => (new Error("User exited the modal before submitting the transaction"))))]),g(0),r({shouldCallAuthOnSuccess:!1}))};t.current=K;let W=async()=>{if(h<(_nullishCoalesce(_optionalChain([c, 'optionalAccess', _849 => _849.instructions, 'access', _850 => _850.length]), () => (1)))-1){g(h+1);return}try{v(!0);let Ee=await pe();if(w||!Ee||!S||!o||!a)return;let{signature:ue,receipt:M}=await Zd({tx:i,accessToken:Ee,connection:P,walletProxy:o,transactionOptions:_optionalChain([e, 'access', _851 => _851.sendSolanaTransaction, 'optionalAccess', _852 => _852.transactionOptions])});_(Nd(ue,M))}catch(Ee){console.warn({transaction:i,error:Ee}),T(Ee)}finally{v(!1)}},X=n.embeddedWallets.priceDisplay.primary==="fiat-currency",L=_optionalChain([e, 'access', _853 => _853.sendTransaction, 'optionalAccess', _854 => _854.uiOptions, 'optionalAccess', _855 => _855.transactionInfo, 'optionalAccess', _856 => _856.title])||(_optionalChain([R, 'optionalAccess', _857 => _857.action])==="approve"?"Confirm address":"Approve transaction"),Q=_optionalChain([e, 'access', _858 => _858.sendTransaction, 'optionalAccess', _859 => _859.uiOptions, 'optionalAccess', _860 => _860.description])||`${n.name} wants your permission to approve the following transaction.`,xe=_optionalChain([e, 'access', _861 => _861.sendTransaction, 'optionalAccess', _862 => _862.uiOptions, 'optionalAccess', _863 => _863.transactionInfo, 'optionalAccess', _864 => _864.contractInfo, 'optionalAccess', _865 => _865.imgUrl])?_jsxruntime.jsx.call(void 0, "img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,he=_optionalChain([R, 'optionalAccess', _866 => _866.amount])||0n,$=h===0&&_optionalChain([c, 'optionalAccess', _867 => _867.fees])||0n,Y=_optionalChain([R, 'optionalAccess', _868 => _868.balance])||0n,ke=_optionalChain([R, 'optionalAccess', _869 => _869.from]),ye=_optionalChain([R, 'optionalAccess', _870 => _870.to]),te=he+$,se=Bi(te),Ge=X&&F?Hi(te,F):void 0,Qe=$?Bi($):void 0,ce=X&&F?Hi($,F):void 0,pt=Y?Bi(Y):void 0,or=X&&F?Hi(Y,F):void 0,wt=_optionalChain([e, 'access', _871 => _871.sendTransaction, 'optionalAccess', _872 => _872.uiOptions, 'optionalAccess', _873 => _873.buttonText])||"Approve";return E?_jsxruntime.jsx.call(void 0, I3,{from:_nullishCoalesce(_optionalChain([R, 'optionalAccess', _874 => _874.from, 'access', _875 => _875.toBase58, 'call', _876 => _876()]), () => ("")),to:_nullishCoalesce(_optionalChain([R, 'optionalAccess', _877 => _877.to, 'access', _878 => _878.toBase58, 'call', _879 => _879()]), () => ("")),amount:he,fees:h===0?E.fees:0n,onClose:K,transactionInfo:_optionalChain([e, 'access', _880 => _880.sendTransaction, 'optionalAccess', _881 => _881.uiOptions, 'access', _882 => _882.transactionInfo]),solPrice:F,receiptHeader:_optionalChain([e, 'access', _883 => _883.sendTransaction, 'optionalAccess', _884 => _884.uiOptions, 'access', _885 => _885.successHeader]),receiptDescription:_optionalChain([e, 'access', _886 => _886.sendTransaction, 'optionalAccess', _887 => _887.uiOptions, 'access', _888 => _888.successDescription]),rpcEndpoint:P.rpcEndpoint}):A?_jsxruntime.jsx.call(void 0, $d,{transactionError:A,connection:P,onClose:K,network:"solana",onRetry:async()=>{T(null);let{blockhash:Ee}=await P.getLatestBlockhash();_walletadapterbase.isVersionedTransaction.call(void 0, i)?i.message.recentBlockhash=Ee:i.recentBlockhash=Ee,s(i)}}):_jsxruntime.jsx.call(void 0, Jd,{isSubmitting:w,submitError:A,isPreparing:!c,isTokenPriceLoading:B,isTokenContractInfoLoading:!1,symbol:"SOL",chain:void 0,img:xe,title:L,subtitle:Q,from:_optionalChain([ke, 'optionalAccess', _889 => _889.toBase58, 'call', _890 => _890()])||"",to:_optionalChain([ye, 'optionalAccess', _891 => _891.toBase58, 'call', _892 => _892()]),fee:_nullishCoalesce(ce, () => (Qe)),total:he!=null?_nullishCoalesce(Ge, () => (se)):void 0,spender:_optionalChain([R, 'optionalAccess', _893 => _893.spender, 'optionalAccess', _894 => _894.toBase58, 'call', _895 => _895()]),network:"Solana",cta:wt,missingFunds:!u&&!_optionalChain([R, 'optionalAccess', _896 => _896.hasFunds]),action:_optionalChain([R, 'optionalAccess', _897 => _897.action]),balance:_nullishCoalesce(or, () => (pt)),prepareError:u,chainName:"Solana",onClose:K,onClick:W,isSponsored:!1,transactionIndex:h,maxIndex:D-1,disabled:!_optionalChain([R, 'optionalAccess', _898 => _898.hasFunds]),onBack:h>0&&D>1?()=>g(h-1):void 0})};async function ep({accessToken:e,rootWallet:t,transactingWallet:r,walletProxy:o,transactionRequest:n,provider:a,requesterAppId:i}){n=Object.assign({chainId:_chunkXKAIXCX7js.O},n),IS(n);let c=(await o.rpc({address:t.address,hdWalletIndex:_nullishCoalesce(r.walletIndex, () => (void 0)),accessToken:e,requesterAppId:i,request:{method:"eth_signTransaction",params:[n]}})).response.data;return await a.sendTransaction(c)}async function tp(e,t,r,o){let n=await o.getBalance(e),a=t.value||0,s=!n.sub(_jssdkcore.QuantityToBigNumber.call(void 0, a)).sub(r).isNegative();return{balance:n,hasSufficientFunds:s}}function IS(e){let t=["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"];for(let r of t){let o=e[r];if(!(typeof o>"u")&&!WS(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 WS(e){let t=typeof e=="number",r=typeof e=="bigint",o=typeof e=="string"&&LS(e);return t||r||o}function LS(e){return/^-?0x[a-f0-9]+$/i.test(e)}function rp(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 $u={[_chunkXKAIXCX7js.da.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[_chunkXKAIXCX7js.ia.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[_chunkXKAIXCX7js.ea.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[_chunkXKAIXCX7js.fa.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[_chunkXKAIXCX7js.ga.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[_chunkXKAIXCX7js.ha.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[_chunkXKAIXCX7js.$.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[_chunkXKAIXCX7js.aa.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[_chunkXKAIXCX7js.Z.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[_chunkXKAIXCX7js._.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[_chunkXKAIXCX7js.X.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[_chunkXKAIXCX7js.Y.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"},L3=(e,t)=>e===$u[t.id];var em=({address:e,appConfig:t,fundWalletConfig:r,methodScreen:o,chainIdOverride:n,comingFromSendTransactionScreen:a=!1})=>{if(!t.fundingConfig||t.fundingConfig.methods.length===0)return;let i;n?i=n:dd(r)&&r.chain?i=r.chain.id:i=_chunk3AGMJGHJjs.e.call(void 0, t.fundingConfig.defaultRecommendedCurrency.chain);let s=t.chains.find(h=>h.id===i);if(!s)throw new (0, _chunkXKAIXCX7js.g)(`Funding chain ${i} is not in PrivyProvider chains list`);let c=dd(r)&&r.amount?r.amount:t.fundingConfig.defaultRecommendedAmount,d,u=!1;function f(){if(!i)return;let h=$u[i];_optionalChain([t, 'access', _899 => _899.fundingConfig, 'optionalAccess', _900 => _900.methods, 'access', _901 => _901.includes, 'call', _902 => _902("external")])&&!h&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),d=h,u=!0}return dd(r)&&"asset"in r?r.asset==="USDC"?f():typeof r.asset!="string"&&"erc20"in r.asset&&(d=r.asset.erc20,u=L3(d,s)):t.fundingConfig.defaultRecommendedCurrency.asset==="USDC"&&f(),{address:e,amount:c,chain:s,erc20Address:d,erc20ContractInfo:u?{symbol:"USDC",decimals:6}:void 0,isUSDC:u,methodScreen:o,comingFromSendTransactionScreen:a,...n2(r)?{moonpayConfigOverride:r.config}:{}}};var tm=["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"],O3={["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"},OS={moonpay:"MOONPAY_PROMPT_SCREEN","coinbase-onramp":"COINBASE_ONRAMP_STATUS_SCREEN",external:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};function op({fundingMethods:e}){if(e.length===0)throw new Error("Wallet funding is not enabled");return e.length===1?OS[e[0]]:"FUNDING_METHOD_SELECTION_SCREEN"}var _bignumber = require('@ethersproject/bignumber');var DS=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=_bignumber.BigNumber.from(e.gasUsed),o=_bignumber.BigNumber.from(e.effectiveGasPrice),n=r.mul(o);if(t){let a=_bignumber.BigNumber.from(t);n=n.add(a)}return n.toString()}catch (e32){return}else return},N3=({txn:e,receipt:t,transactionInfo:r,onClose:o,tokenPrice:n,tokenSymbol:a,l1GasEstimate:i,receiptHeader:s,receiptDescription:c})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:o}),_jsxruntime.jsx.call(void 0, pa,{title:_nullishCoalesce(s, () => ("Transaction complete!")),description:_nullishCoalesce(c, () => ("You're all set."))}),_jsxruntime.jsx.call(void 0, Hd,{tokenPrice:n,from:t.from,to:t.to,gas:DS(t,i),txn:e,transactionInfo:r,tokenSymbol:a}),_jsxruntime.jsx.call(void 0, Xt,{}),_jsxruntime.jsx.call(void 0, US,{loading:!1,onClick:o,children:"All Done"}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]}),US=_styledcomponents2.default.call(void 0, U)`
2707
+ && {
2708
+ margin-top: 24px;
2709
+ }
2710
+ transition: color 350ms ease, background-color 350ms ease;
2711
+ `;var U3=e=>{let t=VS(e);if(t)return{action:"approve",isErc20Ish:!0,functionName:t.functionName,spender:t.args[0],amount:t.args[1]};let r=GS(e);return r?{action:"transfer",isErc20Ish:!0,functionName:r.functionName,amount:r.args[1]}:{action:"transaction",isErc20Ish:!1}},HS=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],VS=e=>{try{return _viem.decodeFunctionData.call(void 0, {abi:HS,data:e})}catch (e33){return null}},GS=e=>{try{return _viem.decodeFunctionData.call(void 0, {abi:Is,data:e})}catch (e34){return null}};var F3=(e,t,r)=>{let[o,n]=_react.useState.call(void 0, null),{getAccessToken:a}=_chunkXKAIXCX7js.ta.call(void 0, ),{walletProxy:i}=_chunkXKAIXCX7js.ra.call(void 0, ),s=async()=>{if(!await a()||!i||!t)return null;let d=[],u=await _jssdkcore.populateTransactionRequest.call(void 0, t.address,e,r).catch(v=>(d.push(v),e)),{totalGasEstimate:f,l1ExecutionFeeEstimate:h}=await _jssdkcore.calculateTotalGasEstimate.call(void 0, u,r).catch(v=>(d.push(v),{totalGasEstimate:null,l1ExecutionFeeEstimate:null})),{balance:g,hasSufficientFunds:w}=await tp(t.address,u,_nullishCoalesce(f, () => (_bignumber.BigNumber.from(0))),r).catch(v=>(d.push(v),{balance:null,hasSufficientFunds:!1}));return{tx:u,totalGasEstimate:f,l1ExecutionFeeEstimate:h,balance:g,hasFunds:w,errors:d}};return _react.useEffect.call(void 0, ()=>{o&&n(null),s().then(n)},[e]),o};var V3=new _t(new Vr("There was an issue preparing your transaction",_jssdkcore.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode)),XS=(e,t)=>{if(_optionalChain([e, 'optionalAccess', _903 => _903.sendTransaction]))return"transactionRequest"in e.sendTransaction?e.sendTransaction.transactionRequest:e.sendTransaction.transactionRequests[t]},ZS=e=>_optionalChain([e, 'optionalAccess', _904 => _904.sendTransaction])?"transactionRequest"in e.sendTransaction?0:e.sendTransaction.transactionRequests.length-1:0,q3=()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t,setModalData:r,navigate:o}=_chunk3AGMJGHJjs.b.call(void 0, ),{rpcConfig:n,chains:a,closePrivyModal:i,walletProxy:s}=_chunkXKAIXCX7js.ra.call(void 0, ),{getAccessToken:c,user:d}=_chunkXKAIXCX7js.ta.call(void 0, ),u=_chunkXKAIXCX7js.oa.call(void 0, ),[f,h]=_react.useState.call(void 0, 0),g=ZS(e),[w,v]=_react.useState.call(void 0, XS(e,f)),[E,_]=_react.useState.call(void 0, null),[A,T]=_react.useState.call(void 0, ),[P,S]=_react.useState.call(void 0, !1),[R,D]=_react.useState.call(void 0, null),[F,B]=_react.useState.call(void 0, null);if(!w||!_optionalChain([e, 'optionalAccess', _905 => _905.sendTransaction])||!_optionalChain([e, 'optionalAccess', _906 => _906.sendTransaction, 'access', _907 => _907.transactingWallet]))return _jsxruntime.jsx.call(void 0, jo,{error:new Error("Invalid transaction request"),onClick:()=>{_optionalChain([e, 'optionalAccess', _908 => _908.sendTransaction, 'optionalAccess', _909 => _909.onFailure, 'call', _910 => _910(V3)]),i({shouldCallAuthOnSuccess:!1})}});let K=e.sendTransaction.rootWallet,W=e.sendTransaction.transactingWallet,X=_react.useMemo.call(void 0, ()=>a.find(_e=>Number(_e.id)===Number(w.chainId)),[w.chainId]),L=_nullishCoalesce(_optionalChain([X, 'optionalAccess', _911 => _911.nativeCurrency, 'access', _912 => _912.symbol]), () => ("ETH")),{action:Q,amount:xe,spender:he,isErc20Ish:$}=_react.useMemo.call(void 0, ()=>U3(w.data),[w.data]);_react.useEffect.call(void 0, ()=>{w.to&&X&&$&&ld({address:w.to,chain:X,rpcConfig:u.rpcConfig,privyAppId:u.id}).then(_).catch(console.error)},[w.to,X]);let{tokenPrice:Y,isTokenPriceLoading:ke}=Lo(w),ye=_react.useMemo.call(void 0, ()=>_chunkLEABMTNMjs.s.call(void 0, Number(w.chainId),a,n,{appId:u.id}),[w.chainId,n]),te=F3(w,W,ye);_react.useEffect.call(void 0, ()=>{_optionalChain([e, 'access', _913 => _913.sendTransaction, 'optionalAccess', _914 => _914.getIsSponsored])?e.sendTransaction.getIsSponsored().then(T).catch(console.error):T(!1)},[e.sendTransaction.getIsSponsored]);let se=()=>{if(!P)return R?(_optionalChain([e, 'optionalAccess', _915 => _915.sendTransaction, 'optionalAccess', _916 => _916.onSuccess, 'call', _917 => _917(R.response)]),i({shouldCallAuthOnSuccess:!1})):!F&&!_optionalChain([te, 'optionalAccess', _918 => _918.errors, 'access', _919 => _919[0]])?(_optionalChain([e, 'optionalAccess', _920 => _920.sendTransaction, 'optionalAccess', _921 => _921.onFailure, 'call', _922 => _922(new _t(new Vr("The user rejected the request",_jssdkcore.ProviderErrors.E4001_USER_REJECTED_REQUEST.eipCode)))]),i({shouldCallAuthOnSuccess:!1})):(_optionalChain([e, 'optionalAccess', _923 => _923.sendTransaction, 'optionalAccess', _924 => _924.onFailure, 'call', _925 => _925(_nullishCoalesce(_nullishCoalesce(F, () => (_optionalChain([te, 'optionalAccess', _926 => _926.errors, 'access', _927 => _927[0]]))), () => (V3)))]),i({shouldCallAuthOnSuccess:!1}))};t.current=se;let Ge=async()=>{if(f<g){h(f+1);return}S(!0);try{let _e=await c();if(P||!_e||!W||!s||!d)return;let Pt=_optionalChain([e, 'optionalAccess', _928 => _928.sendTransaction, 'optionalAccess', _929 => _929.onConfirm])?await e.sendTransaction.onConfirm():(await ep({accessToken:_e,transactingWallet:W,rootWallet:K,walletProxy:s,transactionRequest:_nullishCoalesce(_optionalChain([te, 'optionalAccess', _930 => _930.tx]), () => (w)),provider:ye,requesterAppId:_optionalChain([e, 'access', _931 => _931.sendTransaction, 'optionalAccess', _932 => _932.requesterAppId])})).hash,Yt=await ye.getTransaction(Pt),br=await Yt.wait();D({receipt:rp(br),response:Yt})}catch(_e){console.warn({transaction:_nullishCoalesce(_optionalChain([te, 'optionalAccess', _933 => _933.tx]), () => (w)),error:_e}),B(_e)}finally{S(!1)}},Qe=!!(u.fundingConfig&&u.fundingConfig.methods.length>0&&e.funding),ce=async()=>{if(!W)return;if(!Qe)throw new Error("Funding wallet is not enabled");let _e=op({fundingMethods:u.fundingConfig.methods});r({...e,funding:{...e.funding,methodScreen:_e}}),o(_e)},pt=u.embeddedWallets.priceDisplay.primary==="fiat-currency",or=_jssdkcore.QuantityToBigNumber.call(void 0, _nullishCoalesce(_optionalChain([te, 'optionalAccess', _934 => _934.tx, 'access', _935 => _935.value]), () => (0))).add(_jssdkcore.QuantityToBigNumber.call(void 0, _nullishCoalesce(_optionalChain([te, 'optionalAccess', _936 => _936.totalGasEstimate, 'optionalAccess', _937 => _937.toBigInt, 'call', _938 => _938()]), () => (0)))).toHexString(),wt=_chunkLEABMTNMjs.Z.call(void 0, or,L),Ee=pt&&Y?_chunkLEABMTNMjs.Y.call(void 0, or,Y):void 0,ue=_chunkLEABMTNMjs.Z.call(void 0, _nullishCoalesce(_optionalChain([te, 'optionalAccess', _939 => _939.totalGasEstimate, 'optionalAccess', _940 => _940.toString, 'call', _941 => _941()]), () => (0)),L),M=pt&&Y?_chunkLEABMTNMjs.Y.call(void 0, _nullishCoalesce(_optionalChain([te, 'optionalAccess', _942 => _942.totalGasEstimate, 'optionalAccess', _943 => _943.toString, 'call', _944 => _944()]), () => (0)),Y):void 0,le=_chunkLEABMTNMjs.Z.call(void 0, _nullishCoalesce(_optionalChain([te, 'optionalAccess', _945 => _945.balance, 'optionalAccess', _946 => _946.toString, 'call', _947 => _947()]), () => (0)),L,void 0,!0),nn=pt&&Y?_chunkLEABMTNMjs.Y.call(void 0, _nullishCoalesce(_optionalChain([te, 'optionalAccess', _948 => _948.balance, 'optionalAccess', _949 => _949.toString, 'call', _950 => _950()]), () => (0)),Y):void 0,G=_optionalChain([e, 'access', _951 => _951.sendTransaction, 'optionalAccess', _952 => _952.uiOptions, 'optionalAccess', _953 => _953.transactionInfo, 'optionalAccess', _954 => _954.title])||(Q==="approve"?"Confirm address":`Approve ${Q}`),J=_optionalChain([e, 'access', _955 => _955.sendTransaction, 'optionalAccess', _956 => _956.uiOptions, 'optionalAccess', _957 => _957.description])||`${u.name} wants your permission to approve the following transaction.`,Lt=_optionalChain([e, 'access', _958 => _958.sendTransaction, 'optionalAccess', _959 => _959.uiOptions, 'optionalAccess', _960 => _960.transactionInfo, 'optionalAccess', _961 => _961.contractInfo, 'optionalAccess', _962 => _962.imgUrl])?_jsxruntime.jsx.call(void 0, "img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,we=!!(te&&!te.errors[0]&&!te.hasFunds&&A===!1),gt=we&&Qe,Qi=gt?"Add funds":_optionalChain([e, 'access', _963 => _963.sendTransaction, 'optionalAccess', _964 => _964.uiOptions, 'optionalAccess', _965 => _965.buttonText])||(f<g?"Continue":"Approve");return _optionalChain([R, 'optionalAccess', _966 => _966.receipt])?_jsxruntime.jsx.call(void 0, N3,{txn:_nullishCoalesce(_optionalChain([te, 'optionalAccess', _967 => _967.tx]), () => (w)),onClose:se,receipt:R.receipt,transactionInfo:_optionalChain([e, 'access', _968 => _968.sendTransaction, 'optionalAccess', _969 => _969.uiOptions, 'access', _970 => _970.transactionInfo]),tokenPrice:Y,tokenSymbol:L,l1GasEstimate:_optionalChain([te, 'optionalAccess', _971 => _971.l1ExecutionFeeEstimate, 'optionalAccess', _972 => _972.toString, 'call', _973 => _973()]),receiptHeader:_optionalChain([e, 'access', _974 => _974.sendTransaction, 'optionalAccess', _975 => _975.uiOptions, 'access', _976 => _976.successHeader]),receiptDescription:_optionalChain([e, 'access', _977 => _977.sendTransaction, 'optionalAccess', _978 => _978.uiOptions, 'access', _979 => _979.successDescription])}):F?_jsxruntime.jsx.call(void 0, $d,{transactionError:F,network:"ethereum",chainId:_nullishCoalesce(_optionalChain([te, 'optionalAccess', _980 => _980.tx, 'access', _981 => _981.chainId]), () => (w.chainId)),onClose:se,onRetry:({resetNonce:_e})=>{B(null);let Pt={..._nullishCoalesce(_optionalChain([te, 'optionalAccess', _982 => _982.tx]), () => (w))};_e&&(Pt.nonce=void 0),v(Pt)}}):_jsxruntime.jsx.call(void 0, Jd,{transactionIndex:f,onBack:g!==0&&typeof f=="number"&&f!==0?()=>{h(f-1)}:void 0,maxIndex:g,disabled:we&&!Qe,isSubmitting:P,submitError:F,isPreparing:!te,isTokenPriceLoading:ke,isTokenContractInfoLoading:!E,prepareError:_optionalChain([te, 'optionalAccess', _983 => _983.errors, 'access', _984 => _984[0]]),symbol:_optionalChain([E, 'optionalAccess', _985 => _985.symbol]),chain:X,img:Lt,title:G,subtitle:J,spender:he,total:w.value?_nullishCoalesce(Ee, () => (wt)):void 0,fee:_nullishCoalesce(M, () => (ue)),isSponsored:A,to:w.to,network:_nullishCoalesce(_optionalChain([u, 'access', _986 => _986.chains, 'access', _987 => _987.find, 'call', _988 => _988(_e=>_e.id===w.chainId), 'optionalAccess', _989 => _989.name]), () => ("")),from:_nullishCoalesce(_optionalChain([W, 'optionalAccess', _990 => _990.address]), () => ("")),cta:Qi,missingFunds:we,action:Q,balance:_nullishCoalesce(nn, () => (le)),amount:xe&&E?Jc({amount:xe,decimals:E.decimals}):xe,onClose:se,onClick:gt?ce:Ge})};var _strings = require('@ethersproject/strings');var z3=_styledcomponents2.default.img`
2712
+ && {
2713
+ height: ${e=>e.size==="sm"?"65px":"140px"};
2714
+ width: ${e=>e.size==="sm"?"65px":"140px"};
2715
+ border-radius: 16px;
2716
+ margin-bottom: 12px;
2717
+ }
2718
+ `;var eP=e=>{if(!_bytes.isHexString.call(void 0, e))return e;try{return _strings.toUtf8String.call(void 0, e)}catch (e35){return e}},tP=e=>JSON.stringify(e,null,2),rP=({data:e})=>{let t=r=>typeof r=="object"&&r!==null?_jsxruntime.jsx.call(void 0, nP,{children:Object.entries(r).map(([o,n])=>_jsxruntime.jsxs.call(void 0, "li",{children:[_jsxruntime.jsxs.call(void 0, "strong",{children:[o,":"]})," ",t(n)]},o))}):_jsxruntime.jsx.call(void 0, "span",{children:String(r)});return _jsxruntime.jsx.call(void 0, "div",{children:t(e)})},oP=e=>{let{types:t,primaryType:r,...o}=e.typedData;return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, am,{children:_jsxruntime.jsx.call(void 0, rP,{data:o})}),_jsxruntime.jsx.call(void 0, Sn,{text:tP(e.typedData),itemName:"full payload to clipboard"})," "]})},Y3=()=>{let{authenticated:e}=_chunkXKAIXCX7js.ta.call(void 0, ),{initializeWalletProxy:t,closePrivyModal:r}=_chunkXKAIXCX7js.ra.call(void 0, ),{navigate:o,data:n,onUserCloseViaDialogOrKeybindRef:a}=_chunk3AGMJGHJjs.b.call(void 0, ),[i,s]=_react.useState.call(void 0, !0),[c,d]=_react.useState.call(void 0, ""),[u,f]=_react.useState.call(void 0, ),[h,g]=_react.useState.call(void 0, null),[w,v]=_react.useState.call(void 0, !1),E=h!==null;_react.useEffect.call(void 0, ()=>{e||o("LANDING")},[e]),_react.useEffect.call(void 0, ()=>{t(_chunkXKAIXCX7js.Q).then(B=>{s(!1),B||(d("An error has occurred, please try again."),f(new _t(new Vr(c,_jssdkcore.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:_,data:A,confirmAndSign:T,onSuccess:P,onFailure:S,uiOptions:R}=n.signMessage,D={title:R.title||"Sign message",description:R.description||"Signing this message will not cost you any fees.",buttonText:R.buttonText||"Sign and continue"},F=B=>{B?P(B):S(u||new _t(new Vr("The user rejected the request.",_jssdkcore.ProviderErrors.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout(()=>{g(null),d(""),f(void 0)},200)};return a.current=()=>{F(h)},_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{onClose:()=>F(h)}),_jsxruntime.jsx.call(void 0, ne,{}),R.iconUrl&&typeof R.iconUrl=="string"?_jsxruntime.jsx.call(void 0, sP,{children:_jsxruntime.jsx.call(void 0, z3,{size:"sm",src:R.iconUrl,alt:"app image"})}):null,_jsxruntime.jsx.call(void 0, uo,{children:D.title}),_jsxruntime.jsx.call(void 0, Kr,{children:D.description}),_==="personal_sign"&&_jsxruntime.jsx.call(void 0, am,{children:eP(A)}),_==="eth_signTypedData_v4"&&_jsxruntime.jsx.call(void 0, oP,{typedData:A}),_==="solana_signMessage"&&_jsxruntime.jsx.call(void 0, am,{children:A}),_jsxruntime.jsx.call(void 0, lP,{}),_jsxruntime.jsx.call(void 0, aP,{fail:!0,children:c}),_jsxruntime.jsx.call(void 0, sa,{disabled:w||E||i,loading:w,onClick:async()=>{v(!0),d("");try{let B=await T();g(B),v(!1),setTimeout(()=>{F(B)},_chunkXKAIXCX7js.r)}catch(B){console.error(B),d("An error has occurred, please try again."),f(new _t(new Vr(c,_jssdkcore.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),v(!1)}},children:w?"Signing...":E?_jsxruntime.jsxs.call(void 0, iP,{children:[_jsxruntime.jsx.call(void 0, Pi,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",_jsxruntime.jsx.call(void 0, "span",{children:"Success"})]}):D.buttonText}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})},am=_styledcomponents2.default.div`
2719
+ margin-top: 1.5rem;
2720
+ background-color: var(--privy-color-background-2);
2721
+ border-radius: var(--privy-border-radius-md);
2722
+ padding: 12px;
2723
+ text-align: left;
2724
+ max-height: 310px;
2725
+ overflow: scroll;
2726
+ white-space: pre-wrap;
2727
+ width: 100%;
2728
+
2729
+ // hide the scrollbars
2730
+ -ms-overflow-style: none; /* Internet Explorer 10+ */
2731
+ scrollbar-width: none; /* Firefox */
2732
+
2733
+ &::-webkit-scrollbar {
2734
+ display: none; /* Safari and Chrome */
2735
+ }
2736
+ }
2737
+ `,nP=_styledcomponents2.default.ul`
2738
+ margin-left: 12px !important;
2739
+ white-space: nowrap;
2740
+
2741
+ &:first-child {
2742
+ margin-left: 0 !important;
2743
+ }
2744
+
2745
+ strong {
2746
+ font-weight: 500 !important;
2747
+ }
2748
+ }
2749
+ `,aP=_styledcomponents2.default.div`
2750
+ line-height: 20px;
2751
+ height: 20px;
2752
+ font-size: 13px;
2753
+ color: ${e=>e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
2754
+ display: flex;
2755
+ justify-content: flex-start;
2756
+ width: 100%;
2757
+ margin-top: 16px;
2758
+ margin-bottom: 4px;
2759
+ `,iP=_styledcomponents2.default.span`
2760
+ display: flex;
2761
+ align-items: center;
2762
+ gap: 8px;
2763
+ `,sP=_styledcomponents2.default.div`
2764
+ display: flex;
2765
+ flex-direction: column;
2766
+ justify-content: center;
2767
+ align-items: center;
2768
+ width: 100%;
2769
+ height: 82px;
2770
+ `,lP=_styledcomponents2.default.div`
2771
+ flex-grow: 1;
2772
+ `;var J3=()=>{let{authenticated:e,logout:t,ready:r,user:o}=_chunkXKAIXCX7js.ta.call(void 0, ),{app:n,setModalData:a,navigate:i,resetNavigation:s,data:c}=_chunk3AGMJGHJjs.b.call(void 0, ),{initLoginWithTelegram:d,loginWithTelegram:u,updateWallets:f,setReadyToTrue:h,closePrivyModal:g,createAnalyticsEvent:w}=_chunkXKAIXCX7js.ra.call(void 0, ),[v,E]=_react.useState.call(void 0, !1),[_,A]=_react.useState.call(void 0, void 0),T=_chunkXKAIXCX7js.r;async function P(){try{await u(),E(!0),h(!0)}catch(D){if(_optionalChain([D, 'optionalAccess', _991 => _991.privyErrorCode])==="allowlist_rejected"){A(void 0),s(),i("ALLOWLIST_REJECTION_SCREEN");return}if(_optionalChain([D, 'optionalAccess', _992 => _992.privyErrorCode])==="max_accounts_reached"){console.error(new (0, _chunkXKAIXCX7js.o)(D).toString()),A(void 0),s(),i("USER_LIMIT_REACHED_SCREEN");return}if(_optionalChain([D, 'optionalAccess', _993 => _993.privyErrorCode])==="user_does_not_exist"){A(void 0),s(),i("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:F,detail:B}=Sp(D);A({retryable:F,detail:B,message:"Authentication failed"})}}_react.useEffect.call(void 0, ()=>{P()},[]),_react.useEffect.call(void 0, ()=>{if(!(r&&e&&v&&o))return;if(_optionalChain([n, 'optionalAccess', _994 => _994.legal, 'access', _995 => _995.requireUsersAcceptTerms])&&!o.hasAcceptedTerms){let B=setTimeout(()=>{i("AFFIRMATIVE_CONSENT_SCREEN")},T);return()=>clearTimeout(B)}if(_chunkLEABMTNMjs.A.call(void 0, o,_optionalChain([n, 'optionalAccess', _996 => _996.embeddedWallets, 'optionalAccess', _997 => _997.createOnLogin]))){let B=setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:K=>{console.error(K),w({eventName:"embedded_wallet_creation_failure_logout",payload:{error:K,provider:"telegram",screen:"TelegramAuthScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),i("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},T);return()=>clearTimeout(B)}f();let F=setTimeout(()=>g({shouldCallAuthOnSuccess:!0,isSuccess:!0}),T);return()=>clearTimeout(F)},[r,e,v,o]);let S=v?"Successfully connected with Telegram":_?_.message:"Verifying connection to Telegram",R="";return v?R="You\u2019re good to go!":_?R=_.detail:R="Just a few moments more",_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{}),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsxs.call(void 0, dP,{children:[_jsxruntime.jsx.call(void 0, et,{children:_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, ut,{success:v,fail:!!_}),_jsxruntime.jsx.call(void 0, Ad,{style:{width:"38px",height:"38px"}})]})}),_jsxruntime.jsxs.call(void 0, tt,{children:[_jsxruntime.jsx.call(void 0, "h3",{children:S}),_jsxruntime.jsx.call(void 0, "p",{children:R})]}),_&&_optionalChain([_, 'optionalAccess', _998 => _998.retryable])?_jsxruntime.jsx.call(void 0, fn,{onClick:()=>{d(void 0,_optionalChain([c, 'optionalAccess', _999 => _999.login, 'optionalAccess', _1000 => _1000.disableSignup])).then(async()=>P()).catch(D=>{let{retryable:F,detail:B}=Sp(D);A({retryable:F,detail:B,message:"Authentication failed"})}),A(void 0)},disabled:!v&&!_optionalChain([_, 'optionalAccess', _1001 => _1001.retryable]),children:"Retry"}):null]}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]})},dP=_styledcomponents2.default.div`
2773
+ display: flex;
2774
+ flex-direction: column;
2775
+ align-items: center;
2776
+ justify-content: center;
2777
+ margin-left: 27px;
2778
+ margin-right: 27px;
2779
+ gap: 24px;
2780
+ `;var t0=_react.forwardRef.call(void 0, (e,t)=>{let[r,o]=_react.useState.call(void 0, ""),[n,a]=_react.useState.call(void 0, !1),{authenticated:i,user:s}=_chunkXKAIXCX7js.ta.call(void 0, ),{initUpdateEmail:c}=_chunkXKAIXCX7js.ra.call(void 0, ),{navigate:d,setModalData:u,currentScreen:f}=_chunk3AGMJGHJjs.b.call(void 0, ),{enabled:h,token:g}=Pe(),w=_chunkLEABMTNMjs.f.call(void 0, r),v=n,E=n||!w,_=async T=>{if(!_optionalChain([s, 'optionalAccess', _1002 => _1002.email]))throw new Error("User is required to have an email address to update it.");a(!0);try{await c(s.email.address,r,T),d("AWAITING_PASSWORDLESS_CODE")}catch(P){u({errorModalData:{error:P,previousScreen:f||"LANDING"}})}a(!1)},A=()=>{h&&!g&&!i?(u({captchaModalData:{callback:T=>{if(!_optionalChain([s, 'optionalAccess', _1003 => _1003.email]))throw new Error("User is required to have an email address to update it.");return c(s.email.address,r,T)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),d("CAPTCHA_SCREEN")):_(g)};return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, fP,{children:_jsxruntime.jsxs.call(void 0, hP,{children:[_jsxruntime.jsx.call(void 0, _EnvelopeIcon2.default,{}),_jsxruntime.jsx.call(void 0, "input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:T=>o(T.target.value),onKeyUp:T=>{T.key==="Enter"&&A()},value:r,autoComplete:"email"}),e.stacked?null:_jsxruntime.jsx.call(void 0, ii,{isSubmitting:v,onClick:A,disabled:E,children:"Submit"})]})}),e.stacked?_jsxruntime.jsx.call(void 0, U,{loadingText:null,loading:v,disabled:E,onClick:A,children:"Submit"}):null]})}),fP=_styledcomponents2.default.div`
2781
+ width: 100%;
2782
+ `,hP=_styledcomponents2.default.label`
2783
+ display: block;
2784
+ position: relative;
2785
+ width: 100%;
2786
+ background-color: var(--privy-color-background);
2787
+ transition: background-color 200ms ease;
2788
+
2789
+ > svg {
2790
+ position: absolute;
2791
+ margin: 13px 17px;
2792
+ height: 24px;
2793
+ width: 24px;
2794
+ color: var(--privy-color-foreground-3);
2795
+ }
2796
+
2797
+ && > input {
2798
+ font-size: 16px;
2799
+ line-height: 24px;
2800
+
2801
+ padding: 12px 88px 12px 52px;
2802
+ flex-grow: 1;
2803
+ background: var(--privy-color-background);
2804
+ border: 1px solid var(--privy-color-foreground-4);
2805
+ border-radius: var(--privy-border-radius-mdlg);
2806
+ width: 100%;
2807
+
2808
+ /* Tablet and Up */
2809
+ @media (min-width: 441px) {
2810
+ font-size: 14px;
2811
+ padding-right: 78px;
2812
+ }
2813
+
2814
+ :focus {
2815
+ outline: none;
2816
+ border-color: var(--privy-color-accent);
2817
+ }
2818
+
2819
+ :autofill,
2820
+ :-webkit-autofill {
2821
+ background: var(--privy-color-background);
2822
+ }
2823
+ }
2824
+
2825
+ && > button {
2826
+ right: 0;
2827
+ line-height: 24px;
2828
+ position: absolute;
2829
+ padding: 13px 17px;
2830
+
2831
+ :focus {
2832
+ outline: none;
2833
+ border-color: var(--privy-color-accent);
2834
+ }
2835
+ }
2836
+
2837
+ && > input::placeholder {
2838
+ color: var(--privy-color-foreground-3);
2839
+ }
2840
+ `;var r0=()=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{},"header"),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsx.call(void 0, Ce,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:_jsxruntime.jsx.call(void 0, _EnvelopeIcon2.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),_jsxruntime.jsx.call(void 0, hr,{children:_jsxruntime.jsx.call(void 0, t0,{stacked:!0})}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]});var o0=()=>{let{currentScreen:e,data:t,navigate:r,setModalData:o}=_chunk3AGMJGHJjs.b.call(void 0, ),{user:n}=_chunkXKAIXCX7js.ta.call(void 0, ),{initUpdatePhone:a}=_chunkXKAIXCX7js.ra.call(void 0, );async function i({qualifiedPhoneNumber:s}){try{if(!_optionalChain([n, 'optionalAccess', _1004 => _1004.phone, 'optionalAccess', _1005 => _1005.number]))throw new Error("User is required to have an phone number to update it.");await a(_optionalChain([n, 'optionalAccess', _1006 => _1006.phone, 'optionalAccess', _1007 => _1007.number]),s),r("AWAITING_PASSWORDLESS_CODE")}catch(c){o({errorModalData:{error:c,previousScreen:_optionalChain([t, 'optionalAccess', _1008 => _1008.errorModalData, 'optionalAccess', _1009 => _1009.previousScreen])||e||"LINK_PHONE_SCREEN"}}),r("ERROR_SCREEN")}}return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{},"header"),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsx.call(void 0, Ce,{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:_jsxruntime.jsx.call(void 0, _PhoneIcon2.default,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),_jsxruntime.jsx.call(void 0, hr,{children:_jsxruntime.jsx.call(void 0, Mn,{stacked:!0,onSubmit:i,hideRecent:!0})}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})};var a0=({style:e,...t})=>_jsxruntime.jsx.call(void 0, "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:_jsxruntime.jsx.call(void 0, "path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})});var i0=()=>{let{navigate:e}=_chunk3AGMJGHJjs.b.call(void 0, );return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{}),_jsxruntime.jsxs.call(void 0, TP,{children:[_jsxruntime.jsx.call(void 0, SP,{children:_jsxruntime.jsx.call(void 0, a0,{})}),_jsxruntime.jsxs.call(void 0, PP,{children:[_jsxruntime.jsx.call(void 0, "h3",{children:"Unable to sign in"}),_jsxruntime.jsx.call(void 0, "p",{children:"This application has reached its user limit and cannot sign in new users."})]}),_jsxruntime.jsx.call(void 0, U,{onClick:()=>{e("LANDING")},children:"Go back"})]}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.K,{})]})},TP=_styledcomponents2.default.div`
2841
+ display: flex;
2842
+ flex-direction: column;
2843
+ align-items: center;
2844
+ justify-content: center;
2845
+ gap: 24px;
2846
+ width: 100%;
2847
+ padding-top: 8px;
2848
+ padding-bottom: 32px;
2849
+ `,SP=_styledcomponents2.default.div`
2850
+ display: flex;
2851
+ align-items: center;
2852
+ justify-content: center;
2853
+ height: 72px;
2854
+ aspect-ratio: 1;
2855
+ color: var(--privy-color-error);
2856
+ background-color: var(--privy-color-error-light);
2857
+ border-radius: 50%;
2858
+ `,PP=_styledcomponents2.default.div`
2859
+ display: flex;
2860
+ flex-direction: column;
2861
+ gap: 8px;
2862
+ `;var xP=`
2863
+ *,
2864
+ ::before,
2865
+ ::after {
2866
+ box-sizing: border-box;
2867
+ border-width: 0;
2868
+ border-style: solid;
2869
+ }
2870
+
2871
+ line-height: 1.15;
2872
+ -webkit-text-size-adjust: 100%;
2873
+ -moz-tab-size: 4;
2874
+ tab-size: 4;
2875
+ font-feature-settings: normal;
2876
+
2877
+ margin: 0;
2878
+ font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif,
2879
+ 'Apple Color Emoji', 'Segoe UI Emoji';
2880
+
2881
+ hr {
2882
+ height: 0;
2883
+ color: inherit;
2884
+ border-top-width: 1px;
2885
+ }
2886
+
2887
+ abbr:where([title]) {
2888
+ text-decoration: underline dotted;
2889
+ }
2890
+
2891
+ h1,
2892
+ h2,
2893
+ h3,
2894
+ h4,
2895
+ h5,
2896
+ h6 {
2897
+ font-size: inherit;
2898
+ font-weight: inherit;
2899
+ font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif,
2900
+ 'Apple Color Emoji', 'Segoe UI Emoji';
2901
+ display: inline;
2902
+ }
2903
+
2904
+ a {
2905
+ color: inherit;
2906
+ text-decoration: inherit;
2907
+ }
2908
+
2909
+ b,
2910
+ strong {
2911
+ font-weight: bolder;
2912
+ }
2913
+
2914
+ code,
2915
+ kbd,
2916
+ samp,
2917
+ pre {
2918
+ font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
2919
+ font-size: 1em;
2920
+ }
2921
+
2922
+ small {
2923
+ font-size: 80%;
2924
+ }
2925
+
2926
+ sub,
2927
+ sup {
2928
+ font-size: 75%;
2929
+ line-height: 0;
2930
+ position: relative;
2931
+ vertical-align: baseline;
2932
+ }
2933
+
2934
+ sub {
2935
+ bottom: -0.25em;
2936
+ }
2937
+
2938
+ sup {
2939
+ top: -0.5em;
2940
+ }
2941
+
2942
+ table {
2943
+ text-indent: 0;
2944
+ border-color: inherit;
2945
+ border-collapse: collapse;
2946
+ }
2947
+
2948
+ button,
2949
+ input,
2950
+ optgroup,
2951
+ select,
2952
+ textarea {
2953
+ font-family: inherit;
2954
+ font-size: 100%;
2955
+ font-weight: inherit;
2956
+ line-height: inherit;
2957
+ color: inherit;
2958
+ margin: 0;
2959
+ padding: 0;
2960
+ }
2961
+
2962
+ button,
2963
+ select {
2964
+ text-transform: none;
2965
+ }
2966
+
2967
+ button,
2968
+ [type='button'],
2969
+ [type='reset'],
2970
+ [type='submit'] {
2971
+ -webkit-appearance: button;
2972
+ background-color: transparent;
2973
+ background-image: none;
2974
+ }
2975
+
2976
+ ::-moz-focus-inner {
2977
+ border-style: none;
2978
+ padding: 0;
2979
+ }
2980
+
2981
+ :-moz-focusring {
2982
+ outline: 1px dotted ButtonText;
2983
+ }
2984
+
2985
+ :-moz-ui-invalid {
2986
+ box-shadow: none;
2987
+ }
2988
+
2989
+ legend {
2990
+ padding: 0;
2991
+ }
2992
+
2993
+ progress {
2994
+ vertical-align: baseline;
2995
+ }
2996
+
2997
+ ::-webkit-inner-spin-button,
2998
+ ::-webkit-outer-spin-button {
2999
+ height: auto;
3000
+ }
3001
+
3002
+ [type='search'] {
3003
+ -webkit-appearance: textfield;
3004
+ outline-offset: -2px;
3005
+ }
3006
+
3007
+ ::-webkit-search-decoration {
3008
+ -webkit-appearance: none;
3009
+ }
3010
+
3011
+ ::-webkit-file-upload-button {
3012
+ -webkit-appearance: button;
3013
+ font: inherit;
3014
+ }
3015
+
3016
+ summary {
3017
+ display: list-item;
3018
+ }
3019
+
3020
+ blockquote,
3021
+ dl,
3022
+ dd,
3023
+ h1,
3024
+ h2,
3025
+ h3,
3026
+ h4,
3027
+ h5,
3028
+ h6,
3029
+ hr,
3030
+ figure,
3031
+ p,
3032
+ pre {
3033
+ margin: 0;
3034
+ }
3035
+
3036
+ fieldset {
3037
+ margin: 0;
3038
+ padding: 0;
3039
+ }
3040
+
3041
+ legend {
3042
+ padding: 0;
3043
+ }
3044
+
3045
+ ol,
3046
+ ul,
3047
+ menu {
3048
+ list-style: none;
3049
+ margin: 0;
3050
+ padding: 0;
3051
+ }
3052
+
3053
+ textarea {
3054
+ resize: vertical;
3055
+ }
3056
+
3057
+ input::placeholder,
3058
+ textarea::placeholder {
3059
+ opacity: 1;
3060
+ color: #9ca3af;
3061
+ }
3062
+
3063
+ button,
3064
+ [role='button'] {
3065
+ cursor: pointer;
3066
+ }
3067
+
3068
+ :disabled {
3069
+ cursor: default;
3070
+ }
3071
+
3072
+ img,
3073
+ svg,
3074
+ video,
3075
+ canvas,
3076
+ audio,
3077
+ iframe,
3078
+ embed,
3079
+ object {
3080
+ display: block;
3081
+ }
3082
+
3083
+ img,
3084
+ video {
3085
+ max-width: 100%;
3086
+ height: auto;
3087
+ }
3088
+
3089
+ [hidden] {
3090
+ display: none;
3091
+ }
3092
+ `,s0=xP;var l0=_styledcomponents.createGlobalStyle`
3093
+ :root {
3094
+ // Borders
3095
+ --privy-border-radius-sm: 6px;
3096
+ --privy-border-radius-md: 12px;
3097
+ --privy-border-radius-mdlg: 16px;
3098
+ --privy-border-radius-lg: 24px;
3099
+ --privy-border-radius-full: 9999px;
3100
+
3101
+ // Colors
3102
+ --privy-color-background: ${e=>e.theme.background};
3103
+ --privy-color-background-2: ${e=>e.theme.background2};
3104
+
3105
+ --privy-color-foreground: ${e=>e.theme.foreground};
3106
+ --privy-color-foreground-2: ${e=>e.theme.foreground2};
3107
+ --privy-color-foreground-3: ${e=>e.theme.foreground3};
3108
+ --privy-color-foreground-4: ${e=>e.theme.foreground4};
3109
+ --privy-color-foreground-accent: ${e=>e.theme.foregroundAccent};
3110
+
3111
+ --privy-color-accent: ${e=>e.theme.accent};
3112
+ --privy-color-accent-light: ${e=>e.theme.accentLight};
3113
+ --privy-color-accent-dark: ${e=>e.theme.accentDark};
3114
+
3115
+ --privy-color-success: ${e=>e.theme.success};
3116
+ --privy-color-success-dark: ${e=>e.theme.successDark};
3117
+ --privy-color-success-light: ${e=>e.theme.successLight};
3118
+ --privy-color-error: ${e=>e.theme.error};
3119
+ --privy-color-error-light: ${e=>e.theme.errorLight};
3120
+ --privy-color-warn: ${e=>e.theme.warn};
3121
+ --privy-color-warn-light: ${e=>e.theme.warnLight};
3122
+
3123
+ // Space
3124
+ --privy-height-modal-full: 620px;
3125
+ --privy-height-modal-compact: 480px;
3126
+ };
3127
+ `,lm=_styledcomponents2.default.div`
3128
+ // css normalize only the privy application to avoid conflicts
3129
+ // with consuming application
3130
+ ${s0}
3131
+
3132
+ // Privy styles
3133
+ color: var(--privy-color-foreground-2);
3134
+
3135
+ h3 {
3136
+ font-size: 16px;
3137
+ line-height: 24px;
3138
+ font-weight: 500;
3139
+ color: var(--privy-color-foreground-2);
3140
+ }
3141
+
3142
+ h4 {
3143
+ font-size: 14px;
3144
+ line-height: 20px;
3145
+ font-weight: 500;
3146
+ color: var(--privy-color-foreground);
3147
+ }
3148
+
3149
+ p {
3150
+ font-size: 13px;
3151
+ line-height: 20px;
3152
+ color: var(--privy-color-foreground-2);
3153
+ }
3154
+
3155
+ button:focus,
3156
+ input:focus,
3157
+ optgroup:focus,
3158
+ select:focus,
3159
+ textarea:focus {
3160
+ outline: none;
3161
+ border-color: var(--privy-color-accent-light);
3162
+ box-shadow: 0 0 0 1px var(--privy-color-accent-light);
3163
+ }
3164
+
3165
+ .mobile-only {
3166
+ @media (min-width: 441px) {
3167
+ display: none;
3168
+ }
3169
+ }
3170
+
3171
+ /* Animations */
3172
+
3173
+ @keyframes fadein {
3174
+ 0% {
3175
+ opacity: 0;
3176
+ }
3177
+ 100% {
3178
+ opacity: 1;
3179
+ }
3180
+ }
3181
+ `;var d0=({children:e,open:t,onClick:r,...o})=>_jsxruntime.jsx.call(void 0, _react3.Transition,{show:t,as:_react2.default.Fragment,children:_jsxruntime.jsxs.call(void 0, _react3.Dialog,{onClose:r,...o,as:MP,children:[_jsxruntime.jsx.call(void 0, _react3.Transition.Child,{as:_react2.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:_jsxruntime.jsx.call(void 0, _P,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),_jsxruntime.jsx.call(void 0, IP,{children:_jsxruntime.jsx.call(void 0, _react3.Transition.Child,{as:_react2.default.Fragment,enterFrom:"entering",leaveTo:"leaving",children:_jsxruntime.jsx.call(void 0, _react3.Dialog.Panel,{as:WP,children:e})})})]})}),_P=_styledcomponents2.default.div`
3182
+ position: fixed;
3183
+ inset: 0;
3184
+
3185
+ transition: backdrop-filter 100ms ease;
3186
+ backdrop-filter: blur(3px);
3187
+ -webkit-backdrop-filter: blur(3px);
3188
+
3189
+ &.entering,
3190
+ &.leaving {
3191
+ backdrop-filter: unset;
3192
+ -webkit-backdrop-filter: unset;
3193
+ }
3194
+ `,MP=_styledcomponents2.default.div`
3195
+ position: relative;
3196
+ z-index: 999999;
3197
+ `,IP=_styledcomponents2.default.div`
3198
+ position: fixed;
3199
+ inset: 0;
3200
+ display: flex;
3201
+ align-items: center;
3202
+ justify-content: center;
3203
+ width: 100vw;
3204
+ min-height: 100vh;
3205
+ `,WP=_styledcomponents2.default.div`
3206
+ // reset some default dialog styles
3207
+ padding: 0;
3208
+ background: transparent;
3209
+ border: none;
3210
+ width: 100%;
3211
+ pointer-events: auto;
3212
+
3213
+ outline: none;
3214
+ display: block;
3215
+
3216
+ /*
3217
+ * Normally it is bad to mix media queries like this We are doing
3218
+ * this here specifically for animations to avoid weird jank.
3219
+ */
3220
+ /* Mobile animation is a bottom drawer */
3221
+ @media (max-width: 440px) {
3222
+ opacity: 1;
3223
+ transform: translate3d(0, 0, 0);
3224
+ transition: transform 200ms ease-in;
3225
+ position: fixed;
3226
+ bottom: 0;
3227
+
3228
+ &.entering,
3229
+ &.leaving {
3230
+ opacity: 0;
3231
+ transform: translate3d(0, 100%, 0);
3232
+ transition: transform 150ms ease-in 0ms, opacity 0ms ease 150ms;
3233
+ }
3234
+ }
3235
+
3236
+ /* Tablet/Desktop animation is a fade in */
3237
+ @media (min-width: 441px) {
3238
+ opacity: 1;
3239
+ transition: opacity 100ms ease-in;
3240
+
3241
+ &.entering,
3242
+ &.leaving {
3243
+ opacity: 0;
3244
+ transition-delay: 5ms;
3245
+ }
3246
+
3247
+ margin: auto;
3248
+ width: 360px;
3249
+ box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
3250
+ border-radius: var(--privy-border-radius-lg);
3251
+ }
3252
+ `,p0=_styledcomponents2.default.div`
3253
+ display: flex;
3254
+ flex-direction: column;
3255
+ align-items: center;
3256
+ justify-content: center;
3257
+ height: 100%;
3258
+ `;var UP={["LANDING"]:tC,["CONNECT_OR_CREATE"]:$2,["AWAITING_PASSWORDLESS_CODE"]:py,["AWAITING_CONNECTION"]:Ny,["AWAITING_CONNECT_ONLY_CONNECTION"]:Fy,["AWAITING_FARCASTER_CONNECTION"]:qg,["AWAITING_FARCASTER_SIGNER"]:Zg,["AWAITING_PASSKEY_SYSTEM_DIALOGUE"]:r3,["PHANTOM_INTERSTITIAL_SCREEN"]:i3,["LOGIN_FAILED_SCREEN"]:cC,["AWAITING_OAUTH_SCREEN"]:$C,["CROSS_APP_AUTH_SCREEN"]:Gy,["ALLOWLIST_REJECTION_SCREEN"]:ry,["ACCOUNT_NOT_FOUND_SCREEN"]:Zh,["USER_LIMIT_REACHED_SCREEN"]:i0,["INSTALL_PHANTOM_SCREEN"]:k2,["LINK_EMAIL_SCREEN"]:rC,["LINK_PHONE_SCREEN"]:oC,["LINK_WALLET_SCREEN"]:aC,["LINK_PASSKEY_SCREEN"]:_1,["UPDATE_EMAIL_SCREEN"]:r0,["UPDATE_PHONE_SCREEN"]:o0,["CONNECT_ONLY_LANDING_SCREEN"]:My,["CONNECT_ONLY_AUTHENTICATED_SCREEN"]:Ry,["EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN"]:ng,["EMBEDDED_WALLET_CREATED_SCREEN"]:Jy,["EMBEDDED_WALLET_CONNECTING_SCREEN"]:Xy,["EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN"]:s3,["EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"]:C3,["EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN"]:E3,["EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN"]:h3,["EMBEDDED_WALLET_KEY_EXPORT_SCREEN"]:tg,["EMBEDDED_WALLET_SIGN_REQUEST_SCREEN"]:Y3,["EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"]:q3,["EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN"]:W3,["FUNDING_METHOD_SELECTION_SCREEN"]:p2,["MOONPAY_PROMPT_SCREEN"]:g2,["MOONPAY_STATUS_SCREEN"]:v2,["COINBASE_ONRAMP_STATUS_SCREEN"]:j1,["FUNDING_TRANSFER_FROM_WALLET_SCREEN"]:E2,["FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"]:G1,["FUNDING_MANUAL_TRANSFER_SCREEN"]:u2,["EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"]:_g,["EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN"]:Rg,["EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN"]:g3,["MFA_ENROLLMENT_FLOW_SCREEN"]:TC,["CAPTCHA_SCREEN"]:hy,["ERROR_SCREEN"]:Ig,["IN_APP_BROWSER_LOGIN_NOT_POSSIBLE"]:T2,["AFFIRMATIVE_CONSENT_SCREEN"]:$h,["TELEGRAM_AUTH_SCREEN"]:J3},FP=["LANDING","AWAITING_CONNECTION"],y0=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:o}=_chunkXKAIXCX7js.ta.call(void 0, ),{headless:n}=_chunkXKAIXCX7js.oa.call(void 0, ),{ready:a,currentScreen:i}=_chunk3AGMJGHJjs.b.call(void 0, ),{status:s,execute:c,reset:d,enabled:u}=Pe(),f=o&&i&&FP.includes(i)&&!n&&s==="ready";if(_react.useEffect.call(void 0, ()=>{f&&c()},[f]),_react.useEffect.call(void 0, ()=>{!o&&u&&d()},[o,u]),(!r||!a)&&i!=="AWAITING_OAUTH_SCREEN"&&i!=="CROSS_APP_AUTH_SCREEN"&&i!=="TELEGRAM_AUTH_SCREEN")return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, k,{}),_jsxruntime.jsx.call(void 0, ne,{}),_jsxruntime.jsx.call(void 0, p0,{children:_jsxruntime.jsx.call(void 0, mt,{})}),_jsxruntime.jsx.call(void 0, ae,{}),_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.L,{})]});if(!i&&e)return _jsxruntime.jsx.call(void 0, zu,{open:e,onClose:t});if(!i)return null;let h=UP[i];return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, so,{if:!!e,children:_jsxruntime.jsx.call(void 0, h,{})}),_jsxruntime.jsx.call(void 0, so,{if:!e,children:_jsxruntime.jsx.call(void 0, zu,{open:e,onClose:t})})]})},BP=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let r=_react.useRef.call(void 0, null),o=_chunkLEABMTNMjs.D.call(void 0, r);return _jsxruntime.jsx.call(void 0, VP,{style:{height:o},id:"privy-modal-content",children:_jsxruntime.jsx.call(void 0, "div",{ref:r,children:_jsxruntime.jsx.call(void 0, y0,{isMfaVerifying:e,onMfaVerificationComplete:t})})})},HP=()=>{let{closePrivyModal:e}=_chunkXKAIXCX7js.ra.call(void 0, ),{onUserCloseViaDialogOrKeybindRef:t}=_chunk3AGMJGHJjs.b.call(void 0, );return{gracefulClosePrivyModal:_react.useCallback.call(void 0, ()=>{if(_optionalChain([t, 'optionalAccess', _1010 => _1010.current]))t.current();else return e({shouldCallAuthOnSuccess:!1})},[e])}},pm= exports.o =({open:e})=>{let{app:t}=_chunk3AGMJGHJjs.b.call(void 0, ),{gracefulClosePrivyModal:r}=HP(),[o,n]=_react.useState.call(void 0, !1);Mp({onMfaRequired:()=>{_optionalChain([t, 'optionalAccess', _1011 => _1011.mfa, 'access', _1012 => _1012.noPromptOnMfaRequired])||n(!0)}});let a=e||o;return t.render.standalone?_jsxruntime.jsx.call(void 0, lm,{children:_jsxruntime.jsx.call(void 0, g0,{id:"privy-modal-content",children:_jsxruntime.jsx.call(void 0, y0,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})}):_jsxruntime.jsx.call(void 0, d0,{open:a,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:_jsxruntime.jsx.call(void 0, lm,{children:_jsxruntime.jsx.call(void 0, BP,{isMfaVerifying:o,onMfaVerificationComplete:()=>n(!1)})})})},g0=_styledcomponents2.default.div`
3259
+ display: flex;
3260
+ flex-direction: column;
3261
+ text-align: center;
3262
+ font-size: 14px;
3263
+ line-height: 20px;
3264
+ width: 100%;
3265
+ background: var(--privy-color-background);
3266
+ padding: 0 16px;
3267
+ `,VP=_styledcomponents2.default.call(void 0, g0)`
3268
+ transition: height 150ms ease-out;
3269
+ overflow: hidden;
3270
+
3271
+ // Ensure the modal gets pinned to the top if it ever gets too tall
3272
+ max-height: calc(100svh - 48px);
3273
+
3274
+ border-radius: var(--privy-border-radius-lg) var(--privy-border-radius-lg) 0 0;
3275
+ box-shadow: 0px 0px 36px rgba(55, 65, 81, 0.15);
3276
+
3277
+ @media (min-width: 441px) {
3278
+ box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
3279
+ border-radius: var(--privy-border-radius-lg);
3280
+ }
3281
+ `;function qP({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 v0(e){let t=_react.useRef.call(void 0, null),r=_react.useRef.call(void 0, );return _react.useEffect.call(void 0, ()=>{_optionalChain([r, 'access', _1013 => _1013.current, 'optionalAccess', _1014 => _1014.remove, 'call', _1015 => _1015()]),r.current=qP(e),_optionalChain([t, 'access', _1016 => _1016.current, 'optionalAccess', _1017 => _1017.after, 'call', _1018 => _1018(r.current)])},[e]),_jsxruntime.jsx.call(void 0, "div",{ref:t,hidden:!0})}var ap=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 Vn(e,t,r,o,n,a=!1){let i=a,s=async u=>{if(i&&t&&t.length>0){u===(a?0:1)?n("configureMfa","onMfaRequired",t):_optionalChain([o, 'access', _1019 => _1019.current, 'optionalAccess', _1020 => _1020.reject, 'call', _1021 => _1021(new Ue("missing_or_invalid_mfa","MFA verification failed, retry."))]);let f=await new Promise((h,g)=>{r.current={resolve:h,reject:g};let w=1e3*60*5;setTimeout(()=>{let v=new Ue("mfa_timeout","Timed out waiting for MFA code");_optionalChain([o, 'access', _1022 => _1022.current, 'optionalAccess', _1023 => _1023.reject, 'call', _1024 => _1024(v)]),g(v)},w)});return await e(f)}return await e()},c=4,d=null;for(let u=0;u<c;u++)try{d=await s(u),_optionalChain([o, 'access', _1025 => _1025.current, 'optionalAccess', _1026 => _1026.resolve, 'call', _1027 => _1027(void 0)]);break}catch(f){if(f.type==="missing_or_invalid_mfa")i=!0;else throw _optionalChain([o, 'access', _1028 => _1028.current, 'optionalAccess', _1029 => _1029.resolve, 'call', _1030 => _1030(void 0)]),f}if(d===null){let u=new Ue("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw _optionalChain([o, 'access', _1031 => _1031.current, 'optionalAccess', _1032 => _1032.reject, 'call', _1033 => _1033(u)]),u}return d}var YP=function(e){return()=>`id-${e++}`}(0);function QP(e){return typeof e.event=="string"&&/^privy:.+/.test(e.event)}function Ct(e){return e.error!==void 0}var yt=new ap,um=new Map,XP=(e,t)=>typeof t=="bigint"?t.toString():t,ZP=(e,t)=>`${e}${JSON.stringify(t,XP)}`;function vt(e,t,r,o){let n=r.contentWindow;if(!n)throw new Error("iframe not initialized");let a=ZP(e,t);if(e==="privy:wallet:create"){let s=um.get(a);if(s)return s}let i=new Promise((s,c)=>{let d=YP();yt.enqueue(d,{resolve:s,reject:c}),n.postMessage({id:d,event:e,data:t},o)}).finally(()=>{um.delete(a)});return um.set(a,i),i}function JP(e){switch(e.event){case"privy:iframe:ready":let t=yt.dequeue(e.event,e.id);return Ct(e)?t.reject(new Ue(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=yt.dequeue(e.event,e.id);return Ct(e)?r.reject(new Ue(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:create-additional":let o=yt.dequeue(e.event,e.id);return Ct(e)?o.reject(new Ue(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:import":let n=yt.dequeue(e.event,e.id);return Ct(e)?n.reject(new Ue(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:connect":let a=yt.dequeue(e.event,e.id);return Ct(e)?a.reject(new Ue(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:recover":let i=yt.dequeue(e.event,e.id);return Ct(e)?i.reject(new Ue(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:rpc":let s=yt.dequeue(e.event,e.id);return Ct(e)?s.reject(new Ue(e.error.type,e.error.message)):s.resolve(e.data);case"privy:wallet:set-recovery":let c=yt.dequeue(e.event,e.id);return Ct(e)?c.reject(new Ue(e.error.type,e.error.message)):c.resolve(e.data);case"privy:mfa:verify":let d=yt.dequeue(e.event,e.id);return Ct(e)?d.reject(new Ue(e.error.type,e.error.message)):d.resolve(e.data);case"privy:mfa:init-enrollment":{let g=yt.dequeue(e.event,e.id);return Ct(e)?g.reject(new Ue(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:mfa:submit-enrollment":{let g=yt.dequeue(e.event,e.id);return Ct(e)?g.reject(new Ue(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:mfa:unenroll":{let g=yt.dequeue(e.event,e.id);return Ct(e)?g.reject(new Ue(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:mfa:clear":{let g=yt.dequeue(e.event,e.id);return Ct(e)?g.reject(new Ue(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:farcaster:init-signer":{let g=yt.dequeue(e.event,e.id);return Ct(e)?g.reject(new Ue(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:farcaster:sign":{let g=yt.dequeue(e.event,e.id);return Ct(e)?g.reject(new Ue(e.error.type,e.error.message)):g.resolve(e.data)}case"privy:solana-wallet:create":let u=yt.dequeue(e.event,e.id);return Ct(e)?u.reject(new Ue(e.error.type,e.error.message)):u.resolve(e.data);case"privy:solana-wallet:connect":let f=yt.dequeue(e.event,e.id);return Ct(e)?f.reject(new Ue(e.error.type,e.error.message)):f.resolve(e.data);case"privy:solana-wallet:recover":let h=yt.dequeue(e.event,e.id);return Ct(e)?h.reject(new Ue(e.error.type,e.error.message)):h.resolve(e.data);case"privy:solana-wallet:rpc":{let g=yt.dequeue(e.event,e.id);return Ct(e)?g.reject(new Ue(e.error.type,e.error.message)):g.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}function E0(e){let t=_react.useRef.call(void 0, null),r=_react.useRef.call(void 0, e.mfaMethods),o=_chunkLEABMTNMjs.I.call(void 0, ),[n,a]=_react.useState.call(void 0, !1);return _react.useEffect.call(void 0, ()=>{r.current=e.mfaMethods},[e.mfaMethods]),_react.useEffect.call(void 0, ()=>{if(!n)return;let i=t.current;if(!i)return;function s(h){h&&h.origin===e.origin&&QP(h.data)&&JP(h.data)}let c={create(h){return vt("privy:wallet:create",h,i,e.origin)},createAdditional(h){return vt("privy:wallet:create-additional",h,i,e.origin)},import(h){return vt("privy:wallet:import",h,i,e.origin)},connect(h){return vt("privy:wallet:connect",h,i,e.origin)},recover(h){return Vn(g=>vt("privy:wallet:recover",{...h,...g},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!h.recoveryMethod||h.recoveryMethod==="privy")},rpc(h){return Vn(g=>vt("privy:wallet:rpc",{...h,...g},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},createSolana(h){return vt("privy:solana-wallet:create",h,i,e.origin)},connectSolana(h){return vt("privy:solana-wallet:connect",h,i,e.origin)},recoverSolana(h){return vt("privy:solana-wallet:recover",h,i,e.origin)},rpcSolana(h){return vt("privy:solana-wallet:rpc",h,i,e.origin)},setRecovery(h){return Vn(g=>vt("privy:wallet:set-recovery",{...h,...g},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},verifyMfa(h){return Vn(g=>vt("privy:mfa:verify",{...h,...g},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},initEnrollMfa(h){return Vn(g=>vt("privy:mfa:init-enrollment",{...h,...g},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},submitEnrollMfa(h){return Vn(g=>vt("privy:mfa:submit-enrollment",{...h,...g},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o)},unenrollMfa(h){return Vn(g=>vt("privy:mfa:unenroll",{...h,...g},i,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,o,!0)},clearMfa(h){return vt("privy:mfa:clear",h,i,e.origin)},initFarcasterSigner(h){return vt("privy:farcaster:init-signer",h,i,e.origin)},signFarcasterMessage(h){return vt("privy:farcaster:sign",h,i,e.origin)}};window.addEventListener("message",s);let d=()=>e.onLoad(c),u=(...h)=>{console.warn("Privy iframe failed to load: ",...h),e.onLoadFailed()},f=new AbortController;return _chunkLEABMTNMjs.k.call(void 0, ()=>vt("privy:iframe:ready",{},i,e.origin),{abortSignal:f.signal}).then(d,u),()=>{window.removeEventListener("message",s),f.abort()}},[n]),_jsxruntime.jsx.call(void 0, "iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>a(!0),src:_chunkLEABMTNMjs.l.call(void 0, e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}var ip=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 S0({message:t.params.message})}async request(t){if(console.debug("EmbeddedSolanaProvider.request() called with args",t),!await pe())throw new Error("User must be authenticated to use embedded Solana wallet");if(!await T0())throw new (0, _chunkXKAIXCX7js.g)("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 sp="popup-privy-oauth",lp="PRIVY_OAUTH_USE_BROADCAST_CHANNEL",$P="privy:";function P0(e){return e.startsWith($P)}async function A0({url:e,popup:t}){return t.location=e,new Promise((o,n)=>{let i=setTimeout(()=>{n(new (0, _chunkXKAIXCX7js.g)("Authorization request timed out after 2 minutes.")),s()},12e4);function s(){_optionalChain([t, 'optionalAccess', _1034 => _1034.close, 'call', _1035 => _1035()]),window.removeEventListener("message",u)}let c,d=setInterval(()=>{_optionalChain([t, 'optionalAccess', _1036 => _1036.closed])&&!c&&(s(),clearInterval(d),clearTimeout(i),n(new (0, _chunkXKAIXCX7js.g)("User rejected request")))},300);function u(f){f.data&&(f.data.type==="PRIVY_OAUTH_RESPONSE"&&f.data.stateCode&&f.data.authorizationCode&&(clearTimeout(i),o(f.data),s()),f.data.type==="PRIVY_OAUTH_ERROR"&&(clearTimeout(i),n(new (0, _chunkXKAIXCX7js.g)(f.data.error)),s()),f.data.type===lp&&(c=new BroadcastChannel(sp),c.onmessage=u))}window.addEventListener("message",u)})}var eA="https://cdn.apple-cloudkit.com";async function mm({url:e,popup:t,provider:r}){return t.location=e,new Promise((n,a)=>{function i(){_optionalChain([t, 'optionalAccess', _1037 => _1037.close, 'call', _1038 => _1038()]),window.removeEventListener("message",s)}function s(c){c.data&&(c.data.type==="PRIVY_OAUTH_RESPONSE"&&c.data.stateCode&&c.data.authorizationCode&&(n(c.data),i()),c.origin===eA&&c.data.ckSession&&(n({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:c.data.ckSession}),i()),c.data.type==="PRIVY_OAUTH_ERROR"&&(a(c.data.error),i()))}window.addEventListener("message",s)})}var x0=e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type});var on;function sA(e){return typeof e=="string"&&e.length===25}function pe(){if(!on){let e=_chunkLEABMTNMjs.b.get(_chunkXKAIXCX7js.v);return Promise.resolve(e||null)}return on.getAccessToken()}var R0,Ph=(e,t,r)=>R0(e,t,r),_0,Ah=(e,t,r)=>_0(e,t,r),M0,xh=(e,t,r,o)=>M0(e,t,r,o),I0,kh=()=>I0(),W0,T0=()=>W0(),L0,S0=({message:e})=>L0({message:e}),lA=()=>{let t=new URLSearchParams(window.location.search).get("privy_token");if(!t)return;_chunkLEABMTNMjs.b.put(_chunkXKAIXCX7js.C,t);let r=new URL(window.location.href);r.searchParams.delete("privy_token"),window.history.pushState({},"",r)},cA= exports.q =({config:e,...t})=>{if(typeof window<"u"&&["localhost","127.0.0.1"].indexOf(window.location.hostname)<0&&window.location.protocol!=="https:")throw new (0, _chunkXKAIXCX7js.g)("Embedded wallet is only available over HTTPS");if(!sA(t.appId))throw new (0, _chunkXKAIXCX7js.g)("Cannot initialize the Privy provider with an invalid Privy app ID");on||(on=new ms({appId:t.appId,appClientId:t.clientId,apiUrl:t.apiUrl}));let r=Object.assign({},e);return t.createPrivyWalletOnLogin!==void 0&&_optionalChain([r, 'access', _1039 => _1039.embeddedWallets, 'optionalAccess', _1040 => _1040.createOnLogin])===void 0&&(r.embeddedWallets||(r.embeddedWallets={}),r.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),t.createPrivyWalletOnLogin!==void 0&&_optionalChain([e, 'optionalAccess', _1041 => _1041.embeddedWallets, 'optionalAccess', _1042 => _1042.createOnLogin])&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),_jsxruntime.jsx.call(void 0, _chunkXKAIXCX7js.na,{client:on,clientConfig:r,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:_jsxruntime.jsx.call(void 0, dA,{...t,client:on})})},dA=e=>{let t=e.client,[r,o]=_react.useState.call(void 0, !1),[n,a]=_react.useState.call(void 0, !1),[i,s]=_react.useState.call(void 0, !1),[c,d]=_react.useState.call(void 0, null),[u,f]=_react.useState.call(void 0, []),[h,g]=_react.useState.call(void 0, []),[w,v]=_react.useState.call(void 0, null),E=_react.useRef.call(void 0, u),[_,A]=_react.useState.call(void 0, !1),[T,P]=_react.useState.call(void 0, null),[S,R]=_react.useState.call(void 0, !1),[D,F]=_react.useState.call(void 0, {status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:_chunkXKAIXCX7js.W}),[B,K]=_react.useState.call(void 0, {status:"initial"}),[W,X]=_react.useState.call(void 0, null),L=_chunkXKAIXCX7js.oa.call(void 0, ),Q=_chunkXKAIXCX7js.pa.call(void 0, ),[xe,he]=_react.useState.call(void 0, !0),[$,Y]=_react.useState.call(void 0, {}),[ke,ye]=_react.useState.call(void 0, null),[te,se]=_react.useState.call(void 0, null),[Ge,Qe]=_react.useState.call(void 0, !1),[ce,pt]=_react.useState.call(void 0, !1),[or,wt]=_react.useState.call(void 0, _optionalChain([L, 'access', _1043 => _1043.customAuth, 'optionalAccess', _1044 => _1044.enabled])?{status:"initial"}:{status:"not-enabled"}),Ee=_react.useRef.call(void 0, null),ue=_react.useRef.call(void 0, null),M=_react.useRef.call(void 0, _chunkLEABMTNMjs.E),[le,nn]=_react.useState.call(void 0, !1);t.onStoreToken=l=>{l&&_chunkLEABMTNMjs.H.call(void 0, M,"accessToken","onAccessTokenGranted",l)},t.onDeleteToken=()=>{d(null),s(!1),_chunkLEABMTNMjs.H.call(void 0, M,"accessToken","onAccessTokenRemoved")};let G=_react.useRef.call(void 0, null),J=_react.useRef.call(void 0, null),Lt=_react.useRef.call(void 0, !1),we=l=>{P(l),setTimeout(()=>{o(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:l}})},gt=l=>{L.embeddedWallets.createOnLogin!=="off"&&he(!0),we(l)};_react.useEffect.call(void 0, ()=>{let l=_chunkLEABMTNMjs.x.call(void 0, c);if(!l||!W){v(null);return}let p={type:"solana",imported:!1,address:l.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:void 0,id:"io.privy.solana.wallet"},linked:!0,fund:()=>{throw new (0, _chunkXKAIXCX7js.g)("Funding is not supported for Solana embedded wallets.")},unlink:()=>{throw new (0, _chunkXKAIXCX7js.g)("Cannot unlink an embedded Solana wallet")},getProvider:async()=>new ip(W,l.address),signMessage:async m=>{let y=await pe();if(!y||!W)throw new (0, _chunkXKAIXCX7js.g)("Must have valid access token and Privy wallet to send transaction","must_be_authenticated");let{response:b}=await W.rpcSolana({accessToken:y,publicKey:p.address,request:{method:"signMessage",params:{message:Buffer.from(m).toString("base64")}}});return Buffer.from(b.data.signature,"base64")},async sendTransaction(m,y,b){let{signature:N}=await ym({transaction:m,connection:y,transactionOptions:b,wallet:this});return N},signTransaction:async m=>{let y=await pe();if(!y||!W)throw new (0, _chunkXKAIXCX7js.g)("Must have valid access token and Privy wallet to send transaction","must_be_authenticated");return await Ju({tx:m,accessToken:y,walletProxy:W}),m},loginOrLink:async()=>{throw new (0, _chunkXKAIXCX7js.g)("Cannot login or link with an embedded Solana wallet")},disconnect:()=>{v(null)},isConnected:async()=>!0};v(p)},[W,c]),_react.useEffect.call(void 0, ()=>{if(!c){_optionalChain([t, 'access', _1045 => _1045.connectors, 'optionalAccess', _1046 => _1046.removeEmbeddedWalletConnectors, 'call', _1047 => _1047()]);return}let l=_chunkLEABMTNMjs.v.call(void 0, c),p=_chunkLEABMTNMjs.w.call(void 0, c),m=_chunkLEABMTNMjs.y.call(void 0, c);if((!l||!p.length)&&_optionalChain([t, 'access', _1048 => _1048.connectors, 'optionalAccess', _1049 => _1049.removeEmbeddedWalletConnectors, 'call', _1050 => _1050()]),m||_optionalChain([t, 'access', _1051 => _1051.connectors, 'optionalAccess', _1052 => _1052.removeImportedWalletConnector, 'call', _1053 => _1053()]),!t.connectors){console.debug("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!W){console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized");return}l&&t.connectors.addEmbeddedWalletConnectors({walletProxy:W,rootWallet:l,embeddedWallets:p,defaultChain:L.defaultChain,appId:e.appId}),m&&t.connectors.addImportedWalletConnector(W,m.address,L.defaultChain,e.appId)},[W,c]),_react.useEffect.call(void 0, ()=>{W&&_optionalChain([te, 'optionalCall', _1054 => _1054(W)])},[W]),_react.useEffect.call(void 0, ()=>{(async()=>{if(!_optionalChain([L, 'access', _1055 => _1055.customAuth, 'optionalAccess', _1056 => _1056.enabled])){wt({status:"not-enabled"});return}he(!0),wt({status:"loading"});let{getCustomAccessToken:p,isLoading:m}=L.customAuth;if(!(!n||m))try{let y=await p();if(!y&&i){await Ua.logout(),wt({status:"done"}),_chunkLEABMTNMjs.H.call(void 0, M,"customAuth","onUnauthenticated");return}if(!y){wt({status:"done"});return}if(i){wt({status:"done"});return}t.startAuthFlow(new za(y));let{user:b,isNewUser:N}=await t.authenticate();if(!b){await Ua.logout(),wt({status:"error",error:new (0, _chunkXKAIXCX7js.g)("Failed to sync with custom auth provider")}),_chunkLEABMTNMjs.H.call(void 0, M,"customAuth","onUnauthenticated");return}N!==void 0&&_chunkLEABMTNMjs.H.call(void 0, M,"login","onComplete",b,N,!1,"custom",null),_chunkLEABMTNMjs.H.call(void 0, M,"customAuth","onAuthenticated",{user:b}),wt({status:"done"}),d(b||null),A(N||!1),s(!0),pt(!0)}catch(y){throw console.warn(y),i&&(await Ua.logout(),_chunkLEABMTNMjs.H.call(void 0, M,"customAuth","onUnauthenticated")),_chunkLEABMTNMjs.H.call(void 0, M,"login","onError",y.privyErrorCode||"unknown_auth_error"),wt({status:"error",error:y}),y}})()},[_optionalChain([L, 'access', _1057 => _1057.customAuth, 'optionalAccess', _1058 => _1058.enabled]),_optionalChain([L, 'access', _1059 => _1059.customAuth, 'optionalAccess', _1060 => _1060.getCustomAccessToken]),_optionalChain([L, 'access', _1061 => _1061.customAuth, 'optionalAccess', _1062 => _1062.isLoading]),n,i]),_react.useEffect.call(void 0, ()=>{ce&&W&&c&&_chunkLEABMTNMjs.A.call(void 0, c,L.embeddedWallets.createOnLogin)&&(pt(!1),dp(c,_chunkXKAIXCX7js.Q).catch(console.error))},[ce&&W&&c]),_react.useEffect.call(void 0, ()=>{if(L.externalWallets.solana.connectors)return L.externalWallets.solana.connectors.onMount(),()=>_optionalChain([L, 'access', _1063 => _1063.externalWallets, 'access', _1064 => _1064.solana, 'access', _1065 => _1065.connectors, 'optionalAccess', _1066 => _1066.onUnmount, 'call', _1067 => _1067()])},[L.externalWallets.solana.connectors]),_react.useEffect.call(void 0, ()=>{async function l(){let p=Qi(),m=Bo();lA();let y=_mipd.createStore.call(void 0, );t.initializeConnectorManager({walletConnectCloudProjectId:L.walletConnectCloudProjectId,rpcConfig:L.rpcConfig,chains:L.chains,defaultChain:L.defaultChain,store:y,walletList:L.appearance.walletList,shouldEnforceDefaultChainOnConnect:L.shouldEnforceDefaultChainOnConnect,externalWalletConfig:L.externalWallets,appName:_nullishCoalesce(L.name, () => ("Privy"))});let b;_optionalChain([t, 'access', _1068 => _1068.connectors, 'optionalAccess', _1069 => _1069.on, 'call', _1070 => _1070("connectorInitialized",()=>{b&&clearTimeout(b);let q=t.connectors.walletConnectors.length,oe=t.connectors.walletConnectors.reduce((de,Se)=>de+(Se.initialized?1:0),0);oe===q?nn(!0):b=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:oe,expected:q}),nn(!0)},1500)})]),_optionalChain([t, 'access', _1071 => _1071.connectors, 'optionalAccess', _1072 => _1072.initialize, 'call', _1073 => _1073(), 'access', _1074 => _1074.then, 'call', _1075 => _1075(()=>{nr()})]);let N=await t.getAuthenticatedUser(),V=!!N;if(_optionalChain([L, 'access', _1076 => _1076.customAuth, 'optionalAccess', _1077 => _1077.enabled])||(s(!!N),N&&_chunkLEABMTNMjs.H.call(void 0, M,"login","onComplete",N,!1,!0,null,null),d(N)),p){J.current=V?"link":"login";return}if(m&&!V){J.current="login",gt("TELEGRAM_AUTH_SCREEN");return}re.setReadyToTrue(!!N)}!n&&Q&&l()},[t,ke,n,Q]),_react.useEffect.call(void 0, ()=>{if(!n)return;if(!c){Qe(!0);return}if(!!!c.linkedAccounts.find(m=>m.type==="wallet"&&m.walletClientType==="privy")){Qe(!0);return}let p=!!u.find(m=>m.walletClientType==="privy");Qe(p)},[n,c,u]);let Qi=()=>{let l=ss();if(l.inProgress&&l.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(l.authorizationCode==="error"){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."});return}window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:l.stateCode,authorizationCode:l.authorizationCode});return}return l.inProgress&&P0(l.provider)&&!l.popupFlow&&(new BroadcastChannel(sp).postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:l.stateCode,authorizationCode:l.authorizationCode}),window.close()),!l.inProgress||l.headless?!1:(t.startAuthFlow(new bo(l)),gt("AWAITING_OAUTH_SCREEN"),!0)},Bo=()=>{let l=Eh();if(!l||!L.loginMethods.telegram||!_optionalChain([L, 'access', _1078 => _1078.loginConfig, 'access', _1079 => _1079.telegramAuthConfiguration, 'optionalAccess', _1080 => _1080.seamlessAuthEnabled]))return;let p=new Xa;return t.startAuthFlow(p),l.flowType==="login-url"&&(p.meta.telegramWebAppData=void 0,p.meta.telegramAuthResult={id:l.id,first_name:l.first_name,last_name:l.last_name,auth_date:l.auth_date,username:l.username,photo_url:l.photo_url,hash:l.hash}),l.flowType==="web-app"&&(p.meta.telegramAuthResult=void 0,p.meta.telegramWebAppData={query_id:l.query_id,user:l.user,auth_date:l.auth_date,hash:l.hash,chat_instance:l.chat_instance,chat_type:l.chat_type,start_param:l.start_param}),!0},_e=async(l,p,m,y)=>{let b=await _optionalChain([t, 'access', _1081 => _1081.connectors, 'optionalAccess', _1082 => _1082.createEthereumWalletConnector, 'call', _1083 => _1083(l,p)])||null;Pt(b,p,m,y)};async function Pt(l,p,m,y){if(l)F({status:"disconnected",connectedWallet:null,connectError:null,connector:l,connectRetry:_chunkXKAIXCX7js.W});else return F({status:"disconnected",connectedWallet:null,connectError:new (0, _chunkXKAIXCX7js.i)("Unable to connect to wallet."),connector:null,connectRetry:_chunkXKAIXCX7js.W}),_optionalChain([y, 'optionalCall', _1084 => _1084(null,m)]);l instanceof ao&&p&&await l.resetConnection(p),F({connector:l,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>Pt(l,p,m,y)});try{let b=await l.connect({showPrompt:!0});if((!b||no(b))&&L.shouldEnforceDefaultChainOnConnect&&!L.chains.find(N=>N.id===Number(_optionalChain([b, 'optionalAccess', _1085 => _1085.chainId, 'access', _1086 => _1086.replace, 'call', _1087 => _1087("eip155:","")])))&&!(_optionalChain([b, 'optionalAccess', _1088 => _1088.connectorType])==="wallet_connect_v2"&&_optionalChain([b, 'optionalAccess', _1089 => _1089.walletClientType])==="metamask")){F(N=>({...N,connector:l,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:_chunkXKAIXCX7js.W}));try{await _optionalChain([b, 'optionalAccess', _1090 => _1090.switchChain, 'call', _1091 => _1091(L.defaultChain.id)]),b&&(b.chainId=_chunkLEABMTNMjs.p.call(void 0, _chunkLEABMTNMjs.n.call(void 0, L.defaultChain.id)))}catch (e36){console.warn(`Unable to switch to default chain: ${L.defaultChain.id}`)}}return F(N=>({...N,status:"connected",connectedWallet:b,connectError:null,connectRetry:_chunkXKAIXCX7js.W})),b&&_chunkLEABMTNMjs.H.call(void 0, M,"connectWallet","onSuccess",b),_optionalChain([y, 'optionalCall', _1092 => _1092(b,m)])}catch(b){return b instanceof _chunkXKAIXCX7js.e?(console.warn(b.cause?b.cause:b.message),_chunkLEABMTNMjs.H.call(void 0, M,"connectWallet","onError",b.privyErrorCode||"generic_connect_wallet_error")):(console.warn(b),_chunkLEABMTNMjs.H.call(void 0, M,"connectWallet","onError","unknown_connect_wallet_error")),F(N=>({...N,status:"disconnected",connectedWallet:null,connectError:b})),_optionalChain([y, 'optionalCall', _1093 => _1093(null,m)])}}let Yt=async(l,p,m)=>{if(l===null||!no(l))return;let y=new zo(l,t,p,m);t.startAuthFlow(y)},br=async(l,p)=>{if(l===null||!Pp(l))return;let m=new oa(l,t,p);t.startAuthFlow(m)},nr=()=>{let l=new URLSearchParams(window.location.search),p=l.get("privy_connector"),m=l.get("privy_wallet_client");if(!p||!m)return;if(m==="phantom"&&!_chunkLEABMTNMjs.c.call(void 0, )&&gt("LOGIN_FAILED_SCREEN"),!t.connectors)throw new (0, _chunkXKAIXCX7js.g)("Connector not initialized");we("AWAITING_CONNECTION");let y=new URL(window.location.href);y.searchParams.delete("privy_connector"),y.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",y),_e(p,m,void 0,Yt)};_react.useEffect.call(void 0, ()=>{n&&i&&c===null&&t.getAuthenticatedUser().then(d)},[n,i,c,t]);let Le=l=>{if(!i)throw _chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onError","must_be_authenticated",{linkMethod:l}),new (0, _chunkXKAIXCX7js.g)("User must be authenticated before linking an account.")},Gn=()=>{Le("siwe"),G.current="siwe",J.current="link",we("LINK_WALLET_SCREEN")},an=l=>{if(!i||!c)return!1;if(l.walletClientType==="privy")return!0;for(let p of c.linkedAccounts)if(p.type==="wallet"&&p.address===l.address&&p.walletClientType!=="privy")return!0;return!1},$e=async l=>{if(!t.connectors)throw new (0, _chunkXKAIXCX7js.g)("Connector not initialized");let p;if(l.type==="ethereum"?p=t.connectors.findWalletConnector(l.connectorType,l.walletClientType)||null:p=t.connectors.findSolanaWalletConnector(l.connectorType,l.walletClientType)||null,F(m=>({...m,connector:p,status:"connected",connectedWallet:l,connectError:null,connectRetry:_chunkXKAIXCX7js.W})),L.captchaEnabled&&!i){let m={callback:y=>no(l)?Yt(l,y):br(l,y),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"};Y({captchaModalData:m}),gt("CAPTCHA_SCREEN")}else no(l)?await Yt(l):await br(l),gt("AWAITING_CONNECTION")},cp=async(l,p)=>{let{signedUrl:m,externalTransactionId:y}=await a2(t,l,_nullishCoalesce(p, () => ({})),L.appearance.palette,_nullishCoalesce(_optionalChain([L, 'access', _1094 => _1094.fundingMethodConfig, 'optionalAccess', _1095 => _1095.moonpay, 'access', _1096 => _1096.useSandbox]), () => (!1)));return{signedUrl:m,externalTransactionId:y}},cl=()=>{f(l=>{let p=_optionalChain([t, 'access', _1097 => _1097.connectors, 'optionalAccess', _1098 => _1098.wallets, 'access', _1099 => _1099.filter, 'call', _1100 => _1100(no), 'access', _1101 => _1101.map, 'call', _1102 => _1102(m=>({...m,linked:an(m),loginOrLink:async()=>{if(!await m.isConnected())throw new (0, _chunkXKAIXCX7js.g)("Wallet is not connected");if(m.connectorType==="embedded"&&m.walletClientType==="privy")throw new (0, _chunkXKAIXCX7js.g)("Cannot link or login with embedded wallet");$e(m)},fund:async y=>{await re.fundWallet(m.address,y)},unlink:async()=>{if(!i)throw new (0, _chunkXKAIXCX7js.g)("User is not authenticated.");if(m.connectorType==="embedded"&&m.walletClientType==="privy")throw new (0, _chunkXKAIXCX7js.g)("Cannot unlink an embedded wallet");let y=await t.unlinkEthereumWallet(m.address);d(y)}}))])||[];return cs(l,p)?l:p}),g(l=>{let p=_optionalChain([t, 'access', _1103 => _1103.connectors, 'optionalAccess', _1104 => _1104.wallets, 'access', _1105 => _1105.filter, 'call', _1106 => _1106(Pp), 'access', _1107 => _1107.map, 'call', _1108 => _1108(m=>({...m,linked:an(m),loginOrLink:async()=>{if(!await m.isConnected())throw new (0, _chunkXKAIXCX7js.g)("Wallet is not connected");if(m.connectorType==="embedded"&&m.walletClientType==="privy")throw new (0, _chunkXKAIXCX7js.g)("Cannot link or login with embedded wallet");$e(m)},fund:async y=>{throw new (0, _chunkXKAIXCX7js.g)("Funding not supported for Solana wallets")},unlink:async()=>{if(!i)throw new (0, _chunkXKAIXCX7js.g)("User is not authenticated.");if(m.connectorType==="embedded"&&m.walletClientType==="privy")throw new (0, _chunkXKAIXCX7js.g)("Cannot unlink an embedded wallet");let y=await t.unlinkSolanaWallet(m.address);d(y)}}))])||[];return cs(l,p)?l:p})};_react.useEffect.call(void 0, ()=>{cl()},[_optionalChain([c, 'optionalAccess', _1109 => _1109.linkedAccounts]),i,n]),_react.useEffect.call(void 0, ()=>{if(n){if(!t.connectors)throw new (0, _chunkXKAIXCX7js.g)("Connector not initialized");cl(),t.connectors.on("walletsUpdated",cl)}},[n]);let B0=l=>{l&&"target"in l&&l&&(l=void 0),Y({externalConnectWallet:{walletList:_optionalChain([l, 'optionalAccess', _1110 => _1110.walletList])&&_optionalChain([l, 'optionalAccess', _1111 => _1111.walletList, 'access', _1112 => _1112.length])>0?l.walletList:void 0,suggestedAddress:_optionalChain([l, 'optionalAccess', _1113 => _1113.suggestedAddress])}}),we(i?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")};_react.useEffect.call(void 0, ()=>{if(!u[0])return;let l=u[0],p=E.current.find(y=>y.address===l.address),m;if(l.walletClientType==="privy"?m=_optionalChain([c, 'optionalAccess', _1114 => _1114.linkedAccounts, 'access', _1115 => _1115.find, 'call', _1116 => _1116(y=>y.type==="wallet"&&y.address===l.address&&y.walletClientType==="privy")]):m=_optionalChain([c, 'optionalAccess', _1117 => _1117.linkedAccounts, 'access', _1118 => _1118.find, 'call', _1119 => _1119(y=>y.type==="wallet"&&y.address===l.address&&y.walletClientType!=="privy")]),!p&&m){let y=Object.assign({},c);y.wallet=m&&{address:m.address,chainType:m.chainType,chainId:m.chainId,walletClient:m.walletClient,walletClientType:m.walletClientType,connectorType:m.connectorType,imported:m.imported,walletIndex:m.walletIndex},d(y)}E.current=u},[u]);let dp=async(l,p,m)=>{let y=_chunkLEABMTNMjs.v.call(void 0, l);if(y&&!_optionalChain([m, 'optionalAccess', _1120 => _1120.createAdditional]))throw _chunkLEABMTNMjs.H.call(void 0, M,"createWallet","onError","embedded_wallet_already_exists"),new Error("User already has an embedded wallet.");let[b,N]=await Promise.all([re.initializeWalletProxy(p),pe()]);if(!b&&_optionalChain([L, 'access', _1121 => _1121.customAuth, 'optionalAccess', _1122 => _1122.enabled]))throw _chunkLEABMTNMjs.H.call(void 0, M,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to connect to wallet proxy");if(!b||!N||_optionalChain([L, 'access', _1123 => _1123.embeddedWallets, 'optionalAccess', _1124 => _1124.requireUserOwnedRecoveryOnCreate]))return new Promise((V,q)=>{he(!0),Y({createWallet:{onSuccess:de=>{_chunkLEABMTNMjs.H.call(void 0, M,"createWallet","onSuccess",de),V(de)},onFailure:de=>{_chunkLEABMTNMjs.H.call(void 0, M,"createWallet","onError","unknown_embedded_wallet_error"),q(de)},callAuthOnSuccessOnClose:!1}}),we("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{if(!y)await b.create({accessToken:N});else{let oe=_chunkLEABMTNMjs.w.call(void 0, l),Se=(_optionalChain([oe, 'optionalAccess', _1125 => _1125.length])?Math.max(...oe.map(Re=>Re.walletIndex)):y.walletIndex)+1;await re.recoverEmbeddedEthereumWallet(),await b.createAdditional({accessToken:N,primaryWalletAddress:_optionalChain([y, 'optionalAccess', _1126 => _1126.address]),hdWalletIndex:Se})}let V=await re.refreshUser(),q=_chunkLEABMTNMjs.v.call(void 0, V);if(!q)throw _chunkLEABMTNMjs.H.call(void 0, M,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");return _chunkLEABMTNMjs.H.call(void 0, M,"createWallet","onSuccess",q),q}},H0=l=>{if(!L.chains.map(p=>p.id).includes(l))throw new (0, _chunkXKAIXCX7js.i)(`Chain ID ${l} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},hm=(l,p,m,y)=>new Promise(async(b,N)=>{let{requesterAppId:V}=p||{};if(!i||!c){_chunkLEABMTNMjs.H.call(void 0, M,"sendTransaction","onError","must_be_authenticated"),N(new Error("User must be authenticated before signing with a Privy wallet"));return}let q=_nullishCoalesce(y, () => (_optionalChain([_chunkLEABMTNMjs.v.call(void 0, c), 'optionalAccess', _1127 => _1127.address])));if(!q)throw new (0, _chunkXKAIXCX7js.g)("User must have an embedded wallet to send a transaction.");let{signingWallet:oe,rootWallet:de}=_chunkLEABMTNMjs.z.call(void 0, c,q);if(!de||!oe){_chunkLEABMTNMjs.H.call(void 0, M,"sendTransaction","onError","embedded_wallet_not_found"),N(new Error("Must have a Privy wallet before signing"));return}he(!0);let Se=vm.wallets.find(Nt=>Nt.walletClientType==="privy"&&_address.getAddress.call(void 0, Nt.address)===_address.getAddress.call(void 0, oe.address)),Re=await _optionalChain([Se, 'optionalAccess', _1128 => _1128.getEthereumProvider, 'call', _1129 => _1129()]);if(!Se||!Re)throw new (0, _chunkXKAIXCX7js.g)(`Cannot sendTransaction before embedded wallet ${oe.address} is connected`);let Ot=l.chainId?Number(l.chainId):_chunk3AGMJGHJjs.e.call(void 0, Se.chainId);H0(Ot);let At=Object.assign({},l,{chainId:Ot}),lt=async()=>{let Nt=await pe();if(!Nt||!W){_chunkLEABMTNMjs.H.call(void 0, M,"sendTransaction","onError","embedded_wallet_not_found"),N(new Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await re.recoverEmbeddedEthereumWallet()){_chunkLEABMTNMjs.H.call(void 0, M,"sendTransaction","onError","unknown_connect_wallet_error"),N(new Error("Unable to connect to wallet"));return}let sn=_chunkLEABMTNMjs.s.call(void 0, At.chainId,L.chains,L.rpcConfig,{appId:e.appId}),to=await _jssdkcore.populateTransactionRequest.call(void 0, oe.address,At,sn);if(L.embeddedWallets.noPromptOnSignature||Lt.current){let{totalGasEstimate:V0}=await _jssdkcore.calculateTotalGasEstimate.call(void 0, to,sn),{hasSufficientFunds:G0}=await tp(oe.address,to,V0,sn);if(!G0)throw new _t(new Vr("Wallet has insufficient funds for this transaction.",_jssdkcore.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let ul=await ep({accessToken:Nt,rootWallet:de,transactingWallet:oe,walletProxy:W,transactionRequest:to,provider:sn,requesterAppId:V});_chunkLEABMTNMjs.H.call(void 0, M,"sendTransaction","onSuccess",ul),b(ul)}catch(qn){_chunkLEABMTNMjs.H.call(void 0, M,"sendTransaction","onError","transaction_failure"),N(qn)}};if(L.embeddedWallets.noPromptOnSignature||Lt.current)p&&L.embeddedWallets.noPromptOnSignature&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),lt();else{let Nt={transactionRequest:At,transactingWallet:oe,rootWallet:de,onSuccess:to=>{_chunkLEABMTNMjs.H.call(void 0, M,"sendTransaction","onSuccess",to),b(to)},onFailure:to=>{_chunkLEABMTNMjs.H.call(void 0, M,"sendTransaction","onError","transaction_failure"),N(to)},uiOptions:p||{},fundWalletConfig:m,requesterAppId:V},qn={address:de.address,onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:to=>{_chunkLEABMTNMjs.H.call(void 0, M,"sendTransaction","onError","unknown_connect_wallet_error"),N(to)}},sn=em({address:oe.address,appConfig:L,fundWalletConfig:m,chainIdOverride:At.chainId,comingFromSendTransactionScreen:!0});Y({connectWallet:qn,sendTransaction:Nt,funding:sn}),we("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),ym=({transaction:l,connection:p,transactionOptions:m,uiOptions:y,wallet:b})=>new Promise(async(N,V)=>{let{requesterAppId:q}=y||{};if(!i||!c){_chunkLEABMTNMjs.H.call(void 0, M,"sendSolanaTransaction","onError","must_be_authenticated"),V(new (0, _chunkXKAIXCX7js.g)("User must be authenticated before signing with a Privy wallet","must_be_authenticated"));return}let oe=b?c.linkedAccounts.find(Ot=>Ot.type==="wallet"&&Ot.address===b.address):_chunkLEABMTNMjs.x.call(void 0, c);if(!oe){_chunkLEABMTNMjs.H.call(void 0, M,"sendSolanaTransaction","onError","embedded_wallet_not_found"),V(new (0, _chunkXKAIXCX7js.g)("Must have a Privy wallet before signing","embedded_wallet_not_found"));return}he(!0);let de=_nullishCoalesce(b, () => (w)),Se=await _optionalChain([de, 'optionalAccess', _1130 => _1130.isConnected, 'call', _1131 => _1131()]);if(!de||!Se)throw _chunkLEABMTNMjs.H.call(void 0, M,"sendSolanaTransaction","onError","embedded_wallet_not_found"),new (0, _chunkXKAIXCX7js.g)(`Cannot sendSolanaTransaction before embedded wallet ${oe.address} is connected`,"embedded_wallet_not_found");let Re=async()=>{let Ot=await pe();if(!Ot||!W){_chunkLEABMTNMjs.H.call(void 0, M,"sendSolanaTransaction","onError","embedded_wallet_not_found"),V(new (0, _chunkXKAIXCX7js.g)("Must have valid access token and Privy wallet to send transaction","embedded_wallet_not_found"));return}try{if(!await re.recoverEmbeddedSolanaWallet()){_chunkLEABMTNMjs.H.call(void 0, M,"sendSolanaTransaction","onError","unknown_connect_wallet_error"),V(new (0, _chunkXKAIXCX7js.g)("Unable to connect to wallet","unknown_connect_wallet_error"));return}if(L.embeddedWallets.noPromptOnSignature){let{instructions:sn}=await Dd(l,p);sn.every(ul=>ul.hasFunds)||(_chunkLEABMTNMjs.H.call(void 0, M,"sendSolanaTransaction","onError","insufficient_balance"),V(new (0, _chunkXKAIXCX7js.g)("Solana wallet has insufficient funds for this transaction.","insufficient_balance")))}let{signature:lt,receipt:Nt}=await Zd({accessToken:Ot,tx:l,connection:p,walletProxy:W,transactionOptions:m}),qn=Nd(lt,Nt);_chunkLEABMTNMjs.H.call(void 0, M,"sendSolanaTransaction","onSuccess",qn),N(qn)}catch(At){_chunkLEABMTNMjs.H.call(void 0, M,"sendSolanaTransaction","onError","transaction_failure"),V(At)}};if(L.embeddedWallets.noPromptOnSignature)y&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),Re();else{let Ot={transactionRequest:l,connection:p,transactionOptions:m,transactingWallet:oe,onSuccess:lt=>{_chunkLEABMTNMjs.H.call(void 0, M,"sendSolanaTransaction","onSuccess",lt),N(lt)},onFailure:lt=>{_chunkLEABMTNMjs.H.call(void 0, M,"sendSolanaTransaction","onError","transaction_failure"),V(lt)},uiOptions:y||{},requesterAppId:q},At={address:oe.address,onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",onFailure:lt=>{_chunkLEABMTNMjs.H.call(void 0, M,"sendSolanaTransaction","onError","unknown_connect_wallet_error"),V(lt)}};Y({connectWallet:At,sendSolanaTransaction:Ot,funding:void 0}),we("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function gm(){return new Promise(async(l,p)=>{let m=await pe();if(!m||!W)throw new Error("Must have valid access token to enroll in MFA");try{await W.verifyMfa({accessToken:m}),l()}catch(y){p(y)}})}let dl=l=>_optionalChain([l, 'optionalAccess', _1132 => _1132.linkedAccounts, 'access', _1133 => _1133.filter, 'call', _1134 => _1134(p=>p.latestVerifiedAt!==null&&!(p.type==="wallet"&&p.walletClientType==="privy")), 'access', _1135 => _1135.sort, 'call', _1136 => _1136((p,m)=>m.latestVerifiedAt.getTime()-p.latestVerifiedAt.getTime()), 'access', _1137 => _1137[0]]),ar=l=>{let p=_nullishCoalesce(_optionalChain([c, 'optionalAccess', _1138 => _1138.linkedAccounts, 'access', _1139 => _1139.filter, 'call', _1140 => _1140(b=>b.type===l), 'access', _1141 => _1141.length]), () => (0)),{displayName:m,loginMethod:y}=_n(l);if(l==="passkey"&&p>=5||l!=="passkey"&&p>=1)throw _chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:y}),new (0, _chunkXKAIXCX7js.g)(`User already has an account of type ${m} linked.`)};async function Cm({showAutomaticRecovery:l=!1,legacySetWalletPasswordFlow:p=!1}){P(null);let m=p?"setWalletPassword":"setWalletRecovery";if(!i||!c)throw _chunkLEABMTNMjs.H.call(void 0, M,m,"onError","must_be_authenticated"),new Error("User must be authenticated before adding recovery method to Privy wallet");let y=_chunkLEABMTNMjs.v.call(void 0, c);if(!y||!W)throw _chunkLEABMTNMjs.H.call(void 0, M,m,"onError","embedded_wallet_not_found"),new Error("Must have a Privy wallet to add a recovery method");if(_chunkLEABMTNMjs.x.call(void 0, c))throw new Error("Cannot set user-controlled recovery for user with Solana.");try{await gm()}catch(N){throw _chunkLEABMTNMjs.H.call(void 0, M,m,"onError","missing_or_invalid_mfa"),N}return new Promise((N,V)=>{he(!0);let q={onSuccess:Re=>{_chunkLEABMTNMjs.H.call(void 0, M,m,"onSuccess","user-passcode",Re),N(Re)},onFailure:Re=>{_chunkLEABMTNMjs.H.call(void 0, M,m,"onError","user_exited_set_password_flow"),V(Re)},callAuthOnSuccessOnClose:!1},oe=y.recoveryMethod==="user-passcode",Se={onCompleteNavigateTo:Oc({walletAction:"update",availableRecoveryMethods:L.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:p,isResettingPassword:oe,showAutomaticRecovery:l}),shouldForceMFA:!1,onFailure:Re=>{_chunkLEABMTNMjs.H.call(void 0, M,m,"onError","unknown_connect_wallet_error"),V(Re)}};Y({setWalletPassword:q,createWallet:q,connectWallet:Se,recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:oe}}),we("EMBEDDED_WALLET_CONNECTING_SCREEN")})}async function pl({appId:l,action:p}){let m=await pe();if(p==="link"&&!m)throw _chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onError","must_be_authenticated",{linkMethod:`privy:${l}`}),new (0, _chunkXKAIXCX7js.g)("User must be authenticated before linking an account.");if(p==="login"&&m)throw _chunkLEABMTNMjs.H.call(void 0, M,"login","onError","unknown_auth_error"),new (0, _chunkXKAIXCX7js.g)("Attempted to log in, but user is already logged in. Use a `link` helper instead.");G.current=`privy:${l}`,J.current=p;let y=window.open(void 0,void 0,Fs({w:440,h:680}));return t.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:l}}),new Promise(async(b,N)=>{let{name:V,logoUrl:q}=await id({api:t.api,providerAppId:l,requesterAppId:L.id});Y({crossAppAuth:{appId:l,name:V,logoUrl:q,action:p,popup:y,onSuccess:b,onError:N}}),gt("CROSS_APP_AUTH_SCREEN")})}let Ua={ready:n,authenticated:i,user:c,walletConnectors:t.connectors||null,connectWallet:B0,importWallet:async({privateKey:l})=>{Le("siwe");let[p,m]=await Promise.all([re.initializeWalletProxy(15e3),pe()]);if(p&&m){await p.import({privateKey:l,accessToken:m});let y=await re.refreshUser(),b=_chunkLEABMTNMjs.y.call(void 0, y);if(!b)throw _chunkLEABMTNMjs.H.call(void 0, M,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to import wallet");return _chunkLEABMTNMjs.H.call(void 0, M,"createWallet","onSuccess",b),b}else throw new (0, _chunkXKAIXCX7js.g)("User is not authenticated")},linkWallet:Gn,startCrossAppAuthFlow:pl,linkEmail:()=>{Le("email"),ar("email"),G.current="email",J.current="link",we("LINK_EMAIL_SCREEN")},linkPhone:()=>{Le("sms"),ar("phone"),G.current="sms",J.current="link",we("LINK_PHONE_SCREEN")},linkGoogle:async()=>{Le("google"),ar("google_oauth"),J.current="link",await re.initLoginWithOAuth("google")},linkTwitter:async()=>{Le("twitter"),ar("twitter_oauth"),J.current="link",await re.initLoginWithOAuth("twitter")},linkDiscord:async()=>{Le("discord"),ar("discord_oauth"),J.current="link",await re.initLoginWithOAuth("discord")},linkGithub:async()=>{Le("github"),ar("github_oauth"),J.current="link",await re.initLoginWithOAuth("github")},linkSpotify:async()=>{Le("spotify"),ar("spotify_oauth"),J.current="link",await re.initLoginWithOAuth("spotify")},linkInstagram:async()=>{Le("instagram"),ar("instagram_oauth"),J.current="link",await re.initLoginWithOAuth("instagram")},linkTiktok:async()=>{Le("tiktok"),ar("tiktok_oauth"),J.current="link",await re.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{Le("linkedin"),ar("linkedin_oauth"),J.current="link",await re.initLoginWithOAuth("linkedin")},linkApple:async()=>{Le("apple"),ar("apple_oauth"),J.current="link",await re.initLoginWithOAuth("apple")},linkPasskey:async()=>{Le("passkey"),ar("passkey"),await re.initLinkWithPasskey(),we("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{Le("telegram"),ar("telegram"),J.current="link",G.current="telegram",await re.initLoginWithTelegram(),we("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{Le("farcaster"),ar("farcaster"),await re.initLoginWithFarcaster(),J.current="link",G.current="farcaster",we("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(Le("email"),!_optionalChain([c, 'optionalAccess', _1142 => _1142.email]))throw new (0, _chunkXKAIXCX7js.g)("User does not have an email linked to their account.");J.current="link",G.current="email",we("UPDATE_EMAIL_SCREEN")},updatePhone:()=>{if(Le("sms"),!_optionalChain([c, 'optionalAccess', _1143 => _1143.phone]))throw new (0, _chunkXKAIXCX7js.g)("User does not have a phone number linked to their account.");J.current="link",G.current="sms",we("UPDATE_PHONE_SCREEN")},login:async l=>{l&&"target"in l&&l&&(l=void 0);let p="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!n){let m=await new Promise(y=>{ye(b=>y.bind(b))});if(ye(null),m){console.warn(p);return}}if(c&&!c.isGuest){console.warn(p);return}J.current="login",Y({login:l}),gt("LANDING")},connectOrCreateWallet:async()=>{if(n||(await new Promise(l=>{ye(()=>l)}),ye(null)),i){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}gt("CONNECT_OR_CREATE")},logout:async()=>{if(c&&t.clearProviderAcccessTokens(c),P(null),await t.logout(),c&&W)try{await W.clearMfa({userId:c.id})}catch (e37){}d(null),s(!1),_chunkLEABMTNMjs.H.call(void 0, M,"logout","onSuccess"),J.current=null,G.current=null,o(!1),_chunkLEABMTNMjs.b.del(_chunkXKAIXCX7js.D),_chunkLEABMTNMjs.b.del(_chunkXKAIXCX7js.E.call(void 0, L.id))},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!c||!c.wallet)return new rt;let l=u.find(m=>c.wallet&&m.address===c.wallet.address),p=_optionalChain([t, 'access', _1144 => _1144.connectors, 'optionalAccess', _1145 => _1145.walletConnectors, 'access', _1146 => _1146.find, 'call', _1147 => _1147(m=>m.wallets.find(y=>y.address===_optionalChain([l, 'optionalAccess', _1148 => _1148.address])))]);return!l||!p?new rt:p.proxyProvider},getEthersProvider:()=>{if(!c||!c.wallet)return new (0, _providers.Web3Provider)(new To(new rt));let l=u.find(m=>c.wallet&&m.address===c.wallet.address),p=_optionalChain([t, 'access', _1149 => _1149.connectors, 'optionalAccess', _1150 => _1150.walletConnectors, 'access', _1151 => _1151.find, 'call', _1152 => _1152(m=>m.wallets.find(y=>y.address===_optionalChain([l, 'optionalAccess', _1153 => _1153.address])))]);return!l||!p?new (0, _providers.Web3Provider)(new To(new rt)):new (0, _providers.Web3Provider)(new To(p.proxyProvider))},getWeb3jsProvider:()=>{if(!c||!c.wallet)return new un(new rt);let l=u.find(m=>c.wallet&&m.address===c.wallet.address),p=_optionalChain([t, 'access', _1154 => _1154.connectors, 'optionalAccess', _1155 => _1155.walletConnectors, 'access', _1156 => _1156.find, 'call', _1157 => _1157(m=>m.wallets.find(y=>y.address===_optionalChain([l, 'optionalAccess', _1158 => _1158.address])))]);return!l||!p?new un(new rt):new un(p.proxyProvider)},unlinkWallet:async l=>{let p;return l.startsWith("0x")?p=await t.unlinkEthereumWallet(l):p=await t.unlinkSolanaWallet(l),d(p),p},unlinkEmail:async l=>{let p=await t.unlinkEmail(l);return d(p),p},unlinkPhone:async l=>{let p=await t.unlinkPhone(l);return d(p),p},unlinkGoogle:async l=>{let p=await t.unlinkOAuth("google",l);return d(p),p},unlinkTwitter:async l=>{let p=await t.unlinkOAuth("twitter",l);return d(p),p},unlinkDiscord:async l=>{let p=await t.unlinkOAuth("discord",l);return d(p),p},unlinkGithub:async l=>{let p=await t.unlinkOAuth("github",l);return d(p),p},unlinkSpotify:async l=>{let p=await t.unlinkOAuth("spotify",l);return d(p),p},unlinkInstagram:async l=>{let p=await t.unlinkOAuth("instagram",l);return d(p),p},unlinkTiktok:async l=>{let p=await t.unlinkOAuth("tiktok",l);return d(p),p},unlinkLinkedIn:async l=>{let p=await t.unlinkOAuth("linkedin",l);return d(p),p},unlinkApple:async l=>{let p=await t.unlinkOAuth("apple",l);return d(p),p},unlinkFarcaster:async l=>{let p=await t.unlinkFarcaster(l);return d(p),p},unlinkTelegram:async l=>{let p=await t.unlinkTelegram(l);return d(p),p},unlinkPasskey:async l=>{let p=await t.unlinkPasskey(l);return d(p),p},unlinkCrossAppAccount:async({subject:l})=>{let p=_optionalChain([c, 'optionalAccess', _1159 => _1159.linkedAccounts, 'access', _1160 => _1160.find, 'call', _1161 => _1161(y=>y.type==="cross_app"&&y.subject===l), 'optionalAccess', _1162 => _1162.providerApp]);if(!p)throw new (0, _chunkXKAIXCX7js.g)("Invalid subject");t.storeProviderAccessToken(p.id,null);let m=await t.unlinkOAuth(`privy:${p.id}`,l);return d(m),m},setActiveWallet:async l=>{let p=u.find(y=>_address.getAddress.call(void 0, y.address)===_address.getAddress.call(void 0, l)),m=_optionalChain([c, 'optionalAccess', _1163 => _1163.linkedAccounts, 'access', _1164 => _1164.find, 'call', _1165 => _1165(y=>y.type==="wallet"&&_address.getAddress.call(void 0, y.address)===_address.getAddress.call(void 0, l))]);if(!p||!await p.isConnected())Y({externalConnectWallet:{suggestedAddress:l}}),Gn();else if(!p.linked)p.loginOrLink();else{let y=Object.assign({},c);y.wallet=m&&{address:m.address,chainType:m.chainType,chainId:m.chainId,walletClient:m.walletClient,walletClientType:m.walletClientType,connectorType:m.connectorType,imported:m.imported,walletIndex:m.walletIndex},d(y)}},forkSession:()=>t.forkSession(),createWallet:async l=>{if(l&&"target"in l&&l&&(l=void 0),!i||!c)throw _chunkLEABMTNMjs.H.call(void 0, M,"createWallet","onError","must_be_authenticated"),new Error("User must be authenticated before creating a Privy wallet");return dp(c,15e3,l)},setWalletRecovery:async l=>Cm({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:_nullishCoalesce(_optionalChain([l, 'optionalAccess', _1166 => _1166.showAutomaticRecovery]), () => (!1))}),setWalletPassword:async()=>Cm({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(l,p,m)=>new Promise(async(y,b)=>{let{requesterAppId:N}=p||{};if(!i||!c){_chunkLEABMTNMjs.H.call(void 0, M,"signMessage","onError","must_be_authenticated"),b(new Error("User must be authenticated before signing with a Privy wallet"));return}let V=_nullishCoalesce(m, () => (_optionalChain([_chunkLEABMTNMjs.v.call(void 0, c), 'optionalAccess', _1167 => _1167.address])));if(!V)throw new (0, _chunkXKAIXCX7js.g)("User must have an embedded wallet to sign a message.");let{signingWallet:q,rootWallet:oe}=_chunkLEABMTNMjs.z.call(void 0, c,V);if(!q||!oe){_chunkLEABMTNMjs.H.call(void 0, M,"signMessage","onError","embedded_wallet_not_found"),b(new Error("Must have a Privy wallet before signing"));return}if(typeof l!="string"||l.length<1){_chunkLEABMTNMjs.H.call(void 0, M,"signMessage","onError","invalid_message"),b(new Error("Message must be a non-empty string"));return}he(!0);let de=async()=>{if(!i)throw new Error("User must be authenticated before signing with a Privy wallet");let Se=await pe();if(!W||!Se)throw new Error("Unable to connect to wallet");if(!await re.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:q.address,requesterAppId:N}});let{response:Ot}=await W.rpc({accessToken:Se,address:oe.address,hdWalletIndex:_nullishCoalesce(q.walletIndex, () => (void 0)),requesterAppId:N,request:{method:"personal_sign",params:[l,q.address]}}),At=Ot.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:q.address,requesterAppId:N}}),At};if(L.embeddedWallets.noPromptOnSignature||Lt.current){p&&L.embeddedWallets.noPromptOnSignature&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Se=await de();_chunkLEABMTNMjs.H.call(void 0, M,"signMessage","onSuccess",Se),y(Se)}catch(Se){_chunkLEABMTNMjs.H.call(void 0, M,"signMessage","onError","unable_to_sign"),b(_nullishCoalesce(Se, () => (new _t("Unable to sign message"))))}}else{let Ot={method:"personal_sign",data:l,confirmAndSign:de,onSuccess:lt=>{_chunkLEABMTNMjs.H.call(void 0, M,"signMessage","onSuccess",lt),y(lt)},onFailure:lt=>{_chunkLEABMTNMjs.H.call(void 0, M,"signMessage","onError","unable_to_sign"),b(lt)},uiOptions:p||{}},At={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:lt=>{_chunkLEABMTNMjs.H.call(void 0, M,"signMessage","onError","unknown_connect_wallet_error"),b(lt)},address:oe.address};Y({signMessage:Ot,connectWallet:At}),we("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),signTypedData:(l,p,m)=>new Promise(async(y,b)=>{let{requesterAppId:N}=p||{};if(!i||!c){_chunkLEABMTNMjs.H.call(void 0, M,"signTypedData","onError","must_be_authenticated"),b(new Error("User must be authenticated before signing with a Privy wallet"));return}let V=_nullishCoalesce(m, () => (_optionalChain([_chunkLEABMTNMjs.v.call(void 0, c), 'optionalAccess', _1168 => _1168.address])));if(!V)throw new (0, _chunkXKAIXCX7js.g)("User must have an embedded wallet to sign a message.");let{signingWallet:q,rootWallet:oe}=_chunkLEABMTNMjs.z.call(void 0, c,V);if(!oe||!q){_chunkLEABMTNMjs.H.call(void 0, M,"signTypedData","onError","embedded_wallet_not_found"),b(new Error("Must have a Privy wallet before signing"));return}he(!0);let de=_chunkLEABMTNMjs.t.call(void 0, l),Se=async()=>{if(!i)throw new Error("User must be authenticated before signing with a Privy wallet");let Re=await pe();if(!W||!Re)throw new Error("Unable to connect to wallet");if(!await re.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:q.address,requesterAppId:N}});let{response:At}=await W.rpc({accessToken:Re,address:oe.address,hdWalletIndex:_nullishCoalesce(q.walletIndex, () => (void 0)),requesterAppId:N,request:{method:"eth_signTypedData_v4",params:[q.address,de]}}),lt=At.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:q.address,requesterAppId:N}}),lt};if(Lt.current||L.embeddedWallets.noPromptOnSignature||(_nullishCoalesce(L.legacyWalletUiConfig, () => (!1)))){p&&L.embeddedWallets.noPromptOnSignature&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let Re=await Se();_chunkLEABMTNMjs.H.call(void 0, M,"signTypedData","onSuccess",Re),y(Re)}catch(Re){_chunkLEABMTNMjs.H.call(void 0, M,"signTypedData","onError","unable_to_sign"),b(_nullishCoalesce(Re, () => (new _t("Unable to sign message"))))}}else{let At={method:"eth_signTypedData_v4",data:de,confirmAndSign:Se,onSuccess:Nt=>{_chunkLEABMTNMjs.H.call(void 0, M,"signTypedData","onSuccess",Nt),y(Nt)},onFailure:Nt=>{_chunkLEABMTNMjs.H.call(void 0, M,"signTypedData","onError","unable_to_sign"),b(Nt)},uiOptions:p||{}},lt={onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:Nt=>{_chunkLEABMTNMjs.H.call(void 0, M,"signMessage","onError","unknown_connect_wallet_error"),b(Nt)}};Y({signMessage:At,connectWallet:lt}),we("EMBEDDED_WALLET_CONNECTING_SCREEN")}}),sendTransaction:async(l,p,m,y)=>{let N=await(await hm(l,p,m,y)).wait();return rp(N)},sendSolanaTransaction:async(l,p,m,y)=>await ym({transaction:l,connection:p,transactionOptions:y,uiOptions:m,wallet:_nullishCoalesce(w, () => (void 0))}),exportWallet:l=>new Promise(async(p,m)=>{if(!i||!c){m(new Error("User must be authenticated before exporting their Privy wallet"));return}l&&"target"in l&&l&&(l=void 0);let y=_optionalChain([l, 'optionalAccess', _1169 => _1169.address]),b=c.linkedAccounts.filter(de=>de.type==="wallet"&&de.walletClientType==="privy"&&de.chainType==="ethereum"),N=y?b.find(de=>de.address===_address.getAddress.call(void 0, y)):b.find(de=>!de.imported)||b[0];if(!N){m(new Error("Must have a Privy wallet before exporting"));return}he(!0);let V={onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:m,address:N.address,shouldForceMFA:!0};if(Y($),!await pe()||!W){m(new Error("Must have valid access token to enroll in MFA"));return}if(!W){m(new Error("Must have a Privy wallet before exporting"));return}let oe={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:N,onSuccess:p,onFailure:m};Y({keyExport:oe,connectWallet:V}),we("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:gm,async init(l){switch(l){case"sms":await t.initMfaSmsVerification();return;case"passkey":return await t.initMfaPasskeyVerification();case"totp":return;default:throw new Error(`Unsupported MFA method: ${l}`)}},async submit(l,p){switch(l){case"totp":case"sms":if(typeof p!="string")throw new (0, _chunkXKAIXCX7js.g)("Invalid MFA code");_optionalChain([Ee, 'access', _1170 => _1170.current, 'optionalAccess', _1171 => _1171.resolve, 'call', _1172 => _1172({mfaMethod:l,mfaCode:p,relyingParty:window.origin})]),await new Promise((N,V)=>{ue.current={resolve:N,reject:V}});break;case"passkey":if(typeof p=="string")throw new (0, _chunkXKAIXCX7js.g)("Invalid authenticator response");let y=await(await Promise.resolve().then(() => _interopRequireWildcard(require("@simplewebauthn/browser")))).startAuthentication(p),b=x0(y);_optionalChain([Ee, 'access', _1173 => _1173.current, 'optionalAccess', _1174 => _1174.resolve, 'call', _1175 => _1175({mfaMethod:l,mfaCode:b,relyingParty:window.origin})]),await new Promise((N,V)=>{ue.current={resolve:N,reject:V}});break;default:throw _optionalChain([Ee, 'access', _1176 => _1176.current, 'optionalAccess', _1177 => _1177.reject, 'call', _1178 => _1178(new (0, _chunkXKAIXCX7js.g)("Unsupported MFA method"))]),new (0, _chunkXKAIXCX7js.g)(`Unsupported MFA method: ${l}`)}},cancel(){_optionalChain([Ee, 'access', _1179 => _1179.current, 'optionalAccess', _1180 => _1180.reject, 'call', _1181 => _1181(new (0, _chunkXKAIXCX7js.g)("MFA canceled"))])},async initEnrollmentWithSms(l){let p=await pe();if(!p||!W)throw new Error("Must have valid access token to enroll in MFA");await W.initEnrollMfa({method:"sms",accessToken:p,phoneNumber:l.phoneNumber})},enrollInMfa(l){return new Promise((p,m)=>{if(!l){re.closePrivyModal(),p();return}L.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),Y({mfaEnrollmentFlow:{mfaMethods:L.mfa.methods,onSuccess:p,onFailure:m}}),we("MFA_ENROLLMENT_FLOW_SCREEN")})},async initEnrollmentWithTotp(){let l=await pe();if(!l||!W)throw new Error("Must have valid access token to enroll in MFA");let p=await W.initEnrollMfa({method:"totp",accessToken:l});return{secret:p.secret,authUrl:p.authUrl}},async submitEnrollmentWithSms(l){let p=await pe();if(!p||!W)throw new Error("Must have valid access token to enroll in MFA");await W.submitEnrollMfa({method:"sms",accessToken:p,phoneNumber:l.phoneNumber,code:l.mfaCode});let m=await t.getAuthenticatedUser();d(m)},async submitEnrollmentWithTotp(l){let p=await pe();if(!p||!W)throw new Error("Must have valid access token to enroll in MFA");await W.submitEnrollMfa({method:"totp",accessToken:p,code:l.mfaCode});let m=await t.getAuthenticatedUser();d(m)},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:l}){let p=await pe();if(!p||!W)throw new Error("Must have valid access token to enroll in MFA");await W.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:l});let m=await t.getAuthenticatedUser();d(m)},async unenroll(l){let p=await pe();if(!p||!W)throw new Error("Must have valid access token to remove MFA");l==="passkey"?await W.submitEnrollMfa({method:"passkey",accessToken:p,credentialIds:[]}):await W.unenrollMfa({method:l,accessToken:p});let m=await t.getAuthenticatedUser();d(m)},requestFarcasterSignerFromWarpcast:async()=>{let l=await pe(),p=_optionalChain([c, 'optionalAccess', _1182 => _1182.linkedAccounts, 'access', _1183 => _1183.find, 'call', _1184 => _1184(b=>b.type==="wallet"&&b.walletClientType==="privy")]);if(!l)throw new Error("Must have valid access token to connect with Farcaster");if(!W||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!_optionalChain([c, 'optionalAccess', _1185 => _1185.farcaster, 'optionalAccess', _1186 => _1186.fid]))throw new Error("Must have Farcaster account to use Farcaster signers");if(!await re.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");let y=await W.initFarcasterSigner({address:p.address,hdWalletIndex:null,accessToken:l,mfaCode:null,mfaMethod:null,relyingParty:window.origin});if(y.status==="approved"){let b=await t.getAuthenticatedUser();d(b||c||null)}Y({farcasterSigner:y}),we("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let l=await pe(),p=_optionalChain([c, 'optionalAccess', _1187 => _1187.linkedAccounts, 'access', _1188 => _1188.find, 'call', _1189 => _1189(b=>b.type==="wallet"&&b.walletClientType==="privy")]);if(!l)throw new Error("Must have valid access token to connect with Farcaster");if(!W||!p)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!_optionalChain([c, 'optionalAccess', _1190 => _1190.farcaster, 'optionalAccess', _1191 => _1191.fid]))throw new Error("Must have Farcaster account to use Farcaster signers");if(!await re.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!_optionalChain([c, 'access', _1192 => _1192.farcaster, 'optionalAccess', _1193 => _1193.signerPublicKey]))throw new Error("Must have a Farcaster signer public key to sign");return(b=>Uint8Array.from(b.match(/.{1,2}/g).map(N=>parseInt(N,16))))(c.farcaster.signerPublicKey.slice(2))},signFarcasterMessage:async l=>{let p=await pe(),m=_optionalChain([c, 'optionalAccess', _1194 => _1194.linkedAccounts, 'access', _1195 => _1195.find, 'call', _1196 => _1196(V=>V.type==="wallet"&&V.walletClientType==="privy")]);if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!W||!m)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!_optionalChain([c, 'optionalAccess', _1197 => _1197.farcaster, 'optionalAccess', _1198 => _1198.fid]))throw new Error("Must have Farcaster account to use Farcaster signers");if(!await re.recoverEmbeddedEthereumWallet())throw new Error("Unable to connect to wallet");if(!_optionalChain([c, 'access', _1199 => _1199.farcaster, 'optionalAccess', _1200 => _1200.signerPublicKey]))throw new Error("Must have a Farcaster signer public key to sign");let b=await Promise.resolve().then(() => _interopRequireWildcard(require("@simplewebauthn/browser"))),N=await W.signFarcasterMessage({address:m.address,hdWalletIndex:null,accessToken:p,mfaCode:null,mfaMethod:null,payload:{hash:b.bufferToBase64URLString(l)},fid:BigInt(c.farcaster.fid),relyingParty:window.origin});return new Uint8Array(b.base64URLStringToBuffer(N.signature))},createGuestAccount:async()=>{if(c&&!c.isGuest)throw new Error("User cannot already be authenticated to create a guest account");return _optionalChain([c, 'optionalAccess', _1201 => _1201.isGuest])?c:re.loginWithGuestAccountFlow()},isHeadlessOAuthLoading:S,loginWithCode(l){return re.loginWithCode(l)},initLoginWithEmail(l){return re.initLoginWithEmail(l)},initLoginWithSms(l){return re.initLoginWithSms(l)},otpState:B,fundWallet(l,p){return re.fundWallet(l,p)},initLoginWithHeadlessOAuth(l,p){return re.initLoginWithHeadlessOAuth(l,p)},loginWithHeadlessOAuth(l){return re.loginWithHeadlessOAuth(l)},generateSiweMessage({address:l,chainId:p}){return re.generateSiweMessage({address:l,chainId:p})},linkWithSiwe({message:l,signature:p,chainId:m,walletClientType:y,connectorType:b}){return Le("siwe"),re.linkWithSiwe({message:l,signature:p,chainId:m,walletClientType:y,connectorType:b})},signMessageWithCrossAppWallet(l,{address:p}){return sd({user:c,client:t,address:p,requesterAppId:L.id,request:{method:"personal_sign",params:[l,p]},reconnect:pl})},signTypedDataWithCrossAppWallet(l,{address:p}){let m=_chunkLEABMTNMjs.t.call(void 0, l);return sd({user:c,client:t,address:p,requesterAppId:L.id,request:{method:"eth_signTypedData_v4",params:[p,m]},reconnect:pl})},sendTransactionWithCrossAppWallet(l,{address:p}){return sd({user:c,client:t,address:p,requesterAppId:L.id,request:{method:"eth_sendTransaction",params:[l]},reconnect:pl})},isModalOpen:r,mfaMethods:L.mfa.methods};R0=Ua.signMessage,_0=Ua.signTypedData,M0=async(...l)=>{let p=await hm(...l);return L.embeddedWallets.waitForTransactionConfirmation&&await p.wait(),p};let re=(()=>({isNewUserThisSession:_,pendingTransaction:null,walletConnectionStatus:D,connectors:_nullishCoalesce(_optionalChain([t, 'access', _1202 => _1202.connectors, 'optionalAccess', _1203 => _1203.walletConnectors]), () => ([])),solanaWallets:h,rpcConfig:L.rpcConfig,chains:L.chains,appId:e.appId,showFiatPrices:L.embeddedWallets.priceDisplay.primary!=="native-token",clientAnalyticsId:t.clientAnalyticsId,customAuthStatus:or,noPromptOnSignature:Lt,nativeTokenSymbolForChainId:l=>_optionalChain([L, 'access', _1204 => _1204.chains, 'access', _1205 => _1205.find, 'call', _1206 => _1206(p=>p.id===Number(l)), 'optionalAccess', _1207 => _1207.nativeCurrency, 'access', _1208 => _1208.symbol]),initializeWalletProxy:async l=>{if(W)return W;let p=new Promise(b=>{se(()=>N=>b(N))}),m=new Promise(b=>setTimeout(()=>b(null),l)),y=await Promise.race([p,m]);return se(null),y},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>_optionalChain([t, 'access', _1209 => _1209.authFlow, 'optionalAccess', _1210 => _1210.meta]),client:t,closePrivyModal:async(l={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let p=n&&i&&c,m;p&&G.current&&(m=dl(c)),J.current==="login"?l.shouldCallAuthOnSuccess&&p&&G.current?(_chunkLEABMTNMjs.H.call(void 0, M,"login","onComplete",c,_,!1,G.current,_nullishCoalesce(m, () => (null))),_optionalChain([e, 'access', _1211 => _1211.onSuccess, 'optionalCall', _1212 => _1212(c,_)])):_chunkLEABMTNMjs.H.call(void 0, M,"login","onError","exited_auth_flow"):J.current==="link"&&m&&(l.isSuccess&&p&&G.current?_chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onSuccess",c,G.current,m):G.current&&_chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onError","exited_link_flow",{linkMethod:G.current}));let y=T&&tm.includes(T),b=T==="ERROR_SCREEN"&&$.errorModalData&&tm.includes($.errorModalData.previousScreen);if((y||b)&&$.funding){let N=_nullishCoalesce(O3[T], () => (null)),V=_chunkLEABMTNMjs.s.call(void 0, $.funding.chain.id,L.chains,L.rpcConfig,{appId:e.appId}),q;try{q=(await V.getBalance($.funding.address)).toBigInt()}catch (e38){console.error("Unable to pull wallet balance")}_chunkLEABMTNMjs.H.call(void 0, M,"fundWallet","onUserExited",{address:$.funding.address,chain:$.funding.chain,fundingMethod:N,balance:q})}Y({...$,externalConnectWallet:{suggestedAddress:void 0}}),J.current=null,G.current=null,A(!1),o(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:async({message:l})=>new Promise(async(p,m)=>{let y=async()=>{let b=await t.getAccessToken();if(!b)throw new Error("User must be authenticated to use their embedded wallet.");if(!w)throw new Error("User must have an embedded Solana wallet to sign messages for Solana.");let N=await _asyncNullishCoalesce(re.walletProxy, async () => (await re.initializeWalletProxy(15e3)));if(!N)throw new Error("Failed to initialize embedded wallet proxy.");let{response:V}=await N.rpcSolana({accessToken:b,publicKey:w.address,request:{method:"signMessage",params:{message:l}}});return V.data.signature};if(L.embeddedWallets.noPromptOnSignature||Lt.current)try{let b=await y();p({signature:b})}catch(b){m(b)}else Y({signMessage:{method:"solana_signMessage",data:l,confirmAndSign:y,onSuccess:q=>{p({signature:q})},onFailure:q=>{m(q)},uiOptions:{}}}),gt("EMBEDDED_WALLET_SIGN_REQUEST_SCREEN")}),openPrivyModal:we,connectWallet:Pt,initLoginWithWallet:async(l,p,m)=>{no(l)?(G.current="siwe",Yt(l,p,m)):(G.current="siws",br(l,p))},loginWithWallet:async()=>{if(!n)throw new _chunkXKAIXCX7js.l;let l;if(t.authFlow instanceof zo?l="siwe":t.authFlow instanceof oa&&(l="siws"),!l)throw new (0, _chunkXKAIXCX7js.g)("Must initialize SIWE/SIWS flow first.");let p=await t.getAccessToken(),m,y;if(p!==null)try{({user:m}=await t.link()),G.current=l}catch(b){throw _chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onError",b.privyErrorCode||"failed_to_link_account",{linkMethod:l}),b}else try{({user:m,isNewUser:y}=await t.authenticate()),G.current=l}catch(b){throw _chunkLEABMTNMjs.H.call(void 0, M,"login","onError",b.privyErrorCode||"generic_connect_wallet_error"),b}d(m||c||null),A(y||!1),s(!0)},initLoginWithFarcaster:async(l,p)=>{let m=new os(l,p);t.startAuthFlow(m);try{G.current="farcaster",await m.initializeFarcasterConnect()}catch(y){throw J.current==="login"?_chunkLEABMTNMjs.H.call(void 0, M,"login","onError",y.privyErrorCode||"unknown_auth_error"):J.current==="link"&&_chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onError",y.privyErrorCode||"unknown_auth_error",{linkMethod:"farcaster"}),y}},loginWithFarcaster:async()=>{if(!n)throw new _chunkXKAIXCX7js.l;if(!(t.authFlow instanceof os))throw new (0, _chunkXKAIXCX7js.g)("Must initialize Farcaster flow first.");let l=await t.getAccessToken(),p,m;if(l!==null)try{({user:p}=await t.link()),G.current="farcaster"}catch(y){throw _chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:"farcaster"}),y}else try{({user:p,isNewUser:m}=await t.authenticate()),G.current="farcaster"}catch(y){throw _chunkLEABMTNMjs.H.call(void 0, M,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}d(p||null),A(m||!1),s(!0)},async loginWithGuestAccountFlow(){let l=new Ka(this.appId);t.startAuthFlow(l);try{J.current="login",G.current="guest";let p=await t.authenticate(),{user:m,isNewUser:y}=p;if(y=y||!1,!m)throw new (0, _chunkXKAIXCX7js.g)("Unable to authenticate guest account");if(_chunkLEABMTNMjs.A.call(void 0, m,L.embeddedWallets.createOnLogin))try{await dp(m,15e3),m=await re.refreshUser()}catch (e39){d(m),console.warn("Unable to create embedded wallet for guest account")}else d(m);return A(y),s(!0),_chunkLEABMTNMjs.H.call(void 0, M,"login","onComplete",m,y,!1,"guest",null),m}catch(p){throw _chunkLEABMTNMjs.H.call(void 0, M,"login","onError",p.privyErrorCode||"unknown_auth_error"),p}},async crossAppAuthFlow({appId:l,popup:p,action:m}){let y=`privy:${l}`;G.current=y;let{url:b,stateCode:N,codeVerifier:V}=await q1({api:t.api,appId:l});if(!b)throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:l}}),new (0, _chunkXKAIXCX7js.g)("No authorization URL returned for cross-app auth.");try{let q=await A0({url:b,popup:p,provider:y}),oe=q.stateCode,de=q.authorizationCode;if(oe!==N)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:y,storedStateCode:_nullishCoalesce(N, () => ("")),returnedStateCode:_nullishCoalesce(oe, () => (""))}}),new (0, _chunkXKAIXCX7js.g)("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let Se=await z1({appId:l,codeVerifier:V,stateCode:oe,authorizationCode:de,action:m,client:t});Se&&t.storeProviderAccessToken(l,Se);let Re=await re.refreshUser();if(!Re)throw new (0, _chunkXKAIXCX7js.g)("Unable to update user");return t.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:l}}),Re}catch(q){throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:q.toString(),provider:y}}),q}},async initLoginWithOAuth(l,p,m){if(G.current=l,_chunkLEABMTNMjs.a.call(void 0, )){if(l==="google"&&mi(window.navigator.userAgent)){gt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{gt("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}l==="twitter"&&window.opener&&window.opener.postMessage({type:lp},"*"),_chunkLEABMTNMjs.b.del(_chunkXKAIXCX7js.I),_chunkLEABMTNMjs.b.del(_chunkXKAIXCX7js.J);let y=new bo({provider:l,disableSignup:!!m});p&&y.addCaptchaToken(p),t.startAuthFlow(y);let b=await t.authFlow.getAuthorizationUrl();b&&b.url&&(l==="twitter"&&_reactdevicedetect.isAndroid&&(b.url=b.url.replace("x.com","twitter.com")),window.location.assign(b.url))},async initLoginWithTelegram(l,p){if(!n)throw new _chunkXKAIXCX7js.l;G.current="telegram";let m=new Xa(l,p);t.startAuthFlow(m),m.meta.telegramWebAppData=void 0,m.meta.telegramAuthResult=await new Promise((y,b)=>{if(!L.loginConfig.telegramAuthConfiguration)return b(new (0, _chunkXKAIXCX7js.g)("Telegram Auth configuration is not loaded"));if(!window.Telegram)return b(new (0, _chunkXKAIXCX7js.g)("Telegram was not initialized"));window.Telegram.Login.auth({bot_id:L.loginConfig.telegramAuthConfiguration.botId,request_access:!0},N=>N?y(N):b(new (0, _chunkXKAIXCX7js.g)("Telegram auth failed or was canceled by the client")))})},async loginWithTelegram(){if(!(t.authFlow instanceof Xa))throw new (0, _chunkXKAIXCX7js.g)("Must initialize Telegram flow before calling loginWithTelegram");let l,p;if(J.current==="login")try{let m=await t.authenticate();l=m.user,p=m.isNewUser,G.current="telegram"}catch(m){throw _chunkLEABMTNMjs.H.call(void 0, M,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}else if(J.current==="link")try{l=(await t.link()).user,G.current="telegram"}catch(m){throw _chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onError",m.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),m}else throw new (0, _chunkXKAIXCX7js.g)("Unknown auth intent");d(l),A(p||!1),s(!0)},async recoveryOAuthFlow(l,p,m){let y,b;function N(V){if(!V)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:l}}),new (0, _chunkXKAIXCX7js.g)("Recovery OAuth failed")}switch(l){case"google-drive":{let{url:V,codeVerifier:q,stateCode:oe}=await $p({api:on.api,provider:l});N(V);let de,Se;try{let Re=await mm({url:V,popup:m,provider:l});if(de=Re.stateCode,Se=Re.authorizationCode,de!==oe)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:l,storedStateCode:_nullishCoalesce(oe, () => ("")),returnedStateCode:_nullishCoalesce(de, () => (""))}}),new (0, _chunkXKAIXCX7js.g)("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected")}catch(Re){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:Re.toString(),provider:l}}),new (0, _chunkXKAIXCX7js.g)("Recovery OAuth failed")}[y,b]=await Promise.all([pe(),Ky({api:on.api,provider:l,codeVerifier:q,stateCode:de,authorizationCode:Se})]);break}case"icloud":{let{url:V}=await $p({api:on.api,provider:l});N(V);let{ckWebAuthToken:q}=await mm({url:V,popup:m,provider:l});b=q,y=await pe();break}}if(!W)throw new (0, _chunkXKAIXCX7js.g)("Cannot connect to wallet proxy");if(!y)throw new (0, _chunkXKAIXCX7js.g)("Unable to authorize user");switch(p){case"recover":let V=_optionalChain([$, 'access', _1213 => _1213.recoverWallet, 'optionalAccess', _1214 => _1214.privyWallet, 'optionalAccess', _1215 => _1215.address]);if(!V)throw new (0, _chunkXKAIXCX7js.g)("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:V,recoveryMethod:l}}),await W.recover({address:V,accessToken:y,recoveryAccessToken:b,recoveryMethod:l}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:V,recoveryMethod:l}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await W.create({accessToken:y,recoveryAccessToken:b,recoveryMethod:l});let q=await re.refreshUser(),oe=_chunkLEABMTNMjs.v.call(void 0, q);if(!oe)throw _chunkLEABMTNMjs.H.call(void 0, M,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:oe.address}}),_chunkLEABMTNMjs.H.call(void 0, M,"createWallet","onSuccess",oe);break;case"set-recovery":let de=_chunkLEABMTNMjs.v.call(void 0, c);if(!de)throw _chunkLEABMTNMjs.H.call(void 0, M,"setWalletRecovery","onError","embedded_wallet_not_found"),new Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:de.address,existingRecoveryMethod:de.recoveryMethod,targetRecoveryMethod:l}}),await W.setRecovery({address:de.address,accessToken:y,recoveryAccessToken:b,recoveryMethod:l});let Se=_chunkLEABMTNMjs.v.call(void 0, await re.refreshUser());if(!Se)throw _chunkLEABMTNMjs.H.call(void 0, M,"createWallet","onError","unknown_embedded_wallet_error"),new Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:de.address,existingRecoveryMethod:de.recoveryMethod,targetRecoveryMethod:l}}),_chunkLEABMTNMjs.H.call(void 0, M,"setWalletRecovery","onSuccess",l,Se);break;default:throw new (0, _chunkXKAIXCX7js.g)("Unsupported recovery action")}},async loginWithOAuth(l){if(!(t.authFlow instanceof bo))throw new (0, _chunkXKAIXCX7js.g)("Must initialize OAuth flow before calling loginWithOAuth");let p=_chunkLEABMTNMjs.b.get(_chunkXKAIXCX7js.G),m=t.authFlow.meta.stateCode;if(p!==m)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:l,storedStateCode:_nullishCoalesce(p, () => ("")),returnedStateCode:_nullishCoalesce(m, () => (""))}}),new (0, _chunkXKAIXCX7js.g)("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let y=await t.getAccessToken(),b,N,V;if(y!==null)try{let q=await t.link();b=q.user,V=q.oAuthTokens,G.current=l}catch(q){throw _chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onError",q.privyErrorCode||"failed_to_link_account",{linkMethod:l}),q}else try{let q=await t.authenticate();b=q.user,N=q.isNewUser,V=q.oAuthTokens,G.current=l}catch(q){throw J.current==="login"?_chunkLEABMTNMjs.H.call(void 0, M,"login","onError",q.privyErrorCode||"unknown_auth_error"):J.current==="link"&&_chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onError",q.privyErrorCode||"failed_to_link_account",{linkMethod:l}),q}return d(b),A(N||!1),s(!0),V&&b&&_chunkLEABMTNMjs.H.call(void 0, M,"oAuthAuthorization","onOAuthTokenGrant",V,{user:b}),V},async initLoginWithPasskey(l){let p=new ra(l);t.startAuthFlow(p),J.current="login";try{G.current="passkey",await p.initAuthenticationFlow()}catch(m){throw _chunkLEABMTNMjs.H.call(void 0, M,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}},async loginWithPasskey(){if(!n)throw new _chunkXKAIXCX7js.l;if(!(t.authFlow instanceof ra))throw new (0, _chunkXKAIXCX7js.g)("Must initialize Passkey flow first.");if(G.current!=="passkey")throw new (0, _chunkXKAIXCX7js.g)("Must init login with Passkey flow first.");let l,p;try{G.current="passkey",{user:l,isNewUser:p}=await t.authenticate()}catch(m){throw _chunkLEABMTNMjs.H.call(void 0, M,"login","onError",m.privyErrorCode||"unknown_auth_error"),m}d(l),A(p||!1),s(!0)},async initLinkWithPasskey(l){let p=new ra(l);t.startAuthFlow(p),J.current="link",G.current="passkey";try{await p.initLinkFlow()}catch(m){throw _chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onError",m.privyErrorCode||"unknown_auth_error",{linkMethod:"passkey"}),m}},async linkWithPasskey(){if(!n)throw new _chunkXKAIXCX7js.l;if(!(t.authFlow instanceof ra))throw new (0, _chunkXKAIXCX7js.g)("Must initialize Passkey flow first.");if(G.current!=="passkey")throw new (0, _chunkXKAIXCX7js.g)("Must init login with Passkey flow first.");let l;try{G.current="passkey",{user:l}=await t.link()}catch(p){throw _chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onError",p.privyErrorCode||"failed_to_link_account",{linkMethod:"passkey"}),p}return d(l||c||null),l},async initLoginWithHeadlessOAuth(l,p){if(_chunkLEABMTNMjs.a.call(void 0, )){if(l==="google"&&mi(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.")}else throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let m=new bo({provider:l,headless:!0,disableSignup:!1});p&&m.addCaptchaToken(p);let y=await t.startAuthFlow(m).getAuthorizationUrl();_optionalChain([y, 'optionalAccess', _1216 => _1216.url])&&window.location.assign(y.url)},async loginWithHeadlessOAuth(l){R(!0),t.startAuthFlow(new bo(l));let p=_chunkLEABMTNMjs.b.get(_chunkXKAIXCX7js.G),m=l.stateCode;if(p!==m)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:l.provider,storedStateCode:_nullishCoalesce(p, () => ("")),returnedStateCode:_nullishCoalesce(m, () => (""))}}),R(!1),new (0, _chunkXKAIXCX7js.g)("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let y=await t.getAccessToken(),b,N,V;if(y!==null)try{({user:b,oAuthTokens:V}=await t.link()),G.current=l.provider;let q=dl(b);b&&q&&_chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onSuccess",b,G.current,q)}catch(q){throw R(!1),_chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onError",q.privyErrorCode||"failed_to_link_account",{linkMethod:l.provider}),q}else try{({user:b,isNewUser:N,oAuthTokens:V}=await t.authenticate()),G.current=l.provider;let q=dl(b);b&&q&&N!==void 0&&J.current==="login"&&_chunkLEABMTNMjs.H.call(void 0, M,"login","onComplete",b,N,!1,G.current,q)}catch(q){throw R(!1),_chunkLEABMTNMjs.H.call(void 0, M,"login","onError",q.privyErrorCode||"unknown_auth_error"),q}return d(b),A(N||!1),s(!0),R(!1),V&&b&&_chunkLEABMTNMjs.H.call(void 0, M,"oAuthAuthorization","onOAuthTokenGrant",V,{user:b}),_nullishCoalesce(b, () => (void 0))},initLoginWithEmail:async(l,p,m)=>{let y=new cn(l,p,m);t.startAuthFlow(y);try{G.current="email",await y.sendCodeEmail()}catch(b){throw J.current==="login"?_chunkLEABMTNMjs.H.call(void 0, M,"login","onError",b.privyErrorCode||"unknown_auth_error"):J.current==="link"&&_chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onError",b.privyErrorCode||"failed_to_link_account",{linkMethod:"email"}),b}},initUpdateEmail:async(l,p,m)=>{let y=new Dl(l,p,m);t.startAuthFlow(y),await y.sendCodeEmail()},initUpdatePhone:async(l,p,m)=>{let y=new tc(l,p,m);t.startAuthFlow(y),await y.sendSmsCode()},initLoginWithSms:async(l,p,m)=>{K({status:"sending-code"});let y=new dn(l,p,m);t.startAuthFlow(y);try{G.current="sms",await y.sendSmsCode(),K({status:"awaiting-code-input"})}catch(b){throw K({status:"error",error:b}),J.current==="login"?_chunkLEABMTNMjs.H.call(void 0, M,"login","onError",b.privyErrorCode||"unknown_auth_error"):J.current==="link"&&_chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onError",b.privyErrorCode||"failed_to_link_account",{linkMethod:"sms"}),b}},resendEmailCode:async()=>{await _optionalChain([t, 'access', _1217 => _1217.authFlow, 'optionalAccess', _1218 => _1218.sendCodeEmail, 'call', _1219 => _1219()])},resendSmsCode:async()=>{await _optionalChain([t, 'access', _1220 => _1220.authFlow, 'optionalAccess', _1221 => _1221.sendSmsCode, 'call', _1222 => _1222()])},loginWithCode:async l=>{if(K({status:"submitting-code"}),!n){let y=new _chunkXKAIXCX7js.l;throw K({status:"error",error:y}),y}if(t.authFlow instanceof cn)t.authFlow.meta.emailCode=l.trim();else if(t.authFlow instanceof dn)t.authFlow.meta.smsCode=l.trim();else{let y=new (0, _chunkXKAIXCX7js.g)("Must initialize a passwordless code flow first");throw K({status:"error",error:y}),y}await pe();let p,m;if(J.current==="link")try{({user:p}=await t.link())}catch(y){throw K({status:"error",error:y}),_chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onError",y.privyErrorCode||"failed_to_link_account",{linkMethod:G.current}),y}else try{({user:p,isNewUser:m}=await t.authenticate())}catch(y){throw K({status:"error",error:y}),_chunkLEABMTNMjs.H.call(void 0, M,"login","onError",y.privyErrorCode||"unknown_auth_error"),y}d(p||c||null),A(m||!1),s(!0),K({status:"done"})},generateSiweMessage:async({address:l,chainId:p,captchaToken:m})=>{J.current="link",G.current="siwe";let y=await t.generateSiweNonce({address:l,captchaToken:m}),b=p.replace("eip155:","");return ec({address:l,chainId:b,nonce:y})},linkSmartWallet:async({message:l,signature:p,smartWalletType:m})=>{J.current=null,G.current=null;let y;try{y=await t.linkSmartWallet({message:l,signature:p,smartWalletType:m}),y=await _asyncNullishCoalesce(await re.refreshUser(), async () => (y))}catch(b){throw b}d(y||c||null)},linkWithSiwe:async({message:l,signature:p,chainId:m,walletClientType:y,connectorType:b})=>{let N;try{N=await t.linkWithSiwe({message:l,signature:p,chainId:m,walletClientType:y,connectorType:b}),N=await _asyncNullishCoalesce(await re.refreshUser(), async () => (N));let V=dl(N);V&&_chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onSuccess",N,"siwe",V)}catch(V){throw _chunkLEABMTNMjs.H.call(void 0, M,"linkAccount","onError",V.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),J.current=null,G.current=null,V}d(N||c||null),J.current=null,G.current=null},refreshUser:async()=>{let l=await t.getAuthenticatedUser();return s(!!l),d(l),l},walletProxy:W,createAnalyticsEvent:({eventName:l,payload:p,timestamp:m})=>t.createAnalyticsEvent({eventName:l,payload:p,timestamp:m}),acceptTerms:async()=>{let l=await t.acceptTerms();return d(l),l},getUsdTokenPrice:l=>t.getUsdTokenPrice(l),getUsdPriceForSol:()=>t.getUsdPriceForSol(),recoverEmbeddedEthereumWallet:async l=>new Promise(async(p,m)=>{let y=_chunkLEABMTNMjs.v.call(void 0, _nullishCoalesce(_optionalChain([l, 'optionalAccess', _1223 => _1223.user]), () => (c)))||_chunkLEABMTNMjs.y.call(void 0, _nullishCoalesce(_optionalChain([l, 'optionalAccess', _1224 => _1224.user]), () => (c))),b=await pe();if(!b||!W||!y){m(new Error("Must have valid access token and Privy wallet to recover wallet"));return}he(!0);try{await W.connect({accessToken:b,address:y.address}),p(!0)}catch(N){if(ha(N)&&y.recoveryMethod==="privy")t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:y.address}}),(await W.recover({address:y.address,accessToken:b,recoveryMethod:y.recoveryMethod})).address||m(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:y.address}}),p(!0);else if(ha(N)&&y.recoveryMethod!=="privy"){Y({recoverWallet:{privyWallet:y,onFailure:m,onSuccess:()=>p(!0)},recoveryOAuthStatus:{provider:y.recoveryMethod,action:"recover"}});let V=Nc(y.recoveryMethod);we(V)}else m(N)}}),embeddedSolanaWallet:w,createEmbeddedSolanaWallet:async()=>{he(!0);let l=await pe(),p=await re.refreshUser(),m=_chunkLEABMTNMjs.x.call(void 0, p),y=_chunkLEABMTNMjs.v.call(void 0, p);if(!p||!l)throw new (0, _chunkXKAIXCX7js.g)("User must be logged in to create a Solana wallet");if(m)throw new (0, _chunkXKAIXCX7js.g)("User already has an embedded Solana wallet.");if(y)if(y.recoveryMethod==="privy")await re.recoverEmbeddedEthereumWallet({user:p});else throw new (0, _chunkXKAIXCX7js.g)("Cannot create an embedded Solana wallet for a user with an existing Ethereum wallet with user-controlled recovery.");let b=await re.initializeWalletProxy(15e3);if(!b)throw new (0, _chunkXKAIXCX7js.g)("Unable to initialize wallet proxy");t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await b.createSolana({accessToken:l,ethereumAddress:_optionalChain([y, 'optionalAccess', _1225 => _1225.address])});let N=await re.refreshUser(),V=_chunkLEABMTNMjs.x.call(void 0, N);if(!V)throw new (0, _chunkXKAIXCX7js.g)("Could not get Solana wallet for user");return t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:V.address}}),V}catch(N){throw t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new (0, _chunkXKAIXCX7js.g)("Failed to create Solana embedded wallet with error ",N)}},exportSolanaWallet:l=>new Promise(async(p,m)=>{if(!i||!c){m(new Error("User must be authenticated before exporting their Privy wallet"));return}let y=_optionalChain([l, 'optionalAccess', _1226 => _1226.address]),b=c.linkedAccounts.filter(oe=>oe.type==="wallet"&&oe.walletClientType==="privy"&&oe.chainType==="solana"),N=y?b.find(oe=>oe.address.toLowerCase()===y.toLowerCase()):b.find(oe=>!oe.imported)||b[0];if(!N){m(new Error("Must have a Privy wallet before exporting"));return}if(he(!0),!await pe()||!W){m(new Error("Must have valid access token to enroll in MFA"));return}if(!W){m(new Error("Must have a Privy wallet before exporting"));return}await re.recoverEmbeddedSolanaWallet();let q={appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,wallet:N,onSuccess:p,onFailure:m};Y({keyExport:q}),we("EMBEDDED_WALLET_KEY_EXPORT_SCREEN")}),recoverEmbeddedSolanaWallet:async()=>new Promise(async(l,p)=>{let m=_chunkLEABMTNMjs.x.call(void 0, c),y=await pe();if(!y||!W||!m){p(new Error("Must have valid access token and Privy wallet to recover wallet"));return}he(!0);try{await W.connectSolana({accessToken:y,publicKey:m.address}),l(!0)}catch(b){ha(b)&&m.recoveryMethod==="privy"?(t.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:m.address}}),(await W.recoverSolana({publicKey:m.address,accessToken:y})).publicKey||p(new Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_solana_wallet_recovery_completed",payload:{walletAddress:m.address}}),l(!0)):p(b)}}),getMoonpaySignedUrl:cp,initCoinbaseOnRamp:t.initCoinbaseOnRamp.bind(t),getCoinbaseOnRampStatus:t.getCoinbaseOnRampStatus.bind(t),setReadyToTrue:l=>{a(!0),_optionalChain([ke, 'optionalCall', _1227 => _1227(l)])},updateWallets:()=>cl(),fundWallet:async(l,p)=>{if(!L.fundingConfig||L.fundingConfig.methods.length===0)throw new Error("Wallet funding is not enabled");let m=op({fundingMethods:L.fundingConfig.methods});Y({funding:em({address:l,appConfig:L,fundWalletConfig:p,methodScreen:m})}),we(m)},requestFarcasterSignerStatus:async l=>{let p=await pe(),m=_optionalChain([c, 'optionalAccess', _1228 => _1228.linkedAccounts, 'access', _1229 => _1229.find, 'call', _1230 => _1230(b=>b.type==="wallet"&&b.walletClientType==="privy")]);if(!p)throw new Error("Must have valid access token to connect with Farcaster");if(!W||!m)throw new Error("Must have an embedded wallet to use Farcaster signers");if(!_optionalChain([c, 'optionalAccess', _1231 => _1231.farcaster, 'optionalAccess', _1232 => _1232.fid]))throw new Error("Must have Farcaster account to use Farcaster signers");let y=await t.requestFarcasterSignerStatus(l);if(y.status==="approved"){let b=await t.getAuthenticatedUser();d(b||c||null)}return y},connectCoinbaseSmartWallet:async()=>{L.externalWallets.coinbaseWallet.connectionOptions="smartWalletOnly";let l=_optionalChain([t, 'access', _1233 => _1233.connectors, 'optionalAccess', _1234 => _1234.findWalletConnector, 'call', _1235 => _1235("coinbase_wallet","coinbase_smart_wallet")])||_optionalChain([t, 'access', _1236 => _1236.connectors, 'optionalAccess', _1237 => _1237.findWalletConnector, 'call', _1238 => _1238("coinbase_wallet","coinbase_wallet")]);if(l)return l.updateConnectionPreference("smartWalletOnly"),Pt(l);await _e("coinbase_wallet","coinbase_smart_wallet")}}))();I0=re.recoverEmbeddedEthereumWallet,W0=re.recoverEmbeddedSolanaWallet,L0=re.solanaSignMessage;let vm=_react.useMemo.call(void 0, ()=>({wallets:u,ready:Ge&&le}),[u,Ge,le]);return _jsxruntime.jsx.call(void 0, _chunkXKAIXCX7js.sa.Provider,{value:Ua,children:_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.F.Provider,{value:M,children:_jsxruntime.jsx.call(void 0, _chunkXKAIXCX7js.ua.Provider,{value:vm,children:_jsxruntime.jsx.call(void 0, Vh,{...L,children:_jsxruntime.jsxs.call(void 0, _chunkXKAIXCX7js.qa.Provider,{value:re,children:[_jsxruntime.jsx.call(void 0, _chunkLEABMTNMjs.O,{children:_jsxruntime.jsxs.call(void 0, _chunk3AGMJGHJjs.a,{data:$,setModalData:Y,setInitialScreen:P,initialScreen:T,authenticated:i,open:r,children:[e.children,!L.headless&&L.captchaEnabled&&n&&!i&&_jsxruntime.jsx.call(void 0, _p,{delayedExecution:!1}),_jsxruntime.jsx.call(void 0, l0,{theme:{...L.appearance.palette||{}}}),!L.render.standalone&&_jsxruntime.jsx.call(void 0, pm,{open:r})]})}),xe&&Q?_jsxruntime.jsx.call(void 0, E0,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:_optionalChain([c, 'optionalAccess', _1239 => _1239.mfaMethods]),mfaPromise:Ee,mfaSubmitPromise:ue,onLoad:X,onLoadFailed:()=>null}):null,L.loginConfig.telegramAuthConfiguration&&_jsxruntime.jsx.call(void 0, so,{if:!0,children:_jsxruntime.jsx.call(void 0, v0,{scriptHost:e.apiUrl||_chunkXKAIXCX7js.p,botUsername:L.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};var uA=e=>{_chunkLEABMTNMjs.G.call(void 0, "login",e);let t=Pe(),r=_chunkXKAIXCX7js.pa.call(void 0, ),{initLoginWithHeadlessOAuth:o,loginWithHeadlessOAuth:n,isHeadlessOAuthLoading:a,ready:i,user:s}=_chunkXKAIXCX7js.ta.call(void 0, ),c=_react.useCallback.call(void 0, async u=>{if(t.enabled&&t.status!=="success")throw new Qt(t.error,null,"captcha_failure");return o(u.provider,t.token)},[o,t]),d=_react.useCallback.call(void 0, async()=>{let u=ss();if(s)return console.warn("Cannot login with OAuth when already logged in"),s;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(f){throw f}finally{ta()}},[n]);return _react.useEffect.call(void 0, ()=>{let u=ss();i&&r&&u.inProgress&&u.headless&&!u.popupFlow&&d()},[i,r]),{initOAuth:c,loginWithOAuth:d,loading:a}};var mA=()=>{let e=Pe(),{initLoginWithEmail:t,loginWithCode:r}=_chunkXKAIXCX7js.ra.call(void 0, ),o=_react.useCallback.call(void 0, async({email:a})=>{if(!a)throw new Error("Email required to send OTP code");if(e.enabled&&e.status==="error")throw new Qt(e.error,null,"captcha_failure");let i;return e.enabled&&e.status!=="success"&&(e.execute(),i=await e.waitForResult()),t(a,i)},[t]),n=_react.useCallback.call(void 0, async({code:a})=>{if(e.enabled&&e.status==="error")throw new Qt(e.error,null,"captcha_failure");return r(a)},[r,e.status]);return{sendCode:o,loginWithCode:n}};var fA=()=>{let e=Pe(),{otpState:t}=_chunkXKAIXCX7js.ta.call(void 0, ),{initLoginWithSms:r,loginWithCode:o}=_chunkXKAIXCX7js.ra.call(void 0, ),n=_react.useCallback.call(void 0, async({phoneNumber:i})=>{if(!i)throw new Error("SMS required to send OTP code");if(e.enabled&&e.status==="error")throw new Qt(e.error,null,"captcha_failure");let s;return e.enabled&&e.status!=="success"&&(e.execute(),s=await e.waitForResult()),r(i,s)},[r]),a=_react.useCallback.call(void 0, async({code:i})=>{if(e.enabled&&e.status!=="success")throw new Qt(e.error,null,"captcha_failure");return o(i)},[o,e.status]);return{sendCode:n,loginWithCode:a,state:t}};var hA=()=>{let e=Pe(),{generateSiweMessage:t,linkWithSiwe:r}=_chunkXKAIXCX7js.ta.call(void 0, ),o=_react.useCallback.call(void 0, async({address:a,chainId:i})=>{if(!a||!i)throw new Error("wallet address and chainId required to generate nonce");return t({address:a,chainId:i}).then(s=>s)},[t]),n=_react.useCallback.call(void 0, async({signature:a,message:i,chainId:s,walletClientType:c,connectorType:d})=>{if(e.enabled&&e.status!=="success")throw new Qt(e.error,null,"captcha_failure");return r({message:i,signature:a,chainId:s,walletClientType:c,connectorType:d})},[r,e.status]);return{generateSiweMessage:o,linkWithSiwe:n}};function gA(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:a,linkTwitter:i,linkDiscord:s,linkGithub:c,linkLinkedIn:d,linkTiktok:u,linkSpotify:f,linkInstagram:h,linkTelegram:g,linkFarcaster:w}=_react.useContext.call(void 0, _chunkXKAIXCX7js.sa);return _chunkLEABMTNMjs.G.call(void 0, "linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:n,linkApple:a,linkTwitter:i,linkDiscord:s,linkGithub:c,linkLinkedIn:d,linkTiktok:u,linkSpotify:f,linkInstagram:h,linkFarcaster:w,linkTelegram:g}}function vA(e){let{createWallet:t}=_react.useContext.call(void 0, _chunkXKAIXCX7js.sa);return _chunkLEABMTNMjs.G.call(void 0, "createWallet",e),{createWallet:t}}var wA=()=>{let{embeddedSolanaWallet:e,exportSolanaWallet:t,createEmbeddedSolanaWallet:r,solanaWallets:o}=_chunkXKAIXCX7js.ra.call(void 0, );return{createWallet:r,exportWallet:t,wallets:o.concat(e?[e]:[])}};var bA=()=>{let{connectCoinbaseSmartWallet:e}=_chunkXKAIXCX7js.ra.call(void 0, );return{connectCoinbaseSmartWallet:e}};var EA=()=>{let{startCrossAppAuthFlow:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:n}=_chunkXKAIXCX7js.ta.call(void 0, );return{loginWithCrossAppAccount:({appId:a})=>e({appId:a,action:"login"}),linkCrossAppAccount:({appId:a})=>e({appId:a,action:"link"}),unlinkCrossAppAccount:t,signMessage:r,signTypedData:o,sendTransaction:n}};function SA(e){let{sendTransaction:t}=_react.useContext.call(void 0, _chunkXKAIXCX7js.sa);return _chunkLEABMTNMjs.G.call(void 0, "sendTransaction",e),{sendTransaction:t}}function AA(e){let{sendSolanaTransaction:t}=_react.useContext.call(void 0, _chunkXKAIXCX7js.sa);return _chunkLEABMTNMjs.G.call(void 0, "sendSolanaTransaction",e),{sendSolanaTransaction:t}}function kA(e){let{setWalletPassword:t}=_react.useContext.call(void 0, _chunkXKAIXCX7js.sa);return _chunkLEABMTNMjs.G.call(void 0, "setWalletPassword",e),{setWalletPassword:t}}function _A(){let{createGuestAccount:e}=_react.useContext.call(void 0, _chunkXKAIXCX7js.sa);return{createGuestAccount:e}}function IA(e){let{setWalletRecovery:t}=_react.useContext.call(void 0, _chunkXKAIXCX7js.sa);return _chunkLEABMTNMjs.G.call(void 0, "setWalletRecovery",e),{setWalletRecovery:t}}function LA(e){let{signMessage:t}=_react.useContext.call(void 0, _chunkXKAIXCX7js.sa);return _chunkLEABMTNMjs.G.call(void 0, "signMessage",e),{signMessage:t}}function NA(e){let{signTypedData:t}=_react.useContext.call(void 0, _chunkXKAIXCX7js.sa);return _chunkLEABMTNMjs.G.call(void 0, "signTypedData",e),{signTypedData:t}}var UA=()=>{let{isModalOpen:e}=_react.useContext.call(void 0, _chunkXKAIXCX7js.sa);return{isOpen:e}};function BA(e){let{getAccessToken:t}=_react.useContext.call(void 0, _chunkXKAIXCX7js.sa);return _chunkLEABMTNMjs.G.call(void 0, "accessToken",e),{getAccessToken:t}}function HA(e){let{authenticated:t,user:r}=_chunkXKAIXCX7js.ta.call(void 0, ),{initLoginWithOAuth:o}=_chunkXKAIXCX7js.ra.call(void 0, ),n=_chunkLEABMTNMjs.I.call(void 0, );return _chunkLEABMTNMjs.G.call(void 0, "oAuthAuthorization",e),{reauthorize:a=>VA(t,r,o,n,a.provider)}}var VA=async(e,t,r,o,n)=>{if(!e)throw o("linkAccount","onError","must_be_authenticated",{linkMethod:n}),new (0, _chunkXKAIXCX7js.g)("User must be authenticated before linking an account.");if(!_optionalChain([t, 'optionalAccess', _1240 => _1240.linkedAccounts, 'access', _1241 => _1241.some, 'call', _1242 => _1242(i=>i.type.includes(n))]))throw new (0, _chunkXKAIXCX7js.g)(`OAuth account of type ${n} not linked to the account.`);await r(n)};var GA=e=>{let{customAuthStatus:t}=_chunkXKAIXCX7js.ra.call(void 0, );return _chunkLEABMTNMjs.G.call(void 0, "customAuth",e),{status:t}};var qA=F0;function F0(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=_chunkXKAIXCX7js.ta.call(void 0, );return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}exports.a = aa; exports.b = rt; exports.c = To; exports.d = lr; exports.e = Lh; exports.f = us; exports.g = ms; exports.h = _p; exports.i = Mp; exports.j = ya; exports.k = ga; exports.l = Jp; exports.m = Ks; exports.n = fo; exports.o = pm; exports.p = pe; exports.q = cA; exports.r = uA; exports.s = mA; exports.t = fA; exports.u = hA; exports.v = gA; exports.w = vA; exports.x = wA; exports.y = bA; exports.z = EA; exports.A = SA; exports.B = AA; exports.C = kA; exports.D = _A; exports.E = IA; exports.F = LA; exports.G = NA; exports.H = UA; exports.I = BA; exports.J = HA; exports.K = GA; exports.L = qA; exports.M = F0;