@tap-payments/auth-jsconnect 2.8.54-development → 2.8.55-beta

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 (189) hide show
  1. package/build/@types/app.d.ts +0 -1
  2. package/build/@types/form.d.ts +0 -1
  3. package/build/@types/redux.d.ts +0 -1
  4. package/build/api/entity.d.ts +2 -2
  5. package/build/api/entity.js +4 -12
  6. package/build/api/index.d.ts +2 -2
  7. package/build/constants/api.d.ts +1 -0
  8. package/build/constants/api.js +2 -0
  9. package/build/constants/app.d.ts +2 -0
  10. package/build/constants/app.js +2 -0
  11. package/build/features/app/bank/bankStore.d.ts +18 -13
  12. package/build/features/app/bank/bankStore.js +165 -184
  13. package/build/features/app/board/boardStore.js +30 -52
  14. package/build/features/app/brand/brandStore.d.ts +33 -16
  15. package/build/features/app/brand/brandStore.js +242 -239
  16. package/build/features/app/business/businessStore.d.ts +5 -0
  17. package/build/features/app/business/businessStore.js +87 -76
  18. package/build/features/app/connectExpress/connectExpressStore.d.ts +6 -15
  19. package/build/features/app/connectExpress/connectExpressStore.js +52 -110
  20. package/build/features/app/entity/entityStore.d.ts +36 -20
  21. package/build/features/app/entity/entityStore.js +246 -196
  22. package/build/features/app/individual/individualStore.d.ts +38 -22
  23. package/build/features/app/individual/individualStore.js +266 -263
  24. package/build/features/app/password/passwordStore.d.ts +23 -40
  25. package/build/features/app/password/passwordStore.js +233 -226
  26. package/build/features/app/tax/taxStore.d.ts +7 -13
  27. package/build/features/app/tax/taxStore.js +147 -168
  28. package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +1 -13
  29. package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +1 -7
  30. package/build/features/bank/Bank.d.ts +0 -1
  31. package/build/features/bank/Bank.js +4 -7
  32. package/build/features/bank/screens/BankDetails/BankDetails.js +5 -18
  33. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  34. package/build/features/bank/screens/Verify/Verify.js +5 -5
  35. package/build/features/board/Board.js +4 -8
  36. package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -3
  37. package/build/features/brand/Brand.d.ts +0 -1
  38. package/build/features/brand/Brand.js +4 -7
  39. package/build/features/brand/screens/BrandActivities/BrandActivities.js +12 -49
  40. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -6
  41. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
  42. package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
  43. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
  44. package/build/features/brand/screens/BrandInfo/BrandInfo.js +5 -23
  45. package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +7 -23
  46. package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  47. package/build/features/brand/screens/Verify/Verify.js +1 -1
  48. package/build/features/business/Business.js +4 -9
  49. package/build/features/business/screens/Activities/Activities.js +3 -12
  50. package/build/features/business/screens/BusinessType/BusinessType.js +2 -10
  51. package/build/features/business/screens/CivilID/CivilID.js +1 -1
  52. package/build/features/business/screens/Customers/Customers.js +3 -12
  53. package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -6
  54. package/build/features/business/screens/IDBOD/IDBOD.js +2 -10
  55. package/build/features/business/screens/OTP/OTP.js +1 -1
  56. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -14
  57. package/build/features/business/screens/Verify/Verify.js +3 -13
  58. package/build/features/connect/Connect.js +3 -4
  59. package/build/features/connect/screens/BrandSegment/BrandSegment.js +1 -1
  60. package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +2 -9
  61. package/build/features/connect/screens/CivilID/CivilID.js +1 -1
  62. package/build/features/connect/screens/Individual/Email.js +1 -3
  63. package/build/features/connect/screens/Individual/Individual.js +1 -1
  64. package/build/features/connect/screens/Merchant/BrandList.js +3 -3
  65. package/build/features/connect/screens/Merchant/Merchant.js +1 -1
  66. package/build/features/connect/screens/Merchant/SalesChannels.js +1 -1
  67. package/build/features/connect/screens/Mobile/Mobile.js +8 -11
  68. package/build/features/connect/screens/NID/NID.js +1 -1
  69. package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
  70. package/build/features/connectExpress/ConnectExpress.js +1 -2
  71. package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +2 -5
  72. package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +1 -6
  73. package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +0 -3
  74. package/build/features/connectExpress/screens/AuthenticationList/validation.js +0 -10
  75. package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +1 -7
  76. package/build/features/connectExpress/screens/CivilID/CivilID.js +1 -1
  77. package/build/features/connectExpress/screens/CivilIDMissed/CivilID.js +1 -1
  78. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -1
  79. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +1 -1
  80. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +1 -3
  81. package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +24 -14
  82. package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -9
  83. package/build/features/connectExpress/screens/NID/NID.js +1 -1
  84. package/build/features/connectExpress/screens/NIDMissed/NID.js +1 -1
  85. package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  86. package/build/features/entity/Entity.d.ts +0 -1
  87. package/build/features/entity/Entity.js +4 -7
  88. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +4 -8
  89. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +4 -8
  90. package/build/features/entity/screens/EntityCapital/EntityCapital.js +10 -34
  91. package/build/features/entity/screens/EntityName/EntityName.js +15 -32
  92. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  93. package/build/features/entity/screens/Verify/Verify.js +1 -1
  94. package/build/features/featuresScreens.js +7 -67
  95. package/build/features/individual/Individual.d.ts +0 -1
  96. package/build/features/individual/Individual.js +4 -7
  97. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +14 -54
  98. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +2 -5
  99. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
  100. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +1 -4
  101. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -3
  102. package/build/features/individual/screens/IndividualList/Email.js +2 -3
  103. package/build/features/individual/screens/IndividualList/IndividualList.js +5 -18
  104. package/build/features/individual/screens/IndividualList/UserList.js +9 -13
  105. package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
  106. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +20 -76
  107. package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
  108. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  109. package/build/features/individual/screens/Verify/Verify.js +1 -1
  110. package/build/features/password/Password.d.ts +0 -1
  111. package/build/features/password/Password.js +28 -75
  112. package/build/features/password/screens/CreatePassword/CreatePassword.js +4 -8
  113. package/build/features/password/screens/OTP/OTP.js +1 -1
  114. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  115. package/build/features/password/screens/Verify/Verify.js +5 -5
  116. package/build/features/shared/Button/FlowsButtons.js +3 -13
  117. package/build/features/shared/Containers/FeatureContainer.d.ts +0 -1
  118. package/build/features/shared/Containers/FeatureContainer.js +3 -3
  119. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +1 -5
  120. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +3 -3
  121. package/build/features/signIn/SignIn.js +3 -12
  122. package/build/features/tax/Tax.d.ts +0 -1
  123. package/build/features/tax/Tax.js +4 -7
  124. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  125. package/build/features/tax/screens/TaxDetails/TaxDetails.js +2 -7
  126. package/build/features/tax/screens/Verify/Verify.js +5 -5
  127. package/build/hooks/index.d.ts +0 -1
  128. package/build/hooks/index.js +0 -1
  129. package/build/hooks/useVerifyToken.d.ts +2 -5
  130. package/build/hooks/useVerifyToken.js +5 -10
  131. package/build/utils/common.js +4 -4
  132. package/build/utils/locale.js +1 -2
  133. package/build/utils/string.d.ts +2 -5
  134. package/build/utils/string.js +5 -34
  135. package/package.json +2 -2
  136. package/build/features/bank/screens/OperatorError/OperatorError.d.ts +0 -5
  137. package/build/features/bank/screens/OperatorError/OperatorError.js +0 -9
  138. package/build/features/bank/screens/OperatorError/index.d.ts +0 -3
  139. package/build/features/bank/screens/OperatorError/index.js +0 -2
  140. package/build/features/board/screens/OperatorError/OperatorError.d.ts +0 -5
  141. package/build/features/board/screens/OperatorError/OperatorError.js +0 -9
  142. package/build/features/board/screens/OperatorError/index.d.ts +0 -3
  143. package/build/features/board/screens/OperatorError/index.js +0 -2
  144. package/build/features/brand/screens/OperatorError/OperatorError.d.ts +0 -5
  145. package/build/features/brand/screens/OperatorError/OperatorError.js +0 -9
  146. package/build/features/brand/screens/OperatorError/index.d.ts +0 -3
  147. package/build/features/brand/screens/OperatorError/index.js +0 -2
  148. package/build/features/business/screens/OperatorError/OperatorError.d.ts +0 -5
  149. package/build/features/business/screens/OperatorError/OperatorError.js +0 -9
  150. package/build/features/business/screens/OperatorError/index.d.ts +0 -3
  151. package/build/features/business/screens/OperatorError/index.js +0 -2
  152. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +0 -9
  153. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +0 -90
  154. package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +0 -5
  155. package/build/features/connectExpress/screens/OperatorError/OperatorError.js +0 -9
  156. package/build/features/connectExpress/screens/OperatorError/index.d.ts +0 -3
  157. package/build/features/connectExpress/screens/OperatorError/index.js +0 -2
  158. package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -5
  159. package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +0 -34
  160. package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +0 -2
  161. package/build/features/connectExpress/screens/PrepareDataLoading/index.js +0 -2
  162. package/build/features/entity/screens/OperatorError/OperatorError.d.ts +0 -5
  163. package/build/features/entity/screens/OperatorError/OperatorError.js +0 -9
  164. package/build/features/entity/screens/OperatorError/index.d.ts +0 -3
  165. package/build/features/entity/screens/OperatorError/index.js +0 -2
  166. package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +0 -14
  167. package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.js +0 -76
  168. package/build/features/individual/screens/OperatorError/OperatorError.d.ts +0 -5
  169. package/build/features/individual/screens/OperatorError/OperatorError.js +0 -9
  170. package/build/features/individual/screens/OperatorError/index.d.ts +0 -3
  171. package/build/features/individual/screens/OperatorError/index.js +0 -2
  172. package/build/features/password/screens/OperatorError/OperatorError.d.ts +0 -5
  173. package/build/features/password/screens/OperatorError/OperatorError.js +0 -9
  174. package/build/features/password/screens/OperatorError/index.d.ts +0 -3
  175. package/build/features/password/screens/OperatorError/index.js +0 -2
  176. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -4
  177. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +0 -10
  178. package/build/features/password/screens/PrepareDataLoading/index.d.ts +0 -2
  179. package/build/features/password/screens/PrepareDataLoading/index.js +0 -2
  180. package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +0 -5
  181. package/build/features/signIn/screens/OperatorError/OperatorError.js +0 -9
  182. package/build/features/signIn/screens/OperatorError/index.d.ts +0 -3
  183. package/build/features/signIn/screens/OperatorError/index.js +0 -2
  184. package/build/features/tax/screens/OperatorError/OperatorError.d.ts +0 -5
  185. package/build/features/tax/screens/OperatorError/OperatorError.js +0 -9
  186. package/build/features/tax/screens/OperatorError/index.d.ts +0 -3
  187. package/build/features/tax/screens/OperatorError/index.js +0 -2
  188. package/build/hooks/useFormDirtyCheck.d.ts +0 -10
  189. package/build/hooks/useFormDirtyCheck.js +0 -66
