@privy-io/react-auth 3.13.0 → 3.13.1-beta-20260202140759

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 (363) hide show
  1. package/dist/cjs/AccountNotFoundScreen-DopQJydk.js +1 -0
  2. package/dist/cjs/{Address-aEAhUJFV.js → Address-C0i_Lgxz.js} +1 -1
  3. package/dist/cjs/AffirmativeConsentScreen-DrfsiAOF.js +6 -0
  4. package/dist/cjs/AllowlistRejectionScreen-B4F7MdmW.js +1 -0
  5. package/dist/cjs/AuthenticateWithWalletScreen-BImVaE8G.js +1 -0
  6. package/dist/cjs/AwaitingEvmToSolBridgingScreen-Bld2VoQo.js +2 -0
  7. package/dist/cjs/AwaitingExternalEthereumTransferScreen-CK2PMVQH.js +2 -0
  8. package/dist/cjs/AwaitingPasswordlessCodeScreen-mc4TfLdK.js +103 -0
  9. package/dist/cjs/AwaitingSolToEvmBridgingScreen-BHTmPSzt.js +2 -0
  10. package/dist/cjs/{BridgeNetworkSelectionView-CE2o-1QO.js → BridgeNetworkSelectionView-BTW55LDI.js} +1 -1
  11. package/dist/cjs/CaptchaScreen-C4OKrOJj.js +1 -0
  12. package/dist/cjs/CoinbaseOnrampStatusScreen-DuBusEzK.js +16 -0
  13. package/dist/cjs/{ConnectEmailForm-D-TxBaE5.js → ConnectEmailForm-BAtI_Su2.js} +1 -1
  14. package/dist/cjs/ConnectLedgerScreen-Cxy5kYQy.js +9 -0
  15. package/dist/cjs/ConnectOnlyLandingScreen-UHxAPPxv.js +1 -0
  16. package/dist/cjs/ConnectOnlyStatusScreen-D7hEyOkF.js +1 -0
  17. package/dist/cjs/ConnectOrCreateScreen-DCXEsisd.js +1 -0
  18. package/dist/cjs/{ConnectPhoneForm-DK6jm19G.js → ConnectPhoneForm-IaeAlSaT.js} +1 -1
  19. package/dist/cjs/{ConnectWalletView-1cBOsYe3.js → ConnectWalletView-I7l3i_Tn.js} +1 -1
  20. package/dist/cjs/ConnectionStatusScreen-B5eG6O0t.js +7 -0
  21. package/dist/cjs/CrossAppAuthScreen-BHfk_dqk.js +1 -0
  22. package/dist/cjs/{CustomLandingScreenView-C879x5ia.js → CustomLandingScreenView-ZdAEwrj3.js} +1 -1
  23. package/dist/cjs/DelegatedActionsConsentScreen-LeQ6Lxpc.js +1 -0
  24. package/dist/cjs/DelegatedActionsRevokeScreen-C8v4E_cj.js +1 -0
  25. package/dist/cjs/EmbeddedWalletConnectingScreen-B1rrh4GO.js +1 -0
  26. package/dist/cjs/EmbeddedWalletCreatedScreen-Cem5Ix9r.js +1 -0
  27. package/dist/cjs/{EmbeddedWalletKeyExportScreen-BpjA7HGz.js → EmbeddedWalletKeyExportScreen-C9Et_UFA.js} +3 -3
  28. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-tJoXkQEs.js +1 -0
  29. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-C2wVljgA.js +1 -0
  30. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-CG1oHF6a.js +1 -0
  31. package/dist/cjs/{EnrollTotp-D1jQjLxQ.js → EnrollTotp-BveYXBKW.js} +1 -1
  32. package/dist/cjs/ErrorScreen-Ckke6sz3.js +4 -0
  33. package/dist/cjs/{FarcasterConnectStatusScreen-JBJeeu9F.js → FarcasterConnectStatusScreen-D5ziktAq.js} +3 -3
  34. package/dist/cjs/{FarcasterSignerStatusScreen-8DplKa45.js → FarcasterSignerStatusScreen-8edRjO2Y.js} +6 -6
  35. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-DJEyYpCy.js +2 -0
  36. package/dist/cjs/{FundWalletMethodHeader-CW2KubxL.js → FundWalletMethodHeader-Dyg72x32.js} +1 -1
  37. package/dist/cjs/FundingEditAmountScreen-2vgGeOzZ.js +1 -0
  38. package/dist/cjs/FundingMethodSelectionScreen-D6K2RTnb.js +1 -0
  39. package/dist/cjs/InAppBrowserLoginNotPossible-DlH26fht.js +1 -0
  40. package/dist/cjs/InstallWalletScreen-D-aty_-m.js +1 -0
  41. package/dist/cjs/LandingScreen-C3ycf-sm.js +1 -0
  42. package/dist/cjs/{LinkConflictScreen-DKkFMAqc.js → LinkConflictScreen-tpqlaHKl.js} +2 -2
  43. package/dist/cjs/LinkEmailScreen-CVJ8MM6X.js +1 -0
  44. package/dist/cjs/{LinkPasskeyScreen-D-5RrGXJ.js → LinkPasskeyScreen-BVI23any.js} +1 -1
  45. package/dist/cjs/LinkPhoneScreen-COZH83MT.js +1 -0
  46. package/dist/cjs/LoginFailedScreen-B_f3bRu3.js +1 -0
  47. package/dist/cjs/ManualTransferScreen-DCjvNWqd.js +1 -0
  48. package/dist/cjs/MfaAuthEnrollmentFlowScreen-DN4ce0UG.js +1 -0
  49. package/dist/cjs/MfaAuthVerifyFlowScreen-c-lQ_fEz.js +1 -0
  50. package/dist/cjs/MfaEnrollmentFlowScreen-B6-EB6WE.js +1 -0
  51. package/dist/cjs/MfaVerifyFlowScreen-zbdZQoq2.js +1 -0
  52. package/dist/cjs/{ModalHeader-DmWqn83H.js → ModalHeader-Cy6QK4_e.js} +1 -1
  53. package/dist/cjs/MoonpayStatusScreen-BEtRocSA.js +16 -0
  54. package/dist/cjs/OAuthStatusScreen-FvgZmHXu.js +1 -0
  55. package/dist/cjs/PasskeySelectSignupOrLogin-DqSfSR6i.js +1 -0
  56. package/dist/cjs/PasskeyStatusScreen-DvA6G4hk.js +3 -0
  57. package/dist/cjs/PasswordRecoveryScreen-Befeqrad.js +20 -0
  58. package/dist/cjs/{QrCode-BG2PX4HL.js → QrCode-DuBadwvo.js} +1 -1
  59. package/dist/cjs/RecoveryOAuthStatusScreen-C6mVwtQH.js +1 -0
  60. package/dist/cjs/RecoveryPasswordCreateScreen-DzNiXRjH.js +1 -0
  61. package/dist/cjs/{RecoverySelectionScreen-qP99_3WR.js → RecoverySelectionScreen-CjnlE9el.js} +2 -2
  62. package/dist/cjs/{Screen-BnWlRqz4.js → Screen-edUQX_SB.js} +1 -1
  63. package/dist/cjs/{ScreenLayout-8Ho-PwHJ.js → ScreenLayout-DGTvokS8.js} +1 -1
  64. package/dist/cjs/{SetAutomaticRecoveryScreen-Dw8eXtFM.js → SetAutomaticRecoveryScreen-CrRjNWxq.js} +2 -2
  65. package/dist/cjs/{SetWalletPasswordForm-BtxQiQCF.js → SetWalletPasswordForm-DJeemCn9.js} +1 -1
  66. package/dist/cjs/SignRequestScreen-DHoZ6sz5.js +26 -0
  67. package/dist/cjs/{StandardSignAndSendTransactionScreen-BRCG_Otm.js → StandardSignAndSendTransactionScreen-CBLYn4pf.js} +1 -1
  68. package/dist/cjs/TelegramAuthScreen-D7mlDw-E.js +1 -0
  69. package/dist/cjs/{TransactionDetails-CB_SFjYb.js → TransactionDetails-CXgPk3J1.js} +1 -1
  70. package/dist/cjs/{TransactionErrorView-C6AwpMpC.js → TransactionErrorView-Deibl2Uf.js} +1 -1
  71. package/dist/cjs/{TransferFromWalletScreen-DDbM2aZ-.js → TransferFromWalletScreen-DSItFmOL.js} +2 -2
  72. package/dist/cjs/{TransferOrBridgeLoadingScreen-BdFZ-kHB.js → TransferOrBridgeLoadingScreen-CZY4tSPW.js} +1 -1
  73. package/dist/cjs/UpdateEmailScreen-Bcbi12kY.js +1 -0
  74. package/dist/cjs/UpdatePhoneScreen-lJE1r_mk.js +1 -0
  75. package/dist/cjs/UserLimitReachedScreen-CKsbmhwX.js +1 -0
  76. package/dist/cjs/{WalletInfoCard-BP4plvST.js → WalletInfoCard-BPFjUGT5.js} +1 -1
  77. package/dist/cjs/WalletInterstitialScreen-C-wi9rZH.js +1 -0
  78. package/dist/cjs/{WalletLink-Be-wt7BS.js → WalletLink-DQka9Syl.js} +1 -1
  79. package/dist/cjs/{WalletOverflowButton-DNXb1rWu.js → WalletOverflowButton-CT3ToLGt.js} +1 -1
  80. package/dist/cjs/abstract-smart-wallets.js +1 -1
  81. package/dist/cjs/{context-B5x3dsBc.js → context-BgcJR59W.js} +1 -1
  82. package/dist/cjs/{ethers-CcPcMmj-.js → ethers-CUHJ8mll.js} +1 -1
  83. package/dist/cjs/extended-chains.js +1 -1
  84. package/dist/cjs/get-entropy-details-for-user-Bh25VOwU.js +1 -0
  85. package/dist/cjs/{get-is-unified-wallet-huyBqM6I.js → get-is-unified-wallet-pvisKZtt.js} +1 -1
  86. package/dist/cjs/{index-C9h5dbsX.js → index-BgLmUrL3.js} +1 -1
  87. package/dist/cjs/index-C40Nmmja.js +174 -0
  88. package/dist/cjs/{index-Ddh08VH6.js → index-Y7m6JUJT.js} +1 -1
  89. package/dist/cjs/index.js +1 -1
  90. package/dist/cjs/internal.js +1 -1
  91. package/dist/cjs/{shared-B4PQQyG9.js → shared-BrkTXSb9.js} +1 -1
  92. package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-Cwmd9p6v.js → shouldProceedtoEmbeddedWalletCreationFlow-ClGopOFu.js} +1 -1
  93. package/dist/cjs/smart-wallets-DhMgsCrP.js +1 -0
  94. package/dist/cjs/smart-wallets.js +1 -1
  95. package/dist/cjs/solana.js +1 -1
  96. package/dist/cjs/{styles-BYA0sdA8.js → styles-Dg1gwPet.js} +1 -1
  97. package/dist/cjs/{to-ui-error-kjcnhSmN.js → to-ui-error-Cj4nmAIy.js} +1 -1
  98. package/dist/cjs/ui.js +1 -1
  99. package/dist/cjs/use-export-wallet-BHqL5lkN.js +1 -0
  100. package/dist/cjs/use-export-wallet-CHdfox2p.js +1 -0
  101. package/dist/cjs/useActiveWallet-DQaSSN2M.js +185 -0
  102. package/dist/cjs/{useGetTokenPrice-XbJ2xnl_.js → useGetTokenPrice-Q-LRDLGC.js} +1 -1
  103. package/dist/cjs/{useI18n-CJec5B3S.js → useI18n-C-2tQwPP.js} +1 -1
  104. package/dist/cjs/usePrivy-DN8Ajdzm.js +1 -0
  105. package/dist/cjs/{useSolanaRpcClient-CN7MyWq4.js → useSolanaRpcClient-DAhvriV9.js} +1 -1
  106. package/dist/cjs/useWallets-DOb8xzgz.js +1 -0
  107. package/dist/dts/{events-context-CV9PiG6M.d.ts → events-context-uQF86xPo.d.mts} +1 -1
  108. package/dist/dts/{events-context-CV9PiG6M.d.mts → events-context-uQF86xPo.d.ts} +1 -1
  109. package/dist/dts/extended-chains.d.mts +1 -1
  110. package/dist/dts/extended-chains.d.ts +1 -1
  111. package/dist/dts/farcaster.d.mts +1 -1
  112. package/dist/dts/farcaster.d.ts +1 -1
  113. package/dist/dts/index.d.mts +4 -38
  114. package/dist/dts/index.d.ts +4 -38
  115. package/dist/dts/internal.d.mts +1 -1
  116. package/dist/dts/internal.d.ts +1 -1
  117. package/dist/dts/smart-wallets.d.mts +1 -1
  118. package/dist/dts/smart-wallets.d.ts +1 -1
  119. package/dist/dts/solana.d.mts +3 -3
  120. package/dist/dts/solana.d.ts +3 -3
  121. package/dist/dts/{types-xIUh0rN4.d.mts → types-DLEfLPEB.d.mts} +1 -1
  122. package/dist/dts/{types-xIUh0rN4.d.ts → types-DLEfLPEB.d.ts} +1 -1
  123. package/dist/dts/ui.d.mts +1 -1
  124. package/dist/dts/ui.d.ts +1 -1
  125. package/dist/esm/AccountNotFoundScreen-CVBAv1Mv.mjs +1 -0
  126. package/dist/esm/{Address-BuCMjci7.mjs → Address-BupZf8Rc.mjs} +1 -1
  127. package/dist/esm/AffirmativeConsentScreen-CFSY5nE4.mjs +6 -0
  128. package/dist/esm/AllowlistRejectionScreen-0Z0EYviP.mjs +1 -0
  129. package/dist/esm/AuthenticateWithWalletScreen-BdJYQ2JJ.mjs +1 -0
  130. package/dist/esm/AwaitingEvmToSolBridgingScreen-D9Ef3Dnt.mjs +2 -0
  131. package/dist/esm/AwaitingExternalEthereumTransferScreen-mj07gSaD.mjs +2 -0
  132. package/dist/esm/AwaitingPasswordlessCodeScreen-DE3g9VwQ.mjs +103 -0
  133. package/dist/esm/AwaitingSolToEvmBridgingScreen-CUKh2oVG.mjs +2 -0
  134. package/dist/esm/{BridgeNetworkSelectionView-0VRZoDMv.mjs → BridgeNetworkSelectionView-D8aRUIg2.mjs} +1 -1
  135. package/dist/esm/CaptchaScreen-Co8CjcuQ.mjs +1 -0
  136. package/dist/esm/CoinbaseOnrampStatusScreen-Da7VjKBi.mjs +16 -0
  137. package/dist/esm/ConnectEmailForm-D5UhENmm.mjs +3 -0
  138. package/dist/esm/ConnectLedgerScreen-JDfzYq9M.mjs +9 -0
  139. package/dist/esm/ConnectOnlyLandingScreen-C0j3-tOW.mjs +1 -0
  140. package/dist/esm/ConnectOnlyStatusScreen-D-gYePr8.mjs +1 -0
  141. package/dist/esm/ConnectOrCreateScreen-CqLbK7av.mjs +1 -0
  142. package/dist/esm/{ConnectPhoneForm-DMcfvHG9.mjs → ConnectPhoneForm-CQJPasTi.mjs} +1 -1
  143. package/dist/esm/{ConnectWalletView-rtAY2uds.mjs → ConnectWalletView-mIrd9fmT.mjs} +3 -3
  144. package/dist/esm/ConnectionStatusScreen-D8G_flGR.mjs +7 -0
  145. package/dist/esm/CrossAppAuthScreen-Btm1d-iO.mjs +1 -0
  146. package/dist/esm/{CustomLandingScreenView-Dt4TEi0A.mjs → CustomLandingScreenView-C2TNxHAb.mjs} +1 -1
  147. package/dist/esm/DelegatedActionsConsentScreen-DXwSOiLw.mjs +1 -0
  148. package/dist/esm/DelegatedActionsRevokeScreen-B7uTGw9J.mjs +1 -0
  149. package/dist/esm/EmbeddedWalletConnectingScreen-BioR068C.mjs +1 -0
  150. package/dist/esm/EmbeddedWalletCreatedScreen-Cq1thot_.mjs +1 -0
  151. package/dist/esm/{EmbeddedWalletKeyExportScreen-sjrAvCm3.mjs → EmbeddedWalletKeyExportScreen-CtEY8G7E.mjs} +2 -2
  152. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-ShyQ92Jq.mjs +1 -0
  153. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-qoWRlbPz.mjs +1 -0
  154. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-BeN-dpqi.mjs +1 -0
  155. package/dist/esm/{EnrollTotp-DlnMoeNk.mjs → EnrollTotp-3j3Uj3wv.mjs} +1 -1
  156. package/dist/esm/ErrorScreen-BpG9IyOu.mjs +4 -0
  157. package/dist/esm/{FarcasterConnectStatusScreen-BLgCDUxR.mjs → FarcasterConnectStatusScreen-DadPWt5w.mjs} +4 -4
  158. package/dist/esm/FarcasterSignerStatusScreen-DyJNx88F.mjs +28 -0
  159. package/dist/esm/FundSolWalletWithExternalSolanaWallet-Dhp2jhkc.mjs +1 -0
  160. package/dist/esm/{FundWalletMethodHeader-Dujd1j7J.mjs → FundWalletMethodHeader-Cyn7MCWO.mjs} +1 -1
  161. package/dist/esm/FundingEditAmountScreen-D0KCT7EC.mjs +1 -0
  162. package/dist/esm/FundingMethodSelectionScreen-CrHLwmNP.mjs +1 -0
  163. package/dist/esm/InAppBrowserLoginNotPossible-CcbdJWpW.mjs +1 -0
  164. package/dist/esm/InstallWalletScreen-0udkV09c.mjs +1 -0
  165. package/dist/esm/LandingScreen-C7xCusAZ.mjs +1 -0
  166. package/dist/esm/{LinkConflictScreen-DOsLOvpT.mjs → LinkConflictScreen-B31exGN7.mjs} +4 -4
  167. package/dist/esm/LinkEmailScreen-DZf6HS1n.mjs +1 -0
  168. package/dist/esm/{LinkPasskeyScreen-jzRj6Yq0.mjs → LinkPasskeyScreen-Bl7uzJ8Q.mjs} +7 -7
  169. package/dist/esm/LinkPhoneScreen-DUIIaqp0.mjs +1 -0
  170. package/dist/esm/LoginFailedScreen-DsSbXSXA.mjs +1 -0
  171. package/dist/esm/ManualTransferScreen-B-Kkarxd.mjs +1 -0
  172. package/dist/esm/MfaAuthEnrollmentFlowScreen-D82inQR9.mjs +1 -0
  173. package/dist/esm/MfaAuthVerifyFlowScreen-Cw5rWozq.mjs +1 -0
  174. package/dist/esm/MfaEnrollmentFlowScreen-B3F6HEAl.mjs +1 -0
  175. package/dist/esm/MfaVerifyFlowScreen-DYuvXWXh.mjs +1 -0
  176. package/dist/esm/{ModalHeader-CSfzkWxZ.mjs → ModalHeader-Byy3j4Lh.mjs} +1 -1
  177. package/dist/esm/MoonpayStatusScreen-CBtEX6lf.mjs +16 -0
  178. package/dist/esm/OAuthStatusScreen-YCUnttYA.mjs +1 -0
  179. package/dist/esm/PasskeySelectSignupOrLogin-DuXG4uXH.mjs +1 -0
  180. package/dist/esm/PasskeyStatusScreen-DPvVVoC2.mjs +3 -0
  181. package/dist/esm/PasswordRecoveryScreen-IS0ckI65.mjs +20 -0
  182. package/dist/esm/{QrCode-BkoTqsec.mjs → QrCode-lPYtXNC_.mjs} +1 -1
  183. package/dist/esm/RecoveryOAuthStatusScreen-CJO3irqx.mjs +1 -0
  184. package/dist/esm/RecoveryPasswordCreateScreen-DZb7gDAd.mjs +1 -0
  185. package/dist/esm/{RecoverySelectionScreen-0YIfrkiv.mjs → RecoverySelectionScreen-CThvVB-J.mjs} +2 -2
  186. package/dist/esm/{Screen-5StC6JLQ.mjs → Screen-Ct4Lyoaf.mjs} +1 -1
  187. package/dist/esm/{ScreenLayout-C2Le_YIv.mjs → ScreenLayout-DOt2sB2J.mjs} +1 -1
  188. package/dist/esm/{SetAutomaticRecoveryScreen-BAAv--Sk.mjs → SetAutomaticRecoveryScreen-D1IKpF6a.mjs} +2 -2
  189. package/dist/esm/{SetWalletPasswordForm-lzuYpBex.mjs → SetWalletPasswordForm-CiQmt-HX.mjs} +1 -1
  190. package/dist/esm/{SignRequestScreen-YrG-iwWX.mjs → SignRequestScreen-DKJky_Un.mjs} +2 -2
  191. package/dist/esm/{StandardSignAndSendTransactionScreen-Csw3bRQ4.mjs → StandardSignAndSendTransactionScreen-CPKZQMPj.mjs} +2 -2
  192. package/dist/esm/TelegramAuthScreen-bIm5jFOU.mjs +1 -0
  193. package/dist/esm/{TransactionDetails-BMVu0qlz.mjs → TransactionDetails-DLLlKhs7.mjs} +1 -1
  194. package/dist/esm/{TransactionErrorView-C6AZ1RC0.mjs → TransactionErrorView-CSRxuGt5.mjs} +1 -1
  195. package/dist/esm/{TransferFromWalletScreen-BOOq-OqM.mjs → TransferFromWalletScreen-ClNSdttH.mjs} +4 -4
  196. package/dist/esm/{TransferOrBridgeLoadingScreen-gM_oel5i.mjs → TransferOrBridgeLoadingScreen-rWz1yK-a.mjs} +1 -1
  197. package/dist/esm/UpdateEmailScreen-mog8U9Vt.mjs +1 -0
  198. package/dist/esm/UpdatePhoneScreen-CLLjzpN7.mjs +1 -0
  199. package/dist/esm/UserLimitReachedScreen-Baf8QzFD.mjs +1 -0
  200. package/dist/esm/{WalletInfoCard-TfOxho0A.mjs → WalletInfoCard-BWAC4Crm.mjs} +1 -1
  201. package/dist/esm/WalletInterstitialScreen-chmHYyvD.mjs +1 -0
  202. package/dist/esm/{WalletLink-CZTmkBKu.mjs → WalletLink-cm_UqBHl.mjs} +1 -1
  203. package/dist/esm/{WalletOverflowButton-C0Ysaik4.mjs → WalletOverflowButton-CoHTrzr-.mjs} +1 -1
  204. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  205. package/dist/esm/context-BEE1GR3p.mjs +1 -0
  206. package/dist/esm/{ethers-DrSqg5wi.mjs → ethers-CzVYf1X2.mjs} +1 -1
  207. package/dist/esm/extended-chains.mjs +1 -1
  208. package/dist/esm/farcaster.mjs +1 -1
  209. package/dist/esm/{frame-uzTmvtww.mjs → frame-CjhCpycO.mjs} +1 -1
  210. package/dist/esm/get-entropy-details-for-user-DXl-F6zT.mjs +1 -0
  211. package/dist/esm/{get-is-unified-wallet-GcvxyU9r.mjs → get-is-unified-wallet-szLxUazm.mjs} +1 -1
  212. package/dist/esm/{getErc20Balance-D0MGUaOw.mjs → getErc20Balance-Bs6MYMo9.mjs} +1 -1
  213. package/dist/esm/{getErc20TokenInfo-CZJTqd4c.mjs → getErc20TokenInfo-Cymy79Tp.mjs} +1 -1
  214. package/dist/esm/{getPublicClient-B4uPLKn-.mjs → getPublicClient-BltMpU4i.mjs} +1 -1
  215. package/dist/esm/{index-BXKPenEy.mjs → index-21Khs68W.mjs} +1 -1
  216. package/dist/esm/index-BXdEd5-h.mjs +174 -0
  217. package/dist/esm/{index-tsoVOGEt.mjs → index-CXuTLe54.mjs} +1 -1
  218. package/dist/esm/index.mjs +1 -1
  219. package/dist/esm/{internal-context-Z-fyxadS.mjs → internal-context-C4ZqP8IF.mjs} +1 -1
  220. package/dist/esm/internal.mjs +1 -1
  221. package/dist/esm/{paths-3HW55qZg.mjs → paths-BzM95ysC.mjs} +1 -1
  222. package/dist/esm/reservoir-CB32KXxK.mjs +1 -0
  223. package/dist/esm/{shared-CQ6jg1BO.mjs → shared-CcT7geMr.mjs} +1 -1
  224. package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-BfZwb-3N.mjs → shouldProceedtoEmbeddedWalletCreationFlow-eeAK_6M1.mjs} +1 -1
  225. package/dist/esm/smart-wallets-CHETrkmZ.mjs +1 -0
  226. package/dist/esm/smart-wallets.mjs +1 -1
  227. package/dist/esm/solana.mjs +1 -1
  228. package/dist/esm/{styles-C3H3yhVT.mjs → styles-CVcwbZBK.mjs} +1 -1
  229. package/dist/esm/{to-ui-error-fYkDcQhz.mjs → to-ui-error-CymSkIi1.mjs} +2 -2
  230. package/dist/esm/ui.mjs +1 -1
  231. package/dist/esm/use-export-wallet-BghmI1bY.mjs +1 -0
  232. package/dist/esm/use-export-wallet-DmJRcrg3.mjs +1 -0
  233. package/dist/esm/{use-sign-with-user-signer-Do5Oi_rb.mjs → use-sign-with-user-signer-BYctG7hm.mjs} +1 -1
  234. package/dist/esm/useActiveWallet-CeJ_zia0.mjs +185 -0
  235. package/dist/esm/{useGetSolPrice-DwwjjGbd.mjs → useGetSolPrice-DaxM-vxD.mjs} +1 -1
  236. package/dist/esm/{useGetTokenPrice-YObgUU6L.mjs → useGetTokenPrice-BS8CeRfC.mjs} +1 -1
  237. package/dist/esm/{useI18n-VPW2SjZN.mjs → useI18n-BWqAKjsd.mjs} +1 -1
  238. package/dist/esm/usePrivy-DZkUhG2n.mjs +1 -0
  239. package/dist/esm/{useSolanaRpcClient-BTAchFxj.mjs → useSolanaRpcClient-D-Ekw787.mjs} +1 -1
  240. package/dist/esm/{useWalletBalance-BDrbQBDX.mjs → useWalletBalance-CCG99ZD8.mjs} +1 -1
  241. package/dist/esm/useWallets-CaOutpwQ.mjs +1 -0
  242. package/package.json +1 -1
  243. package/dist/cjs/AccountNotFoundScreen-DxO5LvIc.js +0 -1
  244. package/dist/cjs/AffirmativeConsentScreen-DfJW4zFz.js +0 -6
  245. package/dist/cjs/AllowlistRejectionScreen-CP01TiLV.js +0 -1
  246. package/dist/cjs/AuthenticateWithWalletScreen-CQw1iHsK.js +0 -1
  247. package/dist/cjs/AwaitingEvmToSolBridgingScreen-BzcvlEoa.js +0 -2
  248. package/dist/cjs/AwaitingExternalEthereumTransferScreen-CF8PGODY.js +0 -2
  249. package/dist/cjs/AwaitingPasswordlessCodeScreen-BByZHkHQ.js +0 -103
  250. package/dist/cjs/AwaitingSolToEvmBridgingScreen-DcalXeu-.js +0 -2
  251. package/dist/cjs/CaptchaScreen-anNodbfx.js +0 -1
  252. package/dist/cjs/CoinbaseOnrampStatusScreen-JGw8hfLn.js +0 -16
  253. package/dist/cjs/ConnectLedgerScreen-CwS0odD_.js +0 -9
  254. package/dist/cjs/ConnectOnlyLandingScreen-fpFbLO8Y.js +0 -1
  255. package/dist/cjs/ConnectOnlyStatusScreen-DziODgdH.js +0 -1
  256. package/dist/cjs/ConnectOrCreateScreen-D-V8KzJp.js +0 -1
  257. package/dist/cjs/ConnectionStatusScreen-D4NtHDFM.js +0 -7
  258. package/dist/cjs/CrossAppAuthScreen-BtEXDc88.js +0 -1
  259. package/dist/cjs/DelegatedActionsConsentScreen-CGnSYhkE.js +0 -1
  260. package/dist/cjs/DelegatedActionsRevokeScreen-Dd8u3U62.js +0 -1
  261. package/dist/cjs/EmbeddedWalletConnectingScreen-yIHjjIR2.js +0 -1
  262. package/dist/cjs/EmbeddedWalletCreatedScreen-CouqreWe.js +0 -1
  263. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-Cv8bAxPB.js +0 -1
  264. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-roXY9Gv8.js +0 -1
  265. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-9I5OZ38V.js +0 -1
  266. package/dist/cjs/ErrorScreen-DbETfzK4.js +0 -4
  267. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-CE1VdpiY.js +0 -2
  268. package/dist/cjs/FundingEditAmountScreen-Cjzgv7Q-.js +0 -1
  269. package/dist/cjs/FundingMethodSelectionScreen-Bje3JXwS.js +0 -1
  270. package/dist/cjs/InAppBrowserLoginNotPossible-DpFXJi29.js +0 -1
  271. package/dist/cjs/InstallWalletScreen-DP80Lixb.js +0 -1
  272. package/dist/cjs/LandingScreen-B_s7VUcj.js +0 -1
  273. package/dist/cjs/LinkEmailScreen-POTKFhXp.js +0 -1
  274. package/dist/cjs/LinkPhoneScreen-RWN6_lR0.js +0 -1
  275. package/dist/cjs/LoginFailedScreen-BGq1l-h2.js +0 -1
  276. package/dist/cjs/ManualTransferScreen-S07FPGso.js +0 -1
  277. package/dist/cjs/MfaAuthEnrollmentFlowScreen-Bnb9xLgu.js +0 -1
  278. package/dist/cjs/MfaAuthVerifyFlowScreen-Bn7NxwbP.js +0 -1
  279. package/dist/cjs/MfaEnrollmentFlowScreen-DixH-nyJ.js +0 -1
  280. package/dist/cjs/MfaVerifyFlowScreen-BtjZAo_J.js +0 -1
  281. package/dist/cjs/MoonpayStatusScreen-BAgiyXOW.js +0 -16
  282. package/dist/cjs/OAuthStatusScreen-RWYIpAEG.js +0 -1
  283. package/dist/cjs/PasskeySelectSignupOrLogin-DvUcmWfj.js +0 -1
  284. package/dist/cjs/PasskeyStatusScreen-CpL_C3--.js +0 -3
  285. package/dist/cjs/PasswordRecoveryScreen-FcFRBHq1.js +0 -20
  286. package/dist/cjs/RecoveryOAuthStatusScreen-AV5BAFgZ.js +0 -1
  287. package/dist/cjs/RecoveryPasswordCreateScreen-CvtuH2mp.js +0 -1
  288. package/dist/cjs/SignRequestScreen-B5xPIK1u.js +0 -26
  289. package/dist/cjs/TelegramAuthScreen-CjTMUNYb.js +0 -1
  290. package/dist/cjs/UpdateEmailScreen-BvzkGAlB.js +0 -1
  291. package/dist/cjs/UpdatePhoneScreen-e8rAhVvP.js +0 -1
  292. package/dist/cjs/UserLimitReachedScreen-x5P5FX13.js +0 -1
  293. package/dist/cjs/WalletInterstitialScreen-DrApzB6o.js +0 -1
  294. package/dist/cjs/index-BZqehL-Z.js +0 -174
  295. package/dist/cjs/smart-wallets-xoXme78U.js +0 -1
  296. package/dist/cjs/use-export-wallet-1gw5h-6F.js +0 -1
  297. package/dist/cjs/use-export-wallet-CedJPqOx.js +0 -1
  298. package/dist/cjs/useActiveWallet-4V55N-5C.js +0 -185
  299. package/dist/cjs/usePrivy-Tr-VZh0x.js +0 -1
  300. package/dist/cjs/useWallets-By_aiK-e.js +0 -1
  301. package/dist/cjs/useWallets-Ds2FjLWj.js +0 -1
  302. package/dist/esm/AccountNotFoundScreen-DvDKQEeR.mjs +0 -1
  303. package/dist/esm/AffirmativeConsentScreen-DmjKmR3p.mjs +0 -6
  304. package/dist/esm/AllowlistRejectionScreen-Dzgqqss9.mjs +0 -1
  305. package/dist/esm/AuthenticateWithWalletScreen-DqEYmKRq.mjs +0 -1
  306. package/dist/esm/AwaitingEvmToSolBridgingScreen-mM0yFabb.mjs +0 -2
  307. package/dist/esm/AwaitingExternalEthereumTransferScreen-B8RwfC4k.mjs +0 -2
  308. package/dist/esm/AwaitingPasswordlessCodeScreen-DiwMdkl1.mjs +0 -103
  309. package/dist/esm/AwaitingSolToEvmBridgingScreen-DDjqJpxK.mjs +0 -2
  310. package/dist/esm/CaptchaScreen-DRpV5XFL.mjs +0 -1
  311. package/dist/esm/CoinbaseOnrampStatusScreen-B5SpiCFR.mjs +0 -16
  312. package/dist/esm/ConnectEmailForm-CUfcb4US.mjs +0 -3
  313. package/dist/esm/ConnectLedgerScreen-D54DrxnP.mjs +0 -9
  314. package/dist/esm/ConnectOnlyLandingScreen-Cm10LiWd.mjs +0 -1
  315. package/dist/esm/ConnectOnlyStatusScreen-Bz7rafsR.mjs +0 -1
  316. package/dist/esm/ConnectOrCreateScreen-aeQK2RJ_.mjs +0 -1
  317. package/dist/esm/ConnectionStatusScreen-_g1A1Dg2.mjs +0 -7
  318. package/dist/esm/CrossAppAuthScreen-4oQDzYzy.mjs +0 -1
  319. package/dist/esm/DelegatedActionsConsentScreen-Cj9bU7Q1.mjs +0 -1
  320. package/dist/esm/DelegatedActionsRevokeScreen-DGFRARuM.mjs +0 -1
  321. package/dist/esm/EmbeddedWalletConnectingScreen-Cmt8I8TX.mjs +0 -1
  322. package/dist/esm/EmbeddedWalletCreatedScreen-Dj_JuLO5.mjs +0 -1
  323. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-BOS_pyDI.mjs +0 -1
  324. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-DulDjFpp.mjs +0 -1
  325. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-BkwyRHPS.mjs +0 -1
  326. package/dist/esm/ErrorScreen-8UMMZ6is.mjs +0 -4
  327. package/dist/esm/FarcasterSignerStatusScreen-RHH68QtJ.mjs +0 -28
  328. package/dist/esm/FundSolWalletWithExternalSolanaWallet-DVgX3EaM.mjs +0 -1
  329. package/dist/esm/FundingEditAmountScreen-D10JPLdP.mjs +0 -1
  330. package/dist/esm/FundingMethodSelectionScreen-BuWGEgge.mjs +0 -1
  331. package/dist/esm/InAppBrowserLoginNotPossible-TigdvlfS.mjs +0 -1
  332. package/dist/esm/InstallWalletScreen-DgyXxk_4.mjs +0 -1
  333. package/dist/esm/LandingScreen-C6rQCvI5.mjs +0 -1
  334. package/dist/esm/LinkEmailScreen-C7CpFuoA.mjs +0 -1
  335. package/dist/esm/LinkPhoneScreen-BKHv_Kdp.mjs +0 -1
  336. package/dist/esm/LoginFailedScreen-CJgWFc1S.mjs +0 -1
  337. package/dist/esm/ManualTransferScreen-CFNzuajf.mjs +0 -1
  338. package/dist/esm/MfaAuthEnrollmentFlowScreen-DflCQFD5.mjs +0 -1
  339. package/dist/esm/MfaAuthVerifyFlowScreen-D0KWDrSF.mjs +0 -1
  340. package/dist/esm/MfaEnrollmentFlowScreen-B5CTxsyW.mjs +0 -1
  341. package/dist/esm/MfaVerifyFlowScreen-Bds0d6wr.mjs +0 -1
  342. package/dist/esm/MoonpayStatusScreen-BgCvITlM.mjs +0 -16
  343. package/dist/esm/OAuthStatusScreen-B9LjQopq.mjs +0 -1
  344. package/dist/esm/PasskeySelectSignupOrLogin-BH-9DnYX.mjs +0 -1
  345. package/dist/esm/PasskeyStatusScreen-B0BMf34N.mjs +0 -3
  346. package/dist/esm/PasswordRecoveryScreen-BGO3xmU6.mjs +0 -20
  347. package/dist/esm/RecoveryOAuthStatusScreen-9ngTLe_q.mjs +0 -1
  348. package/dist/esm/RecoveryPasswordCreateScreen-BDCDfQzo.mjs +0 -1
  349. package/dist/esm/TelegramAuthScreen-CXnXpJTY.mjs +0 -1
  350. package/dist/esm/UpdateEmailScreen-B4u7SqtR.mjs +0 -1
  351. package/dist/esm/UpdatePhoneScreen-Dz75pT5l.mjs +0 -1
  352. package/dist/esm/UserLimitReachedScreen-BEQAxJvA.mjs +0 -1
  353. package/dist/esm/WalletInterstitialScreen-jHLFeLvC.mjs +0 -1
  354. package/dist/esm/context-bWeWAiND.mjs +0 -1
  355. package/dist/esm/index-DEtvMjrv.mjs +0 -174
  356. package/dist/esm/reservoir-0wfhnc0j.mjs +0 -1
  357. package/dist/esm/smart-wallets-wzmiQDh1.mjs +0 -1
  358. package/dist/esm/use-export-wallet-8amsQKG9.mjs +0 -1
  359. package/dist/esm/use-export-wallet-DyNNbsJn.mjs +0 -1
  360. package/dist/esm/useActiveWallet-CSq3KvGj.mjs +0 -185
  361. package/dist/esm/usePrivy-CvOp4eQ7.mjs +0 -1
  362. package/dist/esm/useWallets-izyyA2re.mjs +0 -1
  363. package/dist/esm/useWallets-yDa5ACXD.mjs +0 -1
