@tap-payments/auth-jsconnect 2.8.42-test → 2.8.45-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 (140) hide show
  1. package/build/@types/form.d.ts +0 -1
  2. package/build/@types/redux.d.ts +0 -1
  3. package/build/api/axios.js +1 -2
  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 +77 -3
  11. package/build/features/app/bank/bankStore.d.ts +18 -13
  12. package/build/features/app/bank/bankStore.js +161 -173
  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 +204 -173
  16. package/build/features/app/business/businessStore.d.ts +5 -0
  17. package/build/features/app/business/businessStore.js +86 -69
  18. package/build/features/app/connectExpress/connectExpressStore.js +10 -18
  19. package/build/features/app/entity/entityStore.d.ts +35 -15
  20. package/build/features/app/entity/entityStore.js +228 -159
  21. package/build/features/app/individual/individualStore.d.ts +37 -21
  22. package/build/features/app/individual/individualStore.js +265 -253
  23. package/build/features/app/password/passwordStore.d.ts +23 -40
  24. package/build/features/app/password/passwordStore.js +233 -226
  25. package/build/features/app/tax/taxStore.d.ts +7 -13
  26. package/build/features/app/tax/taxStore.js +147 -167
  27. package/build/features/auth/Auth.js +5 -1
  28. package/build/features/auth/screens/OperatorError/OperatorError.d.ts +5 -0
  29. package/build/features/auth/screens/OperatorError/OperatorError.js +9 -0
  30. package/build/features/auth/screens/OperatorError/index.d.ts +3 -0
  31. package/build/features/auth/screens/OperatorError/index.js +2 -0
  32. package/build/features/bank/Bank.d.ts +0 -1
  33. package/build/features/bank/Bank.js +3 -4
  34. package/build/features/bank/screens/BankDetails/BankDetails.js +4 -12
  35. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  36. package/build/features/bank/screens/Verify/Verify.js +5 -5
  37. package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +4 -3
  38. package/build/features/brand/Brand.d.ts +0 -1
  39. package/build/features/brand/Brand.js +3 -4
  40. package/build/features/brand/screens/BrandActivities/BrandActivities.js +1 -1
  41. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -6
  42. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
  43. package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
  44. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
  45. package/build/features/brand/screens/BrandInfo/BrandInfo.js +1 -1
  46. package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +1 -1
  47. package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  48. package/build/features/brand/screens/Verify/Verify.js +1 -1
  49. package/build/features/business/screens/Activities/Activities.js +1 -1
  50. package/build/features/business/screens/BusinessType/BusinessType.js +1 -1
  51. package/build/features/business/screens/CivilID/CivilID.js +1 -1
  52. package/build/features/business/screens/Customers/Customers.js +1 -1
  53. package/build/features/business/screens/Customers/ExpectedSalesRange.js +3 -6
  54. package/build/features/business/screens/IDBOD/IDBOD.js +1 -1
  55. package/build/features/business/screens/OTP/OTP.js +1 -1
  56. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  57. package/build/features/business/screens/Verify/Verify.js +1 -1
  58. package/build/features/connect/screens/BrandSegment/BrandSegment.js +1 -1
  59. package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +1 -2
  60. package/build/features/connect/screens/CivilID/CivilID.js +1 -1
  61. package/build/features/connect/screens/Individual/Email.js +1 -3
  62. package/build/features/connect/screens/Individual/Individual.js +1 -1
  63. package/build/features/connect/screens/Merchant/BrandList.js +3 -3
  64. package/build/features/connect/screens/Merchant/Merchant.js +1 -1
  65. package/build/features/connect/screens/Merchant/SalesChannels.js +1 -1
  66. package/build/features/connect/screens/Mobile/Mobile.js +1 -1
  67. package/build/features/connect/screens/NID/NID.js +1 -1
  68. package/build/features/connectExpress/ConnectExpress.js +22 -20
  69. package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +2 -5
  70. package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +1 -6
  71. package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +0 -3
  72. package/build/features/connectExpress/screens/AuthenticationList/validation.js +0 -10
  73. package/build/features/connectExpress/screens/CivilID/CivilID.js +1 -1
  74. package/build/features/connectExpress/screens/CivilIDMissed/CivilID.js +1 -1
  75. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -1
  76. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +1 -1
  77. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +1 -3
  78. package/build/features/connectExpress/screens/Mobile/Mobile.js +1 -1
  79. package/build/features/connectExpress/screens/NID/NID.js +1 -1
  80. package/build/features/connectExpress/screens/NIDMissed/NID.js +1 -1
  81. package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  82. package/build/features/entity/Entity.d.ts +0 -1
  83. package/build/features/entity/Entity.js +3 -4
  84. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +4 -8
  85. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +4 -8
  86. package/build/features/entity/screens/EntityCapital/EntityCapital.js +1 -1
  87. package/build/features/entity/screens/EntityName/EntityName.js +1 -1
  88. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  89. package/build/features/entity/screens/Verify/Verify.js +1 -1
  90. package/build/features/featuresScreens.js +5 -5
  91. package/build/features/individual/Individual.d.ts +0 -1
  92. package/build/features/individual/Individual.js +3 -4
  93. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +7 -14
  94. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +2 -5
  95. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +3 -8
  96. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +1 -4
  97. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -3
  98. package/build/features/individual/screens/IndividualList/Email.js +2 -3
  99. package/build/features/individual/screens/IndividualList/IndividualList.js +5 -11
  100. package/build/features/individual/screens/IndividualList/UserList.js +9 -13
  101. package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
  102. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +3 -4
  103. package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
  104. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  105. package/build/features/individual/screens/Verify/Verify.js +1 -1
  106. package/build/features/password/Password.d.ts +0 -1
  107. package/build/features/password/Password.js +28 -73
  108. package/build/features/password/screens/CreatePassword/CreatePassword.js +4 -8
  109. package/build/features/password/screens/OTP/OTP.js +1 -1
  110. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  111. package/build/features/password/screens/Verify/Verify.js +5 -5
  112. package/build/features/shared/Button/FlowsButtons.js +3 -4
  113. package/build/features/shared/Containers/FeatureContainer.d.ts +0 -1
  114. package/build/features/shared/Containers/FeatureContainer.js +3 -3
  115. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +1 -5
  116. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +3 -3
  117. package/build/features/tax/Tax.d.ts +0 -1
  118. package/build/features/tax/Tax.js +3 -4
  119. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  120. package/build/features/tax/screens/TaxDetails/TaxDetails.js +2 -7
  121. package/build/features/tax/screens/Verify/Verify.js +5 -5
  122. package/build/hooks/index.d.ts +0 -1
  123. package/build/hooks/index.js +0 -1
  124. package/build/hooks/useVerifyToken.d.ts +2 -3
  125. package/build/hooks/useVerifyToken.js +2 -2
  126. package/build/utils/common.js +4 -4
  127. package/build/utils/locale.js +1 -2
  128. package/build/utils/string.d.ts +2 -5
  129. package/build/utils/string.js +5 -34
  130. package/package.json +2 -2
  131. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +0 -31
  132. package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +0 -90
  133. package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +0 -36
  134. package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.js +0 -76
  135. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +0 -4
  136. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +0 -10
  137. package/build/features/password/screens/PrepareDataLoading/index.d.ts +0 -2
  138. package/build/features/password/screens/PrepareDataLoading/index.js +0 -2
  139. package/build/hooks/useFormDirtyCheck.d.ts +0 -6
  140. package/build/hooks/useFormDirtyCheck.js +0 -29
