@dynamic-labs/sdk-react-core 4.5.0 → 4.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +12 -12
  5. package/src/index.cjs +7 -7
  6. package/src/index.js +2 -2
  7. package/src/lib/components/Alert/Alert.cjs +6 -3
  8. package/src/lib/components/Alert/Alert.d.ts +1 -0
  9. package/src/lib/components/Alert/Alert.js +6 -4
  10. package/src/lib/components/Alert/AlertText/AlertText.cjs +16 -0
  11. package/src/lib/components/Alert/AlertText/AlertText.d.ts +7 -0
  12. package/src/lib/components/Alert/AlertText/AlertText.js +12 -0
  13. package/src/lib/components/Alert/AlertText/index.d.ts +1 -0
  14. package/src/lib/components/NetworkPicker/NetworkPicker.cjs +11 -40
  15. package/src/lib/components/NetworkPicker/NetworkPicker.d.ts +2 -6
  16. package/src/lib/components/NetworkPicker/NetworkPicker.js +12 -41
  17. package/src/lib/components/NetworkPicker/components/NetworkControl/NetworkControl.cjs +6 -8
  18. package/src/lib/components/NetworkPicker/components/NetworkControl/NetworkControl.d.ts +2 -4
  19. package/src/lib/components/NetworkPicker/components/NetworkControl/NetworkControl.js +6 -8
  20. package/src/lib/components/NetworkPicker/components/NetworkDropdown/NetworkDropdown.cjs +67 -0
  21. package/src/lib/components/NetworkPicker/components/NetworkDropdown/NetworkDropdown.d.ts +14 -0
  22. package/src/lib/components/NetworkPicker/components/NetworkDropdown/NetworkDropdown.js +63 -0
  23. package/src/lib/components/NetworkPicker/components/NetworkDropdown/index.d.ts +1 -0
  24. package/src/lib/components/NetworkPicker/components/{EvmNetworkControl/EvmNetworkControl.cjs → NetworkSwitchControl/NetworkSwitchControl.cjs} +27 -36
  25. package/src/lib/components/NetworkPicker/components/NetworkSwitchControl/NetworkSwitchControl.d.ts +16 -0
  26. package/src/lib/components/NetworkPicker/components/{EvmNetworkControl/EvmNetworkControl.js → NetworkSwitchControl/NetworkSwitchControl.js} +27 -35
  27. package/src/lib/components/NetworkPicker/components/NetworkSwitchControl/index.d.ts +1 -0
  28. package/src/lib/components/Portal/Portal.cjs +3 -2
  29. package/src/lib/components/Portal/Portal.js +3 -2
  30. package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +1 -1
  31. package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +1 -1
  32. package/src/lib/components/ShadowDOM/ShadowDOM.cjs +0 -2
  33. package/src/lib/components/ShadowDOM/ShadowDOM.js +1 -2
  34. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.cjs +1 -1
  35. package/src/lib/components/TransactionConfirmationPageLayout/TransactionConfirmationPageLayout.js +1 -1
  36. package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +1 -1
  37. package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +1 -1
  38. package/src/lib/components/UserProfile/UserProfile.cjs +1 -1
  39. package/src/lib/components/UserProfile/UserProfile.js +1 -1
  40. package/src/lib/context/DynamicContext/DynamicContext.cjs +15 -12
  41. package/src/lib/context/DynamicContext/DynamicContext.js +15 -12
  42. package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.cjs +2 -2
  43. package/src/lib/context/DynamicContext/hooks/useEmailLoginState/useEmailLoginState.js +3 -3
  44. package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +0 -4
  45. package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +0 -4
  46. package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.cjs +7 -2
  47. package/src/lib/context/DynamicContext/hooks/useNameService/useNameService.js +7 -2
  48. package/src/lib/context/DynamicContext/hooks/usePasskeySuccessPopup/usePasskeySuccessPopup.cjs +2 -2
  49. package/src/lib/context/DynamicContext/hooks/usePasskeySuccessPopup/usePasskeySuccessPopup.js +3 -3
  50. package/src/lib/context/DynamicContext/types/SettingsOverrides.d.ts +5 -2
  51. package/src/lib/context/ErrorContext/ErrorContext.cjs +7 -6
  52. package/src/lib/context/ErrorContext/ErrorContext.js +8 -7
  53. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +3 -3
  54. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +3 -3
  55. package/src/lib/context/ViewContext/ViewContext.cjs +7 -2
  56. package/src/lib/context/ViewContext/ViewContext.js +7 -2
  57. package/src/lib/context/ViewContext/types/index.d.ts +1 -1
  58. package/src/lib/data/api/embeddedWallets/embeddedWallets.cjs +5 -64
  59. package/src/lib/data/api/embeddedWallets/embeddedWallets.d.ts +2 -18
  60. package/src/lib/data/api/embeddedWallets/embeddedWallets.js +6 -61
  61. package/src/lib/data/api/wallets/wallets.cjs +1 -3
  62. package/src/lib/data/api/wallets/wallets.d.ts +1 -1
  63. package/src/lib/data/api/wallets/wallets.js +2 -4
  64. package/src/lib/events/embeddedWallet.d.ts +0 -4
  65. package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.cjs +2 -6
  66. package/src/lib/layout/DynamicAuthLayout/ToSFooter/ToSFooter.js +2 -6
  67. package/src/lib/locale/en/translation.cjs +13 -32
  68. package/src/lib/locale/en/translation.d.ts +12 -31
  69. package/src/lib/locale/en/translation.js +13 -32
  70. package/src/lib/main.global.cjs +1 -1
  71. package/src/lib/main.global.js +1 -1
  72. package/src/lib/modals/SyncWalletPromptModal/SyncWalletPromptModal.cjs +8 -8
  73. package/src/lib/modals/SyncWalletPromptModal/SyncWalletPromptModal.js +8 -8
  74. package/src/lib/modals/index.d.ts +0 -2
  75. package/src/lib/shared/assets/index.d.ts +1 -0
  76. package/src/lib/shared/assets/{currency.cjs → wallet-with-sunglasses.cjs} +14 -26
  77. package/src/lib/shared/assets/wallet-with-sunglasses.js +34 -0
  78. package/src/lib/shared/utils/functions/index.d.ts +0 -2
  79. package/src/lib/shared/utils/hooks/useLocalStorage/useLocalStorage.cjs +7 -5
  80. package/src/lib/shared/utils/hooks/useLocalStorage/useLocalStorage.js +8 -6
  81. package/src/lib/styles/index.shadow.cjs +1 -1
  82. package/src/lib/styles/index.shadow.js +1 -1
  83. package/src/lib/utils/functions/index.d.ts +0 -5
  84. package/src/lib/utils/functions/isAllowedToLinkWallet/isAllowedToLinkWallet.cjs +1 -1
  85. package/src/lib/utils/functions/isAllowedToLinkWallet/isAllowedToLinkWallet.js +1 -1
  86. package/src/lib/utils/functions/isNetworkUnsupported/isNetworkUnsupported.cjs +2 -4
  87. package/src/lib/utils/functions/isNetworkUnsupported/isNetworkUnsupported.d.ts +2 -2
  88. package/src/lib/utils/functions/isNetworkUnsupported/isNetworkUnsupported.js +2 -4
  89. package/src/lib/utils/functions/onrampConfigurationToOnrampOption/onrampConfigurationToOnrampOption.cjs +1 -1
  90. package/src/lib/utils/functions/onrampConfigurationToOnrampOption/onrampConfigurationToOnrampOption.js +1 -1
  91. package/src/lib/utils/hooks/index.d.ts +0 -1
  92. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +0 -2
  93. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +0 -2
  94. package/src/lib/utils/hooks/useClearWalletConnectSessions/useClearWalletConnectSessions.cjs +2 -2
  95. package/src/lib/utils/hooks/useClearWalletConnectSessions/useClearWalletConnectSessions.js +3 -3
  96. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +16 -4
  97. package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +16 -4
  98. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +3 -3
  99. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +3 -3
  100. package/src/lib/utils/hooks/useCreateWalletConnectorOptions/useCreateWalletConnectorOptions.cjs +1 -1
  101. package/src/lib/utils/hooks/useCreateWalletConnectorOptions/useCreateWalletConnectorOptions.js +1 -1
  102. package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +1 -6
  103. package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +1 -6
  104. package/src/lib/utils/hooks/useDynamicModals/useDynamicModals.cjs +1 -1
  105. package/src/lib/utils/hooks/useDynamicModals/useDynamicModals.js +1 -1
  106. package/src/lib/utils/hooks/useElementById/useElementById.cjs +2 -2
  107. package/src/lib/utils/hooks/useElementById/useElementById.js +3 -3
  108. package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.cjs +1 -13
  109. package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.js +1 -13
  110. package/src/lib/utils/hooks/useEmbeddedWallet/index.d.ts +0 -1
  111. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +7 -23
  112. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +0 -2
  113. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +7 -23
  114. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.cjs +4 -4
  115. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.js +4 -4
  116. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.cjs +3 -3
  117. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.js +3 -3
  118. package/src/lib/utils/hooks/useFundWithWallet/useConnectWalletForFunding/useConnectWalletForFunding.cjs +1 -0
  119. package/src/lib/utils/hooks/useFundWithWallet/useConnectWalletForFunding/useConnectWalletForFunding.js +1 -0
  120. package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.cjs +1 -1
  121. package/src/lib/utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.js +1 -1
  122. package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs +2 -2
  123. package/src/lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js +2 -2
  124. package/src/lib/utils/hooks/useResetCookieLocalStorage/useResetCookieLocalStorage.cjs +1 -1
  125. package/src/lib/utils/hooks/useResetCookieLocalStorage/useResetCookieLocalStorage.js +1 -1
  126. package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.cjs +11 -18
  127. package/src/lib/utils/hooks/useSetWalletConnectorFetchers/useSetWalletConnectorFetchers.js +12 -19
  128. package/src/lib/utils/hooks/useTransferWallet/useTransferWallet.cjs +4 -4
  129. package/src/lib/utils/hooks/useTransferWallet/useTransferWallet.js +4 -4
  130. package/src/lib/utils/hooks/useUpgradeEmbeddedWallet/useUpgradeEmbeddedWallet.cjs +4 -4
  131. package/src/lib/utils/hooks/useUpgradeEmbeddedWallet/useUpgradeEmbeddedWallet.js +4 -4
  132. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +4 -4
  133. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +4 -4
  134. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +0 -3
  135. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +0 -3
  136. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +0 -3
  137. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +0 -3
  138. package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.cjs +0 -1
  139. package/src/lib/utils/hooks/useWalletOptions/useWalletOptions.js +0 -1
  140. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +2 -24
  141. package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +2 -24
  142. package/src/lib/utils/validations/index.d.ts +0 -1
  143. package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +2 -4
  144. package/src/lib/views/CollectUserDataView/CollectUserDataView.js +2 -4
  145. package/src/lib/views/CollectUserDataView/UserDataFields/UserPhoneField/UserPhoneField.cjs +2 -2
  146. package/src/lib/views/CollectUserDataView/UserDataFields/UserPhoneField/UserPhoneField.js +2 -2
  147. package/src/lib/views/EmailVerification/EmailVerification.cjs +4 -4
  148. package/src/lib/views/EmailVerification/EmailVerification.js +4 -4
  149. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +12 -34
  150. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +13 -35
  151. package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.cjs +2 -2
  152. package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.js +2 -2
  153. package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.cjs +1 -1
  154. package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.js +1 -1
  155. package/src/lib/views/MfaRecoveryView/MfaRecoveryView.cjs +1 -1
  156. package/src/lib/views/MfaRecoveryView/MfaRecoveryView.js +1 -1
  157. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +3 -4
  158. package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +3 -4
  159. package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +1 -1
  160. package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +1 -1
  161. package/src/lib/views/SendBalanceView/SendBalanceView.cjs +1 -1
  162. package/src/lib/views/SendBalanceView/SendBalanceView.js +1 -1
  163. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +11 -11
  164. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +11 -11
  165. package/src/lib/views/viewToComponentMap.cjs +0 -4
  166. package/src/lib/views/viewToComponentMap.d.ts +0 -2
  167. package/src/lib/views/viewToComponentMap.js +0 -4
  168. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +10 -15
  169. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +11 -16
  170. package/src/lib/widgets/DynamicWidget/components/Balance/Balance.cjs +1 -1
  171. package/src/lib/widgets/DynamicWidget/components/Balance/Balance.js +1 -1
  172. package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.cjs +2 -6
  173. package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.js +2 -6
  174. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +3 -3
  175. package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +3 -3
  176. package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.cjs +1 -1
  177. package/src/lib/widgets/DynamicWidget/components/SingleWalletButtons/SingleWalletButtons.js +1 -1
  178. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +1 -1
  179. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +1 -1
  180. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +1 -1
  181. package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs +1 -1
  182. package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +1 -1
  183. package/src/lib/widgets/DynamicWidget/views/ChooseOnrampProviderView/ChooseOnrampProviderView.cjs +4 -1
  184. package/src/lib/widgets/DynamicWidget/views/ChooseOnrampProviderView/ChooseOnrampProviderView.js +4 -1
  185. package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/ChooseWalletFundingMethod.cjs +1 -1
  186. package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/ChooseWalletFundingMethod.js +1 -1
  187. package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useFundingMethods.cjs +19 -11
  188. package/src/lib/widgets/DynamicWidget/views/ChooseWalletFundingMethod/useFundingMethods/useFundingMethods.js +19 -11
  189. package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +2 -2
  190. package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +2 -2
  191. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/ReceiveExternalWalletFunds.cjs +103 -50
  192. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/ReceiveExternalWalletFunds.js +99 -46
  193. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/TokenSelectScreen/TokenOption/TokenOption.cjs +21 -10
  194. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/TokenSelectScreen/TokenOption/TokenOption.d.ts +2 -0
  195. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/TokenSelectScreen/TokenOption/TokenOption.js +21 -10
  196. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/TokenSelectScreen/TokenSelectScreen.cjs +3 -3
  197. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/TokenSelectScreen/TokenSelectScreen.d.ts +2 -0
  198. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/TokenSelectScreen/TokenSelectScreen.js +3 -3
  199. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/types.d.ts +2 -0
  200. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/calculateFiatBalance/calculateFiatBalance.cjs +27 -0
  201. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/calculateFiatBalance/calculateFiatBalance.d.ts +2 -0
  202. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/calculateFiatBalance/calculateFiatBalance.js +23 -0
  203. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/calculateFiatBalance/index.d.ts +1 -0
  204. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/convert/convert.cjs +4 -0
  205. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/convert/convert.js +4 -0
  206. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/formatValue/convertScientificToDecimal/convertScientificToDecimal.cjs +33 -0
  207. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/formatValue/convertScientificToDecimal/convertScientificToDecimal.d.ts +8 -0
  208. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/formatValue/convertScientificToDecimal/convertScientificToDecimal.js +29 -0
  209. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/formatValue/convertScientificToDecimal/index.d.ts +1 -0
  210. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/formatValue/formatValue.cjs +27 -22
  211. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/formatValue/formatValue.d.ts +6 -0
  212. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/formatValue/formatValue.js +27 -22
  213. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/isFiatToken/isFiatToken.cjs +2 -0
  214. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/isFiatToken/isFiatToken.d.ts +1 -0
  215. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/isFiatToken/isFiatToken.js +2 -1
  216. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/useExchangeRatesForFunding/index.d.ts +1 -0
  217. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/useExchangeRatesForFunding/useExchangeRatesForFunding.cjs +32 -0
  218. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/useExchangeRatesForFunding/useExchangeRatesForFunding.d.ts +9 -0
  219. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/useExchangeRatesForFunding/useExchangeRatesForFunding.js +28 -0
  220. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/useSubmitExternalWalletFunding/useSubmitExternalWalletFunding.cjs +14 -2
  221. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/useSubmitExternalWalletFunding/useSubmitExternalWalletFunding.js +14 -2
  222. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/useTokensForFunding/useTokensForFunding.cjs +27 -15
  223. package/src/lib/widgets/DynamicWidget/views/ReceiveExternalWalletFunds/utils/useTokensForFunding/useTokensForFunding.js +27 -15
  224. package/src/lib/widgets/DynamicWidget/views/SettingsView/EmptyScreen/EmptyScreen.cjs +20 -0
  225. package/src/lib/widgets/DynamicWidget/views/SettingsView/EmptyScreen/EmptyScreen.d.ts +2 -0
  226. package/src/lib/widgets/DynamicWidget/views/SettingsView/EmptyScreen/EmptyScreen.js +16 -0
  227. package/src/lib/widgets/DynamicWidget/views/SettingsView/EmptyScreen/index.d.ts +1 -0
  228. package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +10 -23
  229. package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +11 -24
  230. package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.d.ts +0 -23
  231. package/src/lib/components/NetworkPicker/components/EvmNetworkControl/index.d.ts +0 -1
  232. package/src/lib/components/ToggleVisibilityButton/ToggleVisibilityButton.cjs +0 -113
  233. package/src/lib/components/ToggleVisibilityButton/ToggleVisibilityButton.js +0 -109
  234. package/src/lib/modals/CreatePasswordModal/CreatePasswordModal.cjs +0 -106
  235. package/src/lib/modals/CreatePasswordModal/CreatePasswordModal.d.ts +0 -3
  236. package/src/lib/modals/CreatePasswordModal/CreatePasswordModal.js +0 -102
  237. package/src/lib/modals/CreatePasswordModal/CreatePasswordModal.types.d.ts +0 -5
  238. package/src/lib/modals/CreatePasswordModal/index.d.ts +0 -1
  239. package/src/lib/modals/EnterPasswordModal/EnterPasswordModal.cjs +0 -106
  240. package/src/lib/modals/EnterPasswordModal/EnterPasswordModal.d.ts +0 -3
  241. package/src/lib/modals/EnterPasswordModal/EnterPasswordModal.js +0 -102
  242. package/src/lib/modals/EnterPasswordModal/EnterPasswordModal.types.d.ts +0 -6
  243. package/src/lib/modals/EnterPasswordModal/index.d.ts +0 -1
  244. package/src/lib/shared/assets/alt-key.cjs +0 -55
  245. package/src/lib/shared/assets/alt-key.js +0 -31
  246. package/src/lib/shared/assets/currency.js +0 -46
  247. package/src/lib/shared/assets/lock.cjs +0 -55
  248. package/src/lib/shared/assets/lock.js +0 -31
  249. package/src/lib/shared/assets/save-password-hero.cjs +0 -128
  250. package/src/lib/shared/assets/save-password-hero.js +0 -104
  251. package/src/lib/shared/assets/wallet-claim-hero.cjs +0 -128
  252. package/src/lib/shared/assets/wallet-claim-hero.js +0 -104
  253. package/src/lib/shared/utils/functions/generateRandomPassword/generateRandomPassword.cjs +0 -15
  254. package/src/lib/shared/utils/functions/generateRandomPassword/generateRandomPassword.d.ts +0 -1
  255. package/src/lib/shared/utils/functions/generateRandomPassword/generateRandomPassword.js +0 -11
  256. package/src/lib/shared/utils/functions/generateRandomPassword/index.d.ts +0 -1
  257. package/src/lib/shared/utils/functions/validatePassword/index.d.ts +0 -1
  258. package/src/lib/shared/utils/functions/validatePassword/validatePassword.cjs +0 -60
  259. package/src/lib/shared/utils/functions/validatePassword/validatePassword.d.ts +0 -13
  260. package/src/lib/shared/utils/functions/validatePassword/validatePassword.js +0 -56
  261. package/src/lib/utils/functions/findCoinbaseMPCWallet/findCoinbaseMPCWallet.cjs +0 -8
  262. package/src/lib/utils/functions/findCoinbaseMPCWallet/findCoinbaseMPCWallet.d.ts +0 -2
  263. package/src/lib/utils/functions/findCoinbaseMPCWallet/findCoinbaseMPCWallet.js +0 -4
  264. package/src/lib/utils/functions/findCoinbaseMPCWallet/index.d.ts +0 -1
  265. package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.cjs +0 -53
  266. package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.d.ts +0 -9
  267. package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/getCoinbaseMPCConnectorFetchers.js +0 -49
  268. package/src/lib/utils/functions/getCoinbaseMPCConnectorFetchers/index.d.ts +0 -1
  269. package/src/lib/utils/functions/isCoinbaseWaasEnabled/isCoinbaseWaasEnabled.cjs +0 -14
  270. package/src/lib/utils/functions/isCoinbaseWaasEnabled/isCoinbaseWaasEnabled.js +0 -10
  271. package/src/lib/utils/functions/requiresPasswordForEmbeddedWallet/index.d.ts +0 -1
  272. package/src/lib/utils/functions/requiresPasswordForEmbeddedWallet/requiresPasswordForEmbeddedWallet.cjs +0 -16
  273. package/src/lib/utils/functions/requiresPasswordForEmbeddedWallet/requiresPasswordForEmbeddedWallet.d.ts +0 -2
  274. package/src/lib/utils/functions/requiresPasswordForEmbeddedWallet/requiresPasswordForEmbeddedWallet.js +0 -12
  275. package/src/lib/utils/functions/requiresPasswordForEmbeddedWalletOnSignup/index.d.ts +0 -1
  276. package/src/lib/utils/functions/requiresPasswordForEmbeddedWalletOnSignup/requiresPasswordForEmbeddedWalletOnSignup.cjs +0 -39
  277. package/src/lib/utils/functions/requiresPasswordForEmbeddedWalletOnSignup/requiresPasswordForEmbeddedWalletOnSignup.d.ts +0 -2
  278. package/src/lib/utils/functions/requiresPasswordForEmbeddedWalletOnSignup/requiresPasswordForEmbeddedWalletOnSignup.js +0 -35
  279. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/index.d.ts +0 -2
  280. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/index.d.ts +0 -1
  281. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.cjs +0 -229
  282. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.d.ts +0 -5
  283. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.js +0 -225
  284. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useMPCEmbeddedWallet.cjs +0 -191
  285. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useMPCEmbeddedWallet.d.ts +0 -18
  286. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useMPCEmbeddedWallet.js +0 -187
  287. package/src/lib/utils/hooks/useEmbeddedWalletPassword/index.d.ts +0 -1
  288. package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.cjs +0 -141
  289. package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.d.ts +0 -4
  290. package/src/lib/utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.js +0 -137
  291. package/src/lib/utils/validations/validateMPCProviderEnabled/index.d.ts +0 -1
  292. package/src/lib/utils/validations/validateMPCProviderEnabled/validateMPCProviderEnabled.cjs +0 -18
  293. package/src/lib/utils/validations/validateMPCProviderEnabled/validateMPCProviderEnabled.d.ts +0 -2
  294. package/src/lib/utils/validations/validateMPCProviderEnabled/validateMPCProviderEnabled.js +0 -14
  295. package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.cjs +0 -116
  296. package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.d.ts +0 -2
  297. package/src/lib/views/CoinbaseMPCClaimIntro/CoinbaseMPCClaimIntro.js +0 -112
  298. package/src/lib/views/CoinbaseMPCClaimIntro/index.d.ts +0 -1
  299. package/src/lib/views/CreatePasswordView/CreatePasswordStep/CreatePasswordStep.cjs +0 -197
  300. package/src/lib/views/CreatePasswordView/CreatePasswordStep/CreatePasswordStep.d.ts +0 -12
  301. package/src/lib/views/CreatePasswordView/CreatePasswordStep/CreatePasswordStep.js +0 -193
  302. package/src/lib/views/CreatePasswordView/CreatePasswordStep/index.d.ts +0 -1
  303. package/src/lib/views/CreatePasswordView/CreatePasswordView.cjs +0 -169
  304. package/src/lib/views/CreatePasswordView/CreatePasswordView.d.ts +0 -9
  305. package/src/lib/views/CreatePasswordView/CreatePasswordView.js +0 -165
  306. package/src/lib/views/CreatePasswordView/SavePasswordStep/SavePasswordStep.cjs +0 -141
  307. package/src/lib/views/CreatePasswordView/SavePasswordStep/SavePasswordStep.d.ts +0 -12
  308. package/src/lib/views/CreatePasswordView/SavePasswordStep/SavePasswordStep.js +0 -137
  309. package/src/lib/views/CreatePasswordView/SavePasswordStep/index.d.ts +0 -1
  310. package/src/lib/views/CreatePasswordView/index.d.ts +0 -1
  311. package/src/lib/views/EnterPasswordView/EnterPasswordView.cjs +0 -141
  312. package/src/lib/views/EnterPasswordView/EnterPasswordView.d.ts +0 -8
  313. package/src/lib/views/EnterPasswordView/EnterPasswordView.js +0 -137
  314. package/src/lib/views/EnterPasswordView/index.d.ts +0 -1
