@dynamic-labs/sdk-react-core 3.0.0-alpha.32 → 3.0.0-alpha.33

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 (96) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +12 -12
  5. package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +2 -2
  6. package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +2 -2
  7. package/src/lib/components/SyncAuthFlow/SyncAuthFlow.cjs +2 -0
  8. package/src/lib/components/SyncAuthFlow/SyncAuthFlow.js +2 -0
  9. package/src/lib/context/DynamicContext/DynamicContext.cjs +17 -11
  10. package/src/lib/context/DynamicContext/DynamicContext.js +17 -11
  11. package/src/lib/context/DynamicContext/types/IDynamicContext.d.ts +1 -2
  12. package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.cjs +2 -2
  13. package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.d.ts +1 -1
  14. package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.js +2 -2
  15. package/src/lib/context/PhantomRedirectContext/useResponseHandlers.cjs +3 -3
  16. package/src/lib/context/PhantomRedirectContext/useResponseHandlers.js +3 -3
  17. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +5 -6
  18. package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +5 -6
  19. package/src/lib/data/api/embeddedWallets/embeddedWallets.cjs +1 -1
  20. package/src/lib/data/api/embeddedWallets/embeddedWallets.js +2 -2
  21. package/src/lib/data/api/embeddedWallets/types.d.ts +2 -2
  22. package/src/lib/data/api/externalAuth/externalAuth.cjs +20 -0
  23. package/src/lib/data/api/externalAuth/externalAuth.d.ts +4 -0
  24. package/src/lib/data/api/externalAuth/externalAuth.js +20 -1
  25. package/src/lib/events/auth.d.ts +12 -0
  26. package/src/lib/shared/utils/functions/hasPendingMfaAction/hasPendingMfaAction.cjs +14 -0
  27. package/src/lib/shared/utils/functions/hasPendingMfaAction/hasPendingMfaAction.d.ts +2 -0
  28. package/src/lib/shared/utils/functions/hasPendingMfaAction/hasPendingMfaAction.js +10 -0
  29. package/src/lib/shared/utils/functions/hasPendingMfaAction/index.d.ts +1 -0
  30. package/src/lib/shared/utils/functions/index.d.ts +1 -0
  31. package/src/lib/store/hooks/useUser/useUser.cjs +24 -6
  32. package/src/lib/store/hooks/useUser/useUser.d.ts +6 -3
  33. package/src/lib/store/hooks/useUser/useUser.js +24 -6
  34. package/src/lib/utils/functions/walletListBuilder/walletListBuilder.cjs +1 -1
  35. package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +1 -1
  36. package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.cjs +3 -3
  37. package/src/lib/utils/hooks/authenticationHooks/useOtpVerificationRequest/useOtpVerificationRequest.js +3 -3
  38. package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.cjs +2 -0
  39. package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.d.ts +1 -1
  40. package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.js +2 -0
  41. package/src/lib/utils/hooks/index.d.ts +2 -0
  42. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.cjs +2 -1
  43. package/src/lib/utils/hooks/multiWallet/useSyncPrimaryWallet/useSyncPrimaryWallet.js +2 -1
  44. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +3 -1
  45. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.d.ts +2 -2
  46. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +4 -2
  47. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +2 -2
  48. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.d.ts +2 -2
  49. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +2 -2
  50. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.cjs +1 -1
  51. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.d.ts +2 -2
  52. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.js +2 -2
  53. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useMPCEmbeddedWallet.d.ts +3 -3
  54. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useSecureEnclaveEmbeddedWallet.d.ts +2 -2
  55. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.d.ts +2 -2
  56. package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.cjs +30 -1
  57. package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.d.ts +1 -0
  58. package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.js +31 -2
  59. package/src/lib/utils/hooks/useMfa/useMfa.cjs +8 -28
  60. package/src/lib/utils/hooks/useMfa/useMfa.d.ts +1 -7
  61. package/src/lib/utils/hooks/useMfa/useMfa.js +8 -28
  62. package/src/lib/utils/hooks/useResetCookieLocalStorage/index.d.ts +1 -0
  63. package/src/lib/utils/hooks/useResetCookieLocalStorage/useResetCookieLocalStorage.cjs +143 -0
  64. package/src/lib/utils/hooks/useResetCookieLocalStorage/useResetCookieLocalStorage.d.ts +8 -0
  65. package/src/lib/utils/hooks/useResetCookieLocalStorage/useResetCookieLocalStorage.js +139 -0
  66. package/src/lib/utils/hooks/useSyncMfaFlow/index.d.ts +1 -0
  67. package/src/lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.cjs +152 -0
  68. package/src/lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.d.ts +4 -0
  69. package/src/lib/utils/hooks/useSyncMfaFlow/useSyncMfaFlow.js +148 -0
  70. package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.cjs +9 -7
  71. package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.js +9 -7
  72. package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +8 -14
  73. package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +8 -14
  74. package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs +3 -3
  75. package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js +3 -3
  76. package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +4 -4
  77. package/src/lib/views/CollectUserDataView/CollectUserDataView.js +4 -4
  78. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.cjs +3 -3
  79. package/src/lib/views/CollectUserDataView/OnboardingUserDataForm/OnboardingUserDataForm.js +3 -3
  80. package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.cjs +3 -3
  81. package/src/lib/views/CollectUserDataViewNoWallet/CollectUserDataViewNoWallet.js +3 -3
  82. package/src/lib/views/EmailVerification/EmailVerification.cjs +4 -4
  83. package/src/lib/views/EmailVerification/EmailVerification.js +4 -4
  84. package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +2 -2
  85. package/src/lib/views/MfaVerificationView/MfaVerificationView.js +2 -2
  86. package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.cjs +2 -2
  87. package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.d.ts +2 -2
  88. package/src/lib/views/Passkey/PasskeyIntroView/PasskeyIntroView.js +2 -2
  89. package/src/lib/views/Passkey/utils/createEmbeddedWalletRequest/createEmbeddedWalletRequest.d.ts +2 -2
  90. package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.cjs +3 -3
  91. package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.js +3 -3
  92. package/src/lib/views/viewToComponentMap.d.ts +1 -1
  93. package/src/lib/context/DynamicContext/hooks/useIsAuthenticated/index.d.ts +0 -1
  94. package/src/lib/context/DynamicContext/hooks/useIsAuthenticated/useIsAuthenticated.cjs +0 -8
  95. package/src/lib/context/DynamicContext/hooks/useIsAuthenticated/useIsAuthenticated.d.ts +0 -2
  96. package/src/lib/context/DynamicContext/hooks/useIsAuthenticated/useIsAuthenticated.js +0 -4
