@privy-io/react-auth 2.6.0 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/cjs/abstract-smart-wallets.js +1 -1
  2. package/dist/cjs/{importWallet-D3s13-Ir.js → importWallet-CqIkwxB-.js} +1 -1
  3. package/dist/cjs/index.js +4 -4
  4. package/dist/cjs/{prepareFundingModalData-CT2XWfw3.js → prepareFundingModalData-BCNQSbXb.js} +1 -1
  5. package/dist/cjs/{smart-wallets-BggeovZV.js → smart-wallets-BJE1oUqH.js} +1 -1
  6. package/dist/cjs/smart-wallets.js +1 -1
  7. package/dist/cjs/solana.js +1 -1
  8. package/dist/cjs/ui.js +1 -1
  9. package/dist/cjs/{useActiveWallet-mT7IempW.js → useActiveWallet-CLPPplpC.js} +4 -4
  10. package/dist/cjs/{useFundWallet-C1OiqVXT.js → useFundWallet-BLEO3WzQ.js} +1 -1
  11. package/dist/cjs/{useWallets-qEcpULZl.js → useWallets-Dmyb5a0t.js} +1 -1
  12. package/dist/dts/index.d.mts +2 -1
  13. package/dist/dts/index.d.ts +2 -1
  14. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  15. package/dist/esm/{importWallet-Db-TmI57.mjs → importWallet-CJLTGjPg.mjs} +1 -1
  16. package/dist/esm/index.mjs +21 -21
  17. package/dist/esm/{prepareFundingModalData-kNpmfOTp.mjs → prepareFundingModalData-due26ueW.mjs} +1 -1
  18. package/dist/esm/{smart-wallets-BF48FIHR.mjs → smart-wallets-dP5AzE1-.mjs} +1 -1
  19. package/dist/esm/smart-wallets.mjs +1 -1
  20. package/dist/esm/solana.mjs +1 -1
  21. package/dist/esm/ui.mjs +1 -1
  22. package/dist/esm/{useActiveWallet-C89-c9e3.mjs → useActiveWallet-C8nSK6cE.mjs} +3 -3
  23. package/dist/esm/{useFundWallet-DYXHQOzn.mjs → useFundWallet-DR5oafbj.mjs} +1 -1
  24. package/dist/esm/{useWallets-DhD2VeRF.mjs → useWallets-DTpjk5Rk.mjs} +1 -1
  25. package/package.json +2 -2