@@ -105,28 +105,30 @@ var ConnectExpress = memo(function (_a) {
105
105
  }, [data.businessCountry]);
106
106
  React.useEffect(function () {
107
107
  var _a, _b;
108
- if (settingLoading)
108
+ if (settingLoading || !props.open)
109
109
  return;
110
- if (data.isValidOperator && props.open) {
111
- if (configToken && connectData.leadId) {
112
- dispatch(retrieveLeadIdentityByIdAsync(connectData.leadId));
113
- return;
114
- }
115
- if (leadId) {
116
- if (props.scope !== 'auth') {
117
- dispatch(setIsLeadIdPassed(true));
118
- }
119
- dispatch(setLeadId(leadId));
120
- dispatch(retrieveLeadIdentityByIdAsync(leadId));
121
- return;
122
- }
123
- if (!((_a = data.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2)) {
124
- dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
125
- return;
126
- }
127
- if (((_b = data.businessCountry) === null || _b === void 0 ? void 0 : _b.iso2) && (isKW(data.businessCountry.iso2) || isOtherThanKWOrSA(data.businessCountry.iso2))) {
128
- dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_MOBILE_STEP'));
110
+ if (!data.isValidOperator) {
111
+ dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_OPERATOR_ERROR_STEP'));
112
+ return;
113
+ }
114
+ if (configToken && connectData.leadId) {
115
+ dispatch(retrieveLeadIdentityByIdAsync(connectData.leadId));
116
+ return;
117
+ }
118
+ if (leadId) {
119
+ if (props.scope !== 'auth') {
120
+ dispatch(setIsLeadIdPassed(true));
129
121
  }
122
+ dispatch(setLeadId(leadId));
123
+ dispatch(retrieveLeadIdentityByIdAsync(leadId));
124
+ return;
125
+ }
126
+ if (!((_a = data.businessCountry) === null || _a === void 0 ? void 0 : _a.iso2)) {
127
+ dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
128
+ return;
129
+ }
130
+ if (((_b = data.businessCountry) === null || _b === void 0 ? void 0 : _b.iso2) && (isKW(data.businessCountry.iso2) || isOtherThanKWOrSA(data.businessCountry.iso2))) {
131
+ dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_MOBILE_STEP'));
130
132
  }
131
133
  }, [data.isValidOperator, settingLoading]);
132
134
  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, screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: !isTapOrigin, dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: true }, { children: connectExpressFeatureScreens.map(function (_a, index) {
@@ -29,7 +29,6 @@ import BrandList from './BrandList';
29
29
  import EntityList from './EntityList';
30
30
  import LicenseNumber from './LicenseNumber';
31
31
  import EntityLegalName from './EntityLegalName';
32
- import LicenseType from './EntityLicenseType';
33
32
  var ListType;
34
33
  (function (ListType) {
35
34
  ListType["BrandList"] = "BrandList";
@@ -65,8 +64,7 @@ var AuthenticationList = function (_a) {
65
64
  var dispatch = useAppDispatch();
66
65
  var onSubmit = function (formData) {
67
66
  if (isAddEntity) {
68
- var licenseNumber = formData.licenseNumber, legalName = formData.legalName, brandInfo_1 = formData.brandInfo, licenseType = formData.licenseType;
69
- var data_1 = { licenseNumber: licenseNumber, legalName: legalName, brandInfo: brandInfo_1, licenseType: licenseType };
67
+ var data_1 = { licenseNumber: formData.licenseNumber, legalName: formData.legalName, brandInfo: formData.brandInfo };
70
68
  dispatch(createEntity(deepCopy(data_1)));
71
69
  return;
72
70
  }
@@ -78,7 +76,6 @@ var AuthenticationList = function (_a) {
78
76
  setIsAddEntity(false);
79
77
  methods.setValue('licenseNumber', '');
80
78
  methods.setValue('legalName', '');
81
- methods.setValue('licenseType', '');
82
79
  methods.setValue('entityInfo', undefined, { shouldValidate: true });
83
80
  return;
84
81
  }
@@ -99,6 +96,6 @@ var AuthenticationList = function (_a) {
99
96
  };
100
97
  var isBrandList = listActive === ListType.BrandList;
101
98
  var isEntityList = listActive === ListType.EntityList;
102
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { list: brandList || [], show: !isAddEntity && !isEntityList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityList, { countryList: settingsData.countries || [], show: !isBrandList, handleAddEntity: function (flag) { return setIsAddEntity(flag); }, onListOpen: function () { return handleMenuClick(ListType.EntityList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: isAddEntity && !isBrandList && !isEntityList }, { children: [_jsx(EntityLegalName, {}), _jsx(LicenseType, {}), _jsx(LicenseNumber, {})] })), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: isAddEntity ? t('create_new_entity') : t('next') })) }))] })) })) }));
99
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandList, { list: brandList || [], show: !isAddEntity && !isEntityList, onListOpen: function () { return handleMenuClick(ListType.BrandList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EntityList, { countryList: settingsData.countries || [], show: !isBrandList, handleAddEntity: function (flag) { return setIsAddEntity(flag); }, onListOpen: function () { return handleMenuClick(ListType.EntityList); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: isAddEntity && !isBrandList && !isEntityList }, { children: [_jsx(EntityLegalName, {}), _jsx(LicenseNumber, {})] })), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, error: t(error || ''), loading: loading }, { children: isAddEntity ? t('create_new_entity') : t('next') })) }))] })) })) }));
103
100
  };