@@ -88,7 +88,7 @@ import '../../../../context/ReinitializeContext/ReinitializeContextProvider.js';
88
88
  import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
89
89
 
90
90
  const useUpdateUser = (validationSchemaStripUnknown) => {
91
- const { environmentId, unauthenticatedUser, setCallback } = useInternalDynamicContext();
91
+ const { environmentId, userWithMissingInfo, setCallback } = useInternalDynamicContext();
92
92
  const { setRetryData } = useVerification();
93
93
  const { selectedPhoneCountry } = useFieldsState();
94
94
  const handleVerificationRequired = useHandleVerificationRequired();
@@ -99,7 +99,7 @@ const useUpdateUser = (validationSchemaStripUnknown) => {
99
99
  let { metadata } = userFields;
100
100
  // when a user has already logged in but a custom field was added to env, in order to not clear the old fields
101
101
  metadata = metadata
102
- ? Object.assign(Object.assign({}, unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.metadata), metadata) : unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.metadata;
102
+ ? Object.assign(Object.assign({}, userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.metadata), metadata) : userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.metadata;
103
103
  // we dont add user.metadata from edit profile because it is already in the metadata request for updateUser
104
104
  const validatedUserFields = yield userFieldsSchema.validate(userFields, {
105
105
  stripUnknown: validationSchemaStripUnknown,
@@ -132,7 +132,7 @@ const useUpdateUser = (validationSchemaStripUnknown) => {
132
132
  updateUserProfileResponse,
133
133
  };
134
134
  }), [
135
- unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.metadata,
135
+ userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.metadata,
136
136
  validationSchemaStripUnknown,
137
137
  selectedPhoneCountry,
138
138
  setRetryData,
@@ -103,19 +103,19 @@ require('qrcode');
103
103
 
104
104
  const CollectUserDataView = () => {
105
105
  var _a;
106
- const { appName, projectSettings, network, selectedWalletConnector: walletConnector, handleLogOut, onboardingImageUrl, unauthenticatedUser, } = useInternalDynamicContext.useInternalDynamicContext();
106
+ const { appName, projectSettings, network, selectedWalletConnector: walletConnector, handleLogOut, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext.useInternalDynamicContext();
107
107
  const [isNetworkPickerOpen, setIsNetworkPickerOpen] = React.useState(false);
108
108
  const nameService = useFetchNameService.useFetchNameService();
109
109
  const { t } = reactI18next.useTranslation();
110
- if (!walletConnector || !unauthenticatedUser) {
110
+ if (!walletConnector || !userWithMissingInfo) {
111
111
  return null;
112
112
  }
113
113
  const evmNetworks = walletConnector.evmNetworks || [];
114
114
  const _isSupportedNetwork = !network || isSupportedNetwork.isSupportedNetwork({ network, walletConnector });
115
- const walletAddress = (_a = unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.verifiedCredentials.find((verifiedCredential) => verifiedCredential.id === unauthenticatedUser.lastVerifiedCredentialId)) === null || _a === void 0 ? void 0 : _a.address;
115
+ const walletAddress = (_a = userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.verifiedCredentials.find((verifiedCredential) => verifiedCredential.id === userWithMissingInfo.lastVerifiedCredentialId)) === null || _a === void 0 ? void 0 : _a.address;
116
116
  return (jsxRuntime.jsxs("div", { className: 'collect-user-data', "data-testid": 'collect-user-data-view', children: [jsxRuntime.jsxs("div", { className: 'collect-user-data__network-container', children: [jsxRuntime.jsxs("div", { className: 'collect-user-data__img-container', children: [(nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsxRuntime.jsx("img", { src: nameService.avatar, alt: '', className: 'collect-user-data__img collect-user-data__img--rounded' })) : (jsxRuntime.jsx(AuthProviderIcon.AuthProviderIcon, { iconSize: 28 })), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data__wallet-address', children: (nameService === null || nameService === void 0 ? void 0 : nameService.name) || shortenWalletAddress.shortenWalletAddress(walletAddress, 3, 3) })] }), jsxRuntime.jsx(NetworkPicker.NetworkPicker, { currentNetwork: network, evmNetworks: evmNetworks, connector: walletConnector, showNetworkName: true, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, buttonClassName: 'collect-user-data__network-picker-button', mainClassName: 'collect-user-data__network-picker' })] }), onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'collect-user-data__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { withIcon: false, className: 'collect-user-data__error--not-supported', copykey: 'dyn_collect_user_data.not_supported_network.error_message', children: t('dyn_collect_user_data.not_supported_network.error_message') })), jsxRuntime.jsxs("div", { className: classNames.classNames('collect-user-data__form', {
117
117
  'collect-user-data__form--error': !_isSupportedNetwork,
118
- }), children: [jsxRuntime.jsx("div", { className: 'collect-user-data__success-icon', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-primary', size: 'large', children: jsxRuntime.jsx(checkConnection.ReactComponent, {}) }) }), jsxRuntime.jsx(OnboardingUserDataForm.OnboardingUserDataForm, { disableSubmit: !_isSupportedNetwork, userProfile: unauthenticatedUser, children: !_isSupportedNetwork ? (jsxRuntime.jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.not_supported_network.title', children: t('dyn_collect_user_data.not_supported_network.title') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.not_supported_network.description', children: t('dyn_collect_user_data.not_supported_network.description') })] })) : (jsxRuntime.jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
118
+ }), children: [jsxRuntime.jsx("div", { className: 'collect-user-data__success-icon', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-primary', size: 'large', children: jsxRuntime.jsx(checkConnection.ReactComponent, {}) }) }), jsxRuntime.jsx(OnboardingUserDataForm.OnboardingUserDataForm, { disableSubmit: !_isSupportedNetwork, userProfile: userWithMissingInfo, children: !_isSupportedNetwork ? (jsxRuntime.jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.not_supported_network.title', children: t('dyn_collect_user_data.not_supported_network.title') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.not_supported_network.description', children: t('dyn_collect_user_data.not_supported_network.description') })] })) : (jsxRuntime.jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
119
119
  t('dyn_collect_user_data.greeting', { appName }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.description', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
120
120
  t('dyn_collect_user_data.description') })] })) }), jsxRuntime.jsx(TextButton.TextButton, { className: 'collect-user-data__log-out', onClick: handleLogOut, copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
121
121
  };
@@ -99,19 +99,19 @@ import 'qrcode';
99
99
 
100
100
  const CollectUserDataView = () => {
101
101
  var _a;
102
- const { appName, projectSettings, network, selectedWalletConnector: walletConnector, handleLogOut, onboardingImageUrl, unauthenticatedUser, } = useInternalDynamicContext();
102
+ const { appName, projectSettings, network, selectedWalletConnector: walletConnector, handleLogOut, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext();
103
103
  const [isNetworkPickerOpen, setIsNetworkPickerOpen] = useState(false);
104
104
  const nameService = useFetchNameService();
105
105
  const { t } = useTranslation();
106
- if (!walletConnector || !unauthenticatedUser) {
106
+ if (!walletConnector || !userWithMissingInfo) {
107
107
  return null;
108
108
  }
109
109
  const evmNetworks = walletConnector.evmNetworks || [];
110
110
  const _isSupportedNetwork = !network || isSupportedNetwork({ network, walletConnector });
111
- const walletAddress = (_a = unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.verifiedCredentials.find((verifiedCredential) => verifiedCredential.id === unauthenticatedUser.lastVerifiedCredentialId)) === null || _a === void 0 ? void 0 : _a.address;
111
+ const walletAddress = (_a = userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.verifiedCredentials.find((verifiedCredential) => verifiedCredential.id === userWithMissingInfo.lastVerifiedCredentialId)) === null || _a === void 0 ? void 0 : _a.address;
112
112
  return (jsxs("div", { className: 'collect-user-data', "data-testid": 'collect-user-data-view', children: [jsxs("div", { className: 'collect-user-data__network-container', children: [jsxs("div", { className: 'collect-user-data__img-container', children: [(nameService === null || nameService === void 0 ? void 0 : nameService.avatar) ? (jsx("img", { src: nameService.avatar, alt: '', className: 'collect-user-data__img collect-user-data__img--rounded' })) : (jsx(AuthProviderIcon, { iconSize: 28 })), jsx(Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data__wallet-address', children: (nameService === null || nameService === void 0 ? void 0 : nameService.name) || shortenWalletAddress(walletAddress, 3, 3) })] }), jsx(NetworkPicker, { currentNetwork: network, evmNetworks: evmNetworks, connector: walletConnector, showNetworkName: true, isNetworkPickerOpen: isNetworkPickerOpen, setIsNetworkPickerOpen: setIsNetworkPickerOpen, buttonClassName: 'collect-user-data__network-picker-button', mainClassName: 'collect-user-data__network-picker' })] }), onboardingImageUrl && (jsx("img", { className: 'collect-user-data__main-img', src: onboardingImageUrl, alt: 'onboarding' })), !_isSupportedNetwork && (jsx(ErrorContainer, { withIcon: false, className: 'collect-user-data__error--not-supported', copykey: 'dyn_collect_user_data.not_supported_network.error_message', children: t('dyn_collect_user_data.not_supported_network.error_message') })), jsxs("div", { className: classNames('collect-user-data__form', {
113
113
  'collect-user-data__form--error': !_isSupportedNetwork,
114
- }), children: [jsx("div", { className: 'collect-user-data__success-icon', children: jsx(Icon, { color: 'text-primary', size: 'large', children: jsx(SvgCheckConnection, {}) }) }), jsx(OnboardingUserDataForm, { disableSubmit: !_isSupportedNetwork, userProfile: unauthenticatedUser, children: !_isSupportedNetwork ? (jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.not_supported_network.title', children: t('dyn_collect_user_data.not_supported_network.title') }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.not_supported_network.description', children: t('dyn_collect_user_data.not_supported_network.description') })] })) : (jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
114
+ }), children: [jsx("div", { className: 'collect-user-data__success-icon', children: jsx(Icon, { color: 'text-primary', size: 'large', children: jsx(SvgCheckConnection, {}) }) }), jsx(OnboardingUserDataForm, { disableSubmit: !_isSupportedNetwork, userProfile: userWithMissingInfo, children: !_isSupportedNetwork ? (jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.not_supported_network.title', children: t('dyn_collect_user_data.not_supported_network.title') }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.not_supported_network.description', children: t('dyn_collect_user_data.not_supported_network.description') })] })) : (jsxs("div", { className: 'collect-user-data__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
115
115
  t('dyn_collect_user_data.greeting', { appName }) }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.description', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
116
116
  t('dyn_collect_user_data.description') })] })) }), jsx(TextButton, { className: 'collect-user-data__log-out', onClick: handleLogOut, copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
117
117
  };
@@ -95,7 +95,7 @@ require('../../../components/InlineWidget/InlineWidget.cjs');
95
95
  require('qrcode');
96
96
 
97
97
  const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
98
- const { policiesConsentInnerComponent, unauthenticatedUser } = useInternalDynamicContext.useInternalDynamicContext();
98
+ const { policiesConsentInnerComponent, userWithMissingInfo } = useInternalDynamicContext.useInternalDynamicContext();
99
99
  const { error } = ErrorContext.useErrorContext();
100
100
  const { completeAuth } = useUserAuth.useUserAuth({});
101
101
  const { updateUser } = useUserUpdateRequest.useUserUpdateRequestInternal({
@@ -107,7 +107,7 @@ const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
107
107
  });
108
108
  }), [completeAuth, updateUser]);
109
109
  const { fetch: loading, formikInitialValues, formikValidationSchema, enforcePolicies, onFormSubmit, } = useUserDataForm.useUserDataForm({
110
- fields: (unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.missingFields) || [],
110
+ fields: (userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.missingFields) || [],
111
111
  onSubmit,
112
112
  userProfile,
113
113
  });
@@ -120,7 +120,7 @@ const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
120
120
  (enforcePolicies &&
121
121
  (policiesConsentInnerComponentArray === null || policiesConsentInnerComponentArray === void 0 ? void 0 : policiesConsentInnerComponentArray.length) !==
122
122
  ((_a = values.policiesConsentArray) === null || _a === void 0 ? void 0 : _a.length));
123
- return (jsxRuntime.jsx(formik.Form, { className: 'user-data-form__form', children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [children, error && (jsxRuntime.jsx(Alert.Alert, { icon: 'error', variant: 'error', className: 'user-data-form__error', children: error })), jsxRuntime.jsx(UserDataFields.UserDataFields, { fields: unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.missingFields, errors: errors, touched: touched, policiesConsentInnerComponentArray: policiesConsentInnerComponentArray }), jsxRuntime.jsx(TypographyButton.TypographyButton, { type: 'submit', loading: loading, disabled: isSubmitBtnDisabled, buttonVariant: 'primary', expanded: true, buttonPadding: 'login-screen-height', children: "Continue" })] }) }));
123
+ return (jsxRuntime.jsx(formik.Form, { className: 'user-data-form__form', children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [children, error && (jsxRuntime.jsx(Alert.Alert, { icon: 'error', variant: 'error', className: 'user-data-form__error', children: error })), jsxRuntime.jsx(UserDataFields.UserDataFields, { fields: userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.missingFields, errors: errors, touched: touched, policiesConsentInnerComponentArray: policiesConsentInnerComponentArray }), jsxRuntime.jsx(TypographyButton.TypographyButton, { type: 'submit', loading: loading, disabled: isSubmitBtnDisabled, buttonVariant: 'primary', expanded: true, buttonPadding: 'login-screen-height', children: "Continue" })] }) }));
124
124
  } }));
125
125
  };
126
126
 
@@ -91,7 +91,7 @@ import '../../../components/InlineWidget/InlineWidget.js';
91
91
  import 'qrcode';
92
92
 
93
93
  const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
94
- const { policiesConsentInnerComponent, unauthenticatedUser } = useInternalDynamicContext();
94
+ const { policiesConsentInnerComponent, userWithMissingInfo } = useInternalDynamicContext();
95
95
  const { error } = useErrorContext();
96
96
  const { completeAuth } = useUserAuth({});
97
97
  const { updateUser } = useUserUpdateRequestInternal({
@@ -103,7 +103,7 @@ const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
103
103
  });
104
104
  }), [completeAuth, updateUser]);
105
105
  const { fetch: loading, formikInitialValues, formikValidationSchema, enforcePolicies, onFormSubmit, } = useUserDataForm({
106
- fields: (unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.missingFields) || [],
106
+ fields: (userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.missingFields) || [],
107
107
  onSubmit,
108
108
  userProfile,
109
109
  });
@@ -116,7 +116,7 @@ const OnboardingUserDataForm = ({ children, userProfile, disableSubmit, }) => {
116
116
  (enforcePolicies &&
117
117
  (policiesConsentInnerComponentArray === null || policiesConsentInnerComponentArray === void 0 ? void 0 : policiesConsentInnerComponentArray.length) !==
118
118
  ((_a = values.policiesConsentArray) === null || _a === void 0 ? void 0 : _a.length));
119
- return (jsx(Form, { className: 'user-data-form__form', children: jsxs(Fragment, { children: [children, error && (jsx(Alert, { icon: 'error', variant: 'error', className: 'user-data-form__error', children: error })), jsx(UserDataFields, { fields: unauthenticatedUser === null || unauthenticatedUser === void 0 ? void 0 : unauthenticatedUser.missingFields, errors: errors, touched: touched, policiesConsentInnerComponentArray: policiesConsentInnerComponentArray }), jsx(TypographyButton, { type: 'submit', loading: loading, disabled: isSubmitBtnDisabled, buttonVariant: 'primary', expanded: true, buttonPadding: 'login-screen-height', children: "Continue" })] }) }));
119
+ return (jsx(Form, { className: 'user-data-form__form', children: jsxs(Fragment, { children: [children, error && (jsx(Alert, { icon: 'error', variant: 'error', className: 'user-data-form__error', children: error })), jsx(UserDataFields, { fields: userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.missingFields, errors: errors, touched: touched, policiesConsentInnerComponentArray: policiesConsentInnerComponentArray }), jsx(TypographyButton, { type: 'submit', loading: loading, disabled: isSubmitBtnDisabled, buttonVariant: 'primary', expanded: true, buttonPadding: 'login-screen-height', children: "Continue" })] }) }));
120
120
  } }));