@@ -25,7 +25,7 @@ import { useTranslation } from 'react-i18next';
25
25
  import { yupResolver } from '@hookform/resolvers/yup';
26
26
  import { alpha, styled, useTheme } from '@mui/material/styles';
27
27
  import Box from '@mui/material/Box';
28
- import { getUserName, isKWOrSA, isValidEmail } from '../../../../utils';
28
+ import { getUserName, isValidEmail } from '../../../../utils';
29
29
  import { useLanguage, useAppSelector, useAppDispatch, useSetFromDefaultValues } from '../../../../hooks';
30
30
  import { IndividualType } from '../../../../@types';
31
31
  import Collapse from '../../../../components/Collapse';
@@ -35,10 +35,9 @@ import Text from '../../../../components/Text';
35
35
  import CheckIcon from '../../../shared/CheckIcon';
36
36
  import { ScreenContainer } from '../../../shared/Containers';
37
37
  import { addDetailsAsync, individualSelector, requestDetailsByEmail, resetIndividualData } from '../../../app/individual/individualStore';
38
- import IndividualActionButtons from '../../../shared/Button/IndividualActionButtons';
38
+ import IndividualActionButtons from '../../../../features/shared/Button/IndividualActionButtons';
39
39
  import { IndividualCollectInfoValidationSchema } from './validation';
40
40
  import CollectPhoneEmail from './CollectPhoneEmail';
