@privy-io/react-auth 3.9.0 → 3.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/dist/cjs/{AccountNotFoundScreen-C0im9fAJ.js → AccountNotFoundScreen-BjG_YLcK.js} +1 -1
  2. package/dist/cjs/{Address-Doz93lgh.js → Address-5znFAhQw.js} +1 -1
  3. package/dist/cjs/{AffirmativeConsentScreen-OgvUs4oT.js → AffirmativeConsentScreen-BiwTOLaX.js} +1 -1
  4. package/dist/cjs/{AllowlistRejectionScreen-CBfQZVO7.js → AllowlistRejectionScreen-DOZr-QmF.js} +1 -1
  5. package/dist/cjs/{AuthenticateWithWalletScreen-B4aHQC44.js → AuthenticateWithWalletScreen-BO4ml_zL.js} +1 -1
  6. package/dist/cjs/{AwaitingEvmToSolBridgingScreen-Cz2E1cWa.js → AwaitingEvmToSolBridgingScreen-DCvvtPfy.js} +1 -1
  7. package/dist/cjs/{AwaitingExternalEthereumTransferScreen-Ca1z7D4v.js → AwaitingExternalEthereumTransferScreen-DXSQjzHX.js} +1 -1
  8. package/dist/cjs/{AwaitingPasswordlessCodeScreen-DDws79F8.js → AwaitingPasswordlessCodeScreen-COP_Jshz.js} +1 -1
  9. package/dist/cjs/{AwaitingSolToEvmBridgingScreen-DlTJafw4.js → AwaitingSolToEvmBridgingScreen-tGqHxf1K.js} +1 -1
  10. package/dist/cjs/{BridgeNetworkSelectionView-Cg3JjiFh.js → BridgeNetworkSelectionView-DgFjMLY3.js} +1 -1
  11. package/dist/cjs/{Button-DpuRzAgk.js → Button-Bm_Ft0Dw.js} +1 -1
  12. package/dist/cjs/{CaptchaScreen-DrvkYUK-.js → CaptchaScreen-BvyOQUvH.js} +1 -1
  13. package/dist/cjs/{CoinbaseOnrampStatusScreen-Cfbivt0s.js → CoinbaseOnrampStatusScreen-9G_2yIQ-.js} +1 -1
  14. package/dist/cjs/{ConnectEmailForm-DeN1Pg_E.js → ConnectEmailForm-D0Xd9Tnw.js} +1 -1
  15. package/dist/cjs/{ConnectLedgerScreen-F3-JADjW.js → ConnectLedgerScreen-COTQ1lqK.js} +1 -1
  16. package/dist/cjs/{ConnectOnlyLandingScreen-DQ9hxL8H.js → ConnectOnlyLandingScreen-DErN9BXL.js} +1 -1
  17. package/dist/cjs/{ConnectOnlyStatusScreen-YPhacltK.js → ConnectOnlyStatusScreen-DKhKRV2M.js} +1 -1
  18. package/dist/cjs/ConnectOrCreateScreen-54nvcrr7.js +1 -0
  19. package/dist/cjs/{ConnectPhoneForm-CIaHyHT9.js → ConnectPhoneForm-WT8rso3i.js} +1 -1
  20. package/dist/cjs/ConnectWalletView-DsOX-lHz.js +1 -0
  21. package/dist/cjs/{ConnectionStatusScreen-Dg1LMsi6.js → ConnectionStatusScreen-C1nqbW_A.js} +1 -1
  22. package/dist/cjs/CrossAppAuthScreen-weeiAu3O.js +1 -0
  23. package/dist/cjs/CustomLandingScreenView-DQLDU2GD.js +2 -0
  24. package/dist/cjs/{DelegatedActionsConsentScreen-CP9xV4-_.js → DelegatedActionsConsentScreen-C_-0aHwH.js} +1 -1
  25. package/dist/cjs/{DelegatedActionsRevokeScreen-QrgQlVmp.js → DelegatedActionsRevokeScreen-SZkD3b1o.js} +1 -1
  26. package/dist/cjs/{EmbeddedWalletConnectingScreen-Ccb4geKv.js → EmbeddedWalletConnectingScreen-VdpmfKNX.js} +1 -1
  27. package/dist/cjs/{EmbeddedWalletCreatedScreen-DTRBR5WW.js → EmbeddedWalletCreatedScreen-CfEf4KkH.js} +1 -1
  28. package/dist/cjs/{EmbeddedWalletKeyExportScreen-B1Ezr57N.js → EmbeddedWalletKeyExportScreen-D0NE_HvJ.js} +1 -1
  29. package/dist/cjs/{EmbeddedWalletOnAccountCreateScreen-0v1ZwZgX.js → EmbeddedWalletOnAccountCreateScreen-CrJFTRI0.js} +1 -1
  30. package/dist/cjs/{EmbeddedWalletPasswordUpdateScreen-DJr1d2fN.js → EmbeddedWalletPasswordUpdateScreen-CjVK53bu.js} +1 -1
  31. package/dist/cjs/{EmbeddedWalletPasswordUpdateSplashScreen-Slns6kTr.js → EmbeddedWalletPasswordUpdateSplashScreen-CVldlThA.js} +1 -1
  32. package/dist/cjs/{EnrollTotp-zJR3l-q0.js → EnrollTotp-BVeDTQ5J.js} +1 -1
  33. package/dist/cjs/{ErrorScreen-DAUNTckD.js → ErrorScreen-BSjRGrRR.js} +1 -1
  34. package/dist/cjs/{FarcasterConnectStatusScreen-C3PPAnT1.js → FarcasterConnectStatusScreen-B7Ab3ddi.js} +1 -1
  35. package/dist/cjs/{FarcasterSignerStatusScreen-BMd0iB8M.js → FarcasterSignerStatusScreen-Bf--BYd8.js} +1 -1
  36. package/dist/cjs/{FundSolWalletWithExternalSolanaWallet-u8DS0vOP.js → FundSolWalletWithExternalSolanaWallet-DcRxhkRg.js} +2 -2
  37. package/dist/cjs/{FundWalletMethodHeader-DFV8N4os.js → FundWalletMethodHeader-BKgYjMau.js} +1 -1
  38. package/dist/cjs/{FundingEditAmountScreen-DXA8k8zQ.js → FundingEditAmountScreen-Bs3_avzr.js} +1 -1
  39. package/dist/cjs/{FundingMethodSelectionScreen-tlU_tfXm.js → FundingMethodSelectionScreen-C_cbW1TC.js} +1 -1
  40. package/dist/cjs/{InAppBrowserLoginNotPossible-BB_zYdr4.js → InAppBrowserLoginNotPossible-CySpQd3Y.js} +1 -1
  41. package/dist/cjs/{InstallWalletScreen-sNsX0qIj.js → InstallWalletScreen-rFpE2-7H.js} +1 -1
  42. package/dist/cjs/LandingScreen-BmZWpgb3.js +1 -0
  43. package/dist/cjs/{LinkConflictScreen-CwA2g0DP.js → LinkConflictScreen-DSIPReKB.js} +1 -1
  44. package/dist/cjs/{LinkEmailScreen-DExuIdVG.js → LinkEmailScreen-Dc8QC15P.js} +1 -1
  45. package/dist/cjs/{LinkPasskeyScreen-DXLAama3.js → LinkPasskeyScreen-CUMuhJ2Q.js} +1 -1
  46. package/dist/cjs/{LinkPhoneScreen-BGKi4PVT.js → LinkPhoneScreen-bozyY6A1.js} +1 -1
  47. package/dist/cjs/{LoginFailedScreen-BMAuqJva.js → LoginFailedScreen-C4gl1Ezs.js} +1 -1
  48. package/dist/cjs/{ManualTransferScreen-Dg8uGXZw.js → ManualTransferScreen-BTj8KQgY.js} +1 -1
  49. package/dist/cjs/{MfaAuthEnrollmentFlowScreen-BZ1svjjW.js → MfaAuthEnrollmentFlowScreen-cmFsgDp4.js} +1 -1
  50. package/dist/cjs/{MfaAuthVerifyFlowScreen-CJhMSZ1r.js → MfaAuthVerifyFlowScreen-DEC3hYOD.js} +1 -1
  51. package/dist/cjs/{MfaEnrollmentFlowScreen-DvxX-vrH.js → MfaEnrollmentFlowScreen-3lOG0uKv.js} +1 -1
  52. package/dist/cjs/{MfaVerifyFlowScreen-BWPqGNNj.js → MfaVerifyFlowScreen-aRH0rn8s.js} +1 -1
  53. package/dist/cjs/{ModalHeader-4MV7Tgk7.js → ModalHeader-DB7Tbjwz.js} +1 -1
  54. package/dist/cjs/{MoonpayStatusScreen-Cd_71Pyq.js → MoonpayStatusScreen-DANoQOd5.js} +1 -1
  55. package/dist/cjs/{OAuthStatusScreen-ZTRfDJXT.js → OAuthStatusScreen-DsGkPiMe.js} +1 -1
  56. package/dist/cjs/{PasskeySelectSignupOrLogin-CQZM_RDH.js → PasskeySelectSignupOrLogin-D9Wfb44J.js} +1 -1
  57. package/dist/cjs/{PasskeyStatusScreen-BM1Mvl9i.js → PasskeyStatusScreen-DAxg2zUJ.js} +1 -1
  58. package/dist/cjs/{PasswordRecoveryScreen-CvVt6RGf.js → PasswordRecoveryScreen-CJfW4kpk.js} +1 -1
  59. package/dist/cjs/{QrCode-DvJPyneT.js → QrCode-DsQD8cG6.js} +1 -1
  60. package/dist/cjs/{RecoveryOAuthStatusScreen-Cg2ntkgK.js → RecoveryOAuthStatusScreen-_R1gExdU.js} +1 -1
  61. package/dist/cjs/{RecoveryPasswordCreateScreen-dGZOvD2x.js → RecoveryPasswordCreateScreen-Cb-gcVc8.js} +1 -1
  62. package/dist/cjs/{RecoverySelectionScreen-DBAg2tyX.js → RecoverySelectionScreen-CZOXXRGl.js} +1 -1
  63. package/dist/cjs/{Screen-CJM19YNL.js → Screen-D9Tvi297.js} +1 -1
  64. package/dist/cjs/{ScreenLayout-Bbhw-EIr.js → ScreenLayout-BeH-Q6N2.js} +1 -1
  65. package/dist/cjs/{SetAutomaticRecoveryScreen-C65Py491.js → SetAutomaticRecoveryScreen-BSDQb_dJ.js} +1 -1
  66. package/dist/cjs/{SetWalletPasswordForm-Bx4bpcUs.js → SetWalletPasswordForm-C3YB2v_1.js} +1 -1
  67. package/dist/cjs/{SignRequestScreen-Dy8xnXXp.js → SignRequestScreen-DW3SnJi5.js} +1 -1
  68. package/dist/cjs/{StandardSignAndSendTransactionScreen-x1O5yfj4.js → StandardSignAndSendTransactionScreen-Cima1YEn.js} +1 -1
  69. package/dist/cjs/{TelegramAuthScreen-DaxoKw-V.js → TelegramAuthScreen-pfwAx0uQ.js} +1 -1
  70. package/dist/cjs/{TransactionDetails-DvBQbDgX.js → TransactionDetails-KB5Wyu1l.js} +1 -1
  71. package/dist/cjs/{TransactionErrorView-BdTYgWfc.js → TransactionErrorView-SaY08uTA.js} +1 -1
  72. package/dist/cjs/TransferFromWalletScreen-DVzjB3Gc.js +1 -0
  73. package/dist/cjs/TransferOrBridgeLoadingScreen-B3zo8l43.js +1 -0
  74. package/dist/cjs/{UpdateEmailScreen-BtndcDiP.js → UpdateEmailScreen-CwWKZeJR.js} +1 -1
  75. package/dist/cjs/{UpdatePhoneScreen-BQb3cbdX.js → UpdatePhoneScreen-B84E2DOe.js} +1 -1
  76. package/dist/cjs/{UserLimitReachedScreen-Ctgox4aT.js → UserLimitReachedScreen-CQMqK5QW.js} +1 -1
  77. package/dist/cjs/{WalletInfoCard-DQtI0K25.js → WalletInfoCard-DKVdH9iF.js} +1 -1
  78. package/dist/cjs/{WalletInterstitialScreen-HfTntL7I.js → WalletInterstitialScreen-0cBKaDQ1.js} +1 -1
  79. package/dist/cjs/{WalletLink-CbnPrVEH.js → WalletLink-GY0_Tmtg.js} +1 -1
  80. package/dist/cjs/WalletOverflowButton-iCeXR9aA.js +1 -0
  81. package/dist/cjs/abstract-smart-wallets.js +1 -1
  82. package/dist/cjs/context-DFq1obBO.js +1 -0
  83. package/dist/cjs/{ethers-BwK3McWK.js → ethers-DZGJ4Y5i.js} +1 -1
  84. package/dist/cjs/extended-chains.js +1 -1
  85. package/dist/cjs/{get-is-unified-wallet-CHHPpmxX.js → get-is-unified-wallet-D4ouXJpi.js} +1 -1
  86. package/dist/cjs/{index-D7QitaMz.js → index-BQai4Vqd.js} +1 -1
  87. package/dist/cjs/{index-DiPPDo6V.js → index-CKB4VKFb.js} +1 -1
  88. package/dist/cjs/{index-4-C2N_7K.js → index-NJrQkxJ7.js} +3 -3
  89. package/dist/cjs/index.js +1 -1
  90. package/dist/cjs/internal.js +1 -1
  91. package/dist/cjs/{prepareFundingModalData-Bap-QRCV.js → prepareFundingModalData-Cnd6rhhJ.js} +1 -1
  92. package/dist/cjs/{shared-BjdszO5f.js → shared-CCAyvw5i.js} +1 -1
  93. package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-CuHR6wvs.js → shouldProceedtoEmbeddedWalletCreationFlow-DZvEYqlO.js} +1 -1
  94. package/dist/cjs/{smart-wallets-Cb8qgePj.js → smart-wallets-CV78p-ta.js} +1 -1
  95. package/dist/cjs/smart-wallets.js +1 -1
  96. package/dist/cjs/solana.js +1 -1
  97. package/dist/cjs/{to-ui-error-C_N9DMza.js → to-ui-error-ER-8XlJF.js} +1 -1
  98. package/dist/cjs/ui.js +1 -1
  99. package/dist/cjs/{use-create-wallet-without-fallback-y9YpooGA.js → use-create-wallet-without-fallback-q0_yd_V9.js} +1 -1
  100. package/dist/cjs/{use-export-wallet-CmWKVG5J.js → use-export-wallet-DKaavHqM.js} +1 -1
  101. package/dist/cjs/{useActiveWallet-B5cSS56I.js → useActiveWallet-BOX8xCn9.js} +1 -1
  102. package/dist/cjs/{useGetTokenPrice-CdW08dO7.js → useGetTokenPrice-BHq-guWz.js} +1 -1
  103. package/dist/cjs/{useI18n-D21RT6EH.js → useI18n-CY6Et_lH.js} +1 -1
  104. package/dist/cjs/{usePrivy-DobNyfbl.js → usePrivy-CcfSRv1R.js} +1 -1
  105. package/dist/cjs/{useSolanaRpcClient-ZoxUaxNS.js → useSolanaRpcClient-TQdbjNyx.js} +1 -1
  106. package/dist/cjs/{useWallets-DPdw6ah8.js → useWallets-BLFNjTwC.js} +1 -1
  107. package/dist/cjs/{useWallets-Z7ZZY1fI.js → useWallets-oPpMUdRR.js} +1 -1
  108. package/dist/dts/{events-context-D8iPaW-H.d.ts → events-context-BYT6PpDG.d.mts} +1 -1
  109. package/dist/dts/{events-context-D8iPaW-H.d.mts → events-context-BYT6PpDG.d.ts} +1 -1
  110. package/dist/dts/extended-chains.d.mts +1 -1
  111. package/dist/dts/extended-chains.d.ts +1 -1
  112. package/dist/dts/farcaster.d.mts +1 -1
  113. package/dist/dts/farcaster.d.ts +1 -1
  114. package/dist/dts/index.d.mts +26 -4
  115. package/dist/dts/index.d.ts +26 -4
  116. package/dist/dts/internal.d.mts +1 -1
  117. package/dist/dts/internal.d.ts +1 -1
  118. package/dist/dts/smart-wallets.d.mts +1 -1
  119. package/dist/dts/smart-wallets.d.ts +1 -1
  120. package/dist/dts/solana.d.mts +3 -3
  121. package/dist/dts/solana.d.ts +3 -3
  122. package/dist/dts/{types-diVZpIb-.d.mts → types-D7U23FgR.d.mts} +2 -0
  123. package/dist/dts/{types-diVZpIb-.d.ts → types-D7U23FgR.d.ts} +2 -0
  124. package/dist/dts/ui.d.mts +1 -1
  125. package/dist/dts/ui.d.ts +1 -1
  126. package/dist/esm/{AccountNotFoundScreen-CvMiU7Tz.mjs → AccountNotFoundScreen-Bk2ZDlxR.mjs} +1 -1
  127. package/dist/esm/{Address-CDOE2oK9.mjs → Address-BsvZLUXE.mjs} +1 -1
  128. package/dist/esm/{AffirmativeConsentScreen-Cia_UEaD.mjs → AffirmativeConsentScreen-CMcGT-7c.mjs} +1 -1
  129. package/dist/esm/{AllowlistRejectionScreen-DMqAO2Y-.mjs → AllowlistRejectionScreen-CgdkdFzy.mjs} +1 -1
  130. package/dist/esm/{AuthenticateWithWalletScreen-DvzZViMZ.mjs → AuthenticateWithWalletScreen-fhyjSxI8.mjs} +1 -1
  131. package/dist/esm/{AwaitingEvmToSolBridgingScreen-BSG_hKyl.mjs → AwaitingEvmToSolBridgingScreen-DbNP1yPY.mjs} +1 -1
  132. package/dist/esm/{AwaitingExternalEthereumTransferScreen-BcZRmV50.mjs → AwaitingExternalEthereumTransferScreen-COnzLcDW.mjs} +1 -1
  133. package/dist/esm/{AwaitingPasswordlessCodeScreen-Dd7TblcM.mjs → AwaitingPasswordlessCodeScreen-D9BoqETu.mjs} +1 -1
  134. package/dist/esm/{AwaitingSolToEvmBridgingScreen-BD1wkQFf.mjs → AwaitingSolToEvmBridgingScreen-JY-d6qlj.mjs} +1 -1
  135. package/dist/esm/{BridgeNetworkSelectionView-DSCjcHJX.mjs → BridgeNetworkSelectionView-Dn5uqa3q.mjs} +1 -1
  136. package/dist/esm/{Button-DJY5dut3.mjs → Button-B8mqatRx.mjs} +1 -1
  137. package/dist/esm/{CaptchaScreen-CapFNnoZ.mjs → CaptchaScreen-D3uGo3qJ.mjs} +1 -1
  138. package/dist/esm/{CoinbaseOnrampStatusScreen-DbQEEYPn.mjs → CoinbaseOnrampStatusScreen-Ce2Z_vJB.mjs} +1 -1
  139. package/dist/esm/{ConnectEmailForm-Cs3r5aBq.mjs → ConnectEmailForm--PZXgvw4.mjs} +1 -1
  140. package/dist/esm/{ConnectLedgerScreen-EYZ2eRpE.mjs → ConnectLedgerScreen-CRDZ_shP.mjs} +1 -1
  141. package/dist/esm/{ConnectOnlyLandingScreen-BM747X2V.mjs → ConnectOnlyLandingScreen-NSgaj_D4.mjs} +1 -1
  142. package/dist/esm/{ConnectOnlyStatusScreen-CW3W1N8z.mjs → ConnectOnlyStatusScreen-DAGVWgFv.mjs} +1 -1
  143. package/dist/esm/ConnectOrCreateScreen-CuVcGxrh.mjs +1 -0
  144. package/dist/esm/{ConnectPhoneForm-Ft9zAuQd.mjs → ConnectPhoneForm-DoYmHBv3.mjs} +1 -1
  145. package/dist/esm/ConnectWalletView-eQbJO3Pg.mjs +1 -0
  146. package/dist/esm/{ConnectionStatusScreen-nzx3dVCV.mjs → ConnectionStatusScreen-DVtobAVi.mjs} +1 -1
  147. package/dist/esm/CrossAppAuthScreen-B0633bnY.mjs +1 -0
  148. package/dist/esm/CustomLandingScreenView-DNbO8W7v.mjs +2 -0
  149. package/dist/esm/{DelegatedActionsConsentScreen-C35m_lng.mjs → DelegatedActionsConsentScreen-Cm3QtgBC.mjs} +1 -1
  150. package/dist/esm/{DelegatedActionsRevokeScreen-h4GhIT-2.mjs → DelegatedActionsRevokeScreen-C2WBGR2c.mjs} +1 -1
  151. package/dist/esm/{EmbeddedWalletConnectingScreen-CrgNS1_v.mjs → EmbeddedWalletConnectingScreen-CpKPkmKa.mjs} +1 -1
  152. package/dist/esm/{EmbeddedWalletCreatedScreen-BhSPSO8A.mjs → EmbeddedWalletCreatedScreen-CMyRcNaG.mjs} +1 -1
  153. package/dist/esm/{EmbeddedWalletKeyExportScreen-BlAL_BUV.mjs → EmbeddedWalletKeyExportScreen-nkSO3O1P.mjs} +1 -1
  154. package/dist/esm/{EmbeddedWalletOnAccountCreateScreen-Xz2dhW-I.mjs → EmbeddedWalletOnAccountCreateScreen-rwdmo9iN.mjs} +1 -1
  155. package/dist/esm/{EmbeddedWalletPasswordUpdateScreen-DQbd-pAr.mjs → EmbeddedWalletPasswordUpdateScreen-Tcp68U7U.mjs} +1 -1
  156. package/dist/esm/{EmbeddedWalletPasswordUpdateSplashScreen-9VnFkswr.mjs → EmbeddedWalletPasswordUpdateSplashScreen-5PH-3FQ3.mjs} +1 -1
  157. package/dist/esm/{EnrollTotp-twiE9SrW.mjs → EnrollTotp-ULLNt8tl.mjs} +1 -1
  158. package/dist/esm/{ErrorScreen-CTI5XNc0.mjs → ErrorScreen-BdxNEgU1.mjs} +1 -1
  159. package/dist/esm/{FarcasterConnectStatusScreen-26MCKeUz.mjs → FarcasterConnectStatusScreen-CruCPzPD.mjs} +1 -1
  160. package/dist/esm/{FarcasterSignerStatusScreen-YwCO1kz9.mjs → FarcasterSignerStatusScreen-DBAyc7bd.mjs} +1 -1
  161. package/dist/esm/{FundSolWalletWithExternalSolanaWallet-B3w3-z6B.mjs → FundSolWalletWithExternalSolanaWallet-Fxpj9pEN.mjs} +1 -1
  162. package/dist/esm/{FundWalletMethodHeader-CN-93vVj.mjs → FundWalletMethodHeader-I8a6Y30s.mjs} +1 -1
  163. package/dist/esm/{FundingEditAmountScreen-Cz6ZAJlk.mjs → FundingEditAmountScreen-yKYKiyG9.mjs} +1 -1
  164. package/dist/esm/{FundingMethodSelectionScreen-B85fzSsC.mjs → FundingMethodSelectionScreen-Dr-QG6BQ.mjs} +1 -1
  165. package/dist/esm/{InAppBrowserLoginNotPossible-CPsaFweG.mjs → InAppBrowserLoginNotPossible-BYO_nlWy.mjs} +1 -1
  166. package/dist/esm/{InstallWalletScreen-D5mGXNHF.mjs → InstallWalletScreen-Cma1GXX4.mjs} +1 -1
  167. package/dist/esm/LandingScreen-DCR5C-gA.mjs +1 -0
  168. package/dist/esm/{LinkConflictScreen-D8y5of24.mjs → LinkConflictScreen-C8kM_4ZL.mjs} +1 -1
  169. package/dist/esm/{LinkEmailScreen-C9lKAk-L.mjs → LinkEmailScreen-DsrprT7p.mjs} +1 -1
  170. package/dist/esm/{LinkPasskeyScreen-C33kWVrX.mjs → LinkPasskeyScreen-yKY5ebtx.mjs} +1 -1
  171. package/dist/esm/{LinkPhoneScreen-Bi98Ngac.mjs → LinkPhoneScreen-BklMbJs1.mjs} +1 -1
  172. package/dist/esm/{LoginFailedScreen-BX7s2pm7.mjs → LoginFailedScreen-CVGjcD9g.mjs} +1 -1
  173. package/dist/esm/ManualTransferScreen-C6MTkQcg.mjs +1 -0
  174. package/dist/esm/{MfaAuthEnrollmentFlowScreen-BBOfIRfA.mjs → MfaAuthEnrollmentFlowScreen-BrEYUoOi.mjs} +1 -1
  175. package/dist/esm/{MfaAuthVerifyFlowScreen-CwZbfXVc.mjs → MfaAuthVerifyFlowScreen-D_LbAt1N.mjs} +1 -1
  176. package/dist/esm/{MfaEnrollmentFlowScreen-Dq5X_CVZ.mjs → MfaEnrollmentFlowScreen-BseHvqlH.mjs} +1 -1
  177. package/dist/esm/{MfaVerifyFlowScreen-DGylIeVO.mjs → MfaVerifyFlowScreen-DB8BFfTJ.mjs} +1 -1
  178. package/dist/esm/{ModalHeader-DHXUvTf4.mjs → ModalHeader-BLGC-7ev.mjs} +1 -1
  179. package/dist/esm/{MoonpayStatusScreen-Boj9S0LW.mjs → MoonpayStatusScreen-D-Qnyxst.mjs} +1 -1
  180. package/dist/esm/{OAuthStatusScreen-DLvm8CkQ.mjs → OAuthStatusScreen-pEjYhAdx.mjs} +1 -1
  181. package/dist/esm/{PasskeySelectSignupOrLogin-62N4Cj_4.mjs → PasskeySelectSignupOrLogin-CmmjfwZM.mjs} +1 -1
  182. package/dist/esm/{PasskeyStatusScreen-DE8Ez-Rl.mjs → PasskeyStatusScreen-AiT-3Rq0.mjs} +1 -1
  183. package/dist/esm/{PasswordRecoveryScreen-CxXsaYPM.mjs → PasswordRecoveryScreen-BW7BBSLI.mjs} +1 -1
  184. package/dist/esm/{QrCode-CbRLsYtm.mjs → QrCode-DR5LogOp.mjs} +1 -1
  185. package/dist/esm/{RecoveryOAuthStatusScreen-9ETDOsJ0.mjs → RecoveryOAuthStatusScreen-BGxGq84t.mjs} +1 -1
  186. package/dist/esm/{RecoveryPasswordCreateScreen-CZizgkaK.mjs → RecoveryPasswordCreateScreen-Brv0MUPN.mjs} +1 -1
  187. package/dist/esm/{RecoverySelectionScreen-CDzuMgIx.mjs → RecoverySelectionScreen-CluXGpRG.mjs} +1 -1
  188. package/dist/esm/{Screen-CKaxnxac.mjs → Screen-BTyXgDrd.mjs} +1 -1
  189. package/dist/esm/{ScreenLayout-BQ6FV6yc.mjs → ScreenLayout-CddsD3Of.mjs} +1 -1
  190. package/dist/esm/{SetAutomaticRecoveryScreen-D5x6hDUL.mjs → SetAutomaticRecoveryScreen-nXcm7pIi.mjs} +1 -1
  191. package/dist/esm/{SetWalletPasswordForm-DelBzpVM.mjs → SetWalletPasswordForm-DvgKP4Ez.mjs} +1 -1
  192. package/dist/esm/{SignRequestScreen-BA5JF3Hr.mjs → SignRequestScreen-Cp5zIIZ3.mjs} +1 -1
  193. package/dist/esm/{StandardSignAndSendTransactionScreen-CiJd6Wf9.mjs → StandardSignAndSendTransactionScreen-bbPFP1pO.mjs} +1 -1
  194. package/dist/esm/{TelegramAuthScreen-zZOkgtJy.mjs → TelegramAuthScreen-DorSPB8G.mjs} +1 -1
  195. package/dist/esm/{TransactionDetails-B2vXU-k4.mjs → TransactionDetails-Bb1NEpUH.mjs} +1 -1
  196. package/dist/esm/{TransactionErrorView-DOcJFQEX.mjs → TransactionErrorView-CfyBAYzV.mjs} +2 -2
  197. package/dist/esm/TransferFromWalletScreen-BeSvua3b.mjs +1 -0
  198. package/dist/esm/{TransferOrBridgeLoadingScreen-B-uvt7Fj.mjs → TransferOrBridgeLoadingScreen-D5Y_FQAB.mjs} +1 -1
  199. package/dist/esm/{UpdateEmailScreen-B1-pVdEN.mjs → UpdateEmailScreen-BolXWblK.mjs} +1 -1
  200. package/dist/esm/{UpdatePhoneScreen-CwYS0KNr.mjs → UpdatePhoneScreen-G2aRPp1w.mjs} +1 -1
  201. package/dist/esm/{UserLimitReachedScreen-C9lTsh_J.mjs → UserLimitReachedScreen-BUXcfdpd.mjs} +1 -1
  202. package/dist/esm/{WalletInfoCard-C8BrD5jy.mjs → WalletInfoCard-YE5P6CSV.mjs} +1 -1
  203. package/dist/esm/{WalletInterstitialScreen-d520uEnZ.mjs → WalletInterstitialScreen-6lMKxpAk.mjs} +1 -1
  204. package/dist/esm/{WalletLink-WAY9-CI0.mjs → WalletLink-C9CSqqVy.mjs} +1 -1
  205. package/dist/esm/WalletOverflowButton-DV9Pe-aq.mjs +1 -0
  206. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  207. package/dist/esm/context-Bycd1SKV.mjs +1 -0
  208. package/dist/esm/{ethers-g3QzXj2h.mjs → ethers-C3Y94dat.mjs} +1 -1
  209. package/dist/esm/extended-chains.mjs +1 -1
  210. package/dist/esm/{get-is-unified-wallet-_KIJnP68.mjs → get-is-unified-wallet-DvKS5IUO.mjs} +1 -1
  211. package/dist/esm/{index-BGEWwttv.mjs → index-C9_VQk69.mjs} +1 -1
  212. package/dist/esm/{index-Dr4t3oWO.mjs → index-CCyaupaz.mjs} +3 -3
  213. package/dist/esm/{index-CiEOopPN.mjs → index-DeGXWdV3.mjs} +1 -1
  214. package/dist/esm/index.mjs +1 -1
  215. package/dist/esm/internal.mjs +1 -1
  216. package/dist/esm/{prepareFundingModalData-BYy0MVol.mjs → prepareFundingModalData-CIgFwA7s.mjs} +1 -1
  217. package/dist/esm/{shared-CRNjAkzC.mjs → shared-rucIJmk0.mjs} +1 -1
  218. package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-iMnL58wW.mjs → shouldProceedtoEmbeddedWalletCreationFlow-Djgu4xiS.mjs} +1 -1
  219. package/dist/esm/{smart-wallets-BMn13jfV.mjs → smart-wallets-B-nGTJog.mjs} +1 -1
  220. package/dist/esm/smart-wallets.mjs +1 -1
  221. package/dist/esm/solana.mjs +1 -1
  222. package/dist/esm/{to-ui-error-CnxcoZ1S.mjs → to-ui-error-3mK4-1VA.mjs} +1 -1
  223. package/dist/esm/ui.mjs +1 -1
  224. package/dist/esm/{use-create-wallet-without-fallback-5er4aqoE.mjs → use-create-wallet-without-fallback-cSYr4rn8.mjs} +1 -1
  225. package/dist/esm/{use-export-wallet-WZT8QqOJ.mjs → use-export-wallet-ntS-M0Jk.mjs} +1 -1
  226. package/dist/esm/{useActiveWallet-SiVSXkvG.mjs → useActiveWallet-Bsy5GTCV.mjs} +1 -1
  227. package/dist/esm/{useGetTokenPrice-CfQvz_Mo.mjs → useGetTokenPrice-0Bn0Y88A.mjs} +1 -1
  228. package/dist/esm/{useI18n-O3hskpuB.mjs → useI18n-BtdAZuQ8.mjs} +1 -1
  229. package/dist/esm/{usePrivy-Bh4N2Hpm.mjs → usePrivy-BaiIHGte.mjs} +1 -1
  230. package/dist/esm/{useSolanaRpcClient-DaxiCEwc.mjs → useSolanaRpcClient-DW9Xaoo_.mjs} +1 -1
  231. package/dist/esm/{useWallets-gElyEQoU.mjs → useWallets-D0lpBS44.mjs} +1 -1
  232. package/dist/esm/{useWallets-DCp1uab-.mjs → useWallets-NhjmJtNE.mjs} +1 -1
  233. package/package.json +4 -4
  234. package/dist/cjs/ConnectOrCreateScreen-DmitWRwr.js +0 -1
  235. package/dist/cjs/ConnectWalletView-B33uROyL.js +0 -1
  236. package/dist/cjs/CrossAppAuthScreen-B6h5ejCd.js +0 -1
  237. package/dist/cjs/CustomLandingScreenView-ClPdt2GY.js +0 -2
  238. package/dist/cjs/LandingScreen-BE8xOJTr.js +0 -1
  239. package/dist/cjs/TransferFromWalletScreen-CGRGSTHN.js +0 -1
  240. package/dist/cjs/TransferOrBridgeLoadingScreen-C4UYLYIL.js +0 -1
  241. package/dist/cjs/WalletButtonList-C6cavPqd.js +0 -1
  242. package/dist/cjs/context-Dn8Hzo8O.js +0 -1
  243. package/dist/esm/ConnectOrCreateScreen-BREVA7pu.mjs +0 -1
  244. package/dist/esm/ConnectWalletView-DFfXN_9_.mjs +0 -1
  245. package/dist/esm/CrossAppAuthScreen-DAQweVCP.mjs +0 -1
  246. package/dist/esm/CustomLandingScreenView-BkNtLof4.mjs +0 -2
  247. package/dist/esm/LandingScreen-BqSnrgDb.mjs +0 -1
  248. package/dist/esm/ManualTransferScreen-BBMujAte.mjs +0 -1
  249. package/dist/esm/TransferFromWalletScreen-C5QQN9h6.mjs +0 -1
  250. package/dist/esm/WalletButtonList-DZp-38Ac.mjs +0 -1
  251. package/dist/esm/context-Dee1TPOi.mjs +0 -1