@@ -1,165 +0,0 @@
1
- 'use client'
2
- import { __awaiter } from '../../../../_virtual/_tslib.js';
3
- import { jsx } from 'react/jsx-runtime';
4
- import { useState } from 'react';
5
- import { useTranslation } from 'react-i18next';
6
- import { isCoinbaseMpcWalletConnector } from '@dynamic-labs/wallet-connector-core';
7
- import '../../context/DynamicContext/DynamicContext.js';
8
- import '@dynamic-labs/sdk-api-core';
9
- import { logger } from '../../shared/logger.js';
10
- import '@dynamic-labs/iconic';
11
- import '../../context/ViewContext/ViewContext.js';
12
- import '@dynamic-labs/wallet-book';
13
- import '@dynamic-labs/utils';
14
- import '../../utils/constants/colors.js';
15
- import '../../utils/constants/values.js';
16
- import '../../shared/consts/index.js';
17
- import { dynamicEvents } from '../../events/dynamicEvents.js';
18
- import '../../context/CaptchaContext/CaptchaContext.js';
19
- import '../../context/ErrorContext/ErrorContext.js';
20
- import '@dynamic-labs/multi-wallet';
21
- import 'react-international-phone';
22
- import '../../store/state/nonce/nonce.js';
23
- import '../../store/state/projectSettings/projectSettings.js';
24
- import { findCoinbaseMPCWallet } from '../../utils/functions/findCoinbaseMPCWallet/findCoinbaseMPCWallet.js';
25
- import { requiresPasswordForEmbeddedWallet } from '../../utils/functions/requiresPasswordForEmbeddedWallet/requiresPasswordForEmbeddedWallet.js';
26
- import '../../config/ApiEndpoint.js';
27
- import '../../store/state/user/user.js';
28
- import '../../locale/locale.js';
29
- import '../../store/state/dynamicContextProps/dynamicContextProps.js';
30
- import '../../store/state/primaryWalletId/primaryWalletId.js';
31
- import '../../context/AccessDeniedContext/AccessDeniedContext.js';
32
- import '../../context/AccountExistsContext/AccountExistsContext.js';
33
- import '../../context/UserWalletsContext/UserWalletsContext.js';
34
- import '../../context/VerificationContext/VerificationContext.js';
35
- import 'react-dom';
36
- import '../../utils/functions/compareChains/compareChains.js';
37
- import '../../context/ThemeContext/ThemeContext.js';
38
- import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
39
- import 'bs58';
40
- import '@dynamic-labs/types';
41
- import '../../context/SocialRedirectContext/SocialRedirectContext.js';
42
- import '../../context/LoadingContext/LoadingContext.js';
43
- import '../../context/WalletContext/WalletContext.js';
44
- import '../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
45
- import { useEmbeddedWalletPassword } from '../../utils/hooks/useEmbeddedWalletPassword/useEmbeddedWalletPassword.js';
46
- import 'yup';
47
- import '../../context/MockContext/MockContext.js';
48
- import '../CollectUserDataView/useFields.js';
49
- import '../../context/FieldsStateContext/FieldsStateContext.js';
50
- import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
51
- import '@dynamic-labs/rpc-providers';
52
- import '../../store/state/loadingAndLifecycle.js';
53
- import '../../store/state/walletOptions/walletOptions.js';
54
- import '../../components/Accordion/components/AccordionItem/AccordionItem.js';
55
- import '../../components/Alert/Alert.js';
56
- import '../../components/ShadowDOM/ShadowDOM.js';
57
- import '../../components/IconButton/IconButton.js';
58
- import '../../components/InlineWidget/InlineWidget.js';
59
- import '../../components/Input/Input.js';
60
- import '../../components/IsBrowser/IsBrowser.js';
61
- import '../../components/MenuList/Dropdown/Dropdown.js';
62
- import '../../components/OverlayCard/OverlayCard.js';
63
- import '../../components/Transition/ZoomTransition/ZoomTransition.js';
64
- import '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
65
- import '../../components/Transition/OpacityTransition/OpacityTransition.js';
66
- import '../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
67
- import '../../components/Popper/Popper/Popper.js';
68
- import '../../components/Popper/PopperContext/PopperContext.js';
69
- import 'react-focus-lock';
70
- import 'qrcode';
71
- import 'formik';
72
- import '../../utils/hooks/useSubdomainCheck/useSubdomainCheck.js';
73
- import '../../context/WalletGroupContext/WalletGroupContext.js';
74
- import '../../context/IpConfigurationContext/IpConfigurationContext.js';
75
- import '../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
76
- import '../../context/ConnectWithOtpContext/constants.js';
77
- import '../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
78
- import '@hcaptcha/react-hcaptcha';
79
- import { CreatePasswordStep } from './CreatePasswordStep/CreatePasswordStep.js';
80
- import { SavePasswordStep } from './SavePasswordStep/SavePasswordStep.js';
81
- import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
82
- import '../../context/FooterAnimationContext/index.js';
83
- import '../../context/PasskeyContext/PasskeyContext.js';
84
- import '../../store/state/sendBalances.js';
85
- import '../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
86
- import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
87
- import '../TransactionConfirmationView/TransactionConfirmationView.js';
88
- import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
89
- import '../../context/OnrampContext/OnrampContext.js';
90
- import '../../widgets/DynamicWidget/views/ReceiveExternalWalletFunds/ReceiveExternalWalletFunds.js';
91
- import '../../../index.js';
92
- import '../../store/state/tokenBalances.js';
93
- import '../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
94
- import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
95
-
96
- const CreatePasswordView = ({ onSuccess, onError, closeView, notCalledFromWalletUtils, isSignUp, }) => {
97
- var _a;
98
- const { setShowAuthFlow, user, projectSettings, primaryWallet, handleLogOut: onLogout, walletConnectorOptions, } = useInternalDynamicContext();
99
- const { t } = useTranslation();
100
- const { claimWallet } = useEmbeddedWalletPassword();
101
- const [curStep, setCurStep] = useState('create-password');
102
- const cbVcWalletProperties = (_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials.find((vc) => vc.walletName === 'coinbasempc')) === null || _a === void 0 ? void 0 : _a.walletProperties;
103
- const isChangingPassword = Boolean(cbVcWalletProperties === null || cbVcWalletProperties === void 0 ? void 0 : cbVcWalletProperties.claimed);
104
- const closeViewOnCreate = closeView !== null && closeView !== void 0 ? closeView : true;
105
- const [currentPassword, setCurrentPassword] = useState('');
106
- const [password, setPassword] = useState('');
107
- const [isLoading, setIsLoading] = useState(false);
108
- const [error, setError] = useState('');
109
- const requiresPassword = requiresPasswordForEmbeddedWallet(projectSettings);
110
- const canClose = isChangingPassword || !requiresPassword;
111
- const handleCreatePassword = () => __awaiter(void 0, void 0, void 0, function* () {
112
- setCurStep('save-password');
113
- });
114
- const handleSavePassword = () => __awaiter(void 0, void 0, void 0, function* () {
115
- var _b, _c, _d;
116
- setIsLoading(true);
117
- try {
118
- if (!isSignUp) {
119
- const connector = (_d = (_b = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) !== null && _b !== void 0 ? _b : (_c = findCoinbaseMPCWallet(walletConnectorOptions)) === null || _c === void 0 ? void 0 : _c.walletConnector) !== null && _d !== void 0 ? _d : undefined;
120
- // notCalledFromWalletUtils = true means the user triggered password flow, not the connector
121
- if (notCalledFromWalletUtils &&
122
- isCoinbaseMpcWalletConnector(connector)) {
123
- yield connector.changePasscode(password, currentPassword);
124
- }
125
- if (!isChangingPassword) {
126
- // if creating password for the first time, set wallet as claimed
127
- yield claimWallet();
128
- }
129
- }
130
- onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(password);
131
- if (closeViewOnCreate) {
132
- setShowAuthFlow(false, { ignoreIfIsEmbeddedWidget: false });
133
- }
134
- dynamicEvents.emit('embeddedWalletCreatePasswordCompleted', password);
135
- }
136
- catch (e) {
137
- logger.debug(`Error ${isChangingPassword ? 'updating' : 'creating'} password`, e);
138
- dynamicEvents.emit('embeddedWalletCreatePasswordFailed', e);
139
- if (e instanceof Error) {
140
- setError(e.message);
141
- }
142
- onError === null || onError === void 0 ? void 0 : onError(e);
143
- }
144
- finally {
145
- setIsLoading(false);
146
- }
147
- });
148
- const handleClose = () => {
149
- if (requiresPassword) {
150
- const error = new Error(t('dyn_create_password.errors.user_closed_view'));
151
- onError === null || onError === void 0 ? void 0 : onError(error, true);
152
- dynamicEvents.emit('embeddedWalletCreatePasswordFailed', error);
153
- }
154
- setShowAuthFlow(false);
155
- };
156
- const handleLogout = (e) => {
157
- e === null || e === void 0 ? void 0 : e.preventDefault();
158
- const error = new Error(t('dyn_create_password.errors.user_closed_view'));
159
- onError === null || onError === void 0 ? void 0 : onError(error, true);
160
- onLogout();
161
- };
162
- return curStep === 'save-password' ? (jsx(SavePasswordStep, { password: password, onBack: () => setCurStep('create-password'), error: error, isLoading: isLoading, onSave: () => handleSavePassword(), onClose: canClose ? () => handleClose() : undefined, onLogout: !canClose ? handleLogout : undefined })) : (jsx(CreatePasswordStep, { password: password, setPassword: setPassword, currentPassword: currentPassword, setCurrentPassword: setCurrentPassword, onContinue: () => handleCreatePassword(), isChangingPassword: isChangingPassword, onClose: canClose ? () => handleClose() : undefined, onLogout: !canClose ? handleLogout : undefined }));
163
- };
164
-
165
- export { CreatePasswordView };
@@ -1,141 +0,0 @@
1
- 'use client'
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, '__esModule', { value: true });
5
-
6
- var _tslib = require('../../../../../_virtual/_tslib.cjs');
7
- var jsxRuntime = require('react/jsx-runtime');
8
- var React = require('react');
9
- var reactI18next = require('react-i18next');
10
- require('@dynamic-labs/utils');
11
- require('../../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
12
- require('../../../components/Alert/Alert.cjs');
13
- require('../../../events/dynamicEvents.cjs');
14
- require('../../../context/DynamicContext/DynamicContext.cjs');
15
- require('@dynamic-labs/sdk-api-core');
16
- require('../../../shared/logger.cjs');
17
- require('@dynamic-labs/iconic');
18
- require('@dynamic-labs/wallet-connector-core');
19
- var chevronLeft = require('../../../shared/assets/chevron-left.cjs');
20
- var close = require('../../../shared/assets/close.cjs');
21
- var copy = require('../../../shared/assets/copy.cjs');
22
- var download = require('../../../shared/assets/download.cjs');
23
- var savePasswordHero = require('../../../shared/assets/save-password-hero.cjs');
24
- require('../../../context/ViewContext/ViewContext.cjs');
25
- require('@dynamic-labs/wallet-book');
26
- require('../../../utils/constants/colors.cjs');
27
- require('../../../utils/constants/values.cjs');
28
- require('../../../shared/consts/index.cjs');
29
- require('../../../context/CaptchaContext/CaptchaContext.cjs');
30
- require('../../../context/ErrorContext/ErrorContext.cjs');
31
- require('@dynamic-labs/multi-wallet');
32
- require('react-international-phone');
33
- require('../../../store/state/nonce/nonce.cjs');
34
- require('../../../store/state/projectSettings/projectSettings.cjs');
35
- require('../../../config/ApiEndpoint.cjs');
36
- require('../../../store/state/user/user.cjs');
37
- require('../../../locale/locale.cjs');
38
- var downloadFile = require('../../../utils/functions/downloadFile/downloadFile.cjs');
39
- require('../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
40
- require('../../../store/state/primaryWalletId/primaryWalletId.cjs');
41
- require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
42
- require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
43
- require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
44
- require('../../../context/VerificationContext/VerificationContext.cjs');
45
- require('react-dom');
46
- require('../../../utils/functions/compareChains/compareChains.cjs');
47
- require('../../../context/ThemeContext/ThemeContext.cjs');
48
- require('../../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
49
- require('bs58');
50
- require('@dynamic-labs/types');
51
- require('../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
52
- require('../../../context/LoadingContext/LoadingContext.cjs');
53
- require('../../../context/WalletContext/WalletContext.cjs');
54
- require('../../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
55
- require('yup');
56
- require('../../../context/MockContext/MockContext.cjs');
57
- require('../../CollectUserDataView/useFields.cjs');
58
- require('../../../context/FieldsStateContext/FieldsStateContext.cjs');
59
- require('../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
60
- require('@dynamic-labs/rpc-providers');
61
- require('../../../store/state/loadingAndLifecycle.cjs');
62
- require('../../../store/state/walletOptions/walletOptions.cjs');
63
- var helpers = require('../../../widgets/DynamicWidget/helpers/helpers.cjs');
64
- var Typography = require('../../../components/Typography/Typography.cjs');
65
- require('../../../context/FooterAnimationContext/index.cjs');
66
- require('../../../components/ShadowDOM/ShadowDOM.cjs');
67
- require('../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
68
- require('../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
69
- require('../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
70
- require('../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
71
- require('../../../context/WalletGroupContext/WalletGroupContext.cjs');
72
- require('../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
73
- require('react-focus-lock');
74
- require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
75
- var IconButton = require('../../../components/IconButton/IconButton.cjs');
76
- require('../../../components/MenuList/Dropdown/Dropdown.cjs');
77
- var ErrorContainer = require('../../../components/ErrorContainer/ErrorContainer.cjs');
78
- var TypographyButton = require('../../../components/TypographyButton/TypographyButton.cjs');
79
- require('formik');
80
- require('../../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
81
- var ModalHeader = require('../../../components/ModalHeader/ModalHeader.cjs');
82
- require('../../../store/state/sendBalances.cjs');
83
- var Input = require('../../../components/Input/Input.cjs');
84
- require('../../../components/OverlayCard/OverlayCard.cjs');
85
- require('../../TransactionConfirmationView/TransactionConfirmationView.cjs');
86
- require('../../../context/PasskeyContext/PasskeyContext.cjs');
87
- require('../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
88
- var Badge = require('../../../components/Badge/Badge.cjs');
89
- require('../../../context/OnrampContext/OnrampContext.cjs');
90
- var TextButton = require('../../../components/TextButton/TextButton.cjs');
91
- require('qrcode');
92
- require('../../../widgets/DynamicWidget/views/ReceiveExternalWalletFunds/ReceiveExternalWalletFunds.cjs');
93
- require('../../../../index.cjs');
94
- require('../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
95
- require('../../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
96
- require('../../../context/ConnectWithOtpContext/constants.cjs');
97
- require('../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
98
- require('@hcaptcha/react-hcaptcha');
99
- var Checkbox = require('../../../components/Checkbox/Checkbox.cjs');
100
- require('../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
101
- require('../../../store/state/tokenBalances.cjs');
102
- require('../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
103
- require('../../../components/InlineWidget/InlineWidget.cjs');
104
- require('../../../components/IsBrowser/IsBrowser.cjs');
105
- require('../../../components/Popper/Popper/Popper.cjs');
106
- require('../../../components/Popper/PopperContext/PopperContext.cjs');
107
- var ToggleVisibilityButton = require('../../../components/ToggleVisibilityButton/ToggleVisibilityButton.cjs');
108
-
109
- const SavePasswordStep = ({ password, error, isLoading, onSave, onBack, onClose, onLogout, }) => {
110
- const { t } = reactI18next.useTranslation();
111
- const [inputType, setInputType] = React.useState('password');
112
- const [acknowledgement, setAcknowledgement] = React.useState(false);
113
- const [isCopied, setIsCopied] = React.useState(false);
114
- const backButton = (jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: () => onBack(), "data-testid": 'back-button', children: jsxRuntime.jsx(chevronLeft.ReactComponent, {}) }));
115
- const closeButton = onClose && (jsxRuntime.jsx(IconButton.IconButton, { onClick: () => onClose(), type: 'button', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
116
- const inputSuffix = (jsxRuntime.jsx(ToggleVisibilityButton.ToggleVisibilityButton, { initialState: inputType === 'password', onClick: (hidden) => setInputType(hidden ? 'password' : 'text'), className: 'save-password-suffix-icon' }));
117
- const handleSavePassword = (e) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
118
- e.preventDefault();
119
- onSave();
120
- });
121
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, trailing: closeButton, children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', copykey: 'dyn_save_password.title', children: t('dyn_save_password.title') }) }), jsxRuntime.jsx("div", { className: 'save-password-view', children: jsxRuntime.jsxs("form", { className: 'save-password-view__body', "data-testid": 'save-password-form', onSubmit: handleSavePassword, children: [jsxRuntime.jsx("div", { className: 'save-password-view__body__icon', children: jsxRuntime.jsx(savePasswordHero.ReactComponent, {}) }), jsxRuntime.jsx("div", { className: 'save-password-view__body__icon', children: jsxRuntime.jsx(Badge.Badge, { text: t('dyn_save_password.badge_text'), className: 'save-password-view__body__badge', copykey: 'dyn_save_password.badge_text' }) }), jsxRuntime.jsxs("div", { className: 'save-password-view__body__description', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_save_password.description', children: t('dyn_save_password.description') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', copykey: 'dyn_save_password.description', children: t('dyn_save_password.warning') })] }), error && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: error }), jsxRuntime.jsx("div", { children: jsxRuntime.jsx(Input.Input, { id: 'password', placeholder: t('dyn_save_password.password_input.placeholder'), type: inputType, suffix: inputSuffix, disabled: true, label: t('dyn_save_password.password_input.label'), value: password, autoFocus: true, copykey: 'dyn_save_password.password_input' }) }), jsxRuntime.jsxs("div", { className: 'save-password-view__actions', children: [jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'save-password-copy', buttonPadding: 'small', buttonVariant: 'primary', onClick: (e) => {
122
- e.preventDefault();
123
- helpers.copyToClipboard(password);
124
- setIsCopied(true);
125
- }, startSlot: jsxRuntime.jsx(copy.ReactComponent, {}), expanded: true, copykey: 'dyn_save_password.copy_button', children: isCopied
126
- ? t('dyn_save_password.copy_button.copied')
127
- : t('dyn_save_password.copy_button.copy') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'save-password-download', buttonPadding: 'small', buttonVariant: 'primary', onClick: (e) => {
128
- e.preventDefault();
129
- downloadFile.downloadFile('wallet-recovery.txt', password);
130
- }, startSlot: jsxRuntime.jsx(download.ReactComponent, {}), expanded: true, copykey: 'dyn_save_password.download_button', children: t('dyn_save_password.download_button') })] }), jsxRuntime.jsx("div", { className: 'save-password-view__body__confirm-card', children: jsxRuntime.jsxs("button", { className: 'save-password-view__body__card__acknowledgement', onClick: (e) => {
131
- e.stopPropagation();
132
- setAcknowledgement(!acknowledgement);
133
- }, type: 'button', children: [jsxRuntime.jsx("div", { children: jsxRuntime.jsx(Checkbox.Checkbox, { checked: acknowledgement, onChange: (e) => {
134
- e.stopPropagation();
135
- setAcknowledgement(!acknowledgement);
136
- }, className: 'save-password-view__body__card__statement__checkbox' }) }), jsxRuntime.jsx("div", { children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', style: { letterSpacing: '-0.15px' }, color: 'primary', copykey: 'dyn_save_password.checkbox_label', children: t('dyn_save_password.checkbox_label') }) })] }) }), jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'save-password-submit', buttonPadding: 'large', buttonVariant: 'brand-primary', typographyProps: {
137
- color: 'inherit',
138
- }, disabled: !acknowledgement, loading: isLoading, type: 'submit', copykey: 'dyn_save_password.continue', children: t('dyn_save_password.continue') }), onLogout && (jsxRuntime.jsx(TextButton.TextButton, { className: 'create-password__log-out', onClick: onLogout, copykey: 'dyn_save_password.logout', children: t('dyn_save_password.logout') }))] }) })] }));
139
- };
140
-
141
- exports.SavePasswordStep = SavePasswordStep;
@@ -1,12 +0,0 @@
1
- import { FC } from 'react';
2
- type SavePasswordStepProps = {
3
- password: string;
4
- onSave: () => Promise<void>;
5
- onBack: () => void;
6
- onClose?: () => void;
7
- onLogout?: (e?: React.MouseEvent<HTMLButtonElement>) => void;
8
- error?: string;
9
- isLoading?: boolean;
10
- };
11
- export declare const SavePasswordStep: FC<SavePasswordStepProps>;
12
- export {};
@@ -1,137 +0,0 @@
1
- 'use client'
2
- import { __awaiter } from '../../../../../_virtual/_tslib.js';
3
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
- import { useState } from 'react';
5
- import { useTranslation } from 'react-i18next';
6
- import '@dynamic-labs/utils';
7
- import '../../../components/Accordion/components/AccordionItem/AccordionItem.js';
8
- import '../../../components/Alert/Alert.js';
9
- import '../../../events/dynamicEvents.js';
10
- import '../../../context/DynamicContext/DynamicContext.js';
11
- import '@dynamic-labs/sdk-api-core';
12
- import '../../../shared/logger.js';
13
- import '@dynamic-labs/iconic';
14
- import '@dynamic-labs/wallet-connector-core';
15
- import { ReactComponent as SvgChevronLeft } from '../../../shared/assets/chevron-left.js';
16
- import { ReactComponent as SvgClose } from '../../../shared/assets/close.js';
17
- import { ReactComponent as SvgCopy } from '../../../shared/assets/copy.js';
18
- import { ReactComponent as SvgDownload } from '../../../shared/assets/download.js';
19
- import { ReactComponent as SvgSavePasswordHero } from '../../../shared/assets/save-password-hero.js';
20
- import '../../../context/ViewContext/ViewContext.js';
21
- import '@dynamic-labs/wallet-book';
22
- import '../../../utils/constants/colors.js';
23
- import '../../../utils/constants/values.js';
24
- import '../../../shared/consts/index.js';
25
- import '../../../context/CaptchaContext/CaptchaContext.js';
26
- import '../../../context/ErrorContext/ErrorContext.js';
27
- import '@dynamic-labs/multi-wallet';
28
- import 'react-international-phone';
29
- import '../../../store/state/nonce/nonce.js';
30
- import '../../../store/state/projectSettings/projectSettings.js';
31
- import '../../../config/ApiEndpoint.js';
32
- import '../../../store/state/user/user.js';
33
- import '../../../locale/locale.js';
34
- import { downloadFile } from '../../../utils/functions/downloadFile/downloadFile.js';
35
- import '../../../store/state/dynamicContextProps/dynamicContextProps.js';
36
- import '../../../store/state/primaryWalletId/primaryWalletId.js';
37
- import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
38
- import '../../../context/AccountExistsContext/AccountExistsContext.js';
39
- import '../../../context/UserWalletsContext/UserWalletsContext.js';
40
- import '../../../context/VerificationContext/VerificationContext.js';
41
- import 'react-dom';
42
- import '../../../utils/functions/compareChains/compareChains.js';
43
- import '../../../context/ThemeContext/ThemeContext.js';
44
- import '../../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
45
- import 'bs58';
46
- import '@dynamic-labs/types';
47
- import '../../../context/SocialRedirectContext/SocialRedirectContext.js';
48
- import '../../../context/LoadingContext/LoadingContext.js';
49
- import '../../../context/WalletContext/WalletContext.js';
50
- import '../../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.js';
51
- import 'yup';
52
- import '../../../context/MockContext/MockContext.js';
53
- import '../../CollectUserDataView/useFields.js';
54
- import '../../../context/FieldsStateContext/FieldsStateContext.js';
55
- import '../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
56
- import '@dynamic-labs/rpc-providers';
57
- import '../../../store/state/loadingAndLifecycle.js';
58
- import '../../../store/state/walletOptions/walletOptions.js';
59
- import { copyToClipboard } from '../../../widgets/DynamicWidget/helpers/helpers.js';
60
- import { Typography } from '../../../components/Typography/Typography.js';
61
- import '../../../context/FooterAnimationContext/index.js';
62
- import '../../../components/ShadowDOM/ShadowDOM.js';
63
- import '../../../components/Transition/ZoomTransition/ZoomTransition.js';
64
- import '../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
65
- import '../../../components/Transition/OpacityTransition/OpacityTransition.js';
66
- import '../../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.js';
67
- import '../../../context/WalletGroupContext/WalletGroupContext.js';
68
- import '../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
69
- import 'react-focus-lock';
70
- import '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
71
- import { IconButton } from '../../../components/IconButton/IconButton.js';
72
- import '../../../components/MenuList/Dropdown/Dropdown.js';
73
- import { ErrorContainer } from '../../../components/ErrorContainer/ErrorContainer.js';
74
- import { TypographyButton } from '../../../components/TypographyButton/TypographyButton.js';
75
- import 'formik';
76
- import '../../../utils/hooks/useSubdomainCheck/useSubdomainCheck.js';
77
- import { ModalHeader } from '../../../components/ModalHeader/ModalHeader.js';
78
- import '../../../store/state/sendBalances.js';
79
- import { Input } from '../../../components/Input/Input.js';
80
- import '../../../components/OverlayCard/OverlayCard.js';
81
- import '../../TransactionConfirmationView/TransactionConfirmationView.js';
82
- import '../../../context/PasskeyContext/PasskeyContext.js';
83
- import '../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
84
- import { Badge } from '../../../components/Badge/Badge.js';
85
- import '../../../context/OnrampContext/OnrampContext.js';
86
- import { TextButton } from '../../../components/TextButton/TextButton.js';
87
- import 'qrcode';
88
- import '../../../widgets/DynamicWidget/views/ReceiveExternalWalletFunds/ReceiveExternalWalletFunds.js';
89
- import '../../../../index.js';
90
- import '../../../context/IpConfigurationContext/IpConfigurationContext.js';
91
- import '../../../context/ConnectWithOtpContext/ConnectWithOtpContext.js';
92
- import '../../../context/ConnectWithOtpContext/constants.js';
93
- import '../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
94
- import '@hcaptcha/react-hcaptcha';
95
- import { Checkbox } from '../../../components/Checkbox/Checkbox.js';
96
- import '../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
97
- import '../../../store/state/tokenBalances.js';
98
- import '../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
99
- import '../../../components/InlineWidget/InlineWidget.js';
100
- import '../../../components/IsBrowser/IsBrowser.js';
101
- import '../../../components/Popper/Popper/Popper.js';
102
- import '../../../components/Popper/PopperContext/PopperContext.js';
103
- import { ToggleVisibilityButton } from '../../../components/ToggleVisibilityButton/ToggleVisibilityButton.js';
104
-
105
- const SavePasswordStep = ({ password, error, isLoading, onSave, onBack, onClose, onLogout, }) => {
106
- const { t } = useTranslation();
107
- const [inputType, setInputType] = useState('password');
108
- const [acknowledgement, setAcknowledgement] = useState(false);
109
- const [isCopied, setIsCopied] = useState(false);
110
- const backButton = (jsx(IconButton, { type: 'button', onClick: () => onBack(), "data-testid": 'back-button', children: jsx(SvgChevronLeft, {}) }));
111
- const closeButton = onClose && (jsx(IconButton, { onClick: () => onClose(), type: 'button', children: jsx(SvgClose, {}) }));
112
- const inputSuffix = (jsx(ToggleVisibilityButton, { initialState: inputType === 'password', onClick: (hidden) => setInputType(hidden ? 'password' : 'text'), className: 'save-password-suffix-icon' }));
113
- const handleSavePassword = (e) => __awaiter(void 0, void 0, void 0, function* () {
114
- e.preventDefault();
115
- onSave();
116
- });
117
- return (jsxs(Fragment, { children: [jsx(ModalHeader, { leading: backButton, trailing: closeButton, children: jsx(Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', copykey: 'dyn_save_password.title', children: t('dyn_save_password.title') }) }), jsx("div", { className: 'save-password-view', children: jsxs("form", { className: 'save-password-view__body', "data-testid": 'save-password-form', onSubmit: handleSavePassword, children: [jsx("div", { className: 'save-password-view__body__icon', children: jsx(SvgSavePasswordHero, {}) }), jsx("div", { className: 'save-password-view__body__icon', children: jsx(Badge, { text: t('dyn_save_password.badge_text'), className: 'save-password-view__body__badge', copykey: 'dyn_save_password.badge_text' }) }), jsxs("div", { className: 'save-password-view__body__description', children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_save_password.description', children: t('dyn_save_password.description') }), jsx(Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', copykey: 'dyn_save_password.description', children: t('dyn_save_password.warning') })] }), error && jsx(ErrorContainer, { children: error }), jsx("div", { children: jsx(Input, { id: 'password', placeholder: t('dyn_save_password.password_input.placeholder'), type: inputType, suffix: inputSuffix, disabled: true, label: t('dyn_save_password.password_input.label'), value: password, autoFocus: true, copykey: 'dyn_save_password.password_input' }) }), jsxs("div", { className: 'save-password-view__actions', children: [jsx(TypographyButton, { dataTestId: 'save-password-copy', buttonPadding: 'small', buttonVariant: 'primary', onClick: (e) => {
118
- e.preventDefault();
119
- copyToClipboard(password);
120
- setIsCopied(true);
121
- }, startSlot: jsx(SvgCopy, {}), expanded: true, copykey: 'dyn_save_password.copy_button', children: isCopied
122
- ? t('dyn_save_password.copy_button.copied')
123
- : t('dyn_save_password.copy_button.copy') }), jsx(TypographyButton, { dataTestId: 'save-password-download', buttonPadding: 'small', buttonVariant: 'primary', onClick: (e) => {
124
- e.preventDefault();
125
- downloadFile('wallet-recovery.txt', password);
126
- }, startSlot: jsx(SvgDownload, {}), expanded: true, copykey: 'dyn_save_password.download_button', children: t('dyn_save_password.download_button') })] }), jsx("div", { className: 'save-password-view__body__confirm-card', children: jsxs("button", { className: 'save-password-view__body__card__acknowledgement', onClick: (e) => {
127
- e.stopPropagation();
128
- setAcknowledgement(!acknowledgement);
129
- }, type: 'button', children: [jsx("div", { children: jsx(Checkbox, { checked: acknowledgement, onChange: (e) => {
130
- e.stopPropagation();
131
- setAcknowledgement(!acknowledgement);
132
- }, className: 'save-password-view__body__card__statement__checkbox' }) }), jsx("div", { children: jsx(Typography, { variant: 'body_normal', style: { letterSpacing: '-0.15px' }, color: 'primary', copykey: 'dyn_save_password.checkbox_label', children: t('dyn_save_password.checkbox_label') }) })] }) }), jsx(TypographyButton, { dataTestId: 'save-password-submit', buttonPadding: 'large', buttonVariant: 'brand-primary', typographyProps: {
133
- color: 'inherit',
134
- }, disabled: !acknowledgement, loading: isLoading, type: 'submit', copykey: 'dyn_save_password.continue', children: t('dyn_save_password.continue') }), onLogout && (jsx(TextButton, { className: 'create-password__log-out', onClick: onLogout, copykey: 'dyn_save_password.logout', children: t('dyn_save_password.logout') }))] }) })] }));
135
- };
136
-
137
- export { SavePasswordStep };
@@ -1 +0,0 @@
1
- export { SavePasswordStep } from './SavePasswordStep';
@@ -1 +0,0 @@
1
- export { CreatePasswordView } from './CreatePasswordView';
@@ -1,141 +0,0 @@
1
- 'use client'
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, '__esModule', { value: true });
5
-
6
- var jsxRuntime = require('react/jsx-runtime');
7
- var React = require('react');
8
- var reactI18next = require('react-i18next');
9
- require('@dynamic-labs/utils');
10
- require('../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
11
- require('../../components/Alert/Alert.cjs');
12
- require('../../events/dynamicEvents.cjs');
13
- require('../../../../_virtual/_tslib.cjs');
14
- require('../../context/DynamicContext/DynamicContext.cjs');
15
- require('@dynamic-labs/sdk-api-core');
16
- require('../../shared/logger.cjs');
17
- require('@dynamic-labs/iconic');
18
- require('@dynamic-labs/wallet-connector-core');
19
- var close = require('../../shared/assets/close.cjs');
20
- var passwordHero = require('../../shared/assets/password-hero.cjs');
21
- require('../../context/ViewContext/ViewContext.cjs');
22
- require('@dynamic-labs/wallet-book');
23
- require('../../utils/constants/colors.cjs');
24
- require('../../utils/constants/values.cjs');
25
- require('../../shared/consts/index.cjs');
26
- var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
27
- require('../../context/CaptchaContext/CaptchaContext.cjs');
28
- require('../../context/ErrorContext/ErrorContext.cjs');
29
- require('@dynamic-labs/multi-wallet');
30
- require('react-international-phone');
31
- require('../../store/state/nonce/nonce.cjs');
32
- require('../../store/state/projectSettings/projectSettings.cjs');
33
- require('../../config/ApiEndpoint.cjs');
34
- require('../../store/state/user/user.cjs');
35
- require('../../locale/locale.cjs');
36
- require('../../store/state/dynamicContextProps/dynamicContextProps.cjs');
37
- require('../../store/state/primaryWalletId/primaryWalletId.cjs');
38
- require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
39
- require('../../context/AccountExistsContext/AccountExistsContext.cjs');
40
- require('../../context/UserWalletsContext/UserWalletsContext.cjs');
41
- require('../../context/VerificationContext/VerificationContext.cjs');
42
- require('react-dom');
43
- require('../../utils/functions/compareChains/compareChains.cjs');
44
- require('../../context/ThemeContext/ThemeContext.cjs');
45
- require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
46
- var useMutation = require('../../utils/hooks/useMutation/useMutation.cjs');
47
- require('bs58');
48
- require('@dynamic-labs/types');
49
- require('../../context/SocialRedirectContext/SocialRedirectContext.cjs');
50
- require('../../context/LoadingContext/LoadingContext.cjs');
51
- require('../../context/WalletContext/WalletContext.cjs');
52
- require('../../utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/constants.cjs');
53
- require('yup');
54
- require('../../context/MockContext/MockContext.cjs');
55
- require('../CollectUserDataView/useFields.cjs');
56
- require('../../context/FieldsStateContext/FieldsStateContext.cjs');
57
- require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
58
- require('@dynamic-labs/rpc-providers');
59
- require('../../store/state/loadingAndLifecycle.cjs');
60
- require('../../store/state/walletOptions/walletOptions.cjs');
61
- var Typography = require('../../components/Typography/Typography.cjs');
62
- require('../../context/FooterAnimationContext/index.cjs');
63
- require('../../components/ShadowDOM/ShadowDOM.cjs');
64
- require('../../components/Transition/ZoomTransition/ZoomTransition.cjs');
65
- require('../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
66
- require('../../components/Transition/OpacityTransition/OpacityTransition.cjs');
67
- require('../../components/OverlayCardBase/OverlayCardTarget/OverlayCardTarget.cjs');
68
- require('../../context/WalletGroupContext/WalletGroupContext.cjs');
69
- require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
70
- require('react-focus-lock');
71
- require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
72
- var IconButton = require('../../components/IconButton/IconButton.cjs');
73
- require('../../components/MenuList/Dropdown/Dropdown.cjs');
74
- var ErrorContainer = require('../../components/ErrorContainer/ErrorContainer.cjs');
75
- var TypographyButton = require('../../components/TypographyButton/TypographyButton.cjs');
76
- require('formik');
77
- require('../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
78
- var ModalHeader = require('../../components/ModalHeader/ModalHeader.cjs');
79
- require('../../store/state/sendBalances.cjs');
80
- var Input = require('../../components/Input/Input.cjs');
81
- require('../../components/OverlayCard/OverlayCard.cjs');
82
- require('../TransactionConfirmationView/TransactionConfirmationView.cjs');
83
- require('../../context/PasskeyContext/PasskeyContext.cjs');
84
- require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
85
- require('../../context/OnrampContext/OnrampContext.cjs');
86
- require('qrcode');
87
- require('../../widgets/DynamicWidget/views/ReceiveExternalWalletFunds/ReceiveExternalWalletFunds.cjs');
88
- require('../../../index.cjs');
89
- require('../../context/IpConfigurationContext/IpConfigurationContext.cjs');
90
- require('../../context/ConnectWithOtpContext/ConnectWithOtpContext.cjs');
91
- require('../../context/ConnectWithOtpContext/constants.cjs');
92
- require('../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
93
- require('@hcaptcha/react-hcaptcha');
94
- require('../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
95
- require('../../store/state/tokenBalances.cjs');
96
- require('../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
97
- require('../../components/InlineWidget/InlineWidget.cjs');
98
- require('../../components/IsBrowser/IsBrowser.cjs');
99
- require('../../components/Popper/Popper/Popper.cjs');
100
- require('../../components/Popper/PopperContext/PopperContext.cjs');
101
- var ToggleVisibilityButton = require('../../components/ToggleVisibilityButton/ToggleVisibilityButton.cjs');
102
-
103
- const EnterPasswordView = ({ mutation, onSuccess, onError, closeView = true, }) => {
104
- const { setShowAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
105
- const [password, setPassword] = React.useState('');
106
- const [inputType, setInputType] = React.useState('password');
107
- const { t } = reactI18next.useTranslation();
108
- const { mutate: handlePasswordSubmit, isLoading, hasError, } = useMutation.useMutation(() => mutation(password), {
109
- onFailure: onError,
110
- onSuccess: () => {
111
- if (closeView) {
112
- setShowAuthFlow(false);
113
- }
114
- onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(password);
115
- },
116
- });
117
- const onClose = () => {
118
- if (onError) {
119
- onError === null || onError === void 0 ? void 0 : onError(t('dyn_enter_password.error.invalid_password'));
120
- return;
121
- }
122
- setShowAuthFlow(false);
123
- };
124
- const errorMessage = hasError
125
- ? t('dyn_enter_password.error.invalid_password')
126
- : undefined;
127
- const closeButton = (jsxRuntime.jsx(IconButton.IconButton, { onClick: onClose, type: 'button', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
128
- const inputSuffix = (jsxRuntime.jsx(ToggleVisibilityButton.ToggleVisibilityButton, { initialState: inputType === 'password', onClick: (hidden) => setInputType(hidden ? 'password' : 'text'), className: 'enter-password-view__password-input__suffix-icon' }));
129
- const onPasswordInputChange = (e) => {
130
- const newPassword = e.target.value;
131
- setPassword(newPassword);
132
- };
133
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { trailing: closeButton, children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', className: 'header__typography', copykey: 'dyn_enter_password.title', children: t('dyn_enter_password.title') }) }), jsxRuntime.jsx("div", { className: 'enter-password-view', children: jsxRuntime.jsxs("form", { className: 'enter-password-view__body', onSubmit: (e) => {
134
- e.preventDefault();
135
- handlePasswordSubmit();
136
- }, children: [jsxRuntime.jsx("div", { className: 'enter-password-view__body__icon', children: jsxRuntime.jsx(passwordHero.ReactComponent, {}) }), jsxRuntime.jsx("div", { className: 'enter-password-view__body__description', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_enter_password.description', children: t('dyn_enter_password.description') }) }), Boolean(errorMessage) && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { copykey: 'dyn_enter_password.error', children: errorMessage })), jsxRuntime.jsx("div", { children: jsxRuntime.jsx(Input.Input, { id: 'password', placeholder: t('dyn_enter_password.input.placeholder'), type: inputType, suffix: inputSuffix, label: t('dyn_enter_password.input.label'), value: password, onChange: onPasswordInputChange, copykey: 'dyn_enter_password.input' }) }), jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonPadding: 'large', buttonVariant: 'brand-primary', typographyProps: {
137
- color: 'inherit',
138
- }, disabled: !password && !errorMessage, loading: isLoading, copykey: 'dyn_enter_password.continue_button_label', type: 'submit', children: t('dyn_enter_password.continue_button_label') })] }) })] }));
139
- };
140
-
141
- exports.EnterPasswordView = EnterPasswordView;