104
101
  export default React.memo(AuthenticationList);
@@ -81,7 +81,6 @@ var EntityList = function (_a) {
81
81
  if (filteredEntityList.length) {
82
82
  setValue('entityInfo', filteredEntityList[0], { shouldValidate: true });
83
83
  setValue('licenseNumber', '');
84
- setValue('licenseType', '');
85
84
  setValue('legalName', '');
86
85
  handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(false);
87
86
  }
@@ -122,12 +121,8 @@ var EntityList = function (_a) {
122
121
  selectedEntityControl.field.onChange(entity);
123
122
  if (entity.id === ADD_ENTITY)
124
123
  handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(true);
125
- else {
126
- setValue('licenseNumber', '');
127
- setValue('legalName', '');
128
- setValue('licenseType', '');
124
+ else
129
125
  handleAddEntity === null || handleAddEntity === void 0 ? void 0 : handleAddEntity(false);
130
- }
131
126
  onCloseEntityList();
132
127
  };
133
128
  var selectedEntity = selectedEntityControl.field.value;
@@ -3,18 +3,15 @@ export declare const AuthenticationListValidationSchema: yup.ObjectSchema<import
3
3
  brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
4
4
  entityInfo: any;
5
5
  licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
6
- licenseType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
7
6
  legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
7
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
9
8
  brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
10
9
  entityInfo: any;
11
10
  licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
12
- licenseType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
13
11
  legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
14
12
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
15
13
  brandInfo: import("yup/lib/object").RequiredObjectSchema<import("yup/lib/object").ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
16
14
  entityInfo: any;
17
15
  licenseNumber: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
18
- licenseType: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
19
16
  legalName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
20
17
  }>>>;
@@ -34,16 +34,6 @@ export var AuthenticationListValidationSchema = yup.object().shape({
34
34
  .required('');
35
35
  })
36
36
  .required(''),
37
- licenseType: yup
38
- .string()
39
- .when('entityInfo', function (entityInfo) {
40
- var isAddEntity = (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) === ADD_ENTITY;
41
- if (!isAddEntity) {
42
- return yup.string().optional();
43
- }
44
- return yup.string().required('choose_license_type');
45
- })
46
- .required(''),
47
37
  legalName: yup
48
38
  .string()
49
39
  .when('entityInfo', function (entityInfo) {
@@ -84,7 +84,7 @@ var CivilID = function (_a) {
84
84
  var onBackToCountryList = function () {
85
85
  dispatch(handleCurrentActiveScreen('CONNECT_EXPRESS_BUSINESS_COUNTRY_STEP'));
86
86
  };
87
- var disabled = !methods.formState.isValid;
87
+ var disabled = !methods.formState.isValid || !!error;
88
88
  var isLeadIdentityIdAvailable = (_c = (_b = responseData === null || responseData === void 0 ? void 0 : responseData.leadData) === null || _b === void 0 ? void 0 : _b.identification) === null || _c === void 0 ? void 0 : _c.id;
89
89
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(IDNumber, { sx: { mb: methods.formState.isValid ? 7.5 : 0, transition: 'mb 0.3s' } }), _jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBackToCountryList, disableBack: !data.isStartFromBusinessCountry, disabled: disabled, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: isLeadIdPassed ? !isLeadIdentityIdAvailable && !methods.formState.isValid : !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading }, { children: t('mobile_button_label') }))] }))] })) })) }));
90
90
  };
@@ -48,7 +48,7 @@ var CivilID = function (_a) {
48
48
  var onBack = function () {
49
49
  dispatch(handlePrevScreenStep());
50
50
  };
51
- var disabled = !methods.formState.isValid;
51
+ var disabled = !methods.formState.isValid || !!error;
52
52
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(IDNumber, { sx: { mb: 5, transition: 'mb 0.3s' } }), _jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBack, disabled: disabled, error: t(error || '') }, { children: t('next') }))] })) })) }));
53
53
  };
54
54
  export default React.memo(CivilID);
@@ -80,7 +80,7 @@ var CollectBusinessInfo = function (_a) {
80
80
  var onBack = function () {
81
81
  dispatch(handlePrevScreenStep());
82
82
  };
83
- var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName;
83
+ var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName || !!error;
84
84
  var disabled = brandErrChecks || brandNameChecking || isBrandNameAvailable == false;
85
85
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(BrandName, { readOnly: readOnly['brandName'], show: true, brandNameChecking: brandNameChecking, fetchingBrandName: setBrandNameChecking }), _jsx(LicenseList, { readOnly: readOnly['selectedLicense'], onListOpen: function () {
86
86
  setListActive(true);
@@ -89,7 +89,7 @@ var CollectIndividualInfo = function (_a) {
89
89
  }, [responseData]);
90
90
  var isLeadEmailAvailable = (contact === null || contact === void 0 ? void 0 : contact.email) === methods.watch('email');
91
91
  var isEmailValid = typeof isEmailAvailable === 'undefined' ? isLeadEmailAvailable : isEmailAvailable;
92
- var emailErrChecks = !methods.formState.isValid || !!methods.formState.errors.email;
92
+ var emailErrChecks = !methods.formState.isValid || !!methods.formState.errors.email || !!error;
93
93
  var disabled = emailErrChecks || emailChecking || !isEmailValid;
94
94
  var emailReadOnly = readOnly['email'] && !((_b = methods.getFieldState('email').error) === null || _b === void 0 ? void 0 : _b.message) && !methods.getFieldState('email').isDirty;
95
95
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Name, { readOnly: readOnly['name'], show: !listActive }), _jsx(MobileNumber, { readOnly: readOnly['mobile'], show: true, onListOpen: function () { return handleMenuListClick(); }, onListClose: function () { return handleMenuListClick(); }, countries: settingsData.countries }), _jsx(Email, { readOnly: emailReadOnly, show: !listActive, fetchingEmail: function (v) { return setEmailChecking(v); }, emailChecking: emailChecking }), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
@@ -53,7 +53,6 @@ import { useController, useFormContext } from 'react-hook-form';
53
53
  import axios from 'axios';
54
54
  import { styled } from '@mui/material/styles';
55
55
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
56
- import { removeAllOtherThanCharsNumbersAtAndDot } from '../../../../utils';
57
56
  import Collapse from '../../../../components/Collapse';
58
57
  import { ScreenContainer } from '../../../shared/Containers';
59
58
  import Input from '../../../shared/Input';
@@ -89,8 +88,7 @@ var Email = function (_a) {
89
88
  });
90
89
  }); }, 500);
