@privy-io/react-auth 3.10.1 → 3.10.2

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 (231) hide show
  1. package/dist/cjs/{AccountNotFoundScreen-DpWbazhN.js → AccountNotFoundScreen-CccXh5Ow.js} +1 -1
  2. package/dist/cjs/{Address-B_I2EZZe.js → Address-szbhr3eZ.js} +1 -1
  3. package/dist/cjs/{AffirmativeConsentScreen-9ZT_Z3WZ.js → AffirmativeConsentScreen-DmfPpl2i.js} +1 -1
  4. package/dist/cjs/{AllowlistRejectionScreen-DkSBlXbO.js → AllowlistRejectionScreen-B75b3HjF.js} +1 -1
  5. package/dist/cjs/{AuthenticateWithWalletScreen-B8X_BqjA.js → AuthenticateWithWalletScreen-CMdBkn5P.js} +1 -1
  6. package/dist/cjs/{AwaitingEvmToSolBridgingScreen-TqLrYeHi.js → AwaitingEvmToSolBridgingScreen-zqMa3M-c.js} +1 -1
  7. package/dist/cjs/{AwaitingExternalEthereumTransferScreen-Dy4mxIoc.js → AwaitingExternalEthereumTransferScreen-Tm1ncf9g.js} +1 -1
  8. package/dist/cjs/{AwaitingPasswordlessCodeScreen-gcHc0S-p.js → AwaitingPasswordlessCodeScreen-DSJA4ZJF.js} +1 -1
  9. package/dist/cjs/{AwaitingSolToEvmBridgingScreen-DtJ9-ogk.js → AwaitingSolToEvmBridgingScreen-Wrz0ccTo.js} +1 -1
  10. package/dist/cjs/{BridgeNetworkSelectionView-dk0l0q-M.js → BridgeNetworkSelectionView-CfUjmKJ-.js} +1 -1
  11. package/dist/cjs/{Button-BEaVAnh4.js → Button-CyX7JNsa.js} +1 -1
  12. package/dist/cjs/{CaptchaScreen-C_mEgCfb.js → CaptchaScreen-MhvzUgNQ.js} +1 -1
  13. package/dist/cjs/{CoinbaseOnrampStatusScreen-retAGRaW.js → CoinbaseOnrampStatusScreen-BhR230ZS.js} +1 -1
  14. package/dist/cjs/{ConnectEmailForm-CfACIV6_.js → ConnectEmailForm-BSkD5EKc.js} +1 -1
  15. package/dist/cjs/{ConnectLedgerScreen-B_lID1I6.js → ConnectLedgerScreen-BvlmHoA3.js} +1 -1
  16. package/dist/cjs/{ConnectOnlyLandingScreen-ByTgLbTP.js → ConnectOnlyLandingScreen-nbPM7web.js} +1 -1
  17. package/dist/cjs/{ConnectOnlyStatusScreen-9JAufomE.js → ConnectOnlyStatusScreen-C2Wl0jxa.js} +1 -1
  18. package/dist/cjs/{ConnectOrCreateScreen-BF_OuFpX.js → ConnectOrCreateScreen-CtzSeQ-J.js} +1 -1
  19. package/dist/cjs/{ConnectPhoneForm-C0SpJtis.js → ConnectPhoneForm-BYlpF5oC.js} +1 -1
  20. package/dist/cjs/ConnectWalletView-O70yBQFu.js +1 -0
  21. package/dist/cjs/{ConnectionStatusScreen-CLgTwzQu.js → ConnectionStatusScreen-DML_ZDfW.js} +1 -1
  22. package/dist/cjs/CrossAppAuthScreen-Dz6PZNOw.js +1 -0
  23. package/dist/cjs/CustomLandingScreenView-CBW3Yr3o.js +2 -0
  24. package/dist/cjs/{DelegatedActionsConsentScreen-Co_Y95XG.js → DelegatedActionsConsentScreen-CN5Y30M4.js} +1 -1
  25. package/dist/cjs/{DelegatedActionsRevokeScreen-YAYK0-5r.js → DelegatedActionsRevokeScreen-CMkHii4b.js} +1 -1
  26. package/dist/cjs/{EmbeddedWalletConnectingScreen-ziUZeTLk.js → EmbeddedWalletConnectingScreen-SBfyKPRv.js} +1 -1
  27. package/dist/cjs/{EmbeddedWalletCreatedScreen-CG0y5Ke2.js → EmbeddedWalletCreatedScreen-sMHJGzfv.js} +1 -1
  28. package/dist/cjs/{EmbeddedWalletKeyExportScreen-DFqz986K.js → EmbeddedWalletKeyExportScreen-C5uNOzfr.js} +1 -1
  29. package/dist/cjs/{EmbeddedWalletOnAccountCreateScreen-B4WNBQna.js → EmbeddedWalletOnAccountCreateScreen-B84q1xGE.js} +1 -1
  30. package/dist/cjs/{EmbeddedWalletPasswordUpdateScreen-Y2DUG4YB.js → EmbeddedWalletPasswordUpdateScreen-CxeydwO6.js} +1 -1
  31. package/dist/cjs/{EmbeddedWalletPasswordUpdateSplashScreen-Dy8KboAq.js → EmbeddedWalletPasswordUpdateSplashScreen-BVc-qFqk.js} +1 -1
  32. package/dist/cjs/{EnrollTotp-CasC3VFI.js → EnrollTotp-DQKYLdAQ.js} +1 -1
  33. package/dist/cjs/{ErrorScreen-BrKj88o9.js → ErrorScreen-MrSIGio_.js} +1 -1
  34. package/dist/cjs/{FarcasterConnectStatusScreen-BLXWWJmD.js → FarcasterConnectStatusScreen-BYDqDWAC.js} +1 -1
  35. package/dist/cjs/{FarcasterSignerStatusScreen-Cr0xAGvg.js → FarcasterSignerStatusScreen-Bik8wrMR.js} +1 -1
  36. package/dist/cjs/{FundSolWalletWithExternalSolanaWallet-BdR31dg6.js → FundSolWalletWithExternalSolanaWallet-CUYnW9m7.js} +1 -1
  37. package/dist/cjs/{FundWalletMethodHeader-CxH_zVnz.js → FundWalletMethodHeader-D2b7Summ.js} +1 -1
  38. package/dist/cjs/{FundingEditAmountScreen-CP4EaEYh.js → FundingEditAmountScreen-BNL_9NSc.js} +1 -1
  39. package/dist/cjs/{FundingMethodSelectionScreen-BgZw0u6b.js → FundingMethodSelectionScreen-pjtPGWB4.js} +1 -1
  40. package/dist/cjs/HCaptchaWrapper-CxqJE5RH.js +1 -0
  41. package/dist/cjs/{InAppBrowserLoginNotPossible-Cg9HwW8w.js → InAppBrowserLoginNotPossible-BDP_0K6U.js} +1 -1
  42. package/dist/cjs/{InstallWalletScreen-DRTLmXtV.js → InstallWalletScreen-DatnwQ5S.js} +1 -1
  43. package/dist/cjs/{LandingScreen-Crcwq_g8.js → LandingScreen-PhSFsQAW.js} +1 -1
  44. package/dist/cjs/{LinkConflictScreen-C3dRaiQk.js → LinkConflictScreen-DhG3p7sJ.js} +1 -1
  45. package/dist/cjs/{LinkEmailScreen-DgQb2Wg1.js → LinkEmailScreen-nUhaHOKN.js} +1 -1
  46. package/dist/cjs/{LinkPasskeyScreen-52yLU_Q-.js → LinkPasskeyScreen-n7IJuNlF.js} +1 -1
  47. package/dist/cjs/{LinkPhoneScreen-DQXhoFL4.js → LinkPhoneScreen-Dek16_Y5.js} +1 -1
  48. package/dist/cjs/{LoginFailedScreen-yCmKlIj1.js → LoginFailedScreen-Du15IoL5.js} +1 -1
  49. package/dist/cjs/{ManualTransferScreen-Dk4BMFPw.js → ManualTransferScreen-CBWn4JvN.js} +1 -1
  50. package/dist/cjs/{MfaAuthEnrollmentFlowScreen-yFdG0eOh.js → MfaAuthEnrollmentFlowScreen-BT0TbVv2.js} +1 -1
  51. package/dist/cjs/{MfaAuthVerifyFlowScreen-BZJ1SkGe.js → MfaAuthVerifyFlowScreen-CRQ4FiuC.js} +1 -1
  52. package/dist/cjs/{MfaEnrollmentFlowScreen-DSsoPwhQ.js → MfaEnrollmentFlowScreen-CqRzU9XV.js} +1 -1
  53. package/dist/cjs/{MfaVerifyFlowScreen-CtOltjrq.js → MfaVerifyFlowScreen-BDOehbLb.js} +1 -1
  54. package/dist/cjs/{ModalHeader-n6Aqpos_.js → ModalHeader-D9UKo-3h.js} +1 -1
  55. package/dist/cjs/{MoonpayStatusScreen-IxyonJvb.js → MoonpayStatusScreen-CdZgJRrM.js} +1 -1
  56. package/dist/cjs/{OAuthStatusScreen-D1DDf9yn.js → OAuthStatusScreen-CIma0mu9.js} +1 -1
  57. package/dist/cjs/{PasskeySelectSignupOrLogin-D4XaKl_E.js → PasskeySelectSignupOrLogin-D1NqVZW7.js} +1 -1
  58. package/dist/cjs/{PasskeyStatusScreen-CFQM6Nh7.js → PasskeyStatusScreen-Q0ehEMbT.js} +1 -1
  59. package/dist/cjs/{PasswordRecoveryScreen-DZhILc6f.js → PasswordRecoveryScreen-C3g17CVW.js} +1 -1
  60. package/dist/cjs/{QrCode-D-MkB93C.js → QrCode-DWvu0AHR.js} +1 -1
  61. package/dist/cjs/{RecoveryOAuthStatusScreen-C47Vu6bz.js → RecoveryOAuthStatusScreen-DN0I--HN.js} +1 -1
  62. package/dist/cjs/{RecoveryPasswordCreateScreen-Cd7NUBpB.js → RecoveryPasswordCreateScreen-BAAoBkhn.js} +1 -1
  63. package/dist/cjs/{RecoverySelectionScreen-C62og2VL.js → RecoverySelectionScreen-Chnml1GU.js} +1 -1
  64. package/dist/cjs/{Screen-J7z62u7O.js → Screen-Cjd8kgCg.js} +1 -1
  65. package/dist/cjs/{ScreenLayout-D6r13vU7.js → ScreenLayout-0BeoRza6.js} +1 -1
  66. package/dist/cjs/{SetAutomaticRecoveryScreen-3unBTQcy.js → SetAutomaticRecoveryScreen-C82NF48g.js} +1 -1
  67. package/dist/cjs/{SetWalletPasswordForm-Bw9mi-NI.js → SetWalletPasswordForm-CwwM_HsZ.js} +1 -1
  68. package/dist/cjs/{SignRequestScreen-ZHkIJ3-6.js → SignRequestScreen-CN-YxEIW.js} +1 -1
  69. package/dist/cjs/{StandardSignAndSendTransactionScreen-A5KpXb14.js → StandardSignAndSendTransactionScreen-BWqXsnZ-.js} +1 -1
  70. package/dist/cjs/{TelegramAuthScreen-qw6gcnZA.js → TelegramAuthScreen-JINnIb1q.js} +1 -1
  71. package/dist/cjs/{TransactionDetails-6aFlRhNd.js → TransactionDetails-DHxuRDQm.js} +1 -1
  72. package/dist/cjs/{TransactionErrorView-U-Fg5udU.js → TransactionErrorView-DV1Rbaza.js} +1 -1
  73. package/dist/cjs/{TransferFromWalletScreen-DnUQ6O_8.js → TransferFromWalletScreen-D1RGQm-9.js} +1 -1
  74. package/dist/cjs/{TransferOrBridgeLoadingScreen-C3pf0mwq.js → TransferOrBridgeLoadingScreen-0auJk1V_.js} +1 -1
  75. package/dist/cjs/{UpdateEmailScreen-dPy98Sn_.js → UpdateEmailScreen-CjEQsyJ6.js} +1 -1
  76. package/dist/cjs/{UpdatePhoneScreen-CtNBijCK.js → UpdatePhoneScreen-66qCevzc.js} +1 -1
  77. package/dist/cjs/{UserLimitReachedScreen-DwbMomyS.js → UserLimitReachedScreen-OwK_WZiy.js} +1 -1
  78. package/dist/cjs/{WalletInfoCard-DxO9lMen.js → WalletInfoCard-BgUUNBb1.js} +1 -1
  79. package/dist/cjs/{WalletInterstitialScreen-CsZg29Za.js → WalletInterstitialScreen-BMQau9a_.js} +1 -1
  80. package/dist/cjs/{WalletLink-J6Gw0D9R.js → WalletLink-B8qg2sNq.js} +1 -1
  81. package/dist/cjs/{WalletOverflowButton-Tdaiid33.js → WalletOverflowButton-4OUSs2qQ.js} +1 -1
  82. package/dist/cjs/abstract-smart-wallets.js +1 -1
  83. package/dist/cjs/{context-BPd2qxKv.js → context-B6zndZbE.js} +1 -1
  84. package/dist/cjs/{ethers-CqH8abGL.js → ethers-BrWeKm_S.js} +1 -1
  85. package/dist/cjs/extended-chains.js +1 -1
  86. package/dist/cjs/get-is-unified-wallet-CYQvifpN.js +1 -0
  87. package/dist/cjs/{index-B4TzPiCM.js → index-DBN8rlPN.js} +1 -1
  88. package/dist/cjs/{index-BsEjyknv.js → index-JLbo6ZA0.js} +1 -1
  89. package/dist/cjs/{index-Dz7affvL.js → index-xKFTBD9J.js} +5 -5
  90. package/dist/cjs/index.js +1 -1
  91. package/dist/cjs/internal.js +1 -1
  92. package/dist/cjs/{prepareFundingModalData-Do7d2fgq.js → prepareFundingModalData-DKaL1Oqz.js} +1 -1
  93. package/dist/cjs/{shared-CbD3Tm1u.js → shared-DAxDIdOV.js} +1 -1
  94. package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-BjZ_f-Zv.js → shouldProceedtoEmbeddedWalletCreationFlow-Brj0fZpr.js} +1 -1
  95. package/dist/cjs/{smart-wallets-DFIScSPs.js → smart-wallets-DSBosnGS.js} +1 -1
  96. package/dist/cjs/smart-wallets.js +1 -1
  97. package/dist/cjs/solana.js +1 -1
  98. package/dist/cjs/{to-ui-error-B83yFdtm.js → to-ui-error-3msE736K.js} +1 -1
  99. package/dist/cjs/{twitter-BVVRWkcG.js → twitter-CJSxxOMI.js} +1 -1
  100. package/dist/cjs/ui.js +1 -1
  101. package/dist/cjs/{use-create-wallet-without-fallback-BSl4qcLv.js → use-create-wallet-without-fallback-DOZsyElA.js} +1 -1
  102. package/dist/cjs/{use-export-wallet-ABk4jSh5.js → use-export-wallet-DYcsnUD8.js} +1 -1
  103. package/dist/cjs/{useActiveWallet-B-Pd49hn.js → useActiveWallet-uEEQi70o.js} +1 -1
  104. package/dist/cjs/{useGetTokenPrice-Cm0Ldnuy.js → useGetTokenPrice-tWpOVbJz.js} +1 -1
  105. package/dist/cjs/{useI18n-5uCrUblH.js → useI18n-5bG-Cpbl.js} +1 -1
  106. package/dist/cjs/{usePrivy-CANb3vg4.js → usePrivy-DZJwQPwT.js} +1 -1
  107. package/dist/cjs/{useSolanaRpcClient-BBCvBn6x.js → useSolanaRpcClient-CEhNB-sj.js} +1 -1
  108. package/dist/cjs/{useWallets-Bi_kf80t.js → useWallets-CMRZ0IEw.js} +1 -1
  109. package/dist/cjs/{useWallets-CTdzIPwr.js → useWallets-DXi6lmEg.js} +1 -1
  110. package/dist/dts/index.d.mts +1 -0
  111. package/dist/dts/index.d.ts +1 -0
  112. package/dist/esm/{AccountNotFoundScreen-S6aY2Bit.mjs → AccountNotFoundScreen-BANDQZGv.mjs} +1 -1
  113. package/dist/esm/{Address-BZeOq9QH.mjs → Address-C2aXxM2N.mjs} +1 -1
  114. package/dist/esm/{AffirmativeConsentScreen-Duhzxm_H.mjs → AffirmativeConsentScreen-CFZO2H5q.mjs} +1 -1
  115. package/dist/esm/{AllowlistRejectionScreen-BMPe-U6U.mjs → AllowlistRejectionScreen-DBeGUmgt.mjs} +1 -1
  116. package/dist/esm/{AuthenticateWithWalletScreen-B0-JIF_P.mjs → AuthenticateWithWalletScreen-ZM6DZFh1.mjs} +1 -1
  117. package/dist/esm/{AwaitingEvmToSolBridgingScreen-SpjPGAVg.mjs → AwaitingEvmToSolBridgingScreen-8IBtNu5_.mjs} +1 -1
  118. package/dist/esm/{AwaitingExternalEthereumTransferScreen-MaJkRZM2.mjs → AwaitingExternalEthereumTransferScreen-BN4n273Y.mjs} +1 -1
  119. package/dist/esm/{AwaitingPasswordlessCodeScreen-CpmHzcEh.mjs → AwaitingPasswordlessCodeScreen-BquZxC7l.mjs} +1 -1
  120. package/dist/esm/{AwaitingSolToEvmBridgingScreen-B3HJI5qn.mjs → AwaitingSolToEvmBridgingScreen-B0I6wDuo.mjs} +1 -1
  121. package/dist/esm/{BridgeNetworkSelectionView-ITdiT09i.mjs → BridgeNetworkSelectionView-BZmf7ayB.mjs} +1 -1
  122. package/dist/esm/{Button-CrJpeX0e.mjs → Button-3JMVXKiE.mjs} +1 -1
  123. package/dist/esm/{CaptchaScreen-BEvV9l59.mjs → CaptchaScreen-Bnh-Gpgm.mjs} +1 -1
  124. package/dist/esm/{CoinbaseOnrampStatusScreen-CYKvPSTa.mjs → CoinbaseOnrampStatusScreen-_W6kQCwE.mjs} +1 -1
  125. package/dist/esm/{ConnectEmailForm-CzIQouaK.mjs → ConnectEmailForm-o04NTrIc.mjs} +1 -1
  126. package/dist/esm/{ConnectLedgerScreen-B84x_XJQ.mjs → ConnectLedgerScreen-CQUW_48V.mjs} +1 -1
  127. package/dist/esm/{ConnectOnlyLandingScreen-DOUEqxQS.mjs → ConnectOnlyLandingScreen-BtemYXlu.mjs} +1 -1
  128. package/dist/esm/{ConnectOnlyStatusScreen-C2DOQ20l.mjs → ConnectOnlyStatusScreen-CN2kWiW2.mjs} +1 -1
  129. package/dist/esm/{ConnectOrCreateScreen-ls3v_wzh.mjs → ConnectOrCreateScreen-BC1JYHYR.mjs} +1 -1
  130. package/dist/esm/{ConnectPhoneForm-BeT3tDQM.mjs → ConnectPhoneForm-CK2ZaLcy.mjs} +1 -1
  131. package/dist/esm/ConnectWalletView-D3ZQBnjF.mjs +1 -0
  132. package/dist/esm/{ConnectionStatusScreen-BFOC7TO_.mjs → ConnectionStatusScreen-BHg6K1gF.mjs} +1 -1
  133. package/dist/esm/CrossAppAuthScreen-D1gqy4CI.mjs +1 -0
  134. package/dist/esm/CustomLandingScreenView-DOwh2oce.mjs +2 -0
  135. package/dist/esm/{DelegatedActionsConsentScreen-h8zjYxdK.mjs → DelegatedActionsConsentScreen-C2p3P6bN.mjs} +1 -1
  136. package/dist/esm/{DelegatedActionsRevokeScreen-C1RofLwl.mjs → DelegatedActionsRevokeScreen-C4XKaajw.mjs} +1 -1
  137. package/dist/esm/{EmbeddedWalletConnectingScreen-DRLC8HnL.mjs → EmbeddedWalletConnectingScreen-k-UW2In7.mjs} +1 -1
  138. package/dist/esm/{EmbeddedWalletCreatedScreen-BiqITDV_.mjs → EmbeddedWalletCreatedScreen-D-5pbs0R.mjs} +1 -1
  139. package/dist/esm/{EmbeddedWalletKeyExportScreen-lPloqMsw.mjs → EmbeddedWalletKeyExportScreen-C35WVhPC.mjs} +1 -1
  140. package/dist/esm/{EmbeddedWalletOnAccountCreateScreen-DjXY44ON.mjs → EmbeddedWalletOnAccountCreateScreen-BbhGfibt.mjs} +1 -1
  141. package/dist/esm/{EmbeddedWalletPasswordUpdateScreen-CfZ6F7Xo.mjs → EmbeddedWalletPasswordUpdateScreen-B3eyAAfe.mjs} +1 -1
  142. package/dist/esm/{EmbeddedWalletPasswordUpdateSplashScreen-1u-5wz14.mjs → EmbeddedWalletPasswordUpdateSplashScreen-D7wjWeB8.mjs} +1 -1
  143. package/dist/esm/{EnrollTotp-Ds_-ZGUd.mjs → EnrollTotp-BE-JDa07.mjs} +1 -1
  144. package/dist/esm/{ErrorScreen-A7eS3gFZ.mjs → ErrorScreen-CR_0-6OL.mjs} +1 -1
  145. package/dist/esm/{FarcasterConnectStatusScreen-CoUFovnM.mjs → FarcasterConnectStatusScreen-DcwiNT96.mjs} +1 -1
  146. package/dist/esm/{FarcasterSignerStatusScreen-DJMF_7OC.mjs → FarcasterSignerStatusScreen-DmELTB-0.mjs} +1 -1
  147. package/dist/esm/{FundSolWalletWithExternalSolanaWallet-BCElohac.mjs → FundSolWalletWithExternalSolanaWallet-BDy0ldlm.mjs} +1 -1
  148. package/dist/esm/{FundWalletMethodHeader-DBV2Rnau.mjs → FundWalletMethodHeader-C0uPKdYw.mjs} +1 -1
  149. package/dist/esm/{FundingEditAmountScreen-hLQBUAs6.mjs → FundingEditAmountScreen-aSBCTHvs.mjs} +1 -1
  150. package/dist/esm/{FundingMethodSelectionScreen-CQ6Kjv8P.mjs → FundingMethodSelectionScreen-BF0zdnRp.mjs} +1 -1
  151. package/dist/esm/HCaptchaWrapper-CUi9LJsp.mjs +1 -0
  152. package/dist/esm/{InAppBrowserLoginNotPossible-B6aOQR90.mjs → InAppBrowserLoginNotPossible-MMzbXP1G.mjs} +1 -1
  153. package/dist/esm/{InstallWalletScreen-gwlyer4j.mjs → InstallWalletScreen-CrnAF_wK.mjs} +1 -1
  154. package/dist/esm/{LandingScreen-BkCClWy8.mjs → LandingScreen-DvQZRxAA.mjs} +1 -1
  155. package/dist/esm/{LinkConflictScreen-C0K1Bw7W.mjs → LinkConflictScreen-CyCVN1lq.mjs} +1 -1
  156. package/dist/esm/{LinkEmailScreen-DDH1Ent-.mjs → LinkEmailScreen-D5s-Ggjy.mjs} +1 -1
  157. package/dist/esm/{LinkPasskeyScreen-75b0FmMc.mjs → LinkPasskeyScreen-Br7W1Zmq.mjs} +1 -1
  158. package/dist/esm/{LinkPhoneScreen-CZaTFcuX.mjs → LinkPhoneScreen-DbRDyzwM.mjs} +1 -1
  159. package/dist/esm/{LoginFailedScreen-Csu_ek1s.mjs → LoginFailedScreen-B1tnBE4h.mjs} +1 -1
  160. package/dist/esm/{ManualTransferScreen-Cn8sFLD_.mjs → ManualTransferScreen-pFyGqOCu.mjs} +1 -1
  161. package/dist/esm/{MfaAuthEnrollmentFlowScreen-9HiNxKYV.mjs → MfaAuthEnrollmentFlowScreen-C8Pvz5fy.mjs} +1 -1
  162. package/dist/esm/{MfaAuthVerifyFlowScreen-C9Pe8A-f.mjs → MfaAuthVerifyFlowScreen-CJEESJMU.mjs} +1 -1
  163. package/dist/esm/{MfaEnrollmentFlowScreen-C-VfRmbP.mjs → MfaEnrollmentFlowScreen-DNMYRR9X.mjs} +1 -1
  164. package/dist/esm/{MfaVerifyFlowScreen-BLzgEe8U.mjs → MfaVerifyFlowScreen-CzhmszLp.mjs} +1 -1
  165. package/dist/esm/{ModalHeader-YP9pLMEP.mjs → ModalHeader-B27O6soE.mjs} +1 -1
  166. package/dist/esm/{MoonpayStatusScreen-tt17kvkR.mjs → MoonpayStatusScreen-CzQ-mLP5.mjs} +1 -1
  167. package/dist/esm/{OAuthStatusScreen-DA8QEDgm.mjs → OAuthStatusScreen-D1IVqsCW.mjs} +1 -1
  168. package/dist/esm/{PasskeySelectSignupOrLogin-BnOxpeKy.mjs → PasskeySelectSignupOrLogin-CQUv5kpw.mjs} +1 -1
  169. package/dist/esm/{PasskeyStatusScreen-CqoYgdZ0.mjs → PasskeyStatusScreen-Co_LVG4x.mjs} +1 -1
  170. package/dist/esm/{PasswordRecoveryScreen-BgFiWz_H.mjs → PasswordRecoveryScreen-CKc7ZSJe.mjs} +1 -1
  171. package/dist/esm/{QrCode-C0_lXRph.mjs → QrCode-CGBH7ZqU.mjs} +1 -1
  172. package/dist/esm/{RecoveryOAuthStatusScreen-B698r-dZ.mjs → RecoveryOAuthStatusScreen-Co_qik6B.mjs} +1 -1
  173. package/dist/esm/{RecoveryPasswordCreateScreen-U7uAGUdt.mjs → RecoveryPasswordCreateScreen-DeZGEgr1.mjs} +1 -1
  174. package/dist/esm/{RecoverySelectionScreen-CvZ8jmi2.mjs → RecoverySelectionScreen-BOUh-dCZ.mjs} +1 -1
  175. package/dist/esm/{Screen-CpIMiJNF.mjs → Screen-Bj-1pwMI.mjs} +1 -1
  176. package/dist/esm/{ScreenLayout-t3qtbQ3-.mjs → ScreenLayout-Dp0ezg8Q.mjs} +1 -1
  177. package/dist/esm/{SetAutomaticRecoveryScreen-BlqLhOJS.mjs → SetAutomaticRecoveryScreen-DqeQkzbI.mjs} +1 -1
  178. package/dist/esm/{SetWalletPasswordForm-DMOSI5Cu.mjs → SetWalletPasswordForm-D9WKtYos.mjs} +1 -1
  179. package/dist/esm/{SignRequestScreen-Bc6WEdOH.mjs → SignRequestScreen-ClKQEiLC.mjs} +1 -1
  180. package/dist/esm/{StandardSignAndSendTransactionScreen-CNnIfg-v.mjs → StandardSignAndSendTransactionScreen-COscrw9p.mjs} +1 -1
  181. package/dist/esm/{TelegramAuthScreen-C_5cJWas.mjs → TelegramAuthScreen-DC1ppGbz.mjs} +1 -1
  182. package/dist/esm/{TransactionDetails-Dpy5T9tM.mjs → TransactionDetails-BBNigCES.mjs} +1 -1
  183. package/dist/esm/{TransactionErrorView-Dyy8JzAg.mjs → TransactionErrorView-DKnANlpi.mjs} +1 -1
  184. package/dist/esm/{TransferFromWalletScreen-DsWLEs0t.mjs → TransferFromWalletScreen-DW25GKHH.mjs} +1 -1
  185. package/dist/esm/{TransferOrBridgeLoadingScreen-CKF3jFy2.mjs → TransferOrBridgeLoadingScreen-R7No-8Yr.mjs} +1 -1
  186. package/dist/esm/{UpdateEmailScreen-DjS9mWl8.mjs → UpdateEmailScreen-CXd8_t7z.mjs} +1 -1
  187. package/dist/esm/{UpdatePhoneScreen-0Wm7i3sR.mjs → UpdatePhoneScreen-B9pfgcCa.mjs} +1 -1
  188. package/dist/esm/{UserLimitReachedScreen-C4J0L2bZ.mjs → UserLimitReachedScreen-pxpwGSM-.mjs} +1 -1
  189. package/dist/esm/{WalletInfoCard-QxupP_e1.mjs → WalletInfoCard-DFrqmXTc.mjs} +1 -1
  190. package/dist/esm/{WalletInterstitialScreen-ofT84gQY.mjs → WalletInterstitialScreen-BduifiaN.mjs} +1 -1
  191. package/dist/esm/{WalletLink-DFEVbh0m.mjs → WalletLink-D5DTXYny.mjs} +1 -1
  192. package/dist/esm/{WalletOverflowButton-gDOg31Q5.mjs → WalletOverflowButton-yerFFdMA.mjs} +1 -1
  193. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  194. package/dist/esm/{context-BOoFAPna.mjs → context-BqHnoxK5.mjs} +1 -1
  195. package/dist/esm/{ethers-DnpKeAXc.mjs → ethers-CUqPIRrW.mjs} +1 -1
  196. package/dist/esm/extended-chains.mjs +1 -1
  197. package/dist/esm/get-is-unified-wallet-GLvRyJlT.mjs +1 -0
  198. package/dist/esm/{index-DL7cst3F.mjs → index-5iW2YlYC.mjs} +1 -1
  199. package/dist/esm/{index-CUao1WyN.mjs → index-B24hEnAn.mjs} +4 -4
  200. package/dist/esm/{index-Doo2h9wE.mjs → index-DT54fwyL.mjs} +1 -1
  201. package/dist/esm/index.mjs +1 -1
  202. package/dist/esm/internal.mjs +1 -1
  203. package/dist/esm/{prepareFundingModalData-CzDMa8gy.mjs → prepareFundingModalData-lYYA8ZfI.mjs} +1 -1
  204. package/dist/esm/{shared-C_3e8pDa.mjs → shared-RdgpdEMG.mjs} +1 -1
  205. package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-BkG4QVN4.mjs → shouldProceedtoEmbeddedWalletCreationFlow-F4FtZ8gq.mjs} +1 -1
  206. package/dist/esm/{smart-wallets-DUDljgWK.mjs → smart-wallets-Bk5LCXUu.mjs} +1 -1
  207. package/dist/esm/smart-wallets.mjs +1 -1
  208. package/dist/esm/solana.mjs +1 -1
  209. package/dist/esm/{to-ui-error-BuXu0iWM.mjs → to-ui-error-ySeuG-hJ.mjs} +1 -1
  210. package/dist/esm/{twitter-6jomarO4.mjs → twitter-BoAxhlj6.mjs} +1 -1
  211. package/dist/esm/ui.mjs +1 -1
  212. package/dist/esm/{use-create-wallet-without-fallback-4kJuPNnl.mjs → use-create-wallet-without-fallback-DCFiaOUd.mjs} +1 -1
  213. package/dist/esm/{use-export-wallet-DLpQ6ZuE.mjs → use-export-wallet-BSyJ6wXH.mjs} +1 -1
  214. package/dist/esm/{useActiveWallet-BdFIc7_K.mjs → useActiveWallet-CBIiGG1k.mjs} +1 -1
  215. package/dist/esm/{useGetTokenPrice-Cw9UgOp3.mjs → useGetTokenPrice-DOgFQ9vL.mjs} +1 -1
  216. package/dist/esm/{useI18n-fcpgyVzo.mjs → useI18n-BotQj3s2.mjs} +1 -1
  217. package/dist/esm/{usePrivy-CeQ3C1KS.mjs → usePrivy-C5z76Qhs.mjs} +1 -1
  218. package/dist/esm/{useSolanaRpcClient-DyBoxaVM.mjs → useSolanaRpcClient-BMkY8W80.mjs} +1 -1
  219. package/dist/esm/{useWallets-3r4yfFNg.mjs → useWallets-Aw21dxK9.mjs} +1 -1
  220. package/dist/esm/{useWallets-CZrLXHtS.mjs → useWallets-CHDUUIx3.mjs} +1 -1
  221. package/package.json +3 -3
  222. package/dist/cjs/ConnectWalletView-B7tEQCbZ.js +0 -1
  223. package/dist/cjs/CrossAppAuthScreen-M__fDCJH.js +0 -1
  224. package/dist/cjs/CustomLandingScreenView-D-7kPzjH.js +0 -2
  225. package/dist/cjs/HCaptchaWrapper-DMLxURsO.js +0 -1
  226. package/dist/cjs/get-is-unified-wallet-D6pn8A8g.js +0 -1
  227. package/dist/esm/ConnectWalletView-Ch6TwKX_.mjs +0 -1
  228. package/dist/esm/CrossAppAuthScreen-BbWHC41s.mjs +0 -1
  229. package/dist/esm/CustomLandingScreenView-CKarTBuo.mjs +0 -2
  230. package/dist/esm/HCaptchaWrapper-Dl2Jt_Df.mjs +0 -1
  231. package/dist/esm/get-is-unified-wallet-Ca5aEojK.mjs +0 -1