@@ -1 +1 @@
1
- import{getAddress as e}from"viem/utils";import{jsx as t,jsxs as a}from"react/jsx-runtime";import{useState as i,useMemo as r,useEffect as n,useContext as l,createContext as s,useRef as o}from"react";import c from"tinycolor2";import{n as p}from"./internal-context-mSHyF0Gq.mjs";const d="https://auth.privy.io",u=2e4,E=1400,m=2500,h=4e3,_="2.6.0",f="privy:token",y="privy-token",A="privy:refresh_token",g="privy-refresh-token",C="privy:pat",b="privy:id_token",N="privy-id-token",S="privy-session",T="privy:caid",v=e=>`privy:guest:${e}`,w=e=>`privy:cross-app:${e}`,k="privy:state_code",L="privy:code_verifier",O="privy:headless_oauth",R="privy:oauth_disable_signup",I=e=>`privy:wallet:${e}`,D="privy:connectors",W="privy:connections",M=12e4,U=1,P="0x1",x=3e4,F="https://api.moonpay.com/v1",G="https://api.moonpay.com/v1",H="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",B="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",V="deprecated";function j(e){return e?new Date(1e3*e):null}function K(e,t){return e.slice().sort(((e,t)=>(e.firstVerifiedAt??e.verifiedAt).getTime()-(t.firstVerifiedAt??t.verifiedAt).getTime())).find((e=>e.type===t))}const Y=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType&&0===e.walletIndex))||null,z=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType)),q=e=>z(e).reduce(((e,t)=>!e||e.walletIndex<t.walletIndex?t:e),null),$=(e,t)=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.chainType===t)),X=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"solana"===e.chainType)),Z=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"solana"===e.chainType&&0===e.walletIndex))||null,J=e=>X(e).reduce(((e,t)=>!e||e.walletIndex<t.walletIndex?t:e),null),Q=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType))||null,ee=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&e.imported&&"privy"===e.walletClientType&&"solana"===e.chainType))||null,te=(e,t)=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.address===t))||null,ae=e=>Y(e)??Z(e),ie=e=>{if("ethereum"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier"};if("solana"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"solana-address-verifier"};throw Error("Failed to get account entropy details")},re=e=>{let t=ae(e);if(!t)throw Error("Failed to find primary wallet");return ie(t)},ne=(t,a)=>{let i=$(t,"ethereum").find((t=>e(t.address)===e(a)));return{signingWallet:i,rootWallet:i?i.imported?i:Y(t):void 0}},le=(e,t)=>{let a=$(e,"solana").find((e=>e.address===t));return a?a.imported||0===a.walletIndex?{signingWallet:a,rootWallet:a}:{signingWallet:a,rootWallet:Z(e)}:{}};function se(e){if(!e)return null;let t=function(e){let t=[];for(let a of e){let e=a.type;switch(a.type){case"wallet":let i={id:a.id,address:a.address,type:a.type,imported:a.imported,delegated:a.delegated,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at),chainType:a.chain_type,walletClientType:a.wallet_client_type,connectorType:a.connector_type,recoveryMethod:a.recovery_method,walletIndex:a.wallet_index};t.push(i);break;case"smart_wallet":let r={address:a.address,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at),smartWalletType:a.smart_wallet_type};t.push(r);break;case"cross_app":let n={type:a.type,subject:a.subject,embeddedWallets:a.embedded_wallets,smartWallets:a.smart_wallets,providerApp:{id:a.provider_app_id},verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(n);break;case"email":let l={address:a.address,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(l);break;case"phone":let s={number:a.phoneNumber,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(s);break;case"google_oauth":let o={subject:a.subject,email:a.email,name:a.name,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(o);break;case"spotify_oauth":let c={subject:a.subject,email:a.email,name:a.name,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(c);break;case"instagram_oauth":let p={subject:a.subject,username:a.username,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(p);break;case"twitter_oauth":let d={subject:a.subject,username:a.username,name:a.name,type:a.type,profilePictureUrl:a.profile_picture_url,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(d);break;case"discord_oauth":let u={subject:a.subject,username:a.username,email:a.email,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(u);break;case"github_oauth":let E={subject:a.subject,username:a.username,name:a.name,email:a.email,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(E);break;case"tiktok_oauth":let m={subject:a.subject,username:a.username,name:a.name,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(m);break;case"linkedin_oauth":let h={subject:a.subject,name:a.name,email:a.email,vanityName:a.vanity_name,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(h);break;case"apple_oauth":let _={subject:a.subject,email:a.email,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(_);break;case"custom_auth":t.push({type:a.type,customUserId:a.custom_user_id,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)});break;case"farcaster":let f={type:a.type,fid:a.fid,ownerAddress:a.owner_address,displayName:a.display_name,username:a.username,bio:a.bio,pfp:a.profile_picture_url,url:a.homepage_url,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at),signerPublicKey:a.signer_public_key};t.push(f);break;case"passkey":let y={type:a.type,enrolledInMfa:a.enrolled_in_mfa,credentialId:a.credential_id,authenticatorName:a.authenticator_name,createdWithDevice:a.created_with_device,createdWithOs:a.created_with_os,createdWithBrowser:a.created_with_browser,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(y);break;case"telegram":let A={type:a.type,telegramUserId:a.telegram_user_id,firstName:a.first_name,lastName:a.last_name,username:a.username,photoUrl:a.photo_url,verifiedAt:j(a.first_verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(A);break;case"signer":let g={type:a.type,publicKey:a.public_key,verifiedAt:j(a.first_verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(g);break;default:console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return t}(e.linked_accounts),a=K(t,"wallet"),i=K(t,"smart_wallet"),r=K(t,"email"),n=K(t,"phone"),l=K(t,"google_oauth"),s=K(t,"twitter_oauth"),o=K(t,"discord_oauth"),c=K(t,"github_oauth"),p=K(t,"spotify_oauth"),d=K(t,"instagram_oauth"),u=K(t,"tiktok_oauth"),E=K(t,"linkedin_oauth"),m=K(t,"apple_oauth"),h=K(t,"farcaster"),_=K(t,"telegram"),f=e.mfa_methods.map((({type:e,verified_at:t})=>({type:e,verifiedAt:j(t)})));return{id:e.id,createdAt:j(e.created_at),linkedAccounts:t,email:r&&{address:r?.address},phone:n&&{number:n?.number},wallet:a&&{id:a.id,address:a.address,chainType:a.chainType,walletClientType:a.walletClientType,connectorType:a.connectorType,recoveryMethod:a.recoveryMethod,imported:a.imported,delegated:a.delegated,walletIndex:a.walletIndex},smartWallet:i&&{address:i.address,smartWalletType:i.smartWalletType},google:l&&{subject:l.subject,email:l.email,name:l.name},twitter:s&&{subject:s.subject,username:s.username,name:s.name,profilePictureUrl:s.profilePictureUrl},discord:o&&{subject:o.subject,username:o.username,email:o.email},github:c&&{subject:c.subject,username:c.username,name:c.name,email:c.email},spotify:p&&{subject:p.subject,email:p.email,name:p.name},instagram:d&&{subject:d.subject,username:d.username},tiktok:u&&{subject:u.subject,username:u.username,name:u.name},linkedin:E&&{subject:E.subject,name:E.name,email:E.email,vanityName:E.vanityName},apple:m&&{subject:m.subject,email:m.email},farcaster:h&&{fid:h.fid,ownerAddress:h.ownerAddress,displayName:h.displayName,username:h.username,bio:h.bio,pfp:h.pfp,url:h.url,signerPublicKey:h.signerPublicKey},telegram:_&&{telegramUserId:_.telegramUserId,firstName:_.firstName,lastName:_.lastName,username:_.username,photoUrl:_.photoUrl},delegatedWallets:[],mfaMethods:f.map((e=>e.type)),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}}const oe={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},ce={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},pe={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},de={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},ue={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},Ee={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},me={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},he={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},_e={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},fe={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},ye={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},Ae={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},ge={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},Ce={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},be={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},Ne=[oe,ce,Ce,_e,fe,ye,Ae,ge,me,{id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},{id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},{id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},ue,Ee,{id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},{id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},he,{id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},pe,de,be,{id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},{id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},{id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},{id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},{id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}}],Se=new Set(Ne.map((e=>e.id)));function Te({src:e,...a}){/*#__PURE__*/return t("img",{src:e,...a,style:{display:"none"}})}const ve={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",externalWallets:{coinbaseWallet:{connectionOptions:"all"}},embeddedWallets:{extendedCalldataDecoding:!1},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let we=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","ronin_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe","solflare","backpack"]),ke=e=>we.has(e),Le=(e,t,a)=>a.indexOf(e)===t;const Oe=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(ke).filter(Le):e?e.filter(ke).filter(Le):ve.appearance.walletList;function Re(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function Ie(e){let t=e.filter((e=>!Se.has(e.id)));return Ne.concat(t)}function De(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}const We=792703809,Me="11111111111111111111111111111111",Ue="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";function Pe(e){return e.includes("testnet")?"testnet":e.includes("devnet")?"devnet":"mainnet-beta"}function xe(e,t){return`https://explorer.solana.com/tx/${e}?cluster=${t}`}function Fe(e,t){return`https://explorer.solana.com/account/${e}?cluster=${t}`}function Ge({name:e,rpcUrl:t}){if(t)return t;switch(e){case"mainnet-beta":return"https://api.mainnet-beta.solana.com";case"testnet":return"https://api.testnet.solana.com";case"devnet":return"https://api.devnet.solana.com"}}let He="#FFFFFF";function Be(e,t){let a=Math.max(0,Math.min(1,e.toHsl().l+t));return c({...e.toHsl(),l:a})}function Ve({backgroundTheme:e,accentHex:t}){let a;switch(e){case"light":a=He;break;case"dark":a="#1E1E1D";break;default:a=e}let i=c(a),r=c(t),n=c("#51BA81"),l=c("#FFB74D"),s=c("#EC6351"),o=function(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}(i.getLuminance()),p=Be(i,"light"===o?-.04:.11),d=Be(i,"light"===o?-.08:.16),u=Be(i,"light"===o?-.88:.87),E=Be(i,"light"===o?-.7:.75),m=Be(i,"light"===o?-.43:.45).desaturate("light"===o?60:20),h=Be(i,"light"===o?-.08:.25).desaturate("light"===o?60:20),_=Be(r,.15),f=Be(r,.25),y=Be(r,-.06),A=Be(r,-.6),g=Be(s,.3),C=Be(l,.3),b=c(r.getLuminance()>.5?"#040217":He),N=Be(n,-.16),S=Be(n,.4);return{colorScheme:o,background:i.toHslString(),background2:p.toHslString(),background3:d.toHslString(),foreground:u.toHslString(),foreground2:E.toHslString(),foreground3:m.toHslString(),foreground4:h.toHslString(),accent:r.toHslString(),accentLight:_.toHslString(),accentLightest:f.toHslString(),accentDark:y.toHslString(),accentDarkest:A.toHslString(),foregroundAccent:b.toHslString(),success:n.toHslString(),successDark:N.toHslString(),successLight:S.toHslString(),error:s.toHslString(),errorLight:g.toHslString(),warn:l.toHslString(),warnLight:C.toHslString()}}function je(e,t,a,i){let r,n,l,s,o,c,p,d,u,E,m,h,_,f,y,A=a?console.warn:()=>{};t?.loginMethods?(r=t.loginMethods.includes("email"),n=t.loginMethods.includes("sms"),s=t.loginMethods.includes("wallet"),o=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),E=t.loginMethods.includes("instagram"),d=t.loginMethods.includes("tiktok"),h=t.loginMethods.includes("github"),m=t.loginMethods.includes("linkedin"),_=t.loginMethods.includes("apple"),f=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram"),l=t.loginMethods.includes("passkey")):(r=e.emailAuth,n=e.smsAuth,s=e.walletAuth||e.solanaWalletAuth,o=e.googleOAuth,c=e.twitterOAuth,p=e.discordOAuth,h=e.githubOAuth,u=e.spotifyOAuth,E=e.instagramOAuth,d=e.tiktokOAuth,m=e.linkedinOAuth,_=e.appleOAuth,f=e.farcasterAuth,y=e.telegramAuth,l=e.passkeyAuth),e.passkeyAuth&&(l=!0),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential&&(l=!1);let g=[r,n].filter(Boolean),C=[o,c,p,h,u,E,d,m,_,f,y].filter(Boolean),b=[s].filter(Boolean),N=t?.loginMethods?.includes("passkey")??!1,S=e.passkeysForSignupEnabled??!1,T=[l&&(S||N)].filter(Boolean);if(g.length+C.length+b.length+T.length===0)throw Error("You must enable at least one login method");let v=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;v&&0===b.length?(A("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),v=!1):v||C.length+g.length!==0||(A("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),v=!0);let w=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&A("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let k=Oe({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),L=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],a=[];for(let a of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(a)?console.warn(`Duplicated login method: ${a}`):t.push(a);for(let i of e.overflow??[])t.includes(i)||a.includes(i)?console.warn(`Duplicated login method: ${i}`):a.push(i);return{primary:t,overflow:a}})({input:t?.loginMethodsAndOrder}),O=t?.intl?.defaultCountry??"US",{chains:R,defaultChain:I}=function({supportedChains:e,defaultChainFromConfig:t}){let a;if(e){if(0===e.length)throw Error("`supportedChains` must contain at least one chain");a=e.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=Ne.find((t=>t.id===e.id)),a=t?.rpcUrls.privy?.http[0];return a?De(e,a):e}))}else a=[...Ne];let i=e?a[0]:_e,r=t??i;if(!a.find((e=>e.id===r.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:a,defaultChain:r}}({supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain}),D=!!t?.defaultChain,W=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,M=t?.embeddedWallets?.requireUserPasswordOnCreate,U=t?.embeddedWallets?.createOnLogin,P=W?"all-users":e.embeddedWalletConfig.ethereum.createOnLogin,x=e.embeddedWalletConfig.solana.createOnLogin,F=t?.solanaClusters??[];return e.solanaWalletAuth&&!t?.externalWallets?.solana?.connectors&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`"),{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??ve.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,footerLogo:t?.appearance?.footerLogo,palette:Ve({backgroundTheme:t?.appearance?.theme??ve.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??ve.appearance.accentColor}),loginGroupPriority:v?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:k,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.walletAuth??!1,solanaWalletAuth:e.solanaWalletAuth??!1})},loginMethods:{wallet:s,email:r,sms:n,passkey:l,google:o,twitter:c,discord:p,github:h,spotify:u,instagram:E,tiktok:d,linkedin:m,apple:_,farcaster:f,telegram:y},disablePlusEmails:e.disablePlusEmails,loginMethodsAndOrder:L,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??ve.walletConnectCloudProjectId,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},chains:R,solanaClusters:{"mainnet-beta":F.find((e=>"mainnet-beta"===e.name))?.rpcUrl||"https://api.mainnet-beta.solana.com",testnet:F.find((e=>"testnet"===e.name))?.rpcUrl||"https://api.testnet.solana.com",devnet:F.find((e=>"devnet"===e.name))?.rpcUrl||"https://api.devnet.solana.com"},defaultChain:I,intl:{defaultCountry:O},shouldEnforceDefaultChainOnConnect:D,captchaEnabled:e.captchaEnabled??ve.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??ve.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:w},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{requireUserOwnedRecoveryOnCreate:M??(!W&&e.embeddedWalletConfig.requireUserOwnedRecoveryOnCreate),userOwnedRecoveryOptions:W?["user-passcode"]:e.embeddedWalletConfig.userOwnedRecoveryOptions,priceDisplay:t?.embeddedWallets?.priceDisplay??{primary:"fiat-currency",secondary:"native-token"},ethereum:{createOnLogin:U??t?.embeddedWallets?.ethereum?.createOnLogin??P},solana:{createOnLogin:t?.embeddedWallets?.solana?.createOnLogin??x},showWalletUIs:t?.embeddedWallets?.showWalletUIs??e.enforceWalletUis??!0,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding??!1,transactionScanning:{enabled:t?.embeddedWallets?.transactionScanning?.enabled??!1,domain:t?.embeddedWallets?.transactionScanning?.domain??i??"https://auth.privy.io"}},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},passkeys:{shouldUnlinkOnUnenrollMfa:t?.passkeys?.shouldUnlinkOnUnenrollMfa,shouldUnenrollMfaOnUnlink:t?.passkeys?.shouldUnenrollMfaOnUnlink},customAuth:W?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration,passkeysForSignupEnabled:e.passkeysForSignupEnabled},headless:!!t?.headless,render:{standalone:t?._render?.standalone??ve._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??ve.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??ve.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??ve.fundingMethodConfig.moonpay.useSandbox}}}}let Ke={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,disablePlusEmails:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{ethereum:{createOnLogin:"off"},solana:{createOnLogin:"off"},requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:"",enforceWalletUis:!1,legacyWalletUiConfig:!1};const Ye=je(Ke,void 0,!1);let ze=/*#__PURE__*/s({appConfig:Ye,isServerConfigLoaded:!1});const qe=({children:e,client:a,clientConfig:l})=>{let[s,o]=i(null),c=r((()=>je(s??Ke,l,!!s,"undefined"!=typeof window?window.location.origin:void 0)),[s,l]);return n((()=>{if(!s)return;let e=function(e){if(!e)return{};let{appearance:t,supportedChains:a,defaultChain:i,externalWallets:r,...n}=e;return{...n,...a?{supportedChains:a.map((e=>e.id))}:void 0,...i?{defaultChain:i.id}:void 0,...r?{walletConnect:r.walletConnect,coinbaseWallet:r.coinbaseWallet,solana:{connectors:r.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0}}(l),t=function(e,t=0){let a=3735928559^t,i=1103547991^t;for(let t,r=0;r<e.length;r++)a=Math.imul(a^(t=e.charCodeAt(r)),2654435761),i=Math.imul(i^t,1597334677);return a=Math.imul(a^a>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),4294967296*(2097151&(i=Math.imul(i^i>>>16,2246822507)^Math.imul(a^a>>>13,3266489909)))+(a>>>0)}(JSON.stringify(e)).toString(),i=`privy:sent:${s.id}:${t}`;localStorage.getItem(i)||(a.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(i,"t"))}),[l,s]),n((()=>{s||(async()=>{try{let e=await a.getServerConfig();e.customApiUrl&&a.updateApiUrl(e.customApiUrl),o(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),/*#__PURE__*/t(ze.Provider,{value:{appConfig:c,isServerConfigLoaded:!!s},children:e})},$e=()=>{let{appConfig:e}=l(ze);return e},Xe=()=>{let{isServerConfigLoaded:e}=l(ze);return e};var Ze,Je=((Ze={}).LANDING="LANDING",Ze.CONNECT_OR_CREATE="CONNECT_OR_CREATE",Ze.AWAITING_CONNECTION="AWAITING_CONNECTION",Ze.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",Ze.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",Ze.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",Ze.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",Ze.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",Ze.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",Ze.SELECT_PASSKEY_SIGNUP_OR_LOGIN="SELECT_PASSKEY_SIGNUP_OR_LOGIN",Ze.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",Ze.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",Ze.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",Ze.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",Ze.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",Ze.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",Ze.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",Ze.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",Ze.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",Ze.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",Ze.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",Ze.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",Ze.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",Ze.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",Ze.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",Ze.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",Ze.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",Ze.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",Ze.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",Ze.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",Ze.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",Ze.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",Ze.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",Ze.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",Ze.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",Ze.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",Ze.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",Ze.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",Ze.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN",Ze.INSTALL_WALLET_SCREEN="INSTALL_WALLET_SCREEN",Ze.WALLET_INTERSTITIAL_SCREEN="WALLET_INTERSTITIAL_SCREEN",Ze.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",Ze.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",Ze.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",Ze.FUNDING_EDIT_AMOUNT_SCREEN="FUNDING_EDIT_AMOUNT_SCREEN",Ze.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",Ze.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN",Ze.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN="FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN",Ze.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN="FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN",Ze.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",Ze.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",Ze.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",Ze.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",Ze.CAPTCHA_SCREEN="CAPTCHA_SCREEN",Ze.ERROR_SCREEN="ERROR_SCREEN",Ze.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",Ze.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",Ze.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN",Ze);const Qe=/*#__PURE__*/s({ready:!1,app:Ye,currentScreen:null,lastScreen:null,navigate:p,navigateBack:p,resetNavigation:p,setModalData:p,onUserCloseViaDialogOrKeybindRef:void 0});let et=[Je.LANDING,Je.CONNECT_ONLY_LANDING_SCREEN,null];const tt=e=>{let r=$e(),l=e.authenticated,[s,c]=i(e.initialScreen);n((()=>{l||et.includes(e.initialScreen)||e.setInitialScreen(null)}),[l]);let p=o(null);n((()=>{e.open||(p.current=null)}),[e.open]),n((()=>{p.current=null}),[e.initialScreen]);let d={ready:!!r.id,app:r,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:s,navigate:(t,a=!0)=>{e.setInitialScreen(t),a&&c(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(s)},resetNavigation:()=>{e.setInitialScreen(null),c(null)},onUserCloseViaDialogOrKeybindRef:p};/*#__PURE__*/return a(Qe.Provider,{value:d,children:[("string"==typeof r.appearance.logo||"img"===r.appearance.logo?.type)&&/*#__PURE__*/t(Te,{src:"string"==typeof r.appearance.logo?r.appearance.logo:r.appearance.logo.props.src}),e.children]})},at=()=>l(Qe),it=/*#__PURE__*/s({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:p,login:p,connectOrCreateWallet:p,linkEmail:p,linkPhone:p,linkFarcaster:p,linkWallet:p,startCrossAppAuthFlow:p,linkGoogle:p,linkTwitter:p,linkDiscord:p,linkGithub:p,linkSpotify:p,linkInstagram:p,linkTelegram:p,linkTiktok:p,linkLinkedIn:p,linkApple:p,linkPasskey:p,updateEmail:p,updatePhone:p,logout:p,getAccessToken:p,unlinkEmail:p,unlinkPhone:p,unlinkWallet:p,unlinkGoogle:p,unlinkTwitter:p,unlinkDiscord:p,unlinkGithub:p,unlinkSpotify:p,unlinkInstagram:p,unlinkTiktok:p,unlinkLinkedIn:p,unlinkApple:p,unlinkCrossAppAccount:p,unlinkFarcaster:p,unlinkTelegram:p,unlinkPasskey:p,createWallet:p,signMessage:p,signTypedData:p,enrollInMfa:p,initEnrollmentWithSms:p,initEnrollmentWithTotp:p,initEnrollmentWithPasskey:p,promptMfa:p,init:p,submitEnrollmentWithSms:p,submitEnrollmentWithTotp:p,submitEnrollmentWithPasskey:p,unenroll:p,submit:p,cancel:p,sendTransaction:p,signTransaction:p,exportWallet:p,setWalletPassword:p,setWalletRecovery:p,requestFarcasterSignerFromWarpcast:p,getFarcasterSignerPublicKey:p,signFarcasterMessage:p,createGuestAccount:p,signMessageWithCrossAppWallet:p,signTypedDataWithCrossAppWallet:p,sendTransactionWithCrossAppWallet:p,isModalOpen:!1,mfaMethods:[]}),rt=()=>l(it),nt=/*#__PURE__*/s(null);function lt(){let e=l(nt);return null===e?(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1}):e}export{ee as $,U as A,Pe as B,L as C,Se as D,lt as E,We as F,Me as G,O as H,b as I,h as J,Ge as K,Ue as L,Je as M,_e as N,R as O,C as P,ue as Q,A as R,k as S,fe as T,Ae as U,_ as V,x as W,oe as X,it as Y,Fe as Z,xe as _,M as a,le as a0,qe as a1,Xe as a2,X as a3,z as a4,Q as a5,q as a6,ne as a7,nt as a8,tt as a9,J as aa,re as ab,Ne as ac,Re as ad,De as ae,I as af,P as ag,pe as ah,me as ai,he as aj,be as ak,G as al,F as am,B as an,H as ao,Ce as ap,ye as aq,ge as ar,Ee as as,de as at,ce as au,D as b,ie as c,W as d,f as e,w as f,v as g,S as h,V as i,se as j,y as k,g as l,N as m,d as n,u as o,T as p,$e as q,rt as r,E as s,m as t,at as u,te as v,Y as w,Z as x,ae as y,Ie as z};
1
+ import{getAddress as e}from"viem/utils";import{jsx as t,jsxs as a}from"react/jsx-runtime";import{useState as i,useMemo as r,useEffect as n,useContext as l,createContext as s,useRef as o}from"react";import c from"tinycolor2";import{n as p}from"./internal-context-mSHyF0Gq.mjs";const d="https://auth.privy.io",u=2e4,E=1400,m=2500,h=4e3,_="2.6.1",f="privy:token",y="privy-token",A="privy:refresh_token",g="privy-refresh-token",C="privy:pat",b="privy:id_token",N="privy-id-token",S="privy-session",T="privy:caid",v=e=>`privy:guest:${e}`,w=e=>`privy:cross-app:${e}`,k="privy:state_code",L="privy:code_verifier",O="privy:headless_oauth",R="privy:oauth_disable_signup",I=e=>`privy:wallet:${e}`,D="privy:connectors",W="privy:connections",M=12e4,U=1,P="0x1",x=3e4,F="https://api.moonpay.com/v1",G="https://api.moonpay.com/v1",H="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",B="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",V="deprecated";function j(e){return e?new Date(1e3*e):null}function K(e,t){return e.slice().sort(((e,t)=>(e.firstVerifiedAt??e.verifiedAt).getTime()-(t.firstVerifiedAt??t.verifiedAt).getTime())).find((e=>e.type===t))}const Y=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType&&0===e.walletIndex))||null,z=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType)),q=e=>z(e).reduce(((e,t)=>!e||e.walletIndex<t.walletIndex?t:e),null),$=(e,t)=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.chainType===t)),X=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"solana"===e.chainType)),Z=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"solana"===e.chainType&&0===e.walletIndex))||null,J=e=>X(e).reduce(((e,t)=>!e||e.walletIndex<t.walletIndex?t:e),null),Q=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType))||null,ee=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&e.imported&&"privy"===e.walletClientType&&"solana"===e.chainType))||null,te=(e,t)=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.address===t))||null,ae=e=>Y(e)??Z(e),ie=e=>{if("ethereum"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier"};if("solana"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"solana-address-verifier"};throw Error("Failed to get account entropy details")},re=e=>{let t=ae(e);if(!t)throw Error("Failed to find primary wallet");return ie(t)},ne=(t,a)=>{let i=$(t,"ethereum").find((t=>e(t.address)===e(a)));return{signingWallet:i,rootWallet:i?i.imported?i:Y(t):void 0}},le=(e,t)=>{let a=$(e,"solana").find((e=>e.address===t));return a?a.imported||0===a.walletIndex?{signingWallet:a,rootWallet:a}:{signingWallet:a,rootWallet:Z(e)}:{}};function se(e){if(!e)return null;let t=function(e){let t=[];for(let a of e){let e=a.type;switch(a.type){case"wallet":let i={id:a.id,address:a.address,type:a.type,imported:a.imported,delegated:a.delegated,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at),chainType:a.chain_type,walletClientType:a.wallet_client_type,connectorType:a.connector_type,recoveryMethod:a.recovery_method,walletIndex:a.wallet_index};t.push(i);break;case"smart_wallet":let r={address:a.address,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at),smartWalletType:a.smart_wallet_type};t.push(r);break;case"cross_app":let n={type:a.type,subject:a.subject,embeddedWallets:a.embedded_wallets,smartWallets:a.smart_wallets,providerApp:{id:a.provider_app_id},verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(n);break;case"email":let l={address:a.address,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(l);break;case"phone":let s={number:a.phoneNumber,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(s);break;case"google_oauth":let o={subject:a.subject,email:a.email,name:a.name,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(o);break;case"spotify_oauth":let c={subject:a.subject,email:a.email,name:a.name,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(c);break;case"instagram_oauth":let p={subject:a.subject,username:a.username,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(p);break;case"twitter_oauth":let d={subject:a.subject,username:a.username,name:a.name,type:a.type,profilePictureUrl:a.profile_picture_url,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(d);break;case"discord_oauth":let u={subject:a.subject,username:a.username,email:a.email,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(u);break;case"github_oauth":let E={subject:a.subject,username:a.username,name:a.name,email:a.email,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(E);break;case"tiktok_oauth":let m={subject:a.subject,username:a.username,name:a.name,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(m);break;case"linkedin_oauth":let h={subject:a.subject,name:a.name,email:a.email,vanityName:a.vanity_name,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(h);break;case"apple_oauth":let _={subject:a.subject,email:a.email,type:a.type,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(_);break;case"custom_auth":t.push({type:a.type,customUserId:a.custom_user_id,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)});break;case"farcaster":let f={type:a.type,fid:a.fid,ownerAddress:a.owner_address,displayName:a.display_name,username:a.username,bio:a.bio,pfp:a.profile_picture_url,url:a.homepage_url,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at),signerPublicKey:a.signer_public_key};t.push(f);break;case"passkey":let y={type:a.type,enrolledInMfa:a.enrolled_in_mfa,credentialId:a.credential_id,authenticatorName:a.authenticator_name,createdWithDevice:a.created_with_device,createdWithOs:a.created_with_os,createdWithBrowser:a.created_with_browser,verifiedAt:j(a.verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(y);break;case"telegram":let A={type:a.type,telegramUserId:a.telegram_user_id,firstName:a.first_name,lastName:a.last_name,username:a.username,photoUrl:a.photo_url,verifiedAt:j(a.first_verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(A);break;case"signer":let g={type:a.type,publicKey:a.public_key,verifiedAt:j(a.first_verified_at),firstVerifiedAt:j(a.first_verified_at),latestVerifiedAt:j(a.latest_verified_at)};t.push(g);break;default:console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return t}(e.linked_accounts),a=K(t,"wallet"),i=K(t,"smart_wallet"),r=K(t,"email"),n=K(t,"phone"),l=K(t,"google_oauth"),s=K(t,"twitter_oauth"),o=K(t,"discord_oauth"),c=K(t,"github_oauth"),p=K(t,"spotify_oauth"),d=K(t,"instagram_oauth"),u=K(t,"tiktok_oauth"),E=K(t,"linkedin_oauth"),m=K(t,"apple_oauth"),h=K(t,"farcaster"),_=K(t,"telegram"),f=e.mfa_methods.map((({type:e,verified_at:t})=>({type:e,verifiedAt:j(t)})));return{id:e.id,createdAt:j(e.created_at),linkedAccounts:t,email:r&&{address:r?.address},phone:n&&{number:n?.number},wallet:a&&{id:a.id,address:a.address,chainType:a.chainType,walletClientType:a.walletClientType,connectorType:a.connectorType,recoveryMethod:a.recoveryMethod,imported:a.imported,delegated:a.delegated,walletIndex:a.walletIndex},smartWallet:i&&{address:i.address,smartWalletType:i.smartWalletType},google:l&&{subject:l.subject,email:l.email,name:l.name},twitter:s&&{subject:s.subject,username:s.username,name:s.name,profilePictureUrl:s.profilePictureUrl},discord:o&&{subject:o.subject,username:o.username,email:o.email},github:c&&{subject:c.subject,username:c.username,name:c.name,email:c.email},spotify:p&&{subject:p.subject,email:p.email,name:p.name},instagram:d&&{subject:d.subject,username:d.username},tiktok:u&&{subject:u.subject,username:u.username,name:u.name},linkedin:E&&{subject:E.subject,name:E.name,email:E.email,vanityName:E.vanityName},apple:m&&{subject:m.subject,email:m.email},farcaster:h&&{fid:h.fid,ownerAddress:h.ownerAddress,displayName:h.displayName,username:h.username,bio:h.bio,pfp:h.pfp,url:h.url,signerPublicKey:h.signerPublicKey},telegram:_&&{telegramUserId:_.telegramUserId,firstName:_.firstName,lastName:_.lastName,username:_.username,photoUrl:_.photoUrl},delegatedWallets:[],mfaMethods:f.map((e=>e.type)),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}}const oe={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},ce={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},pe={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},de={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},ue={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},Ee={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},me={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},he={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},_e={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},fe={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},ye={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},Ae={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},ge={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},Ce={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},be={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},Ne=[oe,ce,Ce,_e,fe,ye,Ae,ge,me,{id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},{id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},{id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},ue,Ee,{id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},{id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},he,{id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},pe,de,be,{id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},{id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},{id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},{id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},{id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}}],Se=new Set(Ne.map((e=>e.id)));function Te({src:e,...a}){/*#__PURE__*/return t("img",{src:e,...a,style:{display:"none"}})}const ve={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",externalWallets:{coinbaseWallet:{connectionOptions:"all"}},embeddedWallets:{extendedCalldataDecoding:!1},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let we=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","ronin_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe","solflare","backpack"]),ke=e=>we.has(e),Le=(e,t,a)=>a.indexOf(e)===t;const Oe=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(ke).filter(Le):e?e.filter(ke).filter(Le):ve.appearance.walletList;function Re(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function Ie(e){let t=e.filter((e=>!Se.has(e.id)));return Ne.concat(t)}function De(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}const We=792703809,Me="11111111111111111111111111111111",Ue="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";function Pe(e){return e.includes("testnet")?"testnet":e.includes("devnet")?"devnet":"mainnet-beta"}function xe(e,t){return`https://explorer.solana.com/tx/${e}?cluster=${t}`}function Fe(e,t){return`https://explorer.solana.com/account/${e}?cluster=${t}`}function Ge({name:e,rpcUrl:t}){if(t)return t;switch(e){case"mainnet-beta":return"https://api.mainnet-beta.solana.com";case"testnet":return"https://api.testnet.solana.com";case"devnet":return"https://api.devnet.solana.com"}}let He="#FFFFFF";function Be(e,t){let a=Math.max(0,Math.min(1,e.toHsl().l+t));return c({...e.toHsl(),l:a})}function Ve({backgroundTheme:e,accentHex:t}){let a;switch(e){case"light":a=He;break;case"dark":a="#1E1E1D";break;default:a=e}let i=c(a),r=c(t),n=c("#51BA81"),l=c("#FFB74D"),s=c("#EC6351"),o=function(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}(i.getLuminance()),p=Be(i,"light"===o?-.04:.11),d=Be(i,"light"===o?-.08:.16),u=Be(i,"light"===o?-.88:.87),E=Be(i,"light"===o?-.7:.75),m=Be(i,"light"===o?-.43:.45).desaturate("light"===o?60:20),h=Be(i,"light"===o?-.08:.25).desaturate("light"===o?60:20),_=Be(r,.15),f=Be(r,.25),y=Be(r,-.06),A=Be(r,-.6),g=Be(s,.3),C=Be(l,.3),b=c(r.getLuminance()>.5?"#040217":He),N=Be(n,-.16),S=Be(n,.4);return{colorScheme:o,background:i.toHslString(),background2:p.toHslString(),background3:d.toHslString(),foreground:u.toHslString(),foreground2:E.toHslString(),foreground3:m.toHslString(),foreground4:h.toHslString(),accent:r.toHslString(),accentLight:_.toHslString(),accentLightest:f.toHslString(),accentDark:y.toHslString(),accentDarkest:A.toHslString(),foregroundAccent:b.toHslString(),success:n.toHslString(),successDark:N.toHslString(),successLight:S.toHslString(),error:s.toHslString(),errorLight:g.toHslString(),warn:l.toHslString(),warnLight:C.toHslString()}}function je(e,t,a,i){let r,n,l,s,o,c,p,d,u,E,m,h,_,f,y,A=a?console.warn:()=>{};t?.loginMethods?(r=t.loginMethods.includes("email"),n=t.loginMethods.includes("sms"),s=t.loginMethods.includes("wallet"),o=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),E=t.loginMethods.includes("instagram"),d=t.loginMethods.includes("tiktok"),h=t.loginMethods.includes("github"),m=t.loginMethods.includes("linkedin"),_=t.loginMethods.includes("apple"),f=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram"),l=t.loginMethods.includes("passkey")):(r=e.emailAuth,n=e.smsAuth,s=e.walletAuth||e.solanaWalletAuth,o=e.googleOAuth,c=e.twitterOAuth,p=e.discordOAuth,h=e.githubOAuth,u=e.spotifyOAuth,E=e.instagramOAuth,d=e.tiktokOAuth,m=e.linkedinOAuth,_=e.appleOAuth,f=e.farcasterAuth,y=e.telegramAuth,l=e.passkeyAuth),e.passkeyAuth&&(l=!0),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential&&(l=!1);let g=[r,n].filter(Boolean),C=[o,c,p,h,u,E,d,m,_,f,y].filter(Boolean),b=[s].filter(Boolean),N=t?.loginMethods?.includes("passkey")??!1,S=e.passkeysForSignupEnabled??!1,T=[l&&(S||N)].filter(Boolean);if(g.length+C.length+b.length+T.length===0)throw Error("You must enable at least one login method");let v=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;v&&0===b.length?(A("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),v=!1):v||C.length+g.length!==0||(A("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),v=!0);let w=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&A("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let k=Oe({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),L=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],a=[];for(let a of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(a)?console.warn(`Duplicated login method: ${a}`):t.push(a);for(let i of e.overflow??[])t.includes(i)||a.includes(i)?console.warn(`Duplicated login method: ${i}`):a.push(i);return{primary:t,overflow:a}})({input:t?.loginMethodsAndOrder}),O=t?.intl?.defaultCountry??"US",{chains:R,defaultChain:I}=function({supportedChains:e,defaultChainFromConfig:t}){let a;if(e){if(0===e.length)throw Error("`supportedChains` must contain at least one chain");a=e.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=Ne.find((t=>t.id===e.id)),a=t?.rpcUrls.privy?.http[0];return a?De(e,a):e}))}else a=[...Ne];let i=e?a[0]:_e,r=t??i;if(!a.find((e=>e.id===r.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:a,defaultChain:r}}({supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain}),D=!!t?.defaultChain,W=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,M=t?.embeddedWallets?.requireUserPasswordOnCreate,U=t?.embeddedWallets?.createOnLogin,P=W?"all-users":e.embeddedWalletConfig.ethereum.createOnLogin,x=e.embeddedWalletConfig.solana.createOnLogin,F=t?.solanaClusters??[];return e.solanaWalletAuth&&!t?.externalWallets?.solana?.connectors&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`"),{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??ve.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,footerLogo:t?.appearance?.footerLogo,palette:Ve({backgroundTheme:t?.appearance?.theme??ve.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??ve.appearance.accentColor}),loginGroupPriority:v?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:k,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.walletAuth??!1,solanaWalletAuth:e.solanaWalletAuth??!1})},loginMethods:{wallet:s,email:r,sms:n,passkey:l,google:o,twitter:c,discord:p,github:h,spotify:u,instagram:E,tiktok:d,linkedin:m,apple:_,farcaster:f,telegram:y},disablePlusEmails:e.disablePlusEmails,loginMethodsAndOrder:L,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??ve.walletConnectCloudProjectId,rpcConfig:{rpcUrls:{},rpcTimeouts:{}},chains:R,solanaClusters:{"mainnet-beta":F.find((e=>"mainnet-beta"===e.name))?.rpcUrl||"https://api.mainnet-beta.solana.com",testnet:F.find((e=>"testnet"===e.name))?.rpcUrl||"https://api.testnet.solana.com",devnet:F.find((e=>"devnet"===e.name))?.rpcUrl||"https://api.devnet.solana.com"},defaultChain:I,intl:{defaultCountry:O},shouldEnforceDefaultChainOnConnect:D,captchaEnabled:e.captchaEnabled??ve.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??ve.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:w},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{requireUserOwnedRecoveryOnCreate:M??(!W&&e.embeddedWalletConfig.requireUserOwnedRecoveryOnCreate),userOwnedRecoveryOptions:W?["user-passcode"]:e.embeddedWalletConfig.userOwnedRecoveryOptions,priceDisplay:t?.embeddedWallets?.priceDisplay??{primary:"fiat-currency",secondary:"native-token"},ethereum:{createOnLogin:U??t?.embeddedWallets?.ethereum?.createOnLogin??P},solana:{createOnLogin:t?.embeddedWallets?.solana?.createOnLogin??x},showWalletUIs:t?.embeddedWallets?.showWalletUIs??e.enforceWalletUis??!0,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding??!1,transactionScanning:{enabled:t?.embeddedWallets?.transactionScanning?.enabled??!1,domain:t?.embeddedWallets?.transactionScanning?.domain??i??"https://auth.privy.io"}},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},passkeys:{shouldUnlinkOnUnenrollMfa:t?.passkeys?.shouldUnlinkOnUnenrollMfa,shouldUnenrollMfaOnUnlink:t?.passkeys?.shouldUnenrollMfaOnUnlink},customAuth:W?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration,passkeysForSignupEnabled:e.passkeysForSignupEnabled},headless:!!t?.headless,render:{standalone:t?._render?.standalone??ve._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??ve.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??ve.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??ve.fundingMethodConfig.moonpay.useSandbox}}}}let Ke={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,disablePlusEmails:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{ethereum:{createOnLogin:"off"},solana:{createOnLogin:"off"},requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:"",enforceWalletUis:!1,legacyWalletUiConfig:!1};const Ye=je(Ke,void 0,!1);let ze=/*#__PURE__*/s({appConfig:Ye,isServerConfigLoaded:!1});const qe=({children:e,client:a,clientConfig:l})=>{let[s,o]=i(null),c=r((()=>je(s??Ke,l,!!s,"undefined"!=typeof window?window.location.origin:void 0)),[s,l]);return n((()=>{if(!s)return;let e=function(e){if(!e)return{};let{appearance:t,supportedChains:a,defaultChain:i,externalWallets:r,...n}=e;return{...n,...a?{supportedChains:a.map((e=>e.id))}:void 0,...i?{defaultChain:i.id}:void 0,...r?{walletConnect:r.walletConnect,coinbaseWallet:r.coinbaseWallet,solana:{connectors:r.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0}}(l),t=function(e,t=0){let a=3735928559^t,i=1103547991^t;for(let t,r=0;r<e.length;r++)a=Math.imul(a^(t=e.charCodeAt(r)),2654435761),i=Math.imul(i^t,1597334677);return a=Math.imul(a^a>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),4294967296*(2097151&(i=Math.imul(i^i>>>16,2246822507)^Math.imul(a^a>>>13,3266489909)))+(a>>>0)}(JSON.stringify(e)).toString(),i=`privy:sent:${s.id}:${t}`;localStorage.getItem(i)||(a.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(i,"t"))}),[l,s]),n((()=>{s||(async()=>{try{let e=await a.getServerConfig();e.customApiUrl&&a.updateApiUrl(e.customApiUrl),o(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),/*#__PURE__*/t(ze.Provider,{value:{appConfig:c,isServerConfigLoaded:!!s},children:e})},$e=()=>{let{appConfig:e}=l(ze);return e},Xe=()=>{let{isServerConfigLoaded:e}=l(ze);return e};var Ze,Je=((Ze={}).LANDING="LANDING",Ze.CONNECT_OR_CREATE="CONNECT_OR_CREATE",Ze.AWAITING_CONNECTION="AWAITING_CONNECTION",Ze.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",Ze.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",Ze.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",Ze.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",Ze.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",Ze.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",Ze.SELECT_PASSKEY_SIGNUP_OR_LOGIN="SELECT_PASSKEY_SIGNUP_OR_LOGIN",Ze.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",Ze.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",Ze.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",Ze.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",Ze.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",Ze.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",Ze.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",Ze.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",Ze.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",Ze.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",Ze.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",Ze.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",Ze.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",Ze.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",Ze.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",Ze.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",Ze.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",Ze.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",Ze.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",Ze.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",Ze.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",Ze.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",Ze.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",Ze.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",Ze.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",Ze.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",Ze.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",Ze.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",Ze.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN",Ze.INSTALL_WALLET_SCREEN="INSTALL_WALLET_SCREEN",Ze.WALLET_INTERSTITIAL_SCREEN="WALLET_INTERSTITIAL_SCREEN",Ze.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",Ze.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",Ze.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",Ze.FUNDING_EDIT_AMOUNT_SCREEN="FUNDING_EDIT_AMOUNT_SCREEN",Ze.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",Ze.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN",Ze.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN="FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN",Ze.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN="FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN",Ze.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",Ze.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",Ze.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",Ze.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",Ze.CAPTCHA_SCREEN="CAPTCHA_SCREEN",Ze.ERROR_SCREEN="ERROR_SCREEN",Ze.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",Ze.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",Ze.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN",Ze);const Qe=/*#__PURE__*/s({ready:!1,app:Ye,currentScreen:null,lastScreen:null,navigate:p,navigateBack:p,resetNavigation:p,setModalData:p,onUserCloseViaDialogOrKeybindRef:void 0});let et=[Je.LANDING,Je.CONNECT_ONLY_LANDING_SCREEN,null];const tt=e=>{let r=$e(),l=e.authenticated,[s,c]=i(e.initialScreen);n((()=>{l||et.includes(e.initialScreen)||e.setInitialScreen(null)}),[l]);let p=o(null);n((()=>{e.open||(p.current=null)}),[e.open]),n((()=>{p.current=null}),[e.initialScreen]);let d={ready:!!r.id,app:r,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:s,navigate:(t,a=!0)=>{e.setInitialScreen(t),a&&c(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(s)},resetNavigation:()=>{e.setInitialScreen(null),c(null)},onUserCloseViaDialogOrKeybindRef:p};/*#__PURE__*/return a(Qe.Provider,{value:d,children:[("string"==typeof r.appearance.logo||"img"===r.appearance.logo?.type)&&/*#__PURE__*/t(Te,{src:"string"==typeof r.appearance.logo?r.appearance.logo:r.appearance.logo.props.src}),e.children]})},at=()=>l(Qe),it=/*#__PURE__*/s({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:p,login:p,connectOrCreateWallet:p,linkEmail:p,linkPhone:p,linkFarcaster:p,linkWallet:p,startCrossAppAuthFlow:p,linkGoogle:p,linkTwitter:p,linkDiscord:p,linkGithub:p,linkSpotify:p,linkInstagram:p,linkTelegram:p,linkTiktok:p,linkLinkedIn:p,linkApple:p,linkPasskey:p,updateEmail:p,updatePhone:p,logout:p,getAccessToken:p,unlinkEmail:p,unlinkPhone:p,unlinkWallet:p,unlinkGoogle:p,unlinkTwitter:p,unlinkDiscord:p,unlinkGithub:p,unlinkSpotify:p,unlinkInstagram:p,unlinkTiktok:p,unlinkLinkedIn:p,unlinkApple:p,unlinkCrossAppAccount:p,unlinkFarcaster:p,unlinkTelegram:p,unlinkPasskey:p,createWallet:p,signMessage:p,signTypedData:p,enrollInMfa:p,initEnrollmentWithSms:p,initEnrollmentWithTotp:p,initEnrollmentWithPasskey:p,promptMfa:p,init:p,submitEnrollmentWithSms:p,submitEnrollmentWithTotp:p,submitEnrollmentWithPasskey:p,unenroll:p,submit:p,cancel:p,sendTransaction:p,signTransaction:p,exportWallet:p,setWalletPassword:p,setWalletRecovery:p,requestFarcasterSignerFromWarpcast:p,getFarcasterSignerPublicKey:p,signFarcasterMessage:p,createGuestAccount:p,signMessageWithCrossAppWallet:p,signTypedDataWithCrossAppWallet:p,sendTransactionWithCrossAppWallet:p,isModalOpen:!1,mfaMethods:[]}),rt=()=>l(it),nt=/*#__PURE__*/s(null);function lt(){let e=l(nt);return null===e?(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1}):e}export{ee as $,U as A,Pe as B,L as C,Se as D,lt as E,We as F,Me as G,O as H,b as I,h as J,Ge as K,Ue as L,Je as M,_e as N,R as O,C as P,ue as Q,A as R,k as S,fe as T,Ae as U,_ as V,x as W,oe as X,it as Y,Fe as Z,xe as _,M as a,le as a0,qe as a1,Xe as a2,X as a3,z as a4,Q as a5,q as a6,ne as a7,nt as a8,tt as a9,J as aa,re as ab,Ne as ac,Re as ad,De as ae,I as af,P as ag,pe as ah,me as ai,he as aj,be as ak,G as al,F as am,B as an,H as ao,Ce as ap,ye as aq,ge as ar,Ee as as,de as at,ce as au,D as b,ie as c,W as d,f as e,w as f,v as g,S as h,V as i,se as j,y as k,g as l,N as m,d as n,u as o,T as p,$e as q,rt as r,E as s,m as t,at as u,te as v,Y as w,Z as x,ae as y,Ie as z};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@privy-io/react-auth",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "React client for the Privy Auth API",
5
5
  "keywords": [
6
6
  "authentication",
@@ -136,7 +136,7 @@
136
136
  "@heroicons/react": "^2.1.1",
137
137
  "@marsidev/react-turnstile": "^0.4.1",
138
138
  "@metamask/eth-sig-util": "^6.0.0",
139
- "@privy-io/js-sdk-core": "0.44.4",
139
+ "@privy-io/js-sdk-core": "0.45.0",
140
140
  "@simplewebauthn/browser": "^9.0.1",
141
141
  "@solana/wallet-adapter-base": "^0.9.23",
142
142
  "@solana/wallet-standard-wallet-adapter-base": "^1.1.2",