91
90
  var handleEmailChange = function (event) {
92
- var value = removeAllOtherThanCharsNumbersAtAndDot(event.target.value);
93
- emailControl.field.onChange(value);
91
+ emailControl.field.onChange(event.target.value);
94
92
  };
95
93
  React.useEffect(function () {
96
94
  var isValid = emailValue && !error && emailValue.length > 3;
@@ -109,7 +109,7 @@ var Mobile = function (_a) {
109
109
  };
110
110
  var originalReadOnly = useFormReadOnly(methods);
111
111
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
112
- var disabled = !methods.formState.isValid;
112
+ var disabled = !methods.formState.isValid || !!error;
113
113
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputsContainerStyled, { children: _jsx(MobileNumber, { readOnly: readOnly['mobile'], show: true, countries: settingData.countries, onListOpen: handleCountryOpen, onListClose: handleCountryClose }) }), _jsxs(Collapse, __assign({ in: !anchor }, { children: [_jsx(TAC, { show: isLeadIdPassed, readOnly: readOnly['termAndConditionChecked'] }), _jsx(Button, __assign({ isAr: isAr, onBackClicked: onBackToCountryList, disableBack: !data.isStartFromBusinessCountry, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: (isLeadIdPassed ? !isLeadIdentityIdAvailable : !methods.formState.isValid) && !isOther }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), isKuwait ? (_jsx(MobileButton, __assign({ disabled: loading, onClick: function () { return onBack(); }, icon: ICONS_NAMES.PACI_ICON }, { children: t('paci_button_label') }))) : (_jsx(AbsherButton, __assign({ disabled: loading, onClick: function () { return onBack(); } }, { children: t('absher_button_label') })))] }))] }))] })) })) }));
114
114
  };
115
115
  export default React.memo(Mobile);
@@ -91,7 +91,7 @@ var NID = function (_a) {
91
91
  };
92
92
  var originalReadOnly = useFormReadOnly(methods);
93
93
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly);
94
- var disabled = !methods.formState.isValid;
94
+ var disabled = !methods.formState.isValid || !!error;
95
95
  var isLeadIdentityIdAvailable = (_c = (_b = responseData === null || responseData === void 0 ? void 0 : responseData.leadData) === null || _b === void 0 ? void 0 : _b.identification) === null || _c === void 0 ? void 0 : _c.id;
96
96
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(IDNumber, { show: !collapse, readOnly: readOnly['nid'] }) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose, readOnly: readOnly['dob'] }), _jsxs(Collapse, __assign({ in: !collapse }, { children: [_jsx(TAC, { show: isLeadIdPassed, readOnly: readOnly['termAndConditionChecked'] }), _jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBackToCountryList, disableBack: !data.isStartFromBusinessCountry, disabled: disabled, error: t(error || '') }, { children: t('next') })), _jsxs(Collapse, __assign({ in: isLeadIdPassed ? !isLeadIdentityIdAvailable && !methods.formState.isValid : !methods.formState.isValid }, { children: [_jsxs(OrBoxStyled, { children: [_jsx(DividerStyled, {}), _jsx(TextStyled, { children: t('or') }), _jsx(DividerStyled, {})] }), _jsx(MobileButton, __assign({ onClick: function () { return onBack(); }, disabled: loading }, { children: t('mobile_button_label') }))] }))] }))] })) })) }));
97
97
  };
@@ -56,7 +56,7 @@ var NID = function (_a) {
56
56
  var onBack = function () {
57
57
  dispatch(handlePrevScreenStep());
58
58
  };
59
- var disabled = !methods.formState.isValid;
59
+ var disabled = !methods.formState.isValid || !!error;
60
60
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(IDNumber, { show: !collapse }) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(Button, __assign({ loading: loading, isAr: isAr, onBackClicked: onBack, disabled: disabled, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
61
61
  };
62
62
  export default React.memo(NID);
@@ -28,7 +28,7 @@ var SuccessWithFlowButtons = function () {
28
28
  var _b = data.responseData || {}, boardData = _b.boardData, leadData = _b.leadData, boardInfo = _b.boardInfo;
29
29
  var name = (leadData || {}).name;
30
30
  var _c = boardData || {}, business = _c.business, merchant = _c.merchant, bank = _c.bank_account, user = _c.user, individuals = _c.individuals, entity = _c.entity, brand = _c.brand;
31
- var _d = boardInfo || {}, flows = _d.info, recipient = _d.recipient;
31
+ var flows = (boardInfo || {}).info;
32
32
  var boardInfoId = boardInfo === null || boardInfo === void 0 ? void 0 : boardInfo.id;
33
33
  var boardId = boardData === null || boardData === void 0 ? void 0 : boardData.id;
34
34
  var individualsInfo = __assign(__assign({}, individuals), (!(user === null || user === void 0 ? void 0 : user.is_authorized) && { data_state: user === null || user === void 0 ? void 0 : user.data_state }));
@@ -36,6 +36,6 @@ var SuccessWithFlowButtons = function () {
36
36
  var name = _a.name;
37
37
  return name !== FlowsTypes.PASSWORD;
38
38
  }); }, [flows]);
39
- return (_jsx(SuccessFlowButtons, { flowName: data.flowName, bank: bank, loading: loading, boardId: boardId, boardInfoId: boardInfoId, brand: brand, business: business, entity: entity, flows: filteredFlows || [], merchant: merchant, individuals: individualsInfo, user: __assign({ names: { en: name } }, user), onClose: isScopeAuthentication ? onClose : undefined, recipient: recipient }));
39
+ return (_jsx(SuccessFlowButtons, { flowName: data.flowName, bank: bank, loading: loading, boardId: boardId, boardInfoId: boardInfoId, brand: brand, business: business, entity: entity, flows: filteredFlows || [], merchant: merchant, individuals: individualsInfo, user: __assign({ names: { en: name } }, user), onClose: isScopeAuthentication ? onClose : undefined }));
40
40
  };
41
41
  export default memo(SuccessWithFlowButtons);
@@ -2,7 +2,6 @@ import { LibConfig } from '../../@types';
2
2
  export interface EntityLibProps extends LibConfig {
3
3
  verifyToken?: string;
4
4
  configToken?: string;
5
- loaderColor?: string;
6
5
  }