121
121
  };
122
122
 
@@ -98,12 +98,12 @@ require('qrcode');
98
98
 
99
99
  const CollectUserDataViewNoWallet = ({ userIdentification, userIdentificationOverride }) => {
100
100
  var _a;
101
- const { appName, handleLogOut, projectSettings, onboardingImageUrl, unauthenticatedUser, } = useInternalDynamicContext.useInternalDynamicContext();
101
+ const { appName, handleLogOut, projectSettings, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext.useInternalDynamicContext();
102
102
  const { t } = reactI18next.useTranslation();
103
- if (!unauthenticatedUser) {
103
+ if (!userWithMissingInfo) {
104
104
  return null;
105
105
  }
106
- return (jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet', "data-testid": 'collect-user-data-login-no-wallet', children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'collect-user-data-login-no-wallet__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__user-info-container', children: [jsxRuntime.jsx("div", { className: 'collect-user-data-login-no-wallet__icon-container', children: jsxRuntime.jsx(UserAvatar.UserAvatar, { user: unauthenticatedUser }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data-login-no-wallet__user-identification', children: (_a = userIdentificationOverride !== null && userIdentificationOverride !== void 0 ? userIdentificationOverride : unauthenticatedUser[userIdentification]) !== null && _a !== void 0 ? _a : getUserIdentifier.getUserIdentifier(unauthenticatedUser) })] }), jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__form', children: [jsxRuntime.jsx("div", { className: 'collect-user-data-login-no-wallet__success-icon', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-primary', size: 'large', children: jsxRuntime.jsx(checkConnection.ReactComponent, {}) }) }), jsxRuntime.jsx(OnboardingUserDataForm.OnboardingUserDataForm, { userProfile: unauthenticatedUser, children: jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data-login-no-wallet__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
106
+ return (jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet', "data-testid": 'collect-user-data-login-no-wallet', children: [onboardingImageUrl && (jsxRuntime.jsx("img", { className: 'collect-user-data-login-no-wallet__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__user-info-container', children: [jsxRuntime.jsx("div", { className: 'collect-user-data-login-no-wallet__icon-container', children: jsxRuntime.jsx(UserAvatar.UserAvatar, { user: userWithMissingInfo }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data-login-no-wallet__user-identification', children: (_a = userIdentificationOverride !== null && userIdentificationOverride !== void 0 ? userIdentificationOverride : userWithMissingInfo[userIdentification]) !== null && _a !== void 0 ? _a : getUserIdentifier.getUserIdentifier(userWithMissingInfo) })] }), jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__form', children: [jsxRuntime.jsx("div", { className: 'collect-user-data-login-no-wallet__success-icon', children: jsxRuntime.jsx(Icon.Icon, { color: 'text-primary', size: 'large', children: jsxRuntime.jsx(checkConnection.ReactComponent, {}) }) }), jsxRuntime.jsx(OnboardingUserDataForm.OnboardingUserDataForm, { userProfile: userWithMissingInfo, children: jsxRuntime.jsxs("div", { className: 'collect-user-data-login-no-wallet__welcome-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'title', color: 'primary', className: 'collect-user-data-login-no-wallet__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
107
107
  t('dyn_collect_user_data.greeting', { appName }) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.description', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