@@ -1 +1 @@
1
- import{jsxs as r,Fragment as e,jsx as l}from"react/jsx-runtime";import{B as t}from"./Button-DJY5dut3.mjs";import{S as a}from"./Screen-CKaxnxac.mjs";const n=({primaryCta:n,secondaryCta:i,helpText:s,watermark:c=!0,children:d,...m})=>{let o=n||i?/*#__PURE__*/r(e,{children:[n&&(()=>{let{label:r,...e}=n,a=e.variant||"primary";/*#__PURE__*/return l(t,{...e,variant:a,style:{width:"100%",...e.style},children:r})})(),i&&(()=>{let{label:r,...e}=i,a=e.variant||"secondary";/*#__PURE__*/return l(t,{...e,variant:a,style:{width:"100%",...e.style},children:r})})()]}):null;/*#__PURE__*/return r(a,{id:m.id,className:m.className,children:[/*#__PURE__*/l(a.Header,{...m}),d?/*#__PURE__*/l(a.Body,{children:d}):null,s||o||c?/*#__PURE__*/r(a.Footer,{children:[s?/*#__PURE__*/l(a.HelpText,{children:s}):null,o?/*#__PURE__*/l(a.Actions,{children:o}):null,c?/*#__PURE__*/l(a.Watermark,{}):null]}):null]})};export{n as S};
1
+ import{jsxs as r,Fragment as e,jsx as l}from"react/jsx-runtime";import{B as t}from"./Button-B8mqatRx.mjs";import{S as a}from"./Screen-BTyXgDrd.mjs";const n=({primaryCta:n,secondaryCta:i,helpText:s,watermark:c=!0,children:d,...m})=>{let o=n||i?/*#__PURE__*/r(e,{children:[n&&(()=>{let{label:r,...e}=n,a=e.variant||"primary";/*#__PURE__*/return l(t,{...e,variant:a,style:{width:"100%",...e.style},children:r})})(),i&&(()=>{let{label:r,...e}=i,a=e.variant||"secondary";/*#__PURE__*/return l(t,{...e,variant:a,style:{width:"100%",...e.style},children:r})})()]}):null;/*#__PURE__*/return r(a,{id:m.id,className:m.className,children:[/*#__PURE__*/l(a.Header,{...m}),d?/*#__PURE__*/l(a.Body,{children:d}):null,s||o||c?/*#__PURE__*/r(a.Footer,{children:[s?/*#__PURE__*/l(a.HelpText,{children:s}):null,o?/*#__PURE__*/l(a.Actions,{children:o}):null,c?/*#__PURE__*/l(a.Watermark,{}):null]}):null]})};export{n as S};
@@ -1 +1 @@
1
- import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/ExclamationTriangleIcon";import i from"@heroicons/react/24/outline/LockClosedIcon";import{useState as n}from"react";import{u as l,a,h as s}from"./get-is-unified-wallet-_KIJnP68.mjs";import{a as c}from"./Button-DJY5dut3.mjs";import{M as m,B as d}from"./ModalHeader-DHXUvTf4.mjs";import{styled as p}from"styled-components";import{S as u}from"./Subtitle-DkvfP2Ev.mjs";import{T as y}from"./Title-D0pfZff-.mjs";import{q as h}from"./context-Dee1TPOi.mjs";import{u as f}from"./internal-context-e-Eni5bG.mjs";import{Y as v}from"./useActiveWallet-SiVSXkvG.mjs";import"viem";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"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BYy0MVol.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";const g=/*#__PURE__*/p.div.withConfig({displayName:"WithCircleBorder",componentId:"sc-e4fc5563-0"})(["&&{border-width:4px;}display:flex;justify-content:center;align-items:center;padding:1rem;aspect-ratio:1;border-style:solid;border-color:",";border-radius:50%;"],(e=>e.$color??"var(--privy-color-accent)")),w={component:()=>{let{user:p}=l(),{client:w,walletProxy:j,refreshSessionAndUser:I,closePrivyModal:b}=f(),x=a(),{entropyId:C,entropyIdVerifier:T}=x.data?.recoverWallet,[k,M]=n(!1),[S,W]=n(null),[A,P]=n(null);function U(){if(!k){if(A)return x.data?.setWalletPassword?.onFailure(A),void b();if(!S)return x.data?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),void b()}}x.onUserCloseViaDialogOrKeybindRef.current=U;let E=!(!k&&!S);/*#__PURE__*/return e(r,A?{children:[/*#__PURE__*/o(m,{onClose:U},"header"),/*#__PURE__*/o(g,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:/*#__PURE__*/o(t,{height:38,width:38,stroke:"var(--privy-color-error)"})}),/*#__PURE__*/o(y,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),/*#__PURE__*/o(v,{style:{minHeight:"2rem"}}),/*#__PURE__*/o(c,{onClick:()=>P(null),children:"Try again"}),/*#__PURE__*/o(d,{})]}:{children:[/*#__PURE__*/o(m,{onClose:U},"header"),/*#__PURE__*/o(i,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),/*#__PURE__*/o(y,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),/*#__PURE__*/o(u,{style:{marginTop:"1rem"},children:"When you log into a new device, you’ll only need to authenticate to access your account. Never get logged out if you forget your password."}),/*#__PURE__*/o(v,{style:{minHeight:"2rem"}}),/*#__PURE__*/o(c,{loading:k,disabled:E,onClick:()=>async function(){M(!0);try{let e=await w.getAccessToken(),r=s(p,C);if(!e||!j||!r)return;if(!(await j.setRecovery({accessToken:e,entropyId:C,entropyIdVerifier:T,existingRecoveryMethod:r.recoveryMethod,recoveryMethod:"privy"})).entropyId)throw Error("Unable to set recovery on wallet");let o=await I();if(!o)throw Error("Unable to set recovery on wallet");let t=s(o,r.address);if(!t)throw Error("Unabled to set recovery on wallet");W(!!o),setTimeout((()=>{x.data?.setWalletPassword?.onSuccess(t),b()}),h)}catch(e){P(e)}finally{M(!1)}}(),children:S?"Success":"Confirm"}),/*#__PURE__*/o(d,{})]})}};export{w as SetAutomaticRecoveryScreen,w as default};
1
+ import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/ExclamationTriangleIcon";import i from"@heroicons/react/24/outline/LockClosedIcon";import{useState as n}from"react";import{u as l,a,h as s}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{a as c}from"./Button-B8mqatRx.mjs";import{M as m,B as d}from"./ModalHeader-BLGC-7ev.mjs";import{styled as p}from"styled-components";import{S as u}from"./Subtitle-DkvfP2Ev.mjs";import{T as y}from"./Title-D0pfZff-.mjs";import{q as h}from"./context-Bycd1SKV.mjs";import{u as f}from"./internal-context-e-Eni5bG.mjs";import{Y as v}from"./useActiveWallet-Bsy5GTCV.mjs";import"viem";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"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CIgFwA7s.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-D0lpBS44.mjs";const g=/*#__PURE__*/p.div.withConfig({displayName:"WithCircleBorder",componentId:"sc-e4fc5563-0"})(["&&{border-width:4px;}display:flex;justify-content:center;align-items:center;padding:1rem;aspect-ratio:1;border-style:solid;border-color:",";border-radius:50%;"],(e=>e.$color??"var(--privy-color-accent)")),w={component:()=>{let{user:p}=l(),{client:w,walletProxy:j,refreshSessionAndUser:I,closePrivyModal:b}=f(),x=a(),{entropyId:C,entropyIdVerifier:T}=x.data?.recoverWallet,[k,M]=n(!1),[S,W]=n(null),[A,P]=n(null);function U(){if(!k){if(A)return x.data?.setWalletPassword?.onFailure(A),void b();if(!S)return x.data?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),void b()}}x.onUserCloseViaDialogOrKeybindRef.current=U;let E=!(!k&&!S);/*#__PURE__*/return e(r,A?{children:[/*#__PURE__*/o(m,{onClose:U},"header"),/*#__PURE__*/o(g,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:/*#__PURE__*/o(t,{height:38,width:38,stroke:"var(--privy-color-error)"})}),/*#__PURE__*/o(y,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),/*#__PURE__*/o(v,{style:{minHeight:"2rem"}}),/*#__PURE__*/o(c,{onClick:()=>P(null),children:"Try again"}),/*#__PURE__*/o(d,{})]}:{children:[/*#__PURE__*/o(m,{onClose:U},"header"),/*#__PURE__*/o(i,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),/*#__PURE__*/o(y,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),/*#__PURE__*/o(u,{style:{marginTop:"1rem"},children:"When you log into a new device, you’ll only need to authenticate to access your account. Never get logged out if you forget your password."}),/*#__PURE__*/o(v,{style:{minHeight:"2rem"}}),/*#__PURE__*/o(c,{loading:k,disabled:E,onClick:()=>async function(){M(!0);try{let e=await w.getAccessToken(),r=s(p,C);if(!e||!j||!r)return;if(!(await j.setRecovery({accessToken:e,entropyId:C,entropyIdVerifier:T,existingRecoveryMethod:r.recoveryMethod,recoveryMethod:"privy"})).entropyId)throw Error("Unable to set recovery on wallet");let o=await I();if(!o)throw Error("Unable to set recovery on wallet");let t=s(o,r.address);if(!t)throw Error("Unabled to set recovery on wallet");W(!!o),setTimeout((()=>{x.data?.setWalletPassword?.onSuccess(t),b()}),h)}catch(e){P(e)}finally{M(!1)}}(),children:S?"Success":"Confirm"}),/*#__PURE__*/o(d,{})]})}};export{w as SetAutomaticRecoveryScreen,w as default};
@@ -1,2 +1,2 @@
1
- import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import{useState as n,useEffect as i,useMemo as t,useCallback as a,useReducer as l}from"react";import{q as c}from"./context-Dee1TPOi.mjs";import{a as s}from"./get-is-unified-wallet-_KIJnP68.mjs";import d from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{b as h,R as p,c as u}from"./Layouts-Bmf8DxNP.mjs";import{M as m,B as g}from"./ModalHeader-DHXUvTf4.mjs";import{E as y,b as v,P as f,a as w,I as b,H as k,S as C,c as S,N as x,D as B,d as $,R as I,e as R,f as P,g as j}from"./shared-CRNjAkzC.mjs";import{styled as A}from"styled-components";import{S as L,P as E}from"./Button-DJY5dut3.mjs";import{C as D}from"./Checkbox-NmGCZeKL.mjs";import z from"@heroicons/react/24/outline/KeyIcon";import H from"@heroicons/react/24/solid/CheckCircleIcon";import T from"fast-password-entropy";import*as U from"secure-password-utilities";import{DEFAULT_WORDLIST as F}from"secure-password-utilities/wordlists";import M from"@heroicons/react/24/outline/ArrowDownTrayIcon";import N from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import K from"@heroicons/react/24/outline/DocumentDuplicateIcon";import O from"@heroicons/react/24/solid/XCircleIcon";import{C as W}from"./ScreenHeader-Biz1wq02.mjs";const Y=({buttonHideAnimations:t,buttonLoading:a,password:l,onSubmit:c,onBack:s})=>{let[u,B]=n(!0),[$,I]=n(!1),[R,P]=n(""),j=l===R;return i((()=>{R&&!$&&I(!0)}),[R]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(m,{closeable:!1,backFn:s}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/o(w,{value:R,onChange:e=>P(e.target.value),onKeyUp:e=>{"Enter"===e.key&&c()},onBlur:()=>I(!0),placeholder:"confirm your password",type:u?"password":"text",style:{paddingRight:"2.3rem"}}),/*#__PURE__*/o(b,{style:{right:"0.75rem"},children:u?/*#__PURE__*/o(k,{onClick:()=>B(!1)}):/*#__PURE__*/o(C,{onClick:()=>B(!0)})})]}),
1
+ import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import{useState as n,useEffect as i,useMemo as t,useCallback as a,useReducer as l}from"react";import{q as c}from"./context-Bycd1SKV.mjs";import{a as s}from"./get-is-unified-wallet-DvKS5IUO.mjs";import d from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{b as h,R as p,c as u}from"./Layouts-Bmf8DxNP.mjs";import{M as m,B as g}from"./ModalHeader-BLGC-7ev.mjs";import{E as y,b as v,P as f,a as w,I as b,H as k,S as C,c as S,N as x,D as B,d as $,R as I,e as R,f as P,g as j}from"./shared-rucIJmk0.mjs";import{styled as A}from"styled-components";import{S as L,P as E}from"./Button-B8mqatRx.mjs";import{C as D}from"./Checkbox-NmGCZeKL.mjs";import z from"@heroicons/react/24/outline/KeyIcon";import H from"@heroicons/react/24/solid/CheckCircleIcon";import T from"fast-password-entropy";import*as U from"secure-password-utilities";import{DEFAULT_WORDLIST as F}from"secure-password-utilities/wordlists";import M from"@heroicons/react/24/outline/ArrowDownTrayIcon";import N from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import K from"@heroicons/react/24/outline/DocumentDuplicateIcon";import O from"@heroicons/react/24/solid/XCircleIcon";import{C as W}from"./ScreenHeader-Biz1wq02.mjs";const Y=({buttonHideAnimations:t,buttonLoading:a,password:l,onSubmit:c,onBack:s})=>{let[u,B]=n(!0),[$,I]=n(!1),[R,P]=n(""),j=l===R;return i((()=>{R&&!$&&I(!0)}),[R]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(m,{closeable:!1,backFn:s}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/o(w,{value:R,onChange:e=>P(e.target.value),onKeyUp:e=>{"Enter"===e.key&&c()},onBlur:()=>I(!0),placeholder:"confirm your password",type:u?"password":"text",style:{paddingRight:"2.3rem"}}),/*#__PURE__*/o(b,{style:{right:"0.75rem"},children:u?/*#__PURE__*/o(k,{onClick:()=>B(!1)}):/*#__PURE__*/o(C,{onClick:()=>B(!0)})})]}),
2
2
  /*#__PURE__*/o(S,{"aria-hidden":!$||j,error:!0,children:"Passwords do not match"})]}),/*#__PURE__*/o(x,{onClick:c,loading:a,disabled:!j,$hideAnimations:t,children:"Continue"}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})},Z=({buttonHideAnimations:i,buttonLoading:t,onSubmit:a,onBack:l,config:c})=>{let[s,u]=n(!1);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{closeable:!1,backFn:l}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),/*#__PURE__*/o(B,{children:/*#__PURE__*/e($,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:e=>{e.preventDefault(),u((e=>!e))},children:[/*#__PURE__*/o(D,{color:"var(--privy-color-error)",readOnly:!0,checked:s}),/*#__PURE__*/o(r,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),/*#__PURE__*/e(_,{children:["user"===c.initiatedBy&&/*#__PURE__*/o(L,{onClick:c.onCancel,disabled:t,children:"Cancel"}),/*#__PURE__*/o(x,{onClick:a,loading:t,$hideAnimations:i,disabled:!s,children:"Set Password"})]}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})};let _=/*#__PURE__*/A.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-d1659c5f-0"})(["display:flex;gap:10px;"]),q=/[a-z]/,G=/[A-Z]/,X=/[0-9]/,J="!@#$%^&*()\\-_+.",Q=`a-zA-Z0-9${J}`,V=RegExp(`[${J}]`),ee=RegExp(`[${Q}]`);const re=RegExp(`^[${Q}]{6,}$`),oe=()=>U.generatePassphrase(4,F);function ne(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function ie(e=""){return(.3*function(e){if(e.length<8)return 0;let r=0;return q.test(e)&&(r+=1),G.test(e)&&(r+=1),X.test(e)&&(r+=1),V.test(e)&&(r+=1),Math.max(0,Math.min(1,r/3))}(e)+T(e)/95)/2}const te=({buttonHideAnimations:a,buttonLoading:l,password:c="",config:s,isResettingPassword:d,onSubmit:u,onClose:P,onBack:j,onPasswordChange:A,onPasswordGenerate:L})=>{let[E,D]=n(!1),[T,U]=n(!1);i((()=>{c&&!T&&U(!0)}),[c]);let F=t((()=>T?6>(c?.length||0)?"Password must be at least 6 characters":re.test(c||"")?null:`Invalid characters used ( ${((e="")=>[...new Set(e.split("").filter((e=>!ee.test(e))).map((e=>e.replace(" ","SPACE"))))])(c).join(" ")} )`:null),[c,T]),M=t((()=>F?{value:0,label:"Weak"}:function(e=""){let r=ie(e);return{value:r,label:ne(r)}}(c)),[c,F]),N=t((()=>!c?.length||!!F),[F,c]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{onClose:P,closeable:"user"===s.initiatedBy,backFn:j}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(z,{height:48,width:48,stroke:"var(--privy-color-accent)"}),/*#__PURE__*/e("h3",{style:{color:"var(--privy-color-foreground)"},children:[d?"Reset":"Set"," your password"]}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/o(w,{value:c,onChange:e=>A(e.target.value),onKeyUp:e=>{"Enter"===e.key&&u()},placeholder:"enter or generate a strong password",type:E?"password":"text",style:{paddingRight:"3.8rem"}}),/*#__PURE__*/e(b,{style:{width:"3.5rem"},children:[E?/*#__PURE__*/o(k,{onClick:()=>D(!1)}):/*#__PURE__*/o(C,{onClick:()=>D(!0)}),/*#__PURE__*/o(I,{onClick:L})]})]}),/*#__PURE__*/o(R,{value:0===M.value?.01:M.value,label:M.label}),/*#__PURE__*/o(S,{error:!!F,children:F||`Password Strength: ${T?M.label:"--"}`}),/*#__PURE__*/e(le,{children:[/*#__PURE__*/o(ae,{children:/*#__PURE__*/e(B,{children:[/*#__PURE__*/e($,{children:[/*#__PURE__*/o(H,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),/*#__PURE__*/e($,{children:[/*#__PURE__*/o(H,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),/*#__PURE__*/o(x,{onClick:u,loading:l,disabled:N,$hideAnimations:a,children:"Continue"})]})]}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})};let ae=/*#__PURE__*/A(B).withConfig({displayName:"DetailsContainer",componentId:"sc-2da5fe90-0"})(["flex:1;padding-top:1rem;"]),le=/*#__PURE__*/A.div.withConfig({displayName:"LowerContainer",componentId:"sc-2da5fe90-1"})(["display:flex;flex-direction:column;height:100%;"]);const ce=({buttonHideAnimations:i,buttonLoading:t,appName:l,password:c,onSubmit:s,onBack:u})=>{let[w,S]=n(!1),[B,$]=n(!0),I=a((()=>{S(!0),c&&navigator.clipboard.writeText(c)}),[c]),R=a((()=>{let e=document.createElement("a"),r=l.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),o=new Blob([se(l,c)],{type:"text/plain"}),n=URL.createObjectURL(o);e.href=n,e.target="_blank",e.download=`${r}-privy-wallet-recovery.txt`,document.body.appendChild(e),e.click(),setTimeout((()=>{e.remove(),URL.revokeObjectURL(n)}),5e3)}),[c]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{backFn:u,closeable:!1}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),/*#__PURE__*/e(f,{centered:!0,children:[/*#__PURE__*/o(P,{children:B?"•".repeat(c.length):c}),/*#__PURE__*/o(b,{style:{right:"0.75rem"},children:B?/*#__PURE__*/o(k,{onClick:()=>$(!1)}):/*#__PURE__*/o(C,{onClick:()=>$(!0)})})]}),/*#__PURE__*/e("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[/*#__PURE__*/o(j,{onClick:I,children:/*#__PURE__*/e(r,w?{children:[/*#__PURE__*/o(N,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}:{children:[/*#__PURE__*/o(K,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),/*#__PURE__*/e(j,{onClick:R,children:[/*#__PURE__*/o(M,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),/*#__PURE__*/o(x,{onClick:s,loading:t,$hideAnimations:i,children:"Continue"}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})};let se=(e,r)=>`Your wallet recovery password for ${e} is\n\n${r}\n\nYou will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;const de=({error:n,onClose:i})=>/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(m,{closeable:!1}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(u,n?{children:[/*#__PURE__*/o(O,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),/*#__PURE__*/o(W,{title:"Something went wrong",description:n})]}:{children:[/*#__PURE__*/o(H,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/o(W,{title:"Success"})]}),/*#__PURE__*/o(E,{onClick:i,children:"Close"}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]});let he=(e,r)=>{switch(e){case"creating":return"back"===r?e:"saving";case"saving":return"back"===r?"creating":"confirming";case"confirming":return"back"===r?"saving":"finalizing";case"finalizing":return"back"===r?"confirming":"done";default:return e}};const pe=({onSubmit:e,...r})=>{let{lastScreen:n,navigate:t}=s(),{send:d,state:h}=(()=>{let[e,r]=l(he,"creating");return{send:r,state:e}})(),p=a((async()=>{"finalizing"===h&&await e(),d("next")}),[h,d,e]);i((()=>{let e;return"done"===h&&"automatic"===r.config.initiatedBy&&(e=setTimeout((()=>r.onClose?.()),c)),()=>{e&&clearTimeout(e)}}),[h,r.config.initiatedBy,r.onClose]);let u=a((()=>{d("back")}),[d]),m=a((()=>{t("RecoverySelectionScreen")}),[n,t]);return"creating"===h?/*#__PURE__*/o(te,{...r,onSubmit:p,onBack:"RecoverySelectionScreen"===n?m:void 0}):"saving"===h?/*#__PURE__*/o(ce,{...r,onSubmit:p,onBack:u}):"confirming"===h?/*#__PURE__*/o(Y,{...r,onSubmit:p,onBack:u}):"finalizing"===h?/*#__PURE__*/o(Z,{...r,onSubmit:p,onBack:u}):"done"===h?/*#__PURE__*/o(de,{...r,onSubmit:p}):null};export{pe as S,oe as g};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import{base64 as i}from"@scure/base";import{Edit as r}from"lucide-react";import{useState as n,useEffect as a}from"react";import{styled as s}from"styled-components";import{isHex as l,hexToString as c}from"viem";import{ProviderErrors as m}from"@privy-io/js-sdk-core";import{C as p}from"./CopyToClipboard-DatKc59_.mjs";import{a as d}from"./Layouts-Bmf8DxNP.mjs";import{M as u,D as g}from"./JsonTree-Bvd2C29R.mjs";import{P as y,j as h}from"./prepareFundingModalData-BYy0MVol.mjs";import{W as f,q as C}from"./context-Dee1TPOi.mjs";import{u as x}from"./internal-context-e-Eni5bG.mjs";import{u as w,a as j}from"./get-is-unified-wallet-_KIJnP68.mjs";import{S as b}from"./ScreenLayout-BQ6FV6yc.mjs";import"./copy-Bx2Jwc5_.mjs";import"eventemitter3";import"tinycolor2";import"ofetch";import"./Button-DJY5dut3.mjs";import"./useActiveWallet-SiVSXkvG.mjs";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const S=/*#__PURE__*/s.img.withConfig({displayName:"StyledLogo",componentId:"sc-68c1b1ea-0"})(["&&{height:",";width:",";border-radius:16px;margin-bottom:12px;}"],(e=>"sm"===e.size?"65px":"140px"),(e=>"sm"===e.size?"65px":"140px"));let T=e=>{if(!l(e))return e;try{let t=c(e);return t.includes("�")?e:t}catch{return e}},v=e=>{try{let t=i.decode(e),o=(new TextDecoder).decode(t);return o.includes("�")?e:o}catch{return e}},E=i=>{let{types:r,primaryType:n,...a}=i.typedData;/*#__PURE__*/return t(o,{children:[/*#__PURE__*/e(_,{data:a}),/*#__PURE__*/e(p,{text:(s=i.typedData,JSON.stringify(s,null,2)),itemName:"full payload to clipboard"})," "]});var s};const D=({method:o,messageData:i,copy:n,iconUrl:a,isLoading:s,success:l,walletProxyIsLoading:c,errorMessage:m,isCancellable:p,onSign:u,onCancel:g,onClose:y})=>/*#__PURE__*/e(b,{title:n.title,subtitle:n.description,showClose:!0,onClose:y,icon:r,iconVariant:"subtle",helpText:m?/*#__PURE__*/e(R,{children:m}):void 0,primaryCta:{label:n.buttonText,onClick:u,disabled:s||l||c,loading:s},secondaryCta:p?{label:"Not now",onClick:g,disabled:s||l||c}:void 0,watermark:!0,children:/*#__PURE__*/t(d,{children:[a?/*#__PURE__*/e(S,{style:{alignSelf:"center"},size:"sm",src:a,alt:"app image"}):null,/*#__PURE__*/t(L,{children:["personal_sign"===o&&/*#__PURE__*/e(M,{children:T(i)}),"eth_signTypedData_v4"===o&&/*#__PURE__*/e(E,{typedData:i}),"solana_signMessage"===o&&/*#__PURE__*/e(M,{children:v(i)})]})]})}),I={component:()=>{let{authenticated:t}=w(),{initializeWalletProxy:o,closePrivyModal:i}=x(),{navigate:r,data:s,onUserCloseViaDialogOrKeybindRef:l}=j(),[c,p]=n(!0),[d,u]=n(""),[g,b]=n(),[S,T]=n(null),[v,E]=n(!1);a((()=>{t||r("LandingScreen")}),[t]),a((()=>{o(f).then((e=>{p(!1),e||(u("An error has occurred, please try again."),b(new y(new h(d,m.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))}))}),[]);let{method:I,data:L,confirmAndSign:R,onSuccess:_,onFailure:M,uiOptions:N}=s.signMessage,A={title:N?.title||"Sign message",description:N?.description||"Signing this message will not cost you any fees.",buttonText:N?.buttonText||"Sign and continue"},U=e=>{e?_(e):M(g||new y(new h("The user rejected the request.",m.E4001_USER_REJECTED_REQUEST.eipCode))),i({shouldCallAuthOnSuccess:!1}),setTimeout((()=>{T(null),u(""),b(void 0)}),200)};l.current=()=>{U(S)};/*#__PURE__*/return e(D,{method:I,messageData:L,copy:A,iconUrl:N?.iconUrl&&"string"==typeof N.iconUrl?N.iconUrl:void 0,isLoading:v,success:null!==S,walletProxyIsLoading:c,errorMessage:d,isCancellable:N?.isCancellable,onSign:async()=>{E(!0),u("");try{let e=await R();T(e),E(!1),setTimeout((()=>{U(e)}),C)}catch(e){console.error(e),u("An error has occurred, please try again."),b(new y(new h(d,m.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),E(!1)}},onCancel:()=>U(null),onClose:()=>U(S)})}};let L=/*#__PURE__*/s.div.withConfig({displayName:"MessageContainer",componentId:"sc-124260c0-0"})(["flex:1;display:flex;flex-direction:column;gap:16px;"]),R=/*#__PURE__*/s.p.withConfig({displayName:"ErrorText",componentId:"sc-124260c0-1"})(["&&{margin:0;width:100%;text-align:center;color:var(--privy-color-error-dark);font-size:14px;line-height:22px;}"]),_=/*#__PURE__*/s(g).withConfig({displayName:"StyledDisplayJsonTree",componentId:"sc-124260c0-2"})(["margin-top:0;"]),M=/*#__PURE__*/s(u).withConfig({displayName:"StyledMessage",componentId:"sc-124260c0-3"})(["margin-top:0;"]);export{I as SignRequestScreen,D as SignRequestView,I as default};
1
+ import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import{base64 as i}from"@scure/base";import{Edit as r}from"lucide-react";import{useState as n,useEffect as a}from"react";import{styled as s}from"styled-components";import{isHex as l,hexToString as c}from"viem";import{ProviderErrors as m}from"@privy-io/js-sdk-core";import{C as p}from"./CopyToClipboard-DatKc59_.mjs";import{a as d}from"./Layouts-Bmf8DxNP.mjs";import{M as u,D as g}from"./JsonTree-Bvd2C29R.mjs";import{P as y,j as h}from"./prepareFundingModalData-CIgFwA7s.mjs";import{W as f,q as C}from"./context-Bycd1SKV.mjs";import{u as x}from"./internal-context-e-Eni5bG.mjs";import{u as w,a as j}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{S as b}from"./ScreenLayout-CddsD3Of.mjs";import"./copy-Bx2Jwc5_.mjs";import"eventemitter3";import"tinycolor2";import"ofetch";import"./Button-B8mqatRx.mjs";import"./useActiveWallet-Bsy5GTCV.mjs";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-D0lpBS44.mjs";import"./Screen-BTyXgDrd.mjs";import"./ModalHeader-BLGC-7ev.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=/*#__PURE__*/s.img.withConfig({displayName:"StyledLogo",componentId:"sc-68c1b1ea-0"})(["&&{height:",";width:",";border-radius:16px;margin-bottom:12px;}"],(e=>"sm"===e.size?"65px":"140px"),(e=>"sm"===e.size?"65px":"140px"));let T=e=>{if(!l(e))return e;try{let t=c(e);return t.includes("�")?e:t}catch{return e}},v=e=>{try{let t=i.decode(e),o=(new TextDecoder).decode(t);return o.includes("�")?e:o}catch{return e}},E=i=>{let{types:r,primaryType:n,...a}=i.typedData;/*#__PURE__*/return t(o,{children:[/*#__PURE__*/e(_,{data:a}),/*#__PURE__*/e(p,{text:(s=i.typedData,JSON.stringify(s,null,2)),itemName:"full payload to clipboard"})," "]});var s};const D=({method:o,messageData:i,copy:n,iconUrl:a,isLoading:s,success:l,walletProxyIsLoading:c,errorMessage:m,isCancellable:p,onSign:u,onCancel:g,onClose:y})=>/*#__PURE__*/e(b,{title:n.title,subtitle:n.description,showClose:!0,onClose:y,icon:r,iconVariant:"subtle",helpText:m?/*#__PURE__*/e(R,{children:m}):void 0,primaryCta:{label:n.buttonText,onClick:u,disabled:s||l||c,loading:s},secondaryCta:p?{label:"Not now",onClick:g,disabled:s||l||c}:void 0,watermark:!0,children:/*#__PURE__*/t(d,{children:[a?/*#__PURE__*/e(S,{style:{alignSelf:"center"},size:"sm",src:a,alt:"app image"}):null,/*#__PURE__*/t(L,{children:["personal_sign"===o&&/*#__PURE__*/e(M,{children:T(i)}),"eth_signTypedData_v4"===o&&/*#__PURE__*/e(E,{typedData:i}),"solana_signMessage"===o&&/*#__PURE__*/e(M,{children:v(i)})]})]})}),I={component:()=>{let{authenticated:t}=w(),{initializeWalletProxy:o,closePrivyModal:i}=x(),{navigate:r,data:s,onUserCloseViaDialogOrKeybindRef:l}=j(),[c,p]=n(!0),[d,u]=n(""),[g,b]=n(),[S,T]=n(null),[v,E]=n(!1);a((()=>{t||r("LandingScreen")}),[t]),a((()=>{o(f).then((e=>{p(!1),e||(u("An error has occurred, please try again."),b(new y(new h(d,m.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))}))}),[]);let{method:I,data:L,confirmAndSign:R,onSuccess:_,onFailure:M,uiOptions:N}=s.signMessage,A={title:N?.title||"Sign message",description:N?.description||"Signing this message will not cost you any fees.",buttonText:N?.buttonText||"Sign and continue"},U=e=>{e?_(e):M(g||new y(new h("The user rejected the request.",m.E4001_USER_REJECTED_REQUEST.eipCode))),i({shouldCallAuthOnSuccess:!1}),setTimeout((()=>{T(null),u(""),b(void 0)}),200)};l.current=()=>{U(S)};/*#__PURE__*/return e(D,{method:I,messageData:L,copy:A,iconUrl:N?.iconUrl&&"string"==typeof N.iconUrl?N.iconUrl:void 0,isLoading:v,success:null!==S,walletProxyIsLoading:c,errorMessage:d,isCancellable:N?.isCancellable,onSign:async()=>{E(!0),u("");try{let e=await R();T(e),E(!1),setTimeout((()=>{U(e)}),C)}catch(e){console.error(e),u("An error has occurred, please try again."),b(new y(new h(d,m.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),E(!1)}},onCancel:()=>U(null),onClose:()=>U(S)})}};let L=/*#__PURE__*/s.div.withConfig({displayName:"MessageContainer",componentId:"sc-124260c0-0"})(["flex:1;display:flex;flex-direction:column;gap:16px;"]),R=/*#__PURE__*/s.p.withConfig({displayName:"ErrorText",componentId:"sc-124260c0-1"})(["&&{margin:0;width:100%;text-align:center;color:var(--privy-color-error-dark);font-size:14px;line-height:22px;}"]),_=/*#__PURE__*/s(g).withConfig({displayName:"StyledDisplayJsonTree",componentId:"sc-124260c0-2"})(["margin-top:0;"]),M=/*#__PURE__*/s(u).withConfig({displayName:"StyledMessage",componentId:"sc-124260c0-3"})(["margin-top:0;"]);export{I as SignRequestScreen,D as SignRequestView,I as default};
@@ -1 +1 @@
1
- import{jsxs as t,jsx as n,Fragment as e}from"react/jsx-runtime";import{useState as a,useMemo as r,useEffect as o}from"react";import{formatTokenAmount as i}from"@privy-io/js-sdk-core";import{a as s,u as c,j as l,g as d}from"./get-is-unified-wallet-_KIJnP68.mjs";import{u}from"./context-Dee1TPOi.mjs";import{u as m}from"./internal-context-e-Eni5bG.mjs";import{u as p}from"./useGetSolPrice-Cfm8o9C5.mjs";import{ErrorScreenView as f}from"./ErrorScreen-CTI5XNc0.mjs";import g from"@heroicons/react/24/outline/CheckCircleIcon";import{styled as h}from"styled-components";import{P as y}from"./Button-DJY5dut3.mjs";import{R as w}from"./Layouts-Bmf8DxNP.mjs";import{M as k,B as b}from"./ModalHeader-DHXUvTf4.mjs";import{C as v}from"./ScreenHeader-Biz1wq02.mjs";import{a as I,R as A}from"./Row-CG0lSY5Z.mjs";import{L as S,V as j}from"./Value-B4M62ove.mjs";import{S as C,W as T}from"./WalletLink-WAY9-CI0.mjs";import{e as O}from"./StackedContainer-BrIQsdas.mjs";import{Y as x}from"./useActiveWallet-SiVSXkvG.mjs";import{T as $,a as L}from"./TransactionErrorView-DOcJFQEX.mjs";import{g as E}from"./transaction-CnfuREWo.mjs";import{pipe as F,getCompiledTransactionMessageDecoder as _,decompileTransactionMessage as P,setTransactionMessageLifetimeUsingBlockhash as B,compileTransaction as J,getTransactionEncoder as W,getBase58Decoder as D,fetchAddressesForLookupTables as M}from"@solana/kit";import{a as R,f as q,s as U,b as V,u as H}from"./useSolanaRpcClient-DaxiCEwc.mjs";import{D as z,T as N,a as Q,S as X,A as Y,R as G,J as K,g as Z}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"viem";import"tinycolor2";import"ofetch";import"lucide-react";import"./index-Dr4t3oWO.mjs";import"uuid";import"jose";import"eventemitter3";import"./useWallets-gElyEQoU.mjs";import"./prepareFundingModalData-BYy0MVol.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Bh4N2Hpm.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./getPublicClient-A9RSftUZ.mjs";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-BQ6FV6yc.mjs";import"./Screen-CKaxnxac.mjs";import"./index-CJMgUOnw.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"./LoadingSkeleton-CHdaq3pb.mjs";import"./ethers-g3QzXj2h.mjs";import"@heroicons/react/24/outline";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"./Address-CDOE2oK9.mjs";import"./WalletInfoCard-C8BrD5jy.mjs";import"./shared-CtYf3O54.mjs";import"./Checkbox-NmGCZeKL.mjs";import"./ErrorBanner-BdiArMwu.mjs";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"./WarningBanner-BDp-QC9i.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/ClipboardDocumentIcon";const tt=/*#__PURE__*/h.span.withConfig({displayName:"CircleBackground",componentId:"sc-c9f33cd-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";background-color:",";border-radius:50%;display:inline-block;box-sizing:border-box;}"],(t=>t.color??"var(--privy-color-accent)"),(t=>t.color??"var(--privy-color-accent)")),nt=({instruction:e,fees:a,transactionInfo:r,solPrice:o,chain:i})=>/*#__PURE__*/t(I,{children:[r?.action&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Action"}),/*#__PURE__*/n(j,{children:r.action})]}),null!=e?.total&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Total"}),/*#__PURE__*/n(j,{children:e.total})]}),!e?.total&&null!=e?.amount&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Total"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(C,{quantities:[e.amount,a],tokenPrice:o})})]}),/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Fees"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(C,{quantities:[a],tokenPrice:o})})]}),e?.to&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"To"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(T,{walletAddress:e.to,chainId:i,chainType:"solana"})})]})]}),et=({fees:a,onClose:r,receiptHeader:o,receiptDescription:i,transactionInfo:s,solPrice:c,signOnly:l,instruction:d,chain:u})=>/*#__PURE__*/t(e,{children:[/*#__PURE__*/n(k,{onClose:r}),/*#__PURE__*/n(O,{style:{marginBottom:"16px"},children:/*#__PURE__*/t("div",{children:[/*#__PURE__*/n(tt,{color:"var(--privy-color-success-light)"}),/*#__PURE__*/n(g,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),/*#__PURE__*/n(v,{title:o??`Transaction ${l?"signed":"complete"}!`,description:i??"You're all set."}),/*#__PURE__*/n(nt,{solPrice:c,instruction:d,fees:a,transactionInfo:s,chain:u}),/*#__PURE__*/n(x,{}),/*#__PURE__*/n(at,{loading:!1,onClick:r,children:"Close"}),/*#__PURE__*/n(w,{}),/*#__PURE__*/n(b,{})]});let at=/*#__PURE__*/h(y).withConfig({displayName:"SubmitButton",componentId:"sc-3cb7ee42-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);async function rt(t,n){try{return await t}catch{return n}}function ot(t){switch(t){case"solana:mainnet":return"mainnet-beta";case"solana:devnet":return"devnet";case"solana:testnet":return"testnet"}}async function it({privyClient:t,chain:n,mint:e}){let a=z[n];if(!a[e]){let r=await t.getSplTokenMetadata({mintAddress:e,cluster:ot(n)});r&&(a[e]={address:e,symbol:r.symbol,decimals:r.decimals})}return a[e]}async function st({tx:t,solanaClient:n,privyClient:e,checkFunds:a}){let r=_().decode(R(t)),o=r.staticAccounts[0]??"",i=await q({solanaClient:n,tx:t}),s=a?await rt(U({solanaClient:n,tx:t})):void 0,c=s?.hasFunds??!0,l={},d=[],u=await async function({solanaClient:t,message:n}){if(!("addressTableLookups"in n)||!n.addressTableLookups)return[...n.staticAccounts];let e=n.addressTableLookups.map((t=>t.lookupTableAddress)),a=await M(e,t.rpc),r=e.map(((t,e)=>[...n.addressTableLookups[e]?.writableIndexes.map((n=>{let r=a[t]?.[n];if(r)return{key:r,isWritable:!0,altIdx:e}}))??[],...n.addressTableLookups[e]?.readonlyIndexes.map((n=>{let r=a[t]?.[n];if(r)return{key:r,isWritable:!1,altIdx:e}}))??[]])).flat().filter((t=>!!t)).sort(((t,n)=>t.isWritable!==n.isWritable?t.isWritable?-1:1:t.altIdx-n.altIdx)).map((({key:t})=>t));return[...n.staticAccounts,...r]}({solanaClient:n,message:r});for(let t of r.instructions){let a=r.staticAccounts[t.programAddressIndex]||"";if(a!==N&&a!==Q)if(a!==X){if(a===Y){let n=await rt(function(t,n,e){let[a,r,o,i]=t.accountIndices?.map((t=>n[t]))??[];return{type:"ata-creation",program:e,payer:a,ata:r,owner:o,mint:i}}(t,u,a));if(!n){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}if(d.push(n),n.ata&&n.owner&&n.mint){l[n.ata]={owner:n.owner,mint:n.mint};continue}}if(G.includes(a)){let r=await rt(ut(t,u,n,e,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r)}else if(K.includes(a)){let r=await rt(mt(t,u,n,e,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r)}else d.push({type:"unknown",program:a,discriminator:t.data?.[0]})}else{let n=await rt(dt(t,u));if(!n){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(n)}else{let r=await rt(lt(t,u,n,e,l,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r),"spl-transfer"===r.type&&(r.fromAta&&r.fromAccount&&r.token.address&&(l[r.fromAta]??={owner:r.fromAccount,mint:r.token.address}),r.toAta&&r.toAccount&&r.token.address&&(l[r.toAta]??={owner:r.toAccount,mint:r.token.address}))}}return{spender:o,fee:i,instructions:d,hasFunds:!!c}}function ct(t,n=0){try{return function(t,n=0){let e=0n;for(let a=0;a<8;a++)e|=BigInt(t[n+a])<<BigInt(8*a);return e}(t,n)}catch{}try{return t.readBigInt64LE(n)}catch{}let e=V(t);try{return((t,n=0)=>{let e=t[n],a=t[n+7];if(!e||!a)throw Error(`Buffer offset out of range: first: ${e}, last: ${a}.`);return(BigInt(t[n+4]+256*t[n+5]+65536*t[n+6]+(a<<24))<<32n)+BigInt(e+256*t[++n]+65536*t[++n]+16777216*t[++n])})(e)}catch{}try{return e.subarray(n).readBigInt64LE()}catch{}try{return e.readBigInt64LE(n)}catch{}return 0n}async function lt(t,n,e,a,r,o){let i=t.data?.[0],s=t.accountIndices?.map((t=>n[t]))??[];if(1===i){let[t,n,e]=s;return{type:"spl-init-account",program:o,account:t,mint:n,owner:e}}if(3===i){let n,i,[c,l,d]=s,u="",m=l?r[l]:void 0;if(m)n=m.owner,u=m.mint;else if(l){let t=await e.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send(),a=t.value?.data;n=a?.parsed?.info?.owner,u=a?.parsed?.info?.mint??"",i=a?.parsed?.info?.tokenAmount?.decimals}if(!u&&c){let t=await e.rpc.getAccountInfo(c,{commitment:"confirmed",encoding:"jsonParsed"}).send(),n=t.value?.data;u=n?.parsed?.info?.mint??""}let p=await it({privyClient:a,chain:e.chain,mint:u}),f=p?.symbol??"";return i??=p?.decimals??9,{type:"spl-transfer",program:o,fromAta:c,fromAccount:d,toAta:l,toAccount:n,value:ct(t.data,1),token:{symbol:f,decimals:i,address:u}}}if(9===i){let[t,n,e]=s;return{type:"spl-close-account",program:o,source:t,destination:n,owner:e}}if(17===i)return{type:"spl-sync-native",program:o};throw Error(`Token program instruction type ${i} not supported`)}async function dt(t,n){let e=t.data?.[0],a=t.accountIndices?.map((t=>n[t]))??[];if(0===e){let[,n]=a;return{type:"create-account",program:X,account:n?.toString(),value:ct(t.data,4),withSeed:!1}}if(2===e){let[n,e]=a;return{type:"sol-transfer",program:X,fromAccount:n,toAccount:e,token:{symbol:"SOL",decimals:9},value:ct(t.data,4),withSeed:!1}}if(3===e){let[,n]=a;return{type:"create-account",program:X,account:n,withSeed:!0,value:ct(t.data.slice(t.data.length-32-8-8))}}if(11===e){let[n,e]=a;return{type:"sol-transfer",program:X,fromAccount:n,toAccount:e,value:ct(t.data,4),token:{symbol:"SOL",decimals:9},withSeed:!0}}throw Error(`System program instruction type ${e} not supported`)}async function ut(t,n,e,a,r){let o=t.accountIndices?.map((t=>n[t]))??[],i=t.data?.[0];if(143===i){let n=o[10],i=o[11];return{type:"raydium-swap-base-input",program:r,mintIn:n,mintOut:i,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:i?await it({privyClient:a,chain:e.chain,mint:i}):void 0,amountIn:ct(t.data,8),minimumAmountOut:ct(t.data,16)}}if(55===i){let n=o[10],i=o[11];return{type:"raydium-swap-base-output",program:r,mintIn:n,mintOut:i,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:i?await it({privyClient:a,chain:e.chain,mint:i}):void 0,maxAmountIn:ct(t.data,8),amountOut:ct(t.data,16)}}throw Error(`Raydium swap program instruction type ${i} not supported`)}async function mt(t,n,e,a,r){let o=t.data?.[0],i=t.accountIndices?.map((t=>n[t]))??[];if([208,51,239,151,123,43,237,92].includes(o)){let n=i[5],o=i[6];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,outAmount:ct(t.data,t.data.length-1-2-8-8),quotedInAmount:ct(t.data,t.data.length-1-2-8)}}if([176,209,105,168,154,125,69,62].includes(o)){let n=i[7],o=i[8];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,outAmount:ct(t.data,t.data.length-1-2-8-8),quotedInAmount:ct(t.data,t.data.length-1-2-8)}}if([193,32,155,51,65,214,156,129].includes(o)){let n=i[7],o=i[8];return{type:"jupiter-swap-shared-accounts-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,inAmount:ct(t.data,t.data.length-1-2-8-8),quotedOutAmount:ct(t.data,t.data.length-1-2-8)}}throw[62,198,214,193,213,159,108,210].includes(o)&&console.warn("Jupiter swap program instruction 'claim' not implemented"),[116,206,27,191,166,19,0,73].includes(o)&&console.warn("Jupiter swap program instruction 'claim_token' not implemented"),[26,74,236,151,104,64,183,249].includes(o)&&console.warn("Jupiter swap program instruction 'close_token' not implemented"),[229,194,212,172,8,10,134,147].includes(o)&&console.warn("Jupiter swap program instruction 'create_open_orders' not implemented"),[28,226,32,148,188,136,113,171].includes(o)&&console.warn("Jupiter swap program instruction 'create_program_open_orders' not implemented"),[232,242,197,253,240,143,129,52].includes(o)&&console.warn("Jupiter swap program instruction 'create_token_ledger' not implemented"),[147,241,123,100,244,132,174,118].includes(o)&&console.warn("Jupiter swap program instruction 'create_token_account' not implemented"),[229,23,203,151,122,227,173,42].includes(o)&&console.warn("Jupiter swap program instruction 'route' not implemented"),[150,86,71,116,167,93,14,104].includes(o)&&console.warn("Jupiter swap program instruction 'route_with_token_ledger' not implemented"),[228,85,185,112,78,79,77,2].includes(o)&&console.warn("Jupiter swap program instruction 'set_token_ledger' not implemented"),[230,121,143,80,119,159,106,170].includes(o)&&console.warn("Jupiter swap program instruction 'shared_accounts_route_with_token_ledger' not implemented"),Error(`Jupiter swap program instruction type ${o} not supported`)}const pt={component:()=>{let{data:t,onUserCloseViaDialogOrKeybindRef:e,setModalData:g,navigate:h}=s(),{client:y,closePrivyModal:w,walletProxy:k,showFiatPrices:b}=m(),v=u(),{user:I}=c(),A=H()(t?.standardSignAndSendTransaction?.chain??"solana:mainnet"),[S,j]=a(t?.standardSignAndSendTransaction?.transaction),[C,T]=a(),[O,x]=a(),[M,q]=a({value:0n,isLoading:!1}),[U,V]=a(!1),[z,N]=a({}),[Q,X]=a(),Y=t?.standardSignAndSendTransaction?.account,G=!!t?.standardSignAndSendTransaction?.signOnly,K=Y?.imported?l(I).find((t=>t.address===Y.address)):d(I),{solPrice:tt,isSolPriceLoading:nt}=p({enabled:b}),at=r((()=>{if(!C)return;let t=C.spender,n=E(C.fee),e=E(M.value,3,!0),a=C.instructions.filter((t=>["sol-transfer","spl-transfer","raydium-swap-base-input","raydium-swap-base-output","jupiter-swap-shared-accounts-route","jupiter-swap-exact-out-route"].includes(t.type))),r=a.at(0);if(!r||a.length>1)return{fee:n,spender:t,balance:e};if("sol-transfer"===r.type)return{fee:n,spender:t,balance:e,total:E(r.value)};if("spl-transfer"===r.type)return{fee:n,spender:t,balance:e,total:`${i({amount:r.value,decimals:r.token.decimals})} ${r.token.symbol}`};if("raydium-swap-base-input"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.amountIn,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.minimumAmountOut,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("raydium-swap-base-output"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.maxAmountIn,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.amountOut,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("jupiter-swap-shared-accounts-route"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.inAmount,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.quotedOutAmount,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("jupiter-swap-exact-out-route"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.quotedInAmount,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.outAmount,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}return{fee:n,spender:t,balance:e}}),[C,Y?.address,M]),rt=r((()=>{let t;if(!C||!b||!tt||nt)return;function n(...t){return Z(t.reduce(((t,n)=>t+n),0n),tt??0)}Y?.address===C.spender&&(t=n(C.fee));let e=n(M.value),a=C.instructions.filter((t=>"sol-transfer"===t.type||"spl-transfer"===t.type)).at(0);return!a||C.instructions.length>1?{fee:t,balance:e}:"sol-transfer"===a.type?{fee:t,balance:e,total:n(a.value,Y?.address===C.spender?C.fee:0n)}:"spl-transfer"===a.type?{fee:t,balance:e,total:`${i({amount:a.value,decimals:a.token.decimals})} ${a.token.symbol}`}:{fee:t,balance:e}}),[C,b,tt,nt,Y?.address,M]);if(o((()=>{!async function(){if(S&&y)try{x(void 0);let t=await st({tx:S,solanaClient:A,privyClient:y,checkFunds:!G});T(t)}catch(t){console.error("Failed to prepare transaction",t),x(t)}}()}),[S,A,y,G]),o((()=>{(async function(){if(!Y)return;q({value:M.value,isLoading:!0});let{value:t}=await A.rpc.getBalance(Y.address,{commitment:"confirmed"}).send();q({value:t??0n,isLoading:!1})})().catch(console.error)}),[C]),!S||!t?.standardSignAndSendTransaction||!Y){let e=Error("Invalid transaction request");/*#__PURE__*/return n(f,{error:e,allowlistConfig:v.allowlistConfig,onRetry:()=>{t?.standardSignAndSendTransaction?.onFailure(e),w({shouldCallAuthOnSuccess:!1})}})}let ot=()=>{if(!U)return z.signature||z.signedTransaction?t?.standardSignAndSendTransaction?.onSuccess({signature:z.signature,signedTransaction:z.signedTransaction}):t?.standardSignAndSendTransaction?.onFailure(Q??O??Error("User exited the modal before submitting the transaction")),w({shouldCallAuthOnSuccess:!1})};e.current=ot;let it=t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/n("img",{src:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,ct=!!(t.funding&&t.funding.supportedOptions.length>0),lt=!C?.hasFunds&&ct;if(z.signature||z.signedTransaction){let e=C?.instructions.filter((t=>"sol-transfer"===t.type||"spl-transfer"===t.type)),a=1===e?.length?e?.at(0):void 0;/*#__PURE__*/return n(et,{fees:z.fees??0n,onClose:ot,transactionInfo:t.standardSignAndSendTransaction?.uiOptions.transactionInfo,solPrice:tt,receiptHeader:t.standardSignAndSendTransaction?.uiOptions.successHeader,receiptDescription:t.standardSignAndSendTransaction?.uiOptions.successDescription,chain:A.chain,signOnly:G,instruction:"sol-transfer"===a?.type?{to:a.toAccount,amount:a.value}:{to:a?.toAccount||a?.toAta,total:at?.total}})}return Q?/*#__PURE__*/n($,{transactionError:Q,chainId:A.chain,onClose:ot,chainType:"solana",onRetry:async()=>{X(void 0);let{value:t}=await A.rpc.getLatestBlockhash().send();var n,e;j((n=S,e=t,F(_().decode(R(n)),(t=>P(t)),(t=>B(e,t)),(t=>J(t)),(t=>new Uint8Array(W().encode(t))))))}}):/*#__PURE__*/n(L,{img:it,title:t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.title||"Confirm transaction",subtitle:t.standardSignAndSendTransaction?.uiOptions?.description||`${v.name} wants your permission to approve the following transaction.`,cta:lt?"Add funds":t.standardSignAndSendTransaction?.uiOptions?.buttonText||"Approve",instructions:C?.instructions??[],network:"solana:mainnet"==A.chain?"Solana":A.chain.replace("solana:",""),blockExplorerUrl:A.blockExplorerUrl,total:b?rt?.total:at?.total,fee:b?rt?.fee:at?.fee,balance:b?rt?.balance:at?.balance,swap:at?.swap,transactingWalletAddress:Y.address,disabled:!C?.hasFunds&&!ct,isSubmitting:U,isPreparing:!C||M.isLoading,isTokenPriceLoading:b&&nt,isMissingFunds:!C?.hasFunds,submitError:Q??void 0,isSponsored:!!t.standardSignAndSendTransaction?.isSponsored,parseError:O,onClick:lt?async()=>{if(!Y)return;if(!ct)throw Error("Funding wallet is not enabled");let n="FundingMethodSelectionScreen";g({...t,funding:{...t.funding,methodScreen:n},solanaFundingData:t?.solanaFundingData}),h(n)}:async()=>{try{if(V(!0),U||!Y||!k||!I||!K)return;let n=await t.standardSignAndSendTransaction.onConfirm(S);if("signature"in n){let t=await async function({solanaClient:t,signature:n}){let e=D().decode(n),a=await t.rpc.getTransaction(e,{maxSupportedTransactionVersion:0,commitment:"confirmed",encoding:"base64"}).send().catch((()=>null));return a?{fee:a.meta?.fee??0n}:null}({solanaClient:A,signature:n.signature});return void N({...n,fees:t?.fee})}N(n)}catch(t){console.warn({transaction:S,error:t}),X(t)}finally{V(!1)}},onClose:ot})}};export{pt as StandardSignAndSendTransactionScreen,pt as default};
1
+ import{jsxs as t,jsx as n,Fragment as e}from"react/jsx-runtime";import{useState as a,useMemo as r,useEffect as o}from"react";import{formatTokenAmount as i}from"@privy-io/js-sdk-core";import{a as s,u as c,j as l,g as d}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{u}from"./context-Bycd1SKV.mjs";import{u as m}from"./internal-context-e-Eni5bG.mjs";import{u as p}from"./useGetSolPrice-Cfm8o9C5.mjs";import{ErrorScreenView as f}from"./ErrorScreen-BdxNEgU1.mjs";import g from"@heroicons/react/24/outline/CheckCircleIcon";import{styled as h}from"styled-components";import{P as y}from"./Button-B8mqatRx.mjs";import{R as w}from"./Layouts-Bmf8DxNP.mjs";import{M as k,B as b}from"./ModalHeader-BLGC-7ev.mjs";import{C as v}from"./ScreenHeader-Biz1wq02.mjs";import{a as I,R as A}from"./Row-CG0lSY5Z.mjs";import{L as S,V as j}from"./Value-B4M62ove.mjs";import{S as C,W as T}from"./WalletLink-C9CSqqVy.mjs";import{e as O}from"./StackedContainer-BrIQsdas.mjs";import{Y as x}from"./useActiveWallet-Bsy5GTCV.mjs";import{T as $,a as L}from"./TransactionErrorView-CfyBAYzV.mjs";import{g as E}from"./transaction-CnfuREWo.mjs";import{pipe as F,getCompiledTransactionMessageDecoder as _,decompileTransactionMessage as P,setTransactionMessageLifetimeUsingBlockhash as B,compileTransaction as J,getTransactionEncoder as W,getBase58Decoder as D,fetchAddressesForLookupTables as M}from"@solana/kit";import{a as R,f as q,s as U,b as V,u as H}from"./useSolanaRpcClient-DW9Xaoo_.mjs";import{D as z,T as N,a as Q,S as X,A as Y,R as G,J as K,g as Z}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"viem";import"tinycolor2";import"ofetch";import"lucide-react";import"./index-CCyaupaz.mjs";import"uuid";import"jose";import"eventemitter3";import"./useWallets-D0lpBS44.mjs";import"./prepareFundingModalData-CIgFwA7s.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-BaiIHGte.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./getPublicClient-A9RSftUZ.mjs";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-CddsD3Of.mjs";import"./Screen-BTyXgDrd.mjs";import"./index-CJMgUOnw.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"./LoadingSkeleton-CHdaq3pb.mjs";import"./ethers-C3Y94dat.mjs";import"@heroicons/react/24/outline";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"./Address-BsvZLUXE.mjs";import"./WalletInfoCard-YE5P6CSV.mjs";import"./shared-CtYf3O54.mjs";import"./Checkbox-NmGCZeKL.mjs";import"./ErrorBanner-BdiArMwu.mjs";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"./WarningBanner-BDp-QC9i.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/ClipboardDocumentIcon";const tt=/*#__PURE__*/h.span.withConfig({displayName:"CircleBackground",componentId:"sc-c9f33cd-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";background-color:",";border-radius:50%;display:inline-block;box-sizing:border-box;}"],(t=>t.color??"var(--privy-color-accent)"),(t=>t.color??"var(--privy-color-accent)")),nt=({instruction:e,fees:a,transactionInfo:r,solPrice:o,chain:i})=>/*#__PURE__*/t(I,{children:[r?.action&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Action"}),/*#__PURE__*/n(j,{children:r.action})]}),null!=e?.total&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Total"}),/*#__PURE__*/n(j,{children:e.total})]}),!e?.total&&null!=e?.amount&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Total"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(C,{quantities:[e.amount,a],tokenPrice:o})})]}),/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Fees"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(C,{quantities:[a],tokenPrice:o})})]}),e?.to&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"To"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(T,{walletAddress:e.to,chainId:i,chainType:"solana"})})]})]}),et=({fees:a,onClose:r,receiptHeader:o,receiptDescription:i,transactionInfo:s,solPrice:c,signOnly:l,instruction:d,chain:u})=>/*#__PURE__*/t(e,{children:[/*#__PURE__*/n(k,{onClose:r}),/*#__PURE__*/n(O,{style:{marginBottom:"16px"},children:/*#__PURE__*/t("div",{children:[/*#__PURE__*/n(tt,{color:"var(--privy-color-success-light)"}),/*#__PURE__*/n(g,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),/*#__PURE__*/n(v,{title:o??`Transaction ${l?"signed":"complete"}!`,description:i??"You're all set."}),/*#__PURE__*/n(nt,{solPrice:c,instruction:d,fees:a,transactionInfo:s,chain:u}),/*#__PURE__*/n(x,{}),/*#__PURE__*/n(at,{loading:!1,onClick:r,children:"Close"}),/*#__PURE__*/n(w,{}),/*#__PURE__*/n(b,{})]});let at=/*#__PURE__*/h(y).withConfig({displayName:"SubmitButton",componentId:"sc-3cb7ee42-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);async function rt(t,n){try{return await t}catch{return n}}function ot(t){switch(t){case"solana:mainnet":return"mainnet-beta";case"solana:devnet":return"devnet";case"solana:testnet":return"testnet"}}async function it({privyClient:t,chain:n,mint:e}){let a=z[n];if(!a[e]){let r=await t.getSplTokenMetadata({mintAddress:e,cluster:ot(n)});r&&(a[e]={address:e,symbol:r.symbol,decimals:r.decimals})}return a[e]}async function st({tx:t,solanaClient:n,privyClient:e,checkFunds:a}){let r=_().decode(R(t)),o=r.staticAccounts[0]??"",i=await q({solanaClient:n,tx:t}),s=a?await rt(U({solanaClient:n,tx:t})):void 0,c=s?.hasFunds??!0,l={},d=[],u=await async function({solanaClient:t,message:n}){if(!("addressTableLookups"in n)||!n.addressTableLookups)return[...n.staticAccounts];let e=n.addressTableLookups.map((t=>t.lookupTableAddress)),a=await M(e,t.rpc),r=e.map(((t,e)=>[...n.addressTableLookups[e]?.writableIndexes.map((n=>{let r=a[t]?.[n];if(r)return{key:r,isWritable:!0,altIdx:e}}))??[],...n.addressTableLookups[e]?.readonlyIndexes.map((n=>{let r=a[t]?.[n];if(r)return{key:r,isWritable:!1,altIdx:e}}))??[]])).flat().filter((t=>!!t)).sort(((t,n)=>t.isWritable!==n.isWritable?t.isWritable?-1:1:t.altIdx-n.altIdx)).map((({key:t})=>t));return[...n.staticAccounts,...r]}({solanaClient:n,message:r});for(let t of r.instructions){let a=r.staticAccounts[t.programAddressIndex]||"";if(a!==N&&a!==Q)if(a!==X){if(a===Y){let n=await rt(function(t,n,e){let[a,r,o,i]=t.accountIndices?.map((t=>n[t]))??[];return{type:"ata-creation",program:e,payer:a,ata:r,owner:o,mint:i}}(t,u,a));if(!n){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}if(d.push(n),n.ata&&n.owner&&n.mint){l[n.ata]={owner:n.owner,mint:n.mint};continue}}if(G.includes(a)){let r=await rt(ut(t,u,n,e,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r)}else if(K.includes(a)){let r=await rt(mt(t,u,n,e,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r)}else d.push({type:"unknown",program:a,discriminator:t.data?.[0]})}else{let n=await rt(dt(t,u));if(!n){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(n)}else{let r=await rt(lt(t,u,n,e,l,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r),"spl-transfer"===r.type&&(r.fromAta&&r.fromAccount&&r.token.address&&(l[r.fromAta]??={owner:r.fromAccount,mint:r.token.address}),r.toAta&&r.toAccount&&r.token.address&&(l[r.toAta]??={owner:r.toAccount,mint:r.token.address}))}}return{spender:o,fee:i,instructions:d,hasFunds:!!c}}function ct(t,n=0){try{return function(t,n=0){let e=0n;for(let a=0;a<8;a++)e|=BigInt(t[n+a])<<BigInt(8*a);return e}(t,n)}catch{}try{return t.readBigInt64LE(n)}catch{}let e=V(t);try{return((t,n=0)=>{let e=t[n],a=t[n+7];if(!e||!a)throw Error(`Buffer offset out of range: first: ${e}, last: ${a}.`);return(BigInt(t[n+4]+256*t[n+5]+65536*t[n+6]+(a<<24))<<32n)+BigInt(e+256*t[++n]+65536*t[++n]+16777216*t[++n])})(e)}catch{}try{return e.subarray(n).readBigInt64LE()}catch{}try{return e.readBigInt64LE(n)}catch{}return 0n}async function lt(t,n,e,a,r,o){let i=t.data?.[0],s=t.accountIndices?.map((t=>n[t]))??[];if(1===i){let[t,n,e]=s;return{type:"spl-init-account",program:o,account:t,mint:n,owner:e}}if(3===i){let n,i,[c,l,d]=s,u="",m=l?r[l]:void 0;if(m)n=m.owner,u=m.mint;else if(l){let t=await e.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send(),a=t.value?.data;n=a?.parsed?.info?.owner,u=a?.parsed?.info?.mint??"",i=a?.parsed?.info?.tokenAmount?.decimals}if(!u&&c){let t=await e.rpc.getAccountInfo(c,{commitment:"confirmed",encoding:"jsonParsed"}).send(),n=t.value?.data;u=n?.parsed?.info?.mint??""}let p=await it({privyClient:a,chain:e.chain,mint:u}),f=p?.symbol??"";return i??=p?.decimals??9,{type:"spl-transfer",program:o,fromAta:c,fromAccount:d,toAta:l,toAccount:n,value:ct(t.data,1),token:{symbol:f,decimals:i,address:u}}}if(9===i){let[t,n,e]=s;return{type:"spl-close-account",program:o,source:t,destination:n,owner:e}}if(17===i)return{type:"spl-sync-native",program:o};throw Error(`Token program instruction type ${i} not supported`)}async function dt(t,n){let e=t.data?.[0],a=t.accountIndices?.map((t=>n[t]))??[];if(0===e){let[,n]=a;return{type:"create-account",program:X,account:n?.toString(),value:ct(t.data,4),withSeed:!1}}if(2===e){let[n,e]=a;return{type:"sol-transfer",program:X,fromAccount:n,toAccount:e,token:{symbol:"SOL",decimals:9},value:ct(t.data,4),withSeed:!1}}if(3===e){let[,n]=a;return{type:"create-account",program:X,account:n,withSeed:!0,value:ct(t.data.slice(t.data.length-32-8-8))}}if(11===e){let[n,e]=a;return{type:"sol-transfer",program:X,fromAccount:n,toAccount:e,value:ct(t.data,4),token:{symbol:"SOL",decimals:9},withSeed:!0}}throw Error(`System program instruction type ${e} not supported`)}async function ut(t,n,e,a,r){let o=t.accountIndices?.map((t=>n[t]))??[],i=t.data?.[0];if(143===i){let n=o[10],i=o[11];return{type:"raydium-swap-base-input",program:r,mintIn:n,mintOut:i,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:i?await it({privyClient:a,chain:e.chain,mint:i}):void 0,amountIn:ct(t.data,8),minimumAmountOut:ct(t.data,16)}}if(55===i){let n=o[10],i=o[11];return{type:"raydium-swap-base-output",program:r,mintIn:n,mintOut:i,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:i?await it({privyClient:a,chain:e.chain,mint:i}):void 0,maxAmountIn:ct(t.data,8),amountOut:ct(t.data,16)}}throw Error(`Raydium swap program instruction type ${i} not supported`)}async function mt(t,n,e,a,r){let o=t.data?.[0],i=t.accountIndices?.map((t=>n[t]))??[];if([208,51,239,151,123,43,237,92].includes(o)){let n=i[5],o=i[6];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,outAmount:ct(t.data,t.data.length-1-2-8-8),quotedInAmount:ct(t.data,t.data.length-1-2-8)}}if([176,209,105,168,154,125,69,62].includes(o)){let n=i[7],o=i[8];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,outAmount:ct(t.data,t.data.length-1-2-8-8),quotedInAmount:ct(t.data,t.data.length-1-2-8)}}if([193,32,155,51,65,214,156,129].includes(o)){let n=i[7],o=i[8];return{type:"jupiter-swap-shared-accounts-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,inAmount:ct(t.data,t.data.length-1-2-8-8),quotedOutAmount:ct(t.data,t.data.length-1-2-8)}}throw[62,198,214,193,213,159,108,210].includes(o)&&console.warn("Jupiter swap program instruction 'claim' not implemented"),[116,206,27,191,166,19,0,73].includes(o)&&console.warn("Jupiter swap program instruction 'claim_token' not implemented"),[26,74,236,151,104,64,183,249].includes(o)&&console.warn("Jupiter swap program instruction 'close_token' not implemented"),[229,194,212,172,8,10,134,147].includes(o)&&console.warn("Jupiter swap program instruction 'create_open_orders' not implemented"),[28,226,32,148,188,136,113,171].includes(o)&&console.warn("Jupiter swap program instruction 'create_program_open_orders' not implemented"),[232,242,197,253,240,143,129,52].includes(o)&&console.warn("Jupiter swap program instruction 'create_token_ledger' not implemented"),[147,241,123,100,244,132,174,118].includes(o)&&console.warn("Jupiter swap program instruction 'create_token_account' not implemented"),[229,23,203,151,122,227,173,42].includes(o)&&console.warn("Jupiter swap program instruction 'route' not implemented"),[150,86,71,116,167,93,14,104].includes(o)&&console.warn("Jupiter swap program instruction 'route_with_token_ledger' not implemented"),[228,85,185,112,78,79,77,2].includes(o)&&console.warn("Jupiter swap program instruction 'set_token_ledger' not implemented"),[230,121,143,80,119,159,106,170].includes(o)&&console.warn("Jupiter swap program instruction 'shared_accounts_route_with_token_ledger' not implemented"),Error(`Jupiter swap program instruction type ${o} not supported`)}const pt={component:()=>{let{data:t,onUserCloseViaDialogOrKeybindRef:e,setModalData:g,navigate:h}=s(),{client:y,closePrivyModal:w,walletProxy:k,showFiatPrices:b}=m(),v=u(),{user:I}=c(),A=H()(t?.standardSignAndSendTransaction?.chain??"solana:mainnet"),[S,j]=a(t?.standardSignAndSendTransaction?.transaction),[C,T]=a(),[O,x]=a(),[M,q]=a({value:0n,isLoading:!1}),[U,V]=a(!1),[z,N]=a({}),[Q,X]=a(),Y=t?.standardSignAndSendTransaction?.account,G=!!t?.standardSignAndSendTransaction?.signOnly,K=Y?.imported?l(I).find((t=>t.address===Y.address)):d(I),{solPrice:tt,isSolPriceLoading:nt}=p({enabled:b}),at=r((()=>{if(!C)return;let t=C.spender,n=E(C.fee),e=E(M.value,3,!0),a=C.instructions.filter((t=>["sol-transfer","spl-transfer","raydium-swap-base-input","raydium-swap-base-output","jupiter-swap-shared-accounts-route","jupiter-swap-exact-out-route"].includes(t.type))),r=a.at(0);if(!r||a.length>1)return{fee:n,spender:t,balance:e};if("sol-transfer"===r.type)return{fee:n,spender:t,balance:e,total:E(r.value)};if("spl-transfer"===r.type)return{fee:n,spender:t,balance:e,total:`${i({amount:r.value,decimals:r.token.decimals})} ${r.token.symbol}`};if("raydium-swap-base-input"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.amountIn,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.minimumAmountOut,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("raydium-swap-base-output"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.maxAmountIn,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.amountOut,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("jupiter-swap-shared-accounts-route"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.inAmount,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.quotedOutAmount,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("jupiter-swap-exact-out-route"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.quotedInAmount,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.outAmount,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}return{fee:n,spender:t,balance:e}}),[C,Y?.address,M]),rt=r((()=>{let t;if(!C||!b||!tt||nt)return;function n(...t){return Z(t.reduce(((t,n)=>t+n),0n),tt??0)}Y?.address===C.spender&&(t=n(C.fee));let e=n(M.value),a=C.instructions.filter((t=>"sol-transfer"===t.type||"spl-transfer"===t.type)).at(0);return!a||C.instructions.length>1?{fee:t,balance:e}:"sol-transfer"===a.type?{fee:t,balance:e,total:n(a.value,Y?.address===C.spender?C.fee:0n)}:"spl-transfer"===a.type?{fee:t,balance:e,total:`${i({amount:a.value,decimals:a.token.decimals})} ${a.token.symbol}`}:{fee:t,balance:e}}),[C,b,tt,nt,Y?.address,M]);if(o((()=>{!async function(){if(S&&y)try{x(void 0);let t=await st({tx:S,solanaClient:A,privyClient:y,checkFunds:!G});T(t)}catch(t){console.error("Failed to prepare transaction",t),x(t)}}()}),[S,A,y,G]),o((()=>{(async function(){if(!Y)return;q({value:M.value,isLoading:!0});let{value:t}=await A.rpc.getBalance(Y.address,{commitment:"confirmed"}).send();q({value:t??0n,isLoading:!1})})().catch(console.error)}),[C]),!S||!t?.standardSignAndSendTransaction||!Y){let e=Error("Invalid transaction request");/*#__PURE__*/return n(f,{error:e,allowlistConfig:v.allowlistConfig,onRetry:()=>{t?.standardSignAndSendTransaction?.onFailure(e),w({shouldCallAuthOnSuccess:!1})}})}let ot=()=>{if(!U)return z.signature||z.signedTransaction?t?.standardSignAndSendTransaction?.onSuccess({signature:z.signature,signedTransaction:z.signedTransaction}):t?.standardSignAndSendTransaction?.onFailure(Q??O??Error("User exited the modal before submitting the transaction")),w({shouldCallAuthOnSuccess:!1})};e.current=ot;let it=t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/n("img",{src:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,ct=!!(t.funding&&t.funding.supportedOptions.length>0),lt=!C?.hasFunds&&ct;if(z.signature||z.signedTransaction){let e=C?.instructions.filter((t=>"sol-transfer"===t.type||"spl-transfer"===t.type)),a=1===e?.length?e?.at(0):void 0;/*#__PURE__*/return n(et,{fees:z.fees??0n,onClose:ot,transactionInfo:t.standardSignAndSendTransaction?.uiOptions.transactionInfo,solPrice:tt,receiptHeader:t.standardSignAndSendTransaction?.uiOptions.successHeader,receiptDescription:t.standardSignAndSendTransaction?.uiOptions.successDescription,chain:A.chain,signOnly:G,instruction:"sol-transfer"===a?.type?{to:a.toAccount,amount:a.value}:{to:a?.toAccount||a?.toAta,total:at?.total}})}return Q?/*#__PURE__*/n($,{transactionError:Q,chainId:A.chain,onClose:ot,chainType:"solana",onRetry:async()=>{X(void 0);let{value:t}=await A.rpc.getLatestBlockhash().send();var n,e;j((n=S,e=t,F(_().decode(R(n)),(t=>P(t)),(t=>B(e,t)),(t=>J(t)),(t=>new Uint8Array(W().encode(t))))))}}):/*#__PURE__*/n(L,{img:it,title:t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.title||"Confirm transaction",subtitle:t.standardSignAndSendTransaction?.uiOptions?.description||`${v.name} wants your permission to approve the following transaction.`,cta:lt?"Add funds":t.standardSignAndSendTransaction?.uiOptions?.buttonText||"Approve",instructions:C?.instructions??[],network:"solana:mainnet"==A.chain?"Solana":A.chain.replace("solana:",""),blockExplorerUrl:A.blockExplorerUrl,total:b?rt?.total:at?.total,fee:b?rt?.fee:at?.fee,balance:b?rt?.balance:at?.balance,swap:at?.swap,transactingWalletAddress:Y.address,disabled:!C?.hasFunds&&!ct,isSubmitting:U,isPreparing:!C||M.isLoading,isTokenPriceLoading:b&&nt,isMissingFunds:!C?.hasFunds,submitError:Q??void 0,isSponsored:!!t.standardSignAndSendTransaction?.isSponsored,parseError:O,onClick:lt?async()=>{if(!Y)return;if(!ct)throw Error("Funding wallet is not enabled");let n="FundingMethodSelectionScreen";g({...t,funding:{...t.funding,methodScreen:n},solanaFundingData:t?.solanaFundingData}),h(n)}:async()=>{try{if(V(!0),U||!Y||!k||!I||!K)return;let n=await t.standardSignAndSendTransaction.onConfirm(S);if("signature"in n){let t=await async function({solanaClient:t,signature:n}){let e=D().decode(n),a=await t.rpc.getTransaction(e,{maxSupportedTransactionVersion:0,commitment:"confirmed",encoding:"base64"}).send().catch((()=>null));return a?{fee:a.meta?.fee??0n}:null}({solanaClient:A,signature:n.signature});return void N({...n,fees:t?.fee})}N(n)}catch(t){console.warn({transaction:S,error:t}),X(t)}finally{V(!1)}},onClose:ot})}};export{pt as StandardSignAndSendTransactionScreen,pt as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as r}from"react";import{a as o,q as i,C as a}from"./index-Dr4t3oWO.mjs";import{u as s,q as n}from"./context-Dee1TPOi.mjs";import{u as m,b as l,k as c}from"./internal-context-e-Eni5bG.mjs";import{u as d,a as u}from"./get-is-unified-wallet-_KIJnP68.mjs";import{s as p}from"./shouldProceedtoEmbeddedWalletCreationFlow-iMnL58wW.mjs";import{S as g}from"./ScreenLayout-BQ6FV6yc.mjs";import{T as v}from"./telegram-B-JqnkqZ.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-SiVSXkvG.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-BYy0MVol.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Bh4N2Hpm.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"tinycolor2";import"./Button-DJY5dut3.mjs";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const y=({success:t,errorMessage:r,onRetry:o})=>{let i=t?"Successfully connected with Telegram":r?r.message:"Verifying connection to Telegram";/*#__PURE__*/return e(g,{title:i,subtitle:t?"You're good to go!":r?r.detail:"Just a few moments more",icon:v,iconVariant:"loading",iconLoadingStatus:{success:t,fail:!!r},secondaryCta:r?.retryable&&o?{label:"Retry",onClick:o}:void 0,watermark:!0})},h={component:()=>{let{authenticated:g,logout:v,ready:h,user:f}=d(),{setModalData:A,navigate:b,resetNavigation:j,data:T}=u(),S=s(),{initLoginWithTelegram:C,loginWithTelegram:w,updateWallets:E,setReadyToTrue:R,closePrivyModal:W,createAnalyticsEvent:_,getAuthMeta:M}=m(),[k,L]=t(!1),[I,x]=t(void 0),D=o();async function U(){try{let e=await async function(){let e;if(!g){if(D.enabled&&"error"===D.status)throw new a(D.error,null,l.CAPTCHA_FAILURE);return D.enabled&&"success"!==D.status&&(D.execute(),e=await D.waitForResult()),e}}();await w({captchaToken:e}),L(!0),R(!0)}catch(e){if(e?.privyErrorCode===l.ALLOWLIST_REJECTED)return x(void 0),j(),void b("AllowlistRejectionScreen");if(e?.privyErrorCode===l.USER_LIMIT_REACHED)return console.error(new c(e).toString()),x(void 0),j(),void b("UserLimitReachedScreen");if(e?.privyErrorCode===l.USER_DOES_NOT_EXIST)return x(void 0),j(),void b("AccountNotFoundScreen");if(e?.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return x(void 0),j(),A({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,telegramAuthResult:M()?.telegramAuthResult,telegramWebAppData:M()?.telegramWebAppData,displayName:e.data?.data?.account?.displayName,linkMethod:"telegram",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void b("LinkConflictScreen");let{retryable:t,detail:r}=i(e);x({retryable:t,detail:r,message:"Authentication failed"})}}r((()=>{U()}),[]),r((()=>{if(!(h&&g&&k&&f))return;if(S?.legal.requireUsersAcceptTerms&&!f.hasAcceptedTerms){let e=setTimeout((()=>{b("AffirmativeConsentScreen")}),n);return()=>clearTimeout(e)}if(p(f,S.embeddedWallets)){let e=setTimeout((()=>{A({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),_({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:"telegram",screen:"TelegramAuthScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),b("EmbeddedWalletOnAccountCreateScreen")}),n);return()=>clearTimeout(e)}E();let e=setTimeout((()=>W({shouldCallAuthOnSuccess:!0,isSuccess:!0})),n);return()=>clearTimeout(e)}),[h,g,k,f]);/*#__PURE__*/return e(y,{success:k,errorMessage:I,onRetry:I?.retryable?async()=>{try{x(void 0),T?.telegramAuthModalData?.seamlessAuth||await C(void 0,T?.login?.disableSignup),await U()}catch(e){let{retryable:t,detail:r}=i(e);x({retryable:t,detail:r,message:"Authentication failed"})}}:void 0})},isCaptchaRequired:!0,isShownBeforeReady:!0};export{h as TelegramAuthScreen,y as TelegramAuthScreenView,h as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as r}from"react";import{a as o,m as i,C as a}from"./index-CCyaupaz.mjs";import{u as s,q as n}from"./context-Bycd1SKV.mjs";import{u as m,b as l,k as c}from"./internal-context-e-Eni5bG.mjs";import{u as d,a as u}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{s as p}from"./shouldProceedtoEmbeddedWalletCreationFlow-Djgu4xiS.mjs";import{S as g}from"./ScreenLayout-CddsD3Of.mjs";import{T as v}from"./telegram-B-JqnkqZ.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-Bsy5GTCV.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-CIgFwA7s.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-D0lpBS44.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-BaiIHGte.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"tinycolor2";import"./Button-B8mqatRx.mjs";import"./Screen-BTyXgDrd.mjs";import"./ModalHeader-BLGC-7ev.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const y=({success:t,errorMessage:r,onRetry:o})=>{let i=t?"Successfully connected with Telegram":r?r.message:"Verifying connection to Telegram";/*#__PURE__*/return e(g,{title:i,subtitle:t?"You're good to go!":r?r.detail:"Just a few moments more",icon:v,iconVariant:"loading",iconLoadingStatus:{success:t,fail:!!r},secondaryCta:r?.retryable&&o?{label:"Retry",onClick:o}:void 0,watermark:!0})},h={component:()=>{let{authenticated:g,logout:v,ready:h,user:f}=d(),{setModalData:A,navigate:b,resetNavigation:j,data:T}=u(),S=s(),{initLoginWithTelegram:C,loginWithTelegram:w,updateWallets:E,setReadyToTrue:R,closePrivyModal:W,createAnalyticsEvent:_,getAuthMeta:M}=m(),[k,L]=t(!1),[I,x]=t(void 0),D=o();async function U(){try{let e=await async function(){let e;if(!g){if(D.enabled&&"error"===D.status)throw new a(D.error,null,l.CAPTCHA_FAILURE);return D.enabled&&"success"!==D.status&&(D.execute(),e=await D.waitForResult()),e}}();await w({captchaToken:e}),L(!0),R(!0)}catch(e){if(e?.privyErrorCode===l.ALLOWLIST_REJECTED)return x(void 0),j(),void b("AllowlistRejectionScreen");if(e?.privyErrorCode===l.USER_LIMIT_REACHED)return console.error(new c(e).toString()),x(void 0),j(),void b("UserLimitReachedScreen");if(e?.privyErrorCode===l.USER_DOES_NOT_EXIST)return x(void 0),j(),void b("AccountNotFoundScreen");if(e?.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return x(void 0),j(),A({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,telegramAuthResult:M()?.telegramAuthResult,telegramWebAppData:M()?.telegramWebAppData,displayName:e.data?.data?.account?.displayName,linkMethod:"telegram",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void b("LinkConflictScreen");let{retryable:t,detail:r}=i(e);x({retryable:t,detail:r,message:"Authentication failed"})}}r((()=>{U()}),[]),r((()=>{if(!(h&&g&&k&&f))return;if(S?.legal.requireUsersAcceptTerms&&!f.hasAcceptedTerms){let e=setTimeout((()=>{b("AffirmativeConsentScreen")}),n);return()=>clearTimeout(e)}if(p(f,S.embeddedWallets)){let e=setTimeout((()=>{A({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),_({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:"telegram",screen:"TelegramAuthScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),b("EmbeddedWalletOnAccountCreateScreen")}),n);return()=>clearTimeout(e)}E();let e=setTimeout((()=>W({shouldCallAuthOnSuccess:!0,isSuccess:!0})),n);return()=>clearTimeout(e)}),[h,g,k,f]);/*#__PURE__*/return e(y,{success:k,errorMessage:I,onRetry:I?.retryable?async()=>{try{x(void 0),T?.telegramAuthModalData?.seamlessAuth||await C(void 0,T?.login?.disableSignup),await U()}catch(e){let{retryable:t,detail:r}=i(e);x({retryable:t,detail:r,message:"Authentication failed"})}}:void 0})},isCaptchaRequired:!0,isShownBeforeReady:!0};export{h as TelegramAuthScreen,y as TelegramAuthScreenView,h as default};
@@ -1,3 +1,3 @@
1
- import{jsxs as e,jsx as i,Fragment as n}from"react/jsx-runtime";import{styled as t}from"styled-components";import{P as o,H as r,W as l}from"./WalletLink-WAY9-CI0.mjs";import{g as d}from"./ethers-g3QzXj2h.mjs";import{F as a}from"./Layouts-Bmf8DxNP.mjs";import c from"@heroicons/react/24/outline/ChevronDownIcon";import{createContext as s,useState as p,useContext as h}from"react";import{s as f,u as g}from"./context-Dee1TPOi.mjs";const m=({label:n,children:t,valueStyles:o})=>/*#__PURE__*/e(v,{children:[/*#__PURE__*/i("div",{children:n}),/*#__PURE__*/i(u,{style:{...o},children:t})]});let v=/*#__PURE__*/t.div.withConfig({displayName:"StyledDetailsRow",componentId:"sc-4ebfdd45-0"})(["display:flex;align-items:center;justify-content:space-between;width:100%;> :first-child{color:var(--privy-color-foreground-3);text-align:left;}> :last-child{color:var(--privy-color-foreground-2);text-align:right;}"]),u=/*#__PURE__*/t.div.withConfig({displayName:"ValueWrapper",componentId:"sc-4ebfdd45-1"})(["font-size:14px;line-height:100%;display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-full);background-color:var(--privy-color-background-2);padding:4px 8px;"]);const y=({gas:n,tokenPrice:t,tokenSymbol:r})=>/*#__PURE__*/e(a,{style:{paddingBottom:"12px"},children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/i(I,{children:"Est. Fees"}),/*#__PURE__*/i("div",{children:/*#__PURE__*/i(o,{weiQuantities:[BigInt(n)],tokenPrice:t,tokenSymbol:r})})]}),t&&/*#__PURE__*/i(b,{children:`${d(BigInt(n),r)}`})]}),x=({value:n,gas:t,tokenPrice:r,tokenSymbol:l})=>{let c=BigInt(n??0)+BigInt(t);/*#__PURE__*/return e(a,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/i(I,{children:"Total (including fees)"}),/*#__PURE__*/i("div",{children:/*#__PURE__*/i(o,{weiQuantities:[BigInt(n||0),BigInt(t)],tokenPrice:r,tokenSymbol:l})})]}),r&&/*#__PURE__*/i(b,{children:d(c,l)})]})};let w=/*#__PURE__*/t.div.withConfig({displayName:"TransactionTotalRow",componentId:"sc-f8ef9b74-0"})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-top:4px;"]),b=/*#__PURE__*/t.div.withConfig({displayName:"ValueConversionRow",componentId:"sc-f8ef9b74-1"})(["display:flex;flex-direction:row;height:12px;font-size:12px;line-height:12px;color:var(--privy-color-foreground-3);font-weight:400;"]),I=/*#__PURE__*/t.div.withConfig({displayName:"TotalText",componentId:"sc-f8ef9b74-2"})(["font-size:14px;line-height:22.4px;font-weight:400;"]);const C=/*#__PURE__*/s(void 0),k=/*#__PURE__*/s(void 0),P=({defaultValue:e,children:n})=>{let[t,o]=p(e||null);/*#__PURE__*/return i(C.Provider,{value:{activePanel:t,togglePanel:e=>{o(t===e?null:e)}},children:/*#__PURE__*/i(j,{children:n})})},T=({value:e,children:n})=>{let{activePanel:t,togglePanel:o}=h(C),r=t===e;/*#__PURE__*/return i(k.Provider,{value:{onToggle:()=>o(e),value:e},children:/*#__PURE__*/i(D,{isActive:r?"true":"false","data-open":String(r),children:n})})},N=({children:t})=>{let{activePanel:o}=h(C),{onToggle:r,value:l}=h(k),d=o===l;/*#__PURE__*/
1
+ import{jsxs as e,jsx as i,Fragment as n}from"react/jsx-runtime";import{styled as t}from"styled-components";import{P as o,H as r,W as l}from"./WalletLink-C9CSqqVy.mjs";import{g as d}from"./ethers-C3Y94dat.mjs";import{F as a}from"./Layouts-Bmf8DxNP.mjs";import c from"@heroicons/react/24/outline/ChevronDownIcon";import{createContext as s,useState as p,useContext as h}from"react";import{s as f,u as g}from"./context-Bycd1SKV.mjs";const m=({label:n,children:t,valueStyles:o})=>/*#__PURE__*/e(v,{children:[/*#__PURE__*/i("div",{children:n}),/*#__PURE__*/i(u,{style:{...o},children:t})]});let v=/*#__PURE__*/t.div.withConfig({displayName:"StyledDetailsRow",componentId:"sc-4ebfdd45-0"})(["display:flex;align-items:center;justify-content:space-between;width:100%;> :first-child{color:var(--privy-color-foreground-3);text-align:left;}> :last-child{color:var(--privy-color-foreground-2);text-align:right;}"]),u=/*#__PURE__*/t.div.withConfig({displayName:"ValueWrapper",componentId:"sc-4ebfdd45-1"})(["font-size:14px;line-height:100%;display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-full);background-color:var(--privy-color-background-2);padding:4px 8px;"]);const y=({gas:n,tokenPrice:t,tokenSymbol:r})=>/*#__PURE__*/e(a,{style:{paddingBottom:"12px"},children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/i(I,{children:"Est. Fees"}),/*#__PURE__*/i("div",{children:/*#__PURE__*/i(o,{weiQuantities:[BigInt(n)],tokenPrice:t,tokenSymbol:r})})]}),t&&/*#__PURE__*/i(b,{children:`${d(BigInt(n),r)}`})]}),x=({value:n,gas:t,tokenPrice:r,tokenSymbol:l})=>{let c=BigInt(n??0)+BigInt(t);/*#__PURE__*/return e(a,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/i(I,{children:"Total (including fees)"}),/*#__PURE__*/i("div",{children:/*#__PURE__*/i(o,{weiQuantities:[BigInt(n||0),BigInt(t)],tokenPrice:r,tokenSymbol:l})})]}),r&&/*#__PURE__*/i(b,{children:d(c,l)})]})};let w=/*#__PURE__*/t.div.withConfig({displayName:"TransactionTotalRow",componentId:"sc-f8ef9b74-0"})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-top:4px;"]),b=/*#__PURE__*/t.div.withConfig({displayName:"ValueConversionRow",componentId:"sc-f8ef9b74-1"})(["display:flex;flex-direction:row;height:12px;font-size:12px;line-height:12px;color:var(--privy-color-foreground-3);font-weight:400;"]),I=/*#__PURE__*/t.div.withConfig({displayName:"TotalText",componentId:"sc-f8ef9b74-2"})(["font-size:14px;line-height:22.4px;font-weight:400;"]);const C=/*#__PURE__*/s(void 0),k=/*#__PURE__*/s(void 0),P=({defaultValue:e,children:n})=>{let[t,o]=p(e||null);/*#__PURE__*/return i(C.Provider,{value:{activePanel:t,togglePanel:e=>{o(t===e?null:e)}},children:/*#__PURE__*/i(j,{children:n})})},T=({value:e,children:n})=>{let{activePanel:t,togglePanel:o}=h(C),r=t===e;/*#__PURE__*/return i(k.Provider,{value:{onToggle:()=>o(e),value:e},children:/*#__PURE__*/i(D,{isActive:r?"true":"false","data-open":String(r),children:n})})},N=({children:t})=>{let{activePanel:o}=h(C),{onToggle:r,value:l}=h(k),d=o===l;/*#__PURE__*/
2
2
  return e(n,{children:[/*#__PURE__*/e(B,{onClick:r,"data-open":String(d),children:[/*#__PURE__*/i(z,{children:t}),/*#__PURE__*/i(V,{isactive:d?"true":"false",children:/*#__PURE__*/i(c,{height:"16px",width:"16px",strokeWidth:"2"})})]}),/*#__PURE__*/i(W,{})]})},S=({children:e})=>{let{activePanel:n}=h(C),{value:t}=h(k);/*#__PURE__*/return i(F,{"data-open":String(n===t),children:/*#__PURE__*/i(R,{children:e})})},A=({children:e})=>{let{activePanel:n}=h(C),{value:t}=h(k);/*#__PURE__*/return i(R,{children:"function"==typeof e?e({isActive:n===t}):e})};let j=/*#__PURE__*/t.div.withConfig({displayName:"AccordionRoot",componentId:"sc-d25f9267-0"})(["display:flex;flex-direction:column;width:100%;gap:8px;"]),B=/*#__PURE__*/t.div.withConfig({displayName:"AccordionTriggerContainer",componentId:"sc-d25f9267-1"})(["display:flex;justify-content:space-between;align-items:center;width:100%;cursor:pointer;padding-bottom:8px;"]),W=/*#__PURE__*/t.div.withConfig({displayName:"AccordionDivider",componentId:"sc-d25f9267-2"})(["width:100%;&&{border-top:1px solid;border-color:var(--privy-color-foreground-4);}padding-bottom:12px;"]),z=/*#__PURE__*/t.div.withConfig({displayName:"AccordionTriggerContent",componentId:"sc-d25f9267-3"})(["font-size:14px;font-weight:500;line-height:19.6px;width:100%;padding-right:8px;"]),D=/*#__PURE__*/t.div.withConfig({displayName:"AccordionPanelContainer",componentId:"sc-d25f9267-4"})(["display:flex;flex-direction:column;width:100%;overflow:hidden;padding:12px;&&{border:1px solid;border-color:var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);}"]),F=/*#__PURE__*/t.div.withConfig({displayName:"AccordionContentContainer",componentId:"sc-d25f9267-5"})(["position:relative;overflow:hidden;transition:max-height 25ms ease-out;&[data-open='true']{max-height:700px;}&[data-open='false']{max-height:0;}"]),R=/*#__PURE__*/t.div.withConfig({displayName:"ContentWrapper",componentId:"sc-d25f9267-6"})(["display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:1px;"]),V=/*#__PURE__*/t.div.withConfig({displayName:"IconWrapper",componentId:"sc-d25f9267-7"})(["transform:",";"],(e=>"true"===e.isactive?"rotate(180deg)":"rotate(0deg)"));const Q=({from:n,to:t,txn:o,transactionInfo:d,tokenPrice:a,gas:c,tokenSymbol:s})=>{let p=BigInt(o?.value||0);/*#__PURE__*/
3
3
  return i(P,{...g().render.standalone?{defaultValue:"details"}:{},children:/*#__PURE__*/e(T,{value:"details",children:[/*#__PURE__*/i(N,{children:/*#__PURE__*/e(L,{children:[/*#__PURE__*/i("div",{children:d?.title||"Details"}),/*#__PURE__*/i(E,{children:/*#__PURE__*/i(r,{weiQuantities:[p],tokenPrice:a,tokenSymbol:s})})]})}),/*#__PURE__*/e(S,{children:[/*#__PURE__*/i(m,{label:"From",children:/*#__PURE__*/i(l,{walletAddress:n,chainId:o.chainId||f,chainType:"ethereum"})}),/*#__PURE__*/i(m,{label:"To",children:/*#__PURE__*/i(l,{walletAddress:t,chainId:o.chainId||f,chainType:"ethereum"})}),d&&d.action&&/*#__PURE__*/i(m,{label:"Action",children:d.action}),c&&/*#__PURE__*/i(y,{value:o.value,gas:c,tokenPrice:a,tokenSymbol:s})]}),/*#__PURE__*/i(A,{children:({isActive:e})=>/*#__PURE__*/i(x,{value:o.value,displayFee:e,gas:c||"0x0",tokenPrice:a,tokenSymbol:s})})]})})};let L=/*#__PURE__*/t.div.withConfig({displayName:"AccordionTriggerContent",componentId:"sc-2eff9f5c-0"})(["display:flex;flex-direction:row;justify-content:space-between;"]),E=/*#__PURE__*/t.div.withConfig({displayName:"TotalText",componentId:"sc-2eff9f5c-1"})(["flex-shrink:0;padding-left:8px;"]);export{Q as T};
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as n,Fragment as r}from"react/jsx-runtime";import{BoltIcon as i,ArrowRightIcon as o,ChevronDownIcon as t}from"@heroicons/react/24/outline";import{useState as a}from"react";import{styled as l}from"styled-components";import{formatTokenAmount as c}from"@privy-io/js-sdk-core";import{P as d,E as s}from"./Button-DJY5dut3.mjs";import{M as h,B as m,a as p}from"./ModalHeader-DHXUvTf4.mjs";import{L as u,V as f,a as g}from"./Value-B4M62ove.mjs";import{a as y,R as b}from"./Row-CG0lSY5Z.mjs";import{E as x}from"./ErrorMessage-Cx8GKGhL.mjs";import{L as k}from"./LabelXs-BOisBtqT.mjs";import{S as w}from"./Subtitle-DkvfP2Ev.mjs";import{T as v}from"./Title-D0pfZff-.mjs";import{A as I}from"./Address-CDOE2oK9.mjs";import{W as C}from"./WalletInfoCard-C8BrD5jy.mjs";import{u as T}from"./context-Dee1TPOi.mjs";import{Y as S}from"./useActiveWallet-SiVSXkvG.mjs";import{L as N}from"./LoadingSkeleton-CHdaq3pb.mjs";import{isAddress as A}from"viem";import{B as j}from"./shared-CtYf3O54.mjs";import{C as E}from"./Checkbox-NmGCZeKL.mjs";import{E as M}from"./ErrorBanner-BdiArMwu.mjs";import{W as $}from"./WarningBanner-BDp-QC9i.mjs";import O from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import D from"@heroicons/react/24/outline/ClipboardDocumentIcon";import F from"@heroicons/react/24/outline/ExclamationCircleIcon";import{u as L}from"./internal-context-e-Eni5bG.mjs";const B=/*#__PURE__*/l(u).withConfig({displayName:"InteractiveLabel",componentId:"sc-b57d0824-0"})(["cursor:pointer;display:inline-flex;gap:8px;align-items:center;color:var(--privy-color-accent);svg{fill:var(--privy-color-accent);}"]);var P=({iconUrl:r,value:i,symbol:o,usdValue:t,nftName:a,nftCount:l,decimals:c,$isLoading:d})=>{if(d)/*#__PURE__*/return e(R,{$isLoading:d});let s=i&&t&&c?function(e,n,r){let i=parseFloat(e),o=parseFloat(r);if(0===i||0===o||Number.isNaN(i)||Number.isNaN(o))return e;let t=Math.ceil(-Math.log10(.01/(o/i))),a=Math.pow(10,t=Math.max(t=Math.min(t,n),1)),l=+(Math.floor(i*a)/a).toFixed(t).replace(/\.?0+$/,"");return Intl.NumberFormat(void 0,{maximumFractionDigits:n}).format(l)}(i,c,t):i;/*#__PURE__*/return n("div",{children:[/*#__PURE__*/n(R,{$isLoading:d,children:[r&&/*#__PURE__*/e(z,{src:r,alt:"Token icon"}),l&&l>1?l+"x":void 0," ",a,s," ",o]}),t&&/*#__PURE__*/n(W,{$isLoading:d,children:["$",t]})]})};let R=/*#__PURE__*/l.span.withConfig({displayName:"Value",componentId:"sc-991db279-0"})(["color:var(--privy-color-foreground);font-size:0.875rem;font-weight:500;line-height:1.375rem;word-break:break-all;text-align:right;display:flex;justify-content:flex-end;",""],N);const W=/*#__PURE__*/l.span.withConfig({displayName:"Subvalue",componentId:"sc-991db279-1"})(["color:var(--privy-color-foreground-2);font-size:12px;font-weight:400;line-height:18px;word-break:break-all;text-align:right;display:flex;justify-content:flex-end;",""],N);let z=/*#__PURE__*/l.img.withConfig({displayName:"TokenIcon",componentId:"sc-991db279-2"})(["height:14px;width:14px;margin-right:4px;object-fit:contain;"]);const V=i=>{let{chain:o,transactionDetails:t,isTokenContractInfoLoading:a,symbol:l}=i,{action:c,functionName:d}=t;/*#__PURE__*/return e(j,{children:/*#__PURE__*/n(y,{children:["transaction"!==c&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Action"}),/*#__PURE__*/e(f,{children:d})]}),"mint"===d&&"args"in t&&t.args.filter((e=>e)).map(((r,i)=>/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:`Param ${i}`}),/*#__PURE__*/e(f,{children:"string"==typeof r&&A(r)?/*#__PURE__*/e(I,{address:r,url:o?.blockExplorers?.default?.url,showCopyIcon:!1}):r?.toString()})]},i))),"setApprovalForAll"===d&&t.operator&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Operator"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.operator,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),"setApprovalForAll"===d&&void 0!==t.approved&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Set approval to"}),/*#__PURE__*/e(f,{children:t.approved?"true":"false"})]}),"transfer"===d||"transferFrom"===d||"safeTransferFrom"===d||"approve"===d?/*#__PURE__*/n(r,{children:["formattedAmount"in t&&t.formattedAmount&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{$isLoading:a,children:[t.formattedAmount," ",l]})]}),"tokenId"in t&&t.tokenId&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token ID"}),/*#__PURE__*/e(f,{children:t.tokenId.toString()})]})]}):null,"safeBatchTransferFrom"===d&&/*#__PURE__*/n(r,{children:["amounts"in t&&t.amounts&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amounts"}),/*#__PURE__*/e(f,{children:t.amounts.join(", ")})]}),"tokenIds"in t&&t.tokenIds&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token IDs"}),/*#__PURE__*/e(f,{children:t.tokenIds.join(", ")})]})]}),"approve"===d&&t.spender&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Spender"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.spender,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&t.transferFrom&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Transferring from"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.transferFrom,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&t.transferTo&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Transferring to"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.transferTo,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]})]})})},H=({variant:i,setPreventMaliciousTransaction:o,colorScheme:t="light",preventMaliciousTransaction:a})=>"warn"===i?/*#__PURE__*/e(U,{children:/*#__PURE__*/n($,{theme:t,children:[/*#__PURE__*/e("span",{style:{fontWeight:"500"},children:"Warning: Suspicious transaction"}),/*#__PURE__*/e("br",{}),"This has been flagged as a potentially deceptive request. Approving could put your assets or funds at risk."]})}):"error"===i?/*#__PURE__*/e(r,{children:/*#__PURE__*/n(U,{children:[/*#__PURE__*/e(M,{theme:t,children:/*#__PURE__*/n("div",{children:[/*#__PURE__*/e("strong",{children:"This is a malicious transaction"}),/*#__PURE__*/e("br",{}),"This transaction transfers tokens to a known malicious address. Proceeding may result in the loss of valuable assets."]})}),/*#__PURE__*/n(q,{children:[/*#__PURE__*/e(E,{color:"var(--privy-color-error)",checked:!a,readOnly:!0,onClick:()=>o(!a)}),/*#__PURE__*/e("span",{children:"I understand and want to proceed anyways."})]})]})}):null;let U=/*#__PURE__*/l.div.withConfig({displayName:"BannerContainer",componentId:"sc-ab8a5a0b-0"})(["margin-top:1.5rem;"]),q=/*#__PURE__*/l.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-ab8a5a0b-1"})(["display:flex;align-items:center;gap:0.5rem;margin-top:0.75rem;"]);const J=({transactionIndex:e,maxIndex:n})=>"number"!=typeof e||0===n?"":` (${e+1} / ${n+1})`,Q=({img:l,submitError:c,prepareError:p,onClose:k,action:C,title:N,subtitle:A,to:j,tokenAddress:E,network:M,missingFunds:$,fee:O,from:D,cta:F,disabled:L,chain:R,isSubmitting:W,isPreparing:z,isTokenPriceLoading:U,isTokenContractInfoLoading:q,isSponsored:Q,symbol:Y,balance:G,onClick:ne,transactionDetails:re,transactionIndex:ie,maxIndex:oe,onBack:te,chainName:ae,validation:le,hasScanDetails:ce,setIsScanDetailsOpen:de,preventMaliciousTransaction:se,setPreventMaliciousTransaction:he,tokensSent:me,tokensReceived:pe,isScanning:ue,isCancellable:fe,functionName:ge})=>{let{showTransactionDetails:ye,setShowTransactionDetails:be,hasMoreDetails:xe,isErc20Ish:ke}=(e=>{let[n,r]=a(!1),i=!0,o=!1;return(!e||e.isErc20Ish||"transaction"===e.action)&&(i=!1),i&&(o=Object.entries(e||{}).some((([e,n])=>n&&!["action","isErc20Ish","isNFTIsh"].includes(e)))),{showTransactionDetails:n,setShowTransactionDetails:r,hasMoreDetails:i&&o,isErc20Ish:e?.isErc20Ish}})(re),we=T(),ve=ke&&q||z||U||ue;/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:k,backFn:te}),l&&/*#__PURE__*/e(Z,{children:l}),/*#__PURE__*/n(v,{style:{marginTop:l?"1.5rem":0},children:[N,/*#__PURE__*/e(J,{maxIndex:oe,transactionIndex:ie})]}),/*#__PURE__*/e(w,{children:A}),/*#__PURE__*/n(y,{style:{marginTop:"2rem"},children:[(!!me[0]||ve)&&/*#__PURE__*/n(b,{children:[pe.length>0?/*#__PURE__*/e(u,{children:"Send"}):/*#__PURE__*/e(u,{children:"approve"===C?"Approval amount":"Amount"}),/*#__PURE__*/e("div",{className:"flex flex-col",children:me.map(((n,r)=>/*#__PURE__*/e(P,{iconUrl:n.iconUrl,value:"setApprovalForAll"===ge?"All":n.value,usdValue:n.usdValue,symbol:n.symbol,nftName:n.nftName,nftCount:n.nftCount,decimals:n.decimals},r)))})]}),pe.length>0&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Receive"}),/*#__PURE__*/e("div",{className:"flex flex-col",children:pe.map(((n,r)=>/*#__PURE__*/e(P,{iconUrl:n.iconUrl,value:n.value,usdValue:n.usdValue,symbol:n.symbol,nftName:n.nftName,nftCount:n.nftCount,decimals:n.decimals},r)))})]}),re&&"spender"in re&&re?.spender?/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Spender"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:re.spender,url:R?.blockExplorers?.default?.url})})]}):null,j&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"To"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:j,url:R?.blockExplorers?.default?.url,showCopyIcon:!0})})]}),E&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token address"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:E,url:R?.blockExplorers?.default?.url})})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Network"}),/*#__PURE__*/e(f,{children:M})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Estimated fee"}),/*#__PURE__*/e(f,{$isLoading:z||U||void 0===Q,children:Q?/*#__PURE__*/n(_,{children:[/*#__PURE__*/n(ee,{children:["Sponsored by ",we.name]}),/*#__PURE__*/e(i,{height:16,width:16})]}):O})]}),xe&&!ce&&/*#__PURE__*/n(r,{children:[/*#__PURE__*/e(b,{className:"cursor-pointer",onClick:()=>be(!ye),children:/*#__PURE__*/n(g,{className:"flex items-center gap-x-1",children:["Details"," ",/*#__PURE__*/e(t,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:ye?"rotate(180deg)":void 0}})]})}),ye&&re&&/*#__PURE__*/e(V,{action:C,chain:R,transactionDetails:re,isTokenContractInfoLoading:q,symbol:Y})]}),ce&&/*#__PURE__*/e(b,{children:/*#__PURE__*/n(B,{onClick:()=>de(!0),children:[/*#__PURE__*/e("span",{className:"text-color-primary",children:"Details"}),/*#__PURE__*/e(o,{height:"14px",width:"14px",strokeWidth:"2"})]})})]}),/*#__PURE__*/e(S,{}),c?/*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:c.message}):p&&0===ie?
2
- /*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:p.shortMessage??K}):null,/*#__PURE__*/e(H,{variant:le,preventMaliciousTransaction:se,setPreventMaliciousTransaction:he}),/*#__PURE__*/e(X,{$useSmallMargins:!(!p&&!c&&"warn"!==le&&"error"!==le),address:D,balance:G,errMsg:z||p||c||!$?void 0:`Add funds on ${R?.name??ae} to complete transaction.`}),/*#__PURE__*/e(d,{style:{marginTop:"1rem"},loading:W,disabled:L||z,onClick:ne,children:F}),fe&&/*#__PURE__*/e(s,{style:{marginTop:"1rem"},onClick:k,isSubmitting:!1,children:"Not now"}),/*#__PURE__*/e(m,{})]})},Y=({img:o,title:l,subtitle:s,cta:p,instructions:g,network:C,blockExplorerUrl:N,isMissingFunds:A,submitError:j,parseError:E,total:M,swap:$,transactingWalletAddress:O,fee:D,balance:F,disabled:L,isSubmitting:P,isPreparing:R,isTokenPriceLoading:W,onClick:z,onClose:V,onBack:H,isSponsored:U})=>{let q=R||W,[J,Q]=a(!1),Y=T();/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:V,backFn:H}),o&&/*#__PURE__*/e(Z,{children:o}),/*#__PURE__*/e(v,{style:{marginTop:o?"1.5rem":0},children:l}),/*#__PURE__*/e(w,{children:s}),/*#__PURE__*/n(y,{style:{marginTop:"2rem",marginBottom:".5rem"},children:[(M||q)&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/e(f,{$isLoading:q,children:M})]}),$&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Swap"}),/*#__PURE__*/e(f,{children:$})]}),C&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Network"}),/*#__PURE__*/e(f,{children:C})]}),(D||q||void 0!==U)&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Estimated fee"}),/*#__PURE__*/e(f,{$isLoading:q,children:U&&!q?/*#__PURE__*/n(_,{children:[/*#__PURE__*/n(ee,{children:["Sponsored by ",Y.name]}),/*#__PURE__*/e(i,{height:16,width:16})]}):D})]})]}),/*#__PURE__*/e(b,{children:/*#__PURE__*/n(B,{onClick:()=>Q((e=>!e)),children:[/*#__PURE__*/e("span",{children:"Advanced"}),/*#__PURE__*/e(t,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:J?"rotate(180deg)":void 0}})]})}),J&&/*#__PURE__*/e(r,{children:g.map(((r,i)=>"sol-transfer"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Transfer ",r.withSeed?"with seed":""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{children:[c({amount:r.value,decimals:r.token.decimals})," ",r.token.symbol]})]}),!!r.toAccount&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Destination"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.toAccount,url:N})})]})]},i):"spl-transfer"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Transfer ",r.token.symbol]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/e(f,{children:r.value.toString()})]}),!!r.fromAta&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Source"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.fromAta,url:N})})]}),!!r.toAta&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Destination"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.toAta,url:N})})]}),!!r.token.address&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.token.address,url:N})})]})]},i):"ata-creation"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/e(k,{children:"Create token account"})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Program ID"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.program,url:N})})]}),!!r.owner&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Owner"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.owner,url:N})})]})]},i):"create-account"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Create account ",r.withSeed?"with seed":""]})}),!!r.account&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Account"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.account,url:N})})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{children:[c({amount:r.value,decimals:9})," SOL"]})]})]},i):"spl-init-account"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/e(k,{children:"Initialize token account"})}),!!r.account&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Account"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.account,url:N})})]}),!!r.mint&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Mint"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mint,url:N})})]}),!!r.owner&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Owner"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.owner,url:N})})]})]},i):"spl-close-account"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/e(k,{children:"Close token account"})}),!!r.source&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Source"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.source,url:N})})]}),!!r.destination&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Destination"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.destination,url:N})})]}),!!r.owner&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Owner"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.owner,url:N})})]})]},i):"spl-sync-native"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/e(k,{children:"Sync native"})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Program ID"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.program,url:N})})]})]},i):"raydium-swap-base-input"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Raydium swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount in"}),/*#__PURE__*/e(f,{children:r.amountIn.toString()})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Minimum amount out"}),/*#__PURE__*/e(f,{children:r.minimumAmountOut.toString()})]}),r.mintIn&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):"raydium-swap-base-output"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Raydium swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Max amount in"}),/*#__PURE__*/e(f,{children:r.maxAmountIn.toString()})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount out"}),/*#__PURE__*/e(f,{children:r.amountOut.toString()})]}),r.mintIn&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):"jupiter-swap-shared-accounts-route"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Jupiter swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"In amount"}),/*#__PURE__*/e(f,{children:r.inAmount.toString()})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Quoted out amount"}),/*#__PURE__*/e(f,{children:r.quotedOutAmount.toString()})]}),r.mintIn&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):"jupiter-swap-exact-out-route"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Jupiter swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Quoted in amount"}),/*#__PURE__*/e(f,{children:r.quotedInAmount.toString()})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount out"}),/*#__PURE__*/e(f,{children:r.outAmount.toString()})]}),r.mintIn&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):/*#__PURE__*/n(G,{children:[/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Program ID"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.program,url:N})})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Data"}),/*#__PURE__*/e(f,{children:r.discriminator})]})]},i)))}),/*#__PURE__*/e(S,{}),j?/*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:j.message}):E?/*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:K}):null,/*#__PURE__*/e(X,{$useSmallMargins:!(!E&&!j),title:"",address:O,balance:F,errMsg:R||E||j||!A?void 0:"Add funds on Solana to complete transaction."}),/*#__PURE__*/e(d,{style:{marginTop:"1rem"},loading:P,disabled:L||R,onClick:z,children:p}),/*#__PURE__*/e(m,{})]})};let X=/*#__PURE__*/l(C).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-cbe5ab37-0"})(["",""],(e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;")),G=/*#__PURE__*/l(y).withConfig({displayName:"InstructionRows",componentId:"sc-cbe5ab37-1"})(["margin-top:0.5rem;border:1px solid var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-sm);padding:0.5rem;"]),K="There was an error preparing your transaction. Your transaction request will likely fail.",Z=/*#__PURE__*/l.div.withConfig({displayName:"ImageContainer",componentId:"sc-cbe5ab37-2"})(["display:flex;width:100%;justify-content:center;max-height:40px;> img{object-fit:contain;border-radius:var(--privy-border-radius-sm);}"]),_=/*#__PURE__*/l.span.withConfig({displayName:"SponsoredRow",componentId:"sc-cbe5ab37-3"})(["display:inline-flex;align-items:center;gap:0.3rem;"]),ee=/*#__PURE__*/l.span.withConfig({displayName:"SponsoredText",componentId:"sc-cbe5ab37-4"})(["font-size:14px;font-weight:500;color:var(--privy-color-foreground);"]);let ne=()=>/*#__PURE__*/n(ae,{children:[/*#__PURE__*/e(ce,{}),/*#__PURE__*/e(le,{})]});const re=({transactionError:i,chainId:o,onClose:t,onRetry:l,chainType:c,transactionHash:d})=>{let{chains:s}=L(),[m,u]=a(!1),{errorCode:f,errorMessage:g}=((e,n)=>{if("ethereum"===n)return{errorCode:e.details??e.message,errorMessage:e.shortMessage};let r=e.txSignature,i=e?.transactionMessage||"Something went wrong.";if(Array.isArray(e.logs)){let n=e.logs.find((e=>/insufficient (lamports|funds)/gi.test(e)));n&&(i=n)}return{transactionHash:r,errorMessage:i}})(i,c),y=(({chains:e,chainId:n,chainType:r,transactionHash:i})=>"ethereum"===r?e.find((e=>e.id===n))?.blockExplorers?.default.url??"https://etherscan.io":function(e,n){return`https://explorer.solana.com/tx/${e}?chain=${n}`}(i||"",n))({chains:s,chainId:o,chainType:c,transactionHash:d});/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:t}),/*#__PURE__*/n(ie,{children:[/*#__PURE__*/e(ne,{}),/*#__PURE__*/e(oe,{children:f}),/*#__PURE__*/e(te,{children:"Please try again."}),/*#__PURE__*/n(he,{children:[/*#__PURE__*/e(se,{children:"Error message"}),/*#__PURE__*/e(pe,{$clickable:!1,children:g})]}),d&&/*#__PURE__*/n(he,{children:[/*#__PURE__*/e(se,{children:"Transaction hash"}),/*#__PURE__*/n(me,{children:["Copy this hash to view details about the transaction on a"," ",/*#__PURE__*/e("u",{children:/*#__PURE__*/e("a",{href:y,children:"block explorer"})}),"."]}),/*#__PURE__*/n(pe,{$clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(d),u(!0)},children:[d,/*#__PURE__*/e(ge,{clicked:m})]})]}),/*#__PURE__*/e(de,{onClick:()=>l({resetNonce:!!d}),children:"Retry transaction"})]}),/*#__PURE__*/e(p,{})]})};let ie=/*#__PURE__*/l.div.withConfig({displayName:"TransactionErrorScreenContainer",componentId:"sc-d58f10e6-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;"]),oe=/*#__PURE__*/l.span.withConfig({displayName:"ErrorCode",componentId:"sc-d58f10e6-1"})(["color:var(--privy-color-foreground);text-align:center;font-size:1.125rem;font-weight:500;line-height:1.25rem;text-align:center;margin:10px;"]),te=/*#__PURE__*/l.span.withConfig({displayName:"Subtitle",componentId:"sc-d58f10e6-2"})(["margin-top:4px;margin-bottom:10px;color:var(--privy-color-foreground-3);text-align:center;font-size:0.875rem;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;"]),ae=/*#__PURE__*/l.div.withConfig({displayName:"CircleContainer",componentId:"sc-d58f10e6-3"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]),le=/*#__PURE__*/l(F).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-d58f10e6-4"})(["position:absolute;width:35px;height:35px;color:var(--privy-color-error);"]),ce=/*#__PURE__*/l.div.withConfig({displayName:"StyledRedCircle",componentId:"sc-d58f10e6-5"})(["position:absolute;width:60px;height:60px;border-radius:50%;background-color:var(--privy-color-error);opacity:0.1;"]),de=/*#__PURE__*/l(d).withConfig({displayName:"RetryButton",componentId:"sc-d58f10e6-6"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]),se=/*#__PURE__*/l.span.withConfig({displayName:"TextBoxTitle",componentId:"sc-d58f10e6-7"})(["width:100%;text-align:left;font-size:0.825rem;color:var(--privy-color-foreground);padding:4px;"]),he=/*#__PURE__*/l.div.withConfig({displayName:"TextBoxContainer",componentId:"sc-d58f10e6-8"})(["width:100%;margin:5px;display:flex;flex-direction:column;justify-content:center;align-items:center;"]),me=/*#__PURE__*/l.text.withConfig({displayName:"HelperText",componentId:"sc-d58f10e6-9"})(["position:relative;width:100%;padding:5px;font-size:0.8rem;color:var(--privy-color-foreground-3);text-align:left;word-wrap:break-word;"]),pe=/*#__PURE__*/l.span.withConfig({displayName:"TextBox",componentId:"sc-d58f10e6-10"})(["position:relative;width:100%;background-color:var(--privy-color-background-2);padding:8px 12px;border-radius:10px;margin-top:5px;font-size:14px;color:var(--privy-color-foreground-3);text-align:left;word-wrap:break-word;",""],(e=>e.$clickable&&"cursor: pointer;\n transition: background-color 0.3s;\n padding-right: 45px;\n\n &:hover {\n background-color: var(--privy-color-foreground-4);\n }")),ue=/*#__PURE__*/l(D).withConfig({displayName:"StyledClipboardIcon",componentId:"sc-d58f10e6-11"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),fe=/*#__PURE__*/l(O).withConfig({displayName:"StyledClipboardCheckIcon",componentId:"sc-d58f10e6-12"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),ge=({clicked:n})=>/*#__PURE__*/e(n?fe:ue,{});export{Q as S,re as T,Y as a};
1
+ import{jsx as e,jsxs as n,Fragment as r}from"react/jsx-runtime";import{BoltIcon as i,ArrowRightIcon as o,ChevronDownIcon as t}from"@heroicons/react/24/outline";import{useState as a}from"react";import{styled as l}from"styled-components";import{formatTokenAmount as d}from"@privy-io/js-sdk-core";import{P as c,E as s}from"./Button-B8mqatRx.mjs";import{M as h,B as m,a as p}from"./ModalHeader-BLGC-7ev.mjs";import{L as u,V as f,a as g}from"./Value-B4M62ove.mjs";import{a as y,R as b}from"./Row-CG0lSY5Z.mjs";import{E as x}from"./ErrorMessage-Cx8GKGhL.mjs";import{L as k}from"./LabelXs-BOisBtqT.mjs";import{S as w}from"./Subtitle-DkvfP2Ev.mjs";import{T as v}from"./Title-D0pfZff-.mjs";import{A as I}from"./Address-BsvZLUXE.mjs";import{W as C}from"./WalletInfoCard-YE5P6CSV.mjs";import{u as T}from"./context-Bycd1SKV.mjs";import{Y as S}from"./useActiveWallet-Bsy5GTCV.mjs";import{L as N}from"./LoadingSkeleton-CHdaq3pb.mjs";import{isAddress as A}from"viem";import{B as j}from"./shared-CtYf3O54.mjs";import{C as E}from"./Checkbox-NmGCZeKL.mjs";import{E as M}from"./ErrorBanner-BdiArMwu.mjs";import{W as $}from"./WarningBanner-BDp-QC9i.mjs";import O from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import D from"@heroicons/react/24/outline/ClipboardDocumentIcon";import F from"@heroicons/react/24/outline/ExclamationCircleIcon";import{u as L}from"./internal-context-e-Eni5bG.mjs";const B=/*#__PURE__*/l(u).withConfig({displayName:"InteractiveLabel",componentId:"sc-b57d0824-0"})(["cursor:pointer;display:inline-flex;gap:8px;align-items:center;color:var(--privy-color-accent);svg{fill:var(--privy-color-accent);}"]);var P=({iconUrl:r,value:i,symbol:o,usdValue:t,nftName:a,nftCount:l,decimals:d,$isLoading:c})=>{if(c)/*#__PURE__*/return e(R,{$isLoading:c});let s=i&&t&&d?function(e,n,r){let i=parseFloat(e),o=parseFloat(r);if(0===i||0===o||Number.isNaN(i)||Number.isNaN(o))return e;let t=Math.ceil(-Math.log10(.01/(o/i))),a=Math.pow(10,t=Math.max(t=Math.min(t,n),1)),l=+(Math.floor(i*a)/a).toFixed(t).replace(/\.?0+$/,"");return Intl.NumberFormat(void 0,{maximumFractionDigits:n}).format(l)}(i,d,t):i;/*#__PURE__*/return n("div",{children:[/*#__PURE__*/n(R,{$isLoading:c,children:[r&&/*#__PURE__*/e(z,{src:r,alt:"Token icon"}),l&&l>1?l+"x":void 0," ",a,s," ",o]}),t&&/*#__PURE__*/n(W,{$isLoading:c,children:["$",t]})]})};let R=/*#__PURE__*/l.span.withConfig({displayName:"Value",componentId:"sc-991db279-0"})(["color:var(--privy-color-foreground);font-size:0.875rem;font-weight:500;line-height:1.375rem;word-break:break-all;text-align:right;display:flex;justify-content:flex-end;",""],N);const W=/*#__PURE__*/l.span.withConfig({displayName:"Subvalue",componentId:"sc-991db279-1"})(["color:var(--privy-color-foreground-2);font-size:12px;font-weight:400;line-height:18px;word-break:break-all;text-align:right;display:flex;justify-content:flex-end;",""],N);let z=/*#__PURE__*/l.img.withConfig({displayName:"TokenIcon",componentId:"sc-991db279-2"})(["height:14px;width:14px;margin-right:4px;object-fit:contain;"]);const V=i=>{let{chain:o,transactionDetails:t,isTokenContractInfoLoading:a,symbol:l}=i,{action:d,functionName:c}=t;/*#__PURE__*/return e(j,{children:/*#__PURE__*/n(y,{children:["transaction"!==d&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Action"}),/*#__PURE__*/e(f,{children:c})]}),"mint"===c&&"args"in t&&t.args.filter((e=>e)).map(((r,i)=>/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:`Param ${i}`}),/*#__PURE__*/e(f,{children:"string"==typeof r&&A(r)?/*#__PURE__*/e(I,{address:r,url:o?.blockExplorers?.default?.url,showCopyIcon:!1}):r?.toString()})]},i))),"setApprovalForAll"===c&&t.operator&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Operator"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.operator,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),"setApprovalForAll"===c&&void 0!==t.approved&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Set approval to"}),/*#__PURE__*/e(f,{children:t.approved?"true":"false"})]}),"transfer"===c||"transferFrom"===c||"safeTransferFrom"===c||"approve"===c?/*#__PURE__*/n(r,{children:["formattedAmount"in t&&t.formattedAmount&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{$isLoading:a,children:[t.formattedAmount," ",l]})]}),"tokenId"in t&&t.tokenId&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token ID"}),/*#__PURE__*/e(f,{children:t.tokenId.toString()})]})]}):null,"safeBatchTransferFrom"===c&&/*#__PURE__*/n(r,{children:["amounts"in t&&t.amounts&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amounts"}),/*#__PURE__*/e(f,{children:t.amounts.join(", ")})]}),"tokenIds"in t&&t.tokenIds&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token IDs"}),/*#__PURE__*/e(f,{children:t.tokenIds.join(", ")})]})]}),"approve"===c&&t.spender&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Spender"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.spender,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===c||"safeTransferFrom"===c||"safeBatchTransferFrom"===c)&&t.transferFrom&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Transferring from"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.transferFrom,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===c||"safeTransferFrom"===c||"safeBatchTransferFrom"===c)&&t.transferTo&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Transferring to"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.transferTo,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]})]})})},H=({variant:i,setPreventMaliciousTransaction:o,colorScheme:t="light",preventMaliciousTransaction:a})=>"warn"===i?/*#__PURE__*/e(U,{children:/*#__PURE__*/n($,{theme:t,children:[/*#__PURE__*/e("span",{style:{fontWeight:"500"},children:"Warning: Suspicious transaction"}),/*#__PURE__*/e("br",{}),"This has been flagged as a potentially deceptive request. Approving could put your assets or funds at risk."]})}):"error"===i?/*#__PURE__*/e(r,{children:/*#__PURE__*/n(U,{children:[/*#__PURE__*/e(M,{theme:t,children:/*#__PURE__*/n("div",{children:[/*#__PURE__*/e("strong",{children:"This is a malicious transaction"}),/*#__PURE__*/e("br",{}),"This transaction transfers tokens to a known malicious address. Proceeding may result in the loss of valuable assets."]})}),/*#__PURE__*/n(q,{children:[/*#__PURE__*/e(E,{color:"var(--privy-color-error)",checked:!a,readOnly:!0,onClick:()=>o(!a)}),/*#__PURE__*/e("span",{children:"I understand and want to proceed anyways."})]})]})}):null;let U=/*#__PURE__*/l.div.withConfig({displayName:"BannerContainer",componentId:"sc-ab8a5a0b-0"})(["margin-top:1.5rem;"]),q=/*#__PURE__*/l.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-ab8a5a0b-1"})(["display:flex;align-items:center;gap:0.5rem;margin-top:0.75rem;"]);const J=({transactionIndex:e,maxIndex:n})=>"number"!=typeof e||0===n?"":` (${e+1} / ${n+1})`,Q=({img:l,submitError:d,prepareError:p,onClose:k,action:C,title:N,subtitle:A,to:j,tokenAddress:E,network:M,missingFunds:$,fee:O,from:D,cta:F,disabled:L,chain:R,isSubmitting:W,isPreparing:z,isTokenPriceLoading:U,isTokenContractInfoLoading:q,isSponsored:Q,symbol:Y,balance:G,onClick:ne,transactionDetails:re,transactionIndex:ie,maxIndex:oe,onBack:te,chainName:ae,validation:le,hasScanDetails:de,setIsScanDetailsOpen:ce,preventMaliciousTransaction:se,setPreventMaliciousTransaction:he,tokensSent:me,tokensReceived:pe,isScanning:ue,isCancellable:fe,functionName:ge})=>{let{showTransactionDetails:ye,setShowTransactionDetails:be,hasMoreDetails:xe,isErc20Ish:ke}=(e=>{let[n,r]=a(!1),i=!0,o=!1;return(!e||e.isErc20Ish||"transaction"===e.action)&&(i=!1),i&&(o=Object.entries(e||{}).some((([e,n])=>n&&!["action","isErc20Ish","isNFTIsh"].includes(e)))),{showTransactionDetails:n,setShowTransactionDetails:r,hasMoreDetails:i&&o,isErc20Ish:e?.isErc20Ish}})(re),we=T(),ve=ke&&q||z||U||ue;/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:k,backFn:te}),l&&/*#__PURE__*/e(Z,{children:l}),/*#__PURE__*/n(v,{style:{marginTop:l?"1.5rem":0},children:[N,/*#__PURE__*/e(J,{maxIndex:oe,transactionIndex:ie})]}),/*#__PURE__*/e(w,{children:A}),/*#__PURE__*/n(y,{style:{marginTop:"2rem"},children:[(!!me[0]||ve)&&/*#__PURE__*/n(b,{children:[pe.length>0?/*#__PURE__*/e(u,{children:"Send"}):/*#__PURE__*/e(u,{children:"approve"===C?"Approval amount":"Amount"}),/*#__PURE__*/e("div",{className:"flex flex-col",children:me.map(((n,r)=>/*#__PURE__*/e(P,{iconUrl:n.iconUrl,value:"setApprovalForAll"===ge?"All":n.value,usdValue:n.usdValue,symbol:n.symbol,nftName:n.nftName,nftCount:n.nftCount,decimals:n.decimals},r)))})]}),pe.length>0&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Receive"}),/*#__PURE__*/e("div",{className:"flex flex-col",children:pe.map(((n,r)=>/*#__PURE__*/e(P,{iconUrl:n.iconUrl,value:n.value,usdValue:n.usdValue,symbol:n.symbol,nftName:n.nftName,nftCount:n.nftCount,decimals:n.decimals},r)))})]}),re&&"spender"in re&&re?.spender?/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Spender"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:re.spender,url:R?.blockExplorers?.default?.url})})]}):null,j&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"To"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:j,url:R?.blockExplorers?.default?.url,showCopyIcon:!0})})]}),E&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token address"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:E,url:R?.blockExplorers?.default?.url})})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Network"}),/*#__PURE__*/e(f,{children:M})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Estimated fee"}),/*#__PURE__*/e(f,{$isLoading:z||U||void 0===Q,children:Q?/*#__PURE__*/n(_,{children:[/*#__PURE__*/n(ee,{children:["Sponsored by ",we.name]}),/*#__PURE__*/e(i,{height:16,width:16})]}):O})]}),xe&&!de&&/*#__PURE__*/n(r,{children:[/*#__PURE__*/e(b,{className:"cursor-pointer",onClick:()=>be(!ye),children:/*#__PURE__*/n(g,{className:"flex items-center gap-x-1",children:["Details"," ",/*#__PURE__*/e(t,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:ye?"rotate(180deg)":void 0}})]})}),ye&&re&&/*#__PURE__*/e(V,{action:C,chain:R,transactionDetails:re,isTokenContractInfoLoading:q,symbol:Y})]}),de&&/*#__PURE__*/e(b,{children:/*#__PURE__*/n(B,{onClick:()=>ce(!0),children:[/*#__PURE__*/e("span",{className:"text-color-primary",children:"Details"}),/*#__PURE__*/e(o,{height:"14px",width:"14px",strokeWidth:"2"})]})})]}),/*#__PURE__*/e(S,{}),d?/*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:d.message}):p&&0===ie?
2
+ /*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:p.shortMessage??K}):null,/*#__PURE__*/e(H,{variant:le,preventMaliciousTransaction:se,setPreventMaliciousTransaction:he}),/*#__PURE__*/e(X,{$useSmallMargins:!(!p&&!d&&"warn"!==le&&"error"!==le),address:D,balance:G,errMsg:z||p||d||!$?void 0:`Add funds on ${R?.name??ae} to complete transaction.`}),/*#__PURE__*/e(c,{style:{marginTop:"1rem"},loading:W,disabled:L||z,onClick:ne,children:F}),fe&&/*#__PURE__*/e(s,{style:{marginTop:"1rem"},onClick:k,isSubmitting:!1,children:"Not now"}),/*#__PURE__*/e(m,{})]})},Y=({img:o,title:l,subtitle:s,cta:p,instructions:g,network:C,blockExplorerUrl:N,isMissingFunds:A,submitError:j,parseError:E,total:M,swap:$,transactingWalletAddress:O,fee:D,balance:F,disabled:L,isSubmitting:P,isPreparing:R,isTokenPriceLoading:W,onClick:z,onClose:V,onBack:H,isSponsored:U})=>{let q=R||W,[J,Q]=a(!1),Y=T();/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:V,backFn:H}),o&&/*#__PURE__*/e(Z,{children:o}),/*#__PURE__*/e(v,{style:{marginTop:o?"1.5rem":0},children:l}),/*#__PURE__*/e(w,{children:s}),/*#__PURE__*/n(y,{style:{marginTop:"2rem",marginBottom:".5rem"},children:[(M||q)&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/e(f,{$isLoading:q,children:M})]}),$&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Swap"}),/*#__PURE__*/e(f,{children:$})]}),C&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Network"}),/*#__PURE__*/e(f,{children:C})]}),(D||q||void 0!==U)&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Estimated fee"}),/*#__PURE__*/e(f,{$isLoading:q,children:U&&!q?/*#__PURE__*/n(_,{children:[/*#__PURE__*/n(ee,{children:["Sponsored by ",Y.name]}),/*#__PURE__*/e(i,{height:16,width:16})]}):D})]})]}),/*#__PURE__*/e(b,{children:/*#__PURE__*/n(B,{onClick:()=>Q((e=>!e)),children:[/*#__PURE__*/e("span",{children:"Advanced"}),/*#__PURE__*/e(t,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:J?"rotate(180deg)":void 0}})]})}),J&&/*#__PURE__*/e(r,{children:g.map(((r,i)=>"sol-transfer"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Transfer ",r.withSeed?"with seed":""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{children:[d({amount:r.value,decimals:r.token.decimals})," ",r.token.symbol]})]}),!!r.toAccount&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Destination"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.toAccount,url:N})})]})]},i):"spl-transfer"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Transfer ",r.token.symbol]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/e(f,{children:r.value.toString()})]}),!!r.fromAta&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Source"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.fromAta,url:N})})]}),!!r.toAta&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Destination"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.toAta,url:N})})]}),!!r.token.address&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.token.address,url:N})})]})]},i):"ata-creation"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/e(k,{children:"Create token account"})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Program ID"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.program,url:N})})]}),!!r.owner&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Owner"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.owner,url:N})})]})]},i):"create-account"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Create account ",r.withSeed?"with seed":""]})}),!!r.account&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Account"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.account,url:N})})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{children:[d({amount:r.value,decimals:9})," SOL"]})]})]},i):"spl-init-account"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/e(k,{children:"Initialize token account"})}),!!r.account&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Account"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.account,url:N})})]}),!!r.mint&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Mint"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mint,url:N})})]}),!!r.owner&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Owner"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.owner,url:N})})]})]},i):"spl-close-account"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/e(k,{children:"Close token account"})}),!!r.source&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Source"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.source,url:N})})]}),!!r.destination&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Destination"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.destination,url:N})})]}),!!r.owner&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Owner"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.owner,url:N})})]})]},i):"spl-sync-native"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/e(k,{children:"Sync native"})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Program ID"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.program,url:N})})]})]},i):"raydium-swap-base-input"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Raydium swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount in"}),/*#__PURE__*/e(f,{children:r.amountIn.toString()})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Minimum amount out"}),/*#__PURE__*/e(f,{children:r.minimumAmountOut.toString()})]}),r.mintIn&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):"raydium-swap-base-output"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Raydium swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Max amount in"}),/*#__PURE__*/e(f,{children:r.maxAmountIn.toString()})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount out"}),/*#__PURE__*/e(f,{children:r.amountOut.toString()})]}),r.mintIn&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):"jupiter-swap-shared-accounts-route"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Jupiter swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"In amount"}),/*#__PURE__*/e(f,{children:r.inAmount.toString()})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Quoted out amount"}),/*#__PURE__*/e(f,{children:r.quotedOutAmount.toString()})]}),r.mintIn&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):"jupiter-swap-exact-out-route"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Jupiter swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Quoted in amount"}),/*#__PURE__*/e(f,{children:r.quotedInAmount.toString()})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount out"}),/*#__PURE__*/e(f,{children:r.outAmount.toString()})]}),r.mintIn&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):/*#__PURE__*/n(G,{children:[/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Program ID"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.program,url:N})})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Data"}),/*#__PURE__*/e(f,{children:r.discriminator})]})]},i)))}),/*#__PURE__*/e(S,{}),j?/*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:j.message}):E?/*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:K}):null,/*#__PURE__*/e(X,{$useSmallMargins:!(!E&&!j),title:"",address:O,balance:F,errMsg:R||E||j||!A?void 0:"Add funds on Solana to complete transaction."}),/*#__PURE__*/e(c,{style:{marginTop:"1rem"},loading:P,disabled:L||R,onClick:z,children:p}),/*#__PURE__*/e(m,{})]})};let X=/*#__PURE__*/l(C).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-cbe5ab37-0"})(["",""],(e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;")),G=/*#__PURE__*/l(y).withConfig({displayName:"InstructionRows",componentId:"sc-cbe5ab37-1"})(["margin-top:0.5rem;border:1px solid var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-sm);padding:0.5rem;"]),K="There was an error preparing your transaction. Your transaction request will likely fail.",Z=/*#__PURE__*/l.div.withConfig({displayName:"ImageContainer",componentId:"sc-cbe5ab37-2"})(["display:flex;width:100%;justify-content:center;max-height:40px;> img{object-fit:contain;border-radius:var(--privy-border-radius-sm);}"]),_=/*#__PURE__*/l.span.withConfig({displayName:"SponsoredRow",componentId:"sc-cbe5ab37-3"})(["display:inline-flex;align-items:center;gap:0.3rem;"]),ee=/*#__PURE__*/l.span.withConfig({displayName:"SponsoredText",componentId:"sc-cbe5ab37-4"})(["font-size:14px;font-weight:500;color:var(--privy-color-foreground);"]);let ne=()=>/*#__PURE__*/n(ae,{children:[/*#__PURE__*/e(de,{}),/*#__PURE__*/e(le,{})]});const re=({transactionError:i,chainId:o,onClose:t,onRetry:l,chainType:d,transactionHash:c})=>{let{chains:s}=L(),[m,u]=a(!1),{errorCode:f,errorMessage:g}=((e,n)=>{if("ethereum"===n)return{errorCode:e.details??e.message,errorMessage:e.shortMessage};let r=e.txSignature,i=e?.transactionMessage||"Something went wrong.";if(Array.isArray(e.logs)){let n=e.logs.find((e=>/insufficient (lamports|funds)/gi.test(e)));n&&(i=n)}return{transactionHash:r,errorMessage:i}})(i,d),y=(({chains:e,chainId:n,chainType:r,transactionHash:i})=>"ethereum"===r?e.find((e=>e.id===n))?.blockExplorers?.default.url??"https://etherscan.io":function(e,n){return`https://explorer.solana.com/tx/${e}?chain=${n}`}(i||"",n))({chains:s,chainId:o,chainType:d,transactionHash:c});/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:t}),/*#__PURE__*/n(ie,{children:[/*#__PURE__*/e(ne,{}),/*#__PURE__*/e(oe,{children:f}),/*#__PURE__*/e(te,{children:"Please try again."}),/*#__PURE__*/n(he,{children:[/*#__PURE__*/e(se,{children:"Error message"}),/*#__PURE__*/e(pe,{$clickable:!1,children:g})]}),c&&/*#__PURE__*/n(he,{children:[/*#__PURE__*/e(se,{children:"Transaction hash"}),/*#__PURE__*/n(me,{children:["Copy this hash to view details about the transaction on a"," ",/*#__PURE__*/e("u",{children:/*#__PURE__*/e("a",{href:y,children:"block explorer"})}),"."]}),/*#__PURE__*/n(pe,{$clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(c),u(!0)},children:[c,/*#__PURE__*/e(ge,{clicked:m})]})]}),/*#__PURE__*/e(ce,{onClick:()=>l({resetNonce:!!c}),children:"Retry transaction"})]}),/*#__PURE__*/e(p,{})]})};let ie=/*#__PURE__*/l.div.withConfig({displayName:"TransactionErrorScreenContainer",componentId:"sc-d58f10e6-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;"]),oe=/*#__PURE__*/l.span.withConfig({displayName:"ErrorCode",componentId:"sc-d58f10e6-1"})(["color:var(--privy-color-foreground);text-align:center;font-size:1.125rem;font-weight:500;line-height:1.25rem;text-align:center;margin:10px;"]),te=/*#__PURE__*/l.span.withConfig({displayName:"Subtitle",componentId:"sc-d58f10e6-2"})(["margin-top:4px;margin-bottom:10px;color:var(--privy-color-foreground-3);text-align:center;font-size:0.875rem;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;"]),ae=/*#__PURE__*/l.div.withConfig({displayName:"CircleContainer",componentId:"sc-d58f10e6-3"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]),le=/*#__PURE__*/l(F).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-d58f10e6-4"})(["position:absolute;width:35px;height:35px;color:var(--privy-color-error);"]),de=/*#__PURE__*/l.div.withConfig({displayName:"StyledRedCircle",componentId:"sc-d58f10e6-5"})(["position:absolute;width:60px;height:60px;border-radius:50%;background-color:var(--privy-color-error);opacity:0.1;"]),ce=/*#__PURE__*/l(c).withConfig({displayName:"RetryButton",componentId:"sc-d58f10e6-6"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]),se=/*#__PURE__*/l.span.withConfig({displayName:"TextBoxTitle",componentId:"sc-d58f10e6-7"})(["width:100%;text-align:left;font-size:0.825rem;color:var(--privy-color-foreground);padding:4px;"]),he=/*#__PURE__*/l.div.withConfig({displayName:"TextBoxContainer",componentId:"sc-d58f10e6-8"})(["width:100%;margin:5px;display:flex;flex-direction:column;justify-content:center;align-items:center;"]),me=/*#__PURE__*/l.text.withConfig({displayName:"HelperText",componentId:"sc-d58f10e6-9"})(["position:relative;width:100%;padding:5px;font-size:0.8rem;color:var(--privy-color-foreground-3);text-align:left;word-wrap:break-word;"]),pe=/*#__PURE__*/l.span.withConfig({displayName:"TextBox",componentId:"sc-d58f10e6-10"})(["position:relative;width:100%;background-color:var(--privy-color-background-2);padding:8px 12px;border-radius:10px;margin-top:5px;font-size:14px;color:var(--privy-color-foreground-3);text-align:left;word-wrap:break-word;",""],(e=>e.$clickable&&"cursor: pointer;\n transition: background-color 0.3s;\n padding-right: 45px;\n\n &:hover {\n background-color: var(--privy-color-foreground-4);\n }")),ue=/*#__PURE__*/l(D).withConfig({displayName:"StyledClipboardIcon",componentId:"sc-d58f10e6-11"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),fe=/*#__PURE__*/l(O).withConfig({displayName:"StyledClipboardCheckIcon",componentId:"sc-d58f10e6-12"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),ge=({clicked:n})=>/*#__PURE__*/e(n?fe:ue,{});export{Q as S,re as T,Y as a};
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{useState as l,useEffect as a}from"react";import{M as o,B as i}from"./ModalHeader-BLGC-7ev.mjs";import{C as r}from"./ScreenHeader-Biz1wq02.mjs";import{t as c}from"./FundWalletMethodHeader-I8a6Y30s.mjs";import{C as s}from"./Chip-Bsgj4Yc-.mjs";import{S as p}from"./Subtitle-DkvfP2Ev.mjs";import{u as d}from"./context-Bycd1SKV.mjs";import{F as m,Q as y,n as u,T as h,U as w,v as f,a8 as T}from"./useActiveWallet-Bsy5GTCV.mjs";import{u as C}from"./internal-context-e-Eni5bG.mjs";import{a as g}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{u as v}from"./useWallets-D0lpBS44.mjs";import{W as _}from"./WalletOverflowButton-DV9Pe-aq.mjs";import{z as j,A as x,D as b}from"./index-CCyaupaz.mjs";import{isMobile as S}from"react-device-detect";import{styled as W}from"styled-components";import{I as $}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{I as k}from"./styles-DY17fuAX.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"./LoadingSkeleton-CHdaq3pb.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"zustand";import"./prepareFundingModalData-CIgFwA7s.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"ofetch";import"lucide-react";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-BaiIHGte.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/WalletIcon";const O=({provider:t,displayName:l,logo:a,connectOnly:o,connector:i})=>{let r,{navigate:c,setModalData:s}=g(),{connectWallet:p}=C(),d=m(),w=y(t),f="wallet_connect_v2"===i.connectorType?t:i.walletClientType,T=window.matchMedia("(display-mode: standalone)").matches,v=u({connectorType:i.connectorType,walletClientType:f});r=v&&v.chainTypes.includes(i.chainType)?()=>{v.isInstalled||"solana"===i.chainType&&"isInstalled"in i&&i.isInstalled?(p(i,f),c(o?"ConnectOnlyStatusScreen":"ConnectionStatusScreen")):S?(s({installWalletModalData:{walletConfig:v,chainType:i.chainType,connectOnly:o}}),c("WalletInterstitialScreen")):(s({installWalletModalData:{walletConfig:v,chainType:i.chainType,connectOnly:o}}),c("InstallWalletScreen"))}:"coinbase_wallet"!==i.connectorType||"eoaOnly"!==i.coinbaseWalletConfig.preference?.options||!S||T||h()?()=>{(!j(window.navigator.userAgent)||event?.isTrusted)&&(p(i,f),o?"wallet_connect_v2"===i.connectorType?(s((e=>({...e,externalConnectWallet:{...e?.externalConnectWallet,preSelectedWalletId:"wallet_connect_qr"}}))),c("ConnectOnlyLandingScreen")):c("ConnectOnlyStatusScreen"):c("ConnectionStatusScreen"))}:()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`};let _=l||w?.metadata?.shortName||w?.name||i.walletClientType;/*#__PURE__*/return e(I,{onClick:r,children:[/*#__PURE__*/n($,{icon:a||w?.image_url?.md,name:_}),/*#__PURE__*/n("span",{children:_}),/*#__PURE__*/e(M,{id:"chip-container",children:[d?.walletClientType===f&&d?.chainType===i.chainType?/*#__PURE__*/n(D,{color:"gray",children:"Recent"}):/*#__PURE__*/n("span",{id:"connect-text",children:"Connect"}),"solana"===i.chainType&&/*#__PURE__*/n(D,{color:"gray",children:"Solana"})]})]})};let I=/*#__PURE__*/W(w).withConfig({displayName:"ConnectWalletButton",componentId:"sc-5fe2f19b-0"})(["> span{color:var(--privy-color-foreground);}> #chip-container > #connect-text{font-weight:500;color:var(--privy-color-accent);opacity:0;transition:opacity 0.1s ease-out;}:hover > #chip-container > #connect-text{opacity:1;}@media (max-width:440px){> #chip-container > #connect-text{display:none;}}"]),D=/*#__PURE__*/W(s).withConfig({displayName:"StyledChip",componentId:"sc-5fe2f19b-1"})(["margin-left:auto;"]),M=/*#__PURE__*/W.div.withConfig({displayName:"ChipContainer",componentId:"sc-5fe2f19b-2"})(["display:flex;flex-wrap:wrap;gap:8px;margin-left:auto;"]);const F=["coinbase_wallet","base_account"];let B=["metamask","okx_wallet","rainbow","uniswap","bybit_wallet","ronin_wallet","haha_wallet","uniswap_extension","zerion","rabby_wallet","cryptocom","binance","kraken_wallet"];const A=["safe"],E=["phantom","backpack","solflare","jupiter","universal_profile"],N={component:()=>{let s,{connectors:m}=C(),{setModalData:y,data:u,navigate:h}=g(),w=d(),{wallets:j}=v(),S=m.filter(f).flatMap((e=>e.wallets)),[W,$]=l("default"),k="solana"===u?.funding?.chainType,I=!!u?.funding?.crossChainBridgingEnabled;s="ethereum"===u?.funding?.chainType?u.funding.erc20Address&&!u.funding.isUSDC?"ethereum-only":I&&!u.funding.chain.testnet?"ethereum-and-solana":"ethereum-only":I&&!u.funding?.isUSDC?"ethereum-and-solana":"solana-only";let D=j.filter((e=>"privy"!==e.walletClientType)),M=D.map((e=>e.walletClientType)),N=S.filter((e=>"privy"!==e.walletClientType)),U=N.map((e=>e.walletClientType)),z=[],H={...u.funding};H.usingDefaultFundingMethod&&(H.usingDefaultFundingMethod=!1);let R=({wallet:e,walletChainType:n})=>{y({...u,funding:{...H,connectedWallet:e,onContinueWithExternalWallet:()=>h(P({destChainType:k?"solana":"ethereum",sourceChainType:n}))},solanaFundingData:u?.solanaFundingData?{...u.solanaFundingData,sourceWalletData:{address:e.address,walletClientType:e.walletClientType}}:void 0}),h("FundingAmountEditScreen")};"solana-only"!==s&&z.push(...D.map(((e,t)=>/*#__PURE__*/n(L,{onClick:()=>R({wallet:e,walletChainType:"ethereum"}),icon:e.meta.icon,name:e.meta.name,chainType:e.type},t)))),"ethereum-only"!==s&&z.push(...N.map(((e,t)=>/*#__PURE__*/n(L,{onClick:()=>R({wallet:e,walletChainType:"solana"}),icon:e.meta.icon,name:e.meta.name,chainType:e.type},t)))),z.push(...(({walletList:e,walletChainType:t,connectors:l,connectOnly:a,ignore:o,walletConnectEnabled:i,forceWallet:r})=>{let c=[],s=[],p=[],d=l.filter((e=>"ethereum-only"===t?"ethereum"===e.chainType:"solana-only"!==t||"solana"===e.chainType)),m=d.find((e=>"wallet_connect_v2"===e.connectorType));for(let[l,y]of(r?[r.wallet]:e).entries()){if("detected_ethereum_wallets"===y)for(let[e,t]of d.filter((({chainType:e,connectorType:n,walletClientType:t})=>"solana"!==e&&("uniswap_wallet_extension"===t||"uniswap_extension"===t?!o.includes("uniswap"):"crypto.com_wallet_extension"===t||"crypto.com_onchain"===t?!o.includes("cryptocom"):"injected"===n&&!o.includes(t)))).entries()){let{walletClientType:o,walletBranding:i,chainType:r}=t;("unknown"===o?s:c).push(/*#__PURE__*/n(O,{connectOnly:a,provider:o,logo:i.icon,displayName:i.name,connector:t},`${l}-${y}-${o}-${r}-${e}`))}if("detected_solana_wallets"===y)for(let[e,i]of d.filter((({chainType:e,walletClientType:n})=>{if("solana"===e)return"ethereum-only"!==t&&!o.includes(n)})).entries()){let{walletClientType:t,walletBranding:o,chainType:r}=i;("unknown"===t?s:c).push(/*#__PURE__*/n(O,{connectOnly:a,provider:t,logo:o.icon,displayName:o.name,connector:i},`${l}-${y}-${t}-${r}-${e}`))}if(E.includes(y)){let e=d.find((e=>"injected"===e.connectorType&&e.walletClientType===y||e.connectorType===y));if(e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e},`${l}-${y}`)),"solana-only"===t||"ethereum-and-solana"===t){let e=d.find((({chainType:e,walletClientType:n})=>"solana"===e&&n===y));e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e},`${y}-solana`))}}else if(B.includes(y)){let e=d.find((e=>"uniswap"===y?"uniswap_wallet_extension"===e.walletClientType||"uniswap_extension"===e.walletClientType:"cryptocom"===y?"crypto.com_wallet_extension"===e.walletClientType||"crypto.com_onchain"===e.walletClientType:"injected"===e.connectorType&&e.walletClientType===y));if(i&&!e&&(e=m),e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e,logo:"injected"===e.connectorType?e.walletBranding.icon:void 0,displayName:"injected"===e.connectorType?e.walletBranding.name:void 0},`${l}-${y}`)),"solana-only"===t||"ethereum-and-solana"===t){let e=d.find((({chainType:e,walletClientType:n})=>"solana"===e&&n===y));e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e},`${y}-solana`))}}else if(F.includes(y)){let e=d.find((({connectorType:e})=>e===y));e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e,displayName:"coinbase_wallet"===e.walletClientType?"Coinbase":"Base",logo:"coinbase_wallet"===e.walletClientType?x:b},`${l}-${y}`))}else if(A.includes(y))m&&p.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:m},`${l}-${y}`));else if("wallet_connect"===y)m&&p.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:m,logo:m.walletBranding.icon,displayName:"WalletConnect"},`${l}-${y}`));else if(y===r?.wallet){let t="ethereum"===r.chainType&&e.includes("detected_ethereum_wallets"),o="solana"===r.chainType&&e.includes("detected_solana_wallets");if(t||o){let e=d.find((({walletClientType:e})=>e===y));e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,displayName:e.walletBranding?.name,logo:e.walletBranding?.icon,connector:e},`${l}-${y}`))}}}return[...s,...c,...p]})({walletList:w.appearance.walletList.filter((e=>!D.some((n=>n.walletClientType===e))&&!N.some((n=>n.walletClientType===e)))),walletChainType:s,connectors:m,connectOnly:!0,ignore:[...w.appearance.walletList,...M,...U],walletConnectEnabled:w.externalWallets.walletConnect.enabled}));let q=/*#__PURE__*/n(_,{text:"More wallets",onClick:()=>$("overflow")}),P=({sourceChainType:e,destChainType:n})=>"ethereum"===e&&"solana"===n?"AwaitingEvmToSolBridgingScreen":"ethereum"===e&&"ethereum"===n?"AwaitingExternalEthereumTransferScreen":"solana"===e&&"ethereum"===n?"AwaitingSolToEvmBridgingScreen":H.externalSolanaFundingScreen;return a((()=>{y({...u,externalConnectWallet:{onCompleteNavigateTo:({address:e,walletClientType:n,walletChainType:t})=>{let l=t??"ethereum",a="ethereum"===l?D.find((t=>t.address===e&&t.walletClientType===n)):N.find((t=>t.address===e&&t.walletClientType===n));return y({...u,funding:{...H,connectedWallet:a,onContinueWithExternalWallet:()=>{h(P({destChainType:k?"solana":"ethereum",sourceChainType:l}))}},solanaFundingData:u?.solanaFundingData?{...u.solanaFundingData,sourceWalletData:{address:e||"",walletClientType:n||""}}:void 0}),"FundingAmountEditScreen"}}})}),[]),/*#__PURE__*/e(t,"overflow"===W?{children:[/*#__PURE__*/n(o,{backFn:()=>$("default")},"header"),/*#__PURE__*/e(T,{children:[/*#__PURE__*/n(p,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),z]}),/*#__PURE__*/n(i,{})]}:{children:[/*#__PURE__*/n(c,{}),/*#__PURE__*/n(r,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),/*#__PURE__*/e(T,{children:[z.length>4?z.slice(0,3):z,z.length>4&&q]}),/*#__PURE__*/n(i,{})]})}};let L=({onClick:t,icon:l,name:a,chainType:o})=>/*#__PURE__*/e(w,{onClick:t,children:[/*#__PURE__*/n(k,{style:{width:20},children:/*#__PURE__*/n("img",{src:l})}),a,/*#__PURE__*/n(s,{color:"gray",style:{marginLeft:"auto"},children:"Connected"}),"solana"===o&&/*#__PURE__*/n(s,{color:"gray",children:"Solana"})]});export{N as TransferFromWalletScreen,N as default};
@@ -1 +1 @@
1
- import{jsxs as e,Fragment as r,jsx as i}from"react/jsx-runtime";import{styled as o}from"styled-components";import{d as t}from"./Layouts-Bmf8DxNP.mjs";import{B as n}from"./ModalHeader-DHXUvTf4.mjs";import{C as m}from"./ScreenHeader-Biz1wq02.mjs";import{t as a}from"./FundWalletMethodHeader-CN-93vVj.mjs";import{I as s}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{N as d}from"./index-CJMgUOnw.mjs";import{a as l,R as c}from"./Row-CG0lSY5Z.mjs";import{L as h,V as p}from"./Value-B4M62ove.mjs";import{A as f}from"./Address-CDOE2oK9.mjs";import{N as g}from"./NetworkIcon-B48ilzF8.mjs";import{Q as j}from"./useActiveWallet-SiVSXkvG.mjs";const I=({walletClientType:o,displayName:I,addressToFund:w,chainId:y,chainName:N,isBridging:C,isErc20Flow:x,totalPriceInNativeCurrency:T,totalPriceInUsd:v,gasPriceInNativeCurrency:B,gasPriceInUsd:P})=>{let k=j(o);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/i(a,{}),/*#__PURE__*/i(d,{centerIcon:/*#__PURE__*/i(s,{icon:k?.image_url?.md,name:o})}),/*#__PURE__*/i(m,{style:{marginTop:"8px",marginBottom:"12px"},title:`${C?"Bridging":"Confirming"} with ${I}`}),!C&&!x&&/*#__PURE__*/e(l,{children:[/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Total"}),/*#__PURE__*/i(p,{children:v||T})]}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"To"}),/*#__PURE__*/i(p,{children:/*#__PURE__*/i(f,{address:w,showCopyIcon:!1})})]}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Network"}),/*#__PURE__*/i(p,{children:/*#__PURE__*/e(u,{children:[/*#__PURE__*/i(g,{chainId:y,height:16,width:16})," ",N]})})]}),B&&/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Estimated fee"}),/*#__PURE__*/i(p,{children:P||B})]})]}),/*#__PURE__*/i(t,{height:24}),/*#__PURE__*/i(n,{})]})};let u=/*#__PURE__*/o.div.withConfig({displayName:"NetworkColumn",componentId:"sc-5bdbf842-0"})(["display:flex;flex-direction:row;align-items:center;gap:4px;"]);export{I as T};
1
+ import{jsxs as e,Fragment as r,jsx as i}from"react/jsx-runtime";import{styled as o}from"styled-components";import{d as t}from"./Layouts-Bmf8DxNP.mjs";import{B as n}from"./ModalHeader-BLGC-7ev.mjs";import{C as m}from"./ScreenHeader-Biz1wq02.mjs";import{t as a}from"./FundWalletMethodHeader-I8a6Y30s.mjs";import{I as s}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{N as d}from"./index-CJMgUOnw.mjs";import{a as l,R as c}from"./Row-CG0lSY5Z.mjs";import{L as h,V as p}from"./Value-B4M62ove.mjs";import{A as f}from"./Address-BsvZLUXE.mjs";import{N as g}from"./NetworkIcon-B48ilzF8.mjs";import{Q as j}from"./useActiveWallet-Bsy5GTCV.mjs";const I=({walletClientType:o,displayName:I,addressToFund:w,chainId:y,chainName:N,isBridging:C,isErc20Flow:x,totalPriceInNativeCurrency:T,totalPriceInUsd:k,gasPriceInNativeCurrency:v,gasPriceInUsd:B})=>{let P=j(o);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/i(a,{}),/*#__PURE__*/i(d,{centerIcon:/*#__PURE__*/i(s,{icon:P?.image_url?.md,name:o})}),/*#__PURE__*/i(m,{style:{marginTop:"8px",marginBottom:"12px"},title:`${C?"Bridging":"Confirming"} with ${I}`}),!C&&!x&&/*#__PURE__*/e(l,{children:[/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Total"}),/*#__PURE__*/i(p,{children:k||T})]}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"To"}),/*#__PURE__*/i(p,{children:/*#__PURE__*/i(f,{address:w,showCopyIcon:!1})})]}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Network"}),/*#__PURE__*/i(p,{children:/*#__PURE__*/e(u,{children:[/*#__PURE__*/i(g,{chainId:y,height:16,width:16})," ",N]})})]}),v&&/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Estimated fee"}),/*#__PURE__*/i(p,{children:B||v})]})]}),/*#__PURE__*/i(t,{height:24}),/*#__PURE__*/i(n,{})]})};let u=/*#__PURE__*/o.div.withConfig({displayName:"NetworkColumn",componentId:"sc-5bdbf842-0"})(["display:flex;flex-direction:row;align-items:center;gap:4px;"]);export{I as T};
@@ -1 +1 @@
1
- import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import i from"@heroicons/react/24/outline/EnvelopeIcon";import{B as o}from"./Layouts-Bmf8DxNP.mjs";import{Mail as a}from"lucide-react";import{forwardRef as s,useState as m}from"react";import{u as n}from"./context-Dee1TPOi.mjs";import{a as l}from"./index-Dr4t3oWO.mjs";import{u as d}from"./internal-context-e-Eni5bG.mjs";import{u as c,a as p}from"./get-is-unified-wallet-_KIJnP68.mjs";import{a1 as u,V as h}from"./useActiveWallet-SiVSXkvG.mjs";import{E as j,P as v}from"./Button-DJY5dut3.mjs";import{I as f,E as g}from"./EmailInputForm-B4hjCxRU.mjs";import{E as y}from"./ErrorMessage-Cx8GKGhL.mjs";import{S as w}from"./ScreenLayout-BQ6FV6yc.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-gElyEQoU.mjs";import"./prepareFundingModalData-BYy0MVol.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Bh4N2Hpm.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"viem";import"./getPublicClient-A9RSftUZ.mjs";import"ofetch";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const k=/*#__PURE__*/s(((i,o)=>{let[s,f]=m(""),[g,w]=m(""),[k,E]=m(!1),{authenticated:A,user:C}=c(),{initUpdateEmail:x}=d(),{navigate:I,setModalData:M,currentScreen:P}=p(),{enabled:T,token:U}=l(),D=n(),L=u(s)&&(D.disablePlusEmails&&s.includes("+")?(g||w("Please enter a valid email address without a '+'."),!1):(g&&w(""),!0)),W=k||!L,q=()=>{!T||U||A?(async e=>{if(!C?.email)throw Error("User is required to have an email address to update it.");E(!0);try{await x({oldAddress:C.email.address,newAddress:s,captchaToken:e}),I("AwaitingPasswordlessCodeScreen")}catch(e){M({errorModalData:{error:e,previousScreen:P||"LandingScreen"}}),I("ErrorScreen")}E(!1)})(U):(M({captchaModalData:{callback:e=>{if(!C?.email)throw Error("User is required to have an email address to update it.");return x({oldAddress:C.email.address,newAddress:s,captchaToken:e})},userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),I("CaptchaScreen"))};/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(b,{children:[g&&/*#__PURE__*/t(y,{style:{marginTop:"0.25rem",textAlign:"left"},children:g}),/*#__PURE__*/e(S,{$error:!!g,children:[/*#__PURE__*/t(h,{children:/*#__PURE__*/t(a,{})}),/*#__PURE__*/t("input",{ref:o,id:"email-input",type:"email",placeholder:"your@email.com",onChange:e=>f(e.target.value),onKeyUp:e=>{"Enter"===e.key&&q()},value:s,autoComplete:"email"}),i.stacked?null:/*#__PURE__*/t(j,{isSubmitting:k,onClick:q,disabled:W,children:"Submit"})]})]}),i.stacked?/*#__PURE__*/t(v,{loadingText:null,loading:k,disabled:W,onClick:q,style:{width:"100%"},children:"Submit"}):null]})}));let b=f,S=g;const E=({title:e="Update your email",subtitle:r="Add the email address you'd like to use going forward. We'll send you a confirmation code"})=>/*#__PURE__*/t(w,{title:e,subtitle:r,icon:i,watermark:!0,children:/*#__PURE__*/t(o,{children:/*#__PURE__*/t(k,{stacked:!0})})}),A={component:()=>/*#__PURE__*/t(E,{})};export{A as UpdateEmailScreen,E as UpdateEmailScreenView,A as default};
1
+ import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import i from"@heroicons/react/24/outline/EnvelopeIcon";import{B as o}from"./Layouts-Bmf8DxNP.mjs";import{Mail as a}from"lucide-react";import{forwardRef as s,useState as m}from"react";import{u as n}from"./context-Bycd1SKV.mjs";import{a as l}from"./index-CCyaupaz.mjs";import{u as d}from"./internal-context-e-Eni5bG.mjs";import{u as c,a as p}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{a1 as u,V as h}from"./useActiveWallet-Bsy5GTCV.mjs";import{E as j,P as v}from"./Button-B8mqatRx.mjs";import{I as f,E as g}from"./EmailInputForm-B4hjCxRU.mjs";import{E as y}from"./ErrorMessage-Cx8GKGhL.mjs";import{S as w}from"./ScreenLayout-CddsD3Of.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-D0lpBS44.mjs";import"./prepareFundingModalData-CIgFwA7s.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-BaiIHGte.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"viem";import"./getPublicClient-A9RSftUZ.mjs";import"ofetch";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Screen-BTyXgDrd.mjs";import"./ModalHeader-BLGC-7ev.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 k=/*#__PURE__*/s(((i,o)=>{let[s,f]=m(""),[g,w]=m(""),[k,E]=m(!1),{authenticated:A,user:C}=c(),{initUpdateEmail:x}=d(),{navigate:I,setModalData:M,currentScreen:P}=p(),{enabled:T,token:U}=l(),D=n(),L=u(s)&&(D.disablePlusEmails&&s.includes("+")?(g||w("Please enter a valid email address without a '+'."),!1):(g&&w(""),!0)),W=k||!L,q=()=>{!T||U||A?(async e=>{if(!C?.email)throw Error("User is required to have an email address to update it.");E(!0);try{await x({oldAddress:C.email.address,newAddress:s,captchaToken:e}),I("AwaitingPasswordlessCodeScreen")}catch(e){M({errorModalData:{error:e,previousScreen:P||"LandingScreen"}}),I("ErrorScreen")}E(!1)})(U):(M({captchaModalData:{callback:e=>{if(!C?.email)throw Error("User is required to have an email address to update it.");return x({oldAddress:C.email.address,newAddress:s,captchaToken:e})},userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),I("CaptchaScreen"))};/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(b,{children:[g&&/*#__PURE__*/t(y,{style:{marginTop:"0.25rem",textAlign:"left"},children:g}),/*#__PURE__*/e(S,{$error:!!g,children:[/*#__PURE__*/t(h,{children:/*#__PURE__*/t(a,{})}),/*#__PURE__*/t("input",{ref:o,id:"email-input",type:"email",placeholder:"your@email.com",onChange:e=>f(e.target.value),onKeyUp:e=>{"Enter"===e.key&&q()},value:s,autoComplete:"email"}),i.stacked?null:/*#__PURE__*/t(j,{isSubmitting:k,onClick:q,disabled:W,children:"Submit"})]})]}),i.stacked?/*#__PURE__*/t(v,{loadingText:null,loading:k,disabled:W,onClick:q,style:{width:"100%"},children:"Submit"}):null]})}));let b=f,S=g;const E=({title:e="Update your email",subtitle:r="Add the email address you'd like to use going forward. We'll send you a confirmation code"})=>/*#__PURE__*/t(w,{title:e,subtitle:r,icon:i,watermark:!0,children:/*#__PURE__*/t(o,{children:/*#__PURE__*/t(k,{stacked:!0})})}),A={component:()=>/*#__PURE__*/t(E,{})};export{A as UpdateEmailScreen,E as UpdateEmailScreenView,A as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/PhoneIcon";import{useState as o}from"react";import{C as r}from"./ConnectPhoneForm-Ft9zAuQd.mjs";import{u as i}from"./internal-context-e-Eni5bG.mjs";import{a as n,u as m}from"./get-is-unified-wallet-_KIJnP68.mjs";import{S as a}from"./ScreenLayout-BQ6FV6yc.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./context-Dee1TPOi.mjs";import"tinycolor2";import"./useActiveWallet-SiVSXkvG.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BYy0MVol.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";import"./Button-DJY5dut3.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"ofetch";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const s=({title:i="Update your phone number",subtitle:n="Add the phone number you'd like to use going forward. We'll send you a confirmation code",onSubmit:m,isSubmitting:s=!1})=>{let[c,u]=o(null);/*#__PURE__*/return e(a,{title:i,subtitle:n,icon:t,primaryCta:{label:s?"Submitting":"Update",onClick:async()=>{c?.qualifiedPhoneNumber&&await m(c)},disabled:!c?.isValid||s},watermark:!0,children:/*#__PURE__*/e(r,{onChange:e=>{u(e)},onSubmit:async()=>{},noIncludeSubmitButton:!0,hideRecent:!0})})},c={component:()=>{let{currentScreen:t,data:r,navigate:a,setModalData:c}=n(),{user:u}=m(),{initUpdatePhone:p}=i(),[l,d]=o(!1);/*#__PURE__*/return e(s,{onSubmit:async e=>{d(!0);try{if(!u?.phone?.number)throw Error("User is required to have an phone number to update it.");await p(u?.phone?.number,e.qualifiedPhoneNumber),a("AwaitingPasswordlessCodeScreen")}catch(e){c({errorModalData:{error:e,previousScreen:r?.errorModalData?.previousScreen||t||"LinkPhoneScreen"}}),a("ErrorScreen")}finally{d(!1)}},isSubmitting:l})}};export{c as UpdatePhoneScreen,s as UpdatePhoneScreenView,c as default};
1
+ import{jsx as e}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/PhoneIcon";import{useState as o}from"react";import{C as r}from"./ConnectPhoneForm-DoYmHBv3.mjs";import{u as i}from"./internal-context-e-Eni5bG.mjs";import{a as n,u as m}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{S as a}from"./ScreenLayout-CddsD3Of.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./context-Bycd1SKV.mjs";import"tinycolor2";import"./useActiveWallet-Bsy5GTCV.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CIgFwA7s.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-D0lpBS44.mjs";import"./Button-B8mqatRx.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"ofetch";import"./Screen-BTyXgDrd.mjs";import"./ModalHeader-BLGC-7ev.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="Update your phone number",subtitle:n="Add the phone number you'd like to use going forward. We'll send you a confirmation code",onSubmit:m,isSubmitting:s=!1})=>{let[c,u]=o(null);/*#__PURE__*/return e(a,{title:i,subtitle:n,icon:t,primaryCta:{label:s?"Submitting":"Update",onClick:async()=>{c?.qualifiedPhoneNumber&&await m(c)},disabled:!c?.isValid||s},watermark:!0,children:/*#__PURE__*/e(r,{onChange:e=>{u(e)},onSubmit:async()=>{},noIncludeSubmitButton:!0,hideRecent:!0})})},c={component:()=>{let{currentScreen:t,data:r,navigate:a,setModalData:c}=n(),{user:u}=m(),{initUpdatePhone:p}=i(),[l,d]=o(!1);/*#__PURE__*/return e(s,{onSubmit:async e=>{d(!0);try{if(!u?.phone?.number)throw Error("User is required to have an phone number to update it.");await p(u?.phone?.number,e.qualifiedPhoneNumber),a("AwaitingPasswordlessCodeScreen")}catch(e){c({errorModalData:{error:e,previousScreen:r?.errorModalData?.previousScreen||t||"LinkPhoneScreen"}}),a("ErrorScreen")}finally{d(!1)}},isSubmitting:l})}};export{c as UpdatePhoneScreen,s as UpdatePhoneScreenView,c as default};
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{a as o}from"./get-is-unified-wallet-_KIJnP68.mjs";import{S as e}from"./ScreenLayout-BQ6FV6yc.mjs";import"viem";import"react";import"./context-Dee1TPOi.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"./Button-DJY5dut3.mjs";import"styled-components";import"./useActiveWallet-SiVSXkvG.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BYy0MVol.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const i=({style:o,...e})=>/*#__PURE__*/t("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...o},...e,children:/*#__PURE__*/t("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})}),r=({title:o="Unable to sign in",subtitle:r="This is a test application that has reached its user limit. To allow more users, this app needs to be upgraded to production.",onGoBack:n})=>/*#__PURE__*/t(e,{title:o,subtitle:r,icon:i,iconVariant:"subtle",primaryCta:{label:"Go back",onClick:n},showBack:!0,onBack:n,watermark:!0}),n={component:()=>{let{navigate:e}=o();/*#__PURE__*/return t(r,{onGoBack:()=>{e("LandingScreen")}})}};export{n as UserLimitReachedScreen,r as UserLimitReachedScreenView,n as default};
1
+ import{jsx as t}from"react/jsx-runtime";import{a as o}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{S as e}from"./ScreenLayout-CddsD3Of.mjs";import"viem";import"react";import"./context-Bycd1SKV.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"./Button-B8mqatRx.mjs";import"styled-components";import"./useActiveWallet-Bsy5GTCV.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CIgFwA7s.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-D0lpBS44.mjs";import"./Screen-BTyXgDrd.mjs";import"./ModalHeader-BLGC-7ev.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=({style:o,...e})=>/*#__PURE__*/t("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...o},...e,children:/*#__PURE__*/t("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})}),r=({title:o="Unable to sign in",subtitle:r="This is a test application that has reached its user limit. To allow more users, this app needs to be upgraded to production.",onGoBack:n})=>/*#__PURE__*/t(e,{title:o,subtitle:r,icon:i,iconVariant:"subtle",primaryCta:{label:"Go back",onClick:n},showBack:!0,onBack:n,watermark:!0}),n={component:()=>{let{navigate:e}=o();/*#__PURE__*/return t(r,{onGoBack:()=>{e("LandingScreen")}})}};export{n as UserLimitReachedScreen,r as UserLimitReachedScreenView,n as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as o,Fragment as t}from"react/jsx-runtime";import{Check as i,Copy as r}from"lucide-react";import{useState as n,useEffect as s}from"react";import{styled as a}from"styled-components";import{S as d}from"./Button-DJY5dut3.mjs";import{E as m}from"./ErrorMessage-Cx8GKGhL.mjs";import{L as l}from"./LabelXs-BOisBtqT.mjs";import{A as c}from"./Address-CDOE2oK9.mjs";import{B as p}from"./shared-CtYf3O54.mjs";let f=/*#__PURE__*/a(p).withConfig({displayName:"StyledBox",componentId:"sc-4010d8f3-0"})(["&&{padding:0.75rem;height:56px;}"]),h=/*#__PURE__*/a.div.withConfig({displayName:"WalletContent",componentId:"sc-4010d8f3-1"})(["display:flex;align-items:center;justify-content:space-between;width:100%;"]),g=/*#__PURE__*/a.div.withConfig({displayName:"AddressContainer",componentId:"sc-4010d8f3-2"})(["display:flex;flex-direction:column;gap:0;"]),y=/*#__PURE__*/a.div.withConfig({displayName:"BalanceText",componentId:"sc-4010d8f3-3"})(["font-size:12px;line-height:1rem;color:var(--privy-color-foreground-3);"]),C=/*#__PURE__*/a(l).withConfig({displayName:"TitleLabel",componentId:"sc-4010d8f3-4"})(["text-align:left;margin-bottom:0.5rem;"]),u=/*#__PURE__*/a(m).withConfig({displayName:"StyledErrorMessage",componentId:"sc-4010d8f3-5"})(["margin-top:0.25rem;"]),w=/*#__PURE__*/a(d).withConfig({displayName:"CopyButton",componentId:"sc-4010d8f3-6"})(["&&{gap:0.375rem;font-size:14px;}"]);const x=({errMsg:a,balance:d,address:m,className:l,title:p,showCopyButton:x=!1})=>{let[v,N]=n(!1);return s((()=>{if(v){let e=setTimeout((()=>N(!1)),3e3);return()=>clearTimeout(e)}}),[v]),/*#__PURE__*/e("div",{children:[p&&/*#__PURE__*/o(C,{children:p}),/*#__PURE__*/o(f,{className:l,$state:a?"error":void 0,children:/*#__PURE__*/e(h,{children:[/*#__PURE__*/e(g,{children:[/*#__PURE__*/o(c,{address:m,showCopyIcon:!1}),void 0!==d&&/*#__PURE__*/o(y,{children:d})]}),x&&/*#__PURE__*/o(w,{onClick:function(e){e.stopPropagation(),navigator.clipboard.writeText(m).then((()=>N(!0))).catch(console.error)},size:"sm",children:/*#__PURE__*/e(t,v?{children:["Copied",/*#__PURE__*/o(i,{size:14})]}:{children:["Copy",/*#__PURE__*/o(r,{size:14})]})})]})}),a&&/*#__PURE__*/o(u,{children:a})]})};export{x as W};
1
+ import{jsxs as e,jsx as o,Fragment as t}from"react/jsx-runtime";import{Check as i,Copy as r}from"lucide-react";import{useState as n,useEffect as s}from"react";import{styled as a}from"styled-components";import{S as d}from"./Button-B8mqatRx.mjs";import{E as m}from"./ErrorMessage-Cx8GKGhL.mjs";import{L as l}from"./LabelXs-BOisBtqT.mjs";import{A as c}from"./Address-BsvZLUXE.mjs";import{B as p}from"./shared-CtYf3O54.mjs";let f=/*#__PURE__*/a(p).withConfig({displayName:"StyledBox",componentId:"sc-4010d8f3-0"})(["&&{padding:0.75rem;height:56px;}"]),h=/*#__PURE__*/a.div.withConfig({displayName:"WalletContent",componentId:"sc-4010d8f3-1"})(["display:flex;align-items:center;justify-content:space-between;width:100%;"]),g=/*#__PURE__*/a.div.withConfig({displayName:"AddressContainer",componentId:"sc-4010d8f3-2"})(["display:flex;flex-direction:column;gap:0;"]),y=/*#__PURE__*/a.div.withConfig({displayName:"BalanceText",componentId:"sc-4010d8f3-3"})(["font-size:12px;line-height:1rem;color:var(--privy-color-foreground-3);"]),C=/*#__PURE__*/a(l).withConfig({displayName:"TitleLabel",componentId:"sc-4010d8f3-4"})(["text-align:left;margin-bottom:0.5rem;"]),u=/*#__PURE__*/a(m).withConfig({displayName:"StyledErrorMessage",componentId:"sc-4010d8f3-5"})(["margin-top:0.25rem;"]),w=/*#__PURE__*/a(d).withConfig({displayName:"CopyButton",componentId:"sc-4010d8f3-6"})(["&&{gap:0.375rem;font-size:14px;}"]);const x=({errMsg:a,balance:d,address:m,className:l,title:p,showCopyButton:x=!1})=>{let[v,N]=n(!1);return s((()=>{if(v){let e=setTimeout((()=>N(!1)),3e3);return()=>clearTimeout(e)}}),[v]),/*#__PURE__*/e("div",{children:[p&&/*#__PURE__*/o(C,{children:p}),/*#__PURE__*/o(f,{className:l,$state:a?"error":void 0,children:/*#__PURE__*/e(h,{children:[/*#__PURE__*/e(g,{children:[/*#__PURE__*/o(c,{address:m,showCopyIcon:!1}),void 0!==d&&/*#__PURE__*/o(y,{children:d})]}),x&&/*#__PURE__*/o(w,{onClick:function(e){e.stopPropagation(),navigator.clipboard.writeText(m).then((()=>N(!0))).catch(console.error)},size:"sm",children:/*#__PURE__*/e(t,v?{children:["Copied",/*#__PURE__*/o(i,{size:14})]}:{children:["Copy",/*#__PURE__*/o(r,{size:14})]})})]})}),a&&/*#__PURE__*/o(u,{children:a})]})};export{x as W};