41
- import { settingsSelector } from '../../../../app/settings';
42
41
  var ScreenContainerStyled = styled(ScreenContainer)(function (_a) {
43
42
  var theme = _a.theme;
44
43
  return ({
@@ -85,12 +84,11 @@ var UserList = function (_a) {
85
84
  var dispatch = useAppDispatch();
86
85
  var _j = React.useState(false), emailChecking = _j[0], setEmailChecking = _j[1];
87
86
  var theme = useTheme();
88
- var _k = useAppSelector(individualSelector), data = _k.data, addOrRequestDetailLoading = _k.addOrRequestDetailLoading, error = _k.error;
89
- var settingsData = useAppSelector(settingsSelector).data;
87
+ var _k = useAppSelector(individualSelector), data = _k.data, loading = _k.loading, error = _k.error;
90
88
  var _l = data.individualCollectData, email = _l.email, mobile = _l.mobile, responseBody = _l.responseBody;
91
89
  var is_available = (responseBody || {}).is_available;
92
90
  var verify = data.verify;
93
- var _m = verify.responseBody || {}, userList = _m.userList, recipient = _m.recipient, userRes = _m.user;
91
+ var _m = verify.responseBody || {}, userList = _m.userList, notification = _m.notification;
94
92
  var methods = useForm({
95
93
  resolver: yupResolver(IndividualCollectInfoValidationSchema(activeUser)),
96
94
  defaultValues: {
@@ -159,10 +157,8 @@ var UserList = function (_a) {
159
157
  return (activeUser === null || activeUser === void 0 ? void 0 : activeUser.id) === user.id;
160
158
  };
161
159
  var isSameUserRequestedBefore = function (user) {
162
- var _a;
163
- if (!(userRes === null || userRes === void 0 ? void 0 : userRes.is_authorized) && !isKWOrSA(settingsData.businessCountry.iso2))
164
- return false;
165
- return (_a = user === null || user === void 0 ? void 0 : user.ids) === null || _a === void 0 ? void 0 : _a.includes(recipient === null || recipient === void 0 ? void 0 : recipient.id);
160
+ var _a, _b;
161
+ return (_a = user === null || user === void 0 ? void 0 : user.ids) === null || _a === void 0 ? void 0 : _a.includes((_b = notification === null || notification === void 0 ? void 0 : notification.recipient) === null || _b === void 0 ? void 0 : _b.id);
166
162
  };
167
163
  var getUserStatus = function (user) {
168
164
  return user === null || user === void 0 ? void 0 : user.individual_data_state;
@@ -192,11 +188,11 @@ var UserList = function (_a) {
192
188
  return (_jsx(ScreenContainerStyled, { children: usersMenuList.map(function (user, index) {
193
189
  return (_jsxs(Box, __assign({ sx: index !== usersMenuList.length - 1 ? { borderBottom: "1px solid ".concat(alpha(theme.palette.divider, 0.8)) } : {} }, { children: [_jsxs(TextBoxStyled, __assign({ sx: {
194
190
  cursor: emailChecking ? 'default' : 'pointer'
195
- }, onClick: !!anchorEl && isActiveUser(user) ? function () { return onCloseUserAction(); } : function (e) { return onClickUser(user, e); } }, { children: [_jsxs(TextStyled, { children: [_jsx("span", { children: getName(user) || '' }), _jsx(RoleTextStyled, { children: getUserRole(user) || '' })] }), (user === null || user === void 0 ? void 0 : user.isRequestedEmail) ? _jsx(CheckIcon, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl && isActiveUser(user) })] })), _jsx(Collapse, __assign({ in: !!anchorEl && isActiveUser(user), timeout: 300 }, { children: _jsx(IndividualActionButtons, { isAr: isAr, addDetails: {
191
+ }, onClick: !!anchorEl && isActiveUser(user) ? function () { return onCloseUserAction(); } : function (e) { return onClickUser(user, e); } }, { children: [_jsx(TextStyled, { children: _jsx("span", { children: getName(user) || '' }) }), (user === null || user === void 0 ? void 0 : user.isRequestedEmail) ? _jsx(CheckIcon, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl && isActiveUser(user) })] })), _jsx(Collapse, __assign({ in: !!anchorEl && isActiveUser(user), timeout: 300 }, { children: _jsx(IndividualActionButtons, { isAr: isAr, addDetails: {
196
192
  status: getUserStatus(user),
197
193
  title: t('add_details'),
198
194
  onClick: onAddDetails,
199
- loading: isActiveUser(user) && !!addOrRequestDetailLoading && type === IndividualRequestType.ADD
195
+ loading: isActiveUser(user) && loading && type === IndividualRequestType.ADD
200
196
  }, requestEmail: {
201
197
  children: getCollectForm(user),
202
198
  title: t('request_details_by_email'),
@@ -204,7 +200,7 @@ var UserList = function (_a) {
204
200
  disabled: showCollectForm ? disabled : false,
205
201
  onClick: onRequestEmail,
206
202
  show: !isSameUserRequestedBefore(user),
207
- loading: isActiveUser(user) && !!addOrRequestDetailLoading && type === IndividualRequestType.REQUEST_EMAIL
203
+ loading: isActiveUser(user) && loading && type === IndividualRequestType.REQUEST_EMAIL
208
204
  } }) }))] }), index));
209
205
  }) }));
210
206
  };
@@ -15,10 +15,9 @@ import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import { styled } from '@mui/material/styles';
17
17
  import Collapse from '../../../../components/Collapse';
18
- import { removeAllOtherThanCharsNumbersAtAndDot } from '../../../../utils';
19
18
  import { ScreenContainer } from '../../../shared/Containers';
20
19
  import Input from '../../../shared/Input';
21
- import { EndAdornment } from '../../../shared/EndAdornment';
20
+ import { EndAdornment } from '../../../../features/shared/EndAdornment';
22
21
  var InputStyled = styled(Input)(function () { return ({
23
22
  input: {
24
23
  textTransform: 'lowercase'
@@ -33,8 +32,7 @@ var Email = function (_a) {
33
32
  var emailValue = emailControl.field.value;
34
33
  var error = (_b = emailControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
35
34
  var handleEmailChange = function (event) {
36
- var value = removeAllOtherThanCharsNumbersAtAndDot(event.target.value);
37
- emailControl.field.onChange(value);
35
+ emailControl.field.onChange(event.target.value);
38
36
  };
39
37
  var clearNumber = function () {
40
38
  emailControl.field.onChange('');
@@ -17,8 +17,8 @@ import { useTranslation } from 'react-i18next';
17
17
  import { handleCurrentActiveScreen, handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
18
18
  import Box from '@mui/material/Box';
19
19
  import { alpha, styled } from '@mui/material/styles';
20
- import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage, useFormReadOnly, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified, useFormDirtyCheck } from '../../../../hooks';
21
- import { convertToEnglishDateFormat, deepCopy, findCountryByIddPrefix, findCountryByIso2, getUserName, isKWOrSA, isOtherThanKWOrSA, sendCustomEventToGTM } from '../../../../utils';
20
+ import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage, useFormReadOnly, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
21
+ import { convertToEnglishDateFormat, deepCopy, getUserName, isOtherThanKWOrSA } from '../../../../utils';
22
22
  import Form from '../../../../components/Form';
23
23
  import Collapse from '../../../../components/Collapse';
24
24
  import Text from '../../../../components/Text';
@@ -50,17 +50,17 @@ var ListType;
50
50
  ListType["NationalityList"] = "NationalityList";
51
51
  })(ListType || (ListType = {}));
52
52
  var IndividualPersonalInfo = function (_a) {
53
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
53
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k;
54
54
  var t = useTranslation().t;
55
55
  var isAr = useLanguage().isAr;
56
56
  var dispatch = useAppDispatch();
57
- var _p = useAppSelector(individualSelector), data = _p.data, loading = _p.loading, error = _p.error, cityLoading = _p.cityLoading;
57
+ var _l = useAppSelector(individualSelector), data = _l.data, loading = _l.loading, error = _l.error, cityLoading = _l.cityLoading;
58
58
  var settingsData = useAppSelector(settingsSelector).data;
59
59
  var countries = settingsData.countries;
60
60
  var verify = data.verify, individualPersonalData = data.individualPersonalData;
61
- var _q = verify.responseBody || {}, user = _q.user, flows = _q.flows;
61
+ var _m = verify.responseBody || {}, user = _m.user, flows = _m.flows;
62
62
  var name = individualPersonalData.name, email = individualPersonalData.email, mobile = individualPersonalData.mobile, countryCode = individualPersonalData.countryCode, gender = individualPersonalData.gender, nid = individualPersonalData.nid, issuedCountry = individualPersonalData.issuedCountry, expiryDate = individualPersonalData.expiryDate, dob = individualPersonalData.dob, placeOfBirthCountry = individualPersonalData.placeOfBirthCountry, placeOfBirthCity = individualPersonalData.placeOfBirthCity, nationality = individualPersonalData.nationality;
63
- var _r = user || {}, data_status = _r.data_status, is_authorized = _r.is_authorized, data_verification = _r.data_verification, contact = _r.contact, genderRes = _r.gender, identification = _r.identification, birth = _r.birth, nationalityRes = _r.nationality;
63
+ var _o = user || {}, data_status = _o.data_status, is_authorized = _o.is_authorized, data_verification = _o.data_verification, contact = _o.contact, genderRes = _o.gender, identification = _o.identification, birth = _o.birth, nationalityRes = _o.nationality;
64
64
  var isOtherCountry = React.useMemo(function () { return isOtherThanKWOrSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
65
65
  var methods = useForm({
66
66
  resolver: yupResolver(IndividualInfoValidationSchema(isOtherCountry)),
@@ -82,51 +82,9 @@ var IndividualPersonalInfo = function (_a) {
82
82
  });
83
83
  var watch = methods.watch;
84
84
  useSetFromDefaultValues(methods, data.individualPersonalData);
85
- var _s = React.useState(), listActive = _s[0], setListActive = _s[1];
86
- var _t = React.useState(false), dobActive = _t[0], setDobActive = _t[1];
87
- var _u = React.useState(false), expiryDateActive = _u[0], setExpiryDateActive = _u[1];
88
- var expDateRes = (identification === null || identification === void 0 ? void 0 : identification.expiry) && convertToEnglishDateFormat(new Date(identification === null || identification === void 0 ? void 0 : identification.expiry));
89
- var dobDateRes = (birth === null || birth === void 0 ? void 0 : birth.date) && convertToEnglishDateFormat(new Date(birth === null || birth === void 0 ? void 0 : birth.date));
90
- var resCountryCode = React.useMemo(function () {
91
- var _a;
92
- if (!((_a = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _a === void 0 ? void 0 : _a.country_code))
93
- return {};
94
- return findCountryByIddPrefix(countries, contact.phone.country_code) || {};
95
- }, [(_b = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _b === void 0 ? void 0 : _b.country_code]);
96
- var resIssuedCountry = React.useMemo(function () {
97
- if (!(identification === null || identification === void 0 ? void 0 : identification.issued_country_code))
98
- return;
99
- return findCountryByIso2(countries, identification.issued_country_code);
100
- }, [identification === null || identification === void 0 ? void 0 : identification.issued_country_code]);
101
- var resPlaceOfBirthCountry = React.useMemo(function () {
102
- if (!(birth === null || birth === void 0 ? void 0 : birth.country))
103
- return;
104
- return findCountryByIso2(countries, birth.country);
105
- }, [birth === null || birth === void 0 ? void 0 : birth.country]);
106
- var resNationality = React.useMemo(function () {
107
- if (!nationalityRes)
108
- return;
109
- return findCountryByIso2(countries, nationalityRes);
110
- }, [nationalityRes]);
111
- var isDirty = useFormDirtyCheck(methods, {
112
- name: getUserName(user, false),
113
- email: contact === null || contact === void 0 ? void 0 : contact.email,
114
- mobile: (_c = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _c === void 0 ? void 0 : _c.number,
115
- countryCode: resCountryCode,
116
- gender: genderRes === null || genderRes === void 0 ? void 0 : genderRes.toLowerCase(),
117
- nid: identification === null || identification === void 0 ? void 0 : identification.id,
118
- issuedCountry: resIssuedCountry,
119
- expiryDate: expDateRes,
120
- dob: dobDateRes,
121
- placeOfBirthCountry: resPlaceOfBirthCountry,
122
- placeOfBirthCity: ((_d = birth === null || birth === void 0 ? void 0 : birth.city) === null || _d === void 0 ? void 0 : _d.cityId) && { id: birth.city.cityId },
123
- nationality: resNationality
124
- }, [
125
- {
126
- name: 'placeOfBirthCity',
127
- keys: ['id']
128
- }
129
- ]).isDirty;
85
+ var _p = React.useState(), listActive = _p[0], setListActive = _p[1];
86
+ var _q = React.useState(false), dobActive = _q[0], setDobActive = _q[1];
87
+ var _r = React.useState(false), expiryDateActive = _r[0], setExpiryDateActive = _r[1];
130
88
  var originalReadOnly = useFormReadOnly(methods);
131
89
  var noneEditable = useDataNoneEditable(data_status, [
132
90
  'name.en',
@@ -162,50 +120,36 @@ var IndividualPersonalInfo = function (_a) {
162
120
  'nationality',
163
121
  'gender'
164
122
  ]);
123
+ var expDateRes = (identification === null || identification === void 0 ? void 0 : identification.expiry) && convertToEnglishDateFormat(new Date(identification === null || identification === void 0 ? void 0 : identification.expiry));
124
+ var dobDateRes = (birth === null || birth === void 0 ? void 0 : birth.date) && convertToEnglishDateFormat(new Date(birth === null || birth === void 0 ? void 0 : birth.date));
165
125
  var isNameVerified = dataVerified['name.en'] && dataVerified['name.ar'] && getUserName(user, isAr) === watch('name');
166
126
  var isPhoneNumberVerified = dataVerified['contact.phone.number'] &&
167
127
  dataVerified['contact.phone.country_code'] &&
168
- ((_e = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _e === void 0 ? void 0 : _e.number) === watch('mobile') &&
169
- ((_f = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _f === void 0 ? void 0 : _f.country_code) === ((_h = (_g = watch('countryCode')) === null || _g === void 0 ? void 0 : _g.idd_prefix) === null || _h === void 0 ? void 0 : _h.toString());
128
+ ((_b = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _b === void 0 ? void 0 : _b.number) === watch('mobile') &&
129
+ ((_c = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _c === void 0 ? void 0 : _c.country_code) === ((_e = (_d = watch('countryCode')) === null || _d === void 0 ? void 0 : _d.idd_prefix) === null || _e === void 0 ? void 0 : _e.toString());
170
130
  var isEmailVerified = dataVerified['contact.email'] && (contact === null || contact === void 0 ? void 0 : contact.email) === watch('email');
171
131
  var isGenderVerified = dataVerified['gender'] && genderRes === watch('gender');
172
132
  var isIDVerified = dataVerified['identification.id'] && (identification === null || identification === void 0 ? void 0 : identification.id) === watch('nid');
173
- var isIssuedCountryVerified = dataVerified['identification.issuer_country'] && (identification === null || identification === void 0 ? void 0 : identification.issued_country_code) === ((_j = watch('issuedCountry')) === null || _j === void 0 ? void 0 : _j.iso2);
133
+ var isIssuedCountryVerified = dataVerified['identification.issuer_country'] && (identification === null || identification === void 0 ? void 0 : identification.issued_country_code) === ((_f = watch('issuedCountry')) === null || _f === void 0 ? void 0 : _f.iso2);
174
134
  var isExpiryDateVerified = dataVerified['identification.expiry'] && expDateRes === watch('expiryDate');
175
135
  var isDOBVerified = dataVerified['birth.date'] && dobDateRes === watch('dob');
176
- var isBirthCountryVerified = dataVerified['birth.country'] && (birth === null || birth === void 0 ? void 0 : birth.country) === ((_k = watch('placeOfBirthCountry')) === null || _k === void 0 ? void 0 : _k.iso2);
177
- var isBirthCityVerified = dataVerified['birth.city'] && ((_l = birth === null || birth === void 0 ? void 0 : birth.city) === null || _l === void 0 ? void 0 : _l.cityId) === ((_m = watch('placeOfBirthCity')) === null || _m === void 0 ? void 0 : _m.id);
178
- var isNationalityVerified = dataVerified['nationality'] && nationalityRes === ((_o = watch('nationality')) === null || _o === void 0 ? void 0 : _o.iso2);
179
- var isKWOrSaCountry = React.useMemo(function () { return isKWOrSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
136
+ var isBirthCountryVerified = dataVerified['birth.country'] && (birth === null || birth === void 0 ? void 0 : birth.country) === ((_g = watch('placeOfBirthCountry')) === null || _g === void 0 ? void 0 : _g.iso2);
137
+ var isBirthCityVerified = dataVerified['birth.city'] && ((_h = birth === null || birth === void 0 ? void 0 : birth.city) === null || _h === void 0 ? void 0 : _h.cityId) === ((_j = watch('placeOfBirthCity')) === null || _j === void 0 ? void 0 : _j.id);
138
+ var isNationalityVerified = dataVerified['nationality'] && nationalityRes === ((_k = watch('nationality')) === null || _k === void 0 ? void 0 : _k.iso2);
180
139
  var onSubmit = function (data) {
181
- var formData = __assign(__assign({}, deepCopy(getFelids(data))), { isDirty: isDirty });
182
- dispatch(updateIndividualPersonalInfo(formData));
140
+ dispatch(updateIndividualPersonalInfo(deepCopy(getFelids(data))));
183
141
  };
184
142
  React.useEffect(function () {
185
143
  if (error)
186
144
  dispatch(clearError());
187
145
  }, [methods.formState.isValid]);
188
- React.useEffect(function () {
189
- sendCustomEventToGTM({
190
- event: 'Send Event',
191
- event_category: 'Board Flows - Individual',
192
- event_action: 'Update Personal Data Page',
193
- event_label: settingsData.businessCountry.iso2
194
- });
195
- }, []);
196
146
  var onBack = function () {
197
147
  if (error)
198
148
  dispatch(clearError());
199
- if (is_authorized || !isKWOrSaCountry) {
149
+ if (is_authorized) {
200
150
  dispatch(handleCurrentActiveScreen('INDIVIDUAL_LIST_STEP'));
201
151
  return;
202
152
  }
203
- sendCustomEventToGTM({
204
- event: 'Send Event',
205
- event_category: 'Board Flows - Individual',
206
- event_action: 'Individual Details Back Button',
207
- event_label: settingsData.businessCountry.iso2
208
- });
209
153
  if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0) {
210
154
  dispatch(handlePrevScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
211
155
  return;
@@ -229,7 +173,7 @@ var IndividualPersonalInfo = function (_a) {
229
173
  var isBirthCountryListActive = listActive === ListType.BirthCountryList;
230
174
  var isBirthCityListActive = listActive === ListType.BirthCityList;
231
175
  var isNationalityListActive = listActive === ListType.NationalityList;
232
- var disableBack = settingsData.appConfig.mode === 'content' && !(is_authorized || !isKWOrSaCountry);
176
+ var disableBack = settingsData.appConfig.mode === 'content' && !is_authorized;
233
177
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Name, { show: showField, readOnly: readOnly['name'] || (noneEditable['name.en'] && noneEditable['name.ar']), isVerified: isNameVerified }), _jsx(MobileNumber, { readOnly: readOnly['mobile'] || noneEditable['contact.phone.number'] || noneEditable['contact.phone.country_code'], show: !isDateFieldActive && !isBirthCountryListActive && !isBirthCityListActive && !isNationalityListActive && !isIssuedCountryListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.MobileCountryList); }, onListClose: function () { return handleMenuClick(); }, isVerified: isPhoneNumberVerified }), _jsx(Email, { show: showField, readOnly: readOnly['email'] || noneEditable['contact.email'], isVerified: isEmailVerified }), _jsx(Gender, { show: showField, readOnly: readOnly['gender'] || noneEditable['gender'], isVerified: isGenderVerified }), _jsx(ID, { show: showField, readOnly: readOnly['nid'] || noneEditable['identification.id'], isVerified: isIDVerified }), _jsx(IssuedCountry, { readOnly: readOnly['issuedCountry'] || noneEditable['identification.issuer_country'], show: !isMobileCountryListActive && !isDateFieldActive && !isBirthCountryListActive && !isBirthCityListActive && !isNationalityListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.IssuedCountryList); }, onListClose: function () { return handleMenuClick(); }, isVerified: isIssuedCountryVerified }), _jsx(ExpiryDate, { show: !listActive && !dobActive, onDateClicked: handleExpiryDateActive, readOnly: readOnly['expiryDate'] || noneEditable['identification.expiry'], isVerified: isExpiryDateVerified }), _jsx(DOB, { show: !listActive && !expiryDateActive, onDateClicked: handleDobActive, readOnly: readOnly['dob'] || noneEditable['birth.date'], isVerified: isDOBVerified }), _jsx(BirthCountry, { readOnly: readOnly['placeOfBirthCountry'] || noneEditable['birth.country'], show: !isMobileCountryListActive && !isDateFieldActive && !isIssuedCountryListActive && !isBirthCityListActive && !isNationalityListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.BirthCountryList); }, onListClose: function () { return handleMenuClick(); }, isVerified: isBirthCountryVerified }), _jsx(BirthCity, { readOnly: readOnly['placeOfBirthCity'] || noneEditable['birth.city'], show: !isMobileCountryListActive &&
234
178
  !isDateFieldActive &&
235
179
  !isIssuedCountryListActive &&
@@ -58,7 +58,7 @@ var PhoneInfo = function (_a) {
58
58
  if (error && methods.formState.isValid)
59
59
  dispatch(clearError());
60
60
  }, [methods.formState.isValid]);
61
- var disabled = !methods.formState.isValid;
61
+ var disabled = !methods.formState.isValid || !!error;
62
62
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(MobileNumber, { readOnly: readOnly['mobile'], show: true, sx: { mb: 7.5 }, countries: countries, onListOpen: function () { return setListActive(true); }, onListClose: function () { return setListActive(false); } }), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
63
63
  };
64
64
  export default React.memo(PhoneInfo);
@@ -21,10 +21,10 @@ var SuccessWithFlowButtons = function () {
21
21
  var _a = useAppSelector(individualSelector), data = _a.data, loading = _a.loading;
22
22
  var settingsData = useAppSelector(settingsSelector).data;
23
23
  var isScopeAuthentication = settingsData.appConfig.scope === SCOPE_AUTH;
24
- var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals, recipient = _b.recipient;
24
+ var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals;
25
25
  var onClose = function () {
26
26
  dispatch(onCloseCompleteIndividual());
27
27
  };
28
- return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication ? onClose : undefined, recipient: recipient }));
28
+ return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication ? onClose : undefined }));
29
29
  };
30
30
  export default memo(SuccessWithFlowButtons);
@@ -72,7 +72,7 @@ var VerifyNumber = function (_a) {
72
72
  var onSubmit = function (formData) {
73
73
  dispatch(verifyLeadOTP(deepCopy(formData)));
74
74
  };
75
- var disabled = !methods.formState.isValid || !phone || resendLoading;
75
+ var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
76
76
  var dataLoading = loading || cityLoading;
77
77
  var showMobileNumber = !loading && !cityLoading && phone;
78
78
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [dataLoading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), showMobileNumber && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
@@ -2,7 +2,6 @@ import { LibConfig } from '../../@types';
2
2
  export interface PasswordLibProps extends LibConfig {
3
3
  verifyToken?: string;
4
4
  configToken?: string;
5
- loaderColor?: string;
6
5
  }
7
6
  export declare function PasswordElement(props: PasswordLibProps): import("react/jsx-runtime").JSX.Element;
8
7
  export declare function renderPasswordLib(config: PasswordLibProps, elementId: string): {
@@ -9,42 +9,6 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
- return new (P || (P = Promise))(function (resolve, reject) {
15
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
- step((generator = generator.apply(thisArg, _arguments || [])).next());
19
- });
20
- };
21
- var __generator = (this && this.__generator) || function (thisArg, body) {
22
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
- function verb(n) { return function (v) { return step([n, v]); }; }
25
- function step(op) {
26
- if (f) throw new TypeError("Generator is already executing.");
27
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
- if (y = 0, t) op = [op[0] & 2, t.value];
30
- switch (op[0]) {
31
- case 0: case 1: t = op; break;
32
- case 4: _.label++; return { value: op[1], done: false };
33
- case 5: _.label++; y = op[1]; op = [0]; continue;
34
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
- default:
36
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
- if (t[2]) _.ops.pop();
41
- _.trys.pop(); continue;
42
- }
43
- op = body.call(thisArg, _);
44
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
- }
47
- };
48
12
  var __rest = (this && this.__rest) || function (s, e) {
49
13
  var t = {};
50
14
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -57,10 +21,10 @@ var __rest = (this && this.__rest) || function (s, e) {
57
21
  return t;
58
22
  };
59
23
  import { jsx as _jsx } from "react/jsx-runtime";
60
- import { memo } from 'react';
24
+ import { memo, useEffect } from 'react';
61
25
  import { createRoot } from 'react-dom/client';
62
- import { useAppTheme, useAppDispatch, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener, useVerifyToken } from '../../hooks';
63
- import { settingsSelector } from '../../app/settings';
26
+ import { useAppTheme, useAppDispatch, useAppSelector, useAppConfig, useErrorListener, useStepStartedListener } from '../../hooks';
27
+ import { handleLanguage, settingsSelector } from '../../app/settings';
64
28
  import AnimationFlow from '../../components/AnimationFlow';
65
29
  import { store } from '../../app/store';
66
30
  import { ReduxProvider, ThemeProvider } from '../../components/Providers';
@@ -72,7 +36,7 @@ import { passwordFeatureScreens } from '../featuresScreens';
72
36
  import { passwordSelector, verifyLeadToken, verifyOperationToken } from '../app/password/passwordStore';
73
37
  import Background from '../shared/Background';
74
38
  var Password = memo(function (_a) {
75
- var configToken = _a.configToken, loaderColor = _a.loaderColor, verifyToken = _a.verifyToken, props = __rest(_a, ["configToken", "loaderColor", "verifyToken"]);
39
+ var configToken = _a.configToken, verifyToken = _a.verifyToken, props = __rest(_a, ["configToken", "verifyToken"]);
76
40
  var theme = useAppTheme().theme;
77
41
  var dispatch = useAppDispatch();
78
42
  var _b = useAppSelector(settingsSelector), data = _b.data, error = _b.error, settingLoading = _b.loading;
@@ -81,42 +45,31 @@ var Password = memo(function (_a) {
81
45
  useErrorListener(passwordError || error);
82
46
  useStepStartedListener();
83
47
  var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open, merchant = data.merchant, isMaturityExpress = data.isMaturityExpress, featureScreensNavigation = data.featureScreensNavigation, appConfig = data.appConfig;
84
- var handleVerifyToken = function (_a) {
85
- var token = _a.token, isInternally = _a.isInternally;
86
- return function () { return __awaiter(void 0, void 0, void 0, function () {
87
- var operationType, boardId, boardInfoId, userId, userType;
88
- return __generator(this, function (_a) {
89
- operationType = getParameterByName('operation_type');
90
- boardId = getParameterByName('board_id') || '';
91
- boardInfoId = getParameterByName('board_info_id') || '';
92
- userId = getParameterByName('user_id') || '';
93
- userType = getParameterByName('user_type') || '';
94
- initializeGTM();
95
- sendPageView({
96
- title: 'Password'
97
- });
98
- if (operationType === PASSWORD_OPERATION_TYPE.RESET_PASSWORD) {
99
- dispatch(verifyOperationToken({ token: token, boardId: boardId, boardInfoId: boardInfoId, userId: userId, userType: userType }));
100
- return [2];
101
- }
102
- dispatch(verifyLeadToken({ token: token, isInternally: isInternally }));
103
- return [2];
104
- });
105
- }); };
48
+ var handleVerifyToken = function () {
49
+ var token = verifyToken !== null && verifyToken !== void 0 ? verifyToken : getParameterByName('token');
50
+ var lang = getParameterByName('lang');
51
+ var operationType = getParameterByName('operation_type');
52
+ var boardId = getParameterByName('board_id') || '';
53
+ var boardInfoId = getParameterByName('board_info_id') || '';
54
+ if (lang)
55
+ dispatch(handleLanguage(lang));
56
+ if (!token)
57
+ throw new Error('Auth token is not found!');
58
+ initializeGTM();
59
+ sendPageView({
60
+ title: 'Password'
61
+ });
62
+ if (operationType === PASSWORD_OPERATION_TYPE.RESET_PASSWORD) {
63
+ dispatch(verifyOperationToken({ token: token, boardId: boardId, boardInfoId: boardInfoId }));
64
+ return;
65
+ }
66
+ dispatch(verifyLeadToken(token));
106
67
  };
107
- useVerifyToken({
108
- verify: handleVerifyToken,
109
- loadingScreenName: 'PASSWORD_LOADING_DATA_STEP',
110
- navigation: featureScreensNavigation,
111
- open: open,
112
- mode: props.mode,
113
- internalToken: verifyToken,
114
- settingLoading: settingLoading,
115
- isValidOperator: data.isValidOperator,
116
- operatorErrorScreenName: 'PASSWORD_OPERATOR_ERROR_STEP'
117
- });
118
- var initialLoading = verifyToken && props.mode !== 'content' ? settingLoading : settingLoading || customLoading;
119
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ mode: props.mode, open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: initialLoading, error: error, open: open, breakpoint: 'sm', loaderColor: loaderColor, screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, type: props.mode === 'content' ? 'CONTENT' : undefined, dialogEdgeFormat: data.appConfig.dialogEdgeFormat, features: appConfig.features }, { children: _jsx(FeatureContainer, __assign({ mode: props.mode, isMaturityExpress: isMaturityExpress }, { children: passwordFeatureScreens.map(function (_a, index) {
68
+ useEffect(function () {
69
+ if (!settingLoading && open)
70
+ handleVerifyToken();
71
+ }, [settingLoading]);
72
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, type: props.mode === 'content' ? 'CONTENT' : undefined, dialogEdgeFormat: data.appConfig.dialogEdgeFormat, features: appConfig.features }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: passwordFeatureScreens.map(function (_a, index) {
120
73
  var Element = _a.element, name = _a.name;
121
74
  var isActive = activeScreen.name === name;
122
75
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -17,7 +17,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
17
17
  import Box from '@mui/material/Box';
18
18
  import { styled } from '@mui/material/styles';
19
19
  import { useAppDispatch, useSetFromDefaultValues } from '../../../../hooks';
20
- import { handleNextScreenStep, handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
20
+ import { handleCurrentActiveScreen, handleNextScreenStep, settingsSelector } from '../../../../app/settings';
21
21
  import Form from '../../../../components/Form';
22
22
  import { useLanguage } from '../../../../hooks';
23
23
  import { PASSWORD_OPERATION_TYPE } from '../../../../constants';
@@ -25,7 +25,7 @@ import ScreenContainer from '../../../shared/Containers/ScreenContainer';
25
25
  import Button from '../../../shared/Button';
26
26
  import { PasswordValidation } from './validation';
27
27
  import Password from './Password';
28
- import { createPassword, passwordSelector, retrieveBoardStatus, storePasswordScreen } from '../../../app/password/passwordStore';
28
+ import { createPassword, passwordSelector, storePasswordScreen } from '../../../app/password/passwordStore';
29
29
  import { useSelector } from 'react-redux';
30
30
  import { deepCopy } from '../../../../utils';
31
31
  var InputsContainerStyled = styled(Box)(function (_a) {
@@ -61,13 +61,9 @@ var CreatePassword = function (_a) {
61
61
  dispatch(createPassword(deepCopy(data)));
62
62
  };
63
63
  var onBack = function () {
64
- if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0) {
65
- dispatch(handlePrevScreenStep());
66
- return;
67
- }
68
- dispatch(retrieveBoardStatus());
64
+ dispatch(handleCurrentActiveScreen('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
69
65
  };
70
- var disableBack = settingsData.appConfig.mode === 'content';
66
+ var disableBack = settingsData.appConfig.mode === 'content' ? true : !(flows === null || flows === void 0 ? void 0 : flows.length);
71
67
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(Password, {}) }), _jsx(Button, __assign({ disableBack: disableBack, onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
72
68
  };
73
69
  export default React.memo(CreatePassword);
@@ -83,7 +83,7 @@ var OTP = function (_a) {
83
83
  var onBack = function () {
84
84
  dispatch(handlePrevScreenStep());
85
85
  };
86
- var disabled = !methods.formState.isValid;
86
+ var disabled = !methods.formState.isValid || !!error;
87
87
  var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.auth_info) === null || _c === void 0 ? void 0 : _c.phone;
88
88
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
89
89
  };
@@ -21,10 +21,10 @@ var SuccessWithFlowButtons = function () {
21
21
  var _a = useAppSelector(passwordSelector), data = _a.data, loading = _a.loading;
22
22
  var settingsData = useAppSelector(settingsSelector).data;
23
23
  var isScopeAuthentication = settingsData.appConfig.scope === SCOPE_AUTH;
24
- var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals, recipient = _b.recipient;
24
+ var _b = data.verify.responseBody || {}, flows = _b.flows, entity = _b.entity, brand = _b.brand, bank = _b.bank_account, merchant = _b.merchant, user = _b.user, business = _b.business, board_id = _b.board_id, board_info_id = _b.board_info_id, name = _b.name, individuals = _b.individuals;
25
25
  var onClose = function () {
26
26
  dispatch(onCloseCompletePassword());
27
27
  };
28
- return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication ? onClose : undefined, recipient: recipient }));
28
+ return (_jsx(SuccessFlowButtons, { flowName: data.flowName, loading: loading, bank: bank, brand: brand, entity: entity, merchant: merchant, user: __assign({ names: { en: name } }, user), business: business, boardId: board_id, boardInfoId: board_info_id, individuals: individuals, flows: flows || [], onClose: isScopeAuthentication ? onClose : undefined }));
29
29
  };
30
30
  export default memo(SuccessWithFlowButtons);
@@ -46,9 +46,9 @@ var FormStyled = styled(Form)(function () { return ({
46
46
  flexDirection: 'column'
47
47
  }); });
48
48
  var VerifyNumber = function (_a) {
49
- var _b, _c;
49
+ var _b, _c, _d;
50
50
  var dispatch = useAppDispatch();
51
- var _d = useAppSelector(passwordSelector), data = _d.data, loading = _d.loading, error = _d.error;
51
+ var _e = useAppSelector(passwordSelector), data = _e.data, loading = _e.loading, error = _e.error;
52
52
  var otp = data.otpData.otp;
53
53
  var methods = useForm({
54
54
  resolver: yupResolver(OTPValidation),
@@ -60,8 +60,8 @@ var VerifyNumber = function (_a) {
60
60
  useSetFromDefaultValues(methods, data.otpData);
61
61
  var t = useTranslation().t;
62
62
  var isAr = useLanguage().isAr;
63
- var _e = React.useState(false), resendLoading = _e[0], setResendLoading = _e[1];
64
- var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.verification_by) === null || _c === void 0 ? void 0 : _c.sent_to;
63
+ var _f = React.useState(false), resendLoading = _f[0], setResendLoading = _f[1];
64
+ var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
65
65
  React.useEffect(function () {
66
66
  if (error && methods.formState.isValid && phone)
67
67
  dispatch(clearError());
@@ -72,7 +72,7 @@ var VerifyNumber = function (_a) {
72
72
  var onSubmit = function (formData) {
73
73
  dispatch(verifyPasswordLeadOTP(deepCopy(formData)));
74
74
  };
75
- var disabled = !methods.formState.isValid || !phone || resendLoading;
75
+ var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
76
76
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, disabled: disabled || resendLoading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
77
77
  };
78
78
  export default React.memo(VerifyNumber);
@@ -48,7 +48,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
48
48
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
49
49
  import { useState } from 'react';
50
50
  import { useTranslation } from 'react-i18next';
51
- import { capitalize } from 'lodash-es';
52
51
  import Button from '../../../components/Button';
53
52
  import { Button as SharedButton } from '../../shared/Button';
54
53
  import { alpha, styled } from '@mui/material/styles';
@@ -58,8 +57,7 @@ import { ICONS_NAMES } from '../../../constants';
58
57
  import CheckIcon from '@mui/icons-material/Check';
59
58
  import { useAppDispatch, useAppSelector, useLanguage } from '../../../hooks';
60
59
  import { handleOpen, handleCurrentActiveScreen, handleNextScreenStep, settingsSelector } from '../../../app/settings';
61
- import { FlowsTypes } from '../../../@types';
62
- import { dangerousMessage, getScreenNameBasedOnFlow, isKWOrSA, sendCustomEventToGTM } from '../../../utils';
60
+ import { dangerousMessage, getScreenNameBasedOnFlow } from '../../../utils';
63
61
  import API from '../../../api';
64
62
  import Text from '../../../components/Text';
65
63
  import Dot from '../Dot';
@@ -162,16 +160,8 @@ export default function FlowsButtons(_a) {
162
160
  var onRedirect = function (item) {
163
161
  if (!item.href)
164
162
  return;
165
- var name = flowName === FlowsTypes.BANK ? 'Wallet' : capitalize(flowName);
166
- sendCustomEventToGTM({
167
- event: 'Send Event',
168
- event_category: "Board Flows - ".concat(name),
169
- event_action: "".concat(name, " Kit Click"),
170
- event_label: settingsData.businessCountry.iso2
171
- });
172
- if (flowName === item.name && !isResetPassword(item.name, item.status)) {
173
- var isOtherThanSAOrKWCountry = !isKWOrSA(settingsData.businessCountry.iso2);
174
- dispatch(handleCurrentActiveScreen(getScreenNameBasedOnFlow(item.name, isAuthorizedUser, isOtherThanSAOrKWCountry)));
163
+ if (flowName === item.name && item.name !== 'password') {
164
+ dispatch(handleCurrentActiveScreen(getScreenNameBasedOnFlow(item.name, isAuthorizedUser)));
175
165
  return;
176
166
  }
177
167
  if (typeof settingsData.appConfig.onBoardButtonClick === 'function') {
@@ -2,7 +2,6 @@ import React from 'react';
2
2
  import { BoxProps } from '@mui/material/Box';
3
3
  interface FeatureContainerProps extends BoxProps {
4
4
  isMaturityExpress?: boolean;
5
- mode?: 'popup' | 'page' | 'content';
6
5
  }
7
6
  declare const FeatureContainer: React.ForwardRefExoticComponent<Omit<FeatureContainerProps, "ref"> & React.RefAttributes<unknown>>;
8
7
  export default FeatureContainer;
@@ -13,9 +13,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import React from 'react';
14
14
  import { styled } from '@mui/material/styles';
15
15
  import Box from '@mui/material/Box';
16
- var Container = styled(Box, { shouldForwardProp: function (prop) { return !['isMaturityExpress', 'mode'].includes(prop); } })(function (_a) {
16
+ var Container = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'isMaturityExpress'; } })(function (_a) {
17
17
  var _b;
18
- var theme = _a.theme, isMaturityExpress = _a.isMaturityExpress, mode = _a.mode;
18
+ var theme = _a.theme, isMaturityExpress = _a.isMaturityExpress;
19
19
  return (_b = {
20
20
  width: '100%',
21
21
  minHeight: theme.spacing(30),
@@ -27,7 +27,7 @@ var Container = styled(Box, { shouldForwardProp: function (prop) { return !['isM
27
27
  property: 'all'
28
28
  },
29
29
  _b[theme.breakpoints.down('sm')] = {
30
- paddingTop: isMaturityExpress || mode === 'content' ? theme.spacing(0.625) : theme.spacing(6)
30
+ paddingTop: isMaturityExpress ? theme.spacing(2.5) : theme.spacing(6)
31
31
  },
32
32
  _b);
33
33
  });