108
108
  t('dyn_collect_user_data.description') })] }) }), jsxRuntime.jsx(TextButton.TextButton, { className: 'collect-user-data-login-no-wallet__log-out', onClick: handleLogOut, copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
109
109
  };
@@ -94,12 +94,12 @@ import 'qrcode';
94
94
 
95
95
  const CollectUserDataViewNoWallet = ({ userIdentification, userIdentificationOverride }) => {
96
96
  var _a;
97
- const { appName, handleLogOut, projectSettings, onboardingImageUrl, unauthenticatedUser, } = useInternalDynamicContext();
97
+ const { appName, handleLogOut, projectSettings, onboardingImageUrl, userWithMissingInfo, } = useInternalDynamicContext();
98
98
  const { t } = useTranslation();
99
- if (!unauthenticatedUser) {
99
+ if (!userWithMissingInfo) {
100
100
  return null;
101
101
  }
102
- return (jsxs("div", { className: 'collect-user-data-login-no-wallet', "data-testid": 'collect-user-data-login-no-wallet', children: [onboardingImageUrl && (jsx("img", { className: 'collect-user-data-login-no-wallet__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxs("div", { className: 'collect-user-data-login-no-wallet__user-info-container', children: [jsx("div", { className: 'collect-user-data-login-no-wallet__icon-container', children: jsx(UserAvatar, { user: unauthenticatedUser }) }), jsx(Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data-login-no-wallet__user-identification', children: (_a = userIdentificationOverride !== null && userIdentificationOverride !== void 0 ? userIdentificationOverride : unauthenticatedUser[userIdentification]) !== null && _a !== void 0 ? _a : getUserIdentifier(unauthenticatedUser) })] }), jsxs("div", { className: 'collect-user-data-login-no-wallet__form', children: [jsx("div", { className: 'collect-user-data-login-no-wallet__success-icon', children: jsx(Icon, { color: 'text-primary', size: 'large', children: jsx(SvgCheckConnection, {}) }) }), jsx(OnboardingUserDataForm, { userProfile: unauthenticatedUser, children: jsxs("div", { className: 'collect-user-data-login-no-wallet__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data-login-no-wallet__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
102
+ return (jsxs("div", { className: 'collect-user-data-login-no-wallet', "data-testid": 'collect-user-data-login-no-wallet', children: [onboardingImageUrl && (jsx("img", { className: 'collect-user-data-login-no-wallet__main-img', src: onboardingImageUrl, alt: 'onboarding' })), jsxs("div", { className: 'collect-user-data-login-no-wallet__user-info-container', children: [jsx("div", { className: 'collect-user-data-login-no-wallet__icon-container', children: jsx(UserAvatar, { user: userWithMissingInfo }) }), jsx(Typography, { variant: 'body_normal', color: 'primary', weight: 'medium', className: 'collect-user-data-login-no-wallet__user-identification', children: (_a = userIdentificationOverride !== null && userIdentificationOverride !== void 0 ? userIdentificationOverride : userWithMissingInfo[userIdentification]) !== null && _a !== void 0 ? _a : getUserIdentifier(userWithMissingInfo) })] }), jsxs("div", { className: 'collect-user-data-login-no-wallet__form', children: [jsx("div", { className: 'collect-user-data-login-no-wallet__success-icon', children: jsx(Icon, { color: 'text-primary', size: 'large', children: jsx(SvgCheckConnection, {}) }) }), jsx(OnboardingUserDataForm, { userProfile: userWithMissingInfo, children: jsxs("div", { className: 'collect-user-data-login-no-wallet__welcome-container', children: [jsx(Typography, { variant: 'title', color: 'primary', className: 'collect-user-data-login-no-wallet__welcome-title', copykey: 'dyn_collect_user_data.greeting', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeHeader) ||
103
103
  t('dyn_collect_user_data.greeting', { appName }) }), jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_collect_user_data.description', children: (projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.collectUserDataWelcomeMessage) ||
104
104
  t('dyn_collect_user_data.description') })] }) }), jsx(TextButton, { className: 'collect-user-data-login-no-wallet__log-out', onClick: handleLogOut, copykey: 'dyn_collect_user_data.log_out_button', children: t('dyn_collect_user_data.log_out_button') })] })] }));
105
105
  };
@@ -114,7 +114,7 @@ require('qrcode');
114
114
  const SECONDS_TO_RETRY = 15;
115
115
  const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _showRetryButton = true, showTransferMessage: _showTransferMessage = false, }) => {
116
116
  var _a, _b, _c, _d;
117
- const { environmentId, handleLogOut, setPrimaryWalletId, setShowAuthFlow, projectSettings, user, unauthenticatedUser, walletConnectorOptions, walletConnector, } = useInternalDynamicContext.useInternalDynamicContext();
117
+ const { environmentId, handleLogOut, setPrimaryWalletId, setShowAuthFlow, projectSettings, user, userWithMissingInfo, walletConnectorOptions, walletConnector, } = useInternalDynamicContext.useInternalDynamicContext();
118
118
  const { setView, goToInitialView } = ViewContext.useViewContext();
119
119
  const { error, setError, setErrorMessage } = ErrorContext.useErrorContext();
120
120
  const { loading, setLoading } = LoadingContext.useLoadingContext();
@@ -236,7 +236,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
236
236
  if (!verificationUUID) {
237
237
  return cancelAuth();
238
238
  }
239
- if (!user && !unauthenticatedUser) {
239
+ if (!user && !userWithMissingInfo) {
240
240
  return initAuth({
241
241
  onVerifySuccess: () => setIsValidated(true),
242
242
  options: { email: email$1 },
@@ -263,7 +263,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
263
263
  setLoading,
264
264
  verificationUUID,
265
265
  user,
266
- unauthenticatedUser,
266
+ userWithMissingInfo,
267
267
  completeAuth,
268
268
  email$1,
269
269
  isEmailRecoveryFlow,
@@ -307,7 +307,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
307
307
  }, []);
308
308
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [error && (jsxRuntime.jsx(ErrorContainer.ErrorContainer, { withIcon: false, className: 'email-verification__error-message', children: error })), jsxRuntime.jsxs("div", { className: classNames.classNames('email-verification__container', {
309
309
  'email-verification__container--error': Boolean(error),
310
- }), children: [showTransferMessage && (jsxRuntime.jsx("div", { className: 'email-verification__transfer-message', copykey: 'dyn_otp_verification.email.complete', children: t('dyn_otp_verification.email.complete') })), isValidated ? (jsxRuntime.jsx("div", { className: 'email-verification__icon-container', children: jsxRuntime.jsx(IconWithStatus.IconWithStatus, { containerClassName: 'email-verification__icon--verified', Icon: EmailIcon, iconSize: 64, InnerIcon: check.ReactComponent }) })) : (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: EmailIcon, iconSize: 96, isSpinning: true, className: 'email-verification__icon-with-spinner' })), jsxRuntime.jsxs("div", { className: 'email-verification__copy-text-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail.shortenEmail(email$1) })] }), jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).join('.').split('.'), isLoading: loading, handleComplete: handleEmailVerification, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), showRetryButton && (jsxRuntime.jsx(RetrySendVerificationCodeSection.RetrySendVerificationCodeSection, { className: 'email-verification__retry-container', retryHandler: handleRetry, secondsToRetry: SECONDS_TO_RETRY })), (user || unauthenticatedUser) && !isEmailRecoveryFlow && (jsxRuntime.jsx(TextButton.TextButton, { className: 'email-verification__log-out', onClick: handleLogOut, copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') }))] })] }));
310
+ }), children: [showTransferMessage && (jsxRuntime.jsx("div", { className: 'email-verification__transfer-message', copykey: 'dyn_otp_verification.email.complete', children: t('dyn_otp_verification.email.complete') })), isValidated ? (jsxRuntime.jsx("div", { className: 'email-verification__icon-container', children: jsxRuntime.jsx(IconWithStatus.IconWithStatus, { containerClassName: 'email-verification__icon--verified', Icon: EmailIcon, iconSize: 64, InnerIcon: check.ReactComponent }) })) : (jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: EmailIcon, iconSize: 96, isSpinning: true, className: 'email-verification__icon-with-spinner' })), jsxRuntime.jsxs("div", { className: 'email-verification__copy-text-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail.shortenEmail(email$1) })] }), jsxRuntime.jsx(PinField.PinField, { initialValue: Array(6).join('.').split('.'), isLoading: loading, handleComplete: handleEmailVerification, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), showRetryButton && (jsxRuntime.jsx(RetrySendVerificationCodeSection.RetrySendVerificationCodeSection, { className: 'email-verification__retry-container', retryHandler: handleRetry, secondsToRetry: SECONDS_TO_RETRY })), (user || userWithMissingInfo) && !isEmailRecoveryFlow && (jsxRuntime.jsx(TextButton.TextButton, { className: 'email-verification__log-out', onClick: handleLogOut, copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') }))] })] }));
311
311
  };