7
6
  export declare function EntityElement(props: EntityLibProps): import("react/jsx-runtime").JSX.Element;
8
7
  export declare function renderEntityLib(config: EntityLibProps, elementId: string): {
@@ -36,7 +36,7 @@ import { entityFeatureScreens } from '../featuresScreens';
36
36
  import { entitySelector, verifyLeadToken } from '../app/entity/entityStore';
37
37
  import Background from '../shared/Background';
38
38
  var Entity = memo(function (_a) {
39
- var configToken = _a.configToken, verifyToken = _a.verifyToken, loaderColor = _a.loaderColor, props = __rest(_a, ["configToken", "verifyToken", "loaderColor"]);
39
+ var configToken = _a.configToken, verifyToken = _a.verifyToken, props = __rest(_a, ["configToken", "verifyToken"]);
40
40
  var theme = useAppTheme().theme;
41
41
  var _b = useAppSelector(settingsSelector), data = _b.data, error = _b.error, settingLoading = _b.loading;
42
42
  var _c = useAppSelector(entitySelector), customLoading = _c.customLoading, entityError = _c.error, loading = _c.loading;
@@ -49,7 +49,6 @@ var Entity = memo(function (_a) {
49
49
  loadingScreenName: 'ENTITY_LOADING_DATA_STEP',
50
50
  navigation: featureScreensNavigation,
51
51
  open: open,
52
- mode: props.mode,
53
52
  internalToken: verifyToken,
54
53
  settingLoading: settingLoading
55
54
  });
@@ -58,8 +57,8 @@ var Entity = memo(function (_a) {
58
57
  title: 'Entity'
59
58
  });
60
59
  }, []);
61
- var initialLoading = verifyToken && props.mode !== 'content' ? settingLoading : settingLoading || customLoading;
62
- 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, open: open, error: error, loading: initialLoading, loaderColor: loaderColor, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, type: props.mode === 'content' ? 'CONTENT' : undefined, dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ mode: props.mode, isMaturityExpress: isMaturityExpress }, { children: entityFeatureScreens.map(function (_a, index) {
60
+ var initialLoading = verifyToken ? settingLoading : settingLoading || customLoading;
61
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, open: open, error: error, loading: initialLoading, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, type: props.mode === 'content' ? 'CONTENT' : undefined, dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: entityFeatureScreens.map(function (_a, index) {
63
62
  var Element = _a.element, name = _a.name;
64
63
  var isActive = activeScreen.name === name;
65
64
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -14,17 +14,16 @@ import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
17
- import { settingsSelector } from '../../../../app/settings';
18
- import { formatNumberAsCurrency, getCurrencyByCountryIso2, removeAllCharsFromNumber } from '../../../../utils';
17
+ import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
19
18
  import { ScreenContainer } from '../../../shared/Containers';
20
19
  import Input from '../../../shared/Input';
21
- import { clearError } from '../../../app/entity/entityStore';
20
+ import { clearError, entitySelector } from '../../../app/entity/entityStore';
22
21
  import { EndAdornment } from '../../../shared/EndAdornment';
23
22
  var CapitalPaid = function (_a) {
24
23
  var _b;
25
24
  var readOnly = _a.readOnly, isVerified = _a.isVerified;
26
25
  var t = useTranslation().t;
27
- var settingsData = useAppSelector(settingsSelector).data;
26
+ var data = useAppSelector(entitySelector).data;
28
27
  var control = useFormContext().control;
29
28
  var dispatch = useAppDispatch();
30
29
  var handleChange = function (_a) {
@@ -34,14 +33,11 @@ var CapitalPaid = function (_a) {
34
33
  var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
35
34
  capitalPaidControl.field.onChange(value);
36
35
  };
37
- var getCurrency = React.useMemo(function () {
38
- return t(getCurrencyByCountryIso2(settingsData.businessCountry.iso2));
39
- }, [settingsData.businessCountry.iso2]);
40
36
  var capitalPaidControl = useController({ control: control, name: 'capitalPaid' });
41
37
  var capitalPaidValue = capitalPaidControl.field.value;
42
38
  var error = (_b = capitalPaidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
43
39
  return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_paid_label', {
44
- currency: getCurrency
40
+ currency: t(data.currency)
45
41
  }), required: true, onChange: handleChange, value: capitalPaidValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_paid_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalPaidValue, isVerified: isVerified }) }) })));
46
42
  };
47
43
  export default React.memo(CapitalPaid);
@@ -13,18 +13,17 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
- import { formatNumberAsCurrency, getCurrencyByCountryIso2, removeAllCharsFromNumber } from '../../../../utils';
16
+ import { formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
17
17
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
18
- import { settingsSelector } from '../../../../app/settings';
19
18
  import { ScreenContainer } from '../../../shared/Containers';
20
19
  import Input from '../../../shared/Input';
21
- import { clearError } from '../../../app/entity/entityStore';
20
+ import { clearError, entitySelector } from '../../../app/entity/entityStore';
22
21
  import { EndAdornment } from '../../../shared/EndAdornment';
23
22
  var CapitalShareValue = function (_a) {
24
23
  var _b;
25
24
  var readOnly = _a.readOnly, isVerified = _a.isVerified;
26
25
  var t = useTranslation().t;
27
- var settingsData = useAppSelector(settingsSelector).data;
26
+ var data = useAppSelector(entitySelector).data;
28
27
  var control = useFormContext().control;
29
28
  var dispatch = useAppDispatch();
30
29
  var handleChange = function (_a) {
@@ -34,14 +33,11 @@ var CapitalShareValue = function (_a) {
34
33
  var value = formatNumberAsCurrency(removeAllCharsFromNumber(target.value));
35
34
  capitalShareValueControl.field.onChange(value);
36
35
  };
37
- var getCurrency = React.useMemo(function () {
38
- return t(getCurrencyByCountryIso2(settingsData.businessCountry.iso2));
39
- }, [settingsData.businessCountry.iso2]);
40
36
  var capitalShareValueControl = useController({ control: control, name: 'capitalShareValue' });
41
37
  var capitalShareValueValue = capitalShareValueControl.field.value;
42
38
  var error = (_b = capitalShareValueControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
43
39
  return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_share_value_label', {
44
- currency: getCurrency
40
+ currency: t(data.currency)
45
41
  }), required: true, onChange: handleChange, value: capitalShareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareValueValue, isVerified: isVerified }) }) })));