@@ -0,0 +1,103 @@
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import o from"@heroicons/react/20/solid/CheckIcon";import t from"@heroicons/react/24/outline/EnvelopeIcon";import i from"@heroicons/react/24/outline/PhoneIcon";import{useState as n,useEffect as a}from"react";import{isMobile as s}from"react-device-detect";import{styled as c}from"styled-components";import{H as l}from"./Layouts-BlFm53ED.mjs";import{L as d}from"./Link-DJ5gq9Di.mjs";import{u as p,q as m}from"./context-BEE1GR3p.mjs";import{u,e as f,c as v,k as h}from"./internal-context-C4ZqP8IF.mjs";import{a as y,u as g}from"./get-is-unified-wallet-szLxUazm.mjs";import{s as x}from"./shouldProceedtoEmbeddedWalletCreationFlow-eeAK_6M1.mjs";import{S as E}from"./ScreenLayout-DOt2sB2J.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./index-BXdEd5-h.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CeJ_zia0.mjs";import"zustand";import"viem/utils";import"./use-export-wallet-DmJRcrg3.mjs";import"./get-entropy-details-for-user-DXl-F6zT.mjs";import"./getPublicClient-BltMpU4i.mjs";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-DZkUhG2n.mjs";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@privy-io/popup";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./ModalHeader-Byy3j4Lh.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Ct4Lyoaf.mjs";import"./index-Dq_xe9dz.mjs";const b=({contactMethod:c,authFlow:p,appName:m="Privy",whatsAppEnabled:u=!1,onBack:f,onCodeSubmit:v,onResend:h,errorMessage:y,success:g=!1,resendCountdown:x=0,onInvalidInput:b,onClearError:w})=>{let[A,T]=n(S);a((()=>{y||T(S)}),[y]);let k=async e=>{e.preventDefault();let r=e.currentTarget.value.replace(" ","");if(""===r)return;if(isNaN(Number(r)))return void b?.("Code should be numeric");w?.();let o=Number(e.currentTarget.name?.charAt(5)),t=[...r||[""]].slice(0,C-o),i=[...A.slice(0,o),...t,...A.slice(o+t.length)];T(i);let n=Math.min(Math.max(o+t.length,0),C-1);if(!isNaN(Number(e.currentTarget.value))){let e=document.querySelector(`input[name=code-${n}]`);e?.focus()}if(i.every((e=>e&&!isNaN(+e)))){let e=document.querySelector(`input[name=code-${n}]`);e?.blur(),await(v?.(i.join("")))}};/*#__PURE__*/return e(E,{title:"Enter confirmation code",subtitle:/*#__PURE__*/r("span","email"===p?{children:["Please check ",/*#__PURE__*/e(M,{children:c})," for an email from privy.io and enter your code below."]}:{children:["Please check ",/*#__PURE__*/e(M,{children:c})," for a",u?" WhatsApp":""," message from ",m," and enter your code below."]}),icon:"email"===p?t:i,onBack:f,showBack:!0,helpText:/*#__PURE__*/r(L,{children:[/*#__PURE__*/r("span",{children:["Didn't get ","email"===p?"an email":"a message","?"]}),x?/*#__PURE__*/r(R,{children:[/*#__PURE__*/e(o,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),/*#__PURE__*/e("span",{children:"Code sent"})]}):/*#__PURE__*/e(d,{as:"button",size:"sm",onClick:h,children:"Resend code"})]}),children:/*#__PURE__*/e(_,{children:/*#__PURE__*/e(l,{children:/*#__PURE__*/r(j,{children:[/*#__PURE__*/e("div",{children:A.map(((r,o)=>/*#__PURE__*/e("input",{name:`code-${o}`,type:"text",value:A[o],onChange:k,onKeyUp:e=>{"Backspace"===e.key&&(e=>{if(w?.(),T([...A.slice(0,e),"",...A.slice(e+1)]),e>0){let r=document.querySelector(`input[name=code-${e-1}]`);r?.focus()}})(o)},inputMode:"numeric",autoFocus:0===o,pattern:"[0-9]",className:`${g?"success":""} ${y?"fail":""}`,autoComplete:s?"one-time-code":"off"},o)))}),/*#__PURE__*/e(I,{$fail:!!y,$success:g,children:/*#__PURE__*/e("span",{children:"Invalid or expired verification code"===y?"Incorrect code":y||(g?"Success!":"")})})]})})})})};let C=6,S=Array(6).fill("");var w,A,T=((w=T||{})[w.RESET_AFTER_DELAY=0]="RESET_AFTER_DELAY",w[w.CLEAR_ON_NEXT_VALID_INPUT=1]="CLEAR_ON_NEXT_VALID_INPUT",w),k=((A=k||{})[A.EMAIL=0]="EMAIL",A[A.SMS=1]="SMS",A);const N={component:()=>{let{navigate:r,lastScreen:o,navigateBack:t,setModalData:i,onUserCloseViaDialogOrKeybindRef:s}=y(),c=p(),{closePrivyModal:l,resendEmailCode:d,resendSmsCode:E,getAuthMeta:C,loginWithCode:S,updateWallets:w,createAnalyticsEvent:A}=u(),{authenticated:T,logout:k,user:N}=g(),{whatsAppEnabled:_}=p(),[j,I]=n(!1),[L,R]=n(null),[M,D]=n(null),[O,P]=n(0);s.current=()=>null;let U=C()?.email?0:1,W=0===U?C()?.email||"":C()?.phoneNumber||"",$=m-500;a((()=>{if(O){let e=setTimeout((()=>{P(O-1)}),1e3);return()=>clearTimeout(e)}}),[O]),a((()=>{if(T&&j&&N){if(c?.legal.requireUsersAcceptTerms&&!N.hasAcceptedTerms){let e=setTimeout((()=>{r("AffirmativeConsentScreen")}),$);return()=>clearTimeout(e)}if(x(N,c.embeddedWallets)){let e=setTimeout((()=>{i({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),A({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AwaitingPasswordlessCodeScreen"}}),k()},callAuthOnSuccessOnClose:!0}}),r("EmbeddedWalletOnAccountCreateScreen")}),$);return()=>clearTimeout(e)}{w();let e=setTimeout((()=>l({shouldCallAuthOnSuccess:!0,isSuccess:!0})),m);return()=>clearTimeout(e)}}}),[T,j,N]),a((()=>{if(L&&0===M){let e=setTimeout((()=>{R(null),D(null);let e=document.querySelector("input[name=code-0]");e?.focus()}),1400);return()=>clearTimeout(e)}}),[L,M]);/*#__PURE__*/return e(b,{contactMethod:W,authFlow:0===U?"email":"sms",appName:c?.name,whatsAppEnabled:_,onBack:()=>t(),onCodeSubmit:async e=>{try{await S(e),I(!0)}catch(e){if(e instanceof f&&e.privyErrorCode===v.INVALID_CREDENTIALS)R("Invalid or expired verification code"),D(0);else if(e instanceof f&&e.privyErrorCode===v.CANNOT_LINK_MORE_OF_TYPE)R(e.message);else{if(e instanceof f&&e.privyErrorCode===v.USER_LIMIT_REACHED)return console.error(new h(e).toString()),void r("UserLimitReachedScreen");if(e instanceof f&&e.privyErrorCode===v.USER_DOES_NOT_EXIST)return void r("AccountNotFoundScreen");if(e instanceof f&&e.privyErrorCode===v.LINKED_TO_ANOTHER_USER)return i({errorModalData:{error:e,previousScreen:o??"AwaitingPasswordlessCodeScreen"}}),void r("ErrorScreen",!1);if(e instanceof f&&e.privyErrorCode===v.DISALLOWED_PLUS_EMAIL)return i({inlineError:{error:e}}),void r("ConnectOrCreateScreen",!1);if(e instanceof f&&e.privyErrorCode===v.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return i({accountTransfer:{nonce:e.data?.data?.nonce,account:W,displayName:e.data?.data?.account?.displayName,linkMethod:0===U?"email":"sms",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void r("LinkConflictScreen");R("Issue verifying code"),D(0)}}},onResend:async()=>{P(30),0===U?await d():await E()},errorMessage:L||void 0,success:j,resendCountdown:O,onInvalidInput:e=>{R(e),D(1)},onClearError:()=>{1===M&&(R(null),D(null))}})}};let _=c.div`
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: center;
5
+ justify-content: center;
6
+ margin: auto;
7
+ gap: 16px;
8
+ flex-grow: 1;
9
+ width: 100%;
10
+ `,j=c.div`
11
+ display: flex;
12
+ flex-direction: column;
13
+ width: 100%;
14
+ gap: 12px;
15
+
16
+ > div:first-child {
17
+ display: flex;
18
+ justify-content: center;
19
+ gap: 0.5rem;
20
+ width: 100%;
21
+ border-radius: var(--privy-border-radius-sm);
22
+
23
+ > input {
24
+ border: 1px solid var(--privy-color-foreground-4);
25
+ background: var(--privy-color-background);
26
+ border-radius: var(--privy-border-radius-sm);
27
+ padding: 8px 10px;
28
+ height: 48px;
29
+ width: 40px;
30
+ text-align: center;
31
+ font-size: 18px;
32
+ font-weight: 600;
33
+ color: var(--privy-color-foreground);
34
+ transition: all 0.2s ease;
35
+ }
36
+
37
+ > input:focus {
38
+ border: 1px solid var(--privy-color-foreground);
39
+ box-shadow: 0 0 0 1px var(--privy-color-foreground);
40
+ }
41
+
42
+ > input:invalid {
43
+ border: 1px solid var(--privy-color-error);
44
+ }
45
+
46
+ > input.success {
47
+ border: 1px solid var(--privy-color-border-success);
48
+ background: var(--privy-color-success-bg);
49
+ }
50
+
51
+ > input.fail {
52
+ border: 1px solid var(--privy-color-border-error);
53
+ background: var(--privy-color-error-bg);
54
+ animation: shake 180ms;
55
+ animation-iteration-count: 2;
56
+ }
57
+ }
58
+
59
+ @keyframes shake {
60
+ 0% {
61
+ transform: translate(1px, 0px);
62
+ }
63
+ 33% {
64
+ transform: translate(-1px, 0px);
65
+ }
66
+ 67% {
67
+ transform: translate(-1px, 0px);
68
+ }
69
+ 100% {
70
+ transform: translate(1px, 0px);
71
+ }
72
+ }
73
+ `,I=c.div`
74
+ line-height: 20px;
75
+ min-height: 20px;
76
+ font-size: 14px;
77
+ font-weight: 400;
78
+ color: ${e=>e.$success?"var(--privy-color-success-dark)":e.$fail?"var(--privy-color-error-dark)":"transparent"};
79
+ display: flex;
80
+ justify-content: center;
81
+ width: 100%;
82
+ text-align: center;
83
+ `,L=c.div`
84
+ display: flex;
85
+ gap: 8px;
86
+ align-items: center;
87
+ justify-content: center;
88
+ width: 100%;
89
+ color: var(--privy-color-foreground-2);
90
+ `,R=c.div`
91
+ display: flex;
92
+ align-items: center;
93
+ justify-content: center;
94
+ border-radius: var(--privy-border-radius-sm);
95
+ padding: 2px 8px;
96
+ gap: 4px;
97
+ background: var(--privy-color-background-2);
98
+ color: var(--privy-color-foreground-2);
99
+ `,M=c.span`
100
+ font-weight: 500;
101
+ word-break: break-all;
102
+ color: var(--privy-color-foreground);
103
+ `;export{N as AwaitingPasswordlessCodeScreen,b as AwaitingPasswordlessCodeScreenView,N as default};
@@ -0,0 +1,2 @@
1
+ import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import r from"@heroicons/react/24/outline/CheckCircleIcon";import{useRef as o,useState as a,useMemo as i,useEffect as s}from"react";import{parseEther as l}from"viem";import{ConnectedStandardSolanaWallet as c}from"@privy-io/js-sdk-core";import{b as d,c as m,R as u}from"./Layouts-BlFm53ED.mjs";import{B as p}from"./ModalHeader-Byy3j4Lh.mjs";import{C as f}from"./ScreenHeader-CHmc4-Lu.mjs";import{t as h}from"./FundWalletMethodHeader-Cyn7MCWO.mjs";import{N as g}from"./index-Dq_xe9dz.mjs";import{u as v,t as w}from"./context-BEE1GR3p.mjs";import{u as I,b as y,c as C}from"./internal-context-C4ZqP8IF.mjs";import{Q as T,a6 as j}from"./useActiveWallet-CeJ_zia0.mjs";import{a as S}from"./get-is-unified-wallet-szLxUazm.mjs";import{O as A}from"./analytics-mkkvFRju.mjs";import{g as b,t as N,d as F,a as U,b as E,u as x}from"./reservoir-CB32KXxK.mjs";import{u as k}from"./PrivyPluginContext-2QN2dVUw.mjs";import{S as R}from"./usePrivy-DZkUhG2n.mjs";import{T as W}from"./TransferOrBridgeLoadingScreen-rWz1yK-a.mjs";import{t as L}from"./use-export-wallet-DmJRcrg3.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"tinycolor2";import"ofetch";import"zustand";import"viem/utils";import"./getPublicClient-BltMpU4i.mjs";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"./get-entropy-details-for-user-DXl-F6zT.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./Row-C9vrS4Zi.mjs";import"./Value-tcJV9e0L.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./Address-BupZf8Rc.mjs";import"lucide-react";import"./NetworkIcon-B48ilzF8.mjs";import"@heroicons/react/24/outline/GlobeAltIcon";import"eventemitter3";const P={component:function(){let P=v(),{closePrivyModal:D,createAnalyticsEvent:B,connectors:$}=I(),{navigate:H,setModalData:M,data:O}=S(),_=v(),q=o(!1),Q=k(),[V,z]=a(!1),[G,X]=a(!1),[Y,J]=a(null),[K,Z]=a(),[ee,te]=a();if(!O?.funding||"ethereum"!==O.funding.chainType)throw Error("Invalid funding data");let{amount:ne,connectedWallet:re,chain:oe,solanaChain:ae,isUSDC:ie}=O.funding,se=O.funding.address,le=O.funding.erc20Address,ce=O.funding.isUSDC?"USDC":oe.nativeCurrency.symbol,de=i((()=>"solana"===re?.type?re.provider:function({connectors:e,connectedWalletAddress:t}){let n=e.find((e=>"solana"===e.chainType&&e.wallets.some((e=>e.address===t)))),r=n?.wallet.accounts.find((e=>e.address===t));if(!n||!r)throw new y("Unable to find source wallet connector");return new c({wallet:n.wallet,account:r})}({connectors:$,connectedWalletAddress:re?.address||""})),[re,$]),me=i((()=>{let e=Q(R);if(!e)throw new y("Unable to load solana plugin");let t=P.solanaRpcs["solana:mainnet"];if(!t)throw new y("Unable to load mainnet RPC");return e.getSolanaRpcClient({rpc:t.rpc,rpcSubscriptions:t.rpcSubscriptions,chain:"solana:mainnet",blockExplorerUrl:t.blockExplorerUrl??"https://explorer.solana.com"})}),[]),ue=T(L(de?.standardWallet.name||"unknown")),pe=ue?.name||"wallet";return s((()=>{(async function(){if(!de||!oe||q.current)return;let e=Q(R);if(!e)return void J(new y("Unable to solana plugin"));q.current=!0,oe?.testnet&&console.warn("Solana testnets are not supported for bridging");let t=ie?1e6*parseFloat(ne):l(ne),n=await b({isTestnet:!!oe.testnet,input:N({appId:_.id,amount:t.toString(),user:de.address,recipient:se,destinationChainId:oe.id,originChainId:E,originCurrency:ie?F:U,destinationCurrency:ie?le:void 0})}).catch(console.error);if(!n)return void J(new y(`Unable to fetch quotes for bridging. Wallet ${j(de.address)} does not have enough funds.`,void 0,C.INSUFFICIENT_BALANCE));let r=await e.createTransactionFromRelayQuote({quote:n,source:de.address,solanaClient:me});if(r)try{z(!0);let t=await e.simulateTransaction({solanaClient:me,tx:r});if(t.hasError)return t.hasFunds?(console.error("Transaction failed:",t.error),void J(new y("Something went wrong",void 0,C.TRANSACTION_FAILURE))):void J(new y(`Wallet ${j(de?.address)} does not have enough funds. ${n.details.currencyIn.amountFormatted} ${ce} are needed to complete the transaction.`,void 0,C.INSUFFICIENT_BALANCE));let{signature:o}=await de.signAndSendTransaction({chain:"solana:mainnet",transaction:r}),a=e.getAddressFromBuffer(o);Z(a),te("pending")}catch(e){if(console.error(e),/user rejected the request/gi.test(e.message||""))return void J(new y("Transaction was rejected by the user",void 0,C.TRANSACTION_FAILURE));J(new y("Something went wrong",void 0,C.TRANSACTION_FAILURE))}else J(new y(`Unable to select bridge option from quotes. Wallet ${j(de.address)} does not have enough funds.`,void 0,C.INSUFFICIENT_BALANCE))})().catch(console.error)}),[]),x({transactionHash:K,isTestnet:!1,bridgingStatus:ee,setBridgingStatus:te,onSuccess({transactionHash:e}){z(!1),X(!0),B({eventName:A,payload:{provider:"external",status:"success",txHash:e,address:de.address,chainType:"solana",clusterName:ae,token:"SOL",destinationAddress:se,destinationChainId:oe.id,destinationChainType:"ethereum",destinationValue:ne,destinationToken:ie?"USDC":"ETH"}})},onFailure({error:e}){z(!1),J(e)}}),s((()=>{if(!G)return;let e=setTimeout(D,w);return()=>clearTimeout(e)}),[G]),s((()=>{Y&&(M({funding:O?.funding,solanaFundingData:O?.solanaFundingData,sendTransaction:O?.sendTransaction,errorModalData:{error:Y,previousScreen:"TransferFromWalletScreen"}}),H("ErrorScreen",!1))}),[Y]),G?/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(h,{}),/*#__PURE__*/t(d,{}),/*#__PURE__*/e(m,{children:[/*#__PURE__*/t(r,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/t(f,{title:"Success!",description:`You’ve successfully added ${ne} ${ce} to your ${_.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/t(u,{}),/*#__PURE__*/t(p,{})]}):V&&de?/*#__PURE__*/t(W,{walletClientType:L(de?.standardWallet.name||"unknown"),displayName:pe,addressToFund:se,isBridging:V,isErc20Flow:!1,chainId:oe.id,chainName:oe.name,totalPriceInUsd:void 0,totalPriceInNativeCurrency:void 0,gasPriceInUsd:void 0,gasPriceInNativeCurrency:void 0}):
2
+ /*#__PURE__*/e(n,{children:[/*#__PURE__*/t(h,{}),/*#__PURE__*/t(g,{}),/*#__PURE__*/t("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/t(p,{})]})}};export{P as AwaitingSolToEvmBridgingScreen,P as default};
@@ -1,4 +1,4 @@
1
- import{createPublicClient as e,http as r}from"viem";import{UsdcAddressMap as a,formatWalletAddress as o}from"@privy-io/js-sdk-core";import{a as i}from"./getPublicClient-B4uPLKn-.mjs";import{g as n}from"./getErc20Balance-D0MGUaOw.mjs";import{jsx as t,jsxs as s,Fragment as c}from"react/jsx-runtime";import{useRef as l}from"react";import{c as m,B as d}from"./ModalHeader-CSfzkWxZ.mjs";import{b as h,R as p}from"./Layouts-BlFm53ED.mjs";import{t as u}from"./FundWalletMethodHeader-Dujd1j7J.mjs";import{R as f}from"./Row-C9vrS4Zi.mjs";import{E as g}from"./ErrorMessage-D8VaAP5m.mjs";import{V as b,L as y}from"./Value-tcJV9e0L.mjs";import{S as v}from"./Subtitle-CV-2yKE4.mjs";import{T as j}from"./Title-BnzYV3Is.mjs";import w from"@heroicons/react/24/outline/WalletIcon";import{styled as C}from"styled-components";import{g as x}from"./getChainName-DjpPdUSc.mjs";import{C as k}from"./Chip-D2-wZOHJ.mjs";import{N}from"./NetworkIcon-B48ilzF8.mjs";import{B as T,a as B}from"./shared-FM0rljBt.mjs";import{Menu as $,MenuButton as A,MenuItems as I,MenuItem as S}from"@headlessui/react";import E from"@heroicons/react/24/outline/ChevronDownIcon";import{f as F}from"./formatErc20TokenAmount-BuPk9xcy.mjs";import{g as P}from"./ethers-DrSqg5wi.mjs";import{F as M,a as L,b as R,c as W,d as H}from"./styles-C3H3yhVT.mjs";const Q=({chains:o,appId:t,address:s,rpcConfig:c,includeUsdc:l})=>Promise.all(o.map((async o=>{let m=e({chain:o,transport:r(i(o,c,t))}),d=await m.getBalance({address:s}).catch((()=>0n)),h=null,p=a[o.id];if(l&&p){let{balance:e}=await n({address:s,chain:o,rpcConfig:c,appId:t,erc20Address:p});h=e}return{balance:d,erc20Balance:h,erc20Address:p,chain:o}}))),U=({balance:e,className:r,chain:a})=>/*#__PURE__*/t(T,{className:r,$state:void 0,children:/*#__PURE__*/t(V,{balance:e,chain:a})}),V=({balance:e,chain:r})=>/*#__PURE__*/s(c,{children:[/*#__PURE__*/s(q,{children:[/*#__PURE__*/t(D,{chainId:"object"==typeof r?r.id:"solana"}),/*#__PURE__*/t(b,{children:"object"==typeof r?r.name:x(r)})]}),/*#__PURE__*/s(k,{isLoading:!1,isPulsing:!1,color:"gray",children:[/*#__PURE__*/t(z,{children:/*#__PURE__*/t(w,{})}),e]})]});let q=C.div`
1
+ import{createPublicClient as e,http as r}from"viem";import{UsdcAddressMap as a,formatWalletAddress as o}from"@privy-io/js-sdk-core";import{a as i}from"./getPublicClient-BltMpU4i.mjs";import{g as n}from"./getErc20Balance-Bs6MYMo9.mjs";import{jsx as t,jsxs as s,Fragment as c}from"react/jsx-runtime";import{useRef as l}from"react";import{c as m,B as d}from"./ModalHeader-Byy3j4Lh.mjs";import{b as h,R as p}from"./Layouts-BlFm53ED.mjs";import{t as u}from"./FundWalletMethodHeader-Cyn7MCWO.mjs";import{R as f}from"./Row-C9vrS4Zi.mjs";import{E as g}from"./ErrorMessage-D8VaAP5m.mjs";import{V as b,L as y}from"./Value-tcJV9e0L.mjs";import{S as v}from"./Subtitle-CV-2yKE4.mjs";import{T as j}from"./Title-BnzYV3Is.mjs";import w from"@heroicons/react/24/outline/WalletIcon";import{styled as C}from"styled-components";import{g as x}from"./getChainName-DjpPdUSc.mjs";import{C as k}from"./Chip-D2-wZOHJ.mjs";import{N}from"./NetworkIcon-B48ilzF8.mjs";import{B as T,a as B}from"./shared-FM0rljBt.mjs";import{Menu as $,MenuButton as A,MenuItems as I,MenuItem as S}from"@headlessui/react";import E from"@heroicons/react/24/outline/ChevronDownIcon";import{f as F}from"./formatErc20TokenAmount-BuPk9xcy.mjs";import{g as P}from"./ethers-CzVYf1X2.mjs";import{F as M,a as L,b as R,c as W,d as H}from"./styles-CVcwbZBK.mjs";const Q=({chains:o,appId:t,address:s,rpcConfig:c,includeUsdc:l})=>Promise.all(o.map((async o=>{let m=e({chain:o,transport:r(i(o,c,t))}),d=await m.getBalance({address:s}).catch((()=>0n)),h=null,p=a[o.id];if(l&&p){let{balance:e}=await n({address:s,chain:o,rpcConfig:c,appId:t,erc20Address:p});h=e}return{balance:d,erc20Balance:h,erc20Address:p,chain:o}}))),U=({balance:e,className:r,chain:a})=>/*#__PURE__*/t(T,{className:r,$state:void 0,children:/*#__PURE__*/t(V,{balance:e,chain:a})}),V=({balance:e,chain:r})=>/*#__PURE__*/s(c,{children:[/*#__PURE__*/s(q,{children:[/*#__PURE__*/t(D,{chainId:"object"==typeof r?r.id:"solana"}),/*#__PURE__*/t(b,{children:"object"==typeof r?r.name:x(r)})]}),/*#__PURE__*/s(k,{isLoading:!1,isPulsing:!1,color:"gray",children:[/*#__PURE__*/t(z,{children:/*#__PURE__*/t(w,{})}),e]})]});let q=C.div`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  `,z=C.div`
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{CheckCircle as t,XCircle as r}from"lucide-react";import{useMemo as i,useRef as o,useState as s,useEffect as a}from"react";import{a as n,C as c}from"./index-BXdEd5-h.mjs";import{a as m}from"./get-is-unified-wallet-szLxUazm.mjs";import{S as u}from"./ScreenLayout-DOt2sB2J.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CeJ_zia0.mjs";import"zustand";import"./context-BEE1GR3p.mjs";import"tinycolor2";import"viem";import"viem/utils";import"./internal-context-C4ZqP8IF.mjs";import"ofetch";import"./use-export-wallet-DmJRcrg3.mjs";import"./get-entropy-details-for-user-DXl-F6zT.mjs";import"./getPublicClient-BltMpU4i.mjs";import"react-device-detect";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-DZkUhG2n.mjs";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@privy-io/popup";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./ModalHeader-Byy3j4Lh.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Ct4Lyoaf.mjs";import"./index-Dq_xe9dz.mjs";const p=({status:o,title:s,description:a,userIntentRequired:n,retriesRemaining:c,hasSelectedCta:m,onContinue:p,onRetry:l})=>{let d=i((()=>{switch(o){case"loading":default:return;case"success":return n?{label:m?"Continuing...":"Continue",onClick:p,disabled:m,loading:m}:void 0;case"error":return c>0?{label:"Retry",onClick:l}:void 0}}),[o,m,p,l]),g=i((()=>({loading:"loading",ready:"subtle",disabled:"subtle",success:"success",error:"error"}[o]||"loading")),[o]);/*#__PURE__*/return e(u,{icon:"loading"===o||"ready"===o?void 0:"success"===o?t:r,iconVariant:g,title:s,subtitle:a,primaryCta:d,watermark:!0})},l={component:()=>{let{lastScreen:t,data:r,navigate:i,setModalData:u}=m(),{status:l,token:d,waitForResult:g,reset:y,execute:h}=n(),v=o([]),j=e=>{v.current=[e,...v.current]},[C,f]=s(!0);a((()=>(j(setTimeout(f,1e3,!1)),()=>{v.current.forEach((e=>clearTimeout(e))),v.current=[]})),[]);let[b,w]=s(""),[k,R]=s("Checking that you are a human..."),[S,x]=s(!1),[I,T]=s(3),P=r?.captchaModalData,A=async e=>{try{await(P?.callback(e)),P?.onSuccessNavigateTo&&i(P?.onSuccessNavigateTo,!1)}catch(e){if(e instanceof c)return;u({errorModalData:{error:e,previousScreen:t||"LandingScreen"}}),i(P?.onErrorNavigateTo||"ErrorScreen",!1)}};a((()=>{"success"===l?j(setTimeout((async()=>{let e=await g();!e||P?.userIntentRequired||A(e)}),1e3)):"ready"===l&&j(setTimeout((()=>{"ready"===l&&h()}),500))}),[l]),a((()=>{if(!C)switch(l){case"success":w("Success!"),R("CAPTCHA passed successfully."),P?.userIntentRequired||setTimeout((()=>{x(!0),A(d)}),2e3);break;case"loading":w(""),R("Checking that you are a human...");break;case"error":w("Something went wrong"),R(I<=0?"If you use an adblocker or VPN, try disabling and re-attempting.":"You did not pass CAPTCHA. Please try again.")}}),[l,C,S]);/*#__PURE__*/return e(p,{status:l,title:b,description:k,userIntentRequired:P?.userIntentRequired,retriesRemaining:I,hasSelectedCta:S,onContinue:()=>{x(!0),A(d)},onRetry:async()=>{if(I<=0)return;T((e=>e-1)),y(),h();let e=await g();!e||P?.userIntentRequired||A(e)}})}};export{l as CaptchaScreen,p as CaptchaScreenView,l as default};
@@ -0,0 +1,16 @@
1
+ import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import i from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as n,useRef as a,useEffect as s,useMemo as c}from"react";import{styled as m}from"styled-components";import{M as l,B as d,P as p}from"./ModalHeader-Byy3j4Lh.mjs";import{a as u}from"./Layouts-BlFm53ED.mjs";import{L as g,a7 as f}from"./useActiveWallet-CeJ_zia0.mjs";import{u as h}from"./internal-context-C4ZqP8IF.mjs";import{a as v}from"./get-is-unified-wallet-szLxUazm.mjs";import{O as y}from"./analytics-mkkvFRju.mjs";import{H as b}from"./index-BXdEd5-h.mjs";import"./context-BEE1GR3p.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-DmJRcrg3.mjs";import"eventemitter3";import"./get-entropy-details-for-user-DXl-F6zT.mjs";import"./getPublicClient-BltMpU4i.mjs";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"ofetch";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-DZkUhG2n.mjs";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@privy-io/popup";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";const w={component:()=>{let{data:o,setModalData:i,navigate:c,navigateBack:m}=v(),{closePrivyModal:p,createAnalyticsEvent:u,client:g}=h(),[f,b]=n("pending-in-flow"),w=a(0),C={...o?.funding,showAlternateFundingMethod:!0};C.usingDefaultFundingMethod&&(C.usingDefaultFundingMethod=!1);let{partnerUserId:k,popup:x}=o?.coinbaseOnrampStatus??{};return s((()=>{if("pending-in-flow"===f||"pending-after-flow"===f){let e=setInterval((async()=>{if(k)try{let{status:e}=await g.getCoinbaseOnRampStatus({partnerUserId:k});if("success"===e)return void b("success");if("failure"===e)throw Error("There was an error completing Coinbase Onramp flow.");if(w.current>=3)return i({funding:C,solanaFundingData:o?.solanaFundingData}),void c("FundingMethodSelectionScreen");x?.closed&&(w.current=w.current+1,b("pending-after-flow"))}catch(e){console.error(e),b("error"),u({eventName:y,payload:{status:"failure",provider:"coinbase-onramp",error:e.message}}),i({funding:{...C,errorMessage:"Something went wrong adding funds. Please try again or use another method."},solanaFundingData:o?.solanaFundingData}),c("FundingMethodSelectionScreen")}}),1500);return()=>clearInterval(e)}}),[k,x,f]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/t(l,{title:"Fund account",backFn:()=>{i({funding:C,solanaFundingData:o?.solanaFundingData}),m()}},"header"),/*#__PURE__*/t(j,{status:f,onClickCta:p}),/*#__PURE__*/t(d,{})]})}};let j=({status:o,onClickCta:i})=>{let{title:n,body:a,cta:s}=c((()=>(e=>{switch(e){case"success":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"pending-after-flow":return{title:"In Progress",body:"Almost done. Retrieving transaction status from Coinbase",cta:""};case"error":case"pending-in-flow":return{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""}}})(o)),[o]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(x,{children:[/*#__PURE__*/t(C,{isSucccess:"success"===o}),/*#__PURE__*/e(u,{children:[/*#__PURE__*/t("h3",{children:n}),/*#__PURE__*/t(k,{children:a})]})]}),s&&/*#__PURE__*/t(p,{onClick:i,children:s})]})},C=({isSucccess:r})=>{if(!r){let r="var(--privy-color-foreground-4)";/*#__PURE__*/return e("div",{style:{position:"relative"},children:[/*#__PURE__*/t(g,{color:r,style:{position:"absolute"}}),/*#__PURE__*/t(f,{color:r}),/*#__PURE__*/t(b,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let n=r?i:()=>/*#__PURE__*/t(o,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),a=r?"var(--privy-color-success)":"var(--privy-color-foreground-4)";/*#__PURE__*/return t("div",{style:{borderColor:a,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:n&&/*#__PURE__*/t(n,{width:"4rem",height:"4rem",color:a})})},k=m.p`
2
+ font-size: 1rem;
3
+ color: var(--privy-color-foreground-3);
4
+ margin-bottom: 1rem;
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: 1rem;
8
+ `,x=m.div`
9
+ display: flex;
10
+ flex-direction: column;
11
+ align-items: center;
12
+ justify-content: center;
13
+ margin-left: 1.75rem;
14
+ margin-right: 1.75rem;
15
+ padding: 2rem 0;
16
+ `;export{w as CoinbaseOnrampStatusScreen,w as default};
@@ -0,0 +1,3 @@
1
+ import{jsxs as e,Fragment as r,jsx as a}from"react/jsx-runtime";import{Mail as i}from"lucide-react";import{forwardRef as t,useState as o,useEffect as n}from"react";import{styled as l}from"styled-components";import{u as s}from"./context-BEE1GR3p.mjs";import{u as m,g as c,c as d}from"./internal-context-C4ZqP8IF.mjs";import{a as p}from"./index-BXdEd5-h.mjs";import{u,a as g}from"./get-is-unified-wallet-szLxUazm.mjs";import{F as h,a1 as f,V as E}from"./useActiveWallet-CeJ_zia0.mjs";import{E as S,P as y}from"./ModalHeader-Byy3j4Lh.mjs";import{C as v}from"./Chip-D2-wZOHJ.mjs";import{I as b,a as k}from"./EmailInputForm-Dgoii4vf.mjs";import{E as C}from"./ErrorMessage-D8VaAP5m.mjs";const j=/*#__PURE__*/t(((t,l)=>{let[E,b]=o(t.defaultValue||""),[k,j]=o(""),[A,T]=o(!1),{authenticated:L}=u(),{initLoginWithEmail:M}=m(),{navigate:D,setModalData:I,currentScreen:U,data:F}=g(),{enabled:N,token:W}=p(),[R,V]=o(!1),{accountType:$}=h(),_=s();n((()=>{!E&&_.disablePlusEmails&&F?.inlineError?.error instanceof c&&F?.inlineError?.error.privyErrorCode===d.DISALLOWED_PLUS_EMAIL&&!k&&j("Please enter a valid email address without a '+'."),k&&j("")}),[E]);let q=f(E),z=A||!q,H=()=>{var e;I({login:F?.login,inlineError:void 0}),!N||W||L?(e=W,T(!0),M({email:E,captchaToken:e,disableSignup:F?.login?.disableSignup,withPrivyUi:!0}).then((()=>{D("AwaitingPasswordlessCodeScreen")})).catch((e=>{I({errorModalData:{error:e,previousScreen:U||"LandingScreen"}}),D("ErrorScreen")})).finally((()=>{T(!1)}))):(I({captchaModalData:{callback:e=>M({email:E,captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),D("CaptchaScreen"))};/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(w,{children:[k&&/*#__PURE__*/a(C,{style:{display:"block",marginTop:"0.25rem",textAlign:"left"},children:k}),/*#__PURE__*/e(x,{stacked:t.stacked,$error:!!k,children:[/*#__PURE__*/a(P,{children:/*#__PURE__*/a(i,{})}),/*#__PURE__*/a("input",{ref:l,id:"email-input",className:"login-method-button",type:"email",placeholder:"your@email.com",onFocus:()=>V(!0),onChange:e=>b(e.target.value),onKeyUp:e=>{"Enter"===e.key&&H()},value:E,autoComplete:"email"}),"email"!==$||R?t.stacked?/*#__PURE__*/a("span",{}):/*#__PURE__*/a(S,{isSubmitting:A,onClick:H,disabled:z,children:"Submit"}):/*#__PURE__*/a(v,{color:"gray",children:"Recent"})]})]}),t.stacked?/*#__PURE__*/a(y,{loadingText:null,loading:A,disabled:z,onClick:H,style:{width:"100%"},children:"Submit"}):null]})}));let w=b,x=k,P=l(E)`
2
+ display: inline-flex;
3
+ `;export{j as C};
@@ -0,0 +1,9 @@
1
+ import{jsx as t,jsxs as e}from"react/jsx-runtime";import{ArrowRightLeft as i}from"lucide-react";import{styled as o}from"styled-components";import{a as r}from"./get-is-unified-wallet-szLxUazm.mjs";import{S as n}from"./ScreenLayout-DOt2sB2J.mjs";import{G as m}from"./index-BXdEd5-h.mjs";import"viem";import"react";import"./context-BEE1GR3p.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-C4ZqP8IF.mjs";import"ofetch";import"./ModalHeader-Byy3j4Lh.mjs";import"./useActiveWallet-CeJ_zia0.mjs";import"zustand";import"viem/utils";import"./use-export-wallet-DmJRcrg3.mjs";import"eventemitter3";import"./get-entropy-details-for-user-DXl-F6zT.mjs";import"./getPublicClient-BltMpU4i.mjs";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Ct4Lyoaf.mjs";import"./index-Dq_xe9dz.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-DZkUhG2n.mjs";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@privy-io/popup";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";const s=e=>/*#__PURE__*/t("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"-0.625 12.48 397.647 399.546",width:"2500",height:"674",preserveAspectRatio:"none",...e,children:/*#__PURE__*/t("g",{children:/*#__PURE__*/t("path",{fill:"#333745",d:"M 333.9 12.8 L 150.9 12.8 L 150.9 258.4 L 396.5 258.4 L 396.5 76.7 C 396.6 42.2 368.4 12.8 333.9 12.8 Z M 94.7 12.8 L 64 12.8 C 29.5 12.8 0 40.9 0 76.8 L 0 107.5 L 94.7 107.5 L 94.7 12.8 Z M 0 165 L 94.7 165 L 94.7 259.7 L 0 259.7 L 0 165 Z M 301.9 410.6 L 332.6 410.6 C 367.1 410.6 396.6 382.5 396.6 346.6 L 396.6 316 L 301.9 316 L 301.9 410.6 Z M 150.9 316 L 245.6 316 L 245.6 410.7 L 150.9 410.7 L 150.9 316 Z M 0 316 L 0 346.7 C 0 381.2 28.1 410.7 64 410.7 L 94.7 410.7 L 94.7 316 L 0 316 Z"})})}),p=({onContinueWithLedger:o,onContinueWithoutLedger:r,title:p="Phantom supports Ledger",subtitle:a="Are you using a Ledger hardware wallet?\nContinue to sign with Ledger"})=>/*#__PURE__*/t(n,{title:p,subtitle:/*#__PURE__*/t(u,{children:a}),primaryCta:{label:"Continue with Ledger",onClick:o},secondaryCta:{label:"Continue without Ledger",onClick:r},watermark:!0,children:/*#__PURE__*/e(l,{children:[/*#__PURE__*/t(m,{style:{width:"48px",height:"48px"}}),/*#__PURE__*/t(i,{strokeWidth:2,color:"var(--privy-color-icon-subtle)",width:22,height:22}),/*#__PURE__*/t(s,{style:{width:"48px",height:"48px"}})]})});function a(){let{data:e,setModalData:i,navigate:o}=r();/*#__PURE__*/return t(p,{onContinueWithLedger:function(){i({...e,login:{...e?.login,isSigningInWithLedgerSolana:!0}}),o("ConnectionStatusScreen")},onContinueWithoutLedger:function(){i({...e,login:{...e?.login,isSigningInWithLedgerSolana:!1}}),o("ConnectionStatusScreen")}})}const c={component:a};let l=o.div`
2
+ display: flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ gap: 8px;
6
+ margin-bottom: var(--screen-space);
7
+ `,u=o.span`
8
+ white-space: pre-wrap;
9
+ `;export{c as ConnectLedgerScreen,a as ConnectLedgerScreenComponent,p as ConnectLedgerScreenView,c as default};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{useRef as t}from"react";import{u as o}from"./context-BEE1GR3p.mjs";import{u as r,g as n,c as i}from"./internal-context-C4ZqP8IF.mjs";import{a}from"./events-context-CI0iqAXA.mjs";import{a as l}from"./get-is-unified-wallet-szLxUazm.mjs";import{i as c}from"./ConnectWalletView-mIrd9fmT.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"react-device-detect";import"styled-components";import"./ModalHeader-Byy3j4Lh.mjs";import"./useActiveWallet-CeJ_zia0.mjs";import"zustand";import"viem/utils";import"./use-export-wallet-DmJRcrg3.mjs";import"eventemitter3";import"./get-entropy-details-for-user-DXl-F6zT.mjs";import"./getPublicClient-BltMpU4i.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./Link-DJ5gq9Di.mjs";import"./QrCode-lPYtXNC_.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-BWqAKjsd.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-Ct4Lyoaf.mjs";import"./index-Dq_xe9dz.mjs";const m={component:()=>{let{closePrivyModal:m}=r(),{data:s,navigate:p}=l(),d=o(),C=a(),u=s?.externalConnectWallet?.description,j=t(s?.externalConnectWallet?.walletList??d.appearance.walletList),E=t(s?.externalConnectWallet?.walletChainType??d.appearance.walletChainType);/*#__PURE__*/return e(c,{walletList:j.current,walletChainType:E.current,preSelectedWalletId:s?.externalConnectWallet?.preSelectedWalletId,hideHeader:s?.externalConnectWallet?.hideHeader,onBack:s?.funding?()=>p("FundingMethodSelectionScreen"):void 0,onClose:()=>{C("connectWallet","onError",i.GENERIC_CONNECT_WALLET_ERROR),m()},onConnect:({connector:e,wallet:t})=>{C("connectWallet","onSuccess",{wallet:t});let o=s?.externalConnectWallet?.onCompleteNavigateTo;o?p(o({address:t.address,walletClientType:e?.walletClientType,walletChainType:e?.chainType})):m()},onConnectError:e=>{e instanceof n?(console.warn(e.cause?e.cause:e.message),C("connectWallet","onError",e.privyErrorCode||i.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),C("connectWallet","onError",i.UNKNOWN_CONNECT_WALLET_ERROR))},customDescription:u,app:d,connectOnly:!0})},isUnauthenticatedScreem:!0};export{m as ConnectOnlyLandingScreen,m as default};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as o}from"react";import{isMobile as r}from"react-device-detect";import{C as i}from"./use-export-wallet-DmJRcrg3.mjs";import{q as n}from"./context-BEE1GR3p.mjs";import{Q as a}from"./useActiveWallet-CeJ_zia0.mjs";import{u as s}from"./internal-context-C4ZqP8IF.mjs";import{a as l}from"./get-is-unified-wallet-szLxUazm.mjs";import{S as c}from"./ScreenLayout-DOt2sB2J.mjs";import{B as m}from"./index-BXdEd5-h.mjs";import{getErrorDetails as p}from"./ConnectionStatusScreen-D8G_flGR.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./get-entropy-details-for-user-DXl-F6zT.mjs";import"zustand";import"tinycolor2";import"viem";import"./getPublicClient-BltMpU4i.mjs";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"ofetch";import"./ModalHeader-Byy3j4Lh.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Ct4Lyoaf.mjs";import"./index-Dq_xe9dz.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-DZkUhG2n.mjs";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@privy-io/popup";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./Link-DJ5gq9Di.mjs";import"./useI18n-BWqAKjsd.mjs";import"./shouldProceedtoEmbeddedWalletCreationFlow-eeAK_6M1.mjs";const u=({walletLogo:t,success:o,errorMessage:r,title:n,subtitle:a,onRetry:s,onUseDifferentWallet:l,onBack:m,numRetries:p,maxRetries:u})=>/*#__PURE__*/e(c,{title:n,subtitle:a,icon:t,iconVariant:"loading",iconLoadingStatus:{success:o,fail:!!r},primaryCta:r===i.ERROR_USER_EXISTS?{label:"Use a different wallet",onClick:l}:!o&&r?.retryable&&p<u?{label:"Retry",onClick:s,disabled:!r?.retryable||p>=u}:!o&&r&&p>=u?{label:"Use a different wallet",onClick:l}:void 0,onBack:m,watermark:!0}),d={component:()=>{let i,{navigateBack:c,navigate:d,lastScreen:w,currentScreen:f,data:y,setModalData:g}=l(),{walletConnectionStatus:j,closePrivyModal:v}=s(),[C,h]=t(void 0),[k,b]=t(0),x=a(j?.connector?.walletClientType||"unknown"),S="connected"===j?.status,R="switching_to_supported_chain"===j?.status;o((()=>{if(S){let e;if(y?.externalConnectWallet?.onCompleteNavigateTo){let t=y.externalConnectWallet.onCompleteNavigateTo,o=j.connectedWallet?.address;e=setTimeout((()=>{if(y.funding&&j.connector){let e=j.connector.wallets.find((e=>e.address===o));g({...y,funding:{...y.funding,connectedWallet:e}})}d(t({address:o,walletClientType:j.connector?.walletClientType,walletChainType:j.connector?.chainType}))}),n)}else e=setTimeout(v,n);return()=>clearTimeout(e)}}),[S]);o((()=>{var e;j?.connectError&&(e=j?.connectError,h(p(e)))}),[j]);let T=j?.connector?.connectorType||"injected",B=j?.connector?.walletClientType||"unknown",W=x?.metadata?.shortName||x?.name||j?.connector?.walletBranding.name||"Browser Extension",E=x?.image_url?.md||j?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(m,{...t})),M="Browser Extension"===W?W.toLowerCase():W;i=S?`Successfully connected with ${M}`:C?C.message:R?"Switching networks":`Waiting for ${M}`;let _="Don’t see your wallet? Check your other browser windows.";return S?_="You’re good to go!":k>=2&&C?_="Unable to connect wallet":C?_=C.detail:R?_="Switch your wallet to the requested network.":"metamask"===B&&r?_="Click to continue to open and connect MetaMask.":"metamask"===B?_="For the best experience, connect only one wallet at a time.":"wallet_connect_v2"===T?_="Open your mobile wallet app to continue":"coinbase_wallet"===T&&(_="Confirm in the Coinbase app/popup to continue."),/*#__PURE__*/e(u,{walletName:W,walletLogo:E,success:S,errorMessage:C,title:i,subtitle:_,onRetry:()=>{b(k+1),h(void 0),j?.connectRetry()},onUseDifferentWallet:c,onBack:f===w?void 0:c,numRetries:k,maxRetries:2})}};export{d as ConnectOnlyStatusScreen,u as ConnectOnlyStatusScreenView,d as default};
@@ -0,0 +1 @@
1
+ import{jsx as t}from"react/jsx-runtime";import{u as o}from"./context-BEE1GR3p.mjs";import{C as r,L as i}from"./CustomLandingScreenView-C2TNxHAb.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-Byy3j4Lh.mjs";import"./useActiveWallet-CeJ_zia0.mjs";import"zustand";import"viem";import"viem/utils";import"./internal-context-C4ZqP8IF.mjs";import"ofetch";import"./use-export-wallet-DmJRcrg3.mjs";import"eventemitter3";import"./get-is-unified-wallet-szLxUazm.mjs";import"./get-entropy-details-for-user-DXl-F6zT.mjs";import"./getPublicClient-BltMpU4i.mjs";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-BXdEd5-h.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-DZkUhG2n.mjs";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@privy-io/popup";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./ConnectWalletView-mIrd9fmT.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./Link-DJ5gq9Di.mjs";import"./QrCode-lPYtXNC_.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-BWqAKjsd.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-Ct4Lyoaf.mjs";import"./index-Dq_xe9dz.mjs";import"lucide-react";import"./ConnectEmailForm-D5UhENmm.mjs";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./farcaster-DPlSjvF5.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./ConnectPhoneForm-CQJPasTi.mjs";import"./twitter-BoAxhlj6.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletOverflowButton-CoHTrzr-.mjs";import"./ScreenLayout-DOt2sB2J.mjs";const e={component:()=>{let e=o();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?/*#__PURE__*/t(r,{connectOnly:!0}):/*#__PURE__*/t(i,{connectOnly:!0})}};export{e as ConnectOrCreateScreen,e as default};
@@ -1,4 +1,4 @@
1
- import{jsx as o,jsxs as e,Fragment as r}from"react/jsx-runtime";import{forwardRef as n,useState as t,useEffect as i}from"react";import{styled as a}from"styled-components";import{countryCodesAndNumbers as d,validatePhoneNumber as l,phoneNumberTypingFormatter as c,getPlaceholderPhoneNumber as p,getCountryCallingCode as u,getPhoneCountryCodeAndNumber as h,formatPhoneNumber as s}from"@privy-io/js-sdk-core";import{u as g}from"./context-bWeWAiND.mjs";import{F as m}from"./useActiveWallet-CSq3KvGj.mjs";import{E as b,P as x}from"./ModalHeader-CSfzkWxZ.mjs";import{C as v}from"./Chip-D2-wZOHJ.mjs";const f=({value:r,onChange:n})=>/*#__PURE__*/o("select",{value:r,onChange:n,children:d.map((o=>/*#__PURE__*/e("option",{value:o.code,children:[o.code," +",o.callCode]},o.code)))}),w=/*#__PURE__*/n(((n,a)=>{let d=g(),[w,k]=t(!1),{accountType:$}=m(),[N,P]=t(""),[S,j]=t(d?.intl.defaultCountry??"US"),V=l(N,S),z=c(S),T=p(S),U=u(S),L=!V,[q,E]=t(!1),B=U.length,D=o=>{let e=o.target.value;j(e),P(""),n.onChange&&n.onChange({rawPhoneNumber:N,qualifiedPhoneNumber:s(N,e),countryCode:e,isValid:l(N,S)})},F=(o,e)=>{try{let r=o.replace(/\D/g,"")===N.replace(/\D/g,"")?o:z.input(o);P(r),n.onChange&&n.onChange({rawPhoneNumber:r,qualifiedPhoneNumber:s(o,e),countryCode:e,isValid:l(o,e)})}catch(o){console.error("Error processing phone number:",o)}},I=()=>{E(!0);let o=s(N,S);n.onSubmit({rawPhoneNumber:N,qualifiedPhoneNumber:o,countryCode:S,isValid:l(N,S)}).finally((()=>E(!1)))};return i((()=>{if(n.defaultValue){let o=h(n.defaultValue);z.reset(),D({target:{value:o.countryCode}}),F(o.phone,o.countryCode)}}),[n.defaultValue]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(y,{children:/*#__PURE__*/e(C,{$callingCodeLength:B,$stacked:n.stacked,children:[/*#__PURE__*/o(f,{value:S,onChange:D}),/*#__PURE__*/o("input",{ref:a,id:"phone-number-input",className:"login-method-button",type:"tel",placeholder:T,onFocus:()=>k(!0),onChange:o=>{F(o.target.value,S)},onKeyUp:o=>{"Enter"===o.key&&I()},value:N,autoComplete:"tel"}),"phone"!==$||w||n.hideRecent?n.stacked||n.noIncludeSubmitButton?/*#__PURE__*/o("span",{}):/*#__PURE__*/o(b,{isSubmitting:q,onClick:I,disabled:L,children:"Submit"}):/*#__PURE__*/o(v,{color:"gray",children:"Recent"})]})}),n.stacked&&!n.noIncludeSubmitButton?/*#__PURE__*/o(x,{loading:q,loadingText:null,onClick:I,disabled:L,children:"Submit"}):null]})}));let y=a.div`
1
+ import{jsx as o,jsxs as e,Fragment as r}from"react/jsx-runtime";import{forwardRef as n,useState as t,useEffect as i}from"react";import{styled as a}from"styled-components";import{countryCodesAndNumbers as d,validatePhoneNumber as l,phoneNumberTypingFormatter as c,getPlaceholderPhoneNumber as p,getCountryCallingCode as u,getPhoneCountryCodeAndNumber as h,formatPhoneNumber as s}from"@privy-io/js-sdk-core";import{u as g}from"./context-BEE1GR3p.mjs";import{F as m}from"./useActiveWallet-CeJ_zia0.mjs";import{E as b,P as x}from"./ModalHeader-Byy3j4Lh.mjs";import{C as v}from"./Chip-D2-wZOHJ.mjs";const f=({value:r,onChange:n})=>/*#__PURE__*/o("select",{value:r,onChange:n,children:d.map((o=>/*#__PURE__*/e("option",{value:o.code,children:[o.code," +",o.callCode]},o.code)))}),w=/*#__PURE__*/n(((n,a)=>{let d=g(),[w,k]=t(!1),{accountType:$}=m(),[N,P]=t(""),[S,j]=t(d?.intl.defaultCountry??"US"),V=l(N,S),z=c(S),T=p(S),U=u(S),L=!V,[q,E]=t(!1),B=U.length,D=o=>{let e=o.target.value;j(e),P(""),n.onChange&&n.onChange({rawPhoneNumber:N,qualifiedPhoneNumber:s(N,e),countryCode:e,isValid:l(N,S)})},F=(o,e)=>{try{let r=o.replace(/\D/g,"")===N.replace(/\D/g,"")?o:z.input(o);P(r),n.onChange&&n.onChange({rawPhoneNumber:r,qualifiedPhoneNumber:s(o,e),countryCode:e,isValid:l(o,e)})}catch(o){console.error("Error processing phone number:",o)}},I=()=>{E(!0);let o=s(N,S);n.onSubmit({rawPhoneNumber:N,qualifiedPhoneNumber:o,countryCode:S,isValid:l(N,S)}).finally((()=>E(!1)))};return i((()=>{if(n.defaultValue){let o=h(n.defaultValue);z.reset(),D({target:{value:o.countryCode}}),F(o.phone,o.countryCode)}}),[n.defaultValue]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(y,{children:/*#__PURE__*/e(C,{$callingCodeLength:B,$stacked:n.stacked,children:[/*#__PURE__*/o(f,{value:S,onChange:D}),/*#__PURE__*/o("input",{ref:a,id:"phone-number-input",className:"login-method-button",type:"tel",placeholder:T,onFocus:()=>k(!0),onChange:o=>{F(o.target.value,S)},onKeyUp:o=>{"Enter"===o.key&&I()},value:N,autoComplete:"tel"}),"phone"!==$||w||n.hideRecent?n.stacked||n.noIncludeSubmitButton?/*#__PURE__*/o("span",{}):/*#__PURE__*/o(b,{isSubmitting:q,onClick:I,disabled:L,children:"Submit"}):/*#__PURE__*/o(v,{color:"gray",children:"Recent"})]})}),n.stacked&&!n.noIncludeSubmitButton?/*#__PURE__*/o(x,{loading:q,loadingText:null,onClick:I,disabled:L,children:"Submit"}):null]})}));let y=a.div`
2
2
  width: 100%;
3
3
  `,C=a.label`
4
4
  --country-code-dropdown-width: calc(54px + calc(12 * ${o=>o.$callingCodeLength}px));
@@ -1,4 +1,4 @@
1
- import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{MagnifyingGlassIcon as l}from"@heroicons/react/24/outline";import{useVirtualizer as i}from"@tanstack/react-virtual";import{useState as a,useMemo as o,useCallback as r,useRef as c,useEffect as s}from"react";import{isMobile as d}from"react-device-detect";import{styled as h}from"styled-components";import{a as m,T as u}from"./ModalHeader-CSfzkWxZ.mjs";import p from"@heroicons/react/24/outline/CheckIcon";import{C as g}from"./copy-Bx2Jwc5_.mjs";import{L as w}from"./Link-DJ5gq9Di.mjs";import{Q as f}from"./QrCode-BkoTqsec.mjs";import{E as y}from"./EmailInputForm-Dgoii4vf.mjs";import{u as v,q as b}from"./context-bWeWAiND.mjs";import{u as C}from"./useI18n-VPW2SjZN.mjs";import{M as x,q as _,d as k,e as L,K as W,V as z,w as T,S}from"./useActiveWallet-CSq3KvGj.mjs";import{u as A,P as E,b as j}from"./internal-context-Z-fyxadS.mjs";import{W as K}from"./WalletCards-DH1rqayz.mjs";import{W as B,h as q}from"./use-export-wallet-DyNNbsJn.mjs";import{S as I}from"./Screen-5StC6JLQ.mjs";let O=h.button`
1
+ import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{MagnifyingGlassIcon as l}from"@heroicons/react/24/outline";import{useVirtualizer as i}from"@tanstack/react-virtual";import{useState as a,useMemo as o,useCallback as r,useRef as c,useEffect as s}from"react";import{isMobile as d}from"react-device-detect";import{styled as h}from"styled-components";import{a as m,T as u}from"./ModalHeader-Byy3j4Lh.mjs";import p from"@heroicons/react/24/outline/CheckIcon";import{C as g}from"./copy-Bx2Jwc5_.mjs";import{L as w}from"./Link-DJ5gq9Di.mjs";import{Q as f}from"./QrCode-lPYtXNC_.mjs";import{E as y}from"./EmailInputForm-Dgoii4vf.mjs";import{u as v,q as b}from"./context-BEE1GR3p.mjs";import{u as C}from"./useI18n-BWqAKjsd.mjs";import{M as x,m as _,n as k,e as L,K as W,V as z,h as T,S}from"./useActiveWallet-CeJ_zia0.mjs";import{u as A,P as E,c as j}from"./internal-context-C4ZqP8IF.mjs";import{W as K}from"./WalletCards-DH1rqayz.mjs";import{W as B,h as I}from"./use-export-wallet-DmJRcrg3.mjs";import{S as O}from"./Screen-Ct4Lyoaf.mjs";let q=h.button`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  gap: 0.5rem;
@@ -22,7 +22,7 @@ import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{Magnifyin
22
22
  `,$=h(g)`
23
23
  color: var(--privy-color-foreground-3);
24
24
  opactiy: 0.5;
25
- `;function F({children:t,iconOnly:l,value:i,hideCopyIcon:o,...r}){let[c,s]=a(!1);/*#__PURE__*/return e(O,{...r,onClick:()=>{navigator.clipboard.writeText(i||t).catch(console.error),s(!0),setTimeout((()=>s(!1)),1500)},children:[t," ",c?/*#__PURE__*/e(N,{children:[/*#__PURE__*/n(U,{})," ",!l&&"Copied"]}):!o&&/*#__PURE__*/n($,{})]})}const M={phantom:{mobile:{native:"phantom://",universal:"https://phantom.app/ul/"}},solflare:{mobile:{native:void 0,universal:"https://solflare.com/ul/v1/"}},metamask:{image_url:{sm:x,md:x}}};class P{static normalize(e){return e.replace(/[-_]wallet$/,"").replace(/[-_]extension$/,"").toLowerCase()}isEth(e){return e.chains.some((e=>e.includes("eip155:")))}isSol(e){return e.chains.some((e=>e.includes("solana:")))}inAllowList(e,n){if(!this.normalizedAllowList||0===this.normalizedAllowList.length||"listing"===n&&this.includeWalletConnect)return!0;let t=P.normalize(e);return this.normalizedAllowList.some((e=>t===P.normalize(e)))}inDenyList(e,n){return"listing"===n&&"rabby"===e||"agw"===P.normalize(e)}chainMatches(e){return"ethereum-only"===this.chainFilter?"ethereum"===e:"solana-only"!==this.chainFilter||"solana"===e}getAllowListKey(e,n,t,l){let i=P.normalize(e);for(let e of this.normalizedAllowList||[])if(i===P.normalize(e))return e;if("connector"===n){if(("injected"===t||"solana_adapter"===t)&&"ethereum"===l&&this.detectedEth)return"detected_ethereum_wallets";if(("injected"===t||"solana_adapter"===t)&&"solana"===l&&this.detectedSol)return"detected_solana_wallets"}if("listing"===n&&this.includeWalletConnect)return"wallet_connect"}connectorOk(e){return!!("null"!==e.connectorType&&"walletconnect_solana"!==e.walletBranding.id&&this.chainMatches(e.chainType)&&(this.inAllowList(e.walletClientType,"connector")||("injected"===e.connectorType||"solana_adapter"===e.connectorType)&&("ethereum"===e.chainType&&this.detectedEth||"solana"===e.chainType&&this.detectedSol)))}listingOk(e){if(e.slug.includes("coinbase"))return!1;if("ethereum-only"===this.chainFilter){if(!this.isEth(e))return!1}else if("solana-only"===this.chainFilter&&!this.isSol(e))return!1;return!(!this.inAllowList(e.slug,"listing")||this.inDenyList(e.slug,"listing"))}getWallets(e,n){let t=new Map,l=e=>{let n=t.get(e.id);if(n){n.chainType!==e.chainType&&(n.chainType="multi");let t=new Set(n.chains);e.chains.forEach((e=>t.add(e))),n.chains=Array.from(t),!n.icon&&e.icon&&(n.icon=e.icon),!n.url&&e.url&&(n.url=e.url),!n.listing&&e.listing&&(n.listing=e.listing),!n.allowListKey&&e.allowListKey&&(n.allowListKey=e.allowListKey)}else t.set(e.id,e)};e.filter((e=>this.connectorOk(e))).forEach((e=>{let n=P.normalize(e.walletClientType);l({id:n,label:e.walletBranding?.name??n,source:"connector",connector:e,chainType:e.chainType,icon:e.walletBranding?.icon,url:void 0,chains:["ethereum"===e.chainType?"eip155":"solana"],allowListKey:this.getAllowListKey(e.walletClientType,"connector",e.connectorType,e.chainType)})}));let i=e.find((e=>"wallet_connect_v2"===e.connectorType)),a=e.find((e=>"walletconnect_solana"===e.walletBranding.id));n.filter((e=>this.listingOk(e))).forEach((n=>{let t=[...n.chains].filter((e=>e.includes("eip155:")||e.includes("solana:")));if(e.some((e=>P.normalize(e.walletClientType)===P.normalize(n.slug)&&"ethereum"===e.chainType&&"null"!==e.connectorType))||i||n.mobile.native||n.mobile.universal||_[n.slug]?.chainTypes.includes("ethereum")||(t=t.filter((e=>!e.includes("eip155:")))),e.some((e=>P.normalize(e.walletClientType)===P.normalize(n.slug)&&"solana"===e.chainType&&"null"!==e.connectorType))||a||n.mobile.native||n.mobile.universal||_[n.slug]?.chainTypes.includes("solana")||(t=t.filter((e=>!e.includes("solana:")))),!t.length)return;let o=P.normalize(n.slug),r=M[n.slug],c=r?.image_url?.sm||n.image_url?.sm;t.some((e=>e.includes("eip155:")))&&l({id:o,label:n.name||o,source:"listing",listing:n,chainType:"ethereum",icon:c,url:n.homepage,chains:t,allowListKey:this.getAllowListKey(n.slug,"listing")}),t.some((e=>e.includes("solana:")))&&l({id:o,label:n.name||o,source:"listing",listing:n,chainType:"solana",icon:c,url:n.homepage,chains:t,allowListKey:this.getAllowListKey(n.slug,"listing")})})),this.includeWalletConnectQr&&i&&l({id:"wallet_connect_qr",label:"WalletConnect",source:"connector",connector:i,chainType:"ethereum",icon:B,url:void 0,chains:["eip155"],allowListKey:"wallet_connect_qr"}),this.includeWalletConnectQrSolana&&a&&l({id:"wallet_connect_qr_solana",label:"WalletConnect",source:"connector",connector:a,chainType:"solana",icon:B,url:void 0,chains:["solana"],allowListKey:"wallet_connect_qr_solana"});let o=Array.from(t.values());o.forEach((e=>{let n=M[e.listing?.slug||e.id];n?.image_url?.sm&&(e.icon=n.image_url.sm)}));let r=new Map;return this.normalizedAllowList?.forEach(((e,n)=>{r.set(P.normalize(e),n)})),{wallets:o.slice().sort(((e,n)=>{if(e.allowListKey&&n.allowListKey){let t=this.normalizedAllowList?.findIndex((n=>P.normalize(n)===P.normalize(e.allowListKey)))??-1,l=this.normalizedAllowList?.findIndex((e=>P.normalize(e)===P.normalize(n.allowListKey)))??-1;if(t!==l&&t>=0&&l>=0)return t-l}if(e.allowListKey&&!n.allowListKey)return-1;if(!e.allowListKey&&n.allowListKey)return 1;let t=P.normalize(e.id),l=P.normalize(n.id);"binance-defi"===t?t="binance":"universalprofiles"===t?t="universal_profile":"cryptocom-defi"===t?t="cryptocom":"bitkeep"===t&&(t="bitget_wallet"),"binance-defi"===l?l="binance":"universalprofiles"===l?l="universal_profile":"cryptocom-defi"===l?l="cryptocom":"bitkeep"===l&&(l="bitget_wallet");let i=r.has(t),a=r.has(l);return i&&a?r.get(t)-r.get(l):i?-1:a?1:"connector"===e.source&&"listing"===n.source?-1:"listing"===e.source&&"connector"===n.source?1:e.label.toLowerCase().localeCompare(n.label.toLowerCase())})),walletCount:o.length}}constructor(e,n){this.chainFilter=e,n&&n.length>0&&(this.normalizedAllowList=n.map(String),this.normalizedAllowList.includes("binance")&&this.normalizedAllowList.push("binance-defi-wallet"),this.normalizedAllowList.includes("bitget_wallet")&&this.normalizedAllowList.push("bitkeep")),this.detectedEth=this.normalizedAllowList?.includes("detected_ethereum_wallets")??!1,this.detectedSol=this.normalizedAllowList?.includes("detected_solana_wallets")??!1,this.includeWalletConnect=this.normalizedAllowList?.includes("wallet_connect")??!1,this.includeWalletConnectQr=this.normalizedAllowList?.includes("wallet_connect_qr")??!1,this.includeWalletConnectQrSolana=this.normalizedAllowList?.includes("wallet_connect_qr_solana")??!1}}var Q=t=>/*#__PURE__*/e("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...t,children:[/*#__PURE__*/n("path",{d:"m0 0h32v32h-32z",fill:"#5469d4"}),/*#__PURE__*/n("path",{d:"m15.997 5.333-.143.486v14.106l.143.143 6.548-3.87z",fill:"#c2ccf4"}),/*#__PURE__*/n("path",{d:"m15.996 5.333-6.548 10.865 6.548 3.87z",fill:"#fff"}),/*#__PURE__*/n("path",{d:"m15.997 21.306-.08.098v5.025l.08.236 6.552-9.227z",fill:"#c2ccf4"}),/*#__PURE__*/n("path",{d:"m15.996 26.665v-5.36l-6.548-3.867z",fill:"#fff"}),/*#__PURE__*/n("path",{d:"m15.995 20.07 6.548-3.87-6.548-2.976v6.847z",fill:"#8698e8"}),/*#__PURE__*/n("path",{d:"m9.448 16.2 6.548 3.87v-6.846z",fill:"#c2ccf4"})]}),D=t=>/*#__PURE__*/e("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...t,children:[/*#__PURE__*/e("linearGradient",{id:"a",gradientUnits:"userSpaceOnUse",x1:"7.233",x2:"24.766",y1:"24.766",y2:"7.234",children:[/*#__PURE__*/n("stop",{offset:"0",stopColor:"#9945ff"}),/*#__PURE__*/n("stop",{offset:".2",stopColor:"#7962e7"}),/*#__PURE__*/n("stop",{offset:"1",stopColor:"#00d18c"})]}),/*#__PURE__*/n("path",{d:"m0 0h32v32h-32z",fill:"#10111a"}),/*#__PURE__*/n("path",{clipRule:"evenodd",d:"m9.873 20.41a.645.645 0 0 1 .476-.21l14.662.012a.323.323 0 0 1 .238.54l-3.123 3.438a.643.643 0 0 1 -.475.21l-14.662-.012a.323.323 0 0 1 -.238-.54zm15.376-2.862a.322.322 0 0 1 -.238.54l-14.662.012a.642.642 0 0 1 -.476-.21l-3.122-3.44a.323.323 0 0 1 .238-.54l14.662-.012a.644.644 0 0 1 .475.21zm-15.376-9.738a.644.644 0 0 1 .476-.21l14.662.012a.322.322 0 0 1 .238.54l-3.123 3.438a.643.643 0 0 1 -.475.21l-14.662-.012a.323.323 0 0 1 -.238-.54z",fill:"url(#a)",fillRule:"evenodd"})]});const R=h.div`
25
+ `;function F({children:t,iconOnly:l,value:i,hideCopyIcon:o,...r}){let[c,s]=a(!1);/*#__PURE__*/return e(q,{...r,onClick:()=>{navigator.clipboard.writeText(i||t).catch(console.error),s(!0),setTimeout((()=>s(!1)),1500)},children:[t," ",c?/*#__PURE__*/e(N,{children:[/*#__PURE__*/n(U,{})," ",!l&&"Copied"]}):!o&&/*#__PURE__*/n($,{})]})}const M={phantom:{mobile:{native:"phantom://",universal:"https://phantom.app/ul/"}},solflare:{mobile:{native:void 0,universal:"https://solflare.com/ul/v1/"}},metamask:{image_url:{sm:x,md:x}}};class P{static normalize(e){return e.replace(/[-_]wallet$/,"").replace(/[-_]extension$/,"").toLowerCase()}isEth(e){return e.chains.some((e=>e.includes("eip155:")))}isSol(e){return e.chains.some((e=>e.includes("solana:")))}inAllowList(e,n){if(!this.normalizedAllowList||0===this.normalizedAllowList.length||"listing"===n&&this.includeWalletConnect)return!0;let t=P.normalize(e);return this.normalizedAllowList.some((e=>t===P.normalize(e)))}inDenyList(e,n){return"listing"===n&&"rabby"===e||"agw"===P.normalize(e)}chainMatches(e){return"ethereum-only"===this.chainFilter?"ethereum"===e:"solana-only"!==this.chainFilter||"solana"===e}getAllowListKey(e,n,t,l){let i=P.normalize(e);for(let e of this.normalizedAllowList||[])if(i===P.normalize(e))return e;if("connector"===n){if(("injected"===t||"solana_adapter"===t)&&"ethereum"===l&&this.detectedEth)return"detected_ethereum_wallets";if(("injected"===t||"solana_adapter"===t)&&"solana"===l&&this.detectedSol)return"detected_solana_wallets"}if("listing"===n&&this.includeWalletConnect)return"wallet_connect"}connectorOk(e){return!!("null"!==e.connectorType&&"walletconnect_solana"!==e.walletBranding.id&&this.chainMatches(e.chainType)&&(this.inAllowList(e.walletClientType,"connector")||("injected"===e.connectorType||"solana_adapter"===e.connectorType)&&("ethereum"===e.chainType&&this.detectedEth||"solana"===e.chainType&&this.detectedSol)))}listingOk(e){if(e.slug.includes("coinbase"))return!1;if("ethereum-only"===this.chainFilter){if(!this.isEth(e))return!1}else if("solana-only"===this.chainFilter&&!this.isSol(e))return!1;return!(!this.inAllowList(e.slug,"listing")||this.inDenyList(e.slug,"listing"))}getWallets(e,n){let t=new Map,l=e=>{let n=t.get(e.id);if(n){n.chainType!==e.chainType&&(n.chainType="multi");let t=new Set(n.chains);e.chains.forEach((e=>t.add(e))),n.chains=Array.from(t),!n.icon&&e.icon&&(n.icon=e.icon),!n.url&&e.url&&(n.url=e.url),!n.listing&&e.listing&&(n.listing=e.listing),!n.allowListKey&&e.allowListKey&&(n.allowListKey=e.allowListKey)}else t.set(e.id,e)};e.filter((e=>this.connectorOk(e))).forEach((e=>{let n=P.normalize(e.walletClientType);l({id:n,label:e.walletBranding?.name??n,source:"connector",connector:e,chainType:e.chainType,icon:e.walletBranding?.icon,url:void 0,chains:["ethereum"===e.chainType?"eip155":"solana"],allowListKey:this.getAllowListKey(e.walletClientType,"connector",e.connectorType,e.chainType)})}));let i=e.find((e=>"wallet_connect_v2"===e.connectorType)),a=e.find((e=>"walletconnect_solana"===e.walletBranding.id));n.filter((e=>this.listingOk(e))).forEach((n=>{let t=[...n.chains].filter((e=>e.includes("eip155:")||e.includes("solana:")));if(e.some((e=>P.normalize(e.walletClientType)===P.normalize(n.slug)&&"ethereum"===e.chainType&&"null"!==e.connectorType))||i||n.mobile.native||n.mobile.universal||_[n.slug]?.chainTypes.includes("ethereum")||(t=t.filter((e=>!e.includes("eip155:")))),e.some((e=>P.normalize(e.walletClientType)===P.normalize(n.slug)&&"solana"===e.chainType&&"null"!==e.connectorType))||a||n.mobile.native||n.mobile.universal||_[n.slug]?.chainTypes.includes("solana")||(t=t.filter((e=>!e.includes("solana:")))),!t.length)return;let o=P.normalize(n.slug),r=M[n.slug],c=r?.image_url?.sm||n.image_url?.sm;t.some((e=>e.includes("eip155:")))&&l({id:o,label:n.name||o,source:"listing",listing:n,chainType:"ethereum",icon:c,url:n.homepage,chains:t,allowListKey:this.getAllowListKey(n.slug,"listing")}),t.some((e=>e.includes("solana:")))&&l({id:o,label:n.name||o,source:"listing",listing:n,chainType:"solana",icon:c,url:n.homepage,chains:t,allowListKey:this.getAllowListKey(n.slug,"listing")})})),this.includeWalletConnectQr&&i&&l({id:"wallet_connect_qr",label:"WalletConnect",source:"connector",connector:i,chainType:"ethereum",icon:B,url:void 0,chains:["eip155"],allowListKey:"wallet_connect_qr"}),this.includeWalletConnectQrSolana&&a&&l({id:"wallet_connect_qr_solana",label:"WalletConnect",source:"connector",connector:a,chainType:"solana",icon:B,url:void 0,chains:["solana"],allowListKey:"wallet_connect_qr_solana"});let o=Array.from(t.values());o.forEach((e=>{let n=M[e.listing?.slug||e.id];n?.image_url?.sm&&(e.icon=n.image_url.sm)}));let r=new Map;return this.normalizedAllowList?.forEach(((e,n)=>{r.set(P.normalize(e),n)})),{wallets:o.slice().sort(((e,n)=>{if(e.allowListKey&&n.allowListKey){let t=this.normalizedAllowList?.findIndex((n=>P.normalize(n)===P.normalize(e.allowListKey)))??-1,l=this.normalizedAllowList?.findIndex((e=>P.normalize(e)===P.normalize(n.allowListKey)))??-1;if(t!==l&&t>=0&&l>=0)return t-l}if(e.allowListKey&&!n.allowListKey)return-1;if(!e.allowListKey&&n.allowListKey)return 1;let t=P.normalize(e.id),l=P.normalize(n.id);"binance-defi"===t?t="binance":"universalprofiles"===t?t="universal_profile":"cryptocom-defi"===t?t="cryptocom":"bitkeep"===t&&(t="bitget_wallet"),"binance-defi"===l?l="binance":"universalprofiles"===l?l="universal_profile":"cryptocom-defi"===l?l="cryptocom":"bitkeep"===l&&(l="bitget_wallet");let i=r.has(t),a=r.has(l);return i&&a?r.get(t)-r.get(l):i?-1:a?1:"connector"===e.source&&"listing"===n.source?-1:"listing"===e.source&&"connector"===n.source?1:e.label.toLowerCase().localeCompare(n.label.toLowerCase())})),walletCount:o.length}}constructor(e,n){this.chainFilter=e,n&&n.length>0&&(this.normalizedAllowList=n.map(String),this.normalizedAllowList.includes("binance")&&this.normalizedAllowList.push("binance-defi-wallet"),this.normalizedAllowList.includes("bitget_wallet")&&this.normalizedAllowList.push("bitkeep")),this.detectedEth=this.normalizedAllowList?.includes("detected_ethereum_wallets")??!1,this.detectedSol=this.normalizedAllowList?.includes("detected_solana_wallets")??!1,this.includeWalletConnect=this.normalizedAllowList?.includes("wallet_connect")??!1,this.includeWalletConnectQr=this.normalizedAllowList?.includes("wallet_connect_qr")??!1,this.includeWalletConnectQrSolana=this.normalizedAllowList?.includes("wallet_connect_qr_solana")??!1}}var Q=t=>/*#__PURE__*/e("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...t,children:[/*#__PURE__*/n("path",{d:"m0 0h32v32h-32z",fill:"#5469d4"}),/*#__PURE__*/n("path",{d:"m15.997 5.333-.143.486v14.106l.143.143 6.548-3.87z",fill:"#c2ccf4"}),/*#__PURE__*/n("path",{d:"m15.996 5.333-6.548 10.865 6.548 3.87z",fill:"#fff"}),/*#__PURE__*/n("path",{d:"m15.997 21.306-.08.098v5.025l.08.236 6.552-9.227z",fill:"#c2ccf4"}),/*#__PURE__*/n("path",{d:"m15.996 26.665v-5.36l-6.548-3.867z",fill:"#fff"}),/*#__PURE__*/n("path",{d:"m15.995 20.07 6.548-3.87-6.548-2.976v6.847z",fill:"#8698e8"}),/*#__PURE__*/n("path",{d:"m9.448 16.2 6.548 3.87v-6.846z",fill:"#c2ccf4"})]}),D=t=>/*#__PURE__*/e("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...t,children:[/*#__PURE__*/e("linearGradient",{id:"a",gradientUnits:"userSpaceOnUse",x1:"7.233",x2:"24.766",y1:"24.766",y2:"7.234",children:[/*#__PURE__*/n("stop",{offset:"0",stopColor:"#9945ff"}),/*#__PURE__*/n("stop",{offset:".2",stopColor:"#7962e7"}),/*#__PURE__*/n("stop",{offset:"1",stopColor:"#00d18c"})]}),/*#__PURE__*/n("path",{d:"m0 0h32v32h-32z",fill:"#10111a"}),/*#__PURE__*/n("path",{clipRule:"evenodd",d:"m9.873 20.41a.645.645 0 0 1 .476-.21l14.662.012a.323.323 0 0 1 .238.54l-3.123 3.438a.643.643 0 0 1 -.475.21l-14.662-.012a.323.323 0 0 1 -.238-.54zm15.376-2.862a.322.322 0 0 1 -.238.54l-14.662.012a.642.642 0 0 1 -.476-.21l-3.122-3.44a.323.323 0 0 1 .238-.54l14.662-.012a.644.644 0 0 1 .475.21zm-15.376-9.738a.644.644 0 0 1 .476-.21l14.662.012a.322.322 0 0 1 .238.54l-3.123 3.438a.643.643 0 0 1 -.475.21l-14.662-.012a.323.323 0 0 1 -.238-.54z",fill:"url(#a)",fillRule:"evenodd"})]});const R=h.div`
26
26
  display: flex;
27
27
  justify-content: space-between;
28
28
  align-items: center;
@@ -95,7 +95,7 @@ import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{Magnifyin
95
95
  100% 32px,
96
96
  100% 16px;
97
97
  background-attachment: local, scroll;
98
- `;function X({enabled:e=!0,walletList:n,walletChainType:t}){let l=v(),{connectors:i}=A(),{listings:r,loading:c}=k(e),s=t??l.appearance.walletChainType,d=n??l.appearance?.walletList,h=o((()=>new P(s,d)),[s,d]),{wallets:m,walletCount:u}=o((()=>h.getWallets(i,r)),[h,i,r]),[p,g]=a(""),w=o((()=>p?m.filter((e=>e.label.toLowerCase().includes(p.toLowerCase()))):m),[p,m]),[f,y]=a();return{selected:f,setSelected:y,search:p,setSearch:g,loadingListings:c,wallets:w,walletCount:u}}let Z=e=>!e||"string"!=typeof e&&(e instanceof T||e instanceof S);const ee=({index:l,style:i,data:a,recent:o})=>{let r=a.wallets[l],{walletChainType:c,handleWalletClick:s}=a,{t:d}=C(),h={...i,boxSizing:"border-box"};return r?/*#__PURE__*/e(ie,{style:h,onClick:()=>s(r),children:[r.icon&&(r.connector&&!Z(r.connector)?/*#__PURE__*/n(V,{children:"string"==typeof r.icon?/*#__PURE__*/n(Y,{src:r.icon}):/*#__PURE__*/n(r.icon,{style:{width:"32px",height:"32px"}})}):"string"==typeof r.icon?/*#__PURE__*/n(Y,{src:r.icon}):/*#__PURE__*/n(r.icon,{style:{width:"32px",height:"32px"}})),/*#__PURE__*/n(re,{children:r.label}),o?/*#__PURE__*/e(t,{children:[/*#__PURE__*/n(G,{children:d("connectWallet.lastUsed")}),/*#__PURE__*/n(ae,{children:/*#__PURE__*/e(t,{children:["ethereum-only"===c&&/*#__PURE__*/n(Q,{}),"solana-only"===c&&/*#__PURE__*/n(D,{})]})})]}):/*#__PURE__*/n(ae,{children:!("ethereum-only"===c||"solana-only"===c)&&/*#__PURE__*/e(t,{children:[r.chains?.some((e=>e.startsWith("eip155")))&&/*#__PURE__*/n(Q,{}),r.chains?.some((e=>e.startsWith("solana")))&&/*#__PURE__*/n(D,{})]})})]}):null};var ne=({className:h,customDescription:p,connectOnly:g,preSelectedWalletId:x,hideHeader:k,...B})=>{let O=v(),{t:N}=C(),{connectors:U}=A(),$=B.walletChainType||O.appearance.walletChainType,F=B.walletList||O.appearance?.walletList,{onBack:R,onClose:H,app:V}=B,{selected:G,setSelected:J,qrUrl:ne,setQrUrl:de,connecting:he,uiState:me,errorCode:ue,wallets:pe,walletCount:ge,handleConnect:we,handleBack:fe,showSearchBar:ye,isInitialConnectView:ve,title:be,search:Ce,setSearch:xe}=function({onConnect:e,onBack:n,onClose:t,onConnectError:l,walletList:i,walletChainType:c,app:s}){let h=v(),{connectors:m}=A(),{t:u}=C(),{wallets:p,walletCount:g,search:w,setSearch:f,selected:y,setSelected:x}=X({enabled:L(i??[]),walletList:i,walletChainType:c}),[_,k]=a(),[z,T]=a(),[S,j]=a(),[K,B]=a(),q=!y&&!S&&!K,I=q&&(g>6||w.length>0),O=m.find((e=>"wallet_connect_v2"===e.connectorType)),N=r((async(n,t)=>{if(n){if(K?.connector===n&&"loading"===_)return void console.log("Already connecting to this wallet, skipping duplicate attempt");if(k("loading"),"string"==typeof n)return B({connector:n,name:t?.name??"Wallet",icon:t?.icon,id:t?.id,url:t?.url}),void window.open(n,"_blank");B({connector:n,name:t?.name??n.walletBranding.name??"Wallet",icon:t?.icon??n.walletBranding.icon,id:t?.id,url:t?.url});try{let t=await n.connect({showPrompt:!0});if(!t)return k("error"),T(void 0),void l?.(new E("Unable to connect wallet"));k("success"),T(void 0),W({address:t.address,client:t.walletClientType,appId:h.id}),setTimeout((()=>{e({connector:n,wallet:t})}),b)}catch(n){if(console.error("ERROR: ",{e:n}),n?.message?.includes("already pending for origin")||n?.message?.includes("wallet_requestPermissions"))return void console.log("Connection request already pending, maintaining loading state");k("error"),T(n?.privyErrorCode),l?.(n instanceof Error?n:new E(n?.message||"Unable to connect wallet"))}}}),[h.id,e,K,_]),U=r((()=>S?(k(void 0),T(void 0),B(void 0),void j(void 0)):K?(k(void 0),T(void 0),void B(void 0)):y?(k(void 0),T(void 0),B(void 0),void x(void 0)):"error"===_||"loading"===_?(k(void 0),T(void 0),void B(void 0)):void n?.()),[S,K,y,_,n]),$=o((()=>K?.connector===O&&S&&d&&K?.name?u("connectWallet.goToWallet",{walletName:K.name}):K?.connector===O&&S&&K?.name?u("connectWallet.scanToConnect",{walletName:K.name}):S&&K?.name?u(d?"connectWallet.goToWallet":"connectWallet.scanToConnect",{walletName:K.name}):"string"==typeof K?.connector?u("connectWallet.openOrInstall",{walletName:K.name}):y&&!K?u("connectWallet.selectNetwork"):K?null:u("connectWallet.selectYourWallet")),[K,S,y,O,u]);return{selected:y,setSelected:x,qrUrl:S,setQrUrl:j,connecting:K,uiState:_,errorCode:z,search:w,setSearch:f,wallets:p,walletCount:g,wc:O,isInitialConnectView:q,showSearchBar:I,title:$,handleConnect:N,handleBack:U,onClose:t,onConnect:e,app:s}}({...B,walletList:F,walletChainType:$}),_e=U.find((e=>"wallet_connect_v2"===e.connectorType)),ke=U.find((e=>"walletconnect_solana"===e.walletBranding.id)),Le=c(null),We=i({count:pe.length,getScrollElement:()=>Le.current,estimateSize:()=>56,overscan:6,gap:5}),ze=r((async e=>{let n="solana-only"!==$&&e.chains?.some((e=>e.startsWith("eip155"))),t="ethereum-only"!==$&&e.chains?.some((e=>e.startsWith("solana"))),l=()=>{let n=e.id;return _[n]||_[`${n}_wallet`]},i=n=>{let t=P.normalize(e.id);return U.find((e=>P.normalize(e.walletClientType)===t&&e.chainType===n&&!("ethereum"===e.chainType&&e instanceof T||"solana"===e.chainType&&e instanceof S)))},a=async()=>{if(!_e||!e.listing)return!1;let n=M[e.listing.slug]?{...e.listing,...M[e.listing.slug]}:e.listing;return _e.setWalletEntry(n,de),await _e.resetConnection(e.id),await we(_e,{name:e.label,icon:e.icon,id:e.id,url:e.url}),!0},o=async()=>!!ke&&!!e.listing&&(await ke.disconnect(),ke.wallet.setWalletEntry(e.listing,de),await new Promise((e=>setTimeout(e,100))),await we(ke,{name:e.label,icon:e.icon,id:e.id,url:e.url}),!0),r=async n=>{let t=(e=>{let n=l();if(n)return n.getMobileRedirect({isSolana:e,connectOnly:!!g,useUniversalLink:!1})})(n);return!!t&&(await we(t,{name:e.label,icon:e.icon,id:e.id,url:e.url}),!0)};if(n&&t)J(e);else{if(n&&!t){let n=i("ethereum");if(n&&!Z(n))return void await we(n,{name:e.label,icon:e.icon,id:e.id,url:e.url});if(d&&l()){if(await r(!1)||await a())return}else if(await a()||await r(!1))return}if(t&&!n){let n=i("solana");if(n&&!Z(n))return void await we(n,{name:e.label,icon:e.icon,id:e.id,url:e.url});if(d){if(await r(!0)||await o())return}else if(await o()||await r(!0))return}if(!Z(e.connector)){if(_e&&"wallet_connect_v2"===e.connector?.connectorType)if(await _e.resetConnection(e.id),"wallet_connect_qr"!==e.id&&e.listing){let n=M[e.listing.slug]?{...e.listing,...M[e.listing.slug]}:e.listing;_e.setWalletEntry(n,de)}else _e.setWalletEntry({id:"wallet_connect_qr",name:"WalletConnect",rdns:"",slug:"wallet-connect",homepage:"",chains:["eip155"],mobile:{native:"",universal:void 0}},de);return ke&&"walletconnect_solana"===e.connector?.walletBranding.id&&(await ke.disconnect(),"wallet_connect_qr_solana"!==e.id&&e.listing?ke.wallet.setWalletEntry(e.listing,de):ke.wallet.setWalletEntry({id:"wallet_connect_solana_qr",name:"WalletConnect",rdns:"",slug:"wallet-connect-solana",homepage:"",chains:["solana"],mobile:{native:"",universal:void 0}},de),await new Promise((e=>setTimeout(e,100)))),void await we(e.connector,{name:e.label,icon:e.icon,id:e.id,url:e.url})}e.url&&await we(e.url,{name:e.label,icon:e.icon,id:e.id,url:e.url})}}),[_e,ke,we,J,de,$,g,U]);return s((()=>{if(!x)return;let e=pe.find((({id:e})=>e===x));e&&ze(e).catch(console.error)}),[x]),/*#__PURE__*/e(I,{className:h,children:[/*#__PURE__*/n(I.Header,{icon:k&&ve?void 0:he&&!ne||ne&&d&&he?.icon?he.icon:he?void 0:K,iconVariant:he&&!ne||ne&&d?"loading":void 0,iconLoadingStatus:he&&!ne||ne&&d?{success:"success"===me,fail:"error"===me}:void 0,title:k&&ve?void 0:he&&!ne?N("connectWallet.waitingForWallet",{walletName:he.name}):ne&&d?N("connectWallet.waitingForWallet",{walletName:he?.name??"connection"}):be,subtitle:k&&ve?void 0:he&&!ne&&"string"==typeof he.connector?N("connectWallet.installAndConnect",{walletName:he.name}):he&&!ne&&"string"!=typeof he.connector?"error"===me?ue===j.NO_SOLANA_ACCOUNTS?`The connected wallet has no Solana accounts. Please add a Solana account in ${he.name} and try again.`:N("connectWallet.tryConnectingAgain"):N("connectionStatus.connectOneWallet"):ve?p??(V?N("connectWallet.connectToAccount",{appName:V.name}):null):null,showBack:!!R||!ve,showClose:!0,onBack:R||fe,onClose:H}),/*#__PURE__*/e(I.Body,{ref:Le,$colorScheme:O.appearance.palette.colorScheme,style:{marginBottom:ne?"0.5rem":void 0},children:[ye&&/*#__PURE__*/n(te,{children:/*#__PURE__*/e(y,{style:{background:"transparent"},children:[/*#__PURE__*/n(z,{children:/*#__PURE__*/n(l,{})}),/*#__PURE__*/n("input",{className:"login-method-button",type:"text",placeholder:N("connectWallet.searchPlaceholder",{count:String(ge)}),onChange:e=>xe(e.target.value),value:Ce})]})}),ne&&d&&"loading"===me&&/*#__PURE__*/e("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"},children:[/*#__PURE__*/n(m,{variant:"primary",onClick:()=>window.open(ne.universal??ne.native,"_blank"),style:{width:"100%"},children:N("connectWallet.openInApp")}),/*#__PURE__*/n(ce,{value:ne.universal??ne.native,iconOnly:!0,children:"Copy link"})]}),ne&&!d&&"loading"===me&&/*#__PURE__*/n("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"},children:/*#__PURE__*/n(ce,{value:ne.universal??ne.native,iconOnly:!0,children:N("connectWallet.copyLink")})}),ne&&!d&&/*#__PURE__*/n(f,{size:280,url:ne.universal??ne.native,squareLogoElement:he?.icon?"string"==typeof he.icon?e=>/*#__PURE__*/n("svg",{...e,children:/*#__PURE__*/n("image",{href:he.icon,height:e.height,width:e.width})}):he.icon:q}),ne&&!d&&he?.url&&("binance"===he.id||"binanceus"===he.id||"binance-defi"===he.id)&&/*#__PURE__*/e(se,{children:[/*#__PURE__*/e("span",{children:["Don't have ",he.name,"? "]}),/*#__PURE__*/n(w,{href:he.url,target:"_blank",size:"sm",children:"Download here"})]}),/*#__PURE__*/e(le,{children:[he&&!ne&&"string"==typeof he.connector&&/*#__PURE__*/e(ie,{onClick:()=>window.open(he.connector,"_blank"),children:[he.icon&&("string"==typeof he.icon?/*#__PURE__*/n(Y,{src:he.icon}):/*#__PURE__*/n(he.icon,{})),/*#__PURE__*/n(re,{children:he.name})]}),G?.chains.some((e=>e.startsWith("eip155")))&&!he&&/*#__PURE__*/e(ie,{onClick:()=>ze({...G,chains:G.chains.filter((e=>e.startsWith("eip155")))}),children:[G.icon&&("string"==typeof G.icon?/*#__PURE__*/n(Y,{src:G.icon}):/*#__PURE__*/n(G.icon,{})),/*#__PURE__*/n(re,{children:G.label}),/*#__PURE__*/n(ae,{children:/*#__PURE__*/n(Q,{})})]}),G?.chains.some((e=>e.startsWith("solana")))&&!he&&/*#__PURE__*/e(ie,{onClick:()=>ze({...G,chains:G.chains.filter((e=>e.startsWith("solana")))}),children:[G.icon&&("string"==typeof G.icon?/*#__PURE__*/n(Y,{src:G.icon}):/*#__PURE__*/n(G.icon,{})),/*#__PURE__*/n(re,{children:G.label}),/*#__PURE__*/n(ae,{children:/*#__PURE__*/n(D,{})})]}),ve&&/*#__PURE__*/e(t,{children:[!(ge>0)&&/*#__PURE__*/n(oe,{children:N("connectWallet.noWalletsFound")}),ge>0&&!ne&&/*#__PURE__*/n("div",{style:{maxHeight:56*Math.min(pe.length,5)+5,width:"100%"},children:/*#__PURE__*/n("div",{style:{height:`${We.getTotalSize()}px`,width:"100%",position:"relative"},children:We.getVirtualItems().map((e=>/*#__PURE__*/n(ee,{index:e.index,style:{position:"absolute",top:0,left:0,height:`${e.size}px`,transform:`translateY(${e.start}px)`},data:{wallets:pe,walletChainType:$,handleWalletClick:ze}},e.key)))})})]})]})]}),/*#__PURE__*/e(I.Footer,{children:[he&&!ne&&"string"!=typeof he.connector&&"error"===me&&/*#__PURE__*/n(I.Actions,{children:/*#__PURE__*/n(m,{style:{width:"100%",alignItems:"center"},variant:"error",onClick:()=>we(he.connector,{name:he.name,icon:he.icon,id:he.id,url:he.url}),children:N("connectWallet.retry")})}),!!(V&&V.legal.privacyPolicyUrl&&V.legal.termsAndConditionsUrl)&&/*#__PURE__*/n(u,{app:V,alwaysShowImplicitConsent:!0}),/*#__PURE__*/n(I.Watermark,{})]})]})};let te=h.div`
98
+ `;function X({enabled:e=!0,walletList:n,walletChainType:t}){let l=v(),{connectors:i}=A(),{listings:r,loading:c}=k(e),s=t??l.appearance.walletChainType,d=n??l.appearance?.walletList,h=o((()=>new P(s,d)),[s,d]),{wallets:m,walletCount:u}=o((()=>h.getWallets(i,r)),[h,i,r]),[p,g]=a(""),w=o((()=>p?m.filter((e=>e.label.toLowerCase().includes(p.toLowerCase()))):m),[p,m]),[f,y]=a();return{selected:f,setSelected:y,search:p,setSearch:g,loadingListings:c,wallets:w,walletCount:u}}let Z=e=>!e||"string"!=typeof e&&(e instanceof T||e instanceof S);const ee=({index:l,style:i,data:a,recent:o})=>{let r=a.wallets[l],{walletChainType:c,handleWalletClick:s}=a,{t:d}=C(),h={...i,boxSizing:"border-box"};return r?/*#__PURE__*/e(ie,{style:h,onClick:()=>s(r),children:[r.icon&&(r.connector&&!Z(r.connector)?/*#__PURE__*/n(V,{children:"string"==typeof r.icon?/*#__PURE__*/n(Y,{src:r.icon}):/*#__PURE__*/n(r.icon,{style:{width:"32px",height:"32px"}})}):"string"==typeof r.icon?/*#__PURE__*/n(Y,{src:r.icon}):/*#__PURE__*/n(r.icon,{style:{width:"32px",height:"32px"}})),/*#__PURE__*/n(re,{children:r.label}),o?/*#__PURE__*/e(t,{children:[/*#__PURE__*/n(G,{children:d("connectWallet.lastUsed")}),/*#__PURE__*/n(ae,{children:/*#__PURE__*/e(t,{children:["ethereum-only"===c&&/*#__PURE__*/n(Q,{}),"solana-only"===c&&/*#__PURE__*/n(D,{})]})})]}):/*#__PURE__*/n(ae,{children:!("ethereum-only"===c||"solana-only"===c)&&/*#__PURE__*/e(t,{children:[r.chains?.some((e=>e.startsWith("eip155")))&&/*#__PURE__*/n(Q,{}),r.chains?.some((e=>e.startsWith("solana")))&&/*#__PURE__*/n(D,{})]})})]}):null};var ne=({className:h,customDescription:p,connectOnly:g,preSelectedWalletId:x,hideHeader:k,...B})=>{let q=v(),{t:N}=C(),{connectors:U}=A(),$=B.walletChainType||q.appearance.walletChainType,F=B.walletList||q.appearance?.walletList,{onBack:R,onClose:H,app:V}=B,{selected:G,setSelected:J,qrUrl:ne,setQrUrl:de,connecting:he,uiState:me,errorCode:ue,wallets:pe,walletCount:ge,handleConnect:we,handleBack:fe,showSearchBar:ye,isInitialConnectView:ve,title:be,search:Ce,setSearch:xe}=function({onConnect:e,onBack:n,onClose:t,onConnectError:l,walletList:i,walletChainType:c,app:s}){let h=v(),{connectors:m}=A(),{t:u}=C(),{wallets:p,walletCount:g,search:w,setSearch:f,selected:y,setSelected:x}=X({enabled:L(i??[]),walletList:i,walletChainType:c}),[_,k]=a(),[z,T]=a(),[S,j]=a(),[K,B]=a(),I=!y&&!S&&!K,O=I&&(g>6||w.length>0),q=m.find((e=>"wallet_connect_v2"===e.connectorType)),N=r((async(n,t)=>{if(n){if(K?.connector===n&&"loading"===_)return void console.log("Already connecting to this wallet, skipping duplicate attempt");if(k("loading"),"string"==typeof n)return B({connector:n,name:t?.name??"Wallet",icon:t?.icon,id:t?.id,url:t?.url}),void window.open(n,"_blank");B({connector:n,name:t?.name??n.walletBranding.name??"Wallet",icon:t?.icon??n.walletBranding.icon,id:t?.id,url:t?.url});try{let t=await n.connect({showPrompt:!0});if(!t)return k("error"),T(void 0),void l?.(new E("Unable to connect wallet"));k("success"),T(void 0),W({address:t.address,client:t.walletClientType,appId:h.id}),setTimeout((()=>{e({connector:n,wallet:t})}),b)}catch(n){if(console.error("ERROR: ",{e:n}),n?.message?.includes("already pending for origin")||n?.message?.includes("wallet_requestPermissions"))return void console.log("Connection request already pending, maintaining loading state");k("error"),T(n?.privyErrorCode),l?.(n instanceof Error?n:new E(n?.message||"Unable to connect wallet"))}}}),[h.id,e,K,_]),U=r((()=>S?(k(void 0),T(void 0),B(void 0),void j(void 0)):K?(k(void 0),T(void 0),void B(void 0)):y?(k(void 0),T(void 0),B(void 0),void x(void 0)):"error"===_||"loading"===_?(k(void 0),T(void 0),void B(void 0)):void n?.()),[S,K,y,_,n]),$=o((()=>K?.connector===q&&S&&d&&K?.name?u("connectWallet.goToWallet",{walletName:K.name}):K?.connector===q&&S&&K?.name?u("connectWallet.scanToConnect",{walletName:K.name}):S&&K?.name?u(d?"connectWallet.goToWallet":"connectWallet.scanToConnect",{walletName:K.name}):"string"==typeof K?.connector?u("connectWallet.openOrInstall",{walletName:K.name}):y&&!K?u("connectWallet.selectNetwork"):K?null:u("connectWallet.selectYourWallet")),[K,S,y,q,u]);return{selected:y,setSelected:x,qrUrl:S,setQrUrl:j,connecting:K,uiState:_,errorCode:z,search:w,setSearch:f,wallets:p,walletCount:g,wc:q,isInitialConnectView:I,showSearchBar:O,title:$,handleConnect:N,handleBack:U,onClose:t,onConnect:e,app:s}}({...B,walletList:F,walletChainType:$}),_e=U.find((e=>"wallet_connect_v2"===e.connectorType)),ke=U.find((e=>"walletconnect_solana"===e.walletBranding.id)),Le=c(null),We=i({count:pe.length,getScrollElement:()=>Le.current,estimateSize:()=>56,overscan:6,gap:5}),ze=r((async e=>{let n="solana-only"!==$&&e.chains?.some((e=>e.startsWith("eip155"))),t="ethereum-only"!==$&&e.chains?.some((e=>e.startsWith("solana"))),l=()=>{let n=e.id;return _[n]||_[`${n}_wallet`]},i=n=>{let t=P.normalize(e.id);return U.find((e=>P.normalize(e.walletClientType)===t&&e.chainType===n&&!("ethereum"===e.chainType&&e instanceof T||"solana"===e.chainType&&e instanceof S)))},a=async()=>{if(!_e||!e.listing)return!1;let n=M[e.listing.slug]?{...e.listing,...M[e.listing.slug]}:e.listing;return _e.setWalletEntry(n,de),await _e.resetConnection(e.id),await we(_e,{name:e.label,icon:e.icon,id:e.id,url:e.url}),!0},o=async()=>!!ke&&!!e.listing&&(await ke.disconnect(),ke.wallet.setWalletEntry(e.listing,de),await new Promise((e=>setTimeout(e,100))),await we(ke,{name:e.label,icon:e.icon,id:e.id,url:e.url}),!0),r=async n=>{let t=(e=>{let n=l();if(n)return n.getMobileRedirect({isSolana:e,connectOnly:!!g,useUniversalLink:!1})})(n);return!!t&&(await we(t,{name:e.label,icon:e.icon,id:e.id,url:e.url}),!0)};if(n&&t)J(e);else{if(n&&!t){let n=i("ethereum");if(n&&!Z(n))return void await we(n,{name:e.label,icon:e.icon,id:e.id,url:e.url});if(d&&l()){if(await r(!1)||await a())return}else if(await a()||await r(!1))return}if(t&&!n){let n=i("solana");if(n&&!Z(n))return void await we(n,{name:e.label,icon:e.icon,id:e.id,url:e.url});if(d){if(await r(!0)||await o())return}else if(await o()||await r(!0))return}if(!Z(e.connector)){if(_e&&"wallet_connect_v2"===e.connector?.connectorType)if(await _e.resetConnection(e.id),"wallet_connect_qr"!==e.id&&e.listing){let n=M[e.listing.slug]?{...e.listing,...M[e.listing.slug]}:e.listing;_e.setWalletEntry(n,de)}else _e.setWalletEntry({id:"wallet_connect_qr",name:"WalletConnect",rdns:"",slug:"wallet-connect",homepage:"",chains:["eip155"],mobile:{native:"",universal:void 0}},de);return ke&&"walletconnect_solana"===e.connector?.walletBranding.id&&(await ke.disconnect(),"wallet_connect_qr_solana"!==e.id&&e.listing?ke.wallet.setWalletEntry(e.listing,de):ke.wallet.setWalletEntry({id:"wallet_connect_solana_qr",name:"WalletConnect",rdns:"",slug:"wallet-connect-solana",homepage:"",chains:["solana"],mobile:{native:"",universal:void 0}},de),await new Promise((e=>setTimeout(e,100)))),void await we(e.connector,{name:e.label,icon:e.icon,id:e.id,url:e.url})}e.url&&await we(e.url,{name:e.label,icon:e.icon,id:e.id,url:e.url})}}),[_e,ke,we,J,de,$,g,U]);return s((()=>{if(!x)return;let e=pe.find((({id:e})=>e===x));e&&ze(e).catch(console.error)}),[x]),/*#__PURE__*/e(O,{className:h,children:[/*#__PURE__*/n(O.Header,{icon:k&&ve?void 0:he&&!ne||ne&&d&&he?.icon?he.icon:he?void 0:K,iconVariant:he&&!ne||ne&&d?"loading":void 0,iconLoadingStatus:he&&!ne||ne&&d?{success:"success"===me,fail:"error"===me}:void 0,title:k&&ve?void 0:he&&!ne?N("connectWallet.waitingForWallet",{walletName:he.name}):ne&&d?N("connectWallet.waitingForWallet",{walletName:he?.name??"connection"}):be,subtitle:k&&ve?void 0:he&&!ne&&"string"==typeof he.connector?N("connectWallet.installAndConnect",{walletName:he.name}):he&&!ne&&"string"!=typeof he.connector?"error"===me?ue===j.NO_SOLANA_ACCOUNTS?`The connected wallet has no Solana accounts. Please add a Solana account in ${he.name} and try again.`:N("connectWallet.tryConnectingAgain"):N("connectionStatus.connectOneWallet"):ve?p??(V?N("connectWallet.connectToAccount",{appName:V.name}):null):null,showBack:!!R||!ve,showClose:!0,onBack:R||fe,onClose:H}),/*#__PURE__*/e(O.Body,{ref:Le,$colorScheme:q.appearance.palette.colorScheme,style:{marginBottom:ne?"0.5rem":void 0},children:[ye&&/*#__PURE__*/n(te,{children:/*#__PURE__*/e(y,{style:{background:"transparent"},children:[/*#__PURE__*/n(z,{children:/*#__PURE__*/n(l,{})}),/*#__PURE__*/n("input",{className:"login-method-button",type:"text",placeholder:N("connectWallet.searchPlaceholder",{count:String(ge)}),onChange:e=>xe(e.target.value),value:Ce})]})}),ne&&d&&"loading"===me&&/*#__PURE__*/e("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"},children:[/*#__PURE__*/n(m,{variant:"primary",onClick:()=>window.open(ne.universal??ne.native,"_blank"),style:{width:"100%"},children:N("connectWallet.openInApp")}),/*#__PURE__*/n(ce,{value:ne.universal??ne.native,iconOnly:!0,children:"Copy link"})]}),ne&&!d&&"loading"===me&&/*#__PURE__*/n("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"},children:/*#__PURE__*/n(ce,{value:ne.universal??ne.native,iconOnly:!0,children:N("connectWallet.copyLink")})}),ne&&!d&&/*#__PURE__*/n(f,{size:280,url:ne.universal??ne.native,squareLogoElement:he?.icon?"string"==typeof he.icon?e=>/*#__PURE__*/n("svg",{...e,children:/*#__PURE__*/n("image",{href:he.icon,height:e.height,width:e.width})}):he.icon:I}),ne&&!d&&he?.url&&("binance"===he.id||"binanceus"===he.id||"binance-defi"===he.id)&&/*#__PURE__*/e(se,{children:[/*#__PURE__*/e("span",{children:["Don't have ",he.name,"? "]}),/*#__PURE__*/n(w,{href:he.url,target:"_blank",size:"sm",children:"Download here"})]}),/*#__PURE__*/e(le,{children:[he&&!ne&&"string"==typeof he.connector&&/*#__PURE__*/e(ie,{onClick:()=>window.open(he.connector,"_blank"),children:[he.icon&&("string"==typeof he.icon?/*#__PURE__*/n(Y,{src:he.icon}):/*#__PURE__*/n(he.icon,{})),/*#__PURE__*/n(re,{children:he.name})]}),G?.chains.some((e=>e.startsWith("eip155")))&&!he&&/*#__PURE__*/e(ie,{onClick:()=>ze({...G,chains:G.chains.filter((e=>e.startsWith("eip155")))}),children:[G.icon&&("string"==typeof G.icon?/*#__PURE__*/n(Y,{src:G.icon}):/*#__PURE__*/n(G.icon,{})),/*#__PURE__*/n(re,{children:G.label}),/*#__PURE__*/n(ae,{children:/*#__PURE__*/n(Q,{})})]}),G?.chains.some((e=>e.startsWith("solana")))&&!he&&/*#__PURE__*/e(ie,{onClick:()=>ze({...G,chains:G.chains.filter((e=>e.startsWith("solana")))}),children:[G.icon&&("string"==typeof G.icon?/*#__PURE__*/n(Y,{src:G.icon}):/*#__PURE__*/n(G.icon,{})),/*#__PURE__*/n(re,{children:G.label}),/*#__PURE__*/n(ae,{children:/*#__PURE__*/n(D,{})})]}),ve&&/*#__PURE__*/e(t,{children:[!(ge>0)&&/*#__PURE__*/n(oe,{children:N("connectWallet.noWalletsFound")}),ge>0&&!ne&&/*#__PURE__*/n("div",{style:{maxHeight:56*Math.min(pe.length,5)+5,width:"100%"},children:/*#__PURE__*/n("div",{style:{height:`${We.getTotalSize()}px`,width:"100%",position:"relative"},children:We.getVirtualItems().map((e=>/*#__PURE__*/n(ee,{index:e.index,style:{position:"absolute",top:0,left:0,height:`${e.size}px`,transform:`translateY(${e.start}px)`},data:{wallets:pe,walletChainType:$,handleWalletClick:ze}},e.key)))})})]})]})]}),/*#__PURE__*/e(O.Footer,{children:[he&&!ne&&"string"!=typeof he.connector&&"error"===me&&/*#__PURE__*/n(O.Actions,{children:/*#__PURE__*/n(m,{style:{width:"100%",alignItems:"center"},variant:"error",onClick:()=>we(he.connector,{name:he.name,icon:he.icon,id:he.id,url:he.url}),children:N("connectWallet.retry")})}),!!(V&&V.legal.privacyPolicyUrl&&V.legal.termsAndConditionsUrl)&&/*#__PURE__*/n(u,{app:V,alwaysShowImplicitConsent:!0}),/*#__PURE__*/n(O.Watermark,{})]})]})};let te=h.div`
99
99
  position: sticky;
100
100
  // Offset by negative margin to account for focus outline
101
101
  margin-top: -3px;
@@ -0,0 +1,7 @@
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useEffect as i,useState as a,useCallback as r}from"react";import{isMobile as c}from"react-device-detect";import{styled as l}from"styled-components";import{a as s,S as d,W as m,B as u,b as p}from"./index-BXdEd5-h.mjs";import{L as g}from"./Link-DJ5gq9Di.mjs";import{u as w,q as h}from"./context-BEE1GR3p.mjs";import{u as S}from"./useI18n-BWqAKjsd.mjs";import{C as y,P as f,d as C}from"./use-export-wallet-DmJRcrg3.mjs";import{Q as b,r as v,T}from"./useActiveWallet-CeJ_zia0.mjs";import{isHex as _,getAddress as E}from"viem";import{c as R,u as k,k as A}from"./internal-context-C4ZqP8IF.mjs";import{u as W,a as I}from"./get-is-unified-wallet-szLxUazm.mjs";import{s as L}from"./shouldProceedtoEmbeddedWalletCreationFlow-eeAK_6M1.mjs";import{u as j}from"./PrivyPluginContext-2QN2dVUw.mjs";import{e as U}from"./usePrivy-DZkUhG2n.mjs";import{S as O}from"./ScreenLayout-DOt2sB2J.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"zustand";import"ofetch";import"./paths-BzM95ysC.mjs";import"js-cookie";import"mipd";import"viem/utils";import"@privy-io/popup";import"@scure/base";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"./get-entropy-details-for-user-DXl-F6zT.mjs";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./getPublicClient-BltMpU4i.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"tinycolor2";import"./ModalHeader-Byy3j4Lh.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Ct4Lyoaf.mjs";import"./index-Dq_xe9dz.mjs";const N=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter((e=>_(e,{strict:!0}))).map((e=>E(e)));return!!t?.length&&!!e?.linkedAccounts.filter((e=>"wallet"==e.type&&t.includes(e.address))).length};const x=e=>e?.privyErrorCode===R.LINKED_TO_ANOTHER_USER?y.ERROR_USER_EXISTS:e instanceof f&&!e.details.default?e.details:e instanceof C?y.ERROR_TIMED_OUT:e?.privyErrorCode===R.CANNOT_LINK_MORE_OF_TYPE?y.ERROR_USER_LIMIT_REACHED:y.ERROR_WALLET_CONNECTION,M=({walletLogo:o,title:i,subtitle:a,signSuccess:r,errorMessage:c,connectSuccess:l,separateConnectAndSign:s,signing:d,walletConnectRedirectUri:m,walletConnectFallbackUniversalUri:u,hasTabbedAway:p,showCoinbaseWalletResetCta:w,numRetries:h,onBack:f,onSign:C,onRetry:b,onCoinbaseReset:v,onDifferentWallet:T})=>{let{t:_}=S(),E=w?{label:"Use a different wallet",onClick:v,disabled:r}:c===y.ERROR_USER_EXISTS&&f?{label:"Use a different wallet",onClick:T}:l&&!r&&s?{label:d?"Signing":"Sign with your wallet",onClick:C,disabled:d}:!r&&c?.retryable&&h<2?{label:"Retry",onClick:b,disabled:!1}:r||c?void 0:{label:_("connectionStatus.connecting"),onClick:()=>{},disabled:!0};/*#__PURE__*/return e(O,{title:i,subtitle:a,icon:o,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!c},primaryCta:E,onBack:f,watermark:!0,children:!l&&m&&!p&&/*#__PURE__*/t(B,{children:[_("connectionStatus.stillHere")," ",/*#__PURE__*/e(g,{href:m,target:"_blank",variant:"underlined",size:"sm",children:_("connectionStatus.tryConnectingAgain")}),u&&/*#__PURE__*/t(n,{children:[" ",_("connectionStatus.or")," ",/*#__PURE__*/e(g,{href:u,target:"_blank",variant:"underlined",size:"sm",children:_("connectionStatus.useDifferentLink")})]})]})})},D={component:()=>{let t,[n,l]=a(!1),[g,f]=a(!1),[C,_]=a(void 0),{authenticated:E,logout:O}=W(),{navigate:D,navigateBack:B,lastScreen:F,currentScreen:P,setModalData:q,data:H}=I(),X=w(),{t:z}=S(),{getAuthFlow:K,walletConnectionStatus:Q,closePrivyModal:Y,initLoginWithWallet:J,loginWithWallet:V,updateWallets:$,createAnalyticsEvent:G}=k(),{walletConnectors:Z}=W(),[ee,te]=a(0),{user:ne}=W(),oe=j(),[ie]=a(ne?.linkedAccounts.length||0),[ae,re]=a(""),[ce,le]=a(""),[se,de]=a(!1),{hasTabbedAway:me}=function(){let[e,t]=a(!1),n=r((()=>{document.hidden&&t(!0)}),[]);return i((()=>(document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n))),[n]),{hasTabbedAway:e,reset:()=>t(!1)}}(),{enabled:ue,token:pe}=s(),ge=b(Q?.connector?.walletClientType||"unknown"),we=c&&"wallet_connect_v2"===Q?.connector?.connectorType||c&&"coinbase_wallet"===Q?.connector?.connectorType||c&&"base_account"===Q?.connector?.connectorType||c&&"injected"===Q?.connector?.connectorType&&"phantom"===Q?.connector?.walletClientType||c&&"solana_adapter"===Q?.connector?.connectorType&&"mobile_wallet_adapter"===Q.connector.walletClientType,he="connected"===Q?.status,Se="switching_to_supported_chain"===Q?.status;i((()=>{let e=K(),t=e instanceof p||e instanceof d?e:void 0;he&&"solana"===Q.connector?.chainType&&"phantom"===Q.connector?.walletClientType&&oe(U)&&void 0===H?.login?.isSigningInWithLedgerSolana?D("ConnectLedgerScreen",!1):(he&&!t&&(!ue||pe||E?J(Q.connectedWallet,pe,H?.login?.disableSignup,H?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})):(q({captchaModalData:{callback:e=>J(Q.connectedWallet,e,H?.login?.disableSignup,H?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})),userIntentRequired:!1,onSuccessNavigateTo:"ConnectionStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),D("CaptchaScreen",!1))),t instanceof d&&H?.login?.isSigningInWithLedgerSolana&&(t.messageType="transaction"),t&&we&&he&&!t.preparedMessage?t.buildMessage():t&&!we&&he&&(g||(async()=>{f(!0),_(void 0);try{"wallet_connect_v2"===Q?.connector?.connectorType&&"metamask"===Q?.connector?.walletClientType&&await v(2500),await fe()}catch(e){console.warn("Auto-prompted signature failed",e)}finally{f(!1)}})()))}),[ee,he,se]),i((()=>{if(ne&&n){let e=h-500;if(X?.legal.requireUsersAcceptTerms&&!ne.hasAcceptedTerms){let t=setTimeout((()=>{D("AffirmativeConsentScreen")}),e);return()=>clearTimeout(t)}if(L(ne,X.embeddedWallets)){let t=setTimeout((()=>{q({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),G({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"ConnectionStatusScreen"}}),O()},callAuthOnSuccessOnClose:!0}}),D("EmbeddedWalletOnAccountCreateScreen")}),e);return()=>clearTimeout(t)}$();let t=setTimeout((()=>Y({shouldCallAuthOnSuccess:!0,isSuccess:!0})),h);return()=>clearTimeout(t)}}),[ne,n]);let ye=e=>{if(e?.privyErrorCode!==R.ALLOWLIST_REJECTED){if(e?.privyErrorCode===R.USER_LIMIT_REACHED)return console.error(new A(e).toString()),void D("UserLimitReachedScreen");if(e?.privyErrorCode!==R.USER_DOES_NOT_EXIST)return e?.privyErrorCode===R.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce?(q({accountTransfer:{nonce:e.data?.data?.nonce,account:K()?.meta.address,displayName:e.data?.data?.account?.displayName,externalWalletMetadata:{walletClientType:K()?.meta.walletClientType,chainId:K()?.meta.chainId,connectorType:K()?.meta.connectorType},linkMethod:K()instanceof p?"siwe":"siws",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void D("LinkConflictScreen")):void _(x(e));D("AccountNotFoundScreen")}else D("AllowlistRejectionScreen")};async function fe(){try{await V(),l(!0)}catch(e){ye(e)}finally{f(!1)}}i((()=>{Q?.connectError&&ye(Q?.connectError)}),[Q]),((e,t)=>{let n=o((()=>{}));i((()=>{n.current=e})),i((()=>{if(null!==t){let e=setInterval((()=>n.current()),t||0);return()=>clearInterval(e)}}),[t])})((()=>{let e="wallet_connect_v2"===Ce&&Q?.connector instanceof m?Q.connector.redirectUri:void 0;e&&re(e);let t="wallet_connect_v2"===Ce&&Q?.connector instanceof m?Q.connector.fallbackUniversalRedirectUri:void 0;t&&le(t)}),Q?.connector instanceof m&&!ae?500:null);let Ce=Q?.connector?.connectorType||"injected",be=Q?.connector?.walletClientType||"unknown",ve=ge?.metadata?.shortName||ge?.name||Q?.connector?.walletBranding.name||"Browser Extension",Te=ge?.image_url?.md||Q?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(u,{...t})),_e="Browser Extension"===ve?ve.toLowerCase():ve;t=n?z("connectionStatus.successfullyConnected",{walletName:_e}):C?z("connectionStatus.errorTitle",{errorMessage:C.message}):Se?"Switching networks":he?g&&we?"Signing":"Sign to verify":`Waiting for ${_e}`;let Ee=z("connectionStatus.checkOtherWindows");n?Ee=ie===(ne?.linkedAccounts.length||0)?"Wallet was already linked.":"You're good to go!":ee>=2&&C?Ee="Unable to connect wallet":C?Ee=C.detail:Se?Ee="Switch your wallet to the requested network.":he&&we?Ee="Sign the message in your wallet to verify it belongs to you.":"metamask"===be&&c?Ee="Click continue to open and connect MetaMask.":"metamask"===be?Ee="For the best experience, connect only one wallet at a time.":"wallet_connect"===Ce?Ee="Open your mobile wallet app to continue":"coinbase_wallet"===Ce?T()||(Ee=N(ne)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Confirm in the Coinbase app/popup to continue."):H?.login?.isSigningInWithLedgerSolana&&(Ee="Ledger requires a transaction to verify your identity. You'll sign a transaction that performs no onchain action.");let Re=Z?.walletConnectors?.find((e=>"coinbase_wallet"===e.walletClientType)),ke="coinbase_wallet"===be&&(N(ne)||C===y.ERROR_USER_EXISTS);/*#__PURE__*/return e(M,{walletLogo:Te,title:t,subtitle:Ee,signSuccess:n,errorMessage:C,connectSuccess:he,separateConnectAndSign:we,signing:g,walletConnectRedirectUri:ae,walletConnectFallbackUniversalUri:ce,hasTabbedAway:me,showCoinbaseWalletResetCta:ke,numRetries:ee,onBack:F&&P!==F?B:void 0,onSign:()=>{f(!0),fe()},onRetry:()=>{te(ee+1),_(void 0),he?(f(!0),fe()):Q?.connectRetry()},onCoinbaseReset:()=>{Re&&Re?.disconnect()},onDifferentWallet:B})}};let B=l.p`
2
+ text-align: center;
3
+ color: var(--privy-color-foreground-2);
4
+ font-size: 14px;
5
+ line-height: 22px;
6
+ margin: 16px 0;
7
+ `;export{D as ConnectionStatusScreen,M as ConnectionStatusView,D as default,x as getErrorDetails};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useState as o,useEffect as r}from"react";import{u as i,q as a}from"./context-BEE1GR3p.mjs";import{R as s}from"./index-BXdEd5-h.mjs";import{u as n,b as c,e as p,c as l}from"./internal-context-C4ZqP8IF.mjs";import{a as m}from"./get-is-unified-wallet-szLxUazm.mjs";import{A as d}from"./useActiveWallet-CeJ_zia0.mjs";import{s as u}from"./shouldProceedtoEmbeddedWalletCreationFlow-eeAK_6M1.mjs";import{S as f}from"./ScreenLayout-DOt2sB2J.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./use-export-wallet-DmJRcrg3.mjs";import"viem/utils";import"./get-entropy-details-for-user-DXl-F6zT.mjs";import"zustand";import"@coinbase/wallet-sdk";import"react-device-detect";import"@walletconnect/ethereum-provider";import"./usePrivy-DZkUhG2n.mjs";import"./events-context-CI0iqAXA.mjs";import"ofetch";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@privy-io/popup";import"@scure/base";import"styled-components";import"@headlessui/react";import"@privy-io/urls";import"viem";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./getPublicClient-BltMpU4i.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./ModalHeader-Byy3j4Lh.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Ct4Lyoaf.mjs";import"./index-Dq_xe9dz.mjs";const h=({providerApp:o,success:r,error:i,onClose:a})=>{let{title:s,subtitle:n}=t((()=>r?{title:`Successfully connected with ${o.name}`,subtitle:"You're good to go!"}:i?{title:"Authentication failed",subtitle:i.message}:{title:`Connecting to ${o.name}`,subtitle:`Please check the pop-up from ${o.name} to continue`}),[r,i,o.name]);/*#__PURE__*/return e(f,{title:s,subtitle:n,icon:o.logoUrl,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!i},onBack:a,watermark:!0})},g={component:()=>{let t=i(),{data:f,navigate:g,setModalData:v,onUserCloseViaDialogOrKeybindRef:y}=m(),{crossAppAuthFlow:A,updateWallets:j,closePrivyModal:b,createAnalyticsEvent:S}=n(),{logout:w}=d(),[C,I]=o({}),U=f?.crossAppAuth,T=new c(`There was an issue connecting your ${U?.name} account. Please try again.`),x=new s((async e=>{if(U?.popup)try{let t=await A({appId:e,popup:U.popup,action:U.action,disableSignup:U.disableSignup});I({data:t})}catch(e){if(e instanceof c)I({error:e});else if(e instanceof p){if(e.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return v({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:`privy:${U.appId}`,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void g("LinkConflictScreen");U.popup&&U.popup.close(),I({error:T})}else I({error:T})}else I({error:T})})),k=()=>{C.data&&(j(),U?.onSuccess(C.data),b({shouldCallAuthOnSuccess:!0,isSuccess:!0})),U?.onError(C.error??new c("User canceled flow")),b({shouldCallAuthOnSuccess:!1,isSuccess:!1})};return y.current=k,r((()=>{U?.appId?.length&&x.execute(U.appId)}),[U?.appId]),r((()=>{if(!C.data)return;let e=C.data;if(t.legal.requireUsersAcceptTerms&&!e.hasAcceptedTerms){let e=setTimeout((()=>{g("AffirmativeConsentScreen")}),a);return()=>clearTimeout(e)}if(u(e,t.embeddedWallets)){let e=setTimeout((()=>{v({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),S({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:`privy:${U?.appId}`,screen:"CrossAppAuthScreen"}}),w()},callAuthOnSuccessOnClose:!0}}),g("EmbeddedWalletOnAccountCreateScreen")}),a);return()=>clearTimeout(e)}let o=setTimeout(k,a);return()=>clearTimeout(o)}),[C.data]),U?.appId?/*#__PURE__*/e(h,{providerApp:{id:U?.appId,logoUrl:U?.logoUrl,name:U?.name},success:!!C.data,error:C.error,onClose:k}):(console.warn("Missing data for Screen"),null)},isShownBeforeReady:!0};export{g as CrossAppAuthScreen,h as CrossAppAuthScreenView,g as default};
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/UserCircleIcon";import l,{useState as r,useEffect as n,useRef as o,useMemo as s}from"react";import{styled as c}from"styled-components";import{T as d,M as p,B as h}from"./ModalHeader-CSfzkWxZ.mjs";import{u}from"./context-bWeWAiND.mjs";import{U as g,G as m,H as f,V as y,F as w,W as v,X as C,Y as b,e as k,Z as S,d as T,_ as M,$ as x,a0 as A}from"./useActiveWallet-CSq3KvGj.mjs";import{u as L}from"./internal-context-Z-fyxadS.mjs";import{u as W,a as E,i as I}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{a as P,t as N}from"./index-DEtvMjrv.mjs";import{u as D,c as j,d as O}from"./ConnectWalletView-rtAY2uds.mjs";import{Mail as R,Smartphone as _,UserCircle as V}from"lucide-react";import{C as U}from"./ConnectEmailForm-CUfcb4US.mjs";import{C as F}from"./Chip-D2-wZOHJ.mjs";import{F as $}from"./farcaster-DPlSjvF5.mjs";import{toObjectKeys as z}from"@privy-io/js-sdk-core";import H from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import G from"@heroicons/react/24/outline/FingerPrintIcon";import{L as q}from"./Link-DJ5gq9Di.mjs";import{C as B}from"./ConnectPhoneForm-DMcfvHG9.mjs";import{T as K,a as X,I as Z,S as Q,L as Y,G as J,b as ee,D as te,A as ie}from"./twitter-BoAxhlj6.mjs";import{T as ae,L as le}from"./twitch-5IOe4sIQ.mjs";import{T as re}from"./telegram-B-JqnkqZ.mjs";import{W as ne}from"./WalletOverflowButton-C0Ysaik4.mjs";import{S as oe}from"./ScreenLayout-C2Le_YIv.mjs";const se=()=>{let t=u(),i=t?.appearance?.logo,a=`${t?.name} logo`,r={maxHeight:"90px",maxWidth:"180px"};return i?"string"==typeof i?/*#__PURE__*/e("img",{src:i,alt:a,style:r}):"svg"===i.type||"img"===i.type?/*#__PURE__*/l.cloneElement(i,{alt:a,style:r}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null},ce=c.div`
1
+ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/UserCircleIcon";import l,{useState as r,useEffect as n,useRef as o,useMemo as s}from"react";import{styled as c}from"styled-components";import{T as d,M as p,B as h}from"./ModalHeader-Byy3j4Lh.mjs";import{u}from"./context-BEE1GR3p.mjs";import{U as g,G as m,H as f,V as y,F as w,W as v,X as C,Y as b,e as k,Z as S,n as T,_ as M,$ as x,a0 as A}from"./useActiveWallet-CeJ_zia0.mjs";import{u as L}from"./internal-context-C4ZqP8IF.mjs";import{u as W,a as E,i as I}from"./get-is-unified-wallet-szLxUazm.mjs";import{a as P,t as N}from"./index-BXdEd5-h.mjs";import{u as D,c as j,d as O}from"./ConnectWalletView-mIrd9fmT.mjs";import{Mail as R,Smartphone as _,UserCircle as V}from"lucide-react";import{C as U}from"./ConnectEmailForm-D5UhENmm.mjs";import{C as F}from"./Chip-D2-wZOHJ.mjs";import{F as $}from"./farcaster-DPlSjvF5.mjs";import{toObjectKeys as z}from"@privy-io/js-sdk-core";import H from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import G from"@heroicons/react/24/outline/FingerPrintIcon";import{L as q}from"./Link-DJ5gq9Di.mjs";import{C as B}from"./ConnectPhoneForm-CQJPasTi.mjs";import{T as K,a as X,I as Z,S as Q,L as Y,G as J,b as ee,D as te,A as ie}from"./twitter-BoAxhlj6.mjs";import{T as ae,L as le}from"./twitch-5IOe4sIQ.mjs";import{T as re}from"./telegram-B-JqnkqZ.mjs";import{W as ne}from"./WalletOverflowButton-CoHTrzr-.mjs";import{S as oe}from"./ScreenLayout-DOt2sB2J.mjs";const se=()=>{let t=u(),i=t?.appearance?.logo,a=`${t?.name} logo`,r={maxHeight:"90px",maxWidth:"180px"};return i?"string"==typeof i?/*#__PURE__*/e("img",{src:i,alt:a,style:r}):"svg"===i.type||"img"===i.type?/*#__PURE__*/l.cloneElement(i,{alt:a,style:r}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null},ce=c.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: center;
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{AlertCircle as t,CheckCircle as o,CloudUpload as r}from"lucide-react";import{useState as i,useEffect as s}from"react";import{W as n}from"./WalletInfoCard-BWAC4Crm.mjs";import{u as a,r as c}from"./context-BEE1GR3p.mjs";import{u as m,b as l}from"./internal-context-C4ZqP8IF.mjs";import{a as p}from"./get-is-unified-wallet-szLxUazm.mjs";import{S as u}from"./ScreenLayout-DOt2sB2J.mjs";import"styled-components";import"./ModalHeader-Byy3j4Lh.mjs";import"./useActiveWallet-CeJ_zia0.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-DmJRcrg3.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./get-entropy-details-for-user-DXl-F6zT.mjs";import"./getPublicClient-BltMpU4i.mjs";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-BupZf8Rc.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"ofetch";import"./Screen-Ct4Lyoaf.mjs";import"./index-Dq_xe9dz.mjs";const d=({appName:i,address:s,success:a,error:c,onAccept:m,onDecline:l,onClose:p})=>/*#__PURE__*/e(u,a||c?{title:c?"Something went wrong":"Success!",subtitle:c?"Please try again.":`You've successfully granted delegated action permissions to ${i}.`,icon:c?t:o,iconVariant:c?"error":"success",onBack:p,watermark:!0}:{title:"Enable offline access",subtitle:`By confirming, ${i} will be able to use your wallet for you even when you're not around. You can revoke this later.`,icon:r,primaryCta:{label:"Accept",onClick:m},secondaryCta:{label:"Not now",onClick:l},onBack:p,watermark:!0,children:/*#__PURE__*/e(n,{address:s,title:"Wallet"})}),f={component:()=>{let{data:t}=p(),o=a(),{closePrivyModal:r}=m(),[n,u]=i(!1),[f,j]=i(),{address:y,onDelegate:g,onSuccess:h,onError:w}=t.delegatedActions.consent,v=async()=>{n?h():w(f??new l("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return s((()=>{if(!n&&!f)return;let e=setTimeout(v,c);return()=>clearTimeout(e)}),[n,f]),/*#__PURE__*/e(d,{appName:o.name,address:y,success:n,error:f,onAccept:async()=>{try{await g(),u(!0)}catch(e){j(e)}},onDecline:()=>{v()},onClose:v})}};export{f as DelegatedActionsConsentScreen,d as DelegatedActionsConsentScreenView,f as default};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{AlertCircle as o,CheckCircle as t,Ban as r}from"lucide-react";import{useState as i,useEffect as n}from"react";import{u as s,r as a}from"./context-BEE1GR3p.mjs";import{u as c,b as m}from"./internal-context-C4ZqP8IF.mjs";import{a as l}from"./get-is-unified-wallet-szLxUazm.mjs";import{S as p}from"./ScreenLayout-DOt2sB2J.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./ModalHeader-Byy3j4Lh.mjs";import"styled-components";import"./useActiveWallet-CeJ_zia0.mjs";import"zustand";import"viem/utils";import"./use-export-wallet-DmJRcrg3.mjs";import"eventemitter3";import"./get-entropy-details-for-user-DXl-F6zT.mjs";import"./getPublicClient-BltMpU4i.mjs";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Ct4Lyoaf.mjs";import"./index-Dq_xe9dz.mjs";const u=({appName:i,success:n,error:s,onRevoke:a,onDeny:c,onClose:m})=>/*#__PURE__*/e(p,n||s?{title:s?"Something went wrong":"Success!",subtitle:s?"Please try again.":"You've successfully revoked permissions.",icon:s?o:t,iconVariant:s?"error":"success",onBack:m,watermark:!0}:{title:"Revoke offline access to wallet",subtitle:`By confirming, ${i} will no longer be able to use this wallet on your behalf when you are not online.`,icon:r,primaryCta:{label:"Confirm",onClick:a},secondaryCta:{label:"Deny",onClick:c},onBack:m,watermark:!0}),d={component:()=>{let{data:o}=l(),t=s(),{closePrivyModal:r}=c(),[p,d]=i(!1),[f,y]=i(),{onRevoke:k,onSuccess:v,onError:w}=o.delegatedActions.revoke,h=async()=>{p?v():w(f??new m("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return n((()=>{if(!p&&!f)return;let e=setTimeout(h,a);return()=>clearTimeout(e)}),[p,f]),/*#__PURE__*/e(u,{appName:t.name,success:p,error:f,onRevoke:async()=>{try{await k(),d(!0)}catch(e){y(e)}},onDeny:()=>{h()},onClose:h})}};export{d as DelegatedActionsRevokeScreen,u as DelegatedActionsRevokeScreenView,d as default};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{XCircle as t}from"lucide-react";import{useMemo as r,useState as o,useEffect as i}from"react";import{e as a,c as n}from"./index-BXdEd5-h.mjs";import{u as s}from"./internal-context-C4ZqP8IF.mjs";import{u as l,a as c}from"./get-is-unified-wallet-szLxUazm.mjs";import{S as m}from"./ScreenLayout-DOt2sB2J.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CeJ_zia0.mjs";import"zustand";import"./context-BEE1GR3p.mjs";import"tinycolor2";import"viem";import"viem/utils";import"./use-export-wallet-DmJRcrg3.mjs";import"./get-entropy-details-for-user-DXl-F6zT.mjs";import"./getPublicClient-BltMpU4i.mjs";import"react-device-detect";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-DZkUhG2n.mjs";import"ofetch";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@privy-io/popup";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./ModalHeader-Byy3j4Lh.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Ct4Lyoaf.mjs";import"./index-Dq_xe9dz.mjs";const p=({connectionFailed:r,onClose:o})=>/*#__PURE__*/e(m,r?{title:"Something went wrong",subtitle:"We're on it. Please try again later.",icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Connecting to your wallet",subtitle:"Please wait...",iconVariant:"loading",showClose:!0,onClose:o,watermark:!1}),d={component:()=>{let{authenticated:t,user:m}=l(),{client:d,closePrivyModal:u,createAnalyticsEvent:y,walletProxy:v}=s(),{navigate:h,data:f,setModalData:w,onUserCloseViaDialogOrKeybindRef:b}=c(),j=r((()=>Date.now()),[]),[g,C]=o(!1),{onCompleteNavigateTo:A,onFailure:I,shouldForceMFA:k,entropyId:x,entropyIdVerifier:P,recoveryMethod:S,connectingWalletAddress:T,isUnifiedWallet:F=!1}=f?.connectWallet,M=e=>{g||(C(!0),I("string"==typeof e?Error(e):e))};return i((()=>{let e;return t?v?((async()=>{let t=await d.getAccessToken();if(!t)return M("User must be authenticated and have a Privy wallet before it can be connected");try{if(!F){if(!x||!P)return M("For on-device first-class chain wallets, entropyId and entropyIdVerifier are required");await v.connect({accessToken:t,entropyId:x,entropyIdVerifier:P})}k&&await v.verifyMfa({accessToken:t});let r=(Date.now()-j)/1e3;"EmbeddedWalletKeyExportScreen"===A&&r<1?e=setTimeout((()=>{h(A,!1)}),1e3*(1-r)):h(A,!1)}catch(e){if(a(e)&&"privy"===S){let e=await d.getAccessToken();if(!e)return M("User must be authenticated and have a Privy wallet before it can be recovered");try{y({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:T}});let t=await(v?.recover({accessToken:e,entropyId:x,entropyIdVerifier:P}));t?.entropyId||M(Error("Unable to recover wallet")),A?h(A):u({shouldCallAuthOnSuccess:!1}),y({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:T}}),h(A)}catch(e){M("An error has occurred, please try again.")}}else a(e)&&"privy"!==S&&"privy-v2"!==S?(w({...f,recoverWallet:{entropyId:x,entropyIdVerifier:P,onCompleteNavigateTo:A,onFailure:I},recoveryOAuthStatus:{provider:S,action:"recover",isInAccountCreateFlow:!1,shouldCreateEth:!1,shouldCreateSol:!1}}),h(n(S))):M(e)}})(),()=>clearTimeout(e)):void 0:M("User must be authenticated and have a Privy wallet before it can be connected")}),[t,m,v]),b.current=()=>{M("User exited before wallet could be connected"),u({shouldCallAuthOnSuccess:!1})},/*#__PURE__*/e(p,{connectionFailed:g,onClose:()=>u({shouldCallAuthOnSuccess:!1})})}};export{d as EmbeddedWalletConnectingScreen,p as EmbeddedWalletConnectingView,d as default};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{CheckCircle as t}from"lucide-react";import{useEffect as o}from"react";import{u as r,a as i,d as s,e as c}from"./get-is-unified-wallet-szLxUazm.mjs";import{u as a,r as m}from"./context-BEE1GR3p.mjs";import{u as n}from"./internal-context-C4ZqP8IF.mjs";import{S as l}from"./ScreenLayout-DOt2sB2J.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./ModalHeader-Byy3j4Lh.mjs";import"styled-components";import"./useActiveWallet-CeJ_zia0.mjs";import"zustand";import"viem/utils";import"./use-export-wallet-DmJRcrg3.mjs";import"eventemitter3";import"./get-entropy-details-for-user-DXl-F6zT.mjs";import"./getPublicClient-BltMpU4i.mjs";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Ct4Lyoaf.mjs";import"./index-Dq_xe9dz.mjs";const u=({title:o,description:r,onClose:i})=>/*#__PURE__*/e(l,{title:o,subtitle:r,icon:t,iconVariant:"success",watermark:!0,onBack:i}),p={component:()=>{let{user:t}=r(),{closePrivyModal:l,isNewUserThisSession:p,updateWallets:d}=n(),{data:f,onUserCloseViaDialogOrKeybindRef:j}=i(),h=a(),{onSuccess:v,onFailure:y,callAuthOnSuccessOnClose:C}=f.createWallet,w=()=>{let e=s(t)??c(t);t&&e?(d(),v({user:t,account:e})):y(Error("Failed to create wallet")),l({shouldCallAuthOnSuccess:C})};return o((()=>{let e=setTimeout(w,m);return()=>clearTimeout(e)}),[]),j.current=w,/*#__PURE__*/e(u,{title:p?"Welcome"+(h?.name?` to ${h?.name}`:""):"All set!",description:p?"You've successfully created an account.":"Your account is secured.",onClose:w})}};export{p as EmbeddedWalletCreatedScreen,u as EmbeddedWalletCreatedScreenView,p as default};
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{useState as o,useEffect as i,useRef as n}from"react";import{styled as a}from"styled-components";import{constructURL as l}from"@privy-io/urls";import{W as c}from"./WarningBanner-c8L53pJ2.mjs";import{W as d}from"./WalletInfoCard-TfOxho0A.mjs";import{u as s}from"./context-bWeWAiND.mjs";import{u as p}from"./internal-context-Z-fyxadS.mjs";import{u as m,a as u}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{S as h}from"./ScreenLayout-C2Le_YIv.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"lucide-react";import"./ModalHeader-CSfzkWxZ.mjs";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-BuCMjci7.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"ofetch";import"./Screen-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const y=({address:o,accessToken:i,appConfigTheme:n,onClose:a,isLoading:l=!1,exportButtonProps:s,onBack:p})=>/*#__PURE__*/e(h,{title:"Export wallet",subtitle:/*#__PURE__*/r(t,{children:["Copy either your private key or seed phrase to export your wallet."," ",/*#__PURE__*/e("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),onClose:a,onBack:p,showBack:!!p,watermark:!0,children:/*#__PURE__*/r(g,{children:[/*#__PURE__*/e(c,{theme:n,children:"Never share your private key or seed phrase with anyone."}),/*#__PURE__*/e(d,{title:"Your wallet",address:o,showCopyButton:!0}),/*#__PURE__*/e("div",{style:{width:"100%"},children:l?/*#__PURE__*/e(f,{}):i&&s&&/*#__PURE__*/e(w,{accessToken:i,dimensions:{height:"44px"},...s})})]})});let g=a.div`
1
+ import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{useState as o,useEffect as i,useRef as n}from"react";import{styled as a}from"styled-components";import{constructURL as l}from"@privy-io/urls";import{W as c}from"./WarningBanner-c8L53pJ2.mjs";import{W as d}from"./WalletInfoCard-BWAC4Crm.mjs";import{u as s}from"./context-BEE1GR3p.mjs";import{u as p}from"./internal-context-C4ZqP8IF.mjs";import{u as m,a as u}from"./get-is-unified-wallet-szLxUazm.mjs";import{S as h}from"./ScreenLayout-DOt2sB2J.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"lucide-react";import"./ModalHeader-Byy3j4Lh.mjs";import"./useActiveWallet-CeJ_zia0.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-DmJRcrg3.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./get-entropy-details-for-user-DXl-F6zT.mjs";import"./getPublicClient-BltMpU4i.mjs";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-BupZf8Rc.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"ofetch";import"./Screen-Ct4Lyoaf.mjs";import"./index-Dq_xe9dz.mjs";const y=({address:o,accessToken:i,appConfigTheme:n,onClose:a,isLoading:l=!1,exportButtonProps:s,onBack:p})=>/*#__PURE__*/e(h,{title:"Export wallet",subtitle:/*#__PURE__*/r(t,{children:["Copy either your private key or seed phrase to export your wallet."," ",/*#__PURE__*/e("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),onClose:a,onBack:p,showBack:!!p,watermark:!0,children:/*#__PURE__*/r(g,{children:[/*#__PURE__*/e(c,{theme:n,children:"Never share your private key or seed phrase with anyone."}),/*#__PURE__*/e(d,{title:"Your wallet",address:o,showCopyButton:!0}),/*#__PURE__*/e("div",{style:{width:"100%"},children:l?/*#__PURE__*/e(f,{}):i&&s&&/*#__PURE__*/e(w,{accessToken:i,dimensions:{height:"44px"},...s})})]})});let g=a.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 1.25rem;
@@ -19,7 +19,7 @@ import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{useState
19
19
  background-color: var(--privy-color-background-2);
20
20
  color: var(--privy-color-foreground-3);
21
21
  `;function w(t){let[a,c]=o(t.dimensions.width),[d,s]=o(void 0),p=n(null);i((()=>{if(p.current&&void 0===a){let{width:e}=p.current.getBoundingClientRect();c(e)}let e=getComputedStyle(document.documentElement);s({background:e.getPropertyValue("--privy-color-background"),background2:e.getPropertyValue("--privy-color-background-2"),foreground3:e.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:e.getPropertyValue("--privy-color-foreground-accent"),accent:e.getPropertyValue("--privy-color-accent"),accentDark:e.getPropertyValue("--privy-color-accent-dark"),success:e.getPropertyValue("--privy-color-success"),colorScheme:e.getPropertyValue("color-scheme")})}),[]);let m="ethereum"===t.chainType&&!t.imported&&!t.isUnifiedWallet;/*#__PURE__*/return e("div",{ref:p,children:a&&
22
- /*#__PURE__*/r(I,{children:[/*#__PURE__*/e("iframe",{style:{position:"absolute",zIndex:1},width:a,height:t.dimensions.height,allow:"clipboard-write self *",src:l({origin:t.origin,path:`/apps/${t.appId}/embedded-wallets/export`,query:t.isUnifiedWallet?{v:"1-unified",wallet_id:t.walletId,client_id:t.appClientId,width:`${a}px`,caid:t.clientAnalyticsId,phrase_export:m,...d}:{v:"1",entropy_id:t.entropyId,entropy_id_verifier:t.entropyIdVerifier,hd_wallet_index:t.hdWalletIndex,chain_type:t.chainType,client_id:t.appClientId,width:`${a}px`,caid:t.clientAnalyticsId,phrase_export:m,...d},hash:{token:t.accessToken}})}),/*#__PURE__*/e(b,{children:"Loading..."}),m&&/*#__PURE__*/e(b,{children:"Loading..."})]})})}const k={component:()=>{let[r,t]=o(null),{authenticated:n,user:a}=m(),{closePrivyModal:l,createAnalyticsEvent:c,clientAnalyticsId:d,client:h}=p(),g=s(),{data:f,onUserCloseViaDialogOrKeybindRef:v}=u(),{onFailure:x,onSuccess:w,origin:k,appId:I,appClientId:b,entropyId:j,entropyIdVerifier:C,walletId:A,hdWalletIndex:_,chainType:T,address:V,isUnifiedWallet:W,imported:P,showBackButton:B}=f.keyExport,L=e=>{l({shouldCallAuthOnSuccess:!1}),x("string"==typeof e?Error(e):e)},S=()=>{l({shouldCallAuthOnSuccess:!1}),w(),c({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:V}})};return i((()=>{if(!n)return L("User must be authenticated before exporting their wallet");h.getAccessToken().then(t).catch(L)}),[n,a]),v.current=S,/*#__PURE__*/e(y,{address:V,accessToken:r,appConfigTheme:g.appearance.palette.colorScheme,onClose:S,isLoading:!r,onBack:B?S:void 0,exportButtonProps:r?{origin:k,appId:I,appClientId:b,clientAnalyticsId:d,entropyId:j,entropyIdVerifier:C,walletId:A,hdWalletIndex:_,isUnifiedWallet:W,imported:P,chainType:T}:void 0})}};let I=a.div`
22
+ /*#__PURE__*/r(I,{children:[/*#__PURE__*/e("iframe",{style:{position:"absolute",zIndex:1},width:a,height:t.dimensions.height,allow:"clipboard-write self *",src:l({origin:t.origin,path:`/apps/${t.appId}/embedded-wallets/export`,query:t.isUnifiedWallet?{v:"1-unified",wallet_id:t.walletId,client_id:t.appClientId,width:`${a}px`,caid:t.clientAnalyticsId,phrase_export:m,...d}:{v:"1",entropy_id:t.entropyId,entropy_id_verifier:t.entropyIdVerifier,hd_wallet_index:t.hdWalletIndex,chain_type:t.chainType,client_id:t.appClientId,width:`${a}px`,caid:t.clientAnalyticsId,phrase_export:m,...d},hash:{token:t.accessToken}})}),/*#__PURE__*/e(b,{children:"Loading..."}),m&&/*#__PURE__*/e(b,{children:"Loading..."})]})})}const k={component:()=>{let[r,t]=o(null),{authenticated:n,user:a}=m(),{closePrivyModal:l,createAnalyticsEvent:c,clientAnalyticsId:d,client:h}=p(),g=s(),{data:f,onUserCloseViaDialogOrKeybindRef:v}=u(),{onFailure:x,onSuccess:w,origin:k,appId:I,appClientId:b,entropyId:j,entropyIdVerifier:C,walletId:A,hdWalletIndex:_,chainType:T,address:V,isUnifiedWallet:P,imported:W,showBackButton:B}=f.keyExport,L=e=>{l({shouldCallAuthOnSuccess:!1}),x("string"==typeof e?Error(e):e)},S=()=>{l({shouldCallAuthOnSuccess:!1}),w(),c({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:V}})};return i((()=>{if(!n)return L("User must be authenticated before exporting their wallet");h.getAccessToken().then(t).catch(L)}),[n,a]),v.current=S,/*#__PURE__*/e(y,{address:V,accessToken:r,appConfigTheme:g.appearance.palette.colorScheme,onClose:S,isLoading:!r,onBack:B?S:void 0,exportButtonProps:r?{origin:k,appId:I,appClientId:b,clientAnalyticsId:d,entropyId:j,entropyIdVerifier:C,walletId:A,hdWalletIndex:_,isUnifiedWallet:P,imported:W,chainType:T}:void 0})}};let I=a.div`
23
23
  overflow: visible;
24
24
  position: relative;
25
25
  overflow: none;
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{XCircle as t}from"lucide-react";import{useState as r,useEffect as o}from"react";import{generateWalletIdempotencyKey as i}from"@privy-io/js-sdk-core";import{u as a}from"./context-BEE1GR3p.mjs";import{v as s,s as l,k as n,F as m,R as c}from"./index-BXdEd5-h.mjs";import{u as d,m as p}from"./internal-context-C4ZqP8IF.mjs";import{a as u,u as h}from"./get-is-unified-wallet-szLxUazm.mjs";import{S as y}from"./ScreenLayout-DOt2sB2J.mjs";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CeJ_zia0.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-DmJRcrg3.mjs";import"./get-entropy-details-for-user-DXl-F6zT.mjs";import"./getPublicClient-BltMpU4i.mjs";import"react-device-detect";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-DZkUhG2n.mjs";import"ofetch";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@privy-io/popup";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./ModalHeader-Byy3j4Lh.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Ct4Lyoaf.mjs";import"./index-Dq_xe9dz.mjs";const w=({errorMessage:r,onClose:o})=>/*#__PURE__*/e(y,r?{title:"Something went wrong",subtitle:r,icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Creating your wallet",subtitle:"Please wait...",iconVariant:"loading",watermark:!1}),v={component:()=>{let{setModalData:t,navigate:y,data:v,onUserCloseViaDialogOrKeybindRef:g}=u(),C=a(),[j,f]=r(""),{embeddedWallets:b}=a(),{authenticated:S,user:x}=h(),{closePrivyModal:O,walletProxy:W,client:A}=d(),{onSuccess:k,onFailure:P,callAuthOnSuccessOnClose:I,shouldCreateEth:M,shouldCreateSol:R}=v.createWallet,U="legacy-embedded-wallets-only"===C.embeddedWallets.mode&&!0===C?.embeddedWallets.requireUserOwnedRecoveryOnCreate,[E,K]=r(null),{create:L}=s(),T=M??(!!x&&l(x,C.embeddedWallets.ethereum.createOnLogin)),F=R??(!!x&&n(x,C.embeddedWallets.solana.createOnLogin)),D=new c((async()=>{let e=await A.getAccessToken();if(x&&e&&W)try{let e,t=await i(x.id,"ethereum"),r=await i(x.id,"solana");if(T&&F)e=await L({chainType:"ethereum",walletIndex:0,latestUser:x,idempotencyKey:t}),e=await L({chainType:"solana",walletIndex:0,latestUser:e.user,idempotencyKey:r});else if(F)e=await L({chainType:"solana",walletIndex:0,latestUser:x,idempotencyKey:r});else{if(!T)return void O({shouldCallAuthOnSuccess:I});e=await L({chainType:"ethereum",walletIndex:0,latestUser:x,idempotencyKey:t})}K(e),y("EmbeddedWalletCreatedScreen")}catch(e){f(e.message)}}));return o((()=>S&&x?U?(t({...v,createWallet:{...v.createWallet,shouldCreateEth:T,shouldCreateSol:F},recoverySelection:{...v?.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:T,shouldCreateSol:F}}),y(m({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:b.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void D.execute():(y("LandingScreen"),void P(Error("User must be authenticated before creating a Privy wallet")))),[U,S]),g.current=()=>null/*#__PURE__*/,e(w,{errorMessage:j||void 0,onClose:()=>{E?(k(E),O({shouldCallAuthOnSuccess:I})):(P(new p("User wallet creation failed")),O({shouldCallAuthOnSuccess:!1}))}})}};export{v as EmbeddedWalletOnAccountCreateScreen,w as EmbeddedWalletOnAccountCreateView,v as default};