312
312
 
313
313
  exports.EmailVerification = EmailVerification;
@@ -110,7 +110,7 @@ import 'qrcode';
110
110
  const SECONDS_TO_RETRY = 15;
111
111
  const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _showRetryButton = true, showTransferMessage: _showTransferMessage = false, }) => {
112
112
  var _a, _b, _c, _d;
113
- const { environmentId, handleLogOut, setPrimaryWalletId, setShowAuthFlow, projectSettings, user, unauthenticatedUser, walletConnectorOptions, walletConnector, } = useInternalDynamicContext();
113
+ const { environmentId, handleLogOut, setPrimaryWalletId, setShowAuthFlow, projectSettings, user, userWithMissingInfo, walletConnectorOptions, walletConnector, } = useInternalDynamicContext();
114
114
  const { setView, goToInitialView } = useViewContext();
115
115
  const { error, setError, setErrorMessage } = useErrorContext();
116
116
  const { loading, setLoading } = useLoadingContext();
@@ -232,7 +232,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
232
232
  if (!verificationUUID) {
233
233
  return cancelAuth();
234
234
  }
235
- if (!user && !unauthenticatedUser) {
235
+ if (!user && !userWithMissingInfo) {
236
236
  return initAuth({
237
237
  onVerifySuccess: () => setIsValidated(true),
238
238
  options: { email },
@@ -259,7 +259,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
259
259
  setLoading,
260
260
  verificationUUID,
261
261
  user,
262
- unauthenticatedUser,
262
+ userWithMissingInfo,
263
263
  completeAuth,
264
264
  email,
265
265
  isEmailRecoveryFlow,
@@ -303,7 +303,7 @@ const EmailVerification = ({ isEmailRecoveryFlow = false, showRetryButton: _show
303
303
  }, []);
304
304
  return (jsxs(Fragment, { children: [error && (jsx(ErrorContainer, { withIcon: false, className: 'email-verification__error-message', children: error })), jsxs("div", { className: classNames('email-verification__container', {
305
305
  'email-verification__container--error': Boolean(error),
306
- }), children: [showTransferMessage && (jsx("div", { className: 'email-verification__transfer-message', copykey: 'dyn_otp_verification.email.complete', children: t('dyn_otp_verification.email.complete') })), isValidated ? (jsx("div", { className: 'email-verification__icon-container', children: jsx(IconWithStatus, { containerClassName: 'email-verification__icon--verified', Icon: EmailIcon, iconSize: 64, InnerIcon: SvgCheck }) })) : (jsx(IconWithSpinner, { Icon: EmailIcon, iconSize: 96, isSpinning: true, className: 'email-verification__icon-with-spinner' })), jsxs("div", { className: 'email-verification__copy-text-container', children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsx(Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail(email) })] }), jsx(PinField, { initialValue: Array(6).join('.').split('.'), isLoading: loading, handleComplete: handleEmailVerification, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), showRetryButton && (jsx(RetrySendVerificationCodeSection, { className: 'email-verification__retry-container', retryHandler: handleRetry, secondsToRetry: SECONDS_TO_RETRY })), (user || unauthenticatedUser) && !isEmailRecoveryFlow && (jsx(TextButton, { className: 'email-verification__log-out', onClick: handleLogOut, copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') }))] })] }));
306
+ }), children: [showTransferMessage && (jsx("div", { className: 'email-verification__transfer-message', copykey: 'dyn_otp_verification.email.complete', children: t('dyn_otp_verification.email.complete') })), isValidated ? (jsx("div", { className: 'email-verification__icon-container', children: jsx(IconWithStatus, { containerClassName: 'email-verification__icon--verified', Icon: EmailIcon, iconSize: 64, InnerIcon: SvgCheck }) })) : (jsx(IconWithSpinner, { Icon: EmailIcon, iconSize: 96, isSpinning: true, className: 'email-verification__icon-with-spinner' })), jsxs("div", { className: 'email-verification__copy-text-container', children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', copykey: 'dyn_otp_verification.description', children: t('dyn_otp_verification.description') }), jsx(Typography, { variant: 'body_normal', weight: 'bold', color: 'secondary', children: shortenEmail(email) })] }), jsx(PinField, { initialValue: Array(6).join('.').split('.'), isLoading: loading, handleComplete: handleEmailVerification, isValidated: isValidated, inputMode: 'numeric', pattern: '[0-9]*', hasError: Boolean(error), onChange: () => setError(undefined) }), showRetryButton && (jsx(RetrySendVerificationCodeSection, { className: 'email-verification__retry-container', retryHandler: handleRetry, secondsToRetry: SECONDS_TO_RETRY })), (user || userWithMissingInfo) && !isEmailRecoveryFlow && (jsx(TextButton, { className: 'email-verification__log-out', onClick: handleLogOut, copykey: 'dyn_otp_verification.log_out_button', children: t('dyn_otp_verification.log_out_button') }))] })] }));
307
307
  };
308
308
 
309
309
  export { EmailVerification };
@@ -95,7 +95,7 @@ require('../../context/ReinitializeContext/ReinitializeContextProvider.cjs');
95
95
 
96
96
  const MfaVerificationView = ({ type }) => {
97
97
  const { t } = reactI18next.useTranslation();
98
- const { user } = useDynamicContext.useDynamicContext();
98
+ const { userWithMissingInfo } = useDynamicContext.useDynamicContext();
99
99
  const { setView } = ViewContext.useViewContext();
100
100
  const { authDevice } = useMfa.useMfa();
101
101
  const [code, setCode] = React.useState('');
@@ -107,7 +107,7 @@ const MfaVerificationView = ({ type }) => {
107
107
  setError(new utils.DynamicError(t('dyn_mfa.otp_verification_view.error')));
108
108
  },
109
109
  onResolve: () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
110
- if ((user === null || user === void 0 ? void 0 : user.mfaBackupCodeAcknowledgement) !==
110
+ if ((userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.mfaBackupCodeAcknowledgement) !==
111
111
  sdkApiCore.MfaBackupCodeAcknowledgement.Complete) {
112
112
  setView('mfa-display-backup-codes');
113
113
  }
@@ -91,7 +91,7 @@ import '../../context/ReinitializeContext/ReinitializeContextProvider.js';
91
91
 
92
92
  const MfaVerificationView = ({ type }) => {
93
93
  const { t } = useTranslation();
94
- const { user } = useDynamicContext();
94
+ const { userWithMissingInfo } = useDynamicContext();
95
95
  const { setView } = useViewContext();
96
96
  const { authDevice } = useMfa();
97
97
  const [code, setCode] = useState('');
@@ -103,7 +103,7 @@ const MfaVerificationView = ({ type }) => {
103
103
  setError(new DynamicError(t('dyn_mfa.otp_verification_view.error')));
104
104
  },
105
105
  onResolve: () => __awaiter(void 0, void 0, void 0, function* () {
106
- if ((user === null || user === void 0 ? void 0 : user.mfaBackupCodeAcknowledgement) !==
106
+ if ((userWithMissingInfo === null || userWithMissingInfo === void 0 ? void 0 : userWithMissingInfo.mfaBackupCodeAcknowledgement) !==
107
107
  MfaBackupCodeAcknowledgement.Complete) {
108
108
  setView('mfa-display-backup-codes');
109
109
  }
@@ -103,7 +103,7 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useDyna
103
103
 
104
104
  const PasskeyIntroView = ({ chains }) => {
105
105
  var _a;
106
- const { walletConnectorOptions, environmentId, handleLogOut, user, unauthenticatedUser, } = useInternalDynamicContext.useInternalDynamicContext();
106
+ const { walletConnectorOptions, environmentId, handleLogOut, user, userWithMissingInfo, } = useInternalDynamicContext.useInternalDynamicContext();
107
107
  const isEmailRecoveryFlow = ((_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
108
108
  !getUserVerifiedCredentialType.getUserVerifiedCredentialType(user, sdkApiCore.JwtVerifiedCredentialFormatEnum.Email);
109
109
  const { t } = reactI18next.useTranslation();
@@ -116,7 +116,7 @@ const PasskeyIntroView = ({ chains }) => {
116
116
  React.useEffect(() => localStorage.LocalStorage.removeFromLS(localStorage$1.LAST_USED_WALLET), []);
117
117
  const { createDynamicEmbeddedWalletMutation, isLoading, error } = useCreateDynamicEmbeddedWalletMutation.useCreateDynamicEmbeddedWalletMutation();
118
118
  const handleCreateEmbeddedWallet = (withAuthenticator) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
119
- if (!user && !unauthenticatedUser) {
119
+ if (!user && !userWithMissingInfo) {
120
120
  throw new Error('User is not logged in');
121
121
  }
122
122
  setCreateWalletWithAuthenticator(withAuthenticator);
@@ -1,7 +1,7 @@
1
1
  import { FC } from 'react';
2
- import { ChainEnum } from '@dynamic-labs/sdk-api-core';
2
+ import { EmbeddedWalletChainEnum } from '@dynamic-labs/sdk-api-core';
3
3
  type PasskeyIntroViewProps = {
4
- chains?: ChainEnum[];
4
+ chains?: EmbeddedWalletChainEnum[];
5
5
  };
6
6
  export declare const PasskeyIntroView: FC<PasskeyIntroViewProps>;
7
7
  export {};
@@ -99,7 +99,7 @@ import { useInternalDynamicContext } from '../../../context/DynamicContext/useDy
99
99
 
100
100
  const PasskeyIntroView = ({ chains }) => {
101
101
  var _a;
102
- const { walletConnectorOptions, environmentId, handleLogOut, user, unauthenticatedUser, } = useInternalDynamicContext();
102
+ const { walletConnectorOptions, environmentId, handleLogOut, user, userWithMissingInfo, } = useInternalDynamicContext();
103
103
  const isEmailRecoveryFlow = ((_a = user === null || user === void 0 ? void 0 : user.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
104
104
  !getUserVerifiedCredentialType(user, JwtVerifiedCredentialFormatEnum.Email);
105
105
  const { t } = useTranslation();
@@ -112,7 +112,7 @@ const PasskeyIntroView = ({ chains }) => {
112
112
  useEffect(() => LocalStorage.removeFromLS(LAST_USED_WALLET), []);
113
113
  const { createDynamicEmbeddedWalletMutation, isLoading, error } = useCreateDynamicEmbeddedWalletMutation();
114
114
  const handleCreateEmbeddedWallet = (withAuthenticator) => __awaiter(void 0, void 0, void 0, function* () {
115
- if (!user && !unauthenticatedUser) {
115
+ if (!user && !userWithMissingInfo) {
116
116
  throw new Error('User is not logged in');
117
117
  }
118
118
  setCreateWalletWithAuthenticator(withAuthenticator);
@@ -1,11 +1,11 @@
1
- import { ChainEnum } from '@dynamic-labs/sdk-api-core';
1
+ import { EmbeddedWalletChainEnum } from '@dynamic-labs/sdk-api-core';
2
2
  import { UserProfile } from '@dynamic-labs/types';
3
3
  import { IEmailWalletConnector, IPasskeyWalletConnector, WebAuthnAttestation } from '@dynamic-labs/wallet-connector-core';
4
4
  type CreateEmbeddedWalletRequestProps = {
5
5
  environmentId: string;
6
6
  user: UserProfile | undefined;
7
7
  walletConnector: (IPasskeyWalletConnector & IEmailWalletConnector) | undefined;
8
- chains: ChainEnum[];
8
+ chains: EmbeddedWalletChainEnum[];
9
9
  webAuthnAttestation?: WebAuthnAttestation;
10
10
  withAuthenticator: boolean;
11
11
  };
@@ -96,7 +96,7 @@ var useInternalDynamicContext = require('../../../context/DynamicContext/useDyna
96
96
 
97
97
  const useSmsVerification = (type) => {
98
98
  const { verificationUUID, displayedDestination: formattedPhone, retryData, } = VerificationContext.useVerification();
99
- const { environmentId, user, unauthenticatedUser } = useInternalDynamicContext.useInternalDynamicContext();
99
+ const { environmentId, user, userWithMissingInfo } = useInternalDynamicContext.useInternalDynamicContext();
100
100
  const [error, setError] = React.useState();
101
101
  const { verifyOtp } = useOtpVerificationRequest.useOtpVerificationRequest();
102
102
  const { initAuth, completeAuth, cancelAuth } = useUserAuth.useUserAuth({
@@ -134,7 +134,7 @@ const useSmsVerification = (type) => {
134
134
  });
135
135
  });
136
136
  const submitOtpForVerification = React.useCallback((verificationToken) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
137
- if (!verificationUUID || (!user && !unauthenticatedUser)) {
137
+ if (!verificationUUID || (!user && !userWithMissingInfo)) {
138
138
  yield cancelAuth();
139
139
  return;
140
140
  }
@@ -146,7 +146,7 @@ const useSmsVerification = (type) => {
146
146
  cancelAuth,
147
147
  completeAuth,
148
148
  user,
149
- unauthenticatedUser,
149
+ userWithMissingInfo,
150
150
  verificationUUID,
151
151
  verifyOtp,
152
152
  ]);
@@ -92,7 +92,7 @@ import { useInternalDynamicContext } from '../../../context/DynamicContext/useDy
92
92
 
93
93
  const useSmsVerification = (type) => {
94
94
  const { verificationUUID, displayedDestination: formattedPhone, retryData, } = useVerification();
95
- const { environmentId, user, unauthenticatedUser } = useInternalDynamicContext();
95
+ const { environmentId, user, userWithMissingInfo } = useInternalDynamicContext();
96
96
  const [error, setError] = useState();
97
97
  const { verifyOtp } = useOtpVerificationRequest();
98
98
  const { initAuth, completeAuth, cancelAuth } = useUserAuth({
@@ -130,7 +130,7 @@ const useSmsVerification = (type) => {
130
130
  });
131
131
  });
132
132
  const submitOtpForVerification = useCallback((verificationToken) => __awaiter(void 0, void 0, void 0, function* () {
133
- if (!verificationUUID || (!user && !unauthenticatedUser)) {
133
+ if (!verificationUUID || (!user && !userWithMissingInfo)) {
134
134
  yield cancelAuth();
135
135
  return;
136
136
  }
@@ -142,7 +142,7 @@ const useSmsVerification = (type) => {
142
142
  cancelAuth,
143
143
  completeAuth,
144
144
  user,
145
- unauthenticatedUser,
145
+ userWithMissingInfo,
146
146
  verificationUUID,
147
147
  verifyOtp,
148
148
  ]);
@@ -38,7 +38,7 @@ export declare const viewToComponentMap: {
38
38
  'no-access': () => JSX.Element;
39
39
  'no-qr-not-installed': () => JSX.Element | null;
40
40
  'passkey-intro': import("react").FC<{
41
- chains?: import("@dynamic-labs/sdk-api-core").ChainEnum[] | undefined;
41
+ chains?: import("@dynamic-labs/sdk-api-core").EmbeddedWalletChainEnum[] | undefined;
42
42
  }>;
43
43
  'passkey-new-domain-detected': import("react").FC;
44
44
  'passkey-recovery-add-email': import("react").FC<import("./Passkey/PasskeyRecovery/AddRecoveryEmail/AddRecoveryEmail").AddRecoveryEmailProps>;
@@ -1 +0,0 @@
1
- export * from './useIsAuthenticated';
@@ -1,8 +0,0 @@
1
- 'use client'
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, '__esModule', { value: true });
5
-
6
- const useIsAuthenticated = (user) => Boolean(user);
7
-
8
- exports.useIsAuthenticated = useIsAuthenticated;
@@ -1,2 +0,0 @@
1
- import { UserProfile } from '../../../../..';
2
- export declare const useIsAuthenticated: (user: UserProfile | undefined) => boolean;
@@ -1,4 +0,0 @@
1
- 'use client'
2
- const useIsAuthenticated = (user) => Boolean(user);
3
-
4
- export { useIsAuthenticated };