46
42
  };
47
43
  export default React.memo(CapitalShareValue);
@@ -80,7 +80,7 @@ var EntityCapital = function (_a) {
80
80
  var handleActivitiesOpenClose = function (flag) {
81
81
  setAnchorEl(flag);
82
82
  };
83
- var disabled = !methods.formState.isValid || uploading;
83
+ var disabled = !methods.formState.isValid || !!error || uploading;
84
84
  return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(ActivityList, { readOnly: readOnly['activities'] || noneEditable['activities'], onListOpen: function () { return handleActivitiesOpenClose(true); }, onListClose: function () { return handleActivitiesOpenClose(false); } }), _jsxs(Collapse, __assign({ in: !anchorEl }, { children: [_jsx(CapitalPaid, { readOnly: readOnly['capitalPaid'] || noneEditable['capital.paid'], isVerified: isCapitalPaidVerified }), _jsx(CapitalShareCount, { readOnly: readOnly['capitalShareCount'] || noneEditable['capital.shares.count'], isVerified: isCapitalShareCountVerified }), _jsx(CapitalShareValue, { readOnly: readOnly['capitalShareValue'] || noneEditable['capital.shares.value'], isVerified: isCapitalShareValueVerified }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] }))] })) })) }));
85
85
  };
86
86
  export default EntityCapital;
@@ -136,7 +136,7 @@ var EntityName = function (_a) {
136
136
  if (error)
137
137
  dispatch(clearError());
138
138
  }, [methods.formState.isValid]);
139
- var disabled = !methods.formState.isValid || uploading || uploadingArticle;
139
+ var disabled = !methods.formState.isValid || !!error || uploading || uploadingArticle;
140
140
  var showLicenseNumber = isKWCountry ? isCR : true;
141
141
  var showUnifiedNumber = isSACountry ? isCR : false;
142
142
  var disableBack = settingsData.appConfig.mode === 'content';