@@ -1 +1 @@
1
- import{jsx as t,jsxs as e,Fragment as a}from"react/jsx-runtime";import n from"@heroicons/react/24/outline/CheckCircleIcon";import{useState as o,useEffect as r}from"react";import{formatWalletAddress as s}from"@privy-io/js-sdk-core";import{P as i}from"./Button-CrJpeX0e.mjs";import{b as l,c as m,R as c,e as d}from"./Layouts-Bmf8DxNP.mjs";import{B as u}from"./ModalHeader-YP9pLMEP.mjs";import{C as p}from"./ScreenHeader-Biz1wq02.mjs";import{t as f}from"./FundWalletMethodHeader-DBV2Rnau.mjs";import{I as g}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{N as h}from"./index-CJMgUOnw.mjs";import{L as I,V as w}from"./Value-B4M62ove.mjs";import{a as v,R as S}from"./Row-CG0lSY5Z.mjs";import{u as j,t as C}from"./context-BOoFAPna.mjs";import{u as y,a as L,b as x}from"./internal-context-e-Eni5bG.mjs";import{a as F}from"./get-is-unified-wallet-Ca5aEojK.mjs";import{u as k,g as U}from"./useWallets-CZrLXHtS.mjs";import{u as T}from"./useGetTokenPrice-Cw9UgOp3.mjs";import{O as b}from"./analytics-mkkvFRju.mjs";import{getTransferSolInstruction as A}from"@solana-program/system";import{pipe as W,createTransactionMessage as D,setTransactionMessageFeePayerSigner as P,setTransactionMessageLifetimeUsingBlockhash as N,appendTransactionMessageInstruction as O,compileTransaction as M,getTransactionEncoder as B}from"@solana/kit";import{findAssociatedTokenPda as E,getCreateAssociatedTokenIdempotentInstruction as $,getTransferInstruction as R}from"@solana-program/token";import{T as H,L as G,g as V}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import{g as _}from"./getUsdcMintAddress-DFI1hv05.mjs";import{u as q,f as z,s as Q,w as X}from"./useSolanaRpcClient-DyBoxaVM.mjs";import{g as Y}from"./getChainName-DjpPdUSc.mjs";import{t as J}from"./prepareFundingModalData-CzDMa8gy.mjs";import"styled-components";import"./useActiveWallet-BdFIc7_K.mjs";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-3r4yfFNg.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/WalletIcon";import"./LoadingSkeleton-CHdaq3pb.mjs";import"tinycolor2";import"ofetch";import"./usePrivy-CeQ3C1KS.mjs";import"eventemitter3";import"@scure/base";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./useGetSolPrice-Cfm8o9C5.mjs";function K({rows:a}){/*#__PURE__*/return t(v,{children:a.filter((t=>!!t)).map(((a,n)=>null!=a.value||a.isLoading?/*#__PURE__*/e(S,{children:[/*#__PURE__*/t(I,{children:a.label}),/*#__PURE__*/t(w,{$isLoading:a.isLoading,children:a.value})]},n):null))})}function Z(t){return BigInt(Math.floor(1e9*parseFloat(t)))}function tt(t){return+et.format(parseFloat(t.toString())/1e9)}let et=Intl.NumberFormat(void 0,{maximumFractionDigits:8});async function at({tx:t,solanaClient:e,amount:a,asset:n,tokenPrice:o}){if(!t)return null;if("SOL"===n&&o){let n=Z(a),r=V(n,o),s=await z({solanaClient:e,tx:t});return{amountInUsd:r,feeInUsd:o?V(s,o):void 0,totalInUsd:V(n+s,o)}}if("USDC"===n&&o){let n="$"+a,r=await z({solanaClient:e,tx:t}),s=function(t,e){let a=parseFloat(t.toString())/G*e;return a<.01?0:a}(r,o);return{amountInUsd:n,feeInUsd:V(r,o),totalInUsd:"$"+(parseFloat(a)+s).toFixed(2)}}if("SOL"===n){let n=Z(a),o=await z({solanaClient:e,tx:t});return{amountInSol:a+" SOL",feeInSol:tt(o)+" SOL",totalInSol:tt(n+o)+" SOL"}}return{amountInUsdc:a+" USDC",feeInSol:tt(await z({solanaClient:e,tx:t}))+" SOL"}}const nt={component:function(){let I=j(),{closePrivyModal:w,createAnalyticsEvent:v}=y(),{data:S,setModalData:G,navigate:z}=F(),{wallets:tt}=k(),[et,nt]=o("preparing"),[ot,rt]=o(),[st,it]=o(),[lt,mt]=o();if(!S?.solanaFundingData)throw Error("Funding config is missing");if(!S.solanaFundingData.sourceWalletData)throw Error("Funding config is missing source wallet data");let{amount:ct,asset:dt,chain:ut,sourceWalletData:pt,destinationAddress:ft,afterSuccessScreen:gt}=S.solanaFundingData,ht=tt.find((t=>t.address===pt.address&&J(pt.walletClientType)===J(t.standardWallet.name))),It=q()(ut),{tokenPrice:wt,isTokenPriceLoading:vt}=T("solana");return r((()=>{if("preparing"!==et||vt||!ht)return;let t="SOL"===dt?Z(ct):function(t){return BigInt(Math.floor(1e6*parseFloat(t)))}(ct);it({amount:("SOL"===dt&&wt?V(t,wt):ct)??ct}),("SOL"===dt?async function({solanaClient:t,source:e,destination:a,amountInLamports:n}){let{value:o}=await t.rpc.getLatestBlockhash().send(),r={address:e},s=W(D({version:0}),(t=>P(r,t)),(t=>N(o,t)),(t=>O(A({amount:n,source:r,destination:a}),t)),(t=>M(t)));return new Uint8Array(B().encode(s))}({solanaClient:It,source:ht.address,destination:ft,amountInLamports:t}):async function({solanaClient:t,source:e,destination:a,amountInBaseUnits:n}){let o=_(t.chain),{value:r}=await t.rpc.getLatestBlockhash().send(),s={address:e},[i]=await E({mint:o,owner:e,tokenProgram:H}),[l]=await E({mint:o,owner:a,tokenProgram:H}),[m,c]=await Promise.all([t.rpc.getAccountInfo(i,{commitment:"confirmed",encoding:"jsonParsed"}).send().catch((()=>null)),t.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send().catch((()=>null))]);if(!m?.value)throw Error(`Source token account does not exist for address: ${e}`);let d=$({payer:s,ata:l,owner:a,mint:o}),u=W(D({version:0}),(t=>P(s,t)),(t=>N(r,t)),(t=>c?.value?t:O(d,t)),(t=>O(R({source:i,destination:l,authority:s,amount:n}),t)),(t=>M(t)));return new Uint8Array(B().encode(u))}({solanaClient:It,source:ht.address,destination:ft,amountInBaseUnits:t})).then(rt).catch((t=>{nt("error"),mt(t)}))}),[et,ct,dt,ut,ht,ft,vt,wt]),r((()=>{"preparing"===et&&ot&&at({tx:ot,solanaClient:It,amount:ct,asset:dt,tokenPrice:wt}).then((t=>{nt("loaded"),it({amount:t?.amountInUsd??t?.amountInUsdc??t?.amountInSol??ct,fee:t?.feeInUsd??t?.feeInSol,total:t?.totalInUsd??t?.totalInSol})})).catch((t=>{nt("error"),mt(t)}))}),[ot,ct,dt,et,wt]),r((()=>{"error"===et&&lt&&(G({errorModalData:{error:lt,previousScreen:"FundSolWalletWithExternalSolanaWallet"},solanaFundingData:S.solanaFundingData}),z("ErrorScreen",!1))}),[et,z]),r((()=>{if("success"!==et)return;let t=setTimeout(gt?()=>z(gt):w,C);return()=>clearTimeout(t)}),[et]),/*#__PURE__*/e(a,"success"===et?{children:[/*#__PURE__*/t(f,{}),/*#__PURE__*/t(l,{}),/*#__PURE__*/e(m,{children:[/*#__PURE__*/t(n,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/t(p,{title:"Success!",description:`You’ve successfully added ${ct} ${dt} to your ${I.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/t(c,{}),/*#__PURE__*/t(u,{})]}:"preparing"===et||"loaded"===et||"sending"===et?{children:[/*#__PURE__*/t(f,{}),/*#__PURE__*/t(d,{style:{marginTop:"16px"},children:/*#__PURE__*/t(g,{icon:ht?.standardWallet.icon,name:ht?.standardWallet.name})}),/*#__PURE__*/t(p,{style:{marginTop:"8px",marginBottom:"12px"},title:"sending"===et&&ht?`Confirming with ${ht.standardWallet.name}`:"Confirm transaction"}),/*#__PURE__*/t(K,{rows:[{label:"Source",value:s(pt.address)},{label:"Destination",value:s(ft)},{label:"Network",value:Y(ut)},{label:"Amount",value:st?.amount,isLoading:"preparing"===et},{label:"Estimated fee",value:st?.fee,isLoading:"preparing"===et},{label:"Total",value:st?.total,isLoading:"preparing"===et}]}),/*#__PURE__*/t(i,{style:{marginTop:"1rem"},loading:"preparing"===et||"sending"===et,onClick:function(){"loaded"===et&&ot&&ht&&(nt("sending"),async function({transaction:t,chain:e,sourceWallet:a,solanaClient:n}){let{hasFunds:o}=await Q({solanaClient:n,tx:t});if(!o)throw new L(`Wallet ${s(a.address)} does not have enough funds.`,void 0,x.INSUFFICIENT_BALANCE);let r=U((await a.signAndSendTransaction({transaction:t,chain:e}).catch((t=>{throw new L("Transaction was rejected by the user",t,x.TRANSACTION_FAILURE)}))).signature);return await X({rpcSubscriptions:n.rpcSubscriptions,signature:r,timeout:2e4}),r}({solanaClient:It,transaction:ot,chain:ut,sourceWallet:ht}).then((t=>{nt("success"),v({eventName:b,payload:{provider:"external",status:"success",txHash:t,address:ht.address,value:ct,chainType:"solana",clusterName:ut,token:dt,destinationAddress:ft,destinationValue:ct,destinationChainType:"solana",destinationClusterName:ut,destinationToken:dt}})})).catch((t=>{nt("error"),mt(t)})))},children:"Confirm"}),/*#__PURE__*/t(u,{})]}:{children:[/*#__PURE__*/t(f,{}),/*#__PURE__*/t(h,{}),/*#__PURE__*/t("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/t(u,{})]})}};export{nt as FundSolWalletWithExternalSolanaWallet,nt as default};
1
+ import{jsx as t,jsxs as e,Fragment as a}from"react/jsx-runtime";import n from"@heroicons/react/24/outline/CheckCircleIcon";import{useState as o,useEffect as r}from"react";import{formatWalletAddress as s}from"@privy-io/js-sdk-core";import{P as i}from"./Button-3JMVXKiE.mjs";import{b as l,c as m,R as c,e as d}from"./Layouts-Bmf8DxNP.mjs";import{B as u}from"./ModalHeader-B27O6soE.mjs";import{C as p}from"./ScreenHeader-Biz1wq02.mjs";import{t as f}from"./FundWalletMethodHeader-C0uPKdYw.mjs";import{I as g}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{N as h}from"./index-CJMgUOnw.mjs";import{L as I,V as w}from"./Value-B4M62ove.mjs";import{a as v,R as S}from"./Row-CG0lSY5Z.mjs";import{u as j,t as C}from"./context-BqHnoxK5.mjs";import{u as y,a as L,b as x}from"./internal-context-e-Eni5bG.mjs";import{a as F}from"./get-is-unified-wallet-GLvRyJlT.mjs";import{u as k,g as U}from"./useWallets-CHDUUIx3.mjs";import{u as T}from"./useGetTokenPrice-DOgFQ9vL.mjs";import{O as b}from"./analytics-mkkvFRju.mjs";import{getTransferSolInstruction as A}from"@solana-program/system";import{pipe as W,createTransactionMessage as D,setTransactionMessageFeePayerSigner as P,setTransactionMessageLifetimeUsingBlockhash as N,appendTransactionMessageInstruction as O,compileTransaction as M,getTransactionEncoder as B}from"@solana/kit";import{findAssociatedTokenPda as E,getCreateAssociatedTokenIdempotentInstruction as $,getTransferInstruction as R}from"@solana-program/token";import{T as H,L as G,g as V}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import{g as _}from"./getUsdcMintAddress-DFI1hv05.mjs";import{u as q,f as z,s as Q,w as X}from"./useSolanaRpcClient-BMkY8W80.mjs";import{g as Y}from"./getChainName-DjpPdUSc.mjs";import{t as J}from"./prepareFundingModalData-lYYA8ZfI.mjs";import"styled-components";import"./useActiveWallet-CBIiGG1k.mjs";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-Aw21dxK9.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/WalletIcon";import"./LoadingSkeleton-CHdaq3pb.mjs";import"tinycolor2";import"ofetch";import"./usePrivy-C5z76Qhs.mjs";import"eventemitter3";import"@scure/base";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./useGetSolPrice-Cfm8o9C5.mjs";function K({rows:a}){/*#__PURE__*/return t(v,{children:a.filter((t=>!!t)).map(((a,n)=>null!=a.value||a.isLoading?/*#__PURE__*/e(S,{children:[/*#__PURE__*/t(I,{children:a.label}),/*#__PURE__*/t(w,{$isLoading:a.isLoading,children:a.value})]},n):null))})}function Z(t){return BigInt(Math.floor(1e9*parseFloat(t)))}function tt(t){return+et.format(parseFloat(t.toString())/1e9)}let et=Intl.NumberFormat(void 0,{maximumFractionDigits:8});async function at({tx:t,solanaClient:e,amount:a,asset:n,tokenPrice:o}){if(!t)return null;if("SOL"===n&&o){let n=Z(a),r=V(n,o),s=await z({solanaClient:e,tx:t});return{amountInUsd:r,feeInUsd:o?V(s,o):void 0,totalInUsd:V(n+s,o)}}if("USDC"===n&&o){let n="$"+a,r=await z({solanaClient:e,tx:t}),s=function(t,e){let a=parseFloat(t.toString())/G*e;return a<.01?0:a}(r,o);return{amountInUsd:n,feeInUsd:V(r,o),totalInUsd:"$"+(parseFloat(a)+s).toFixed(2)}}if("SOL"===n){let n=Z(a),o=await z({solanaClient:e,tx:t});return{amountInSol:a+" SOL",feeInSol:tt(o)+" SOL",totalInSol:tt(n+o)+" SOL"}}return{amountInUsdc:a+" USDC",feeInSol:tt(await z({solanaClient:e,tx:t}))+" SOL"}}const nt={component:function(){let I=j(),{closePrivyModal:w,createAnalyticsEvent:v}=y(),{data:S,setModalData:G,navigate:z}=F(),{wallets:tt}=k(),[et,nt]=o("preparing"),[ot,rt]=o(),[st,it]=o(),[lt,mt]=o();if(!S?.solanaFundingData)throw Error("Funding config is missing");if(!S.solanaFundingData.sourceWalletData)throw Error("Funding config is missing source wallet data");let{amount:ct,asset:dt,chain:ut,sourceWalletData:pt,destinationAddress:ft,afterSuccessScreen:gt}=S.solanaFundingData,ht=tt.find((t=>t.address===pt.address&&J(pt.walletClientType)===J(t.standardWallet.name))),It=q()(ut),{tokenPrice:wt,isTokenPriceLoading:vt}=T("solana");return r((()=>{if("preparing"!==et||vt||!ht)return;let t="SOL"===dt?Z(ct):function(t){return BigInt(Math.floor(1e6*parseFloat(t)))}(ct);it({amount:("SOL"===dt&&wt?V(t,wt):ct)??ct}),("SOL"===dt?async function({solanaClient:t,source:e,destination:a,amountInLamports:n}){let{value:o}=await t.rpc.getLatestBlockhash().send(),r={address:e},s=W(D({version:0}),(t=>P(r,t)),(t=>N(o,t)),(t=>O(A({amount:n,source:r,destination:a}),t)),(t=>M(t)));return new Uint8Array(B().encode(s))}({solanaClient:It,source:ht.address,destination:ft,amountInLamports:t}):async function({solanaClient:t,source:e,destination:a,amountInBaseUnits:n}){let o=_(t.chain),{value:r}=await t.rpc.getLatestBlockhash().send(),s={address:e},[i]=await E({mint:o,owner:e,tokenProgram:H}),[l]=await E({mint:o,owner:a,tokenProgram:H}),[m,c]=await Promise.all([t.rpc.getAccountInfo(i,{commitment:"confirmed",encoding:"jsonParsed"}).send().catch((()=>null)),t.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send().catch((()=>null))]);if(!m?.value)throw Error(`Source token account does not exist for address: ${e}`);let d=$({payer:s,ata:l,owner:a,mint:o}),u=W(D({version:0}),(t=>P(s,t)),(t=>N(r,t)),(t=>c?.value?t:O(d,t)),(t=>O(R({source:i,destination:l,authority:s,amount:n}),t)),(t=>M(t)));return new Uint8Array(B().encode(u))}({solanaClient:It,source:ht.address,destination:ft,amountInBaseUnits:t})).then(rt).catch((t=>{nt("error"),mt(t)}))}),[et,ct,dt,ut,ht,ft,vt,wt]),r((()=>{"preparing"===et&&ot&&at({tx:ot,solanaClient:It,amount:ct,asset:dt,tokenPrice:wt}).then((t=>{nt("loaded"),it({amount:t?.amountInUsd??t?.amountInUsdc??t?.amountInSol??ct,fee:t?.feeInUsd??t?.feeInSol,total:t?.totalInUsd??t?.totalInSol})})).catch((t=>{nt("error"),mt(t)}))}),[ot,ct,dt,et,wt]),r((()=>{"error"===et&&lt&&(G({errorModalData:{error:lt,previousScreen:"FundSolWalletWithExternalSolanaWallet"},solanaFundingData:S.solanaFundingData}),z("ErrorScreen",!1))}),[et,z]),r((()=>{if("success"!==et)return;let t=setTimeout(gt?()=>z(gt):w,C);return()=>clearTimeout(t)}),[et]),/*#__PURE__*/e(a,"success"===et?{children:[/*#__PURE__*/t(f,{}),/*#__PURE__*/t(l,{}),/*#__PURE__*/e(m,{children:[/*#__PURE__*/t(n,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/t(p,{title:"Success!",description:`You’ve successfully added ${ct} ${dt} to your ${I.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/t(c,{}),/*#__PURE__*/t(u,{})]}:"preparing"===et||"loaded"===et||"sending"===et?{children:[/*#__PURE__*/t(f,{}),/*#__PURE__*/t(d,{style:{marginTop:"16px"},children:/*#__PURE__*/t(g,{icon:ht?.standardWallet.icon,name:ht?.standardWallet.name})}),/*#__PURE__*/t(p,{style:{marginTop:"8px",marginBottom:"12px"},title:"sending"===et&&ht?`Confirming with ${ht.standardWallet.name}`:"Confirm transaction"}),/*#__PURE__*/t(K,{rows:[{label:"Source",value:s(pt.address)},{label:"Destination",value:s(ft)},{label:"Network",value:Y(ut)},{label:"Amount",value:st?.amount,isLoading:"preparing"===et},{label:"Estimated fee",value:st?.fee,isLoading:"preparing"===et},{label:"Total",value:st?.total,isLoading:"preparing"===et}]}),/*#__PURE__*/t(i,{style:{marginTop:"1rem"},loading:"preparing"===et||"sending"===et,onClick:function(){"loaded"===et&&ot&&ht&&(nt("sending"),async function({transaction:t,chain:e,sourceWallet:a,solanaClient:n}){let{hasFunds:o}=await Q({solanaClient:n,tx:t});if(!o)throw new L(`Wallet ${s(a.address)} does not have enough funds.`,void 0,x.INSUFFICIENT_BALANCE);let r=U((await a.signAndSendTransaction({transaction:t,chain:e}).catch((t=>{throw new L("Transaction was rejected by the user",t,x.TRANSACTION_FAILURE)}))).signature);return await X({rpcSubscriptions:n.rpcSubscriptions,signature:r,timeout:2e4}),r}({solanaClient:It,transaction:ot,chain:ut,sourceWallet:ht}).then((t=>{nt("success"),v({eventName:b,payload:{provider:"external",status:"success",txHash:t,address:ht.address,value:ct,chainType:"solana",clusterName:ut,token:dt,destinationAddress:ft,destinationValue:ct,destinationChainType:"solana",destinationClusterName:ut,destinationToken:dt}})})).catch((t=>{nt("error"),mt(t)})))},children:"Confirm"}),/*#__PURE__*/t(u,{})]}:{children:[/*#__PURE__*/t(f,{}),/*#__PURE__*/t(h,{}),/*#__PURE__*/t("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/t(u,{})]})}};export{nt as FundSolWalletWithExternalSolanaWallet,nt as default};
@@ -1 +1 @@
1
- import{jsx as n}from"react/jsx-runtime";import{a as e}from"./get-is-unified-wallet-Ca5aEojK.mjs";import{M as a}from"./ModalHeader-YP9pLMEP.mjs";function t({title:t}){let{currentScreen:i,navigateBack:r,navigate:d,data:o,setModalData:u}=e();/*#__PURE__*/return n(a,{title:t,backFn:"ManualTransferScreen"===i?r:i===o?.funding?.methodScreen?o.funding.comingFromSendTransactionScreen?()=>d("SendTransactionScreen"):void 0:o?.funding?.methodScreen?()=>{let n=o.funding;n.usingDefaultFundingMethod&&(n.usingDefaultFundingMethod=!1),u({funding:n,solanaFundingData:o?.solanaFundingData}),d(n.methodScreen)}:void 0})}export{t};
1
+ import{jsx as n}from"react/jsx-runtime";import{a as e}from"./get-is-unified-wallet-GLvRyJlT.mjs";import{M as a}from"./ModalHeader-B27O6soE.mjs";function t({title:t}){let{currentScreen:i,navigateBack:r,navigate:d,data:o,setModalData:u}=e();/*#__PURE__*/return n(a,{title:t,backFn:"ManualTransferScreen"===i?r:i===o?.funding?.methodScreen?o.funding.comingFromSendTransactionScreen?()=>d("SendTransactionScreen"):void 0:o?.funding?.methodScreen?()=>{let n=o.funding;n.usingDefaultFundingMethod&&(n.usingDefaultFundingMethod=!1),u({funding:n,solanaFundingData:o?.solanaFundingData}),d(n.methodScreen)}:void 0})}export{t};
@@ -1 +1 @@
1
- import{jsxs as t,Fragment as o,jsx as e}from"react/jsx-runtime";import{useRef as r}from"react";import{a as i}from"./Button-CrJpeX0e.mjs";import{F as n}from"./Layouts-Bmf8DxNP.mjs";import{B as a}from"./ModalHeader-YP9pLMEP.mjs";import{t as m}from"./FundWalletMethodHeader-DBV2Rnau.mjs";import{N as s}from"./index-CJMgUOnw.mjs";import{T as l}from"./Title-D0pfZff-.mjs";import{a as c}from"./get-is-unified-wallet-Ca5aEojK.mjs";import{u as p}from"./useGetTokenPrice-Cw9UgOp3.mjs";import{c as d}from"./ethers-DnpKeAXc.mjs";import{F as u,a as h,h as f,c as j,d as g}from"./styles-DY17fuAX.mjs";import"styled-components";import"./useActiveWallet-BdFIc7_K.mjs";import"zustand";import"./context-BOoFAPna.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"react-device-detect";import"./prepareFundingModalData-CzDMa8gy.mjs";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-3r4yfFNg.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"./useGetSolPrice-Cfm8o9C5.mjs";const v={component:()=>{let{data:v,setModalData:C}=c(),y=v?.funding,D="solana"===y.chainType,k=r(null),{tokenPrice:x}=p(D?"solana":y.chain.id),F=D?void 0:y,T=!(!F?.erc20Address||F?.erc20ContractInfo),A=D?y.isUSDC?"USDC":"SOL":y.erc20Address?y.erc20ContractInfo?.symbol:y.chain.nativeCurrency.symbol||"ETH",I=parseFloat(y.amount),M=!isNaN(I)&&I>0,S=x?d(y.amount,x):void 0;/*#__PURE__*/return t(o,{children:[/*#__PURE__*/e(m,{}),/*#__PURE__*/e(l,{children:"Confirm or edit amount"}),/*#__PURE__*/t(n,{style:{marginTop:"32px"},children:[/*#__PURE__*/e(u,{children:T?/*#__PURE__*/e(s,{size:"50px"}):/*#__PURE__*/t(o,{children:[/*#__PURE__*/t(h,{onClick:()=>k.current?.focus(),children:[/*#__PURE__*/e(f,{ref:k,value:y.amount,onChange:t=>{let o=t.target.value;/^[0-9.]*$/.test(o)&&o.split(".").length-1<=1&&C({...v,funding:{...y,amount:o},solanaFundingData:v?.solanaFundingData?{...v.solanaFundingData,amount:o}:void 0})}}),/*#__PURE__*/e(j,{children:A})]}),!F?.erc20Address&&!(D&&y.isUSDC)&&/*#__PURE__*/e(g,{children:S&&M?`${S} USD`:""})]})}),/*#__PURE__*/e(i,{style:{marginTop:"1rem"},disabled:!M,onClick:y.onContinueWithExternalWallet,children:"Continue"})]}),/*#__PURE__*/e(a,{})]})}};export{v as FundingAmountEditScreen,v as default};
1
+ import{jsxs as t,Fragment as o,jsx as e}from"react/jsx-runtime";import{useRef as r}from"react";import{a as i}from"./Button-3JMVXKiE.mjs";import{F as n}from"./Layouts-Bmf8DxNP.mjs";import{B as a}from"./ModalHeader-B27O6soE.mjs";import{t as m}from"./FundWalletMethodHeader-C0uPKdYw.mjs";import{N as s}from"./index-CJMgUOnw.mjs";import{T as l}from"./Title-D0pfZff-.mjs";import{a as c}from"./get-is-unified-wallet-GLvRyJlT.mjs";import{u as p}from"./useGetTokenPrice-DOgFQ9vL.mjs";import{c as d}from"./ethers-CUqPIRrW.mjs";import{F as u,a as h,h as f,c as j,d as g}from"./styles-DY17fuAX.mjs";import"styled-components";import"./useActiveWallet-CBIiGG1k.mjs";import"zustand";import"./context-BqHnoxK5.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"react-device-detect";import"./prepareFundingModalData-lYYA8ZfI.mjs";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-Aw21dxK9.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"./useGetSolPrice-Cfm8o9C5.mjs";const v={component:()=>{let{data:v,setModalData:C}=c(),y=v?.funding,D="solana"===y.chainType,k=r(null),{tokenPrice:x}=p(D?"solana":y.chain.id),F=D?void 0:y,T=!(!F?.erc20Address||F?.erc20ContractInfo),A=D?y.isUSDC?"USDC":"SOL":y.erc20Address?y.erc20ContractInfo?.symbol:y.chain.nativeCurrency.symbol||"ETH",I=parseFloat(y.amount),M=!isNaN(I)&&I>0,S=x?d(y.amount,x):void 0;/*#__PURE__*/return t(o,{children:[/*#__PURE__*/e(m,{}),/*#__PURE__*/e(l,{children:"Confirm or edit amount"}),/*#__PURE__*/t(n,{style:{marginTop:"32px"},children:[/*#__PURE__*/e(u,{children:T?/*#__PURE__*/e(s,{size:"50px"}):/*#__PURE__*/t(o,{children:[/*#__PURE__*/t(h,{onClick:()=>k.current?.focus(),children:[/*#__PURE__*/e(f,{ref:k,value:y.amount,onChange:t=>{let o=t.target.value;/^[0-9.]*$/.test(o)&&o.split(".").length-1<=1&&C({...v,funding:{...y,amount:o},solanaFundingData:v?.solanaFundingData?{...v.solanaFundingData,amount:o}:void 0})}}),/*#__PURE__*/e(j,{children:A})]}),!F?.erc20Address&&!(D&&y.isUSDC)&&/*#__PURE__*/e(g,{children:S&&M?`${S} USD`:""})]})}),/*#__PURE__*/e(i,{style:{marginTop:"1rem"},disabled:!M,onClick:y.onContinueWithExternalWallet,children:"Continue"})]}),/*#__PURE__*/e(a,{})]})}};export{v as FundingAmountEditScreen,v as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/CreditCardIcon";import i from"@heroicons/react/24/outline/QrCodeIcon";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import{useState as r,useEffect as c,useMemo as d}from"react";import{getAddress as s}from"viem/utils";import{B as l}from"./ModalHeader-YP9pLMEP.mjs";import{t as h}from"./FundWalletMethodHeader-DBV2Rnau.mjs";import{E as p}from"./ErrorBanner-BdiArMwu.mjs";import{I as u}from"./InfoBanner-D6C6Bt8L.mjs";import{u as m}from"./context-BOoFAPna.mjs";import{v as f,Q as g,U as y}from"./useActiveWallet-BdFIc7_K.mjs";import{a as v,u as C}from"./internal-context-e-Eni5bG.mjs";import{a as w}from"./get-is-unified-wallet-Ca5aEojK.mjs";import{u as F}from"./useWallets-3r4yfFNg.mjs";import{W as M}from"./WalletCards-DH1rqayz.mjs";import{g as b}from"./getErc20TokenInfo-BFoeg5F6.mjs";import{avalanche as W,arbitrum as S,polygon as x,optimism as I,base as D,mainnet as T,toCoinbaseAssetId as A,getCoinbaseOnRampUrl as j,chainToMoonpayCurrency as k,isSupportedChainIdForMoonpay as z,isSupportedChainIdForCoinbaseOnramp as E}from"@privy-io/js-sdk-core";import{trigger as L}from"@privy-io/popup";import{a as U}from"./index-Doo2h9wE.mjs";import{e as O,I as _,f as H,g as P}from"./styles-DY17fuAX.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"tinycolor2";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CzDMa8gy.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-A9RSftUZ.mjs";import"ofetch";import"./analytics-mkkvFRju.mjs";const B=n=>/*#__PURE__*/e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 210.2",xmlSpace:"preserve",...n,children:/*#__PURE__*/e("path",{d:"M93.6,27.1C87.6,34.2,78,39.8,68.4,39c-1.2-9.6,3.5-19.8,9-26.1c6-7.3,16.5-12.5,25-12.9 C103.4,10,99.5,19.8,93.6,27.1 M102.3,40.9c-13.9-0.8-25.8,7.9-32.4,7.9c-6.7,0-16.8-7.5-27.8-7.3c-14.3,0.2-27.6,8.3-34.9,21.2 c-15,25.8-3.9,64,10.6,85c7.1,10.4,15.6,21.8,26.8,21.4c10.6-0.4,14.8-6.9,27.6-6.9c12.9,0,16.6,6.9,27.8,6.7 c11.6-0.2,18.9-10.4,26-20.8c8.1-11.8,11.4-23.3,11.6-23.9c-0.2-0.2-22.4-8.7-22.6-34.3c-0.2-21.4,17.5-31.6,18.3-32.2 C123.3,42.9,107.7,41.3,102.3,40.9 M182.6,11.9v155.9h24.2v-53.3h33.5c30.6,0,52.1-21,52.1-51.4c0-30.4-21.1-51.2-51.3-51.2H182.6z M206.8,32.3h27.9c21,0,33,11.2,33,30.9c0,19.7-12,31-33.1,31h-27.8V32.3z M336.6,169c15.2,0,29.3-7.7,35.7-19.9h0.5v18.7h22.4V90.2 c0-22.5-18-37-45.7-37c-25.7,0-44.7,14.7-45.4,34.9h21.8c1.8-9.6,10.7-15.9,22.9-15.9c14.8,0,23.1,6.9,23.1,19.6v8.6l-30.2,1.8 c-28.1,1.7-43.3,13.2-43.3,33.2C298.4,155.6,314.1,169,336.6,169z M343.1,150.5c-12.9,0-21.1-6.2-21.1-15.7c0-9.8,7.9-15.5,23-16.4 l26.9-1.7v8.8C371.9,140.1,359.5,150.5,343.1,150.5z M425.1,210.2c23.6,0,34.7-9,44.4-36.3L512,54.7h-24.6l-28.5,92.1h-0.5 l-28.5-92.1h-25.3l41,113.5l-2.2,6.9c-3.7,11.7-9.7,16.2-20.4,16.2c-1.9,0-5.6-0.2-7.1-0.4v18.7C417.3,210,423.3,210.2,425.1,210.2z"})}),R=t=>/*#__PURE__*/n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 38.1",xmlSpace:"preserve",...t,children:[/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M37.8,19.7V29h-3V6h7.8c1.9,0,3.7,0.7,5.1,2c1.4,1.2,2.1,3,2.1,4.9c0,1.9-0.7,3.6-2.1,4.9c-1.4,1.3-3.1,2-5.1,2 L37.8,19.7L37.8,19.7z M37.8,8.8v8h5c1.1,0,2.2-0.4,2.9-1.2c1.6-1.5,1.6-4,0.1-5.5c0,0-0.1-0.1-0.1-0.1c-0.8-0.8-1.8-1.3-2.9-1.2 L37.8,8.8L37.8,8.8z"}),/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M56.7,12.8c2.2,0,3.9,0.6,5.2,1.8s1.9,2.8,1.9,4.8V29H61v-2.2h-0.1c-1.2,1.8-2.9,2.7-4.9,2.7 c-1.7,0-3.2-0.5-4.4-1.5c-1.1-1-1.8-2.4-1.8-3.9c0-1.6,0.6-2.9,1.8-3.9c1.2-1,2.9-1.4,4.9-1.4c1.8,0,3.2,0.3,4.3,1v-0.7 c0-1-0.4-2-1.2-2.6c-0.8-0.7-1.8-1.1-2.9-1.1c-1.7,0-3,0.7-3.9,2.1l-2.6-1.6C51.8,13.8,53.9,12.8,56.7,12.8z M52.9,24.2 c0,0.8,0.4,1.5,1,1.9c0.7,0.5,1.5,0.8,2.3,0.8c1.2,0,2.4-0.5,3.3-1.4c1-0.9,1.5-2,1.5-3.2c-0.9-0.7-2.2-1.1-3.9-1.1 c-1.2,0-2.2,0.3-3,0.9C53.3,22.6,52.9,23.3,52.9,24.2z"}),/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M80,13.3l-9.9,22.7h-3l3.7-7.9l-6.5-14.7h3.2l4.7,11.3h0.1l4.6-11.3H80z"}),/*#__PURE__*/e("path",{style:{fill:"#4285F4"},d:"M25.9,17.7c0-0.9-0.1-1.8-0.2-2.7H13.2v5.1h7.1c-0.3,1.6-1.2,3.1-2.6,4v3.3H22C24.5,25.1,25.9,21.7,25.9,17.7z"}),/*#__PURE__*/e("path",{style:{fill:"#34A853"},d:"M13.2,30.6c3.6,0,6.6-1.2,8.8-3.2l-4.3-3.3c-1.2,0.8-2.7,1.3-4.5,1.3c-3.4,0-6.4-2.3-7.4-5.5H1.4v3.4 C3.7,27.8,8.2,30.6,13.2,30.6z"}),/*#__PURE__*/e("path",{style:{fill:"#FBBC04"},d:"M5.8,19.9c-0.6-1.6-0.6-3.4,0-5.1v-3.4H1.4c-1.9,3.7-1.9,8.1,0,11.9L5.8,19.9z"}),/*#__PURE__*/e("path",{style:{fill:"#EA4335"},d:"M13.2,9.4c1.9,0,3.7,0.7,5.1,2l0,0l3.8-3.8c-2.4-2.2-5.6-3.5-8.8-3.4c-5,0-9.6,2.8-11.8,7.3l4.4,3.4 C6.8,11.7,9.8,9.4,13.2,9.4z"})]}),V=e=>{let[n,t]=r();return c((()=>{e().then((e=>{t(e)})).catch((()=>{}))}),[]),n};function N(e){let n=q[e];if(!n)throw new v(`Unsupported chainId: ${e} for Coinbase Onramp`);return n}let q={[T.id]:"ethereum",[D.id]:"base",[I.id]:"optimism",[x.id]:"polygon",[S.id]:"arbitrum",[W.id]:"avacchain"};const Q=(e,n,t,a,i,o)=>new Promise((async(r,c)=>{let d=L();if(!d)return void c(Error("Unable to initialize flow"));let s="ethereum"===n.chainType?N(n.chain.id):"solana",l=n.isUSDC?"USDC":"ethereum"===n.chainType?A(n.chain.id,"native-currency"):"SOL",h=await e.initCoinbaseOnRamp({addresses:[{address:n.address,blockchains:[s]}],assets:[l]}),{url:p}=j({appId:e.getAppId(),input:h,amount:n.amount,blockchain:s,asset:l,experience:o});d.location=p.toString();let u={...i?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(u.usingDefaultFundingMethod=!1),t({funding:u,solanaFundingData:i?.solanaFundingData,coinbaseOnrampStatus:{popup:d}}),a("CoinbaseOnrampStatusScreen"),e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp",value:n.amount,chainType:n.chainType,chainId:"ethereum"===n.chainType?n.chain.id:n.chain}}),setTimeout((()=>{t({funding:u,solanaFundingData:i?.solanaFundingData,coinbaseOnrampStatus:{partnerUserId:h.partner_user_id,popup:d}})}),5e3),r()})),$=async(e,n,t,a,i,o,r,c)=>{let d=L();if(!d)throw Error("Unable to initialize flow");let s="ethereum"===n.chainType?k(n.chain.id,a):n.isUSDC?"USDC_SOL":"SOL",{signedUrl:l,externalTransactionId:h}=await e.signMoonpayOnRampUrl({address:n.address,useSandbox:t.fundingMethodConfig.moonpay.useSandbox??!1,config:{uiConfig:{accentColor:t.appearance.palette.accent,theme:t.appearance.palette.colorScheme},paymentMethod:c,currencyCode:s,quoteCurrencyAmount:U(n.amount)}});e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"moonpay",value:n.amount,chainType:n.chainType,chainId:"ethereum"===n.chainType?n.chain.id:n.chain}}),d.location=l;let p={...r?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(p.usingDefaultFundingMethod=!1),i({moonpayStatus:{},funding:p,solanaFundingData:r?.solanaFundingData}),o("MoonpayStatusScreen"),setTimeout((()=>{i({moonpayStatus:{externalTransactionId:h},funding:p,solanaFundingData:r?.solanaFundingData})}),8e3)};let X=async e=>"undefined"!=typeof window&&"PaymentRequest"in window&&await new window.PaymentRequest([{supportedMethods:e}],{id:"0",total:{label:"Item",amount:{currency:"USD",value:"1.00"}}}).canMakePayment();const G=()=>X("https://apple.com/apple-pay"),J=()=>X("https://google.com/pay"),K={component:()=>{let{wallets:r}=F(),{connectors:v}=C(),W=v.filter(f).flatMap((e=>e.wallets)),{navigate:S,data:x,setModalData:I}=w(),{client:D}=C(),T=m(),A=x?.funding,j=V(G),k=V(J),L="solana"===A.chainType,U=L?void 0:A,N=d((()=>((e,n,t,a,i,o)=>{let r,c,d="solana"===t.chainType,s=d?void 0:t,l=t.isUSDC?"USDC":s?.erc20Address?void 0:"native-currency",h=!!d||l&&z(Number(t.chain.id),l),p=!!d||l&&E(Number(t.chain.id),l),u=[];for(let r of(t.preferredCardProvider&&t.supportedOptions.sort((e=>e.provider===t.preferredCardProvider?-1:1)),t.supportedOptions))"card"===r.method&&"coinbase"===r.provider&&p&&u.push((()=>Q(n,t,a,i,o,"buy"))),"card"===r.method&&"moonpay"===r.provider&&h&&l&&u.push((()=>$(n,t,e,l,a,i,o,"credit_debit_card")));for(let e of t.supportedOptions)"exchange"===e.method&&"coinbase"===e.provider&&p&&(r=()=>Q(n,t,a,i,o,"buy"));for(let e of o?.funding?.supportedOptions??[])"wallets"===e.method&&(c=()=>i("TransferFromWalletScreen"));return{onFundWithCard:u,onFundWithExchange:r,onFundWithWallet:c}})(T,D,A,I,S,x)),[T,D,A,x,I,S]),q=L?W.find((({address:e})=>e===A.address)):r.find((({address:e})=>s(e)===s(A.address))),X=g(q?.walletClientType||"unknown"),K=X?.name||"wallet",Y=q&&"privy"!==q.walletClientType?K:T.name,Z=d((()=>A.uiConfig?.landing?.title?A.uiConfig?.landing?.title:`Add funds to your ${Y?.toLowerCase().endsWith("wallet")?Y:Y+" wallet"}`),[A.uiConfig?.landing?.title,Y]);c((()=>{if(A?.defaultFundingMethod&&A.usingDefaultFundingMethod)switch(I({funding:{...A,usingDefaultFundingMethod:!1},solanaFundingData:x?.solanaFundingData}),A?.defaultFundingMethod){case"card":N.onFundWithCard[0]&&N.onFundWithCard[0]();break;case"exchange":N.onFundWithExchange&&N.onFundWithExchange();break;case"wallet":N.onFundWithWallet&&N.onFundWithWallet();break;case"manual":S("ManualTransferScreen")}}),[]),c((()=>{U?.erc20Address&&!U.erc20ContractInfo&&b({address:U.erc20Address,chain:U.chain,rpcConfig:T.rpcConfig,privyAppId:T.id}).then((e=>{I({...x,funding:{...U,erc20ContractInfo:e?{symbol:e.symbol,decimals:e.decimals}:void 0}})})).catch(console.error)}),[U?.erc20Address,U?.chain]);let ee=!(!U?.erc20Address||U?.erc20ContractInfo);/*#__PURE__*/return n(t,{children:[/*#__PURE__*/e(h,{}),/*#__PURE__*/e("h3",{children:Z}),/*#__PURE__*/n(O,{children:[A.errorMessage&&/*#__PURE__*/e(p,{theme:T.appearance.palette.colorScheme,children:A.errorMessage}),N.onFundWithCard?.[0]&&/*#__PURE__*/n(y,{disabled:ee,onClick:N.onFundWithCard[0],children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(a,{style:{width:24}})}),"Pay with card",j?/*#__PURE__*/e(B,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):k?/*#__PURE__*/e(R,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):null]}),N.onFundWithExchange&&/*#__PURE__*/n(y,{disabled:ee,onClick:N.onFundWithExchange,children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(o,{style:{width:24}})}),"Transfer from an exchange"]}),N.onFundWithWallet&&/*#__PURE__*/n(y,{disabled:ee,onClick:N.onFundWithWallet,children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(M,{style:{width:24}})}),"Transfer from wallet"]}),/*#__PURE__*/n(y,{disabled:ee,onClick:()=>S("ManualTransferScreen"),children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(i,{style:{width:24}})}),"Receive funds"]}),A?.showAlternateFundingMethod&&N.onFundWithCard?.[1]&&/*#__PURE__*/e(u,{theme:T.appearance.palette.colorScheme,children:/*#__PURE__*/n(H,{children:["Having trouble or facing location restrictions?"," ",/*#__PURE__*/e(P,{onClick:N.onFundWithCard[1],children:"Try a different provider."})]})})]}),/*#__PURE__*/e(l,{})]})}};export{K as FundingMethodSelectionScreen,K as default};
1
+ import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/CreditCardIcon";import i from"@heroicons/react/24/outline/QrCodeIcon";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import{useState as r,useEffect as c,useMemo as d}from"react";import{getAddress as s}from"viem/utils";import{B as l}from"./ModalHeader-B27O6soE.mjs";import{t as h}from"./FundWalletMethodHeader-C0uPKdYw.mjs";import{E as p}from"./ErrorBanner-BdiArMwu.mjs";import{I as u}from"./InfoBanner-D6C6Bt8L.mjs";import{u as m}from"./context-BqHnoxK5.mjs";import{v as f,Q as g,U as y}from"./useActiveWallet-CBIiGG1k.mjs";import{a as v,u as C}from"./internal-context-e-Eni5bG.mjs";import{a as w}from"./get-is-unified-wallet-GLvRyJlT.mjs";import{u as F}from"./useWallets-Aw21dxK9.mjs";import{W as M}from"./WalletCards-DH1rqayz.mjs";import{g as b}from"./getErc20TokenInfo-BFoeg5F6.mjs";import{avalanche as W,arbitrum as S,polygon as x,optimism as I,base as D,mainnet as T,toCoinbaseAssetId as A,getCoinbaseOnRampUrl as j,chainToMoonpayCurrency as k,isSupportedChainIdForMoonpay as z,isSupportedChainIdForCoinbaseOnramp as E}from"@privy-io/js-sdk-core";import{trigger as L}from"@privy-io/popup";import{a as U}from"./index-DT54fwyL.mjs";import{e as O,I as _,f as H,g as P}from"./styles-DY17fuAX.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"tinycolor2";import"zustand";import"react-device-detect";import"./prepareFundingModalData-lYYA8ZfI.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-A9RSftUZ.mjs";import"ofetch";import"./analytics-mkkvFRju.mjs";const B=n=>/*#__PURE__*/e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 210.2",xmlSpace:"preserve",...n,children:/*#__PURE__*/e("path",{d:"M93.6,27.1C87.6,34.2,78,39.8,68.4,39c-1.2-9.6,3.5-19.8,9-26.1c6-7.3,16.5-12.5,25-12.9 C103.4,10,99.5,19.8,93.6,27.1 M102.3,40.9c-13.9-0.8-25.8,7.9-32.4,7.9c-6.7,0-16.8-7.5-27.8-7.3c-14.3,0.2-27.6,8.3-34.9,21.2 c-15,25.8-3.9,64,10.6,85c7.1,10.4,15.6,21.8,26.8,21.4c10.6-0.4,14.8-6.9,27.6-6.9c12.9,0,16.6,6.9,27.8,6.7 c11.6-0.2,18.9-10.4,26-20.8c8.1-11.8,11.4-23.3,11.6-23.9c-0.2-0.2-22.4-8.7-22.6-34.3c-0.2-21.4,17.5-31.6,18.3-32.2 C123.3,42.9,107.7,41.3,102.3,40.9 M182.6,11.9v155.9h24.2v-53.3h33.5c30.6,0,52.1-21,52.1-51.4c0-30.4-21.1-51.2-51.3-51.2H182.6z M206.8,32.3h27.9c21,0,33,11.2,33,30.9c0,19.7-12,31-33.1,31h-27.8V32.3z M336.6,169c15.2,0,29.3-7.7,35.7-19.9h0.5v18.7h22.4V90.2 c0-22.5-18-37-45.7-37c-25.7,0-44.7,14.7-45.4,34.9h21.8c1.8-9.6,10.7-15.9,22.9-15.9c14.8,0,23.1,6.9,23.1,19.6v8.6l-30.2,1.8 c-28.1,1.7-43.3,13.2-43.3,33.2C298.4,155.6,314.1,169,336.6,169z M343.1,150.5c-12.9,0-21.1-6.2-21.1-15.7c0-9.8,7.9-15.5,23-16.4 l26.9-1.7v8.8C371.9,140.1,359.5,150.5,343.1,150.5z M425.1,210.2c23.6,0,34.7-9,44.4-36.3L512,54.7h-24.6l-28.5,92.1h-0.5 l-28.5-92.1h-25.3l41,113.5l-2.2,6.9c-3.7,11.7-9.7,16.2-20.4,16.2c-1.9,0-5.6-0.2-7.1-0.4v18.7C417.3,210,423.3,210.2,425.1,210.2z"})}),R=t=>/*#__PURE__*/n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 38.1",xmlSpace:"preserve",...t,children:[/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M37.8,19.7V29h-3V6h7.8c1.9,0,3.7,0.7,5.1,2c1.4,1.2,2.1,3,2.1,4.9c0,1.9-0.7,3.6-2.1,4.9c-1.4,1.3-3.1,2-5.1,2 L37.8,19.7L37.8,19.7z M37.8,8.8v8h5c1.1,0,2.2-0.4,2.9-1.2c1.6-1.5,1.6-4,0.1-5.5c0,0-0.1-0.1-0.1-0.1c-0.8-0.8-1.8-1.3-2.9-1.2 L37.8,8.8L37.8,8.8z"}),/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M56.7,12.8c2.2,0,3.9,0.6,5.2,1.8s1.9,2.8,1.9,4.8V29H61v-2.2h-0.1c-1.2,1.8-2.9,2.7-4.9,2.7 c-1.7,0-3.2-0.5-4.4-1.5c-1.1-1-1.8-2.4-1.8-3.9c0-1.6,0.6-2.9,1.8-3.9c1.2-1,2.9-1.4,4.9-1.4c1.8,0,3.2,0.3,4.3,1v-0.7 c0-1-0.4-2-1.2-2.6c-0.8-0.7-1.8-1.1-2.9-1.1c-1.7,0-3,0.7-3.9,2.1l-2.6-1.6C51.8,13.8,53.9,12.8,56.7,12.8z M52.9,24.2 c0,0.8,0.4,1.5,1,1.9c0.7,0.5,1.5,0.8,2.3,0.8c1.2,0,2.4-0.5,3.3-1.4c1-0.9,1.5-2,1.5-3.2c-0.9-0.7-2.2-1.1-3.9-1.1 c-1.2,0-2.2,0.3-3,0.9C53.3,22.6,52.9,23.3,52.9,24.2z"}),/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M80,13.3l-9.9,22.7h-3l3.7-7.9l-6.5-14.7h3.2l4.7,11.3h0.1l4.6-11.3H80z"}),/*#__PURE__*/e("path",{style:{fill:"#4285F4"},d:"M25.9,17.7c0-0.9-0.1-1.8-0.2-2.7H13.2v5.1h7.1c-0.3,1.6-1.2,3.1-2.6,4v3.3H22C24.5,25.1,25.9,21.7,25.9,17.7z"}),/*#__PURE__*/e("path",{style:{fill:"#34A853"},d:"M13.2,30.6c3.6,0,6.6-1.2,8.8-3.2l-4.3-3.3c-1.2,0.8-2.7,1.3-4.5,1.3c-3.4,0-6.4-2.3-7.4-5.5H1.4v3.4 C3.7,27.8,8.2,30.6,13.2,30.6z"}),/*#__PURE__*/e("path",{style:{fill:"#FBBC04"},d:"M5.8,19.9c-0.6-1.6-0.6-3.4,0-5.1v-3.4H1.4c-1.9,3.7-1.9,8.1,0,11.9L5.8,19.9z"}),/*#__PURE__*/e("path",{style:{fill:"#EA4335"},d:"M13.2,9.4c1.9,0,3.7,0.7,5.1,2l0,0l3.8-3.8c-2.4-2.2-5.6-3.5-8.8-3.4c-5,0-9.6,2.8-11.8,7.3l4.4,3.4 C6.8,11.7,9.8,9.4,13.2,9.4z"})]}),V=e=>{let[n,t]=r();return c((()=>{e().then((e=>{t(e)})).catch((()=>{}))}),[]),n};function N(e){let n=q[e];if(!n)throw new v(`Unsupported chainId: ${e} for Coinbase Onramp`);return n}let q={[T.id]:"ethereum",[D.id]:"base",[I.id]:"optimism",[x.id]:"polygon",[S.id]:"arbitrum",[W.id]:"avacchain"};const Q=(e,n,t,a,i,o)=>new Promise((async(r,c)=>{let d=L();if(!d)return void c(Error("Unable to initialize flow"));let s="ethereum"===n.chainType?N(n.chain.id):"solana",l=n.isUSDC?"USDC":"ethereum"===n.chainType?A(n.chain.id,"native-currency"):"SOL",h=await e.initCoinbaseOnRamp({addresses:[{address:n.address,blockchains:[s]}],assets:[l]}),{url:p}=j({appId:e.getAppId(),input:h,amount:n.amount,blockchain:s,asset:l,experience:o});d.location=p.toString();let u={...i?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(u.usingDefaultFundingMethod=!1),t({funding:u,solanaFundingData:i?.solanaFundingData,coinbaseOnrampStatus:{popup:d}}),a("CoinbaseOnrampStatusScreen"),e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp",value:n.amount,chainType:n.chainType,chainId:"ethereum"===n.chainType?n.chain.id:n.chain}}),setTimeout((()=>{t({funding:u,solanaFundingData:i?.solanaFundingData,coinbaseOnrampStatus:{partnerUserId:h.partner_user_id,popup:d}})}),5e3),r()})),$=async(e,n,t,a,i,o,r,c)=>{let d=L();if(!d)throw Error("Unable to initialize flow");let s="ethereum"===n.chainType?k(n.chain.id,a):n.isUSDC?"USDC_SOL":"SOL",{signedUrl:l,externalTransactionId:h}=await e.signMoonpayOnRampUrl({address:n.address,useSandbox:t.fundingMethodConfig.moonpay.useSandbox??!1,config:{uiConfig:{accentColor:t.appearance.palette.accent,theme:t.appearance.palette.colorScheme},paymentMethod:c,currencyCode:s,quoteCurrencyAmount:U(n.amount)}});e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"moonpay",value:n.amount,chainType:n.chainType,chainId:"ethereum"===n.chainType?n.chain.id:n.chain}}),d.location=l;let p={...r?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(p.usingDefaultFundingMethod=!1),i({moonpayStatus:{},funding:p,solanaFundingData:r?.solanaFundingData}),o("MoonpayStatusScreen"),setTimeout((()=>{i({moonpayStatus:{externalTransactionId:h},funding:p,solanaFundingData:r?.solanaFundingData})}),8e3)};let X=async e=>"undefined"!=typeof window&&"PaymentRequest"in window&&await new window.PaymentRequest([{supportedMethods:e}],{id:"0",total:{label:"Item",amount:{currency:"USD",value:"1.00"}}}).canMakePayment();const G=()=>X("https://apple.com/apple-pay"),J=()=>X("https://google.com/pay"),K={component:()=>{let{wallets:r}=F(),{connectors:v}=C(),W=v.filter(f).flatMap((e=>e.wallets)),{navigate:S,data:x,setModalData:I}=w(),{client:D}=C(),T=m(),A=x?.funding,j=V(G),k=V(J),L="solana"===A.chainType,U=L?void 0:A,N=d((()=>((e,n,t,a,i,o)=>{let r,c,d="solana"===t.chainType,s=d?void 0:t,l=t.isUSDC?"USDC":s?.erc20Address?void 0:"native-currency",h=!!d||l&&z(Number(t.chain.id),l),p=!!d||l&&E(Number(t.chain.id),l),u=[];for(let r of(t.preferredCardProvider&&t.supportedOptions.sort((e=>e.provider===t.preferredCardProvider?-1:1)),t.supportedOptions))"card"===r.method&&"coinbase"===r.provider&&p&&u.push((()=>Q(n,t,a,i,o,"buy"))),"card"===r.method&&"moonpay"===r.provider&&h&&l&&u.push((()=>$(n,t,e,l,a,i,o,"credit_debit_card")));for(let e of t.supportedOptions)"exchange"===e.method&&"coinbase"===e.provider&&p&&(r=()=>Q(n,t,a,i,o,"buy"));for(let e of o?.funding?.supportedOptions??[])"wallets"===e.method&&(c=()=>i("TransferFromWalletScreen"));return{onFundWithCard:u,onFundWithExchange:r,onFundWithWallet:c}})(T,D,A,I,S,x)),[T,D,A,x,I,S]),q=L?W.find((({address:e})=>e===A.address)):r.find((({address:e})=>s(e)===s(A.address))),X=g(q?.walletClientType||"unknown"),K=X?.name||"wallet",Y=q&&"privy"!==q.walletClientType?K:T.name,Z=d((()=>A.uiConfig?.landing?.title?A.uiConfig?.landing?.title:`Add funds to your ${Y?.toLowerCase().endsWith("wallet")?Y:Y+" wallet"}`),[A.uiConfig?.landing?.title,Y]);c((()=>{if(A?.defaultFundingMethod&&A.usingDefaultFundingMethod)switch(I({funding:{...A,usingDefaultFundingMethod:!1},solanaFundingData:x?.solanaFundingData}),A?.defaultFundingMethod){case"card":N.onFundWithCard[0]&&N.onFundWithCard[0]();break;case"exchange":N.onFundWithExchange&&N.onFundWithExchange();break;case"wallet":N.onFundWithWallet&&N.onFundWithWallet();break;case"manual":S("ManualTransferScreen")}}),[]),c((()=>{U?.erc20Address&&!U.erc20ContractInfo&&b({address:U.erc20Address,chain:U.chain,rpcConfig:T.rpcConfig,privyAppId:T.id}).then((e=>{I({...x,funding:{...U,erc20ContractInfo:e?{symbol:e.symbol,decimals:e.decimals}:void 0}})})).catch(console.error)}),[U?.erc20Address,U?.chain]);let ee=!(!U?.erc20Address||U?.erc20ContractInfo);/*#__PURE__*/return n(t,{children:[/*#__PURE__*/e(h,{}),/*#__PURE__*/e("h3",{children:Z}),/*#__PURE__*/n(O,{children:[A.errorMessage&&/*#__PURE__*/e(p,{theme:T.appearance.palette.colorScheme,children:A.errorMessage}),N.onFundWithCard?.[0]&&/*#__PURE__*/n(y,{disabled:ee,onClick:N.onFundWithCard[0],children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(a,{style:{width:24}})}),"Pay with card",j?/*#__PURE__*/e(B,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):k?/*#__PURE__*/e(R,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):null]}),N.onFundWithExchange&&/*#__PURE__*/n(y,{disabled:ee,onClick:N.onFundWithExchange,children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(o,{style:{width:24}})}),"Transfer from an exchange"]}),N.onFundWithWallet&&/*#__PURE__*/n(y,{disabled:ee,onClick:N.onFundWithWallet,children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(M,{style:{width:24}})}),"Transfer from wallet"]}),/*#__PURE__*/n(y,{disabled:ee,onClick:()=>S("ManualTransferScreen"),children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(i,{style:{width:24}})}),"Receive funds"]}),A?.showAlternateFundingMethod&&N.onFundWithCard?.[1]&&/*#__PURE__*/e(u,{theme:T.appearance.palette.colorScheme,children:/*#__PURE__*/n(H,{children:["Having trouble or facing location restrictions?"," ",/*#__PURE__*/e(P,{onClick:N.onFundWithCard[1],children:"Try a different provider."})]})})]}),/*#__PURE__*/e(l,{})]})}};export{K as FundingMethodSelectionScreen,K as default};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import r from"@hcaptcha/react-hcaptcha";const t=({delayedExecution:t,captchaContext:o,...a})=>{let{setError:c,setToken:i,setExecuting:n,execute:s,siteKey:p,ref:d}=o;/*#__PURE__*/return e(r,{ref:d,sitekey:p??"",size:"invisible",onLoad:()=>{t||s()},onVerify:e=>{a.onSuccess?.(e),i(e),n(!1)},onError:e=>{a.onError?.(e),c("Captcha failed"),n(!1)},onExpire:()=>{a.onExpire?.("");try{d.current?.resetCaptcha(),c(void 0),i(void 0)}catch(e){c("expired_and_failed_reset")}}})};export{t as HCaptchaWrapper,t as default};
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{ExternalLink as o}from"lucide-react";import{u as e}from"./internal-context-e-Eni5bG.mjs";import{S as r}from"./ScreenLayout-t3qtbQ3-.mjs";import"ofetch";import"react";import"./Button-CrJpeX0e.mjs";import"styled-components";import"./useActiveWallet-BdFIc7_K.mjs";import"zustand";import"./context-BOoFAPna.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"react-device-detect";import"./prepareFundingModalData-CzDMa8gy.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./get-is-unified-wallet-Ca5aEojK.mjs";import"./useWallets-3r4yfFNg.mjs";import"./Screen-CpIMiJNF.mjs";import"./ModalHeader-YP9pLMEP.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 i=({onClose:e})=>/*#__PURE__*/t(r,{title:"Could not log in with provider",subtitle:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",icon:o,primaryCta:{label:"Close",onClick:e},watermark:!0}),m={component:()=>{let{closePrivyModal:o}=e();/*#__PURE__*/return t(i,{onClose:()=>o()})}};export{m as InAppBrowserLoginNotPossible,i as InAppBrowserLoginNotPossibleView,m as default};
1
+ import{jsx as t}from"react/jsx-runtime";import{ExternalLink as o}from"lucide-react";import{u as e}from"./internal-context-e-Eni5bG.mjs";import{S as r}from"./ScreenLayout-Dp0ezg8Q.mjs";import"ofetch";import"react";import"./Button-3JMVXKiE.mjs";import"styled-components";import"./useActiveWallet-CBIiGG1k.mjs";import"zustand";import"./context-BqHnoxK5.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"react-device-detect";import"./prepareFundingModalData-lYYA8ZfI.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./get-is-unified-wallet-GLvRyJlT.mjs";import"./useWallets-Aw21dxK9.mjs";import"./Screen-Bj-1pwMI.mjs";import"./ModalHeader-B27O6soE.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 i=({onClose:e})=>/*#__PURE__*/t(r,{title:"Could not log in with provider",subtitle:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",icon:o,primaryCta:{label:"Close",onClick:e},watermark:!0}),m={component:()=>{let{closePrivyModal:o}=e();/*#__PURE__*/return t(i,{onClose:()=>o()})}};export{m as InAppBrowserLoginNotPossible,i as InAppBrowserLoginNotPossibleView,m as default};
@@ -1 +1 @@
1
- import{jsx as t,jsxs as e,Fragment as o}from"react/jsx-runtime";import{L as r}from"./Link-DwjLfHwW.mjs";import{T as i,a}from"./TodoList-Dn0Qu-vv.mjs";import{a as l}from"./get-is-unified-wallet-Ca5aEojK.mjs";import{S as n}from"./ScreenLayout-t3qtbQ3-.mjs";import"styled-components";import"lucide-react";import"react";import"viem";import"./context-BOoFAPna.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"./Button-CrJpeX0e.mjs";import"./useActiveWallet-BdFIc7_K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CzDMa8gy.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-3r4yfFNg.mjs";import"./Screen-CpIMiJNF.mjs";import"./ModalHeader-YP9pLMEP.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 s=({walletName:l,installLink:s,title:m,subtitle:c="Follow the instructions below to get started.",onReload:p,onBack:d})=>{let h=m||`Create a ${l} wallet`.replace(/wallet wallet/gi,"wallet");/*#__PURE__*/return t(n,{title:h,subtitle:c,onBack:d,showBack:!0,primaryCta:{label:"Reload the page to use your wallet",onClick:p},helpText:/*#__PURE__*/e(o,{children:[/*#__PURE__*/t("span",{children:"Still not sure? "}),/*#__PURE__*/t(r,{size:"sm",target:"_blank",href:"https://solana.com/docs/intro/wallets",children:"Learn more"})]}),watermark:!0,children:/*#__PURE__*/e(i,{children:[/*#__PURE__*/t(a,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/t("span",{children:"Install the "})," ",/*#__PURE__*/e(r,{href:s,target:"_blank",children:[l," browser extension"]})]})}),/*#__PURE__*/t(a,{children:"Set up your first wallet"}),/*#__PURE__*/t(a,{children:"Store your recovery phrase in a safe place!"})]})})},m={component:()=>{let{navigateBack:e,data:o}=l();if(!o?.installWalletModalData)throw Error("Wallet data is missing");let{walletConfig:r}=o.installWalletModalData;/*#__PURE__*/return t(s,{walletName:r.name,installLink:r.installLink,onReload:()=>{window.location.reload()},onBack:e})}};export{m as InstallWalletScreen,s as InstallWalletScreenView,m as default};
1
+ import{jsx as t,jsxs as e,Fragment as o}from"react/jsx-runtime";import{L as r}from"./Link-DwjLfHwW.mjs";import{T as i,a}from"./TodoList-Dn0Qu-vv.mjs";import{a as l}from"./get-is-unified-wallet-GLvRyJlT.mjs";import{S as n}from"./ScreenLayout-Dp0ezg8Q.mjs";import"styled-components";import"lucide-react";import"react";import"viem";import"./context-BqHnoxK5.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"./Button-3JMVXKiE.mjs";import"./useActiveWallet-CBIiGG1k.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-lYYA8ZfI.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-Aw21dxK9.mjs";import"./Screen-Bj-1pwMI.mjs";import"./ModalHeader-B27O6soE.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 s=({walletName:l,installLink:s,title:m,subtitle:c="Follow the instructions below to get started.",onReload:p,onBack:d})=>{let h=m||`Create a ${l} wallet`.replace(/wallet wallet/gi,"wallet");/*#__PURE__*/return t(n,{title:h,subtitle:c,onBack:d,showBack:!0,primaryCta:{label:"Reload the page to use your wallet",onClick:p},helpText:/*#__PURE__*/e(o,{children:[/*#__PURE__*/t("span",{children:"Still not sure? "}),/*#__PURE__*/t(r,{size:"sm",target:"_blank",href:"https://solana.com/docs/intro/wallets",children:"Learn more"})]}),watermark:!0,children:/*#__PURE__*/e(i,{children:[/*#__PURE__*/t(a,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/t("span",{children:"Install the "})," ",/*#__PURE__*/e(r,{href:s,target:"_blank",children:[l," browser extension"]})]})}),/*#__PURE__*/t(a,{children:"Set up your first wallet"}),/*#__PURE__*/t(a,{children:"Store your recovery phrase in a safe place!"})]})})},m={component:()=>{let{navigateBack:e,data:o}=l();if(!o?.installWalletModalData)throw Error("Wallet data is missing");let{walletConfig:r}=o.installWalletModalData;/*#__PURE__*/return t(s,{walletName:r.name,installLink:r.installLink,onReload:()=>{window.location.reload()},onBack:e})}};export{m as InstallWalletScreen,s as InstallWalletScreenView,m as default};
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{u as o}from"./context-BOoFAPna.mjs";import{C as r,L as i}from"./CustomLandingScreenView-CKarTBuo.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-YP9pLMEP.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"./useActiveWallet-BdFIc7_K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CzDMa8gy.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./get-is-unified-wallet-Ca5aEojK.mjs";import"./useWallets-3r4yfFNg.mjs";import"./index-CUao1WyN.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-CeQ3C1KS.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"./ConnectWalletView-Ch6TwKX_.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"./Button-CrJpeX0e.mjs";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./Link-DwjLfHwW.mjs";import"./QrCode-C0_lXRph.mjs";import"qrcode";import"./EmailInputForm-B4hjCxRU.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./useI18n-fcpgyVzo.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-CpIMiJNF.mjs";import"./index-CJMgUOnw.mjs";import"lucide-react";import"./ConnectEmailForm-CzIQouaK.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./farcaster-DPlSjvF5.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./ConnectPhoneForm-BeT3tDQM.mjs";import"./twitter-6jomarO4.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletOverflowButton-gDOg31Q5.mjs";import"./ScreenLayout-t3qtbQ3-.mjs";const e={component:()=>{let e=o();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?/*#__PURE__*/t(r,{connectOnly:!1}):/*#__PURE__*/t(i,{connectOnly:!1})},isCaptchaRequired:!0,isUnauthenticatedScreem:!0};export{e as LandingScreen,e as default};
1
+ import{jsx as t}from"react/jsx-runtime";import{u as o}from"./context-BqHnoxK5.mjs";import{C as r,L as i}from"./CustomLandingScreenView-DOwh2oce.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-B27O6soE.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"./useActiveWallet-CBIiGG1k.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-lYYA8ZfI.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./get-is-unified-wallet-GLvRyJlT.mjs";import"./useWallets-Aw21dxK9.mjs";import"./index-B24hEnAn.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-C5z76Qhs.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"./ConnectWalletView-D3ZQBnjF.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"./Button-3JMVXKiE.mjs";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./Link-DwjLfHwW.mjs";import"./QrCode-CGBH7ZqU.mjs";import"qrcode";import"./EmailInputForm-B4hjCxRU.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./useI18n-BotQj3s2.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-Bj-1pwMI.mjs";import"./index-CJMgUOnw.mjs";import"lucide-react";import"./ConnectEmailForm-o04NTrIc.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./farcaster-DPlSjvF5.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./ConnectPhoneForm-CK2ZaLcy.mjs";import"./twitter-BoAxhlj6.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletOverflowButton-yerFFdMA.mjs";import"./ScreenLayout-Dp0ezg8Q.mjs";const e={component:()=>{let e=o();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?/*#__PURE__*/t(r,{connectOnly:!1}):/*#__PURE__*/t(i,{connectOnly:!1})},isCaptchaRequired:!0,isUnauthenticatedScreem:!0};export{e as LandingScreen,e as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as r,Fragment as o}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/ExclamationTriangleIcon";import n from"@heroicons/react/24/outline/WalletIcon";import{useState as i}from"react";import{P as a,S as c}from"./Button-CrJpeX0e.mjs";import{styled as s}from"styled-components";import{M as l,B as d}from"./ModalHeader-YP9pLMEP.mjs";import{e as p}from"./StackedContainer-BrIQsdas.mjs";import{A as u}from"./Address-BZeOq9QH.mjs";import{u as m}from"./internal-context-e-Eni5bG.mjs";import{a as h}from"./get-is-unified-wallet-Ca5aEojK.mjs";import{e as f}from"./capitalizeFirstLetter-DmLYqXsO.mjs";import{u as g}from"./context-BOoFAPna.mjs";import y from"@heroicons/react/24/outline/ExclamationCircleIcon";import x from"@heroicons/react/24/outline/Square2StackIcon";import"./useActiveWallet-BdFIc7_K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CzDMa8gy.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-3r4yfFNg.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"lucide-react";import"ofetch";import"tinycolor2";const b=/*#__PURE__*/s.span.withConfig({displayName:"CircleBorder",componentId:"sc-9056b8b8-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1.2s linear infinite;transition:border-color 800ms;border-bottom-color:",";}"],(e=>e.color??"var(--privy-color-accent)"),(e=>e.color??"var(--privy-color-accent)"));function w(o){/*#__PURE__*/return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...o,children:[/*#__PURE__*/r("circle",{cx:"12",cy:"12",r:"10"}),/*#__PURE__*/r("line",{x1:"12",x2:"12",y1:"8",y2:"12"}),/*#__PURE__*/r("line",{x1:"12",x2:"12.01",y1:"16",y2:"16"})]})}const v=({onTransfer:e,isTransferring:o,transferSuccess:t})=>/*#__PURE__*/r(a,{...t?{success:!0,children:"Success!"}:{warn:!0,loading:o,onClick:e,children:"Transfer and delete account"}}),C=/*#__PURE__*/s.div.withConfig({displayName:"ConnectContainer",componentId:"sc-3505eb4c-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;width:100%;padding-bottom:16px;"]),T=/*#__PURE__*/s.div.withConfig({displayName:"GappedContainer",componentId:"sc-3505eb4c-1"})(["display:flex;flex-direction:column;&& p{font-size:14px;}width:100%;gap:16px;"]),k=/*#__PURE__*/s.div.withConfig({displayName:"DisclosedAccountContainer",componentId:"sc-3505eb4c-2"})(["display:flex;cursor:pointer;align-items:center;width:100%;border:1px solid var(--privy-color-foreground-4) !important;border-radius:var(--privy-border-radius-md);padding:8px 10px;font-size:14px;font-weight:500;gap:8px;"]),I=/*#__PURE__*/s(y).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-3505eb4c-3"})(["position:relative;width:",";height:",";color:var(--privy-color-foreground-3);margin-left:auto;"],(({$iconSize:e})=>`${e}px`),(({$iconSize:e})=>`${e}px`)),A=/*#__PURE__*/s(x).withConfig({displayName:"StyledCopyIcon",componentId:"sc-3505eb4c-4"})(["position:relative;width:15px;height:15px;color:var(--privy-color-foreground-3);margin-left:auto;"]),S=/*#__PURE__*/s.ol.withConfig({displayName:"ListContainer",componentId:"sc-3505eb4c-5"})(["display:flex;flex-direction:column;font-size:14px;width:100%;text-align:left;"]),j=/*#__PURE__*/s.li.withConfig({displayName:"ListItem",componentId:"sc-3505eb4c-6"})(["font-size:14px;list-style-type:auto;list-style-position:outside;margin-left:1rem;margin-bottom:0.5rem;&:last-child{margin-bottom:0;}"]),W=/*#__PURE__*/s.div.withConfig({displayName:"CircleContainer",componentId:"sc-3505eb4c-7"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]);let M=()=>/*#__PURE__*/r(W,{children:/*#__PURE__*/r(I,{$iconSize:60})});const N=({address:t,onClose:i,onRetry:a,onTransfer:c,isTransferring:s,transferSuccess:p})=>{let{defaultChain:m}=g(),h=m.blockExplorers?.default.url??"https://etherscan.io";/*#__PURE__*/return e(o,{children:[/*#__PURE__*/r(l,{onClose:i,backFn:a}),/*#__PURE__*/e(C,{children:[/*#__PURE__*/r(M,{}),/*#__PURE__*/e(T,{children:[/*#__PURE__*/r("h3",{children:"Check account assets before transferring"}),/*#__PURE__*/r("p",{children:"Before transferring, ensure there are no assets in the other account. Assets in that account will not transfer automatically and may be lost."}),/*#__PURE__*/e(S,{children:[/*#__PURE__*/r("p",{children:" To check your balance, you can:"}),/*#__PURE__*/r(j,{children:"Log out and log back into the other account, or "}),/*#__PURE__*/e(j,{children:["Copy your wallet address and use a"," ",/*#__PURE__*/r("u",{children:/*#__PURE__*/r("a",{target:"_blank",href:h,children:"block explorer"})})," ","to see if the account holds any assets."]})]}),/*#__PURE__*/e(k,{onClick:()=>navigator.clipboard.writeText(t).catch(console.error),children:[/*#__PURE__*/r(n,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),/*#__PURE__*/r(u,{address:t,showCopyIcon:!1}),/*#__PURE__*/r(A,{})]}),/*#__PURE__*/r(v,{onTransfer:c,isTransferring:s,transferSuccess:p})]})]}),/*#__PURE__*/r(d,{})]})},z={component:()=>{let{initiateAccountTransfer:e,closePrivyModal:o}=m(),{data:t,navigate:n,lastScreen:a,setModalData:c}=h(),[s,l]=i(void 0),[d,p]=i(!1),[u,f]=i(!1),g=async()=>{try{if(!t?.accountTransfer?.nonce||!t?.accountTransfer?.account)throw Error("missing account transfer inputs");f(!0),await e({nonce:t?.accountTransfer?.nonce,account:t?.accountTransfer?.account,accountType:t?.accountTransfer?.linkMethod,externalWalletMetadata:t?.accountTransfer?.externalWalletMetadata,telegramWebAppData:t?.accountTransfer?.telegramWebAppData,telegramAuthResult:t?.accountTransfer?.telegramAuthResult,farcasterEmbeddedAddress:t?.accountTransfer?.farcasterEmbeddedAddress,oAuthUserInfo:t?.accountTransfer?.oAuthUserInfo}),p(!0),f(!1),setTimeout(o,1e3)}catch(e){c({errorModalData:{error:e,previousScreen:a||"LinkConflictScreen"}}),n("ErrorScreen",!0)}};return s?/*#__PURE__*/r(N,{address:s,onClose:o,onRetry:()=>l(void 0),onTransfer:g,isTransferring:u,transferSuccess:d}):/*#__PURE__*/r(E,{onClose:o,onInfo:()=>l(t?.accountTransfer?.embeddedWalletAddress),onContinue:()=>l(t?.accountTransfer?.embeddedWalletAddress),onTransfer:g,isTransferring:u,transferSuccess:d,data:t})}},E=({onClose:n,onContinue:i,onInfo:s,onTransfer:u,transferSuccess:m,isTransferring:h,data:g})=>{if(!g?.accountTransfer?.linkMethod||!g?.accountTransfer?.displayName)return;let y={method:g?.accountTransfer?.linkMethod,handle:g?.accountTransfer?.displayName,disclosedAccount:g?.accountTransfer?.embeddedWalletAddress?{type:"wallet",handle:g?.accountTransfer?.embeddedWalletAddress}:void 0};/*#__PURE__*/return e(o,{children:[/*#__PURE__*/r(l,{closeable:!0}),/*#__PURE__*/e(C,{children:[/*#__PURE__*/r(p,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/r(b,{color:"var(--privy-color-error)"}),/*#__PURE__*/r(t,{height:38,width:38,stroke:"var(--privy-color-error)"})]})}),/*#__PURE__*/e(T,{children:[/*#__PURE__*/e("h3",{children:[function(e){switch(e){case"sms":return"Phone number";case"email":return"Email address";case"siwe":return"Wallet address";case"siws":return"Solana wallet address";case"linkedin":return"LinkedIn profile";case"google":case"apple":case"discord":case"github":case"instagram":case"spotify":case"tiktok":case"line":case"twitch":case"twitter":case"telegram":case"farcaster":return`${f(e.replace("_oauth",""))} profile`;default:return e.startsWith("privy:")?"Cross-app account":e}}(y.method)," is associated with another account"]}),/*#__PURE__*/e("p",{children:["Do you want to transfer",/*#__PURE__*/r("b",{children:y.handle?` ${y.handle}`:""})," to this account instead? This will delete your other account."]}),/*#__PURE__*/r(L,{onClick:s,disclosedAccount:y.disclosedAccount})]}),/*#__PURE__*/e(T,{style:{gap:12,marginTop:12},children:[g?.accountTransfer?.embeddedWalletAddress?/*#__PURE__*/r(a,{onClick:i,children:"Continue"}):/*#__PURE__*/r(v,{onTransfer:u,transferSuccess:m,isTransferring:h}),/*#__PURE__*/r(c,{onClick:n,children:"No thanks"})]})]}),/*#__PURE__*/r(d,{})]})};function L({disclosedAccount:o,onClick:t}){return o?/*#__PURE__*/e(k,{onClick:t,children:[/*#__PURE__*/r(n,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),/*#__PURE__*/r(u,{address:o.handle,showCopyIcon:!1}),/*#__PURE__*/r(w,{width:15,height:15,color:"var(--privy-color-foreground-3)",style:{marginLeft:"auto"}})]}):null}export{z as LinkConflictScreen,E as LinkConflictScreenView,z as default};
1
+ import{jsxs as e,jsx as r,Fragment as o}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/ExclamationTriangleIcon";import n from"@heroicons/react/24/outline/WalletIcon";import{useState as i}from"react";import{P as a,S as c}from"./Button-3JMVXKiE.mjs";import{styled as s}from"styled-components";import{M as l,B as d}from"./ModalHeader-B27O6soE.mjs";import{e as p}from"./StackedContainer-BrIQsdas.mjs";import{A as u}from"./Address-C2aXxM2N.mjs";import{u as m}from"./internal-context-e-Eni5bG.mjs";import{a as h}from"./get-is-unified-wallet-GLvRyJlT.mjs";import{e as f}from"./capitalizeFirstLetter-DmLYqXsO.mjs";import{u as g}from"./context-BqHnoxK5.mjs";import y from"@heroicons/react/24/outline/ExclamationCircleIcon";import x from"@heroicons/react/24/outline/Square2StackIcon";import"./useActiveWallet-CBIiGG1k.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-lYYA8ZfI.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-Aw21dxK9.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"lucide-react";import"ofetch";import"tinycolor2";const b=/*#__PURE__*/s.span.withConfig({displayName:"CircleBorder",componentId:"sc-9056b8b8-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1.2s linear infinite;transition:border-color 800ms;border-bottom-color:",";}"],(e=>e.color??"var(--privy-color-accent)"),(e=>e.color??"var(--privy-color-accent)"));function w(o){/*#__PURE__*/return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...o,children:[/*#__PURE__*/r("circle",{cx:"12",cy:"12",r:"10"}),/*#__PURE__*/r("line",{x1:"12",x2:"12",y1:"8",y2:"12"}),/*#__PURE__*/r("line",{x1:"12",x2:"12.01",y1:"16",y2:"16"})]})}const v=({onTransfer:e,isTransferring:o,transferSuccess:t})=>/*#__PURE__*/r(a,{...t?{success:!0,children:"Success!"}:{warn:!0,loading:o,onClick:e,children:"Transfer and delete account"}}),C=/*#__PURE__*/s.div.withConfig({displayName:"ConnectContainer",componentId:"sc-3505eb4c-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;width:100%;padding-bottom:16px;"]),T=/*#__PURE__*/s.div.withConfig({displayName:"GappedContainer",componentId:"sc-3505eb4c-1"})(["display:flex;flex-direction:column;&& p{font-size:14px;}width:100%;gap:16px;"]),k=/*#__PURE__*/s.div.withConfig({displayName:"DisclosedAccountContainer",componentId:"sc-3505eb4c-2"})(["display:flex;cursor:pointer;align-items:center;width:100%;border:1px solid var(--privy-color-foreground-4) !important;border-radius:var(--privy-border-radius-md);padding:8px 10px;font-size:14px;font-weight:500;gap:8px;"]),I=/*#__PURE__*/s(y).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-3505eb4c-3"})(["position:relative;width:",";height:",";color:var(--privy-color-foreground-3);margin-left:auto;"],(({$iconSize:e})=>`${e}px`),(({$iconSize:e})=>`${e}px`)),A=/*#__PURE__*/s(x).withConfig({displayName:"StyledCopyIcon",componentId:"sc-3505eb4c-4"})(["position:relative;width:15px;height:15px;color:var(--privy-color-foreground-3);margin-left:auto;"]),S=/*#__PURE__*/s.ol.withConfig({displayName:"ListContainer",componentId:"sc-3505eb4c-5"})(["display:flex;flex-direction:column;font-size:14px;width:100%;text-align:left;"]),j=/*#__PURE__*/s.li.withConfig({displayName:"ListItem",componentId:"sc-3505eb4c-6"})(["font-size:14px;list-style-type:auto;list-style-position:outside;margin-left:1rem;margin-bottom:0.5rem;&:last-child{margin-bottom:0;}"]),W=/*#__PURE__*/s.div.withConfig({displayName:"CircleContainer",componentId:"sc-3505eb4c-7"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]);let M=()=>/*#__PURE__*/r(W,{children:/*#__PURE__*/r(I,{$iconSize:60})});const N=({address:t,onClose:i,onRetry:a,onTransfer:c,isTransferring:s,transferSuccess:p})=>{let{defaultChain:m}=g(),h=m.blockExplorers?.default.url??"https://etherscan.io";/*#__PURE__*/return e(o,{children:[/*#__PURE__*/r(l,{onClose:i,backFn:a}),/*#__PURE__*/e(C,{children:[/*#__PURE__*/r(M,{}),/*#__PURE__*/e(T,{children:[/*#__PURE__*/r("h3",{children:"Check account assets before transferring"}),/*#__PURE__*/r("p",{children:"Before transferring, ensure there are no assets in the other account. Assets in that account will not transfer automatically and may be lost."}),/*#__PURE__*/e(S,{children:[/*#__PURE__*/r("p",{children:" To check your balance, you can:"}),/*#__PURE__*/r(j,{children:"Log out and log back into the other account, or "}),/*#__PURE__*/e(j,{children:["Copy your wallet address and use a"," ",/*#__PURE__*/r("u",{children:/*#__PURE__*/r("a",{target:"_blank",href:h,children:"block explorer"})})," ","to see if the account holds any assets."]})]}),/*#__PURE__*/e(k,{onClick:()=>navigator.clipboard.writeText(t).catch(console.error),children:[/*#__PURE__*/r(n,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),/*#__PURE__*/r(u,{address:t,showCopyIcon:!1}),/*#__PURE__*/r(A,{})]}),/*#__PURE__*/r(v,{onTransfer:c,isTransferring:s,transferSuccess:p})]})]}),/*#__PURE__*/r(d,{})]})},z={component:()=>{let{initiateAccountTransfer:e,closePrivyModal:o}=m(),{data:t,navigate:n,lastScreen:a,setModalData:c}=h(),[s,l]=i(void 0),[d,p]=i(!1),[u,f]=i(!1),g=async()=>{try{if(!t?.accountTransfer?.nonce||!t?.accountTransfer?.account)throw Error("missing account transfer inputs");f(!0),await e({nonce:t?.accountTransfer?.nonce,account:t?.accountTransfer?.account,accountType:t?.accountTransfer?.linkMethod,externalWalletMetadata:t?.accountTransfer?.externalWalletMetadata,telegramWebAppData:t?.accountTransfer?.telegramWebAppData,telegramAuthResult:t?.accountTransfer?.telegramAuthResult,farcasterEmbeddedAddress:t?.accountTransfer?.farcasterEmbeddedAddress,oAuthUserInfo:t?.accountTransfer?.oAuthUserInfo}),p(!0),f(!1),setTimeout(o,1e3)}catch(e){c({errorModalData:{error:e,previousScreen:a||"LinkConflictScreen"}}),n("ErrorScreen",!0)}};return s?/*#__PURE__*/r(N,{address:s,onClose:o,onRetry:()=>l(void 0),onTransfer:g,isTransferring:u,transferSuccess:d}):/*#__PURE__*/r(E,{onClose:o,onInfo:()=>l(t?.accountTransfer?.embeddedWalletAddress),onContinue:()=>l(t?.accountTransfer?.embeddedWalletAddress),onTransfer:g,isTransferring:u,transferSuccess:d,data:t})}},E=({onClose:n,onContinue:i,onInfo:s,onTransfer:u,transferSuccess:m,isTransferring:h,data:g})=>{if(!g?.accountTransfer?.linkMethod||!g?.accountTransfer?.displayName)return;let y={method:g?.accountTransfer?.linkMethod,handle:g?.accountTransfer?.displayName,disclosedAccount:g?.accountTransfer?.embeddedWalletAddress?{type:"wallet",handle:g?.accountTransfer?.embeddedWalletAddress}:void 0};/*#__PURE__*/return e(o,{children:[/*#__PURE__*/r(l,{closeable:!0}),/*#__PURE__*/e(C,{children:[/*#__PURE__*/r(p,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/r(b,{color:"var(--privy-color-error)"}),/*#__PURE__*/r(t,{height:38,width:38,stroke:"var(--privy-color-error)"})]})}),/*#__PURE__*/e(T,{children:[/*#__PURE__*/e("h3",{children:[function(e){switch(e){case"sms":return"Phone number";case"email":return"Email address";case"siwe":return"Wallet address";case"siws":return"Solana wallet address";case"linkedin":return"LinkedIn profile";case"google":case"apple":case"discord":case"github":case"instagram":case"spotify":case"tiktok":case"line":case"twitch":case"twitter":case"telegram":case"farcaster":return`${f(e.replace("_oauth",""))} profile`;default:return e.startsWith("privy:")?"Cross-app account":e}}(y.method)," is associated with another account"]}),/*#__PURE__*/e("p",{children:["Do you want to transfer",/*#__PURE__*/r("b",{children:y.handle?` ${y.handle}`:""})," to this account instead? This will delete your other account."]}),/*#__PURE__*/r(L,{onClick:s,disclosedAccount:y.disclosedAccount})]}),/*#__PURE__*/e(T,{style:{gap:12,marginTop:12},children:[g?.accountTransfer?.embeddedWalletAddress?/*#__PURE__*/r(a,{onClick:i,children:"Continue"}):/*#__PURE__*/r(v,{onTransfer:u,transferSuccess:m,isTransferring:h}),/*#__PURE__*/r(c,{onClick:n,children:"No thanks"})]})]}),/*#__PURE__*/r(d,{})]})};function L({disclosedAccount:o,onClick:t}){return o?/*#__PURE__*/e(k,{onClick:t,children:[/*#__PURE__*/r(n,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),/*#__PURE__*/r(u,{address:o.handle,showCopyIcon:!1}),/*#__PURE__*/r(w,{width:15,height:15,color:"var(--privy-color-foreground-3)",style:{marginLeft:"auto"}})]}):null}export{z as LinkConflictScreen,E as LinkConflictScreenView,z as default};
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import o from"@heroicons/react/24/outline/EnvelopeIcon";import{C as r}from"./ConnectEmailForm-CzIQouaK.mjs";import{B as i}from"./Layouts-Bmf8DxNP.mjs";import{u as e}from"./context-BOoFAPna.mjs";import{S as m}from"./ScreenLayout-t3qtbQ3-.mjs";import"lucide-react";import"react";import"styled-components";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"./index-CUao1WyN.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"./get-is-unified-wallet-Ca5aEojK.mjs";import"viem";import"eventemitter3";import"./useActiveWallet-BdFIc7_K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CzDMa8gy.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-3r4yfFNg.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CeQ3C1KS.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"./Button-CrJpeX0e.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./EmailInputForm-B4hjCxRU.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"tinycolor2";import"./Screen-CpIMiJNF.mjs";import"./ModalHeader-YP9pLMEP.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=({title:e="Connect your email",subtitle:p="Add your email to your account"})=>/*#__PURE__*/t(m,{title:e,subtitle:p,icon:o,watermark:!0,children:/*#__PURE__*/t(i,{children:/*#__PURE__*/t(r,{stacked:!0})})}),s={component:()=>{let o=e();/*#__PURE__*/return t(p,{subtitle:`Add your email to your ${o?.name} account`})}};export{s as LinkEmailScreen,p as LinkEmailScreenView,s as default};
1
+ import{jsx as t}from"react/jsx-runtime";import o from"@heroicons/react/24/outline/EnvelopeIcon";import{C as r}from"./ConnectEmailForm-o04NTrIc.mjs";import{B as i}from"./Layouts-Bmf8DxNP.mjs";import{u as e}from"./context-BqHnoxK5.mjs";import{S as m}from"./ScreenLayout-Dp0ezg8Q.mjs";import"lucide-react";import"react";import"styled-components";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"./index-B24hEnAn.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"./get-is-unified-wallet-GLvRyJlT.mjs";import"viem";import"eventemitter3";import"./useActiveWallet-CBIiGG1k.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-lYYA8ZfI.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-Aw21dxK9.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-C5z76Qhs.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"./Button-3JMVXKiE.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./EmailInputForm-B4hjCxRU.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"tinycolor2";import"./Screen-Bj-1pwMI.mjs";import"./ModalHeader-B27O6soE.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=({title:e="Connect your email",subtitle:p="Add your email to your account"})=>/*#__PURE__*/t(m,{title:e,subtitle:p,icon:o,watermark:!0,children:/*#__PURE__*/t(i,{children:/*#__PURE__*/t(r,{stacked:!0})})}),s={component:()=>{let o=e();/*#__PURE__*/return t(p,{subtitle:`Add your email to your ${o?.name} account`})}};export{s as LinkEmailScreen,p as LinkEmailScreenView,s as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{CheckCircle as i,FingerprintIcon as o,Trash2 as n}from"lucide-react";import{useState as r,useEffect as a}from"react";import{styled as s,css as c}from"styled-components";import{G as d}from"./useActiveWallet-BdFIc7_K.mjs";import{T as l,a as p}from"./TodoList-Dn0Qu-vv.mjs";import{u as m,c as h,b as y}from"./internal-context-e-Eni5bG.mjs";import{u}from"./get-is-unified-wallet-Ca5aEojK.mjs";import{S as f}from"./ScreenLayout-t3qtbQ3-.mjs";import"zustand";import"./context-BOoFAPna.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"react-device-detect";import"./prepareFundingModalData-CzDMa8gy.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-3r4yfFNg.mjs";import"ofetch";import"./Button-CrJpeX0e.mjs";import"./Screen-CpIMiJNF.mjs";import"./ModalHeader-YP9pLMEP.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 g=({passkeys:t,isLoading:n,errorReason:r,success:a,expanded:s,onLinkPasskey:c,onUnlinkPasskey:d,onExpand:l,onBack:p,onClose:m})=>/*#__PURE__*/e(f,a?{title:"Passkeys updated",icon:i,iconVariant:"success",primaryCta:{label:"Done",onClick:m},onClose:m,watermark:!0}:s?{icon:o,title:"Your passkeys",onBack:p,onClose:m,watermark:!0,children:/*#__PURE__*/e(v,{passkeys:t,expanded:s,onUnlink:d,onExpand:l})}:{icon:o,title:"Set up passkey verification",subtitle:"Verify with passkey",primaryCta:{label:"Add new passkey",onClick:c,loading:n},onClose:m,watermark:!0,helpText:r||void 0,children:0===t.length?/*#__PURE__*/e(x,{}):/*#__PURE__*/e(k,{children:/*#__PURE__*/e(v,{passkeys:t,expanded:s,onUnlink:d,onExpand:l})})});let k=/*#__PURE__*/s.div.withConfig({displayName:"ContentContainer",componentId:"sc-a752cbd1-0"})(["margin-bottom:12px;"]),v=({passkeys:i,expanded:o,onUnlink:a,onExpand:s})=>{let[c,l]=r([]),p=o?i.length:2;/*#__PURE__*/return t("div",{children:[/*#__PURE__*/e(N,{children:"Your passkeys"}),/*#__PURE__*/t(j,{children:[i.slice(0,p).map((i=>{/*#__PURE__*/return t(A,{children:[/*#__PURE__*/t("div",{children:[/*#__PURE__*/e(P,{children:(o=i,o.authenticatorName?o.createdWithBrowser?`${o.authenticatorName} on ${o.createdWithBrowser}`:o.authenticatorName:o.createdWithBrowser?o.createdWithOs?`${o.createdWithBrowser} on ${o.createdWithOs}`:`${o.createdWithBrowser}`:"Unknown device")}),/*#__PURE__*/t(L,{children:["Last used:"," ",(i.latestVerifiedAt??i.firstVerifiedAt)?.toLocaleString()??"N/A"]})]}),/*#__PURE__*/e(W,{disabled:c.includes(i.credentialId),onClick:()=>(async e=>{l((t=>t.concat([e]))),await a(e),l((t=>t.filter((t=>t!==e))))})(i.credentialId),children:c.includes(i.credentialId)?/*#__PURE__*/e(d,{}):/*#__PURE__*/e(n,{size:16})})]},i.credentialId);var o})),i.length>2&&!o&&/*#__PURE__*/e(I,{onClick:s,children:"View all"})]})]})},x=()=>/*#__PURE__*/t(l,{style:{color:"var(--privy-color-foreground)"},children:[/*#__PURE__*/e(p,{children:"Verify with Touch ID, Face ID, PIN, or hardware key"}),/*#__PURE__*/e(p,{children:"Takes seconds to set up and use"}),/*#__PURE__*/e(p,{children:"Use your passkey to verify transactions and login to your account"})]});const w={component:()=>{let{user:t,unlinkPasskey:i}=u(),{linkWithPasskey:o,closePrivyModal:n}=m(),s=t?.linkedAccounts.filter((e=>"passkey"===e.type)),[c,d]=r(!1),[l,p]=r(""),[f,k]=r(!1),[v,x]=r(!1);return a((()=>{0===s.length&&x(!1)}),[s.length]),/*#__PURE__*/e(g,{passkeys:s,isLoading:c,errorReason:l,success:f,expanded:v,onLinkPasskey:()=>{d(!0),o().then((()=>k(!0))).catch((e=>{if(e instanceof h){if(e.privyErrorCode===y.CANNOT_LINK_MORE_OF_TYPE)return void p("Cannot link more passkeys to account.");if(e.privyErrorCode===y.PASSKEY_NOT_ALLOWED)return void p("Passkey request timed out or rejected by user.")}p("Unknown error occurred.")})).finally((()=>{d(!1)}))},onUnlinkPasskey:async e=>(d(!0),await i(e).then((()=>k(!0))).catch((e=>{e instanceof h&&e.privyErrorCode===y.MISSING_MFA_CREDENTIALS?p("Cannot unlink a passkey enrolled in MFA"):p("Unknown error occurred.")})).finally((()=>{d(!1)}))),onExpand:()=>x(!0),onBack:()=>x(!1),onClose:()=>n()})}},C=/*#__PURE__*/s.div.withConfig({displayName:"DoubleIconWrapper",componentId:"sc-a752cbd1-1"})(["display:flex;align-items:center;justify-content:center;width:180px;height:90px;border-radius:50%;svg + svg{margin-left:12px;}> svg{z-index:2;color:var(--privy-color-accent) !important;stroke:var(--privy-color-accent) !important;fill:var(--privy-color-accent) !important;}"]);let b=/*#__PURE__*/c(["&&{width:100%;font-size:0.875rem;line-height:1rem;@media (min-width:440px){font-size:14px;}display:flex;gap:12px;justify-content:center;padding:6px 8px;background-color:var(--privy-color-background);transition:background-color 200ms ease;color:var(--privy-color-accent) !important;:focus{outline:none;box-shadow:none;}}"]);const I=/*#__PURE__*/s.button.withConfig({displayName:"LinkButton",componentId:"sc-a752cbd1-2"})(["",""],b);let j=/*#__PURE__*/s.div.withConfig({displayName:"List",componentId:"sc-a752cbd1-3"})(["display:flex;flex-direction:column;align-items:stretch;gap:0.8rem;padding:0.5rem 0rem 0rem;flex-grow:1;width:100%;"]),N=/*#__PURE__*/s.div.withConfig({displayName:"PasskeyListTitle",componentId:"sc-a752cbd1-4"})(["line-height:20px;height:20px;font-size:1em;font-weight:450;display:flex;justify-content:flex-beginning;width:100%;"]),P=/*#__PURE__*/s.div.withConfig({displayName:"PasskeyItemTitle",componentId:"sc-a752cbd1-5"})(["font-size:1em;line-height:1.3em;font-weight:500;color:var(--privy-color-foreground-2);padding:0.2em 0;"]),L=/*#__PURE__*/s.div.withConfig({displayName:"PasskeyItemSubtitle",componentId:"sc-a752cbd1-6"})(["font-size:0.875rem;line-height:1rem;color:#64668b;padding:0.2em 0;"]),A=/*#__PURE__*/s.div.withConfig({displayName:"PasskeyListItem",componentId:"sc-a752cbd1-7"})(["display:flex;align-items:center;justify-content:space-between;padding:1em;gap:10px;font-size:0.875rem;line-height:1rem;text-align:left;border-radius:8px;border:1px solid #e2e3f0 !important;width:100%;height:5em;"]),E=/*#__PURE__*/c([":focus,:hover,:active{outline:none;}display:flex;width:2em;height:2em;justify-content:center;align-items:center;svg{color:var(--privy-color-error);}svg:hover{color:var(--privy-color-foreground-3);}"]),W=/*#__PURE__*/s.button.withConfig({displayName:"PasskeyItemUnlinkButton",componentId:"sc-a752cbd1-8"})(["",""],E);export{C as DoubleIconWrapper,I as LinkButton,w as LinkPasskeyScreen,g as LinkPasskeyView,w as default};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{CheckCircle as i,FingerprintIcon as o,Trash2 as n}from"lucide-react";import{useState as r,useEffect as a}from"react";import{styled as s,css as c}from"styled-components";import{G as d}from"./useActiveWallet-CBIiGG1k.mjs";import{T as l,a as p}from"./TodoList-Dn0Qu-vv.mjs";import{u as m,c as h,b as y}from"./internal-context-e-Eni5bG.mjs";import{u}from"./get-is-unified-wallet-GLvRyJlT.mjs";import{S as f}from"./ScreenLayout-Dp0ezg8Q.mjs";import"zustand";import"./context-BqHnoxK5.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"react-device-detect";import"./prepareFundingModalData-lYYA8ZfI.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-Aw21dxK9.mjs";import"ofetch";import"./Button-3JMVXKiE.mjs";import"./Screen-Bj-1pwMI.mjs";import"./ModalHeader-B27O6soE.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 g=({passkeys:t,isLoading:n,errorReason:r,success:a,expanded:s,onLinkPasskey:c,onUnlinkPasskey:d,onExpand:l,onBack:p,onClose:m})=>/*#__PURE__*/e(f,a?{title:"Passkeys updated",icon:i,iconVariant:"success",primaryCta:{label:"Done",onClick:m},onClose:m,watermark:!0}:s?{icon:o,title:"Your passkeys",onBack:p,onClose:m,watermark:!0,children:/*#__PURE__*/e(v,{passkeys:t,expanded:s,onUnlink:d,onExpand:l})}:{icon:o,title:"Set up passkey verification",subtitle:"Verify with passkey",primaryCta:{label:"Add new passkey",onClick:c,loading:n},onClose:m,watermark:!0,helpText:r||void 0,children:0===t.length?/*#__PURE__*/e(x,{}):/*#__PURE__*/e(k,{children:/*#__PURE__*/e(v,{passkeys:t,expanded:s,onUnlink:d,onExpand:l})})});let k=/*#__PURE__*/s.div.withConfig({displayName:"ContentContainer",componentId:"sc-a752cbd1-0"})(["margin-bottom:12px;"]),v=({passkeys:i,expanded:o,onUnlink:a,onExpand:s})=>{let[c,l]=r([]),p=o?i.length:2;/*#__PURE__*/return t("div",{children:[/*#__PURE__*/e(N,{children:"Your passkeys"}),/*#__PURE__*/t(j,{children:[i.slice(0,p).map((i=>{/*#__PURE__*/return t(A,{children:[/*#__PURE__*/t("div",{children:[/*#__PURE__*/e(P,{children:(o=i,o.authenticatorName?o.createdWithBrowser?`${o.authenticatorName} on ${o.createdWithBrowser}`:o.authenticatorName:o.createdWithBrowser?o.createdWithOs?`${o.createdWithBrowser} on ${o.createdWithOs}`:`${o.createdWithBrowser}`:"Unknown device")}),/*#__PURE__*/t(L,{children:["Last used:"," ",(i.latestVerifiedAt??i.firstVerifiedAt)?.toLocaleString()??"N/A"]})]}),/*#__PURE__*/e(W,{disabled:c.includes(i.credentialId),onClick:()=>(async e=>{l((t=>t.concat([e]))),await a(e),l((t=>t.filter((t=>t!==e))))})(i.credentialId),children:c.includes(i.credentialId)?/*#__PURE__*/e(d,{}):/*#__PURE__*/e(n,{size:16})})]},i.credentialId);var o})),i.length>2&&!o&&/*#__PURE__*/e(I,{onClick:s,children:"View all"})]})]})},x=()=>/*#__PURE__*/t(l,{style:{color:"var(--privy-color-foreground)"},children:[/*#__PURE__*/e(p,{children:"Verify with Touch ID, Face ID, PIN, or hardware key"}),/*#__PURE__*/e(p,{children:"Takes seconds to set up and use"}),/*#__PURE__*/e(p,{children:"Use your passkey to verify transactions and login to your account"})]});const w={component:()=>{let{user:t,unlinkPasskey:i}=u(),{linkWithPasskey:o,closePrivyModal:n}=m(),s=t?.linkedAccounts.filter((e=>"passkey"===e.type)),[c,d]=r(!1),[l,p]=r(""),[f,k]=r(!1),[v,x]=r(!1);return a((()=>{0===s.length&&x(!1)}),[s.length]),/*#__PURE__*/e(g,{passkeys:s,isLoading:c,errorReason:l,success:f,expanded:v,onLinkPasskey:()=>{d(!0),o().then((()=>k(!0))).catch((e=>{if(e instanceof h){if(e.privyErrorCode===y.CANNOT_LINK_MORE_OF_TYPE)return void p("Cannot link more passkeys to account.");if(e.privyErrorCode===y.PASSKEY_NOT_ALLOWED)return void p("Passkey request timed out or rejected by user.")}p("Unknown error occurred.")})).finally((()=>{d(!1)}))},onUnlinkPasskey:async e=>(d(!0),await i(e).then((()=>k(!0))).catch((e=>{e instanceof h&&e.privyErrorCode===y.MISSING_MFA_CREDENTIALS?p("Cannot unlink a passkey enrolled in MFA"):p("Unknown error occurred.")})).finally((()=>{d(!1)}))),onExpand:()=>x(!0),onBack:()=>x(!1),onClose:()=>n()})}},C=/*#__PURE__*/s.div.withConfig({displayName:"DoubleIconWrapper",componentId:"sc-a752cbd1-1"})(["display:flex;align-items:center;justify-content:center;width:180px;height:90px;border-radius:50%;svg + svg{margin-left:12px;}> svg{z-index:2;color:var(--privy-color-accent) !important;stroke:var(--privy-color-accent) !important;fill:var(--privy-color-accent) !important;}"]);let b=/*#__PURE__*/c(["&&{width:100%;font-size:0.875rem;line-height:1rem;@media (min-width:440px){font-size:14px;}display:flex;gap:12px;justify-content:center;padding:6px 8px;background-color:var(--privy-color-background);transition:background-color 200ms ease;color:var(--privy-color-accent) !important;:focus{outline:none;box-shadow:none;}}"]);const I=/*#__PURE__*/s.button.withConfig({displayName:"LinkButton",componentId:"sc-a752cbd1-2"})(["",""],b);let j=/*#__PURE__*/s.div.withConfig({displayName:"List",componentId:"sc-a752cbd1-3"})(["display:flex;flex-direction:column;align-items:stretch;gap:0.8rem;padding:0.5rem 0rem 0rem;flex-grow:1;width:100%;"]),N=/*#__PURE__*/s.div.withConfig({displayName:"PasskeyListTitle",componentId:"sc-a752cbd1-4"})(["line-height:20px;height:20px;font-size:1em;font-weight:450;display:flex;justify-content:flex-beginning;width:100%;"]),P=/*#__PURE__*/s.div.withConfig({displayName:"PasskeyItemTitle",componentId:"sc-a752cbd1-5"})(["font-size:1em;line-height:1.3em;font-weight:500;color:var(--privy-color-foreground-2);padding:0.2em 0;"]),L=/*#__PURE__*/s.div.withConfig({displayName:"PasskeyItemSubtitle",componentId:"sc-a752cbd1-6"})(["font-size:0.875rem;line-height:1rem;color:#64668b;padding:0.2em 0;"]),A=/*#__PURE__*/s.div.withConfig({displayName:"PasskeyListItem",componentId:"sc-a752cbd1-7"})(["display:flex;align-items:center;justify-content:space-between;padding:1em;gap:10px;font-size:0.875rem;line-height:1rem;text-align:left;border-radius:8px;border:1px solid #e2e3f0 !important;width:100%;height:5em;"]),E=/*#__PURE__*/c([":focus,:hover,:active{outline:none;}display:flex;width:2em;height:2em;justify-content:center;align-items:center;svg{color:var(--privy-color-error);}svg:hover{color:var(--privy-color-foreground-3);}"]),W=/*#__PURE__*/s.button.withConfig({displayName:"PasskeyItemUnlinkButton",componentId:"sc-a752cbd1-8"})(["",""],E);export{C as DoubleIconWrapper,I as LinkButton,w as LinkPasskeyScreen,g as LinkPasskeyView,w as default};
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import e from"@heroicons/react/24/outline/PhoneIcon";import{useState as o}from"react";import{C as r}from"./ConnectPhoneForm-BeT3tDQM.mjs";import{u as i}from"./context-BOoFAPna.mjs";import{u as n}from"./internal-context-e-Eni5bG.mjs";import{a as m}from"./get-is-unified-wallet-Ca5aEojK.mjs";import{S as a}from"./ScreenLayout-t3qtbQ3-.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./useActiveWallet-BdFIc7_K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CzDMa8gy.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-3r4yfFNg.mjs";import"./Button-CrJpeX0e.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"tinycolor2";import"ofetch";import"./Screen-CpIMiJNF.mjs";import"./ModalHeader-YP9pLMEP.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 s=({title:i="Connect your phone",subtitle:n="Add your number to your account",onSubmit:m,isSubmitting:s=!1})=>{let[c,u]=o(null),l=async()=>{c?.qualifiedPhoneNumber&&await m(c)};/*#__PURE__*/return t(a,{title:i,subtitle:n,icon:e,primaryCta:{label:s?"Submitting":"Submit",onClick:l,disabled:!c?.isValid||s},watermark:!0,children:/*#__PURE__*/t(r,{onChange:t=>{u(t)},onSubmit:l,noIncludeSubmitButton:!0,hideRecent:!0})})},c={component:()=>{let{currentScreen:e,data:r,navigate:a,setModalData:c}=m(),u=i(),{initLoginWithSms:l}=n(),[p,d]=o(!1);/*#__PURE__*/return t(s,{subtitle:`Add your number to your ${u?.name} account`,onSubmit:async t=>{d(!0);try{await l({phoneNumber:t.qualifiedPhoneNumber,withPrivyUi:!0}),a("AwaitingPasswordlessCodeScreen")}catch(t){c({errorModalData:{error:t,previousScreen:r?.errorModalData?.previousScreen||e||"LinkPhoneScreen"}}),a("ErrorScreen")}finally{d(!1)}},isSubmitting:p})}};export{c as LinkPhoneScreen,s as LinkPhoneScreenView,c as default};
1
+ import{jsx as t}from"react/jsx-runtime";import e from"@heroicons/react/24/outline/PhoneIcon";import{useState as o}from"react";import{C as r}from"./ConnectPhoneForm-CK2ZaLcy.mjs";import{u as i}from"./context-BqHnoxK5.mjs";import{u as n}from"./internal-context-e-Eni5bG.mjs";import{a as m}from"./get-is-unified-wallet-GLvRyJlT.mjs";import{S as a}from"./ScreenLayout-Dp0ezg8Q.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./useActiveWallet-CBIiGG1k.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-lYYA8ZfI.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-Aw21dxK9.mjs";import"./Button-3JMVXKiE.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"tinycolor2";import"ofetch";import"./Screen-Bj-1pwMI.mjs";import"./ModalHeader-B27O6soE.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 s=({title:i="Connect your phone",subtitle:n="Add your number to your account",onSubmit:m,isSubmitting:s=!1})=>{let[c,u]=o(null),l=async()=>{c?.qualifiedPhoneNumber&&await m(c)};/*#__PURE__*/return t(a,{title:i,subtitle:n,icon:e,primaryCta:{label:s?"Submitting":"Submit",onClick:l,disabled:!c?.isValid||s},watermark:!0,children:/*#__PURE__*/t(r,{onChange:t=>{u(t)},onSubmit:l,noIncludeSubmitButton:!0,hideRecent:!0})})},c={component:()=>{let{currentScreen:e,data:r,navigate:a,setModalData:c}=m(),u=i(),{initLoginWithSms:l}=n(),[p,d]=o(!1);/*#__PURE__*/return t(s,{subtitle:`Add your number to your ${u?.name} account`,onSubmit:async t=>{d(!0);try{await l({phoneNumber:t.qualifiedPhoneNumber,withPrivyUi:!0}),a("AwaitingPasswordlessCodeScreen")}catch(t){c({errorModalData:{error:t,previousScreen:r?.errorModalData?.previousScreen||e||"LinkPhoneScreen"}}),a("ErrorScreen")}finally{d(!1)}},isSubmitting:p})}};export{c as LinkPhoneScreen,s as LinkPhoneScreenView,c as default};
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{XCircle as e}from"lucide-react";import{u as o}from"./internal-context-e-Eni5bG.mjs";import{a as r}from"./get-is-unified-wallet-Ca5aEojK.mjs";import{S as i}from"./ScreenLayout-t3qtbQ3-.mjs";import"ofetch";import"react";import"viem";import"./context-BOoFAPna.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./Button-CrJpeX0e.mjs";import"styled-components";import"./useActiveWallet-BdFIc7_K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CzDMa8gy.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-3r4yfFNg.mjs";import"./Screen-CpIMiJNF.mjs";import"./ModalHeader-YP9pLMEP.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=({title:o="Could not connect with wallet",subtitle:r="Please check that Phantom multichain is enabled and try again.",primaryCtaText:n="Try again",secondaryCtaText:a="Cancel",onTryAgain:m,onCancel:c})=>/*#__PURE__*/t(i,{title:o,subtitle:r,icon:e,iconVariant:"error",primaryCta:{label:n,onClick:m},secondaryCta:{label:a,onClick:c},watermark:!0}),a={component:()=>{let{closePrivyModal:e}=o(),{navigate:i}=r();/*#__PURE__*/return t(n,{onTryAgain:()=>{i("LandingScreen")},onCancel:async()=>{await e()}})}};export{a as LoginFailedScreen,n as LoginFailedScreenView,a as default};
1
+ import{jsx as t}from"react/jsx-runtime";import{XCircle as e}from"lucide-react";import{u as o}from"./internal-context-e-Eni5bG.mjs";import{a as r}from"./get-is-unified-wallet-GLvRyJlT.mjs";import{S as i}from"./ScreenLayout-Dp0ezg8Q.mjs";import"ofetch";import"react";import"viem";import"./context-BqHnoxK5.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./Button-3JMVXKiE.mjs";import"styled-components";import"./useActiveWallet-CBIiGG1k.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-lYYA8ZfI.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-Aw21dxK9.mjs";import"./Screen-Bj-1pwMI.mjs";import"./ModalHeader-B27O6soE.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=({title:o="Could not connect with wallet",subtitle:r="Please check that Phantom multichain is enabled and try again.",primaryCtaText:n="Try again",secondaryCtaText:a="Cancel",onTryAgain:m,onCancel:c})=>/*#__PURE__*/t(i,{title:o,subtitle:r,icon:e,iconVariant:"error",primaryCta:{label:n,onClick:m},secondaryCta:{label:a,onClick:c},watermark:!0}),a={component:()=>{let{closePrivyModal:e}=o(),{navigate:i}=r();/*#__PURE__*/return t(n,{onTryAgain:()=>{i("LandingScreen")},onCancel:async()=>{await e()}})}};export{a as LoginFailedScreen,n as LoginFailedScreenView,a as default};
@@ -1 +1 @@
1
- import{jsx as e,Fragment as r,jsxs as t}from"react/jsx-runtime";import{useState as o,useEffect as i,useMemo as a}from"react";import{formatUnits as s}from"viem";import{formatTokenAmount as n,formatWeiAmount as m}from"@privy-io/js-sdk-core";import{P as c}from"./Button-CrJpeX0e.mjs";import{F as d}from"./Layouts-Bmf8DxNP.mjs";import{B as l}from"./ModalHeader-YP9pLMEP.mjs";import{Q as p}from"./QrCode-C0_lXRph.mjs";import{t as u}from"./FundWalletMethodHeader-DBV2Rnau.mjs";import{I as f}from"./InfoBanner-D6C6Bt8L.mjs";import{S as h}from"./Subtitle-DkvfP2Ev.mjs";import{T as g}from"./Title-D0pfZff-.mjs";import{W as v}from"./WalletInfoCard-QxupP_e1.mjs";import{u as j}from"./context-BOoFAPna.mjs";import{v as y,D as C}from"./useActiveWallet-BdFIc7_K.mjs";import{u as S}from"./internal-context-e-Eni5bG.mjs";import{a as I}from"./get-is-unified-wallet-Ca5aEojK.mjs";import{u as T}from"./useWalletBalance-CkNw6kj0.mjs";import{u as b}from"./useWallets-3r4yfFNg.mjs";import{O as w}from"./analytics-mkkvFRju.mjs";import{w as A,y as k}from"./index-CUao1WyN.mjs";import{g as F}from"./getChainName-DjpPdUSc.mjs";import{g as D}from"./getUsdcMintAddress-DFI1hv05.mjs";import{g as M}from"./transaction-CnfuREWo.mjs";import{g as B}from"./getErc20Balance-CaKjNAs9.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"qrcode";import"@heroicons/react/24/outline/InformationCircleIcon";import"lucide-react";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Address-BZeOq9QH.mjs";import"./shared-CtYf3O54.mjs";import"tinycolor2";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CzDMa8gy.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"ofetch";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CeQ3C1KS.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"./getFormattedUsdFromLamports-B6EqSEho.mjs";const U={component:()=>{let{wallets:k}=b(),{connectors:U}=S(),$=U.filter(y).flatMap((e=>e.wallets)),{data:x,setModalData:L,navigate:W,lastScreen:O}=I(),{rpcConfig:P,appId:R,createAnalyticsEvent:q,closePrivyModal:H}=S(),N=j(),[Q,z]=o(void 0),[X,Y]=o(!1),G=x?.funding,{reloadBalance:J}=T({rpcConfig:P,appId:R,address:"ethereum"===G.chainType?G.address:void 0,chain:"ethereum"===G.chainType?G.chain:void 0}),K="solana"===G.chainType,V=K?G.isUSDC?"USDC":"SOL":G.erc20Address?G.erc20ContractInfo?.symbol:G.chain.nativeCurrency.symbol,Z=K?$.find((({address:e})=>e===G.address)):k.find((({address:e})=>C(e)===C(G.address)));if(!G)return L({errorModalData:{error:Error("Couldn't find funding config"),previousScreen:O||"FundingMethodSelectionScreen"},funding:x?.funding,solanaFundingData:x?.solanaFundingData,sendTransaction:x?.sendTransaction}),W("ErrorScreen"),/*#__PURE__*/e(r,{});i((()=>{let e=K?async function(){if("solana"!==G.chainType)return;let e=N.solanaRpcs[G.chain];e?(G.isUSDC?async function({rpc:e,address:r,mintAddress:t}){let o=await e.getTokenAccountsByOwner(r,{mint:t},{encoding:"jsonParsed",commitment:"confirmed"}).send(),i=o.value[0]?.account;return i?BigInt(i.data.parsed.info.tokenAmount.amount):0n}({rpc:e.rpc,address:G.address,mintAddress:D(G.chain)}):A({rpc:e.rpc,address:G.address})).then((e=>{let r=BigInt(e);Q&&r>Q&&(Y(!0),q({eventName:w,payload:{provider:"manual",status:"success",chainType:"solana",address:Z?.address,value:G.isUSDC?s(r-Q,6):s(r-Q,9),token:G.isUSDC?"USDC":"SOL"}})),z(r)})):console.warn("Unable to load solana rpc, skipping balance")}:async function(){"ethereum"===G.chainType&&(async()=>{if(!G.erc20Address)return await J()??BigInt(0);{let{balance:e}=await B({chain:G.chain,address:G.address,erc20Address:G.erc20Address,rpcConfig:P,appId:R});return e}})().then((e=>{Q&&e>Q&&(Y(!0),q({eventName:w,payload:{provider:"manual",status:"success",chainType:"ethereum",address:Z?.address,chainId:G.chain.id,value:s(e-Q,G.erc20ContractInfo?.decimals??18),token:G.erc20ContractInfo?.symbol??G.erc20Address??"ETH"}})),z(e)})).catch((()=>z(void 0)))},r=setInterval(e,2e3);return e(),()=>clearInterval(r)}),[Q]);let _=a((()=>null==Q?"":G.isUSDC?n({amount:Q,decimals:6}):K?M(Q,3,!0,!0):null!=G.erc20ContractInfo?.decimals?n({amount:Q,decimals:G.erc20ContractInfo.decimals}):m({wei:Q})),[Q,K,G]),ee="ethereum"===G.chainType?G.chain.name:F(G.chain),re=a((()=>""===G.uiConfig?.receiveFundsTitle?null:/*#__PURE__*/e(g,{children:G.uiConfig?.receiveFundsTitle??`Receive ${G.amount} ${V??""}`.trim()})),[G.uiConfig?.receiveFundsTitle,G.amount,V]),te=a((()=>""===G.uiConfig?.receiveFundsSubtitle?null:/*#__PURE__*/e(h,{children:G.uiConfig?.receiveFundsSubtitle??`Scan this code or copy your wallet address to receive funds on ${ee}.`})),[G.uiConfig?.receiveFundsSubtitle,ee]),oe="solana"===G.chainType&&G.isUSDC&&D(G.chain)?`?spl-token=${D(G.chain)}`:"";/*#__PURE__*/return t(r,{children:[/*#__PURE__*/e(u,{}),re,te,/*#__PURE__*/t(d,{style:{gap:"1rem",margin:re||te?"1rem 0":"0"},children:[/*#__PURE__*/e(p,{url:`${G.chainType}:${G.address}${oe}`,size:200,squareLogoElement:E}),/*#__PURE__*/t(f,{theme:N.appearance.palette.colorScheme,children:["Make sure to send funds on ",ee,"."]}),/*#__PURE__*/e(v,{title:"Your wallet",errMsg:void 0,showCopyButton:!0,balance:`${_} ${V}`,address:G.address}),X&&/*#__PURE__*/e(c,{onClick:()=>H({shouldCallAuthOnSuccess:!1,isSuccess:!0}),children:"Continue"})]}),/*#__PURE__*/e(l,{})]})}};let E=({...r})=>/*#__PURE__*/e(k,{color:"black",...r});export{U as ManualTransferScreen,U as default};
1
+ import{jsx as e,Fragment as r,jsxs as t}from"react/jsx-runtime";import{useState as o,useEffect as i,useMemo as a}from"react";import{formatUnits as s}from"viem";import{formatTokenAmount as n,formatWeiAmount as m}from"@privy-io/js-sdk-core";import{P as c}from"./Button-3JMVXKiE.mjs";import{F as d}from"./Layouts-Bmf8DxNP.mjs";import{B as l}from"./ModalHeader-B27O6soE.mjs";import{Q as p}from"./QrCode-CGBH7ZqU.mjs";import{t as u}from"./FundWalletMethodHeader-C0uPKdYw.mjs";import{I as f}from"./InfoBanner-D6C6Bt8L.mjs";import{S as h}from"./Subtitle-DkvfP2Ev.mjs";import{T as g}from"./Title-D0pfZff-.mjs";import{W as v}from"./WalletInfoCard-DFrqmXTc.mjs";import{u as j}from"./context-BqHnoxK5.mjs";import{v as y,D as C}from"./useActiveWallet-CBIiGG1k.mjs";import{u as S}from"./internal-context-e-Eni5bG.mjs";import{a as I}from"./get-is-unified-wallet-GLvRyJlT.mjs";import{u as T}from"./useWalletBalance-CkNw6kj0.mjs";import{u as b}from"./useWallets-Aw21dxK9.mjs";import{O as w}from"./analytics-mkkvFRju.mjs";import{w as A,y as k}from"./index-B24hEnAn.mjs";import{g as F}from"./getChainName-DjpPdUSc.mjs";import{g as D}from"./getUsdcMintAddress-DFI1hv05.mjs";import{g as M}from"./transaction-CnfuREWo.mjs";import{g as B}from"./getErc20Balance-CaKjNAs9.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"qrcode";import"@heroicons/react/24/outline/InformationCircleIcon";import"lucide-react";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Address-C2aXxM2N.mjs";import"./shared-CtYf3O54.mjs";import"tinycolor2";import"zustand";import"react-device-detect";import"./prepareFundingModalData-lYYA8ZfI.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"ofetch";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-C5z76Qhs.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"./getFormattedUsdFromLamports-B6EqSEho.mjs";const U={component:()=>{let{wallets:k}=b(),{connectors:U}=S(),$=U.filter(y).flatMap((e=>e.wallets)),{data:x,setModalData:L,navigate:W,lastScreen:O}=I(),{rpcConfig:P,appId:R,createAnalyticsEvent:q,closePrivyModal:H}=S(),N=j(),[Q,z]=o(void 0),[X,Y]=o(!1),G=x?.funding,{reloadBalance:J}=T({rpcConfig:P,appId:R,address:"ethereum"===G.chainType?G.address:void 0,chain:"ethereum"===G.chainType?G.chain:void 0}),K="solana"===G.chainType,V=K?G.isUSDC?"USDC":"SOL":G.erc20Address?G.erc20ContractInfo?.symbol:G.chain.nativeCurrency.symbol,Z=K?$.find((({address:e})=>e===G.address)):k.find((({address:e})=>C(e)===C(G.address)));if(!G)return L({errorModalData:{error:Error("Couldn't find funding config"),previousScreen:O||"FundingMethodSelectionScreen"},funding:x?.funding,solanaFundingData:x?.solanaFundingData,sendTransaction:x?.sendTransaction}),W("ErrorScreen"),/*#__PURE__*/e(r,{});i((()=>{let e=K?async function(){if("solana"!==G.chainType)return;let e=N.solanaRpcs[G.chain];e?(G.isUSDC?async function({rpc:e,address:r,mintAddress:t}){let o=await e.getTokenAccountsByOwner(r,{mint:t},{encoding:"jsonParsed",commitment:"confirmed"}).send(),i=o.value[0]?.account;return i?BigInt(i.data.parsed.info.tokenAmount.amount):0n}({rpc:e.rpc,address:G.address,mintAddress:D(G.chain)}):A({rpc:e.rpc,address:G.address})).then((e=>{let r=BigInt(e);Q&&r>Q&&(Y(!0),q({eventName:w,payload:{provider:"manual",status:"success",chainType:"solana",address:Z?.address,value:G.isUSDC?s(r-Q,6):s(r-Q,9),token:G.isUSDC?"USDC":"SOL"}})),z(r)})):console.warn("Unable to load solana rpc, skipping balance")}:async function(){"ethereum"===G.chainType&&(async()=>{if(!G.erc20Address)return await J()??BigInt(0);{let{balance:e}=await B({chain:G.chain,address:G.address,erc20Address:G.erc20Address,rpcConfig:P,appId:R});return e}})().then((e=>{Q&&e>Q&&(Y(!0),q({eventName:w,payload:{provider:"manual",status:"success",chainType:"ethereum",address:Z?.address,chainId:G.chain.id,value:s(e-Q,G.erc20ContractInfo?.decimals??18),token:G.erc20ContractInfo?.symbol??G.erc20Address??"ETH"}})),z(e)})).catch((()=>z(void 0)))},r=setInterval(e,2e3);return e(),()=>clearInterval(r)}),[Q]);let _=a((()=>null==Q?"":G.isUSDC?n({amount:Q,decimals:6}):K?M(Q,3,!0,!0):null!=G.erc20ContractInfo?.decimals?n({amount:Q,decimals:G.erc20ContractInfo.decimals}):m({wei:Q})),[Q,K,G]),ee="ethereum"===G.chainType?G.chain.name:F(G.chain),re=a((()=>""===G.uiConfig?.receiveFundsTitle?null:/*#__PURE__*/e(g,{children:G.uiConfig?.receiveFundsTitle??`Receive ${G.amount} ${V??""}`.trim()})),[G.uiConfig?.receiveFundsTitle,G.amount,V]),te=a((()=>""===G.uiConfig?.receiveFundsSubtitle?null:/*#__PURE__*/e(h,{children:G.uiConfig?.receiveFundsSubtitle??`Scan this code or copy your wallet address to receive funds on ${ee}.`})),[G.uiConfig?.receiveFundsSubtitle,ee]),oe="solana"===G.chainType&&G.isUSDC&&D(G.chain)?`?spl-token=${D(G.chain)}`:"";/*#__PURE__*/return t(r,{children:[/*#__PURE__*/e(u,{}),re,te,/*#__PURE__*/t(d,{style:{gap:"1rem",margin:re||te?"1rem 0":"0"},children:[/*#__PURE__*/e(p,{url:`${G.chainType}:${G.address}${oe}`,size:200,squareLogoElement:E}),/*#__PURE__*/t(f,{theme:N.appearance.palette.colorScheme,children:["Make sure to send funds on ",ee,"."]}),/*#__PURE__*/e(v,{title:"Your wallet",errMsg:void 0,showCopyButton:!0,balance:`${_} ${V}`,address:G.address}),X&&/*#__PURE__*/e(c,{onClick:()=>H({shouldCallAuthOnSuccess:!1,isSuccess:!0}),children:"Continue"})]}),/*#__PURE__*/e(l,{})]})}};let E=({...r})=>/*#__PURE__*/e(k,{color:"black",...r});export{U as ManualTransferScreen,U as default};
@@ -1 +1 @@
1
- import{jsxs as e,Fragment as o,jsx as t}from"react/jsx-runtime";import r from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import i from"@heroicons/react/24/outline/ShieldCheckIcon";import{useState as n}from"react";import{P as a}from"./Button-CrJpeX0e.mjs";import{L as s}from"./useActiveWallet-BdFIc7_K.mjs";import{M as m,a as l}from"./ModalHeader-YP9pLMEP.mjs";import{u as c}from"./context-BOoFAPna.mjs";import{u as p,a as u}from"./get-is-unified-wallet-Ca5aEojK.mjs";import{M as d,E as h,a as y,b as f}from"./EnrollTotp-Ds_-ZGUd.mjs";import{A as v,C as j,I as k,T as g,S as C,B as w}from"./PinInput-C3_MNxMt.mjs";import"styled-components";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CzDMa8gy.mjs";import"@privy-io/js-sdk-core";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-3r4yfFNg.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";import"tinycolor2";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/PhoneIcon";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"./ErrorScreen-A7eS3gFZ.mjs";import"lucide-react";import"./index-CUao1WyN.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-CeQ3C1KS.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"./reservoir-kvLjIrEo.mjs";import"./ScreenLayout-t3qtbQ3-.mjs";import"./Screen-CpIMiJNF.mjs";import"./index-CJMgUOnw.mjs";import"./LinkPasskeyScreen-75b0FmMc.mjs";import"./TodoList-Dn0Qu-vv.mjs";import"./CopyToClipboard-DatKc59_.mjs";import"./copy-Bx2Jwc5_.mjs";import"./Layouts-Bmf8DxNP.mjs";import"./Column-DQ5Vw9t1.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"./shared-CtYf3O54.mjs";import"@heroicons/react/24/solid/ShieldCheckIcon";import"./QrCode-C0_lXRph.mjs";import"qrcode";const M={component:()=>{let{user:M,ready:b}=p(),{data:I,onUserCloseViaDialogOrKeybindRef:S}=u(),A=c(),[E,R]=n(null),[F,P]=n(null),[T,L]=n(null),[x,B]=n(!1),[U,W]=n(!1),[D,O]=n(),$=async()=>{D?H(D):M?await K({user:M}):H(Error("Must be logged in to manage MFA")),setTimeout((()=>{R(null),P(null)}),500)};if(S.current=$,!I?.mfaEnroll)throw Error("Missing modal data for MFA enrollment screen.");let{onFailure:H,onSuccess:K,onBack:Q,mfaMethods:X,verify:q,generateTotpSecret:z,enrollTotp:N,unenrollTotp:V,enrollPasskey:Y}=I.mfaEnroll,G=M?.mfaMethods.includes("sms"),J=M?.mfaMethods.includes("totp"),Z=M?.mfaMethods.includes("passkey"),_=!!M?.phone,ee=M?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function oe(){R(null),P(null),O(void 0)}async function te(e=ee){try{O(void 0),W(!0);let o=await Y(e);return await K({user:o})}catch(e){O(e)}finally{W(!1),B(!1)}}if(!b||!M||!A)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(m,{onClose:$,backFn:Q},"header"),/*#__PURE__*/t(v,{children:/*#__PURE__*/t(d,{})}),/*#__PURE__*/t(j,{children:/*#__PURE__*/t(s,{})}),/*#__PURE__*/t(l,{})]});if("sms"===E)return null;if("totp"===E)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(m,{backFn:oe,onClose:$},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(r,{})}),/*#__PURE__*/t(g,{children:"Remove authenticator app verification?"}),/*#__PURE__*/e(C,{children:["MFA adds an extra layer of security to your ",A?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/t(w,{children:/*#__PURE__*/t(a,{$warn:!0,onClick:async function(){try{O(void 0),W(!0);let e=await V();return await K({user:e})}catch(e){O(e)}finally{W(!1),R(null)}},loading:U,children:"Remove"})}),/*#__PURE__*/t(l,{})]});if("passkey"===E){let i=I.mfaEnroll.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(m,{backFn:oe,onClose:$},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(r,{})}),/*#__PURE__*/t(g,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/t(C,{children:i?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),/*#__PURE__*/t(w,{children:/*#__PURE__*/t(a,{$warn:!0,onClick:async function(){try{O(void 0),W(!0);let e=await Y([]);return await K({user:e})}catch(e){O(e)}finally{W(!1),R(null)}},loading:U,children:"Remove"})}),/*#__PURE__*/t(l,{})]})}return 0!==X.length||G||J||Z?"sms"===F?null:"totp"===F&&T?/*#__PURE__*/t(h,{onClose:$,onReset:oe,submitEnrollmentWithTotp:e=>async function(e){try{O(void 0),W(!0);let o=await N(e);return await K({user:o})}catch(e){O(e)}finally{W(!1),R(null)}}(e.mfaCode),error:D,totpInfo:{...T,appName:A?.name||"Privy"}}):"passkey"===F?/*#__PURE__*/t(y,{onReset:oe,onClose:$,submitEnrollmentWithPasskey:te}):/*#__PURE__*/t(f,{showIntro:!0,userMfaMethods:M.mfaMethods,appMfaMethods:A.mfa.methods,userHasAuthSms:_,backFn:Q,handleSelectMethod:async function(e){O(void 0);try{await q()}catch(e){return void O(e)}return"totp"===e?(P(e),L(null),void z().then((({totpSecret:e,totpAuthUrl:o})=>{L({authUrl:o,secret:e})})).catch((()=>{L(null),oe()}))):"passkey"===e&&1===ee.length?await te():void P(e)},isTotpLoading:"totp"===F&&!T,isPasskeyLoading:x,error:D,onClose:$,setRemovingMfaMethod:async function(e){O(void 0);try{await q()}catch(e){return void O(e)}R(e)}}):/*#__PURE__*/e(o,{children:[/*#__PURE__*/t(m,{onClose:$,backFn:Q},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(i,{})}),/*#__PURE__*/t(g,{children:"Add more security"}),/*#__PURE__*/e(C,{children:[A?.name," does not have any verification methods enabled."]}),/*#__PURE__*/t(w,{children:/*#__PURE__*/t(a,{onClick:$,children:"Close"})}),/*#__PURE__*/t(l,{})]})}};export{M as MfaAuthEnrollmentFlowScreen,M as default};
1
+ import{jsxs as e,Fragment as o,jsx as t}from"react/jsx-runtime";import r from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import i from"@heroicons/react/24/outline/ShieldCheckIcon";import{useState as n}from"react";import{P as a}from"./Button-3JMVXKiE.mjs";import{L as s}from"./useActiveWallet-CBIiGG1k.mjs";import{M as m,a as l}from"./ModalHeader-B27O6soE.mjs";import{u as c}from"./context-BqHnoxK5.mjs";import{u as p,a as u}from"./get-is-unified-wallet-GLvRyJlT.mjs";import{M as d,E as h,a as y,b as f}from"./EnrollTotp-BE-JDa07.mjs";import{A as v,C as j,I as k,T as g,S as C,B as w}from"./PinInput-C3_MNxMt.mjs";import"styled-components";import"zustand";import"react-device-detect";import"./prepareFundingModalData-lYYA8ZfI.mjs";import"@privy-io/js-sdk-core";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-Aw21dxK9.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";import"tinycolor2";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/PhoneIcon";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"./ErrorScreen-CR_0-6OL.mjs";import"lucide-react";import"./index-B24hEnAn.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-C5z76Qhs.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"./reservoir-kvLjIrEo.mjs";import"./ScreenLayout-Dp0ezg8Q.mjs";import"./Screen-Bj-1pwMI.mjs";import"./index-CJMgUOnw.mjs";import"./LinkPasskeyScreen-Br7W1Zmq.mjs";import"./TodoList-Dn0Qu-vv.mjs";import"./CopyToClipboard-DatKc59_.mjs";import"./copy-Bx2Jwc5_.mjs";import"./Layouts-Bmf8DxNP.mjs";import"./Column-DQ5Vw9t1.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"./shared-CtYf3O54.mjs";import"@heroicons/react/24/solid/ShieldCheckIcon";import"./QrCode-CGBH7ZqU.mjs";import"qrcode";const M={component:()=>{let{user:M,ready:b}=p(),{data:I,onUserCloseViaDialogOrKeybindRef:S}=u(),A=c(),[E,R]=n(null),[F,P]=n(null),[T,L]=n(null),[x,B]=n(!1),[U,W]=n(!1),[D,O]=n(),$=async()=>{D?H(D):M?await K({user:M}):H(Error("Must be logged in to manage MFA")),setTimeout((()=>{R(null),P(null)}),500)};if(S.current=$,!I?.mfaEnroll)throw Error("Missing modal data for MFA enrollment screen.");let{onFailure:H,onSuccess:K,onBack:Q,mfaMethods:X,verify:q,generateTotpSecret:z,enrollTotp:N,unenrollTotp:V,enrollPasskey:Y}=I.mfaEnroll,G=M?.mfaMethods.includes("sms"),J=M?.mfaMethods.includes("totp"),Z=M?.mfaMethods.includes("passkey"),_=!!M?.phone,ee=M?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function oe(){R(null),P(null),O(void 0)}async function te(e=ee){try{O(void 0),W(!0);let o=await Y(e);return await K({user:o})}catch(e){O(e)}finally{W(!1),B(!1)}}if(!b||!M||!A)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(m,{onClose:$,backFn:Q},"header"),/*#__PURE__*/t(v,{children:/*#__PURE__*/t(d,{})}),/*#__PURE__*/t(j,{children:/*#__PURE__*/t(s,{})}),/*#__PURE__*/t(l,{})]});if("sms"===E)return null;if("totp"===E)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(m,{backFn:oe,onClose:$},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(r,{})}),/*#__PURE__*/t(g,{children:"Remove authenticator app verification?"}),/*#__PURE__*/e(C,{children:["MFA adds an extra layer of security to your ",A?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/t(w,{children:/*#__PURE__*/t(a,{$warn:!0,onClick:async function(){try{O(void 0),W(!0);let e=await V();return await K({user:e})}catch(e){O(e)}finally{W(!1),R(null)}},loading:U,children:"Remove"})}),/*#__PURE__*/t(l,{})]});if("passkey"===E){let i=I.mfaEnroll.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(m,{backFn:oe,onClose:$},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(r,{})}),/*#__PURE__*/t(g,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/t(C,{children:i?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),/*#__PURE__*/t(w,{children:/*#__PURE__*/t(a,{$warn:!0,onClick:async function(){try{O(void 0),W(!0);let e=await Y([]);return await K({user:e})}catch(e){O(e)}finally{W(!1),R(null)}},loading:U,children:"Remove"})}),/*#__PURE__*/t(l,{})]})}return 0!==X.length||G||J||Z?"sms"===F?null:"totp"===F&&T?/*#__PURE__*/t(h,{onClose:$,onReset:oe,submitEnrollmentWithTotp:e=>async function(e){try{O(void 0),W(!0);let o=await N(e);return await K({user:o})}catch(e){O(e)}finally{W(!1),R(null)}}(e.mfaCode),error:D,totpInfo:{...T,appName:A?.name||"Privy"}}):"passkey"===F?/*#__PURE__*/t(y,{onReset:oe,onClose:$,submitEnrollmentWithPasskey:te}):/*#__PURE__*/t(f,{showIntro:!0,userMfaMethods:M.mfaMethods,appMfaMethods:A.mfa.methods,userHasAuthSms:_,backFn:Q,handleSelectMethod:async function(e){O(void 0);try{await q()}catch(e){return void O(e)}return"totp"===e?(P(e),L(null),void z().then((({totpSecret:e,totpAuthUrl:o})=>{L({authUrl:o,secret:e})})).catch((()=>{L(null),oe()}))):"passkey"===e&&1===ee.length?await te():void P(e)},isTotpLoading:"totp"===F&&!T,isPasskeyLoading:x,error:D,onClose:$,setRemovingMfaMethod:async function(e){O(void 0);try{await q()}catch(e){return void O(e)}R(e)}}):/*#__PURE__*/e(o,{children:[/*#__PURE__*/t(m,{onClose:$,backFn:Q},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(i,{})}),/*#__PURE__*/t(g,{children:"Add more security"}),/*#__PURE__*/e(C,{children:[A?.name," does not have any verification methods enabled."]}),/*#__PURE__*/t(w,{children:/*#__PURE__*/t(a,{onClick:$,children:"Close"})}),/*#__PURE__*/t(l,{})]})}};export{M as MfaAuthEnrollmentFlowScreen,M as default};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{useState as e,useEffect as t,useRef as r}from"react";import{u as i,a as s}from"./get-is-unified-wallet-Ca5aEojK.mjs";import{V as m,a as n,b as a,t as c}from"./to-ui-error-BuXu0iWM.mjs";import"viem";import"./context-BOoFAPna.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"./ModalHeader-YP9pLMEP.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./ScreenLayout-t3qtbQ3-.mjs";import"./Button-CrJpeX0e.mjs";import"./useActiveWallet-BdFIc7_K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CzDMa8gy.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-3r4yfFNg.mjs";import"./Screen-CpIMiJNF.mjs";import"./index-CJMgUOnw.mjs";import"./PinInput-C3_MNxMt.mjs";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./StackedContainer-BrIQsdas.mjs";import"./useGetTokenPrice-Cw9UgOp3.mjs";import"./useGetSolPrice-Cfm8o9C5.mjs";import"./index-CUao1WyN.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-CeQ3C1KS.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"./TransactionDetails-Dpy5T9tM.mjs";import"./WalletLink-DFEVbh0m.mjs";import"./ethers-DnpKeAXc.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"./Layouts-Bmf8DxNP.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";const p={component:()=>{let{user:p}=i(),{data:l}=s(),[u,d]=e(p?.mfaMethods[0]),[h,f]=e(!1),[j,v]=e(),[y,k]=e();if(t((()=>{d(p?.mfaMethods[0])}),[p?.mfaMethods]),!l?.mfaVerify)throw Error("Missing modal data for MFA verification screen.");let{onFailure:g,onSuccess:w,generateOptions:C,verifyTotpCode:M,verifyPasskey:S,verifySmsCode:I,sendSmsCode:b}=l.mfaVerify,P=async o=>{if("passkey"!==o)try{d(o),"sms"===o&&(d(o),await b()),"totp"===o&&d(o)}catch(o){console.error(o)}else try{d(o);let e=await C();if(!e)throw Error("something went wrong");v(e),await S(e),f(!0),k(void 0),w()}catch(o){k(c(o))}},x=async o=>{k(void 0);try{if(!o||!u)return;if("passkey"===u){if(!j)throw Error("Missing passkey challenge");await S(j)}else"sms"===u?await I(o):"totp"===u&&await M(o);k(void 0),f(!0),w()}catch(o){throw c(o).error}},A=()=>{y||!h?g(y?.error??Error("Canceled MFA verification.")):w()},E=r(!1);return t((()=>{!E.current&&u&&(E.current=!0,P(u).finally((()=>{E.current=!1})))}),[open]),p?"passkey"===u?/*#__PURE__*/o(m,{account:p.linkedAccounts.filter((o=>"passkey"===o.type&&o.enrolledInMfa)).sort(((o,e)=>e.firstVerifiedAt.valueOf()-o.firstVerifiedAt.valueOf()))[0],submitSuccess:h,hasBlockingError:y?.isBlocking??!1,error:y?.error,onClose:A,onBack:()=>{d(void 0),k(void 0)},handleSubmit:()=>x(j).catch(k)}):"sms"===u||"totp"===u?/*#__PURE__*/o(n,{selectedMethod:u,submitSuccess:h,hasBlockingError:y?.isBlocking??!1,handleSubmitCode:x,onClose:A,onBack:p.mfaMethods.length>1?()=>d(void 0):void 0}):/*#__PURE__*/o(a,{user:p,onSelect:P,handleClose:A}):null}};export{p as MfaAuthVerifyFlowScreen,p as default};
1
+ import{jsx as o}from"react/jsx-runtime";import{useState as e,useEffect as t,useRef as r}from"react";import{u as i,a as s}from"./get-is-unified-wallet-GLvRyJlT.mjs";import{V as m,a as n,b as a,t as c}from"./to-ui-error-ySeuG-hJ.mjs";import"viem";import"./context-BqHnoxK5.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"./ModalHeader-B27O6soE.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./ScreenLayout-Dp0ezg8Q.mjs";import"./Button-3JMVXKiE.mjs";import"./useActiveWallet-CBIiGG1k.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-lYYA8ZfI.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-Aw21dxK9.mjs";import"./Screen-Bj-1pwMI.mjs";import"./index-CJMgUOnw.mjs";import"./PinInput-C3_MNxMt.mjs";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./StackedContainer-BrIQsdas.mjs";import"./useGetTokenPrice-DOgFQ9vL.mjs";import"./useGetSolPrice-Cfm8o9C5.mjs";import"./index-B24hEnAn.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-C5z76Qhs.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"./TransactionDetails-BBNigCES.mjs";import"./WalletLink-D5DTXYny.mjs";import"./ethers-CUqPIRrW.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"./Layouts-Bmf8DxNP.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";const p={component:()=>{let{user:p}=i(),{data:l}=s(),[u,d]=e(p?.mfaMethods[0]),[h,f]=e(!1),[j,v]=e(),[y,k]=e();if(t((()=>{d(p?.mfaMethods[0])}),[p?.mfaMethods]),!l?.mfaVerify)throw Error("Missing modal data for MFA verification screen.");let{onFailure:g,onSuccess:w,generateOptions:C,verifyTotpCode:M,verifyPasskey:S,verifySmsCode:I,sendSmsCode:b}=l.mfaVerify,P=async o=>{if("passkey"!==o)try{d(o),"sms"===o&&(d(o),await b()),"totp"===o&&d(o)}catch(o){console.error(o)}else try{d(o);let e=await C();if(!e)throw Error("something went wrong");v(e),await S(e),f(!0),k(void 0),w()}catch(o){k(c(o))}},x=async o=>{k(void 0);try{if(!o||!u)return;if("passkey"===u){if(!j)throw Error("Missing passkey challenge");await S(j)}else"sms"===u?await I(o):"totp"===u&&await M(o);k(void 0),f(!0),w()}catch(o){throw c(o).error}},A=()=>{y||!h?g(y?.error??Error("Canceled MFA verification.")):w()},E=r(!1);return t((()=>{!E.current&&u&&(E.current=!0,P(u).finally((()=>{E.current=!1})))}),[open]),p?"passkey"===u?/*#__PURE__*/o(m,{account:p.linkedAccounts.filter((o=>"passkey"===o.type&&o.enrolledInMfa)).sort(((o,e)=>e.firstVerifiedAt.valueOf()-o.firstVerifiedAt.valueOf()))[0],submitSuccess:h,hasBlockingError:y?.isBlocking??!1,error:y?.error,onClose:A,onBack:()=>{d(void 0),k(void 0)},handleSubmit:()=>x(j).catch(k)}):"sms"===u||"totp"===u?/*#__PURE__*/o(n,{selectedMethod:u,submitSuccess:h,hasBlockingError:y?.isBlocking??!1,handleSubmitCode:x,onClose:A,onBack:p.mfaMethods.length>1?()=>d(void 0):void 0}):/*#__PURE__*/o(a,{user:p,onSelect:P,handleClose:A}):null}};export{p as MfaAuthVerifyFlowScreen,p as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import n from"@heroicons/react/24/outline/ShieldCheckIcon";import i from"@heroicons/react/24/solid/CheckBadgeIcon";import l from"@heroicons/react/24/solid/IdentificationIcon";import{useState as a,useEffect as s}from"react";import{P as c,S as m}from"./Button-CrJpeX0e.mjs";import{L as d}from"./useActiveWallet-BdFIc7_K.mjs";import{M as h,a as u}from"./ModalHeader-YP9pLMEP.mjs";import{u as p}from"./context-BOoFAPna.mjs";import{u as f}from"./internal-context-e-Eni5bG.mjs";import{a as y,u as v}from"./get-is-unified-wallet-Ca5aEojK.mjs";import{d as C,f as w,g as k,h as g,i as j,u as b}from"./index-CUao1WyN.mjs";import{M,E as S,a as E,b as I}from"./EnrollTotp-Ds_-ZGUd.mjs";import F from"@heroicons/react/24/outline/CheckCircleIcon";import P from"@heroicons/react/24/outline/PhoneIcon";import{lastFourDigits as R}from"@privy-io/js-sdk-core";import{C as x}from"./ConnectPhoneForm-BeT3tDQM.mjs";import{I as T,T as W,S as L,C as B,a as A,B as N,N as U,A as O,L as D,b as Y,c as $}from"./PinInput-C3_MNxMt.mjs";import{ErrorScreenView as q}from"./ErrorScreen-A7eS3gFZ.mjs";import"styled-components";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CzDMa8gy.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-3r4yfFNg.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";import"tinycolor2";import"ofetch";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CeQ3C1KS.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"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"./LinkPasskeyScreen-75b0FmMc.mjs";import"lucide-react";import"./TodoList-Dn0Qu-vv.mjs";import"./ScreenLayout-t3qtbQ3-.mjs";import"./Screen-CpIMiJNF.mjs";import"./index-CJMgUOnw.mjs";import"./CopyToClipboard-DatKc59_.mjs";import"./copy-Bx2Jwc5_.mjs";import"./Layouts-Bmf8DxNP.mjs";import"./Column-DQ5Vw9t1.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"./shared-CtYf3O54.mjs";import"@heroicons/react/24/solid/ShieldCheckIcon";import"./QrCode-C0_lXRph.mjs";import"qrcode";import"./reservoir-kvLjIrEo.mjs";const H=({appName:t,onComplete:n,onReset:i,onClose:l})=>{let[s,m]=a(""),[d,f]=a(!1),[v,b]=a(null),[M,S]=a("enroll"),{initEnrollmentWithSms:E,submitEnrollmentWithSms:I}=C(),{data:O}=y(),D=p();function Y(){O?.mfaEnrollmentFlow?.onSuccess(),n()}return v?/*#__PURE__*/e(q,{allowlistConfig:D.allowlistConfig,error:v,onBack:()=>b(null),onRetry:()=>b(null)}):/*#__PURE__*/o(r,"enroll"===M?{children:[/*#__PURE__*/e(h,{backFn:i,onClose:l},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(P,{})}),/*#__PURE__*/e(W,{children:"Set up SMS verification"}),/*#__PURE__*/o(L,{children:["We'll text a verification code to this mobile device whenever you use your ",t," ","wallet."]}),/*#__PURE__*/o(B,{children:[/*#__PURE__*/e(x,{onSubmit:async function({qualifiedPhoneNumber:e}){try{await E({phoneNumber:e}),m(e),S("verify")}catch(e){b(e)}},hideRecent:!0}),/*#__PURE__*/o(A,{children:["By providing your mobile number, you agree to receive text messages from ",D?.name,". Some carrier charges may apply"]})]}),/*#__PURE__*/e(u,{})]}:d?{children:[/*#__PURE__*/e(h,{onClose:Y},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(F,{})}),/*#__PURE__*/e(W,{children:"SMS verification added"}),/*#__PURE__*/o(L,{children:["From now on, you'll enter the verification code sent to your mobile device whenever you use your ",t," wallet."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(c,{onClick:Y,children:"Done"})}),/*#__PURE__*/e(u,{})]}:{children:[/*#__PURE__*/e(h,{backFn:function(){"verify"===M?S("enroll"):i()},onClose:l},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(P,{})}),/*#__PURE__*/e(W,{children:"Enter enrollment code"}),/*#__PURE__*/o(B,{children:[/*#__PURE__*/e(U,{onChange:async function(e){try{if(!e)return;await I({phoneNumber:s,mfaCode:e}),f(!0)}catch(e){if(w(e))throw Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.");if(k(e))throw Error("The code you entered is not valid");if(g(e))throw Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.");throw j(e)?Error("Verification canceled"):Error("Unknown error")}}}),/*#__PURE__*/o(L,{children:["To continue, enter the 6-digit code sent to ",/*#__PURE__*/e("strong",{children:R(s)})]})]}),/*#__PURE__*/e(u,{})]})},K={component:()=>{let{user:w,enrollInMfa:k,ready:g}=v(),[j,F]=a(null),{unenrollWithSms:P,unenrollWithTotp:R,unenrollWithPasskey:x,submitEnrollmentWithTotp:A,initEnrollmentWithPasskey:U,submitEnrollmentWithPasskey:q,initEnrollmentWithTotp:K}=C(),{data:Q,onUserCloseViaDialogOrKeybindRef:V}=y(),X=p(),{closePrivyModal:z}=f(),{promptMfa:G}=b(),[J,Z]=a(!1),[_,ee]=a(null),[oe,re]=a(null),te=()=>{z({shouldCallAuthOnSuccess:!0}),k(!1),setTimeout((()=>{F(null),ee(null)}),500)},[ne,ie]=a(!1),[le,ae]=a();V.current=te;let se=w?.mfaMethods.includes("sms"),ce=!!w?.phone,me=w?.mfaMethods.includes("totp"),de=w?.mfaMethods.includes("passkey"),he=se||me||de,ue=w?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function pe(){F(null),ee(null)}async function fe(e=ue){ie(!0);try{return await U(),await q({credentialIds:e},{removeForLogin:Q?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa}),Q?.mfaEnrollmentFlow?.onSuccess(),te()}catch(e){ae(e)}finally{ie(!1)}}if(s((()=>{he&&Z(!0)}),[he]),!g||!w||!X/*#__PURE__*/)return o(r,{children:[/*#__PURE__*/e(h,{onClose:te},"header"),/*#__PURE__*/e(O,{children:/*#__PURE__*/e(M,{})}),/*#__PURE__*/e(B,{children:/*#__PURE__*/e(d,{})}),/*#__PURE__*/e(u,{})]});if("sms"===j)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(h,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(W,{children:"Remove SMS verification?"}),/*#__PURE__*/o(L,{children:["MFA adds an extra layer of security to your ",X?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(c,{$warn:!0,onClick:async function(){F(null);try{await P()}catch(e){F(null)}},children:"Remove"})}),/*#__PURE__*/e(u,{})]});if("totp"===j)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(h,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(W,{children:"Remove authenticator app verification?"}),/*#__PURE__*/o(L,{children:["MFA adds an extra layer of security to your ",X?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(c,{$warn:!0,onClick:async function(){F(null);try{await R()}catch(e){F(null)}},children:"Remove"})}),/*#__PURE__*/e(u,{})]});if("passkey"===j){let n=Q?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(h,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(W,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/e(L,{children:n?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(c,{$warn:!0,onClick:async function(){F(null);try{await x({removeForLogin:Q?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa})}catch(e){F(null)}},children:"Remove"})}),/*#__PURE__*/e(u,{})]})}if(0===Q.mfaEnrollmentFlow.mfaMethods.length&&!he)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(h,{onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(n,{})}),/*#__PURE__*/e(W,{children:"Add more security"}),/*#__PURE__*/o(L,{children:[X?.name," does not have any verification methods enabled."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(c,{onClick:te,children:"Close"})}),/*#__PURE__*/e(u,{})]});let ye=!he&&!J;return ye?/*#__PURE__*/o(r,{children:[/*#__PURE__*/e(h,{onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(n,{})}),/*#__PURE__*/e(W,{children:"Transaction Protection"}),/*#__PURE__*/e(L,{children:"Set up transaction protection to add an extra layer of security to your account"}),/*#__PURE__*/o(D,{children:[/*#__PURE__*/o(Y,{children:[/*#__PURE__*/e($,{children:/*#__PURE__*/e(i,{})}),"Enable 2-Step verification for your ",X?.name," wallet."]}),/*#__PURE__*/o(Y,{children:[/*#__PURE__*/e($,{children:/*#__PURE__*/e(l,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),/*#__PURE__*/o(N,{children:[/*#__PURE__*/e(c,{onClick:()=>Z(!0),children:"Continue"}),/*#__PURE__*/e(m,{onClick:te,children:"Not now"})]}),/*#__PURE__*/e(u,{})]}):"sms"===_?/*#__PURE__*/e(H,{appName:X?.name||"Privy",onComplete:te,onReset:pe,onClose:te}):"totp"===_&&oe?/*#__PURE__*/e(S,{onClose:te,onReset:pe,submitEnrollmentWithTotp:({mfaCode:e})=>async function(e){try{return ae(void 0),await A({mfaCode:e}),Q?.mfaEnrollmentFlow?.onSuccess(),te()}catch(e){ae(e)}finally{F(null)}}(e),totpInfo:{...oe,appName:X?.name||"Privy"}}):"passkey"===_?/*#__PURE__*/e(E,{onReset:pe,onClose:te,submitEnrollmentWithPasskey:fe}):/*#__PURE__*/e(I,{showIntro:ye,userMfaMethods:w.mfaMethods,appMfaMethods:X.mfa.methods,userHasAuthSms:ce,backFn:function(){Z(!1)},handleSelectMethod:async function(e){try{await G()}catch(e){return void ae(e)}return"totp"===e?(ee(e),re(null),void K().then((e=>{re(e)})).catch((()=>{re(null),pe()}))):"passkey"===e&&1===ue.length?await fe():void ee(e)},isTotpLoading:"totp"===_&&!oe,isPasskeyLoading:ne,error:le,onClose:te,setRemovingMfaMethod:async e=>{try{await G()}catch(e){return void ae(e)}F(e)}})}};export{K as MfaEnrollmentFlowScreen,K as default};
1
+ import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import n from"@heroicons/react/24/outline/ShieldCheckIcon";import i from"@heroicons/react/24/solid/CheckBadgeIcon";import l from"@heroicons/react/24/solid/IdentificationIcon";import{useState as a,useEffect as s}from"react";import{P as c,S as m}from"./Button-3JMVXKiE.mjs";import{L as d}from"./useActiveWallet-CBIiGG1k.mjs";import{M as h,a as u}from"./ModalHeader-B27O6soE.mjs";import{u as p}from"./context-BqHnoxK5.mjs";import{u as f}from"./internal-context-e-Eni5bG.mjs";import{a as y,u as v}from"./get-is-unified-wallet-GLvRyJlT.mjs";import{d as C,f as w,g as k,h as g,i as j,u as b}from"./index-B24hEnAn.mjs";import{M,E as S,a as E,b as I}from"./EnrollTotp-BE-JDa07.mjs";import F from"@heroicons/react/24/outline/CheckCircleIcon";import P from"@heroicons/react/24/outline/PhoneIcon";import{lastFourDigits as R}from"@privy-io/js-sdk-core";import{C as x}from"./ConnectPhoneForm-CK2ZaLcy.mjs";import{I as T,T as W,S as L,C as B,a as A,B as N,N as U,A as O,L as D,b as Y,c as $}from"./PinInput-C3_MNxMt.mjs";import{ErrorScreenView as q}from"./ErrorScreen-CR_0-6OL.mjs";import"styled-components";import"zustand";import"react-device-detect";import"./prepareFundingModalData-lYYA8ZfI.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-Aw21dxK9.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";import"tinycolor2";import"ofetch";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-C5z76Qhs.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"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"./LinkPasskeyScreen-Br7W1Zmq.mjs";import"lucide-react";import"./TodoList-Dn0Qu-vv.mjs";import"./ScreenLayout-Dp0ezg8Q.mjs";import"./Screen-Bj-1pwMI.mjs";import"./index-CJMgUOnw.mjs";import"./CopyToClipboard-DatKc59_.mjs";import"./copy-Bx2Jwc5_.mjs";import"./Layouts-Bmf8DxNP.mjs";import"./Column-DQ5Vw9t1.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"./shared-CtYf3O54.mjs";import"@heroicons/react/24/solid/ShieldCheckIcon";import"./QrCode-CGBH7ZqU.mjs";import"qrcode";import"./reservoir-kvLjIrEo.mjs";const H=({appName:t,onComplete:n,onReset:i,onClose:l})=>{let[s,m]=a(""),[d,f]=a(!1),[v,b]=a(null),[M,S]=a("enroll"),{initEnrollmentWithSms:E,submitEnrollmentWithSms:I}=C(),{data:O}=y(),D=p();function Y(){O?.mfaEnrollmentFlow?.onSuccess(),n()}return v?/*#__PURE__*/e(q,{allowlistConfig:D.allowlistConfig,error:v,onBack:()=>b(null),onRetry:()=>b(null)}):/*#__PURE__*/o(r,"enroll"===M?{children:[/*#__PURE__*/e(h,{backFn:i,onClose:l},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(P,{})}),/*#__PURE__*/e(W,{children:"Set up SMS verification"}),/*#__PURE__*/o(L,{children:["We'll text a verification code to this mobile device whenever you use your ",t," ","wallet."]}),/*#__PURE__*/o(B,{children:[/*#__PURE__*/e(x,{onSubmit:async function({qualifiedPhoneNumber:e}){try{await E({phoneNumber:e}),m(e),S("verify")}catch(e){b(e)}},hideRecent:!0}),/*#__PURE__*/o(A,{children:["By providing your mobile number, you agree to receive text messages from ",D?.name,". Some carrier charges may apply"]})]}),/*#__PURE__*/e(u,{})]}:d?{children:[/*#__PURE__*/e(h,{onClose:Y},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(F,{})}),/*#__PURE__*/e(W,{children:"SMS verification added"}),/*#__PURE__*/o(L,{children:["From now on, you'll enter the verification code sent to your mobile device whenever you use your ",t," wallet."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(c,{onClick:Y,children:"Done"})}),/*#__PURE__*/e(u,{})]}:{children:[/*#__PURE__*/e(h,{backFn:function(){"verify"===M?S("enroll"):i()},onClose:l},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(P,{})}),/*#__PURE__*/e(W,{children:"Enter enrollment code"}),/*#__PURE__*/o(B,{children:[/*#__PURE__*/e(U,{onChange:async function(e){try{if(!e)return;await I({phoneNumber:s,mfaCode:e}),f(!0)}catch(e){if(w(e))throw Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.");if(k(e))throw Error("The code you entered is not valid");if(g(e))throw Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.");throw j(e)?Error("Verification canceled"):Error("Unknown error")}}}),/*#__PURE__*/o(L,{children:["To continue, enter the 6-digit code sent to ",/*#__PURE__*/e("strong",{children:R(s)})]})]}),/*#__PURE__*/e(u,{})]})},K={component:()=>{let{user:w,enrollInMfa:k,ready:g}=v(),[j,F]=a(null),{unenrollWithSms:P,unenrollWithTotp:R,unenrollWithPasskey:x,submitEnrollmentWithTotp:A,initEnrollmentWithPasskey:U,submitEnrollmentWithPasskey:q,initEnrollmentWithTotp:K}=C(),{data:Q,onUserCloseViaDialogOrKeybindRef:V}=y(),X=p(),{closePrivyModal:z}=f(),{promptMfa:G}=b(),[J,Z]=a(!1),[_,ee]=a(null),[oe,re]=a(null),te=()=>{z({shouldCallAuthOnSuccess:!0}),k(!1),setTimeout((()=>{F(null),ee(null)}),500)},[ne,ie]=a(!1),[le,ae]=a();V.current=te;let se=w?.mfaMethods.includes("sms"),ce=!!w?.phone,me=w?.mfaMethods.includes("totp"),de=w?.mfaMethods.includes("passkey"),he=se||me||de,ue=w?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function pe(){F(null),ee(null)}async function fe(e=ue){ie(!0);try{return await U(),await q({credentialIds:e},{removeForLogin:Q?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa}),Q?.mfaEnrollmentFlow?.onSuccess(),te()}catch(e){ae(e)}finally{ie(!1)}}if(s((()=>{he&&Z(!0)}),[he]),!g||!w||!X/*#__PURE__*/)return o(r,{children:[/*#__PURE__*/e(h,{onClose:te},"header"),/*#__PURE__*/e(O,{children:/*#__PURE__*/e(M,{})}),/*#__PURE__*/e(B,{children:/*#__PURE__*/e(d,{})}),/*#__PURE__*/e(u,{})]});if("sms"===j)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(h,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(W,{children:"Remove SMS verification?"}),/*#__PURE__*/o(L,{children:["MFA adds an extra layer of security to your ",X?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(c,{$warn:!0,onClick:async function(){F(null);try{await P()}catch(e){F(null)}},children:"Remove"})}),/*#__PURE__*/e(u,{})]});if("totp"===j)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(h,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(W,{children:"Remove authenticator app verification?"}),/*#__PURE__*/o(L,{children:["MFA adds an extra layer of security to your ",X?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(c,{$warn:!0,onClick:async function(){F(null);try{await R()}catch(e){F(null)}},children:"Remove"})}),/*#__PURE__*/e(u,{})]});if("passkey"===j){let n=Q?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(h,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(W,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/e(L,{children:n?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(c,{$warn:!0,onClick:async function(){F(null);try{await x({removeForLogin:Q?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa})}catch(e){F(null)}},children:"Remove"})}),/*#__PURE__*/e(u,{})]})}if(0===Q.mfaEnrollmentFlow.mfaMethods.length&&!he)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(h,{onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(n,{})}),/*#__PURE__*/e(W,{children:"Add more security"}),/*#__PURE__*/o(L,{children:[X?.name," does not have any verification methods enabled."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(c,{onClick:te,children:"Close"})}),/*#__PURE__*/e(u,{})]});let ye=!he&&!J;return ye?/*#__PURE__*/o(r,{children:[/*#__PURE__*/e(h,{onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(n,{})}),/*#__PURE__*/e(W,{children:"Transaction Protection"}),/*#__PURE__*/e(L,{children:"Set up transaction protection to add an extra layer of security to your account"}),/*#__PURE__*/o(D,{children:[/*#__PURE__*/o(Y,{children:[/*#__PURE__*/e($,{children:/*#__PURE__*/e(i,{})}),"Enable 2-Step verification for your ",X?.name," wallet."]}),/*#__PURE__*/o(Y,{children:[/*#__PURE__*/e($,{children:/*#__PURE__*/e(l,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),/*#__PURE__*/o(N,{children:[/*#__PURE__*/e(c,{onClick:()=>Z(!0),children:"Continue"}),/*#__PURE__*/e(m,{onClick:te,children:"Not now"})]}),/*#__PURE__*/e(u,{})]}):"sms"===_?/*#__PURE__*/e(H,{appName:X?.name||"Privy",onComplete:te,onReset:pe,onClose:te}):"totp"===_&&oe?/*#__PURE__*/e(S,{onClose:te,onReset:pe,submitEnrollmentWithTotp:({mfaCode:e})=>async function(e){try{return ae(void 0),await A({mfaCode:e}),Q?.mfaEnrollmentFlow?.onSuccess(),te()}catch(e){ae(e)}finally{F(null)}}(e),totpInfo:{...oe,appName:X?.name||"Privy"}}):"passkey"===_?/*#__PURE__*/e(E,{onReset:pe,onClose:te,submitEnrollmentWithPasskey:fe}):/*#__PURE__*/e(I,{showIntro:ye,userMfaMethods:w.mfaMethods,appMfaMethods:X.mfa.methods,userHasAuthSms:ce,backFn:function(){Z(!1)},handleSelectMethod:async function(e){try{await G()}catch(e){return void ae(e)}return"totp"===e?(ee(e),re(null),void K().then((e=>{re(e)})).catch((()=>{re(null),pe()}))):"passkey"===e&&1===ue.length?await fe():void ee(e)},isTotpLoading:"totp"===_&&!oe,isPasskeyLoading:ne,error:le,onClose:te,setRemovingMfaMethod:async e=>{try{await G()}catch(e){return void ae(e)}F(e)}})}};export{K as MfaEnrollmentFlowScreen,K as default};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{useState as t,useEffect as e,useRef as r}from"react";import{u as i}from"./get-is-unified-wallet-Ca5aEojK.mjs";import{u as n}from"./index-CUao1WyN.mjs";import{V as m,a as s,b as c,t as a}from"./to-ui-error-BuXu0iWM.mjs";import"viem";import"./context-BOoFAPna.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-BdFIc7_K.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-CzDMa8gy.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-3r4yfFNg.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CeQ3C1KS.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"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"./ModalHeader-YP9pLMEP.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"./ScreenLayout-t3qtbQ3-.mjs";import"./Button-CrJpeX0e.mjs";import"./Screen-CpIMiJNF.mjs";import"./index-CJMgUOnw.mjs";import"./PinInput-C3_MNxMt.mjs";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./StackedContainer-BrIQsdas.mjs";import"./useGetTokenPrice-Cw9UgOp3.mjs";import"./useGetSolPrice-Cfm8o9C5.mjs";import"./TransactionDetails-Dpy5T9tM.mjs";import"./WalletLink-DFEVbh0m.mjs";import"./ethers-DnpKeAXc.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"./Layouts-Bmf8DxNP.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";const p=({onClose:p})=>{let{user:l}=i(),[u,d]=t(l?.mfaMethods[0]??null),{init:h,cancel:j,submit:f}=n(),[v,y]=t(!1),[k,g]=t(null),[w,b]=t();e((()=>{d(l?.mfaMethods[0]??null)}),[l?.mfaMethods]);let C=r(!1);async function I(o){b(void 0);try{if(!o||!u)return;await f(u,o),y(!0),b(void 0),p()}catch(o){throw a(o).error}}async function M(o){if("passkey"!==o)try{d(o),await h(o)}catch(o){console.error(o)}else try{d(o);let t=await h(o);if(!t)throw Error("something went wrong");g(t),await f(o,t),y(!0),b(void 0),p()}catch(o){b(a(o))}}e((()=>{!C.current&&u&&(C.current=!0,M(u).finally((()=>{C.current=!1})))}),[]);let S=()=>{d(null),b(void 0),j(),p()};return l?"passkey"===u?/*#__PURE__*/o(m,{account:l.linkedAccounts.filter((o=>"passkey"===o.type&&o.enrolledInMfa)).sort(((o,t)=>t.firstVerifiedAt.valueOf()-o.firstVerifiedAt.valueOf()))[0],submitSuccess:v,hasBlockingError:w?.isBlocking??!1,error:w?.error,onClose:S,onBack:()=>{d(null),b(void 0)},handleSubmit:()=>I(k).catch(b)}):u?/*#__PURE__*/o(s,{submitSuccess:v,hasBlockingError:w?.isBlocking??!1,handleSubmitCode:I,selectedMethod:u,onClose:S,onBack:l.mfaMethods.length>1?()=>d(null):void 0}):/*#__PURE__*/o(c,{user:l,onSelect:M,handleClose:S}):null};export{p as MfaVerifyFlowScreen,p as default};
1
+ import{jsx as o}from"react/jsx-runtime";import{useState as t,useEffect as e,useRef as r}from"react";import{u as i}from"./get-is-unified-wallet-GLvRyJlT.mjs";import{u as n}from"./index-B24hEnAn.mjs";import{V as m,a as s,b as c,t as a}from"./to-ui-error-ySeuG-hJ.mjs";import"viem";import"./context-BqHnoxK5.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CBIiGG1k.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-lYYA8ZfI.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-Aw21dxK9.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-C5z76Qhs.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"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"./ModalHeader-B27O6soE.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"./ScreenLayout-Dp0ezg8Q.mjs";import"./Button-3JMVXKiE.mjs";import"./Screen-Bj-1pwMI.mjs";import"./index-CJMgUOnw.mjs";import"./PinInput-C3_MNxMt.mjs";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./StackedContainer-BrIQsdas.mjs";import"./useGetTokenPrice-DOgFQ9vL.mjs";import"./useGetSolPrice-Cfm8o9C5.mjs";import"./TransactionDetails-BBNigCES.mjs";import"./WalletLink-D5DTXYny.mjs";import"./ethers-CUqPIRrW.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"./Layouts-Bmf8DxNP.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";const p=({onClose:p})=>{let{user:l}=i(),[u,d]=t(l?.mfaMethods[0]??null),{init:h,cancel:j,submit:f}=n(),[v,y]=t(!1),[k,g]=t(null),[w,b]=t();e((()=>{d(l?.mfaMethods[0]??null)}),[l?.mfaMethods]);let C=r(!1);async function I(o){b(void 0);try{if(!o||!u)return;await f(u,o),y(!0),b(void 0),p()}catch(o){throw a(o).error}}async function M(o){if("passkey"!==o)try{d(o),await h(o)}catch(o){console.error(o)}else try{d(o);let t=await h(o);if(!t)throw Error("something went wrong");g(t),await f(o,t),y(!0),b(void 0),p()}catch(o){b(a(o))}}e((()=>{!C.current&&u&&(C.current=!0,M(u).finally((()=>{C.current=!1})))}),[]);let S=()=>{d(null),b(void 0),j(),p()};return l?"passkey"===u?/*#__PURE__*/o(m,{account:l.linkedAccounts.filter((o=>"passkey"===o.type&&o.enrolledInMfa)).sort(((o,t)=>t.firstVerifiedAt.valueOf()-o.firstVerifiedAt.valueOf()))[0],submitSuccess:v,hasBlockingError:w?.isBlocking??!1,error:w?.error,onClose:S,onBack:()=>{d(null),b(void 0)},handleSubmit:()=>I(k).catch(b)}):u?/*#__PURE__*/o(s,{submitSuccess:v,hasBlockingError:w?.isBlocking??!1,handleSubmitCode:I,selectedMethod:u,onClose:S,onBack:l.mfaMethods.length>1?()=>d(null):void 0}):/*#__PURE__*/o(c,{user:l,onSelect:M,handleClose:S}):null};export{p as MfaVerifyFlowScreen,p as default};