@privy-io/react-auth 3.8.1 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/dist/cjs/{AccountNotFoundScreen-Cu7enz9o.js → AccountNotFoundScreen-C0im9fAJ.js} +1 -1
  2. package/dist/cjs/{Address-DYZ3IQKV.js → Address-Doz93lgh.js} +1 -1
  3. package/dist/cjs/{AffirmativeConsentScreen-Cl_SWg16.js → AffirmativeConsentScreen-OgvUs4oT.js} +1 -1
  4. package/dist/cjs/{AllowlistRejectionScreen-D5b9mnX_.js → AllowlistRejectionScreen-CBfQZVO7.js} +1 -1
  5. package/dist/cjs/{AuthenticateWithWalletScreen-CfFbXvGY.js → AuthenticateWithWalletScreen-B4aHQC44.js} +1 -1
  6. package/dist/cjs/{AwaitingEvmToSolBridgingScreen-CCdsJbKx.js → AwaitingEvmToSolBridgingScreen-Cz2E1cWa.js} +1 -1
  7. package/dist/cjs/{AwaitingExternalEthereumTransferScreen-CTI3rpHf.js → AwaitingExternalEthereumTransferScreen-Ca1z7D4v.js} +1 -1
  8. package/dist/cjs/{AwaitingPasswordlessCodeScreen-ftedBDSO.js → AwaitingPasswordlessCodeScreen-DDws79F8.js} +1 -1
  9. package/dist/cjs/{AwaitingSolToEvmBridgingScreen-CaKyEgGQ.js → AwaitingSolToEvmBridgingScreen-DlTJafw4.js} +1 -1
  10. package/dist/cjs/{BridgeNetworkSelectionView-ekW1jVoZ.js → BridgeNetworkSelectionView-Cg3JjiFh.js} +1 -1
  11. package/dist/cjs/{Button-BpQ22RCK.js → Button-DpuRzAgk.js} +1 -1
  12. package/dist/cjs/{CaptchaScreen-aaD10pK6.js → CaptchaScreen-DrvkYUK-.js} +1 -1
  13. package/dist/cjs/{CoinbaseOnrampStatusScreen-DXk7YS8-.js → CoinbaseOnrampStatusScreen-Cfbivt0s.js} +1 -1
  14. package/dist/cjs/{ConnectEmailForm-uUuYB04I.js → ConnectEmailForm-DeN1Pg_E.js} +1 -1
  15. package/dist/cjs/{ConnectLedgerScreen-BsZYPosO.js → ConnectLedgerScreen-F3-JADjW.js} +1 -1
  16. package/dist/cjs/{ConnectOnlyLandingScreen-DDCcNqF9.js → ConnectOnlyLandingScreen-DQ9hxL8H.js} +1 -1
  17. package/dist/cjs/{ConnectOnlyStatusScreen-DyJB2X3z.js → ConnectOnlyStatusScreen-YPhacltK.js} +1 -1
  18. package/dist/cjs/ConnectOrCreateScreen-DmitWRwr.js +1 -0
  19. package/dist/cjs/{ConnectPhoneForm-tjeQd9v8.js → ConnectPhoneForm-CIaHyHT9.js} +1 -1
  20. package/dist/cjs/ConnectWalletView-B33uROyL.js +1 -0
  21. package/dist/cjs/{ConnectionStatusScreen-iMAYJhVc.js → ConnectionStatusScreen-Dg1LMsi6.js} +1 -1
  22. package/dist/cjs/{CrossAppAuthScreen-CsZ_rLLg.js → CrossAppAuthScreen-B6h5ejCd.js} +1 -1
  23. package/dist/cjs/{CustomLandingScreenView-B0bNrKZn.js → CustomLandingScreenView-ClPdt2GY.js} +2 -2
  24. package/dist/cjs/{DelegatedActionsConsentScreen-CyITZiB7.js → DelegatedActionsConsentScreen-CP9xV4-_.js} +1 -1
  25. package/dist/cjs/{DelegatedActionsRevokeScreen-vQnlP7qN.js → DelegatedActionsRevokeScreen-QrgQlVmp.js} +1 -1
  26. package/dist/cjs/{EmbeddedWalletConnectingScreen-D5yc0IhZ.js → EmbeddedWalletConnectingScreen-Ccb4geKv.js} +1 -1
  27. package/dist/cjs/{EmbeddedWalletCreatedScreen-BFJ6BKQ4.js → EmbeddedWalletCreatedScreen-DTRBR5WW.js} +1 -1
  28. package/dist/cjs/{EmbeddedWalletKeyExportScreen-Cz3cpL6Q.js → EmbeddedWalletKeyExportScreen-B1Ezr57N.js} +1 -1
  29. package/dist/cjs/{EmbeddedWalletOnAccountCreateScreen-L4tUdjxn.js → EmbeddedWalletOnAccountCreateScreen-0v1ZwZgX.js} +1 -1
  30. package/dist/cjs/{EmbeddedWalletPasswordUpdateScreen-n5Z982kO.js → EmbeddedWalletPasswordUpdateScreen-DJr1d2fN.js} +1 -1
  31. package/dist/cjs/{EmbeddedWalletPasswordUpdateSplashScreen-BJQXfJ5I.js → EmbeddedWalletPasswordUpdateSplashScreen-Slns6kTr.js} +1 -1
  32. package/dist/cjs/{EnrollTotp-Bo2kHSAy.js → EnrollTotp-zJR3l-q0.js} +1 -1
  33. package/dist/cjs/{ErrorScreen-BGI-4cUT.js → ErrorScreen-DAUNTckD.js} +1 -1
  34. package/dist/cjs/{FarcasterConnectStatusScreen-BKcQ6ZMu.js → FarcasterConnectStatusScreen-C3PPAnT1.js} +1 -1
  35. package/dist/cjs/{FarcasterSignerStatusScreen-BB63F9MZ.js → FarcasterSignerStatusScreen-BMd0iB8M.js} +1 -1
  36. package/dist/cjs/{FundSolWalletWithExternalSolanaWallet-DFQlLB8a.js → FundSolWalletWithExternalSolanaWallet-u8DS0vOP.js} +1 -1
  37. package/dist/cjs/{FundWalletMethodHeader-CZ9E9Pcd.js → FundWalletMethodHeader-DFV8N4os.js} +1 -1
  38. package/dist/cjs/{FundingEditAmountScreen-C8OzBV96.js → FundingEditAmountScreen-DXA8k8zQ.js} +1 -1
  39. package/dist/cjs/{FundingMethodSelectionScreen-GE2W8CGa.js → FundingMethodSelectionScreen-tlU_tfXm.js} +1 -1
  40. package/dist/cjs/{InAppBrowserLoginNotPossible-BDJuZ0-D.js → InAppBrowserLoginNotPossible-BB_zYdr4.js} +1 -1
  41. package/dist/cjs/{InstallWalletScreen-tcaVKdvZ.js → InstallWalletScreen-sNsX0qIj.js} +1 -1
  42. package/dist/cjs/{LandingScreen-BIRSSuAB.js → LandingScreen-BE8xOJTr.js} +1 -1
  43. package/dist/cjs/{LinkConflictScreen-D6812iEs.js → LinkConflictScreen-CwA2g0DP.js} +1 -1
  44. package/dist/cjs/{LinkEmailScreen-D-kZRiYu.js → LinkEmailScreen-DExuIdVG.js} +1 -1
  45. package/dist/cjs/{LinkPasskeyScreen-Dn0beRU9.js → LinkPasskeyScreen-DXLAama3.js} +1 -1
  46. package/dist/cjs/{LinkPhoneScreen-D2wD2X6_.js → LinkPhoneScreen-BGKi4PVT.js} +1 -1
  47. package/dist/cjs/{LoginFailedScreen-JL8lSBDT.js → LoginFailedScreen-BMAuqJva.js} +1 -1
  48. package/dist/cjs/{ManualTransferScreen-rVVbGuHO.js → ManualTransferScreen-Dg8uGXZw.js} +1 -1
  49. package/dist/cjs/{MfaAuthEnrollmentFlowScreen-7wF7sedZ.js → MfaAuthEnrollmentFlowScreen-BZ1svjjW.js} +1 -1
  50. package/dist/cjs/{MfaAuthVerifyFlowScreen-DXT_z8L7.js → MfaAuthVerifyFlowScreen-CJhMSZ1r.js} +1 -1
  51. package/dist/cjs/{MfaEnrollmentFlowScreen-DJWHdMZL.js → MfaEnrollmentFlowScreen-DvxX-vrH.js} +1 -1
  52. package/dist/cjs/{MfaVerifyFlowScreen-BC3Vuttf.js → MfaVerifyFlowScreen-BWPqGNNj.js} +1 -1
  53. package/dist/cjs/{ModalHeader-BmFtLkWJ.js → ModalHeader-4MV7Tgk7.js} +1 -1
  54. package/dist/cjs/{MoonpayStatusScreen-DyW9zeoT.js → MoonpayStatusScreen-Cd_71Pyq.js} +1 -1
  55. package/dist/cjs/{OAuthStatusScreen-FjNrpKlb.js → OAuthStatusScreen-ZTRfDJXT.js} +1 -1
  56. package/dist/cjs/{PasskeySelectSignupOrLogin-DyHtky_y.js → PasskeySelectSignupOrLogin-CQZM_RDH.js} +1 -1
  57. package/dist/cjs/{PasskeyStatusScreen-Q0ag_5Jx.js → PasskeyStatusScreen-BM1Mvl9i.js} +1 -1
  58. package/dist/cjs/{PasswordRecoveryScreen-D6vuUKqB.js → PasswordRecoveryScreen-CvVt6RGf.js} +1 -1
  59. package/dist/cjs/{QrCode-qgAdMqWi.js → QrCode-DvJPyneT.js} +1 -1
  60. package/dist/cjs/{RecoveryOAuthStatusScreen-D1xbanmh.js → RecoveryOAuthStatusScreen-Cg2ntkgK.js} +1 -1
  61. package/dist/cjs/{RecoveryPasswordCreateScreen-DW-I4Bjp.js → RecoveryPasswordCreateScreen-dGZOvD2x.js} +1 -1
  62. package/dist/cjs/{RecoverySelectionScreen-CSsw-SMB.js → RecoverySelectionScreen-DBAg2tyX.js} +1 -1
  63. package/dist/cjs/{Screen-BAXdSOJk.js → Screen-CJM19YNL.js} +1 -1
  64. package/dist/cjs/{ScreenLayout-95K6C4n8.js → ScreenLayout-Bbhw-EIr.js} +1 -1
  65. package/dist/cjs/{SetAutomaticRecoveryScreen-DdYvhBam.js → SetAutomaticRecoveryScreen-C65Py491.js} +1 -1
  66. package/dist/cjs/{SetWalletPasswordForm-D7TN70-K.js → SetWalletPasswordForm-Bx4bpcUs.js} +1 -1
  67. package/dist/cjs/{SignRequestScreen-B6DzD2bf.js → SignRequestScreen-Dy8xnXXp.js} +1 -1
  68. package/dist/cjs/{StandardSignAndSendTransactionScreen-Cl_1GhiF.js → StandardSignAndSendTransactionScreen-x1O5yfj4.js} +1 -1
  69. package/dist/cjs/{TelegramAuthScreen-D32WGqrh.js → TelegramAuthScreen-DaxoKw-V.js} +1 -1
  70. package/dist/cjs/{TransactionDetails-B4mP9iqk.js → TransactionDetails-DvBQbDgX.js} +1 -1
  71. package/dist/cjs/{TransactionErrorView-BPMOzuyp.js → TransactionErrorView-BdTYgWfc.js} +1 -1
  72. package/dist/cjs/{TransferFromWalletScreen-BbJ3ISYt.js → TransferFromWalletScreen-CGRGSTHN.js} +1 -1
  73. package/dist/cjs/{TransferOrBridgeLoadingScreen-DsBPxxqR.js → TransferOrBridgeLoadingScreen-C4UYLYIL.js} +1 -1
  74. package/dist/cjs/{UpdateEmailScreen-fqqg8VfP.js → UpdateEmailScreen-BtndcDiP.js} +1 -1
  75. package/dist/cjs/{UpdatePhoneScreen-BJDovBOR.js → UpdatePhoneScreen-BQb3cbdX.js} +1 -1
  76. package/dist/cjs/{UserLimitReachedScreen-CSkM5uLj.js → UserLimitReachedScreen-Ctgox4aT.js} +1 -1
  77. package/dist/cjs/{WalletButtonList-jzt0Egd8.js → WalletButtonList-C6cavPqd.js} +1 -1
  78. package/dist/cjs/{WalletInfoCard-bdaI4ebq.js → WalletInfoCard-DQtI0K25.js} +1 -1
  79. package/dist/cjs/{WalletInterstitialScreen-BzSNp3dA.js → WalletInterstitialScreen-HfTntL7I.js} +1 -1
  80. package/dist/cjs/{WalletLink-2kOfC5R5.js → WalletLink-CbnPrVEH.js} +1 -1
  81. package/dist/cjs/abstract-smart-wallets.js +1 -1
  82. package/dist/cjs/context-Dn8Hzo8O.js +1 -0
  83. package/dist/cjs/{ethers-Djy--MKt.js → ethers-BwK3McWK.js} +1 -1
  84. package/dist/cjs/extended-chains.js +1 -1
  85. package/dist/cjs/farcaster.js +1 -1
  86. package/dist/cjs/{frame-BSQIYvLs.js → frame-B14fp9oC.js} +1 -1
  87. package/dist/cjs/{get-is-unified-wallet-CAK7Zx3C.js → get-is-unified-wallet-CHHPpmxX.js} +1 -1
  88. package/dist/cjs/{getErc20Balance-BiXU_58s.js → getErc20Balance-DknCauCO.js} +1 -1
  89. package/dist/cjs/{getErc20TokenInfo-B78AxnZ3.js → getErc20TokenInfo-CBduyYx4.js} +1 -1
  90. package/dist/cjs/{getPublicClient-d-gCTRgH.js → getPublicClient-CGlodIp_.js} +1 -1
  91. package/dist/cjs/index-4-C2N_7K.js +5 -0
  92. package/dist/cjs/{index-BqAmClyL.js → index-D7QitaMz.js} +1 -1
  93. package/dist/cjs/{index-CBf8l7UH.js → index-DiPPDo6V.js} +1 -1
  94. package/dist/cjs/index.js +1 -1
  95. package/dist/cjs/internal-context-NWsAL807.js +1 -0
  96. package/dist/cjs/internal.js +1 -1
  97. package/dist/cjs/prepareFundingModalData-Bap-QRCV.js +1 -0
  98. package/dist/cjs/{reservoir-DLqCfAka.js → reservoir-CQGyEBb7.js} +1 -1
  99. package/dist/cjs/{shared-LnNw37YZ.js → shared-BjdszO5f.js} +1 -1
  100. package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-D8TmPfTs.js → shouldProceedtoEmbeddedWalletCreationFlow-CuHR6wvs.js} +1 -1
  101. package/dist/cjs/{smart-wallets-BxBo7Rwr.js → smart-wallets-Cb8qgePj.js} +1 -1
  102. package/dist/cjs/smart-wallets.js +1 -1
  103. package/dist/cjs/solana.js +1 -1
  104. package/dist/cjs/{to-ui-error-DQR0PH1r.js → to-ui-error-C_N9DMza.js} +1 -1
  105. package/dist/cjs/ui.js +1 -1
  106. package/dist/cjs/{use-create-wallet-without-fallback-DVsaEUAi.js → use-create-wallet-without-fallback-y9YpooGA.js} +1 -1
  107. package/dist/cjs/{use-export-wallet-Bp3Q263k.js → use-export-wallet-CmWKVG5J.js} +1 -1
  108. package/dist/cjs/{use-sign-with-user-signer-H6aAias8.js → use-sign-with-user-signer-BcAsQTGF.js} +1 -1
  109. package/dist/cjs/{useActiveWallet-rCbIz7HK.js → useActiveWallet-B5cSS56I.js} +1 -1
  110. package/dist/cjs/{useGetSolPrice-mb9rbK56.js → useGetSolPrice-C986iVoO.js} +1 -1
  111. package/dist/cjs/{useGetTokenPrice-BXSjabMV.js → useGetTokenPrice-CdW08dO7.js} +1 -1
  112. package/dist/cjs/{useI18n-DnOEBAdg.js → useI18n-D21RT6EH.js} +1 -1
  113. package/dist/cjs/usePrivy-DobNyfbl.js +1 -0
  114. package/dist/cjs/{useSolanaRpcClient-BSb_hq8i.js → useSolanaRpcClient-ZoxUaxNS.js} +1 -1
  115. package/dist/cjs/{useWalletBalance-9yRQYIAe.js → useWalletBalance-BVb8F3RO.js} +1 -1
  116. package/dist/cjs/{useWallets-D6t7Ii2K.js → useWallets-DPdw6ah8.js} +1 -1
  117. package/dist/cjs/{useWallets-dr024nCy.js → useWallets-Z7ZZY1fI.js} +1 -1
  118. package/dist/dts/{events-context-Bt8hY3AJ.d.ts → events-context-D8iPaW-H.d.mts} +1 -1
  119. package/dist/dts/{events-context-Bt8hY3AJ.d.mts → events-context-D8iPaW-H.d.ts} +1 -1
  120. package/dist/dts/extended-chains.d.mts +1 -1
  121. package/dist/dts/extended-chains.d.ts +1 -1
  122. package/dist/dts/farcaster.d.mts +1 -1
  123. package/dist/dts/farcaster.d.ts +1 -1
  124. package/dist/dts/index.d.mts +4 -4
  125. package/dist/dts/index.d.ts +4 -4
  126. package/dist/dts/internal.d.mts +1 -1
  127. package/dist/dts/internal.d.ts +1 -1
  128. package/dist/dts/smart-wallets.d.mts +1 -1
  129. package/dist/dts/smart-wallets.d.ts +1 -1
  130. package/dist/dts/solana.d.mts +3 -3
  131. package/dist/dts/solana.d.ts +3 -3
  132. package/dist/dts/{types-Dx2VbdX1.d.mts → types-diVZpIb-.d.mts} +10 -3
  133. package/dist/dts/{types-Dx2VbdX1.d.ts → types-diVZpIb-.d.ts} +10 -3
  134. package/dist/dts/ui.d.mts +1 -1
  135. package/dist/dts/ui.d.ts +1 -1
  136. package/dist/esm/{AccountNotFoundScreen-DQR0FatT.mjs → AccountNotFoundScreen-CvMiU7Tz.mjs} +1 -1
  137. package/dist/esm/{Address-C1iw9r70.mjs → Address-CDOE2oK9.mjs} +1 -1
  138. package/dist/esm/{AffirmativeConsentScreen-BU4I5ISJ.mjs → AffirmativeConsentScreen-Cia_UEaD.mjs} +1 -1
  139. package/dist/esm/{AllowlistRejectionScreen-WgcCN6CH.mjs → AllowlistRejectionScreen-DMqAO2Y-.mjs} +1 -1
  140. package/dist/esm/{AuthenticateWithWalletScreen-D6Zy69An.mjs → AuthenticateWithWalletScreen-DvzZViMZ.mjs} +1 -1
  141. package/dist/esm/{AwaitingEvmToSolBridgingScreen-ByIVuwRF.mjs → AwaitingEvmToSolBridgingScreen-BSG_hKyl.mjs} +1 -1
  142. package/dist/esm/{AwaitingExternalEthereumTransferScreen-Bq0rCErj.mjs → AwaitingExternalEthereumTransferScreen-BcZRmV50.mjs} +1 -1
  143. package/dist/esm/{AwaitingPasswordlessCodeScreen-itJ4854u.mjs → AwaitingPasswordlessCodeScreen-Dd7TblcM.mjs} +1 -1
  144. package/dist/esm/{AwaitingSolToEvmBridgingScreen-BSxfnQcf.mjs → AwaitingSolToEvmBridgingScreen-BD1wkQFf.mjs} +1 -1
  145. package/dist/esm/{BridgeNetworkSelectionView-DXjTVIcQ.mjs → BridgeNetworkSelectionView-DSCjcHJX.mjs} +1 -1
  146. package/dist/esm/{Button-OlK_6fKk.mjs → Button-DJY5dut3.mjs} +1 -1
  147. package/dist/esm/{CaptchaScreen-BBjPbV4B.mjs → CaptchaScreen-CapFNnoZ.mjs} +1 -1
  148. package/dist/esm/{CoinbaseOnrampStatusScreen-CZpfBNiz.mjs → CoinbaseOnrampStatusScreen-DbQEEYPn.mjs} +1 -1
  149. package/dist/esm/{ConnectEmailForm-C2TJPUYV.mjs → ConnectEmailForm-Cs3r5aBq.mjs} +1 -1
  150. package/dist/esm/{ConnectLedgerScreen-TCVn5s4x.mjs → ConnectLedgerScreen-EYZ2eRpE.mjs} +1 -1
  151. package/dist/esm/{ConnectOnlyLandingScreen-CjVJO9uh.mjs → ConnectOnlyLandingScreen-BM747X2V.mjs} +1 -1
  152. package/dist/esm/{ConnectOnlyStatusScreen-BGJ4l52n.mjs → ConnectOnlyStatusScreen-CW3W1N8z.mjs} +1 -1
  153. package/dist/esm/ConnectOrCreateScreen-BREVA7pu.mjs +1 -0
  154. package/dist/esm/{ConnectPhoneForm-kW8tUq0-.mjs → ConnectPhoneForm-Ft9zAuQd.mjs} +1 -1
  155. package/dist/esm/ConnectWalletView-DFfXN_9_.mjs +1 -0
  156. package/dist/esm/{ConnectionStatusScreen-B3NfUQx_.mjs → ConnectionStatusScreen-nzx3dVCV.mjs} +1 -1
  157. package/dist/esm/{CrossAppAuthScreen-CnvB1lhx.mjs → CrossAppAuthScreen-DAQweVCP.mjs} +1 -1
  158. package/dist/esm/CustomLandingScreenView-BkNtLof4.mjs +2 -0
  159. package/dist/esm/{DelegatedActionsConsentScreen-DeBkGN9b.mjs → DelegatedActionsConsentScreen-C35m_lng.mjs} +1 -1
  160. package/dist/esm/{DelegatedActionsRevokeScreen-CTgPXrqu.mjs → DelegatedActionsRevokeScreen-h4GhIT-2.mjs} +1 -1
  161. package/dist/esm/{EmbeddedWalletConnectingScreen-Qu9cmWzJ.mjs → EmbeddedWalletConnectingScreen-CrgNS1_v.mjs} +1 -1
  162. package/dist/esm/{EmbeddedWalletCreatedScreen-DFciR3k8.mjs → EmbeddedWalletCreatedScreen-BhSPSO8A.mjs} +1 -1
  163. package/dist/esm/{EmbeddedWalletKeyExportScreen-CEo3FI_N.mjs → EmbeddedWalletKeyExportScreen-BlAL_BUV.mjs} +1 -1
  164. package/dist/esm/{EmbeddedWalletOnAccountCreateScreen-C7cawTmQ.mjs → EmbeddedWalletOnAccountCreateScreen-Xz2dhW-I.mjs} +1 -1
  165. package/dist/esm/{EmbeddedWalletPasswordUpdateScreen-GdNNmtZR.mjs → EmbeddedWalletPasswordUpdateScreen-DQbd-pAr.mjs} +1 -1
  166. package/dist/esm/{EmbeddedWalletPasswordUpdateSplashScreen-BNOCuoES.mjs → EmbeddedWalletPasswordUpdateSplashScreen-9VnFkswr.mjs} +1 -1
  167. package/dist/esm/{EnrollTotp-CtNw20-I.mjs → EnrollTotp-twiE9SrW.mjs} +1 -1
  168. package/dist/esm/{ErrorScreen-NoHFWbKU.mjs → ErrorScreen-CTI5XNc0.mjs} +1 -1
  169. package/dist/esm/FarcasterConnectStatusScreen-26MCKeUz.mjs +1 -0
  170. package/dist/esm/{FarcasterSignerStatusScreen-MQ2QrijY.mjs → FarcasterSignerStatusScreen-YwCO1kz9.mjs} +1 -1
  171. package/dist/esm/{FundSolWalletWithExternalSolanaWallet-DVaHCgDh.mjs → FundSolWalletWithExternalSolanaWallet-B3w3-z6B.mjs} +1 -1
  172. package/dist/esm/{FundWalletMethodHeader-RY6-H-Ry.mjs → FundWalletMethodHeader-CN-93vVj.mjs} +1 -1
  173. package/dist/esm/FundingEditAmountScreen-Cz6ZAJlk.mjs +1 -0
  174. package/dist/esm/{FundingMethodSelectionScreen-yZenKs6o.mjs → FundingMethodSelectionScreen-B85fzSsC.mjs} +1 -1
  175. package/dist/esm/{InAppBrowserLoginNotPossible-CTnPeOBa.mjs → InAppBrowserLoginNotPossible-CPsaFweG.mjs} +1 -1
  176. package/dist/esm/{InstallWalletScreen-CBxWJiQf.mjs → InstallWalletScreen-D5mGXNHF.mjs} +1 -1
  177. package/dist/esm/LandingScreen-BqSnrgDb.mjs +1 -0
  178. package/dist/esm/{LinkConflictScreen-BnoDRUE0.mjs → LinkConflictScreen-D8y5of24.mjs} +1 -1
  179. package/dist/esm/{LinkEmailScreen-x_TPODcx.mjs → LinkEmailScreen-C9lKAk-L.mjs} +1 -1
  180. package/dist/esm/{LinkPasskeyScreen-D9IfHaec.mjs → LinkPasskeyScreen-C33kWVrX.mjs} +1 -1
  181. package/dist/esm/{LinkPhoneScreen-DaK-7otl.mjs → LinkPhoneScreen-Bi98Ngac.mjs} +1 -1
  182. package/dist/esm/{LoginFailedScreen-CoukYLVP.mjs → LoginFailedScreen-BX7s2pm7.mjs} +1 -1
  183. package/dist/esm/{ManualTransferScreen-DdumQnbt.mjs → ManualTransferScreen-BBMujAte.mjs} +1 -1
  184. package/dist/esm/{MfaAuthEnrollmentFlowScreen-BsRpCR72.mjs → MfaAuthEnrollmentFlowScreen-BBOfIRfA.mjs} +1 -1
  185. package/dist/esm/{MfaAuthVerifyFlowScreen-Cr92F0yT.mjs → MfaAuthVerifyFlowScreen-CwZbfXVc.mjs} +1 -1
  186. package/dist/esm/{MfaEnrollmentFlowScreen-CXyaDU1D.mjs → MfaEnrollmentFlowScreen-Dq5X_CVZ.mjs} +1 -1
  187. package/dist/esm/{MfaVerifyFlowScreen-ghKHn2BT.mjs → MfaVerifyFlowScreen-DGylIeVO.mjs} +1 -1
  188. package/dist/esm/{ModalHeader-CxHK1IKF.mjs → ModalHeader-DHXUvTf4.mjs} +1 -1
  189. package/dist/esm/{MoonpayStatusScreen-DhMZLroP.mjs → MoonpayStatusScreen-Boj9S0LW.mjs} +1 -1
  190. package/dist/esm/{OAuthStatusScreen-BFVDc4G4.mjs → OAuthStatusScreen-DLvm8CkQ.mjs} +1 -1
  191. package/dist/esm/{PasskeySelectSignupOrLogin-Dvxli58H.mjs → PasskeySelectSignupOrLogin-62N4Cj_4.mjs} +1 -1
  192. package/dist/esm/{PasskeyStatusScreen-c9nu4s_d.mjs → PasskeyStatusScreen-DE8Ez-Rl.mjs} +1 -1
  193. package/dist/esm/{PasswordRecoveryScreen-CsdO4G6h.mjs → PasswordRecoveryScreen-CxXsaYPM.mjs} +1 -1
  194. package/dist/esm/{QrCode-BI2LxLLg.mjs → QrCode-CbRLsYtm.mjs} +1 -1
  195. package/dist/esm/{RecoveryOAuthStatusScreen-Dp7fnj5t.mjs → RecoveryOAuthStatusScreen-9ETDOsJ0.mjs} +1 -1
  196. package/dist/esm/{RecoveryPasswordCreateScreen-DdzD09T3.mjs → RecoveryPasswordCreateScreen-CZizgkaK.mjs} +1 -1
  197. package/dist/esm/{RecoverySelectionScreen-D2nDGt4R.mjs → RecoverySelectionScreen-CDzuMgIx.mjs} +1 -1
  198. package/dist/esm/{Screen-Dzz_AFFs.mjs → Screen-CKaxnxac.mjs} +1 -1
  199. package/dist/esm/{ScreenLayout-pthdsODa.mjs → ScreenLayout-BQ6FV6yc.mjs} +1 -1
  200. package/dist/esm/{SetAutomaticRecoveryScreen-g1kDOe61.mjs → SetAutomaticRecoveryScreen-D5x6hDUL.mjs} +1 -1
  201. package/dist/esm/{SetWalletPasswordForm-DUTEhc4R.mjs → SetWalletPasswordForm-DelBzpVM.mjs} +1 -1
  202. package/dist/esm/{SignRequestScreen-DjLHkDxK.mjs → SignRequestScreen-BA5JF3Hr.mjs} +1 -1
  203. package/dist/esm/{StandardSignAndSendTransactionScreen-CFqthHKF.mjs → StandardSignAndSendTransactionScreen-CiJd6Wf9.mjs} +1 -1
  204. package/dist/esm/{TelegramAuthScreen-B5uYbdxP.mjs → TelegramAuthScreen-zZOkgtJy.mjs} +1 -1
  205. package/dist/esm/{TransactionDetails-DITlhQNk.mjs → TransactionDetails-B2vXU-k4.mjs} +1 -1
  206. package/dist/esm/{TransactionErrorView-DmFbjQHi.mjs → TransactionErrorView-DOcJFQEX.mjs} +1 -1
  207. package/dist/esm/{TransferFromWalletScreen-Dvp-YNqS.mjs → TransferFromWalletScreen-C5QQN9h6.mjs} +1 -1
  208. package/dist/esm/{TransferOrBridgeLoadingScreen-CFRKffkj.mjs → TransferOrBridgeLoadingScreen-B-uvt7Fj.mjs} +1 -1
  209. package/dist/esm/{UpdateEmailScreen-DoDVvVCw.mjs → UpdateEmailScreen-B1-pVdEN.mjs} +1 -1
  210. package/dist/esm/{UpdatePhoneScreen-BoEnTnCl.mjs → UpdatePhoneScreen-CwYS0KNr.mjs} +1 -1
  211. package/dist/esm/{UserLimitReachedScreen-68Vv3bFU.mjs → UserLimitReachedScreen-C9lTsh_J.mjs} +1 -1
  212. package/dist/esm/{WalletButtonList-C1OqZHCA.mjs → WalletButtonList-DZp-38Ac.mjs} +1 -1
  213. package/dist/esm/{WalletInfoCard-DmIqX_B8.mjs → WalletInfoCard-C8BrD5jy.mjs} +1 -1
  214. package/dist/esm/{WalletInterstitialScreen-Du_L0CK7.mjs → WalletInterstitialScreen-d520uEnZ.mjs} +1 -1
  215. package/dist/esm/{WalletLink-D2x4SkPO.mjs → WalletLink-WAY9-CI0.mjs} +1 -1
  216. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  217. package/dist/esm/context-Dee1TPOi.mjs +1 -0
  218. package/dist/esm/{ethers-oRuqwv5W.mjs → ethers-g3QzXj2h.mjs} +1 -1
  219. package/dist/esm/extended-chains.mjs +1 -1
  220. package/dist/esm/farcaster.mjs +1 -1
  221. package/dist/esm/{frame-BMn1PaPp.mjs → frame-CwE9r3cT.mjs} +1 -1
  222. package/dist/esm/{get-is-unified-wallet-DXko-EzF.mjs → get-is-unified-wallet-_KIJnP68.mjs} +1 -1
  223. package/dist/esm/{getErc20Balance-Cl5jZN3g.mjs → getErc20Balance-CaKjNAs9.mjs} +1 -1
  224. package/dist/esm/{getErc20TokenInfo-wBcf5dYY.mjs → getErc20TokenInfo-BFoeg5F6.mjs} +1 -1
  225. package/dist/esm/{getPublicClient-C_l_ocJu.mjs → getPublicClient-A9RSftUZ.mjs} +1 -1
  226. package/dist/esm/{index-Ce4cEnEO.mjs → index-BGEWwttv.mjs} +1 -1
  227. package/dist/esm/{index-BctMJtH0.mjs → index-CiEOopPN.mjs} +1 -1
  228. package/dist/esm/index-Dr4t3oWO.mjs +5 -0
  229. package/dist/esm/index.mjs +1 -1
  230. package/dist/esm/{internal-context-DLZicboG.mjs → internal-context-e-Eni5bG.mjs} +1 -1
  231. package/dist/esm/internal.mjs +1 -1
  232. package/dist/esm/prepareFundingModalData-BYy0MVol.mjs +1 -0
  233. package/dist/esm/{reservoir-DRNnyqld.mjs → reservoir-kvLjIrEo.mjs} +1 -1
  234. package/dist/esm/{shared-BMOp6N9y.mjs → shared-CRNjAkzC.mjs} +1 -1
  235. package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-DVwf2mAj.mjs → shouldProceedtoEmbeddedWalletCreationFlow-iMnL58wW.mjs} +1 -1
  236. package/dist/esm/{smart-wallets-B3-1-dnO.mjs → smart-wallets-BMn13jfV.mjs} +1 -1
  237. package/dist/esm/smart-wallets.mjs +1 -1
  238. package/dist/esm/solana.mjs +1 -1
  239. package/dist/esm/{to-ui-error-B8DSJO-0.mjs → to-ui-error-CnxcoZ1S.mjs} +1 -1
  240. package/dist/esm/ui.mjs +1 -1
  241. package/dist/esm/{use-create-wallet-without-fallback-COqi_EHH.mjs → use-create-wallet-without-fallback-5er4aqoE.mjs} +1 -1
  242. package/dist/esm/{use-export-wallet-CRKJ4-yx.mjs → use-export-wallet-WZT8QqOJ.mjs} +1 -1
  243. package/dist/esm/{use-sign-with-user-signer-J1po7l19.mjs → use-sign-with-user-signer-eEm9Olt_.mjs} +1 -1
  244. package/dist/esm/{useActiveWallet-Bj-s666H.mjs → useActiveWallet-SiVSXkvG.mjs} +1 -1
  245. package/dist/esm/{useGetSolPrice-fF6UX0Cj.mjs → useGetSolPrice-Cfm8o9C5.mjs} +1 -1
  246. package/dist/esm/{useGetTokenPrice-CnQZmfvQ.mjs → useGetTokenPrice-CfQvz_Mo.mjs} +1 -1
  247. package/dist/esm/{useI18n-DIAzggWr.mjs → useI18n-O3hskpuB.mjs} +1 -1
  248. package/dist/esm/usePrivy-Bh4N2Hpm.mjs +1 -0
  249. package/dist/esm/{useSolanaRpcClient-Be5Dd6m5.mjs → useSolanaRpcClient-DaxiCEwc.mjs} +1 -1
  250. package/dist/esm/{useWalletBalance-BuMx9pCk.mjs → useWalletBalance-CkNw6kj0.mjs} +1 -1
  251. package/dist/esm/{useWallets-Cc1ILfGS.mjs → useWallets-DCp1uab-.mjs} +1 -1
  252. package/dist/esm/{useWallets-DuxHKVvE.mjs → useWallets-gElyEQoU.mjs} +1 -1
  253. package/package.json +6 -6
  254. package/dist/cjs/ConnectOrCreateScreen-Dfoq-0pD.js +0 -1
  255. package/dist/cjs/ConnectWalletView-CxfQTEJ2.js +0 -1
  256. package/dist/cjs/context-CToLw7Dr.js +0 -1
  257. package/dist/cjs/index-DKxtLOTJ.js +0 -5
  258. package/dist/cjs/internal-context-D80qA_jS.js +0 -1
  259. package/dist/cjs/prepareFundingModalData-BhY38T4k.js +0 -1
  260. package/dist/cjs/usePrivy-fmKLKsT3.js +0 -1
  261. package/dist/esm/ConnectOrCreateScreen-CZDi1Oaj.mjs +0 -1
  262. package/dist/esm/ConnectWalletView-tpdAD3K7.mjs +0 -1
  263. package/dist/esm/CustomLandingScreenView-DZTOg8z4.mjs +0 -2
  264. package/dist/esm/FarcasterConnectStatusScreen-CiN00CmD.mjs +0 -1
  265. package/dist/esm/FundingEditAmountScreen-DiZ2-4XS.mjs +0 -1
  266. package/dist/esm/LandingScreen-CzhCoUSE.mjs +0 -1
  267. package/dist/esm/context-B4VZqX5H.mjs +0 -1
  268. package/dist/esm/index-CCrVHfyv.mjs +0 -5
  269. package/dist/esm/prepareFundingModalData-CndHQFiM.mjs +0 -1
  270. package/dist/esm/usePrivy-BSIhOAz8.mjs +0 -1