@@ -21,10 +21,10 @@ var SuccessWithFlowButtons = function () {
21
21
  var _a = useAppSelector(entitySelector), 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(onCloseCompleteEntity());
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, individuals: individuals, boardInfoId: board_info_id, 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, individuals: individuals, boardInfoId: board_info_id, 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(verifyEntityLeadOTP(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, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
77
77
  };
78
78
  export default React.memo(VerifyNumber);
@@ -44,6 +44,7 @@ import AuthMerchantScreen from './auth/screens/AuthMerchant';
44
44
  import AuthAccountCreatedLoaderScreen from './auth/screens/AccountCreatedLoader';
45
45
  import AuthEmailSentScreen from './auth/screens/EmailSent';
46
46
  import AuthMigratingDataScreen from './auth/screens/MigratingData';
47
+ import AuthOperatorError from './auth/screens/OperatorError';
47
48
  import CustomersPage from './business/screens/Customers';
48
49
  import IDBODPage from './business/screens/IDBOD';
49
50
  import BusinessVerifyPage from './business/screens/Verify';
@@ -58,7 +59,6 @@ import BusVerifyPACIScreen from './business/screens/VerifyPACI';
58
59
  import BrandVerifyScreen from './business/screens/BrandDetails';
59
60
  import PasswordVerifyPage from './password/screens/Verify';
60
61
  import CreatePasswordPage from './password/screens/CreatePassword';
61
- import PasswordDataLoadingPage from './password/screens/PrepareDataLoading';
62
62
  import PasswordOTPPage from './password/screens/OTP';
63
63
  import SuccessPasswordPage from './password/screens/Success';
64
64
  import PasswordSuccessWithFlowPage from './password/screens/SuccessWithFlowButtons';
@@ -294,6 +294,10 @@ export var authFeatureScreens = [
294
294
  {
295
295
  name: 'AUTH_MIGRATING_DATA_STEP',
296
296
  element: AuthMigratingDataScreen
297
+ },
298
+ {
299
+ name: 'AUTH_OPERATOR_ERROR_STEP',
300
+ element: AuthOperatorError
297
301
  }
298
302
  ];
299
303
  export var businessFeatureScreens = [
@@ -343,10 +347,6 @@ export var passwordFeatureScreens = [
343
347
  name: 'PASSWORD_CREATE_PASSWORD_STEP',
344
348
  element: CreatePasswordPage
345
349
  },
346
- {
347
- name: 'PASSWORD_LOADING_DATA_STEP',
348
- element: PasswordDataLoadingPage
349
- },
350
350
  {
351
351
  name: 'PASSWORD_RESET_PASSWORD_OTP_STEP',
352
352
  element: PasswordOTPPage
@@ -2,7 +2,6 @@ import { LibConfig } from '../../@types';
2
2
  export interface IndividualLibProps extends LibConfig {
3
3
  verifyToken?: string;
4
4
  configToken?: string;
5
- loaderColor?: string;
6
5
  }
7
6
  export declare function IndividualElement(props: IndividualLibProps): import("react/jsx-runtime").JSX.Element;
8
7
  export declare function renderIndividualLib(config: IndividualLibProps, elementId: string): {
@@ -36,7 +36,7 @@ import { individualFeatureScreens } from '../featuresScreens';
36
36
  import { individualSelector, verifyLeadToken } from '../app/individual/individualStore';
37
37
  import Background from '../shared/Background';
38
38
  var Individual = memo(function (_a) {
39
- var configToken = _a.configToken, verifyToken = _a.verifyToken, loaderColor = _a.loaderColor, props = __rest(_a, ["configToken", "verifyToken", "loaderColor"]);
39
+ var configToken = _a.configToken, verifyToken = _a.verifyToken, props = __rest(_a, ["configToken", "verifyToken"]);
40
40
  var theme = useAppTheme().theme;
41
41
  var _b = useAppSelector(settingsSelector), data = _b.data, error = _b.error, settingLoading = _b.loading;
42
42
  var _c = useAppSelector(individualSelector), customLoading = _c.customLoading, individualError = _c.error, loading = _c.loading;
@@ -49,7 +49,6 @@ var Individual = memo(function (_a) {
49
49
  loadingScreenName: 'INDIVIDUAL_LOADING_DATA_STEP',
50
50
  navigation: featureScreensNavigation,
51
51
  open: open,
52
- mode: props.mode,
53
52
  internalToken: verifyToken,
54
53
  settingLoading: settingLoading
55
54
  });
@@ -58,8 +57,8 @@ var Individual = memo(function (_a) {
58
57
  title: 'Individual'
59
58
  });
60
59
  }, []);
61
- var initialLoading = verifyToken && props.mode !== 'content' ? settingLoading : settingLoading || customLoading;
62
- 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, loaderColor: loaderColor, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, type: props.mode === 'content' ? 'CONTENT' : undefined, dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ mode: props.mode, isMaturityExpress: isMaturityExpress }, { children: individualFeatureScreens.map(function (_a, index) {
60
+ var initialLoading = verifyToken ? settingLoading : settingLoading || customLoading;
61
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: initialLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, loading: initialLoading, error: error, open: open, breakpoint: 'sm', screenId: activeScreen.name, merchantInfo: merchant, isMaturityExpress: isMaturityExpress, type: props.mode === 'content' ? 'CONTENT' : undefined, dialogEdgeFormat: data.appConfig.dialogEdgeFormat }, { children: _jsx(FeatureContainer, __assign({ isMaturityExpress: isMaturityExpress }, { children: individualFeatureScreens.map(function (_a, index) {
63
62
  var Element = _a.element, name = _a.name;
64
63
  var isActive = activeScreen.name === name;
65
64
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -19,7 +19,7 @@ import Box from '@mui/material/Box';
19
19
  import { alpha, styled } from '@mui/material/styles';
20
20
  import { useAppDispatch, useAppSelector, useSetFromDefaultValues, useLanguage, useFormReadOnly, useDataNoneEditable, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
21
21
  import { DocumentPurpose, IndividualType } from '../../../../@types';
22
- import { deepCopy, getIndividualType, isKW, isKWOrSA } from '../../../../utils';
22
+ import { deepCopy, getIndividualType, isKW } from '../../../../utils';
23
23
  import Form from '../../../../components/Form';
24
24
  import Collapse from '../../../../components/Collapse';
25
25
  import Text from '../../../../components/Text';
@@ -37,7 +37,6 @@ import SignatureFile from './SignatureFile';
37
37
  import ShareCount from './ShareCount';
38
38
  import ShareValue from './ShareValue';
39
39
  import { getFileDetailsFromDocument } from '../../../../utils';
40
- import IsAuthorizedSwitch from './IsAuthorizedSwitch';
41
40
  var TextBoxStyled = styled(Box)(function (_a) {
42
41
  var theme = _a.theme;
43
42
  return (__assign(__assign({ display: 'flex', justifyContent: 'center', flexDirection: 'row', padding: theme.spacing(1.8, 2.5, 1.8, 2.5) }, theme.typography.body1), { lineHeight: theme.spacing(2.5), color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightMedium }));
@@ -61,13 +60,11 @@ var AdditionalIndividualInfo = function (_a) {
61
60
  var settingsData = useAppSelector(settingsSelector).data;
62
61
  var verify = data.verify;
63
62
  var user = (verify.responseBody || {}).user;
64
- var _d = data.individualData, occupation = _d.occupation, sourceIncome = _d.sourceIncome, monthlyIncome = _d.monthlyIncome, employerName = _d.employerName, isPEP = _d.isPEP, isInfluencer = _d.isInfluencer, civilID = _d.civilID, signatureFileId = _d.signatureFileId, civilIDUploading = _d.civilIDUploading, signatureFileUploading = _d.signatureFileUploading, shareCount = _d.shareCount, shareValue = _d.shareValue, isAuthorized = _d.isAuthorized;
63
+ var _d = data.individualData, occupation = _d.occupation, sourceIncome = _d.sourceIncome, monthlyIncome = _d.monthlyIncome, employerName = _d.employerName, isPEP = _d.isPEP, isInfluencer = _d.isInfluencer, civilID = _d.civilID, signatureFileId = _d.signatureFileId, civilIDUploading = _d.civilIDUploading, signatureFileUploading = _d.signatureFileUploading, shareCount = _d.shareCount, shareValue = _d.shareValue;
65
64
  var _e = user || {}, documents = _e.documents, is_authorized = _e.is_authorized, data_status = _e.data_status, data_verification = _e.data_verification, names = _e.names, role = _e.role, occupationRes = _e.occupation, is_relative_PEP = _e.is_relative_PEP, is_influencer = _e.is_influencer, objects = _e.objects;
66
65
  var isKWCountry = React.useMemo(function () { return isKW(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
67
- var isOtherThanKWAndSa = React.useMemo(function () { return !isKWOrSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
68
- var showIsAuthorized = isOtherThanKWAndSa;
69
66
  var methods = useForm({
70
- resolver: yupResolver(IndividualInfoValidationSchema(objects, isKWCountry, showIsAuthorized)),
67
+ resolver: yupResolver(IndividualInfoValidationSchema(objects, isKWCountry)),
71
68
  defaultValues: {
72
69
  occupation: occupation,
73
70
  sourceIncome: sourceIncome,
@@ -80,8 +77,7 @@ var AdditionalIndividualInfo = function (_a) {
80
77
  civilIDUploading: civilIDUploading,
81
78
  signatureFileUploading: signatureFileUploading,
82
79
  shareCount: shareCount,
83
- shareValue: shareValue,
84
- isAuthorized: isAuthorized
80
+ shareValue: shareValue
85
81
  },
86
82
  mode: 'onChange'
87
83
  });
@@ -100,8 +96,7 @@ var AdditionalIndividualInfo = function (_a) {
100
96
  'source_of_income',
101
97
  'monthly_income',
102
98
  'is_relative_PEP',
103
- 'is_influencer',
104
- 'is_authorized'
99
+ 'is_influencer'
105
100
  ]);
106
101
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
107
102
  var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
@@ -109,10 +104,9 @@ var AdditionalIndividualInfo = function (_a) {
109
104
  var isOccupationVerified = dataVerified['occupation'] && (occupationRes === null || occupationRes === void 0 ? void 0 : occupationRes.id) === ((_b = watch('occupation')) === null || _b === void 0 ? void 0 : _b.id);
110
105
  var isPEPSwitchVerified = dataVerified['is_relative_PEP'] && is_relative_PEP === watch('isPEP');
111
106
  var isInfluencerSwitchVerified = dataVerified['is_influencer'] && is_influencer === watch('isInfluencer');
112
- var isAuthorizedSwitchVerified = dataVerified['is_authorized'] && is_authorized === watch('isAuthorized');
113
107
  var _f = React.useState(), listActive = _f[0], setListActive = _f[1];
114
108
  var onSubmit = function (data) {
115
- dispatch(updateIndividualInfo(deepCopy(getFelids(__assign(__assign({}, data), { signatureFileUploading: signatureFileUploading, civilIDUploading: civilIDUploading })))));
109
+ dispatch(updateIndividualInfo(deepCopy(getFelids(data))));
116
110
  };
117
111
  var onBack = function () {
118
112
  dispatch(handleCurrentActiveScreen('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
@@ -140,7 +134,6 @@ var AdditionalIndividualInfo = function (_a) {
140
134
  var _g = React.useMemo(function () { return getIndividualType(objects); }, [objects]), isUser = _g.isUser, isShareholder = _g.isShareholder, isBoardMember = _g.isBoardMember, isBuyer = _g.isBuyer;
141
135
  var isUserORBuyerType = isUser || isBuyer;
142
136
  var isUserORBoardMemberType = isUser || isBoardMember;
143
- var isAuthorizedValue = watch('isAuthorized');
144
137
  var showSignatureFile = isUserORBuyerType;
145
138
  var showOccupationFile = isUserORBuyerType;
146
139
  var showSourceOfIncome = isUserORBuyerType;
@@ -151,7 +144,7 @@ var AdditionalIndividualInfo = function (_a) {
151
144
  var isMonthlyIncomeListActive = listActive === ListType.MonthlyIncomeList;
152
145
  var isOccupationListActive = listActive === ListType.OccupationList;
153
146
  var disabled = !methods.formState.isValid || civilIDUploading || signatureFileUploading;
154
- return (_jsxs(ScreenContainer, { children: [_jsx(Collapse, __assign({ in: !listActive && !!is_authorized, timeout: 500 }, { children: _jsxs(TextBoxStyled, { children: [getUserName() || '', _jsx(RoleTextStyled, { children: getUserRole() || '' })] }) })), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Occupation, { isVerified: isOccupationVerified, readOnly: readOnly['occupation'] || noneEditable['occupation'], onListOpen: function () { return handleMenuClick(ListType.OccupationList); }, onListClose: function () { return handleMenuClick(); }, show: showOccupationFile && !isMonthlyIncomeListActive && !isSourceOfIncomeListActive }), _jsx(SourceOfIncome, { readOnly: readOnly['sourceIncome'] || noneEditable['source_of_income'], onListOpen: function () { return handleMenuClick(ListType.SourceOfIncomeList); }, onListClose: function () { return handleMenuClick(); }, show: showSourceOfIncome && !isMonthlyIncomeListActive && !isOccupationListActive }), _jsx(MonthlyIncome, { readOnly: readOnly['monthlyIncome'] || noneEditable['monthly_income'], show: showSourceOfIncome && !isSourceOfIncomeListActive && !isOccupationListActive, onListOpen: function () { return handleMenuClick(ListType.MonthlyIncomeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ShareCount, { show: !listActive && showShares, readOnly: readOnly['shareCount'] }), _jsx(ShareValue, { show: !listActive && showShares, readOnly: readOnly['shareValue'] }), _jsx(IsAuthorizedSwitch, { show: !listActive && showIsAuthorized, readOnly: readOnly['isAuthorized'] || noneEditable['is_authorized'], isVerified: isAuthorizedSwitchVerified }), _jsxs(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: [_jsx(CivilIDFile, { show: isKWCountry, readOnly: readOnly['civilID'], defaultFiles: defaultCivilIdFiles }), _jsx(SignatureFile, { show: isAuthorizedValue && showSignatureFile, readOnly: readOnly['signatureFileId'], defaultFiles: defaultSignatureFiles })] })), _jsx(PEPSwitch, { show: showIsPEP && !listActive, readOnly: readOnly['isPEP'] || noneEditable['is_relative_PEP'], isVerified: isPEPSwitchVerified }), _jsx(InfluencerSwitch, { show: showIsInfluencer && isKWCountry && !listActive, readOnly: readOnly['isInfluencer'] || noneEditable['is_influencer'], isVerified: isInfluencerSwitchVerified })] }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) }))] }));
147
+ return (_jsxs(ScreenContainer, { children: [_jsx(Collapse, __assign({ in: !listActive && !!is_authorized, timeout: 500 }, { children: _jsx(TextBoxStyled, { children: getUserName() || '' }) })), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Occupation, { isVerified: isOccupationVerified, readOnly: readOnly['occupation'] || noneEditable['occupation'], onListOpen: function () { return handleMenuClick(ListType.OccupationList); }, onListClose: function () { return handleMenuClick(); }, show: showOccupationFile && !isMonthlyIncomeListActive && !isSourceOfIncomeListActive }), _jsx(SourceOfIncome, { readOnly: readOnly['sourceIncome'] || noneEditable['source_of_income'], onListOpen: function () { return handleMenuClick(ListType.SourceOfIncomeList); }, onListClose: function () { return handleMenuClick(); }, show: showSourceOfIncome && !isMonthlyIncomeListActive && !isOccupationListActive }), _jsx(MonthlyIncome, { readOnly: readOnly['monthlyIncome'] || noneEditable['monthly_income'], show: showSourceOfIncome && !isSourceOfIncomeListActive && !isOccupationListActive, onListOpen: function () { return handleMenuClick(ListType.MonthlyIncomeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ShareCount, { show: !listActive && showShares, readOnly: readOnly['shareCount'] }), _jsx(ShareValue, { show: !listActive && showShares, readOnly: readOnly['shareValue'] }), _jsxs(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: [_jsx(CivilIDFile, { show: isKWCountry, readOnly: readOnly['civilID'], defaultFiles: defaultCivilIdFiles }), _jsx(SignatureFile, { show: is_authorized && showSignatureFile, readOnly: readOnly['signatureFileId'], defaultFiles: defaultSignatureFiles })] })), _jsx(PEPSwitch, { show: showIsPEP && !listActive, readOnly: readOnly['isPEP'] || noneEditable['is_relative_PEP'], isVerified: isPEPSwitchVerified }), _jsx(InfluencerSwitch, { show: showIsInfluencer && isKWCountry && !listActive, readOnly: readOnly['isInfluencer'] || noneEditable['is_influencer'], isVerified: isInfluencerSwitchVerified })] }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) }))] }));
155
148
  };
156
149
  export default React.memo(AdditionalIndividualInfo);
157
150
  AdditionalIndividualInfo.defaultProps = {};