@@ -1 +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 n}from"./prepareFundingModalData-CndHQFiM.mjs";import{q as i}from"./context-B4VZqX5H.mjs";import{Q as a}from"./useActiveWallet-Bj-s666H.mjs";import{u as s}from"./internal-context-DLZicboG.mjs";import{a as l}from"./get-is-unified-wallet-DXko-EzF.mjs";import{S as c}from"./ScreenLayout-pthdsODa.mjs";import{B as m}from"./index-CCrVHfyv.mjs";import{getErrorDetails as p}from"./ConnectionStatusScreen-B3NfUQx_.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"tinycolor2";import"zustand";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"ofetch";import"./Button-OlK_6fKk.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.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-CJMgUOnw.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BSIhOAz8.mjs";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Link-DwjLfHwW.mjs";import"./useI18n-DIAzggWr.mjs";import"./shouldProceedtoEmbeddedWalletCreationFlow-DVwf2mAj.mjs";const u=({walletLogo:t,success:o,errorMessage:r,title:i,subtitle:a,onRetry:s,onUseDifferentWallet:l,onBack:m,numRetries:p,maxRetries:u})=>/*#__PURE__*/e(c,{title:i,subtitle:a,icon:t,iconVariant:"loading",iconLoadingStatus:{success:o,fail:!!r},primaryCta:r===n.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 n,{navigateBack:c,navigate:d,lastScreen:w,currentScreen:f,data:y,setModalData:g}=l(),{walletConnectionStatus:j,closePrivyModal:v}=s(),[h,C]=t(void 0),[k,b]=t(0),x=a(j?.connector?.walletClientType||"unknown"),S="connected"===j?.status,T="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}))}),i)}else e=setTimeout(v,i);return()=>clearTimeout(e)}}),[S]);o((()=>{var e;j?.connectError&&(e=j?.connectError,C(p(e)))}),[j]);let R=j?.connector?.connectorType||"injected",B=j?.connector?.walletClientType||"unknown",W=x?.metadata?.shortName||x?.name||j?.connector?.walletBranding.name||"Browser Extension",M=x?.image_url?.md||j?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(m,{...t})),E="Browser Extension"===W?W.toLowerCase():W;n=S?`Successfully connected with ${E}`:h?h.message:T?"Switching networks":`Waiting for ${E}`;let _="Don’t see your wallet? Check your other browser windows.";return S?_="You’re good to go!":k>=2&&h?_="Unable to connect wallet":h?_=h.detail:T?_="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"===R?_="Open your mobile wallet app to continue":"coinbase_wallet"===R&&(_="Confirm in the Coinbase app/popup to continue."),/*#__PURE__*/e(u,{walletName:W,walletLogo:M,success:S,errorMessage:h,title:n,subtitle:_,onRetry:()=>{b(k+1),C(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};
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 n}from"./prepareFundingModalData-BYy0MVol.mjs";import{q as i}from"./context-Dee1TPOi.mjs";import{Q as a}from"./useActiveWallet-SiVSXkvG.mjs";import{u as s}from"./internal-context-e-Eni5bG.mjs";import{a as l}from"./get-is-unified-wallet-_KIJnP68.mjs";import{S as c}from"./ScreenLayout-BQ6FV6yc.mjs";import{B as m}from"./index-Dr4t3oWO.mjs";import{getErrorDetails as p}from"./ConnectionStatusScreen-nzx3dVCV.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"tinycolor2";import"zustand";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";import"ofetch";import"./Button-DJY5dut3.mjs";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.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-CJMgUOnw.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Bh4N2Hpm.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Link-DwjLfHwW.mjs";import"./useI18n-O3hskpuB.mjs";import"./shouldProceedtoEmbeddedWalletCreationFlow-iMnL58wW.mjs";const u=({walletLogo:t,success:o,errorMessage:r,title:i,subtitle:a,onRetry:s,onUseDifferentWallet:l,onBack:m,numRetries:p,maxRetries:u})=>/*#__PURE__*/e(c,{title:i,subtitle:a,icon:t,iconVariant:"loading",iconLoadingStatus:{success:o,fail:!!r},primaryCta:r===n.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 n,{navigateBack:c,navigate:d,lastScreen:w,currentScreen:f,data:y,setModalData:g}=l(),{walletConnectionStatus:j,closePrivyModal:v}=s(),[h,C]=t(void 0),[k,b]=t(0),x=a(j?.connector?.walletClientType||"unknown"),S="connected"===j?.status,T="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}))}),i)}else e=setTimeout(v,i);return()=>clearTimeout(e)}}),[S]);o((()=>{var e;j?.connectError&&(e=j?.connectError,C(p(e)))}),[j]);let R=j?.connector?.connectorType||"injected",B=j?.connector?.walletClientType||"unknown",W=x?.metadata?.shortName||x?.name||j?.connector?.walletBranding.name||"Browser Extension",M=x?.image_url?.md||j?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(m,{...t})),E="Browser Extension"===W?W.toLowerCase():W;n=S?`Successfully connected with ${E}`:h?h.message:T?"Switching networks":`Waiting for ${E}`;let _="Don’t see your wallet? Check your other browser windows.";return S?_="You’re good to go!":k>=2&&h?_="Unable to connect wallet":h?_=h.detail:T?_="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"===R?_="Open your mobile wallet app to continue":"coinbase_wallet"===R&&(_="Confirm in the Coinbase app/popup to continue."),/*#__PURE__*/e(u,{walletName:W,walletLogo:M,success:S,errorMessage:h,title:n,subtitle:_,onRetry:()=>{b(k+1),C(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-Dee1TPOi.mjs";import{C as r,L as i}from"./CustomLandingScreenView-BkNtLof4.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-DHXUvTf4.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"./internal-context-e-Eni5bG.mjs";import"ofetch";import"./get-is-unified-wallet-_KIJnP68.mjs";import"viem";import"./index-Dr4t3oWO.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-SiVSXkvG.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BYy0MVol.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Bh4N2Hpm.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"lucide-react";import"./ConnectEmailForm-Cs3r5aBq.mjs";import"./Button-DJY5dut3.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./EmailInputForm-B4hjCxRU.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./farcaster-DPlSjvF5.mjs";import"./ConnectWalletView-DFfXN_9_.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./QrCode-CbRLsYtm.mjs";import"qrcode";import"./useI18n-O3hskpuB.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-CKaxnxac.mjs";import"./index-CJMgUOnw.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./Link-DwjLfHwW.mjs";import"./ConnectPhoneForm-Ft9zAuQd.mjs";import"./twitter-6jomarO4.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletButtonList-DZp-38Ac.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./ScreenLayout-BQ6FV6yc.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 +1 @@
1
- import{jsx as o,jsxs as e,Fragment as n}from"react/jsx-runtime";import{forwardRef as r,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-B4VZqX5H.mjs";import{F as m}from"./useActiveWallet-Bj-s666H.mjs";import{E as v,P as x}from"./Button-OlK_6fKk.mjs";import{C as b}from"./Chip-Bsgj4Yc-.mjs";const f=({value:n,onChange:r})=>/*#__PURE__*/o("select",{value:n,onChange:r,children:d.map((o=>/*#__PURE__*/e("option",{value:o.code,children:[o.code," +",o.callCode]},o.code)))}),w=/*#__PURE__*/r(((r,a)=>{let d=g(),[w,k]=t(!1),{accountType:N}=m(),[P,S]=t(""),[$,j]=t(d?.intl.defaultCountry??"US"),I=l(P,$),V=c($),z=p($),L=u($),q=!I,[B,E]=t(!1),D=L.length,F=o=>{let e=o.target.value;j(e),S(""),r.onChange&&r.onChange({rawPhoneNumber:P,qualifiedPhoneNumber:s(P,e),countryCode:e,isValid:l(P,$)})},R=(o,e)=>{try{let n=o.replace(/\D/g,"")===P.replace(/\D/g,"")?o:V.input(o);S(n),r.onChange&&r.onChange({rawPhoneNumber:n,qualifiedPhoneNumber:s(o,e),countryCode:e,isValid:l(o,e)})}catch(o){console.error("Error processing phone number:",o)}},T=()=>{E(!0);let o=s(P,$);r.onSubmit({rawPhoneNumber:P,qualifiedPhoneNumber:o,countryCode:$,isValid:l(P,$)}).finally((()=>E(!1)))};return i((()=>{if(r.defaultValue){let o=h(r.defaultValue);V.reset(),F({target:{value:o.countryCode}}),R(o.phone,o.countryCode)}}),[r.defaultValue]),/*#__PURE__*/e(n,{children:[/*#__PURE__*/o(y,{children:/*#__PURE__*/e(C,{$callingCodeLength:D,$stacked:r.stacked,children:[/*#__PURE__*/o(f,{value:$,onChange:F}),/*#__PURE__*/o("input",{ref:a,id:"phone-number-input",className:"login-method-button",type:"tel",placeholder:z,onFocus:()=>k(!0),onChange:o=>{R(o.target.value,$)},onKeyUp:o=>{"Enter"===o.key&&T()},value:P,autoComplete:"tel"}),"phone"!==N||w||r.hideRecent?r.stacked||r.noIncludeSubmitButton?/*#__PURE__*/o("span",{}):/*#__PURE__*/o(v,{isSubmitting:B,onClick:T,disabled:q,children:"Submit"}):/*#__PURE__*/o(b,{color:"gray",children:"Recent"})]})}),r.stacked&&!r.noIncludeSubmitButton?/*#__PURE__*/o(x,{loading:B,loadingText:null,onClick:T,disabled:q,children:"Submit"}):null]})}));let y=/*#__PURE__*/a.div.withConfig({displayName:"InputContainer",componentId:"sc-545daacd-0"})(["width:100%;"]),C=/*#__PURE__*/a.label.withConfig({displayName:"PhoneNumberInput",componentId:"sc-545daacd-1"})(["--country-code-dropdown-width:calc(54px + calc(12 * ","px));--phone-input-extra-padding-left:calc(12px + calc(3 * ","px));display:block;position:relative;width:100%;@media (min-width:441px){--country-code-dropdown-width:calc(52px + calc(10 * ","px));}&& > select{font-size:16px;height:24px;position:absolute;margin:13px calc(var(--country-code-dropdown-width) / 4);line-height:24px;width:var(--country-code-dropdown-width);background-color:var(--privy-color-background);background-size:auto;background-position-x:right;cursor:pointer;@media (min-width:441px){font-size:14px;width:var(--country-code-dropdown-width);}:focus{outline:none;box-shadow:none;}}&& > input{font-size:16px;line-height:24px;color:var(--privy-color-foreground);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;width:calc(100% - var(--country-code-dropdown-width));padding:12px 88px 12px calc(var(--country-code-dropdown-width) + var(--phone-input-extra-padding-left));padding-right:",";flex-grow:1;background:var(--privy-color-background);border:1px solid var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);width:100%;:focus{outline:none;border-color:var(--privy-color-accent);}:autofill,:-webkit-autofill{background:var(--privy-color-background);}@media (min-width:441px){font-size:14px;padding-right:78px;}}&& > :last-child{right:16px;position:absolute;top:50%;transform:translate(0,-50%);}&& > button:last-child{right:0px;line-height:24px;padding:13px 17px;:focus{outline:none;border-color:var(--privy-color-accent);}}&& > input::placeholder{color:var(--privy-color-foreground-3);}"],(o=>o.$callingCodeLength),(o=>o.$callingCodeLength),(o=>o.$callingCodeLength),(o=>o.$stacked?"16px":"88px"));export{w as C};
1
+ import{jsx as o,jsxs as e,Fragment as n}from"react/jsx-runtime";import{forwardRef as r,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-Dee1TPOi.mjs";import{F as m}from"./useActiveWallet-SiVSXkvG.mjs";import{E as v,P as x}from"./Button-DJY5dut3.mjs";import{C as b}from"./Chip-Bsgj4Yc-.mjs";const f=({value:n,onChange:r})=>/*#__PURE__*/o("select",{value:n,onChange:r,children:d.map((o=>/*#__PURE__*/e("option",{value:o.code,children:[o.code," +",o.callCode]},o.code)))}),w=/*#__PURE__*/r(((r,a)=>{let d=g(),[w,k]=t(!1),{accountType:N}=m(),[P,S]=t(""),[$,j]=t(d?.intl.defaultCountry??"US"),I=l(P,$),V=c($),z=p($),L=u($),q=!I,[B,E]=t(!1),D=L.length,F=o=>{let e=o.target.value;j(e),S(""),r.onChange&&r.onChange({rawPhoneNumber:P,qualifiedPhoneNumber:s(P,e),countryCode:e,isValid:l(P,$)})},R=(o,e)=>{try{let n=o.replace(/\D/g,"")===P.replace(/\D/g,"")?o:V.input(o);S(n),r.onChange&&r.onChange({rawPhoneNumber:n,qualifiedPhoneNumber:s(o,e),countryCode:e,isValid:l(o,e)})}catch(o){console.error("Error processing phone number:",o)}},T=()=>{E(!0);let o=s(P,$);r.onSubmit({rawPhoneNumber:P,qualifiedPhoneNumber:o,countryCode:$,isValid:l(P,$)}).finally((()=>E(!1)))};return i((()=>{if(r.defaultValue){let o=h(r.defaultValue);V.reset(),F({target:{value:o.countryCode}}),R(o.phone,o.countryCode)}}),[r.defaultValue]),/*#__PURE__*/e(n,{children:[/*#__PURE__*/o(y,{children:/*#__PURE__*/e(C,{$callingCodeLength:D,$stacked:r.stacked,children:[/*#__PURE__*/o(f,{value:$,onChange:F}),/*#__PURE__*/o("input",{ref:a,id:"phone-number-input",className:"login-method-button",type:"tel",placeholder:z,onFocus:()=>k(!0),onChange:o=>{R(o.target.value,$)},onKeyUp:o=>{"Enter"===o.key&&T()},value:P,autoComplete:"tel"}),"phone"!==N||w||r.hideRecent?r.stacked||r.noIncludeSubmitButton?/*#__PURE__*/o("span",{}):/*#__PURE__*/o(v,{isSubmitting:B,onClick:T,disabled:q,children:"Submit"}):/*#__PURE__*/o(b,{color:"gray",children:"Recent"})]})}),r.stacked&&!r.noIncludeSubmitButton?/*#__PURE__*/o(x,{loading:B,loadingText:null,onClick:T,disabled:q,children:"Submit"}):null]})}));let y=/*#__PURE__*/a.div.withConfig({displayName:"InputContainer",componentId:"sc-545daacd-0"})(["width:100%;"]),C=/*#__PURE__*/a.label.withConfig({displayName:"PhoneNumberInput",componentId:"sc-545daacd-1"})(["--country-code-dropdown-width:calc(54px + calc(12 * ","px));--phone-input-extra-padding-left:calc(12px + calc(3 * ","px));display:block;position:relative;width:100%;@media (min-width:441px){--country-code-dropdown-width:calc(52px + calc(10 * ","px));}&& > select{font-size:16px;height:24px;position:absolute;margin:13px calc(var(--country-code-dropdown-width) / 4);line-height:24px;width:var(--country-code-dropdown-width);background-color:var(--privy-color-background);background-size:auto;background-position-x:right;cursor:pointer;@media (min-width:441px){font-size:14px;width:var(--country-code-dropdown-width);}:focus{outline:none;box-shadow:none;}}&& > input{font-size:16px;line-height:24px;color:var(--privy-color-foreground);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;width:calc(100% - var(--country-code-dropdown-width));padding:12px 88px 12px calc(var(--country-code-dropdown-width) + var(--phone-input-extra-padding-left));padding-right:",";flex-grow:1;background:var(--privy-color-background);border:1px solid var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);width:100%;:focus{outline:none;border-color:var(--privy-color-accent);}:autofill,:-webkit-autofill{background:var(--privy-color-background);}@media (min-width:441px){font-size:14px;padding-right:78px;}}&& > :last-child{right:16px;position:absolute;top:50%;transform:translate(0,-50%);}&& > button:last-child{right:0px;line-height:24px;padding:13px 17px;:focus{outline:none;border-color:var(--privy-color-accent);}}&& > input::placeholder{color:var(--privy-color-foreground-3);}"],(o=>o.$callingCodeLength),(o=>o.$callingCodeLength),(o=>o.$callingCodeLength),(o=>o.$stacked?"16px":"88px"));export{w as C};
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{MagnifyingGlassIcon as i}from"@heroicons/react/24/outline";import{useVirtualizer as l}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{B as m}from"./Button-DJY5dut3.mjs";import p from"@heroicons/react/24/outline/CheckIcon";import{C as u}from"./copy-Bx2Jwc5_.mjs";import{T as g}from"./ModalHeader-DHXUvTf4.mjs";import{Q as w}from"./QrCode-CbRLsYtm.mjs";import{E as f}from"./EmailInputForm-B4hjCxRU.mjs";import{u as y,q as v}from"./context-Dee1TPOi.mjs";import{u as b}from"./useI18n-O3hskpuB.mjs";import{M as C,q as x,d as W,e as k,K as T,V as _,w as z,S}from"./useActiveWallet-SiVSXkvG.mjs";import{u as L,P as I,b as N}from"./internal-context-e-Eni5bG.mjs";import{W as A}from"./WalletCards-DH1rqayz.mjs";import{W as B,h as E}from"./prepareFundingModalData-BYy0MVol.mjs";import{S as j}from"./Screen-CKaxnxac.mjs";let O=/*#__PURE__*/h.button.withConfig({displayName:"CopyTextButton",componentId:"sc-4b0620dc-0"})(["display:flex;align-items:center;gap:0.5rem;&:hover{text-decoration:underline;}svg{width:0.875rem;height:0.875rem;}"]),q=/*#__PURE__*/h.span.withConfig({displayName:"CopiedText",componentId:"sc-4b0620dc-1"})(["display:flex;align-items:center;gap:0.25rem;font-size:0.875rem;color:var(--privy-color-foreground-2);"]),U=/*#__PURE__*/h(p).withConfig({displayName:"GreenCheck",componentId:"sc-4b0620dc-2"})(["color:var(--privy-color-success);"]),F=/*#__PURE__*/h(u).withConfig({displayName:"StyledCopy",componentId:"sc-4b0620dc-3"})(["color:var(--privy-color-foreground-3);opactiy:0.5;"]);function M({children:t,iconOnly:i,value:l,hideCopyIcon:o,...r}){let[c,s]=a(!1);/*#__PURE__*/return e(O,{...r,onClick:()=>{navigator.clipboard.writeText(l||t).catch(console.error),s(!0),setTimeout((()=>s(!1)),1500)},children:[t," ",c?/*#__PURE__*/e(q,{children:[/*#__PURE__*/n(U,{})," ",!i&&"Copied"]}):!o&&/*#__PURE__*/n(F,{})]})}const $={phantom:{mobile:{native:"phantom://",universal:"https://phantom.app/ul/"}},solflare:{mobile:{native:void 0,universal:"https://solflare.com/ul/v1/"}},metamask:{image_url:{sm:C,md:C}}};class P{static normalize(e){return e.replace(/[-_]wallet$/,"").replace(/[-_]extension$/,"").toLowerCase()}isEth(e){return e.chains.some((e=>e.startsWith("eip155:")))}isSol(e){return e.chains.some((e=>e.startsWith("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}chainMatches(e){return"ethereum-only"===this.chainFilter?"ethereum"===e:"solana-only"!==this.chainFilter||"solana"===e}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,i=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)}else t.set(e.id,e)};e.filter((e=>this.connectorOk(e))).forEach((e=>{let n=P.normalize(e.walletClientType);i({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"]})}));let l=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))||l||n.mobile.native||n.mobile.universal||x[n.slug]?.chainTypes.includes("ethereum")||(t=t.filter((e=>!e.startsWith("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||x[n.slug]?.chainTypes.includes("solana")||(t=t.filter((e=>!e.startsWith("solana")))),!t.length)return;let o=P.normalize(n.slug),r=$[n.slug],c=r?.image_url?.sm||n.image_url?.sm;t.some((e=>e.includes("eip155:")))&&i({id:o,label:n.name||o,source:"listing",listing:n,chainType:"ethereum",icon:c,url:n.homepage,chains:t}),t.some((e=>e.includes("solana:")))&&i({id:o,label:n.name||o,source:"listing",listing:n,chainType:"solana",icon:c,url:n.homepage,chains:t})})),this.includeWalletConnectQr&&l&&i({id:"wallet_connect_qr",label:"WalletConnect",source:"connector",connector:l,chainType:"ethereum",icon:B,url:void 0,chains:["eip155"]}),this.includeWalletConnectQrSolana&&a&&i({id:"wallet_connect_qr_solana",label:"WalletConnect",source:"connector",connector:a,chainType:"solana",icon:B,url:void 0,chains:["solana"]});let o=Array.from(t.values());o.forEach((e=>{let n=$[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)=>{let t=P.normalize(e.id),i=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"===i?i="binance":"universalprofiles"===i?i="universal_profile":"cryptocom-defi"===i?i="cryptocom":"bitkeep"===i&&(i="bitget_wallet");let l=r.has(t),a=r.has(i);return l&&a?r.get(t)-r.get(i):l?-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 H=/*#__PURE__*/h.div.withConfig({displayName:"Header",componentId:"sc-9b65f2b6-0"})(["display:flex;justify-content:space-between;align-items:center;"]),R=/*#__PURE__*/h.button.withConfig({displayName:"CloseButton",componentId:"sc-9b65f2b6-1"})(["padding:0.25rem;height:30px;width:30px;display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-full);background:var(--privy-color-background-2);"]),V=/*#__PURE__*/h.div.withConfig({displayName:"WalletIconWithActiveIndicator",componentId:"sc-9b65f2b6-2"})(["position:relative;display:inline-flex;align-items:center;&::after{content:' ';border-radius:var(--privy-border-radius-full);height:6px;width:6px;background-color:var(--privy-color-icon-success);position:absolute;right:-3px;top:-3px;}"]),G=/*#__PURE__*/h.img.withConfig({displayName:"WalletIcon",componentId:"sc-9b65f2b6-3"})(["width:32px;height:32px;border-radius:0.25rem;object-fit:contain;"]),Y=/*#__PURE__*/h.span.withConfig({displayName:"Chip",componentId:"sc-9b65f2b6-4"})(["display:flex;gap:0.25rem;align-items:center;padding:0.25rem 0.5rem;font-size:0.75rem;font-weight:500;line-height:1.125rem;border-radius:var(--privy-border-radius-sm);background-color:var(--privy-color-background-2);svg{width:100%;max-width:1rem;max-height:1rem;stroke-width:2;}"]),K=/*#__PURE__*/h.div.withConfig({displayName:"ScrollContainer",componentId:"sc-9b65f2b6-5"})(["display:flex;flex-direction:column;gap:0.5rem;max-height:24rem;overflow-y:scroll;&::-webkit-scrollbar{display:none;}scrollbar-gutter:stable both-edges;scrollbar-width:none;-ms-overflow-style:none;"," background-repeat:no-repeat;background-size:100% 32px,100% 16px;background-attachment:local,scroll;"],(e=>"light"===e.$colorScheme?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":"dark"===e.$colorScheme?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0));function J({enabled:e=!0,walletList:n,walletChainType:t}){let i=y(),{connectors:l}=L(),{listings:r,loading:c}=W(e),s=t??i.appearance.walletChainType,d=n??i.appearance?.walletList,h=o((()=>new P(s,d)),[s,d]),{wallets:m,walletCount:p}=o((()=>h.getWallets(l,r)),[h,l,r]),[u,g]=a(""),w=o((()=>u?m.filter((e=>e.label.toLowerCase().includes(u.toLowerCase()))):m),[u,m]),[f,v]=a();return{selected:f,setSelected:v,search:u,setSearch:g,loadingListings:c,wallets:w,walletCount:p}}let X=e=>!e||"string"!=typeof e&&(e instanceof z||e instanceof S);const Z=({index:i,style:l,data:a,recent:o})=>{let r=a.wallets[i],{walletChainType:c,handleWalletClick:s}=a,{t:d}=b(),h={...l,boxSizing:"border-box"};return r?/*#__PURE__*/e(ie,{style:h,onClick:()=>s(r),children:[r.icon&&(r.connector&&!X(r.connector)?/*#__PURE__*/n(V,{children:"string"==typeof r.icon?/*#__PURE__*/n(G,{src:r.icon}):/*#__PURE__*/n(r.icon,{style:{width:"32px",height:"32px"}})}):"string"==typeof r.icon?/*#__PURE__*/n(G,{src:r.icon}):/*#__PURE__*/n(r.icon,{style:{width:"32px",height:"32px"}})),/*#__PURE__*/n(oe,{children:r.label}),o?/*#__PURE__*/e(t,{children:[/*#__PURE__*/n(Y,{children:d("connectWallet.lastUsed")}),/*#__PURE__*/n(le,{children:/*#__PURE__*/e(t,{children:["ethereum-only"===c&&/*#__PURE__*/n(Q,{}),"solana-only"===c&&/*#__PURE__*/n(D,{})]})})]}):/*#__PURE__*/n(le,{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 ee=({className:h,customDescription:p,connectOnly:u,preSelectedWalletId:C,hideHeader:W,...B})=>{let O=y(),{t:q}=b(),{connectors:U}=L(),F=B.walletChainType||O.appearance.walletChainType,M=B.walletList||O.appearance?.walletList,{onBack:H,onClose:R,app:V}=B,{selected:Y,setSelected:K,qrUrl:ee,setQrUrl:ce,connecting:se,uiState:de,errorCode:he,wallets:me,walletCount:pe,handleConnect:ue,handleBack:ge,showSearchBar:we,isInitialConnectView:fe,title:ye,search:ve,setSearch:be}=function({onConnect:e,onBack:n,onClose:t,onConnectError:i,walletList:l,walletChainType:c,app:s}){let h=y(),{connectors:m}=L(),{t:p}=b(),{wallets:u,walletCount:g,search:w,setSearch:f,selected:C,setSelected:x}=J({enabled:k(l??[]),walletList:l,walletChainType:c}),[W,_]=a(),[z,S]=a(),[N,A]=a(),[B,E]=a(),j=!C&&!N&&!B,O=j&&(g>6||w.length>0),q=m.find((e=>"wallet_connect_v2"===e.connectorType)),U=r((async(n,t)=>{if(n){if(B?.connector===n&&"loading"===W)return void console.log("Already connecting to this wallet, skipping duplicate attempt");if(_("loading"),"string"==typeof n)return E({connector:n,name:t?.name??"Wallet",icon:t?.icon}),void window.open(n,"_blank");E({connector:n,name:t?.name??n.walletBranding.name??"Wallet",icon:t?.icon??n.walletBranding.icon});try{let t=await n.connect({showPrompt:!0});if(!t)return _("error"),S(void 0),void i?.(new I("Unable to connect wallet"));_("success"),S(void 0),T({address:t.address,client:t.walletClientType,appId:h.id}),setTimeout((()=>{e({connector:n,wallet:t})}),v)}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");_("error"),S(n?.privyErrorCode),i?.(n instanceof Error?n:new I(n?.message||"Unable to connect wallet"))}}}),[h.id,e,B,W]),F=r((()=>N?(_(void 0),S(void 0),E(void 0),void A(void 0)):B?(_(void 0),S(void 0),void E(void 0)):C?(_(void 0),S(void 0),E(void 0),void x(void 0)):"error"===W||"loading"===W?(_(void 0),S(void 0),void E(void 0)):void n?.()),[N,B,C,W,n]),M=o((()=>B?.connector===q&&N&&d&&B?.name?p("connectWallet.goToWallet",{walletName:B.name}):B?.connector===q&&N&&B?.name?p("connectWallet.scanToConnect",{walletName:B.name}):N&&B?.name?p(d?"connectWallet.goToWallet":"connectWallet.scanToConnect",{walletName:B.name}):"string"==typeof B?.connector?p("connectWallet.openOrInstall",{walletName:B.name}):C&&!B?p("connectWallet.selectNetwork"):B?null:p("connectWallet.selectYourWallet")),[B,N,C,q,p]);return{selected:C,setSelected:x,qrUrl:N,setQrUrl:A,connecting:B,uiState:W,errorCode:z,search:w,setSearch:f,wallets:u,walletCount:g,wc:q,isInitialConnectView:j,showSearchBar:O,title:M,handleConnect:U,handleBack:F,onClose:t,onConnect:e,app:s}}({...B,walletList:M,walletChainType:F}),Ce=U.find((e=>"wallet_connect_v2"===e.connectorType)),xe=U.find((e=>"walletconnect_solana"===e.walletBranding.id)),We=c(null),ke=l({count:me.length,getScrollElement:()=>We.current,estimateSize:()=>56,overscan:6,gap:5}),Te=r((async e=>{let n="solana-only"!==F&&e.chains?.some((e=>e.startsWith("eip155"))),t="ethereum-only"!==F&&e.chains?.some((e=>e.startsWith("solana"))),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 z||"solana"===e.chainType&&e instanceof S)))},l=async()=>{if(!Ce||!e.listing)return!1;let n=$[e.listing.slug]?{...e.listing,...$[e.listing.slug]}:e.listing;return Ce.setWalletEntry(n,ce),await Ce.resetConnection(e.id),await ue(Ce,{name:e.label,icon:e.icon}),!0},a=async()=>!!xe&&!!e.listing&&(await xe.disconnect(),xe.wallet.setWalletEntry(e.listing,ce),await new Promise((e=>setTimeout(e,100))),await ue(xe,{name:e.label,icon:e.icon}),!0),o=async n=>{let t=(n=>{let t=x[e.id];if(t)return t.getMobileRedirect({isSolana:n,connectOnly:!!u,useUniversalLink:!1})})(n);return!!t&&(await ue(t,{name:e.label,icon:e.icon}),!0)};if(n&&t)K(e);else{if(n&&!t){let n=i("ethereum");if(n&&!X(n))return void await ue(n,{name:e.label,icon:e.icon});if(d&&"phantom"===e.id){if(await o(!1)||await l())return}else if(await l()||await o(!1))return}if(t&&!n){let n=i("solana");if(n&&!X(n))return void await ue(n,{name:e.label,icon:e.icon});if(d){if(await o(!0)||await a())return}else if(await a()||await o(!0))return}if(!X(e.connector)){if(Ce&&"wallet_connect_v2"===e.connector?.connectorType)if(await Ce.resetConnection(e.id),"wallet_connect_qr"!==e.id&&e.listing){let n=$[e.listing.slug]?{...e.listing,...$[e.listing.slug]}:e.listing;Ce.setWalletEntry(n,ce)}else Ce.setWalletEntry({id:"wallet_connect_qr",name:"WalletConnect",rdns:"",slug:"wallet-connect",homepage:"",chains:["eip155"],mobile:{native:"",universal:void 0}},ce);return xe&&"walletconnect_solana"===e.connector?.walletBranding.id&&(await xe.disconnect(),"wallet_connect_qr_solana"!==e.id&&e.listing?xe.wallet.setWalletEntry(e.listing,ce):xe.wallet.setWalletEntry({id:"wallet_connect_solana_qr",name:"WalletConnect",rdns:"",slug:"wallet-connect-solana",homepage:"",chains:["solana"],mobile:{native:"",universal:void 0}},ce),await new Promise((e=>setTimeout(e,100)))),void await ue(e.connector,{name:e.label,icon:e.icon})}e.url&&await ue(e.url,{name:e.label,icon:e.icon})}}),[Ce,xe,ue,K,ce,F,u,U]);return s((()=>{if(!C)return;let e=me.find((({id:e})=>e===C));e&&Te(e).catch(console.error)}),[C]),/*#__PURE__*/e(j,{className:h,children:[/*#__PURE__*/n(j.Header,{icon:W&&fe?void 0:se&&!ee||ee&&d&&se?.icon?se.icon:se?void 0:A,iconVariant:se&&!ee||ee&&d?"loading":void 0,iconLoadingStatus:se&&!ee||ee&&d?{success:"success"===de,fail:"error"===de}:void 0,title:W&&fe?void 0:se&&!ee?q("connectWallet.waitingForWallet",{walletName:se.name}):ee&&d?q("connectWallet.waitingForWallet",{walletName:se?.name??"connection"}):ye,subtitle:W&&fe?void 0:se&&!ee&&"string"==typeof se.connector?q("connectWallet.installAndConnect",{walletName:se.name}):se&&!ee&&"string"!=typeof se.connector?"error"===de?he===N.NO_SOLANA_ACCOUNTS?`The connected wallet has no Solana accounts. Please add a Solana account in ${se.name} and try again.`:q("connectWallet.tryConnectingAgain"):q("connectionStatus.connectOneWallet"):fe?p??(V?q("connectWallet.connectToAccount",{appName:V.name}):null):null,showBack:!!H||!fe,showClose:!0,onBack:H||ge,onClose:R}),/*#__PURE__*/e(j.Body,{ref:We,$colorScheme:O.appearance.palette.colorScheme,style:{marginBottom:ee?"0.5rem":void 0},children:[we&&/*#__PURE__*/n(ne,{children:/*#__PURE__*/e(f,{style:{background:"transparent"},children:[/*#__PURE__*/n(_,{children:/*#__PURE__*/n(i,{})}),/*#__PURE__*/n("input",{className:"login-method-button",type:"text",placeholder:q("connectWallet.searchPlaceholder",{count:String(pe)}),onChange:e=>be(e.target.value),value:ve})]})}),ee&&d&&"loading"===de&&/*#__PURE__*/e("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"},children:[/*#__PURE__*/n(m,{variant:"primary",onClick:()=>window.open(ee.universal??ee.native,"_blank"),style:{width:"100%"},children:q("connectWallet.openInApp")}),/*#__PURE__*/n(re,{value:ee.universal??ee.native,iconOnly:!0,children:"Copy link"})]}),ee&&!d&&"loading"===de&&/*#__PURE__*/n("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"},children:/*#__PURE__*/n(re,{value:ee.universal??ee.native,iconOnly:!0,children:q("connectWallet.copyLink")})}),ee&&!d&&/*#__PURE__*/n(w,{size:280,url:ee.universal??ee.native,squareLogoElement:se?.icon?"string"==typeof se.icon?e=>/*#__PURE__*/n("svg",{...e,children:/*#__PURE__*/n("image",{href:se.icon,height:e.height,width:e.width})}):se.icon:E}),/*#__PURE__*/e(te,{children:[se&&!ee&&"string"==typeof se.connector&&/*#__PURE__*/e(ie,{onClick:()=>window.open(se.connector,"_blank"),children:[se.icon&&("string"==typeof se.icon?/*#__PURE__*/n(G,{src:se.icon}):/*#__PURE__*/n(se.icon,{})),/*#__PURE__*/n(oe,{children:se.name})]}),Y?.chains.some((e=>e.startsWith("eip155")))&&!se&&/*#__PURE__*/e(ie,{onClick:()=>Te({...Y,chains:Y.chains.filter((e=>e.startsWith("eip155")))}),children:[Y.icon&&("string"==typeof Y.icon?/*#__PURE__*/n(G,{src:Y.icon}):/*#__PURE__*/n(Y.icon,{})),/*#__PURE__*/n(oe,{children:Y.label}),/*#__PURE__*/n(le,{children:/*#__PURE__*/n(Q,{})})]}),Y?.chains.some((e=>e.startsWith("solana")))&&!se&&/*#__PURE__*/e(ie,{onClick:()=>Te({...Y,chains:Y.chains.filter((e=>e.startsWith("solana")))}),children:[Y.icon&&("string"==typeof Y.icon?/*#__PURE__*/n(G,{src:Y.icon}):/*#__PURE__*/n(Y.icon,{})),/*#__PURE__*/n(oe,{children:Y.label}),/*#__PURE__*/n(le,{children:/*#__PURE__*/n(D,{})})]}),fe&&/*#__PURE__*/e(t,{children:[!(pe>0)&&/*#__PURE__*/n(ae,{children:q("connectWallet.noWalletsFound")}),pe>0&&!ee&&/*#__PURE__*/n("div",{style:{maxHeight:56*Math.min(me.length,5)+5,width:"100%"},children:/*#__PURE__*/n("div",{style:{height:`${ke.getTotalSize()}px`,width:"100%",position:"relative"},children:ke.getVirtualItems().map((e=>/*#__PURE__*/n(Z,{index:e.index,style:{position:"absolute",top:0,left:0,height:`${e.size}px`,transform:`translateY(${e.start}px)`},data:{wallets:me,walletChainType:F,handleWalletClick:Te}},e.key)))})})]})]})]}),/*#__PURE__*/e(j.Footer,{children:[se&&!ee&&"string"!=typeof se.connector&&"error"===de&&/*#__PURE__*/n(j.Actions,{children:/*#__PURE__*/n(m,{style:{width:"100%",alignItems:"center"},variant:"error",onClick:()=>ue(se.connector,{name:se.name,icon:se.icon}),children:q("connectWallet.retry")})}),!!(V&&V.legal.privacyPolicyUrl&&V.legal.termsAndConditionsUrl)&&/*#__PURE__*/n(g,{app:V,alwaysShowImplicitConsent:!0}),/*#__PURE__*/n(j.Watermark,{})]})]})};let ne=/*#__PURE__*/h.div.withConfig({displayName:"StickySearchContainer",componentId:"sc-34a6bff4-0"})(["position:sticky;margin-top:-3px;padding-top:3px;top:-3px;z-index:1;background:var(--privy-color-background);padding-bottom:calc(var(--screen-space) / 2);"]),te=/*#__PURE__*/h.div.withConfig({displayName:"WalletListContainer",componentId:"sc-34a6bff4-1"})(["display:flex;flex-direction:column;gap:","px;"],5),ie=/*#__PURE__*/h.button.withConfig({displayName:"Button",componentId:"sc-34a6bff4-2"})(["&&{gap:0.5rem;align-items:center;display:flex;position:relative;text-align:left;font-weight:500;transition:background 200ms ease-in;width:calc(100% - 4px);border-radius:var(--privy-border-radius-md);padding:0.75em;border:1px solid var(--privy-color-foreground-4);justify-content:space-between;}&:hover{background:var(--privy-color-background-2);}"]),le=/*#__PURE__*/h.span.withConfig({displayName:"ButtonBadge",componentId:"sc-34a6bff4-3"})(["display:flex;align-items:center;justify-content:end;position:relative;& > svg{border-radius:var(--privy-border-radius-full);stroke-width:2.5;width:100%;max-height:1rem;max-width:1rem;flex-shrink:0;}& > svg:not(:last-child){border-radius:var(--privy-border-radius-full);margin-right:-0.375rem;}"]),ae=/*#__PURE__*/h.div.withConfig({displayName:"EmptyContainer",componentId:"sc-34a6bff4-4"})(["height:60px;display:flex;align-items:center;justify-content:center;text-align:center;"]),oe=/*#__PURE__*/h.span.withConfig({displayName:"WalletName",componentId:"sc-34a6bff4-5"})(["text-overflow:ellipsis;white-space:nowrap;color:var(--privy-color-foreground);font-weight:400;flex:1;"]),re=/*#__PURE__*/h(M).withConfig({displayName:"StyledCopyableText",componentId:"sc-34a6bff4-6"})(["&&{margin:0.5rem auto 0 auto;}"]);export{M as C,H,K as S,G as W,Y as a,R as b,P as c,Z as d,ee as i,J as u};
@@ -1 +1 @@
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-CCrVHfyv.mjs";import{L as g}from"./Link-DwjLfHwW.mjs";import{u as w,q as h}from"./context-B4VZqX5H.mjs";import{u as S}from"./useI18n-DIAzggWr.mjs";import{C as y,P as f,d as C}from"./prepareFundingModalData-CndHQFiM.mjs";import{Q as b,k as v,T}from"./useActiveWallet-Bj-s666H.mjs";import{isHex as _,getAddress as E}from"viem";import{b as R,u as k,j as A}from"./internal-context-DLZicboG.mjs";import{u as W,a as I}from"./get-is-unified-wallet-DXko-EzF.mjs";import{s as L}from"./shouldProceedtoEmbeddedWalletCreationFlow-DVwf2mAj.mjs";import{a as j,b as U}from"./usePrivy-BSIhOAz8.mjs";import{S as O}from"./ScreenLayout-pthdsODa.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useWallets-DuxHKVvE.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./events-context-CI0iqAXA.mjs";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./getPublicClient-C_l_ocJu.mjs";import"ofetch";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"tinycolor2";import"./Button-OlK_6fKk.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.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-CJMgUOnw.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 M=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,x=({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:Q,walletConnectionStatus:Y,closePrivyModal:J,initLoginWithWallet:K,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(Y?.connector?.walletClientType||"unknown"),we=c&&"wallet_connect_v2"===Y?.connector?.connectorType||c&&"coinbase_wallet"===Y?.connector?.connectorType||c&&"base_account"===Y?.connector?.connectorType||c&&"injected"===Y?.connector?.connectorType&&"phantom"===Y?.connector?.walletClientType||c&&"solana_adapter"===Y?.connector?.connectorType&&"mobile_wallet_adapter"===Y.connector.walletClientType,he="connected"===Y?.status,Se="switching_to_supported_chain"===Y?.status;i((()=>{let e=Q(),t=e instanceof p||e instanceof d?e:void 0;he&&"solana"===Y.connector?.chainType&&"phantom"===Y.connector?.walletClientType&&oe(U)&&void 0===H?.login?.isSigningInWithLedgerSolana?D("ConnectLedgerScreen",!1):(he&&!t&&(!ue||pe||E?K(Y.connectedWallet,pe,H?.login?.disableSignup,H?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})):(q({captchaModalData:{callback:e=>K(Y.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"===Y?.connector?.connectorType&&"metamask"===Y?.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((()=>J({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:Q()?.meta.address,displayName:e.data?.data?.account?.displayName,externalWalletMetadata:{walletClientType:Q()?.meta.walletClientType,chainId:Q()?.meta.chainId,connectorType:Q()?.meta.connectorType},linkMethod:Q()instanceof p?"siwe":"siws",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void D("LinkConflictScreen")):void _(M(e));D("AccountNotFoundScreen")}else D("AllowlistRejectionScreen")};async function fe(){try{await V(),l(!0)}catch(e){ye(e)}finally{f(!1)}}i((()=>{Y?.connectError&&ye(Y?.connectError)}),[Y]),((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&&Y?.connector instanceof m?Y.connector.redirectUri:void 0;e&&re(e);let t="wallet_connect_v2"===Ce&&Y?.connector instanceof m?Y.connector.fallbackUniversalRedirectUri:void 0;t&&le(t)}),Y?.connector instanceof m&&!ae?500:null);let Ce=Y?.connector?.connectorType||"injected",be=Y?.connector?.walletClientType||"unknown",ve=ge?.metadata?.shortName||ge?.name||Y?.connector?.walletBranding.name||"Browser Extension",Te=ge?.image_url?.md||Y?.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(x,{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()):Y?.connectRetry()},onCoinbaseReset:()=>{Re&&Re?.disconnect()},onDifferentWallet:B})}};let B=/*#__PURE__*/l.p.withConfig({displayName:"RedirectLinksContainer",componentId:"sc-2a867557-0"})(["text-align:center;color:var(--privy-color-foreground-2);font-size:14px;line-height:22px;margin:16px 0;"]);export{D as ConnectionStatusScreen,x as ConnectionStatusView,D as default,M as getErrorDetails};
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-Dr4t3oWO.mjs";import{L as g}from"./Link-DwjLfHwW.mjs";import{u as w,q as h}from"./context-Dee1TPOi.mjs";import{u as S}from"./useI18n-O3hskpuB.mjs";import{C as y,P as f,d as C}from"./prepareFundingModalData-BYy0MVol.mjs";import{Q as b,k as v,T}from"./useActiveWallet-SiVSXkvG.mjs";import{isHex as _,getAddress as E}from"viem";import{b as R,u as k,k as A}from"./internal-context-e-Eni5bG.mjs";import{u as W,a as I}from"./get-is-unified-wallet-_KIJnP68.mjs";import{s as L}from"./shouldProceedtoEmbeddedWalletCreationFlow-iMnL58wW.mjs";import{c as j,e as U}from"./usePrivy-Bh4N2Hpm.mjs";import{S as O}from"./ScreenLayout-BQ6FV6yc.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useWallets-gElyEQoU.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./events-context-CI0iqAXA.mjs";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./getPublicClient-A9RSftUZ.mjs";import"ofetch";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"tinycolor2";import"./Button-DJY5dut3.mjs";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.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-CJMgUOnw.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 M=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,x=({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:Q,walletConnectionStatus:Y,closePrivyModal:J,initLoginWithWallet:K,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(Y?.connector?.walletClientType||"unknown"),we=c&&"wallet_connect_v2"===Y?.connector?.connectorType||c&&"coinbase_wallet"===Y?.connector?.connectorType||c&&"base_account"===Y?.connector?.connectorType||c&&"injected"===Y?.connector?.connectorType&&"phantom"===Y?.connector?.walletClientType||c&&"solana_adapter"===Y?.connector?.connectorType&&"mobile_wallet_adapter"===Y.connector.walletClientType,he="connected"===Y?.status,Se="switching_to_supported_chain"===Y?.status;i((()=>{let e=Q(),t=e instanceof p||e instanceof d?e:void 0;he&&"solana"===Y.connector?.chainType&&"phantom"===Y.connector?.walletClientType&&oe(U)&&void 0===H?.login?.isSigningInWithLedgerSolana?D("ConnectLedgerScreen",!1):(he&&!t&&(!ue||pe||E?K(Y.connectedWallet,pe,H?.login?.disableSignup,H?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})):(q({captchaModalData:{callback:e=>K(Y.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"===Y?.connector?.connectorType&&"metamask"===Y?.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((()=>J({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:Q()?.meta.address,displayName:e.data?.data?.account?.displayName,externalWalletMetadata:{walletClientType:Q()?.meta.walletClientType,chainId:Q()?.meta.chainId,connectorType:Q()?.meta.connectorType},linkMethod:Q()instanceof p?"siwe":"siws",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void D("LinkConflictScreen")):void _(M(e));D("AccountNotFoundScreen")}else D("AllowlistRejectionScreen")};async function fe(){try{await V(),l(!0)}catch(e){ye(e)}finally{f(!1)}}i((()=>{Y?.connectError&&ye(Y?.connectError)}),[Y]),((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&&Y?.connector instanceof m?Y.connector.redirectUri:void 0;e&&re(e);let t="wallet_connect_v2"===Ce&&Y?.connector instanceof m?Y.connector.fallbackUniversalRedirectUri:void 0;t&&le(t)}),Y?.connector instanceof m&&!ae?500:null);let Ce=Y?.connector?.connectorType||"injected",be=Y?.connector?.walletClientType||"unknown",ve=ge?.metadata?.shortName||ge?.name||Y?.connector?.walletBranding.name||"Browser Extension",Te=ge?.image_url?.md||Y?.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(x,{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()):Y?.connectRetry()},onCoinbaseReset:()=>{Re&&Re?.disconnect()},onDifferentWallet:B})}};let B=/*#__PURE__*/l.p.withConfig({displayName:"RedirectLinksContainer",componentId:"sc-2a867557-0"})(["text-align:center;color:var(--privy-color-foreground-2);font-size:14px;line-height:22px;margin:16px 0;"]);export{D as ConnectionStatusScreen,x as ConnectionStatusView,D as default,M as getErrorDetails};
@@ -1 +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-B4VZqX5H.mjs";import{R as s}from"./index-CCrVHfyv.mjs";import{u as n,a as c,e as m,b as l}from"./internal-context-DLZicboG.mjs";import{a as p}from"./get-is-unified-wallet-DXko-EzF.mjs";import{z as d}from"./useActiveWallet-Bj-s666H.mjs";import{s as u}from"./shouldProceedtoEmbeddedWalletCreationFlow-DVwf2mAj.mjs";import{S as f}from"./ScreenLayout-pthdsODa.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-DuxHKVvE.mjs";import"./prepareFundingModalData-CndHQFiM.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BSIhOAz8.mjs";import"./events-context-CI0iqAXA.mjs";import"styled-components";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"viem";import"./getPublicClient-C_l_ocJu.mjs";import"ofetch";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-OlK_6fKk.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.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-CJMgUOnw.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})},v={component:()=>{let t=i(),{data:f,navigate:v,setModalData:A,onUserCloseViaDialogOrKeybindRef:j}=p(),{crossAppAuthFlow:y,updateWallets:g,closePrivyModal:b,createAnalyticsEvent:C}=n(),{logout:w}=d(),[S,U]=o({}),T=f?.crossAppAuth,k={id:T.appId,name:T.name,logoUrl:T.logoUrl},W=new c(`There was an issue connecting your ${k.name} account. Please try again.`),x=new s((async e=>{if(T.popup)try{let t=await y({appId:e,popup:T.popup,action:T.action});U({data:t})}catch(e){if(e instanceof c)U({error:e});else if(e instanceof m){if(e.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return A({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:`privy:${k.id}`,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void v("LinkConflictScreen");T.popup&&T.popup.close(),U({error:W})}else U({error:W})}else U({error:W})})),E=()=>{S.data&&(g(),T.onSuccess(S.data),b({shouldCallAuthOnSuccess:!0,isSuccess:!0})),T.onError(S.error??new c("User canceled flow")),b({shouldCallAuthOnSuccess:!1,isSuccess:!1})};return j.current=E,r((()=>{k.id.length&&x.execute(k.id)}),[k.id]),r((()=>{if(!S.data)return;let e=S.data;if(t.legal.requireUsersAcceptTerms&&!e.hasAcceptedTerms){let e=setTimeout((()=>{v("AffirmativeConsentScreen")}),a);return()=>clearTimeout(e)}if(u(e,t.embeddedWallets)){let e=setTimeout((()=>{A({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),C({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:`privy:${k.id}`,screen:"CrossAppAuthScreen"}}),w()},callAuthOnSuccessOnClose:!0}}),v("EmbeddedWalletOnAccountCreateScreen")}),a);return()=>clearTimeout(e)}let o=setTimeout(E,a);return()=>clearTimeout(o)}),[S.data]),/*#__PURE__*/e(h,{providerApp:k,success:!!S.data,error:S.error,onClose:E})},isShownBeforeReady:!0};export{v as CrossAppAuthScreen,h as CrossAppAuthScreenView,v as default};
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-Dee1TPOi.mjs";import{R as s}from"./index-Dr4t3oWO.mjs";import{u as n,a as c,e as m,b as l}from"./internal-context-e-Eni5bG.mjs";import{a as p}from"./get-is-unified-wallet-_KIJnP68.mjs";import{z as d}from"./useActiveWallet-SiVSXkvG.mjs";import{s as u}from"./shouldProceedtoEmbeddedWalletCreationFlow-iMnL58wW.mjs";import{S as f}from"./ScreenLayout-BQ6FV6yc.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-gElyEQoU.mjs";import"./prepareFundingModalData-BYy0MVol.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Bh4N2Hpm.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"styled-components";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"viem";import"./getPublicClient-A9RSftUZ.mjs";import"ofetch";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJY5dut3.mjs";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.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-CJMgUOnw.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})},v={component:()=>{let t=i(),{data:f,navigate:v,setModalData:A,onUserCloseViaDialogOrKeybindRef:j}=p(),{crossAppAuthFlow:y,updateWallets:g,closePrivyModal:b,createAnalyticsEvent:C}=n(),{logout:w}=d(),[S,U]=o({}),T=f?.crossAppAuth,k={id:T.appId,name:T.name,logoUrl:T.logoUrl},W=new c(`There was an issue connecting your ${k.name} account. Please try again.`),x=new s((async e=>{if(T.popup)try{let t=await y({appId:e,popup:T.popup,action:T.action});U({data:t})}catch(e){if(e instanceof c)U({error:e});else if(e instanceof m){if(e.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return A({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:`privy:${k.id}`,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void v("LinkConflictScreen");T.popup&&T.popup.close(),U({error:W})}else U({error:W})}else U({error:W})})),E=()=>{S.data&&(g(),T.onSuccess(S.data),b({shouldCallAuthOnSuccess:!0,isSuccess:!0})),T.onError(S.error??new c("User canceled flow")),b({shouldCallAuthOnSuccess:!1,isSuccess:!1})};return j.current=E,r((()=>{k.id.length&&x.execute(k.id)}),[k.id]),r((()=>{if(!S.data)return;let e=S.data;if(t.legal.requireUsersAcceptTerms&&!e.hasAcceptedTerms){let e=setTimeout((()=>{v("AffirmativeConsentScreen")}),a);return()=>clearTimeout(e)}if(u(e,t.embeddedWallets)){let e=setTimeout((()=>{A({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),C({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:`privy:${k.id}`,screen:"CrossAppAuthScreen"}}),w()},callAuthOnSuccessOnClose:!0}}),v("EmbeddedWalletOnAccountCreateScreen")}),a);return()=>clearTimeout(e)}let o=setTimeout(E,a);return()=>clearTimeout(o)}),[S.data]),/*#__PURE__*/e(h,{providerApp:k,success:!!S.data,error:S.error,onClose:E})},isShownBeforeReady:!0};export{v as CrossAppAuthScreen,h as CrossAppAuthScreenView,v as default};
@@ -0,0 +1,2 @@
1
+ import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import i 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-DHXUvTf4.mjs";import{u}from"./context-Dee1TPOi.mjs";import{u as m}from"./internal-context-e-Eni5bG.mjs";import{u as g,a as f,i as y}from"./get-is-unified-wallet-_KIJnP68.mjs";import{a as w,t as v}from"./index-Dr4t3oWO.mjs";import{U as C,G as b,H as k,V as S,F as T,W as M,X as x,Y as A,e as L,Z as I,_ as N,$ as W,a0 as E}from"./useActiveWallet-SiVSXkvG.mjs";import{Mail as P,Smartphone as j,UserCircle as D}from"lucide-react";import{C as O}from"./ConnectEmailForm-Cs3r5aBq.mjs";import{C as R}from"./Chip-Bsgj4Yc-.mjs";import{F as _}from"./farcaster-DPlSjvF5.mjs";import{toObjectKeys as V}from"@privy-io/js-sdk-core";import{u as U,c as F,d as $}from"./ConnectWalletView-DFfXN_9_.mjs";import z from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import H from"@heroicons/react/24/outline/FingerPrintIcon";import{L as G}from"./Link-DwjLfHwW.mjs";import{C as q}from"./ConnectPhoneForm-Ft9zAuQd.mjs";import{T as B,a as K,I as X,S as Z,L as J,G as Q,b as Y,D as ee,A as te}from"./twitter-6jomarO4.mjs";import{T as ae,L as ie}from"./twitch-5IOe4sIQ.mjs";import{T as le}from"./telegram-B-JqnkqZ.mjs";import{W as re,t as ne}from"./WalletButtonList-DZp-38Ac.mjs";import{S as oe}from"./ScreenLayout-BQ6FV6yc.mjs";const se=()=>{let t=u(),a=t?.appearance?.logo,i=`${t?.name} logo`,r={maxHeight:"90px",maxWidth:"180px"};return a?"string"==typeof a?/*#__PURE__*/e("img",{src:a,alt:i,style:r}):"svg"===a.type||"img"===a.type?/*#__PURE__*/l.cloneElement(a,{alt:i,style:r}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null},ce=t=>{let a=u();return a?.appearance.logo?/*#__PURE__*/e(de,{...t,children:/*#__PURE__*/e(se,{})}):null},de=/*#__PURE__*/c.div.withConfig({displayName:"AppLogoContainer",componentId:"sc-b210074-0"})(["display:flex;flex-direction:column;align-items:center;padding:24px 0;flex-grow:1;justify-content:center;"]),pe=({name:t,logoUrl:a,size:i="38px"})=>"string"==typeof a?/*#__PURE__*/e("img",{src:a,alt:`${t??"Provider app"} logo`,style:{width:i,height:i,maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):
2
+ /*#__PURE__*/e("span",{}),he=({appId:i})=>{let[l,o]=r(void 0),{startCrossAppAuthFlow:s,authenticated:c}=g(),{client:d}=m();return n((()=>{(async()=>{d&&o(await d.getCrossAppProviderDetails(i))})()}),[d]),/*#__PURE__*/e(C,{onClick:()=>s({appId:i,action:c?"link":"login"}),disabled:!l,children:l?/*#__PURE__*/t(a,{children:[/*#__PURE__*/e(pe,{name:l.name,logoUrl:l.icon_url||void 0,size:"24px"})," ",l.name]}):/*#__PURE__*/e(b,{})})},ue=({isEditable:i,setIsEditable:l,defaultValue:r})=>{let n=o(null);/*#__PURE__*/return t(a,{children:[/*#__PURE__*/e(k,{$if:!i,children:/*#__PURE__*/e(O,{ref:n,defaultValue:r})}),/*#__PURE__*/e(k,{$if:i,children:/*#__PURE__*/t(C,{onClick:()=>{l(),setTimeout((()=>{n.current?.focus()}),0)},children:[/*#__PURE__*/e(S,{children:/*#__PURE__*/e(P,{})}),"Continue with Email"]})})]})},me=()=>{let[a,i]=r(!1),{currentScreen:l,navigate:n,setModalData:o,data:s}=f(),{enabled:c,token:d}=w(),{initLoginWithFarcaster:p}=m(),{accountType:h}=T();/*#__PURE__*/return t(C,{onClick:async()=>{i(!0);try{c&&!d?(o({captchaModalData:{callback:e=>p(e,s?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:"FarcasterConnectStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),n("CaptchaScreen")):(await p(d,s?.login?.disableSignup),n("FarcasterConnectStatusScreen"))}catch(e){o({errorModalData:{error:e,previousScreen:l||"LandingScreen"}}),n("ErrorScreen")}finally{i(!1)}},disabled:!1,children:[/*#__PURE__*/e(_,{width:32,height:32})," Farcaster",a&&/*#__PURE__*/e(b,{}),"farcaster"===h&&/*#__PURE__*/e(ge,{color:"gray",children:"Recent"})]})};let ge=/*#__PURE__*/c(R).withConfig({displayName:"StyledChip",componentId:"sc-2f1c7323-0"})(["margin-left:auto;"]);const fe=({...a})=>/*#__PURE__*/t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...a,children:[/*#__PURE__*/t("g",{clipPath:"url(#clip0_2856_1743)",children:[/*#__PURE__*/e("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/e("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),/*#__PURE__*/e("defs",{children:/*#__PURE__*/e("clipPath",{id:"clip0_2856_1743",children:/*#__PURE__*/e("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]}),ye=({chainType:a,withPadding:i})=>{let l="";return l="ethereum-only"===a||"ethereum-and-solana"===a?"Rainbow, Phantom, or Coinbase Wallet":"Phantom or Solflare",/*#__PURE__*/e(M,{$withPadding:i,children:/*#__PURE__*/t(x,{children:[/*#__PURE__*/e(z,{style:{color:"var(--privy-color-warn)",height:48,width:48}}),/*#__PURE__*/e("h3",{children:"No wallets available"}),/*#__PURE__*/t("p",{children:["Please download an external wallet provider, like ",l,"."]})]})},"empty-wallet-state")},we=()=>{let{enabled:a,token:i}=w(),{navigate:l,setModalData:r,data:n}=f(),o=u(),{initLoginWithPasskey:c}=m(),d=()=>{o.loginConfig.passkeysForSignupEnabled?l("PasskeySelectSignupOrLogin"):(async()=>{a&&!i?(r({passkeyAuthModalData:{passkeySignupFlow:!1},captchaModalData:{callback:e=>c({captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"PasskeyStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),l("CaptchaScreen")):(await c({withPrivyUi:!0,captchaToken:i}),r({passkeyAuthModalData:{passkeySignupFlow:!1}}),l("PasskeyStatusScreen"))})()};return 0===s((()=>{let e=n?.login?.loginMethods;return e?e.filter((e=>"passkey"!==e)).length:Object.entries(o.loginMethods).filter((([e,t])=>t)).filter((([e])=>"passkey"!==e)).length}),[o.loginMethods,n?.login])?/*#__PURE__*/t(C,{onClick:d,children:[/*#__PURE__*/e(H,{})," Continue with passkey"]}):/*#__PURE__*/e(G,{as:"button",onClick:d,size:"sm",variant:"navigation",style:{width:"100%",justifyContent:"center"},children:"I have a passkey"})},ve=({isEditable:i,setIsEditable:l,defaultValue:r})=>{let n=o(null),{authenticated:s}=g(),{navigate:c,setModalData:d,currentScreen:p,data:h}=f(),{initLoginWithSms:y}=m(),{enabled:v,token:b}=w(),{whatsAppEnabled:T}=u();/*#__PURE__*/return t(a,{children:[/*#__PURE__*/e(k,{$if:!i,children:/*#__PURE__*/e(q,{ref:n,onSubmit:async function({qualifiedPhoneNumber:e}){if(!v||b||s)try{await y({phoneNumber:e,captchaToken:b,withPrivyUi:!0,disableSignup:h?.login?.disableSignup}),c("AwaitingPasswordlessCodeScreen")}catch(e){d({errorModalData:{error:e,previousScreen:p||"LandingScreen"}}),c("ErrorScreen")}else d({captchaModalData:{callback:t=>y({phoneNumber:e,captchaToken:t,withPrivyUi:!0,disableSignup:h?.login?.disableSignup}),userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),c("CaptchaScreen")},defaultValue:r})}),/*#__PURE__*/e(k,{$if:i,children:/*#__PURE__*/t(C,{onClick:()=>{l(),setTimeout((()=>{n.current?.focus()}),0)},children:[/*#__PURE__*/e(S,{children:/*#__PURE__*/e(j,{})}),"Continue with ",T?"WhatsApp":"SMS"]})})]})};let Ce={apple:{logo:te,displayName:"Apple"},discord:{logo:ee,displayName:"Discord"},github:{logo:Y,displayName:"GitHub"},google:{logo:Q,displayName:"Google"},linkedin:{logo:J,displayName:"LinkedIn"},spotify:{logo:Z,displayName:"Spotify"},instagram:{logo:X,displayName:"Instagram"},twitter:{logo:K,displayName:"Twitter"},tiktok:{logo:B,displayName:"TikTok"},line:{logo:ie,displayName:"LINE"},twitch:{logo:ae,displayName:"Twitch"}};const be=({provider:a})=>{let{enabled:i,token:l}=w(),{navigate:n,setModalData:o,data:c}=f(),[d,p]=r(!1),h=u(),{initLoginWithOAuth:g}=m(),{accountType:b}=T(),k=s((()=>b&&"guest"!==b&&"authorization_key"!==b&&"cross_app"!==b?v(b):null),[b]),{displayName:M,logo:x}=s((()=>{if(y(a)){let t=h.customOAuthProviders.find((e=>e.provider===a)),i=t.provider_icon_url,l=t.provider_display_name;return{displayName:l,logo:({style:t})=>/*#__PURE__*/e("img",{alt:`${l} logo`,src:i,style:t})}}return Ce[a]}),[a,h.customOAuthProviders]);/*#__PURE__*/return t(C,{onClick:()=>{p(!0),setTimeout((()=>{p(!1)}),2e3),i&&!l?(o({captchaModalData:{callback:e=>g(a,e,c?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ErrorScreen"}}),n("CaptchaScreen")):g(a,void 0,c?.login?.disableSignup)},disabled:d,children:[/*#__PURE__*/e(S,{$fullSize:!0,children:/*#__PURE__*/e(x,{style:{width:"32px",height:"32px"}})}),M,k?.loginMethod===a&&/*#__PURE__*/e(ke,{color:"gray",children:"Recent"})]})};let ke=/*#__PURE__*/c(R).withConfig({displayName:"StyledChip",componentId:"sc-e74c7091-0"})(["margin-left:auto;"]);const Se=()=>{let{enabled:a,token:i}=w(),{navigate:l,setModalData:n,data:o}=f(),[s,c]=r(!1),{initLoginWithTelegram:d}=m(),{accountType:p}=T();async function h(e){try{await d(e,o?.login?.disableSignup),n({telegramAuthModalData:{seamlessAuth:!1}}),l("TelegramAuthScreen")}catch(e){console.error(e),c(!1)}}/*#__PURE__*/return t(C,{onClick:async function(){if(c(!0),a&&!i)return n({captchaModalData:{callback:h,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ErrorScreen"}}),void l("CaptchaScreen");await h(i)},disabled:s,children:[/*#__PURE__*/e(le,{width:32,height:32}),"Telegram","telegram"===p&&/*#__PURE__*/e(Te,{color:"gray",children:"Recent"})]})};let Te=/*#__PURE__*/c(R).withConfig({displayName:"StyledChip",componentId:"sc-639dd483-0"})(["margin-left:auto;"]);const Me=({onClick:a,text:i,icon:l})=>/*#__PURE__*/t(C,{onClick:a,children:[/*#__PURE__*/e(S,{children:l}),/*#__PURE__*/e(A,{children:i})]}),xe=({connectOnly:i})=>{let{closePrivyModal:l}=m(),{data:o,setModalData:c,onUserCloseViaDialogOrKeybindRef:p,navigate:h}=f(),g=u(),w=o?.login,C=g.appearance.walletList,b=w?.walletChainType??g.appearance.walletChainType,{accountType:k,walletClientType:S,chainType:M}=T(),x=s((()=>k&&"guest"!==k&&"authorization_key"!==k&&"cross_app"!==k?v(k):null),[k]),{email:A,sms:N,google:W,twitter:E,discord:P,github:j,spotify:D,instagram:O,tiktok:R,line:_,twitch:z,linkedin:H,apple:G,wallet:q,farcaster:B,telegram:K}=s((()=>w?.loginMethods?V(w.loginMethods,!0):null),[w])??g.loginMethods,{wallets:X}=U({enabled:L(q?C:[]),walletList:C,walletChainType:b}),Z=g.customOAuthProviders,J=g.crossAppProviders,{passkey:Q}=g.loginMethods,Y=[A&&"email",N&&"sms",W&&"google",E&&"twitter",P&&"discord",j&&"github",D&&"spotify",O&&"instagram",R&&"tiktok",_&&"line",z&&"twitch",H&&"linkedin",G&&"apple",B&&"farcaster",K&&"telegram",...Z.map((e=>e.provider)),...J].filter((e=>!!e)),ee=Y.length>0,te=s((()=>q&&!ee?"web3-first":q&&g?.appearance.loginGroupPriority||"web2-first"),[q,ee,g?.appearance.loginGroupPriority]),ae=g?.appearance.hideDirectWeb2Inputs,[ie,le]=r("default"),[ne,ce]=r(Ee({mostRecentlyUsedAccountType:k,smsAvailable:N,emailAvailable:A,prefilledType:w?.prefill?.type}));n((()=>{ce(Ee({mostRecentlyUsedAccountType:k,smsAvailable:N,emailAvailable:A,prefilledType:w?.prefill?.type}))}),[A,N,k]);let de=()=>{l({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{le("default")}),150)};p.current=de;let pe=[];S&&q?pe.push(S):x?.loginMethod&&Y.includes(x.loginMethod)&&pe.push(x.loginMethod);let ge=t=>{if("email"===t)/*#__PURE__*/return e(ue,{isEditable:"email"===ne,setIsEditable:()=>{ce("email")},defaultValue:"email"===w?.prefill?.type?w.prefill.value:void 0},t);if("sms"===t)/*#__PURE__*/return e(ve,{isEditable:"sms"===ne,setIsEditable:()=>{ce("sms")},defaultValue:"phone"===w?.prefill?.type?w.prefill.value:void 0},t);if("apple"===t)/*#__PURE__*/return e(be,{provider:"apple"},t);if("discord"===t)/*#__PURE__*/return e(be,{provider:"discord"},t);if("farcaster"===t)/*#__PURE__*/return e(me,{},t);if("github"===t)/*#__PURE__*/return e(be,{provider:"github"},t);if("google"===t)/*#__PURE__*/return e(be,{provider:"google"},t);if("linkedin"===t)/*#__PURE__*/return e(be,{provider:"linkedin"},t);if("tiktok"===t)/*#__PURE__*/return e(be,{provider:"tiktok"},t);if("line"===t)/*#__PURE__*/return e(be,{provider:"line"},t);if("twitch"===t)/*#__PURE__*/return e(be,{provider:"twitch"},t);if("spotify"===t)/*#__PURE__*/return e(be,{provider:"spotify"},t);if("instagram"===t)/*#__PURE__*/return e(be,{provider:"instagram"},t);if("twitter"===t)/*#__PURE__*/return e(be,{provider:"twitter"},t);if("telegram"===t)/*#__PURE__*/return e(Se,{},t);if(y(t))/*#__PURE__*/return e(be,{provider:t},t);if(t.startsWith("privy:")){let a=t.split(":")[1];if(!a)throw Error("Invalid cross-app provider format. App ID missing.");/*#__PURE__*/return e(he,{appId:a},t)}let a=X.findIndex((({id:e})=>e===F.normalize(t))),l="solana"===M?"solana-only":"ethereum-only";/*#__PURE__*/return e($,{recent:!0,index:a,data:{wallets:X,walletChainType:l,handleWalletClick(e){c((t=>({...t,externalConnectWallet:{walletList:C,walletChainType:l,preSelectedWalletId:e.id}}))),h(i?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}})},fe=X.filter((e=>e.id!==F.normalize(S||""))),Ce=fe.map(((t,a)=>/*#__PURE__*/e($,{index:a,data:{walletChainType:b,wallets:fe,handleWalletClick(e){c((t=>({...t,externalConnectWallet:{walletList:C,walletChainType:b,preSelectedWalletId:e.id}}))),h(i?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}},t.id))),ke=Y.filter((e=>e!==x?.loginMethod)).flatMap(ge),Te=pe.flatMap(ge);"web3-first"===te&&"default"===ie?Ce.unshift(...Te):"web2-first"===te&&ke.unshift(...Te);let xe="web2-overflow"===ie?()=>le("default"):void 0,Pe=Y.filter((e=>"email"!==e&&"sms"!==e)),je=Ie({priority:te,email:A,sms:N,social:Pe}),De=Ne({priority:te,email:A,sms:N,social:Pe}),Oe=/*#__PURE__*/e(re,{text:We({priority:te}),onClick:()=>{c({...o,externalConnectWallet:{walletChainType:w?.walletChainType??g.appearance.walletChainType}}),h(i?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}),Re=/*#__PURE__*/e(Me,{text:je,icon:De,onClick:()=>le("web2-overflow")}),_e=ae?0:1,Ve=q&&Ce.length>0,Ue=0===ke.length&&q&&0===Ce.length,Fe=5-(Ve?1:0),$e="default"===ie&&g?.appearance.logo,ze="default"===ie&&g.appearance.loginMessage;/*#__PURE__*/return t(oe,{title:g.appearance.landingHeader,icon:$e?/*#__PURE__*/e(se,{}):void 0,iconVariant:$e?"logo":void 0,onClose:de,showClose:!0,onBack:xe,showBack:!!xe,helpText:g||Q&&"default"===ie?/*#__PURE__*/t(a,{children:[Q&&"default"===ie&&/*#__PURE__*/e(we,{}),g&&/*#__PURE__*/e(d,{app:g})]}):void 0,watermark:!0,children:[ze&&("string"==typeof g.appearance.loginMessage?/*#__PURE__*/e(Ae,{children:g.appearance.loginMessage}):/*#__PURE__*/e(Le,{children:g.appearance.loginMessage})),/*#__PURE__*/e(I,{$colorScheme:g.appearance.palette.colorScheme,children:"default"===ie&&"web2-first"===te?/*#__PURE__*/t(a,{children:[ke.length>Fe?ke.slice(0,Fe-1):ke,ke.length>Fe&&Re,Ve&&Oe,Ue&&/*#__PURE__*/e(ye,{chainType:g.appearance.walletChainType})]}):"default"===ie&&"web3-first"===te?/*#__PURE__*/t(a,{children:[q&&/*#__PURE__*/t(a,{children:[Ce.length>Fe?Ce.slice(0,Fe-1):Ce,Ce.length>Fe&&Oe]}),ke.length>_e&&Re,ke.length===_e&&ke[0],Ue&&/*#__PURE__*/e(ye,{chainType:g.appearance.walletChainType})]}):"web2-overflow"===ie?/*#__PURE__*/e(a,{children:"web3-first"===te?ke:ke.slice(3)}):null})]})};let Ae=/*#__PURE__*/c.div.withConfig({displayName:"StyledSubtitle",componentId:"sc-c85d71fe-0"})(["text-align:center;font-size:14px;margin-bottom:24px;"]),Le=/*#__PURE__*/c.div.withConfig({displayName:"MessageContainer",componentId:"sc-c85d71fe-1"})(["margin-bottom:24px;"]),Ie=({priority:e,email:t,sms:a,social:i})=>"web2-first"===e?"Other socials":t&&a&&i.length>0||t&&i.length>0?"Log in with email or socials":a&&i.length>0?"Log in with sms or socials":t&&a?"Continue with email or sms":t?"Continue with email":a?"Continue with sms":"Log in with a social account",Ne=({priority:t,email:a,sms:i,social:l})=>"web2-first"===t||l.length>0?/*#__PURE__*/e(D,{}):a&&i?/*#__PURE__*/e(fe,{}):a?/*#__PURE__*/e(P,{}):i?/*#__PURE__*/e(j,{}):null,We=({priority:e})=>"web2-first"===e?"Continue with a wallet":"Other wallets";const Ee=({mostRecentlyUsedAccountType:e,smsAvailable:t,emailAvailable:a,prefilledType:i})=>a&&("email"===e&&"phone"!==i||"email"===i)||!t||"phone"!==e&&"phone"!==i?"email":"sms",Pe=({connectOnly:l})=>{let{closePrivyModal:o,connectors:c}=m(),{onUserCloseViaDialogOrKeybindRef:g,data:y}=f(),w=u(),{appearance:{palette:{colorScheme:C}}}=u(),{accountType:b,walletClientType:k,chainType:S}=T(),M=s((()=>b&&"guest"!==b&&"authorization_key"!==b&&"cross_app"!==b?v(b):null),[b]),x=w.loginMethodsAndOrder?.primary??[],A=w.loginMethodsAndOrder?.overflow??[],L=s((()=>[...x,...A]),[x,A]),P=w.loginMethods.passkey,j=y?.login,D=[];k&&L.includes(k)?D.push(k):b&&L.includes(M?.loginMethod)&&D.push(M?.loginMethod);let[O,R]=r("default"),[_,V]=r(Ee({mostRecentlyUsedAccountType:b,smsAvailable:L.includes("sms"),emailAvailable:L.includes("email"),prefilledType:j?.prefill?.type}));n((()=>{V(Ee({mostRecentlyUsedAccountType:b,smsAvailable:L.includes("sms"),emailAvailable:L.includes("email"),prefilledType:j?.prefill?.type}))}),[L,b]),n((()=>{"phone"===b&&V("sms");let e=L.indexOf("sms"),t=L.indexOf("email");e>-1&&e<t&&V("sms")}),[b,x,A]);let U=()=>{o({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{R("default")}),150)};g.current=U;let F=t=>"email"===t?/*#__PURE__*/e(ue,{isEditable:"email"===_,setIsEditable:()=>{V("email")},defaultValue:"email"===j?.prefill?.type?j.prefill.value:void 0},t):"sms"===t?/*#__PURE__*/e(ve,{isEditable:"sms"===_,setIsEditable:()=>{V("sms")},defaultValue:"phone"===j?.prefill?.type?j.prefill.value:void 0},t):"apple"===t?/*#__PURE__*/e(be,{provider:"apple"},t):"discord"===t?/*#__PURE__*/e(be,{provider:"discord"},t):"farcaster"===t?/*#__PURE__*/e(me,{},t):"github"===t?/*#__PURE__*/e(be,{provider:"github"},t):"google"===t?/*#__PURE__*/e(be,{provider:"google"},t):"linkedin"===t?/*#__PURE__*/e(be,{provider:"linkedin"},t):"spotify"===t?/*#__PURE__*/e(be,{provider:"spotify"},t):"instagram"===t?/*#__PURE__*/e(be,{provider:"instagram"},t):"tiktok"===t?/*#__PURE__*/e(be,{provider:"tiktok"},t):"line"===t?/*#__PURE__*/e(be,{provider:"line"},t):"twitch"===t?/*#__PURE__*/e(be,{provider:"twitch"},t):"twitter"===t?/*#__PURE__*/e(be,{provider:"twitter"},t):"telegram"===t?/*#__PURE__*/e(Se,{},t):t.startsWith("privy:")?/*#__PURE__*/e(he,{appId:t.replace("privy:","")},t):ne({walletList:w.appearance.walletList,walletChainType:j?.walletChainType??w.appearance.walletChainType,connectors:c,connectOnly:l,ignore:L,walletConnectEnabled:w.externalWallets.walletConnect.enabled,forceWallet:{wallet:t,chainType:S??"ethereum"}}),$=D.flatMap(F),z=x.filter((e=>e!==k&&e!==M?.loginMethod)).flatMap(F),H=A.filter((e=>e!==k&&e!==M?.loginMethod)).flatMap(F),[G,q]=N([...$,...z,...H],je({primary:z.length+$.length,overflow:H.length}));/*#__PURE__*/return t(a,{children:[/*#__PURE__*/e(p,{title:w.appearance.landingHeader,onClose:U,backFn:"default"===O?void 0:()=>{R("default")}}),"default"===O&&/*#__PURE__*/e(De,{}),"default"===O&&("string"==typeof w.appearance.loginMessage?/*#__PURE__*/e(W,{children:w.appearance.loginMessage}):w.appearance.loginMessage),/*#__PURE__*/e(E,{style:{overflow:"hidden"},children:/*#__PURE__*/t(I,{$colorScheme:C,children:["default"===O&&/*#__PURE__*/t(a,{children:[G,q.length>0&&/*#__PURE__*/e(Me,{text:"More options",icon:/*#__PURE__*/e(i,{}),onClick:()=>R("overflow")})]}),"overflow"===O&&/*#__PURE__*/e(a,{children:q}),P&&"default"===O&&/*#__PURE__*/e(we,{})]})}),w&&/*#__PURE__*/e(d,{app:w}),/*#__PURE__*/e(h,{})]})};let je=({primary:e,overflow:t})=>e<5?e:5===e&&0===t?5:4,De=/*#__PURE__*/c(ce).withConfig({displayName:"StyledAppLogoHeader",componentId:"sc-7cdadd41-0"})(["margin-bottom:16px;"]);export{Pe as C,xe as L};
@@ -1 +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 a}from"./WalletInfoCard-DmIqX_B8.mjs";import{u as n,r as c}from"./context-B4VZqX5H.mjs";import{u as m,a as l}from"./internal-context-DLZicboG.mjs";import{a as p}from"./get-is-unified-wallet-DXko-EzF.mjs";import{S as u}from"./ScreenLayout-pthdsODa.mjs";import"styled-components";import"./Button-OlK_6fKk.mjs";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Address-C1iw9r70.mjs";import"./shared-CtYf3O54.mjs";import"tinycolor2";import"ofetch";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.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-CJMgUOnw.mjs";const d=({appName:i,address:s,success:n,error:c,onAccept:m,onDecline:l,onClose:p})=>/*#__PURE__*/e(u,n||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(a,{address:s,title:"Wallet"})}),j={component:()=>{let{data:t}=p(),o=n(),{closePrivyModal:r}=m(),[a,u]=i(!1),[j,f]=i(),{address:y,onDelegate:g,onSuccess:h,onError:w}=t.delegatedActions.consent,v=async()=>{a?h():w(j??new l("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return s((()=>{if(!a&&!j)return;let e=setTimeout(v,c);return()=>clearTimeout(e)}),[a,j]),/*#__PURE__*/e(d,{appName:o.name,address:y,success:a,error:j,onAccept:async()=>{try{await g(),u(!0)}catch(e){f(e)}},onDecline:()=>{v()},onClose:v})}};export{j as DelegatedActionsConsentScreen,d as DelegatedActionsConsentScreenView,j as default};
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 a}from"./WalletInfoCard-C8BrD5jy.mjs";import{u as n,r as c}from"./context-Dee1TPOi.mjs";import{u as m,a as l}from"./internal-context-e-Eni5bG.mjs";import{a as p}from"./get-is-unified-wallet-_KIJnP68.mjs";import{S as u}from"./ScreenLayout-BQ6FV6yc.mjs";import"styled-components";import"./Button-DJY5dut3.mjs";import"./useActiveWallet-SiVSXkvG.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BYy0MVol.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Address-CDOE2oK9.mjs";import"./shared-CtYf3O54.mjs";import"tinycolor2";import"ofetch";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.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-CJMgUOnw.mjs";const d=({appName:i,address:s,success:n,error:c,onAccept:m,onDecline:l,onClose:p})=>/*#__PURE__*/e(u,n||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(a,{address:s,title:"Wallet"})}),j={component:()=>{let{data:t}=p(),o=n(),{closePrivyModal:r}=m(),[a,u]=i(!1),[j,f]=i(),{address:y,onDelegate:g,onSuccess:h,onError:w}=t.delegatedActions.consent,v=async()=>{a?h():w(j??new l("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return s((()=>{if(!a&&!j)return;let e=setTimeout(v,c);return()=>clearTimeout(e)}),[a,j]),/*#__PURE__*/e(d,{appName:o.name,address:y,success:a,error:j,onAccept:async()=>{try{await g(),u(!0)}catch(e){f(e)}},onDecline:()=>{v()},onClose:v})}};export{j as DelegatedActionsConsentScreen,d as DelegatedActionsConsentScreenView,j as default};
@@ -1 +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-B4VZqX5H.mjs";import{u as c,a as m}from"./internal-context-DLZicboG.mjs";import{a as l}from"./get-is-unified-wallet-DXko-EzF.mjs";import{S as p}from"./ScreenLayout-pthdsODa.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./Button-OlK_6fKk.mjs";import"styled-components";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.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-CJMgUOnw.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:v,onSuccess:k,onError:h}=o.delegatedActions.revoke,j=async()=>{p?k():h(f??new m("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return n((()=>{if(!p&&!f)return;let e=setTimeout(j,a);return()=>clearTimeout(e)}),[p,f]),/*#__PURE__*/e(u,{appName:t.name,success:p,error:f,onRevoke:async()=>{try{await v(),d(!0)}catch(e){y(e)}},onDeny:()=>{j()},onClose:j})}};export{d as DelegatedActionsRevokeScreen,u as DelegatedActionsRevokeScreenView,d as default};
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-Dee1TPOi.mjs";import{u as c,a as m}from"./internal-context-e-Eni5bG.mjs";import{a as l}from"./get-is-unified-wallet-_KIJnP68.mjs";import{S as p}from"./ScreenLayout-BQ6FV6yc.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./Button-DJY5dut3.mjs";import"styled-components";import"./useActiveWallet-SiVSXkvG.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BYy0MVol.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.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-CJMgUOnw.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:v,onSuccess:k,onError:h}=o.delegatedActions.revoke,j=async()=>{p?k():h(f??new m("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return n((()=>{if(!p&&!f)return;let e=setTimeout(j,a);return()=>clearTimeout(e)}),[p,f]),/*#__PURE__*/e(u,{appName:t.name,success:p,error:f,onRevoke:async()=>{try{await v(),d(!0)}catch(e){y(e)}},onDeny:()=>{j()},onClose:j})}};export{d as DelegatedActionsRevokeScreen,u as DelegatedActionsRevokeScreenView,d as default};
@@ -1 +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-CCrVHfyv.mjs";import{u as s}from"./internal-context-DLZicboG.mjs";import{u as l,a as c}from"./get-is-unified-wallet-DXko-EzF.mjs";import{S as m}from"./ScreenLayout-pthdsODa.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"./context-B4VZqX5H.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BSIhOAz8.mjs";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-OlK_6fKk.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.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-CJMgUOnw.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:S,recoveryMethod:F,connectingWalletAddress:M,isUnifiedWallet:P=!1}=f?.connectWallet,T=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 T("User must be authenticated and have a Privy wallet before it can be connected");try{if(!P){if(!x||!S)return T("For on-device first-class chain wallets, entropyId and entropyIdVerifier are required");await v.connect({accessToken:t,entropyId:x,entropyIdVerifier:S})}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"===F){let e=await d.getAccessToken();if(!e)return T("User must be authenticated and have a Privy wallet before it can be recovered");try{y({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:M}});let t=await(v?.recover({accessToken:e,entropyId:x,entropyIdVerifier:S}));t?.entropyId||T(Error("Unable to recover wallet")),A?h(A):u({shouldCallAuthOnSuccess:!1}),y({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:M}}),h(A)}catch(e){T("An error has occurred, please try again.")}}else a(e)&&"privy"!==F&&"privy-v2"!==F?(w({...f,recoverWallet:{entropyId:x,entropyIdVerifier:S,onCompleteNavigateTo:A,onFailure:I},recoveryOAuthStatus:{provider:F,action:"recover",isInAccountCreateFlow:!1,shouldCreateEth:!1,shouldCreateSol:!1}}),h(n(F))):T(e)}})(),()=>clearTimeout(e)):void 0:T("User must be authenticated and have a Privy wallet before it can be connected")}),[t,m,v]),b.current=()=>{T("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};
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-Dr4t3oWO.mjs";import{u as s}from"./internal-context-e-Eni5bG.mjs";import{u as l,a as c}from"./get-is-unified-wallet-_KIJnP68.mjs";import{S as m}from"./ScreenLayout-BQ6FV6yc.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-SiVSXkvG.mjs";import"zustand";import"./context-Dee1TPOi.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-BYy0MVol.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Bh4N2Hpm.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJY5dut3.mjs";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.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-CJMgUOnw.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:S,recoveryMethod:F,connectingWalletAddress:M,isUnifiedWallet:P=!1}=f?.connectWallet,T=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 T("User must be authenticated and have a Privy wallet before it can be connected");try{if(!P){if(!x||!S)return T("For on-device first-class chain wallets, entropyId and entropyIdVerifier are required");await v.connect({accessToken:t,entropyId:x,entropyIdVerifier:S})}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"===F){let e=await d.getAccessToken();if(!e)return T("User must be authenticated and have a Privy wallet before it can be recovered");try{y({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:M}});let t=await(v?.recover({accessToken:e,entropyId:x,entropyIdVerifier:S}));t?.entropyId||T(Error("Unable to recover wallet")),A?h(A):u({shouldCallAuthOnSuccess:!1}),y({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:M}}),h(A)}catch(e){T("An error has occurred, please try again.")}}else a(e)&&"privy"!==F&&"privy-v2"!==F?(w({...f,recoverWallet:{entropyId:x,entropyIdVerifier:S,onCompleteNavigateTo:A,onFailure:I},recoveryOAuthStatus:{provider:F,action:"recover",isInAccountCreateFlow:!1,shouldCreateEth:!1,shouldCreateSol:!1}}),h(n(F))):T(e)}})(),()=>clearTimeout(e)):void 0:T("User must be authenticated and have a Privy wallet before it can be connected")}),[t,m,v]),b.current=()=>{T("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};
@@ -1 +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,b as s,c}from"./get-is-unified-wallet-DXko-EzF.mjs";import{u as a,r as m}from"./context-B4VZqX5H.mjs";import{u as n}from"./internal-context-DLZicboG.mjs";import{S as l}from"./ScreenLayout-pthdsODa.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./Button-OlK_6fKk.mjs";import"styled-components";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.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-CJMgUOnw.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:j,onUserCloseViaDialogOrKeybindRef:f}=i(),h=a(),{onSuccess:v,onFailure:C,callAuthOnSuccessOnClose:y}=j.createWallet,S=()=>{let e=s(t)??c(t);t&&e?(d(),v({user:t,account:e})):C(Error("Failed to create wallet")),l({shouldCallAuthOnSuccess:y})};return o((()=>{let e=setTimeout(S,m);return()=>clearTimeout(e)}),[]),f.current=S,/*#__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:S})}};export{p as EmbeddedWalletCreatedScreen,u as EmbeddedWalletCreatedScreenView,p as default};
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,b as s,c}from"./get-is-unified-wallet-_KIJnP68.mjs";import{u as a,r as m}from"./context-Dee1TPOi.mjs";import{u as n}from"./internal-context-e-Eni5bG.mjs";import{S as l}from"./ScreenLayout-BQ6FV6yc.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./Button-DJY5dut3.mjs";import"styled-components";import"./useActiveWallet-SiVSXkvG.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BYy0MVol.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.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-CJMgUOnw.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:j,onUserCloseViaDialogOrKeybindRef:f}=i(),h=a(),{onSuccess:v,onFailure:C,callAuthOnSuccessOnClose:y}=j.createWallet,S=()=>{let e=s(t)??c(t);t&&e?(d(),v({user:t,account:e})):C(Error("Failed to create wallet")),l({shouldCallAuthOnSuccess:y})};return o((()=>{let e=setTimeout(S,m);return()=>clearTimeout(e)}),[]),f.current=S,/*#__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:S})}};export{p as EmbeddedWalletCreatedScreen,u as EmbeddedWalletCreatedScreenView,p as default};
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as t,Fragment as r}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 d}from"./WarningBanner-BDp-QC9i.mjs";import{W as c}from"./WalletInfoCard-DmIqX_B8.mjs";import{u as s}from"./context-B4VZqX5H.mjs";import{u as p}from"./internal-context-DLZicboG.mjs";import{u as m,a as u}from"./get-is-unified-wallet-DXko-EzF.mjs";import{S as h}from"./ScreenLayout-pthdsODa.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"lucide-react";import"./Button-OlK_6fKk.mjs";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Address-C1iw9r70.mjs";import"./shared-CtYf3O54.mjs";import"tinycolor2";import"ofetch";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.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-CJMgUOnw.mjs";const y=({address:o,accessToken:i,appConfigTheme:n,onClose:a,isLoading:l=!1,exportButtonProps:s})=>/*#__PURE__*/e(h,{title:"Export wallet",subtitle:/*#__PURE__*/t(r,{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,watermark:!0,children:/*#__PURE__*/t(f,{children:[/*#__PURE__*/e(d,{theme:n,children:"Never share your private key or seed phrase with anyone."}),/*#__PURE__*/e(c,{title:"Your wallet",address:o,showCopyButton:!0}),/*#__PURE__*/e("div",{style:{width:"100%"},children:l?/*#__PURE__*/e(g,{}):i&&s&&/*#__PURE__*/e(w,{accessToken:i,dimensions:{height:"44px"},...s})})]})});let f=/*#__PURE__*/a.div.withConfig({displayName:"ContentContainer",componentId:"sc-b9fde557-0"})(["display:flex;flex-direction:column;gap:1.25rem;text-align:left;"]),g=()=>/*#__PURE__*/e(v,{children:/*#__PURE__*/e(x,{children:"Loading..."})}),v=/*#__PURE__*/a.div.withConfig({displayName:"PlaceholderContainer",componentId:"sc-b9fde557-1"})(["display:flex;gap:12px;height:44px;"]),x=/*#__PURE__*/a.div.withConfig({displayName:"PlaceholderButton",componentId:"sc-b9fde557-2"})(["display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:16px;font-weight:500;border-radius:var(--privy-border-radius-md);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);"]);function w(r){let[a,d]=o(r.dimensions.width),[c,s]=o(void 0),p=n(null);i((()=>{if(p.current&&void 0===a){let{width:e}=p.current.getBoundingClientRect();d(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"===r.chainType&&!r.imported&&!r.isUnifiedWallet;/*#__PURE__*/return e("div",{ref:p,children:a&&
1
+ import{jsx as e,jsxs as t,Fragment as r}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 d}from"./WarningBanner-BDp-QC9i.mjs";import{W as c}from"./WalletInfoCard-C8BrD5jy.mjs";import{u as s}from"./context-Dee1TPOi.mjs";import{u as p}from"./internal-context-e-Eni5bG.mjs";import{u as m,a as u}from"./get-is-unified-wallet-_KIJnP68.mjs";import{S as h}from"./ScreenLayout-BQ6FV6yc.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"lucide-react";import"./Button-DJY5dut3.mjs";import"./useActiveWallet-SiVSXkvG.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BYy0MVol.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Address-CDOE2oK9.mjs";import"./shared-CtYf3O54.mjs";import"tinycolor2";import"ofetch";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.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-CJMgUOnw.mjs";const y=({address:o,accessToken:i,appConfigTheme:n,onClose:a,isLoading:l=!1,exportButtonProps:s})=>/*#__PURE__*/e(h,{title:"Export wallet",subtitle:/*#__PURE__*/t(r,{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,watermark:!0,children:/*#__PURE__*/t(f,{children:[/*#__PURE__*/e(d,{theme:n,children:"Never share your private key or seed phrase with anyone."}),/*#__PURE__*/e(c,{title:"Your wallet",address:o,showCopyButton:!0}),/*#__PURE__*/e("div",{style:{width:"100%"},children:l?/*#__PURE__*/e(g,{}):i&&s&&/*#__PURE__*/e(w,{accessToken:i,dimensions:{height:"44px"},...s})})]})});let f=/*#__PURE__*/a.div.withConfig({displayName:"ContentContainer",componentId:"sc-b9fde557-0"})(["display:flex;flex-direction:column;gap:1.25rem;text-align:left;"]),g=()=>/*#__PURE__*/e(v,{children:/*#__PURE__*/e(x,{children:"Loading..."})}),v=/*#__PURE__*/a.div.withConfig({displayName:"PlaceholderContainer",componentId:"sc-b9fde557-1"})(["display:flex;gap:12px;height:44px;"]),x=/*#__PURE__*/a.div.withConfig({displayName:"PlaceholderButton",componentId:"sc-b9fde557-2"})(["display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:16px;font-weight:500;border-radius:var(--privy-border-radius-md);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);"]);function w(r){let[a,d]=o(r.dimensions.width),[c,s]=o(void 0),p=n(null);i((()=>{if(p.current&&void 0===a){let{width:e}=p.current.getBoundingClientRect();d(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"===r.chainType&&!r.imported&&!r.isUnifiedWallet;/*#__PURE__*/return e("div",{ref:p,children:a&&
2
2
  /*#__PURE__*/t(b,{children:[/*#__PURE__*/e("iframe",{style:{position:"absolute",zIndex:1},width:a,height:r.dimensions.height,allow:"clipboard-write self *",src:l({origin:r.origin,path:`/apps/${r.appId}/embedded-wallets/export`,query:r.isUnifiedWallet?{v:"1-unified",wallet_id:r.walletId,client_id:r.appClientId,width:`${a}px`,caid:r.clientAnalyticsId,phrase_export:m,...c}:{v:"1",entropy_id:r.entropyId,entropy_id_verifier:r.entropyIdVerifier,hd_wallet_index:r.hdWalletIndex,chain_type:r.chainType,client_id:r.appClientId,width:`${a}px`,caid:r.clientAnalyticsId,phrase_export:m,...c},hash:{token:r.accessToken}})}),/*#__PURE__*/e(C,{children:"Loading..."}),m&&/*#__PURE__*/e(C,{children:"Loading..."})]})})}const I={component:()=>{let[t,r]=o(null),{authenticated:n,user:a}=m(),{closePrivyModal:l,createAnalyticsEvent:d,clientAnalyticsId:c,client:h}=p(),f=s(),{data:g,onUserCloseViaDialogOrKeybindRef:v}=u(),{onFailure:x,onSuccess:w,origin:I,appId:b,appClientId:C,entropyId:k,entropyIdVerifier:j,walletId:_,hdWalletIndex:A,chainType:P,address:T,isUnifiedWallet:V,imported:W}=g.keyExport,B=e=>{l({shouldCallAuthOnSuccess:!1}),x("string"==typeof e?Error(e):e)},L=()=>{l({shouldCallAuthOnSuccess:!1}),w(),d({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:T}})};return i((()=>{if(!n)return B("User must be authenticated before exporting their wallet");h.getAccessToken().then(r).catch(B)}),[n,a]),v.current=L,/*#__PURE__*/e(y,{address:T,accessToken:t,appConfigTheme:f.appearance.palette.colorScheme,onClose:L,isLoading:!t,exportButtonProps:t?{origin:I,appId:b,appClientId:C,clientAnalyticsId:c,entropyId:k,entropyIdVerifier:j,walletId:_,hdWalletIndex:A,isUnifiedWallet:V,imported:W,chainType:P}:void 0})}};let b=/*#__PURE__*/a.div.withConfig({displayName:"ButtonContainer",componentId:"sc-b9fde557-3"})(["overflow:visible;position:relative;overflow:none;height:44px;display:flex;gap:12px;"]),C=/*#__PURE__*/a.div.withConfig({displayName:"LoadingButton",componentId:"sc-b9fde557-4"})(["display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:16px;font-weight:500;border-radius:var(--privy-border-radius-md);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);"]);export{I as EmbeddedWalletKeyExportScreen,y as EmbeddedWalletKeyExportView,I as default};
@@ -1 +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{u as a}from"./context-B4VZqX5H.mjs";import{s as i,k as s,E as l,R as n}from"./index-CCrVHfyv.mjs";import{u as m,l as c}from"./internal-context-DLZicboG.mjs";import{u as d}from"./use-create-wallet-without-fallback-COqi_EHH.mjs";import{a as u,u as p}from"./get-is-unified-wallet-DXko-EzF.mjs";import{S as h}from"./ScreenLayout-pthdsODa.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BSIhOAz8.mjs";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-OlK_6fKk.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.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-CJMgUOnw.mjs";const w=({errorMessage:r,onClose:o})=>/*#__PURE__*/e(h,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}),y={component:()=>{let{setModalData:t,navigate:h,data:y,onUserCloseViaDialogOrKeybindRef:v}=u(),g=a(),[j,C]=r(""),{embeddedWallets:f}=a(),{authenticated:b,user:S}=p(),{closePrivyModal:x,walletProxy:W,client:O}=m(),{onSuccess:k,onFailure:A,callAuthOnSuccessOnClose:I,shouldCreateEth:M,shouldCreateSol:P}=y.createWallet,R="legacy-embedded-wallets-only"===g.embeddedWallets.mode&&!0===g?.embeddedWallets.requireUserOwnedRecoveryOnCreate,[U,E]=r(null),{create:L}=d(),T=M??(!!S&&i(S,g.embeddedWallets.ethereum.createOnLogin)),F=P??(!!S&&s(S,g.embeddedWallets.solana.createOnLogin)),D=new n((async()=>{let e=await O.getAccessToken();if(S&&e&&W)try{let e;if(T&&F)e=await L({chainType:"ethereum",walletIndex:0,latestUser:S}),e=await L({chainType:"solana",walletIndex:0,latestUser:e.user});else if(F)e=await L({chainType:"solana",walletIndex:0,latestUser:S});else{if(!T)return void x({shouldCallAuthOnSuccess:I});e=await L({chainType:"ethereum",walletIndex:0,latestUser:S})}E(e),h("EmbeddedWalletCreatedScreen")}catch(e){C(e.message)}}));return o((()=>b&&S?R?(t({...y,createWallet:{...y.createWallet,shouldCreateEth:T,shouldCreateSol:F},recoverySelection:{...y?.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:T,shouldCreateSol:F}}),h(l({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:f.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void D.execute():(h("LandingScreen"),void A(Error("User must be authenticated before creating a Privy wallet")))),[R,b]),v.current=()=>null/*#__PURE__*/,e(w,{errorMessage:j||void 0,onClose:()=>{U?(k(U),x({shouldCallAuthOnSuccess:I})):(A(new c("User wallet creation failed")),x({shouldCallAuthOnSuccess:!1}))}})}};export{y as EmbeddedWalletOnAccountCreateScreen,w as EmbeddedWalletOnAccountCreateView,y as default};
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{u as a}from"./context-Dee1TPOi.mjs";import{s as i,k as s,E as l,R as n}from"./index-Dr4t3oWO.mjs";import{u as m,m as c}from"./internal-context-e-Eni5bG.mjs";import{u as d}from"./use-create-wallet-without-fallback-5er4aqoE.mjs";import{a as u,u as p}from"./get-is-unified-wallet-_KIJnP68.mjs";import{S as h}from"./ScreenLayout-BQ6FV6yc.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-SiVSXkvG.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-BYy0MVol.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Bh4N2Hpm.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJY5dut3.mjs";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.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-CJMgUOnw.mjs";const w=({errorMessage:r,onClose:o})=>/*#__PURE__*/e(h,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}),y={component:()=>{let{setModalData:t,navigate:h,data:y,onUserCloseViaDialogOrKeybindRef:v}=u(),g=a(),[j,C]=r(""),{embeddedWallets:f}=a(),{authenticated:b,user:S}=p(),{closePrivyModal:x,walletProxy:W,client:O}=m(),{onSuccess:k,onFailure:A,callAuthOnSuccessOnClose:I,shouldCreateEth:M,shouldCreateSol:P}=y.createWallet,R="legacy-embedded-wallets-only"===g.embeddedWallets.mode&&!0===g?.embeddedWallets.requireUserOwnedRecoveryOnCreate,[U,E]=r(null),{create:L}=d(),T=M??(!!S&&i(S,g.embeddedWallets.ethereum.createOnLogin)),F=P??(!!S&&s(S,g.embeddedWallets.solana.createOnLogin)),D=new n((async()=>{let e=await O.getAccessToken();if(S&&e&&W)try{let e;if(T&&F)e=await L({chainType:"ethereum",walletIndex:0,latestUser:S}),e=await L({chainType:"solana",walletIndex:0,latestUser:e.user});else if(F)e=await L({chainType:"solana",walletIndex:0,latestUser:S});else{if(!T)return void x({shouldCallAuthOnSuccess:I});e=await L({chainType:"ethereum",walletIndex:0,latestUser:S})}E(e),h("EmbeddedWalletCreatedScreen")}catch(e){C(e.message)}}));return o((()=>b&&S?R?(t({...y,createWallet:{...y.createWallet,shouldCreateEth:T,shouldCreateSol:F},recoverySelection:{...y?.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:T,shouldCreateSol:F}}),h(l({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:f.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void D.execute():(h("LandingScreen"),void A(Error("User must be authenticated before creating a Privy wallet")))),[R,b]),v.current=()=>null/*#__PURE__*/,e(w,{errorMessage:j||void 0,onClose:()=>{U?(k(U),x({shouldCallAuthOnSuccess:I})):(A(new c("User wallet creation failed")),x({shouldCallAuthOnSuccess:!1}))}})}};export{y as EmbeddedWalletOnAccountCreateScreen,w as EmbeddedWalletOnAccountCreateView,y as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as o,useEffect as r}from"react";import{u as t,a as s,g as a}from"./get-is-unified-wallet-DXko-EzF.mjs";import{u as i}from"./context-B4VZqX5H.mjs";import{u as n,m as d,l as c}from"./internal-context-DLZicboG.mjs";import{g as l}from"./useWallets-DuxHKVvE.mjs";import{S as m,g as p}from"./SetWalletPasswordForm-DUTEhc4R.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./Layouts-Bmf8DxNP.mjs";import"styled-components";import"./ModalHeader-CxHK1IKF.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"./shared-BMOp6N9y.mjs";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"./Button-OlK_6fKk.mjs";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./Checkbox-NmGCZeKL.mjs";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";import"./ScreenHeader-Biz1wq02.mjs";const u={component:()=>{let[u,w]=o(null),[y,h]=o(!1),[v,g]=o(null),[f,M]=o(""),{authenticated:_,user:A}=t(),{client:I,walletProxy:j,refreshSessionAndUser:C,closePrivyModal:R,createAnalyticsEvent:b}=n(),{navigate:P,data:x,onUserCloseViaDialogOrKeybindRef:S}=s(),E=i(),{onSuccess:k,onFailure:D}=x.setWalletPassword,N=a(A),O="user-passcode"===u?.recoveryMethod,L="user-passcode"===N?.recoveryMethod;r((()=>{_||(P("LandingScreen"),D(new d("User must be authenticated before setting a password on a Privy wallet")))}),[_]);let T=()=>v?(D(v),void R({shouldCallAuthOnSuccess:!1})):O?(k(u),void R({shouldCallAuthOnSuccess:!1})):(D(new c("Exited before password was added to wallet")),void R({shouldCallAuthOnSuccess:!1}));S.current=T;/*#__PURE__*/return e(m,{appName:E?.name||"privy",config:{initiatedBy:"user",onCancel:T},error:v?"An error has occurred, please try again.":void 0,buttonLoading:y,buttonHideAnimations:!1,password:f,isResettingPassword:L,onPasswordGenerate:()=>M(p()),onPasswordChange:M,onSubmit:async()=>{O?(k(u),R({shouldCallAuthOnSuccess:!1})):(h(!0),g(null),await(async()=>{let e=await I.getAccessToken();if(e&&A&&N?.address&&f&&j)try{b({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L}});let{entropyId:o,entropyIdVerifier:r}=l(A);if(!(await j.setRecovery({accessToken:e,entropyId:o,entropyIdVerifier:r,recoveryPassword:f,recoveryMethod:"user-passcode"})).entropyId)return g(new c("Error setting password on privy wallet")),void b({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L,reason:"error setting password"}});let t=await C(),s=a(t);if(!s)return g(new c("Error setting password on privy wallet")),void b({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L,reason:"wallet disconnected"}});w(s),b({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L}})}catch(e){console.warn(e),g(e instanceof Error?e:Error("Error setting password on privy wallet")),b({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:N.address,reason:e}})}})(),h(!1))},onClose:T})}};export{u as EmbeddedWalletPasswordUpdateScreen,u as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{useState as o,useEffect as r}from"react";import{u as t,a as s,g as a}from"./get-is-unified-wallet-_KIJnP68.mjs";import{u as i}from"./context-Dee1TPOi.mjs";import{u as n,o as d,m as c}from"./internal-context-e-Eni5bG.mjs";import{g as l}from"./useWallets-gElyEQoU.mjs";import{S as m,g as p}from"./SetWalletPasswordForm-DelBzpVM.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./Layouts-Bmf8DxNP.mjs";import"styled-components";import"./ModalHeader-DHXUvTf4.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"./shared-CRNjAkzC.mjs";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"./Button-DJY5dut3.mjs";import"./useActiveWallet-SiVSXkvG.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BYy0MVol.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./Checkbox-NmGCZeKL.mjs";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";import"./ScreenHeader-Biz1wq02.mjs";const u={component:()=>{let[u,w]=o(null),[y,h]=o(!1),[v,g]=o(null),[f,M]=o(""),{authenticated:_,user:A}=t(),{client:I,walletProxy:j,refreshSessionAndUser:C,closePrivyModal:R,createAnalyticsEvent:b}=n(),{navigate:P,data:x,onUserCloseViaDialogOrKeybindRef:S}=s(),E=i(),{onSuccess:k,onFailure:D}=x.setWalletPassword,N=a(A),O="user-passcode"===u?.recoveryMethod,L="user-passcode"===N?.recoveryMethod;r((()=>{_||(P("LandingScreen"),D(new d("User must be authenticated before setting a password on a Privy wallet")))}),[_]);let T=()=>v?(D(v),void R({shouldCallAuthOnSuccess:!1})):O?(k(u),void R({shouldCallAuthOnSuccess:!1})):(D(new c("Exited before password was added to wallet")),void R({shouldCallAuthOnSuccess:!1}));S.current=T;/*#__PURE__*/return e(m,{appName:E?.name||"privy",config:{initiatedBy:"user",onCancel:T},error:v?"An error has occurred, please try again.":void 0,buttonLoading:y,buttonHideAnimations:!1,password:f,isResettingPassword:L,onPasswordGenerate:()=>M(p()),onPasswordChange:M,onSubmit:async()=>{O?(k(u),R({shouldCallAuthOnSuccess:!1})):(h(!0),g(null),await(async()=>{let e=await I.getAccessToken();if(e&&A&&N?.address&&f&&j)try{b({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L}});let{entropyId:o,entropyIdVerifier:r}=l(A);if(!(await j.setRecovery({accessToken:e,entropyId:o,entropyIdVerifier:r,recoveryPassword:f,recoveryMethod:"user-passcode"})).entropyId)return g(new c("Error setting password on privy wallet")),void b({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L,reason:"error setting password"}});let t=await C(),s=a(t);if(!s)return g(new c("Error setting password on privy wallet")),void b({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L,reason:"wallet disconnected"}});w(s),b({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L}})}catch(e){console.warn(e),g(e instanceof Error?e:Error("Error setting password on privy wallet")),b({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:N.address,reason:e}})}})(),h(!1))},onClose:T})}};export{u as EmbeddedWalletPasswordUpdateScreen,u as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{Lock as r}from"lucide-react";import{u as i,l as s}from"./internal-context-DLZicboG.mjs";import{a}from"./get-is-unified-wallet-DXko-EzF.mjs";import{S as n}from"./ScreenLayout-pthdsODa.mjs";import"ofetch";import"react";import"viem";import"./context-B4VZqX5H.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./Button-OlK_6fKk.mjs";import"styled-components";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.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-CJMgUOnw.mjs";const m=({onClose:i,onProceed:s})=>/*#__PURE__*/e(n,{title:"Secure Your Account",subtitle:/*#__PURE__*/o(t,{children:["Please set a password to secure your account.",/*#__PURE__*/e("br",{}),"Losing access to this password and this device will make your account inaccessible."]}),icon:r,primaryCta:{label:"Add password",onClick:s},onClose:i,watermark:!0}),c={component:()=>{let{closePrivyModal:o}=i(),{data:t,navigate:r,onUserCloseViaDialogOrKeybindRef:n}=a(),{onFailure:c}=t.setWalletPassword,l=()=>{c(new s("Exited before password was added to wallet")),o({shouldCallAuthOnSuccess:!1})};return n.current=l,/*#__PURE__*/e(m,{onClose:l,onProceed:()=>{r("EmbeddedWalletPasswordUpdateScreen")}})}};export{c as EmbeddedWalletPasswordUpdateSplashScreen,m as EmbeddedWalletPasswordUpdateSplashView,c as default};
1
+ import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{Lock as r}from"lucide-react";import{u as i,m as s}from"./internal-context-e-Eni5bG.mjs";import{a}from"./get-is-unified-wallet-_KIJnP68.mjs";import{S as n}from"./ScreenLayout-BQ6FV6yc.mjs";import"ofetch";import"react";import"viem";import"./context-Dee1TPOi.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./Button-DJY5dut3.mjs";import"styled-components";import"./useActiveWallet-SiVSXkvG.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BYy0MVol.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.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-CJMgUOnw.mjs";const m=({onClose:i,onProceed:s})=>/*#__PURE__*/e(n,{title:"Secure Your Account",subtitle:/*#__PURE__*/o(t,{children:["Please set a password to secure your account.",/*#__PURE__*/e("br",{}),"Losing access to this password and this device will make your account inaccessible."]}),icon:r,primaryCta:{label:"Add password",onClick:s},onClose:i,watermark:!0}),c={component:()=>{let{closePrivyModal:o}=i(),{data:t,navigate:r,onUserCloseViaDialogOrKeybindRef:n}=a(),{onFailure:c}=t.setWalletPassword,l=()=>{c(new s("Exited before password was added to wallet")),o({shouldCallAuthOnSuccess:!1})};return n.current=l,/*#__PURE__*/e(m,{onClose:l,onProceed:()=>{r("EmbeddedWalletPasswordUpdateScreen")}})}};export{c as EmbeddedWalletPasswordUpdateSplashScreen,m as EmbeddedWalletPasswordUpdateSplashView,c as default};