@tap-payments/auth-jsconnect 2.0.54-test → 2.0.56-test

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 (203) hide show
  1. package/build/@types/app.d.ts +39 -14
  2. package/build/@types/app.js +9 -0
  3. package/build/@types/form.d.ts +11 -0
  4. package/build/api/auth.d.ts +14 -1
  5. package/build/api/auth.js +24 -1
  6. package/build/api/axios.js +2 -2
  7. package/build/api/data.d.ts +33 -7
  8. package/build/api/data.js +41 -16
  9. package/build/api/entity.d.ts +2 -0
  10. package/build/api/index.d.ts +11 -8
  11. package/build/api/individual.d.ts +1 -1
  12. package/build/app/rootReducer.d.ts +3 -0
  13. package/build/app/rootReducer.js +7 -1
  14. package/build/app/settings.js +8 -2
  15. package/build/app/store.d.ts +7 -1
  16. package/build/assets/locales/ar.json +14 -4
  17. package/build/assets/locales/en.json +14 -4
  18. package/build/components/AnimationFlow/AnimationFlow.d.ts +4 -1
  19. package/build/components/AnimationFlow/AnimationFlow.js +5 -7
  20. package/build/components/AnimationFlow/BottomSheet.js +2 -1
  21. package/build/components/AnimationFlow/Dialog.d.ts +4 -1
  22. package/build/components/AnimationFlow/Dialog.js +9 -4
  23. package/build/components/FileInput/DragAndDrop.d.ts +9 -1
  24. package/build/components/FileInput/DragAndDrop.js +113 -8
  25. package/build/components/Lottie/Lottie.d.ts +878 -0
  26. package/build/components/Lottie/Lottie.js +58 -0
  27. package/build/components/Lottie/files/pulsating_circle_waves.json +236 -0
  28. package/build/components/Lottie/files/success.json +425 -0
  29. package/build/components/Lottie/index.d.ts +3 -0
  30. package/build/components/Lottie/index.js +3 -0
  31. package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -0
  32. package/build/components/ProgressBar/CircularProgressBar.js +48 -0
  33. package/build/components/ProgressBar/index.d.ts +2 -0
  34. package/build/components/ProgressBar/index.js +2 -0
  35. package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +2 -1
  36. package/build/components/SocialMediaGroup/SocialMediaGroup.js +27 -34
  37. package/build/constants/api.d.ts +1 -0
  38. package/build/constants/api.js +10 -7
  39. package/build/constants/app.d.ts +15 -0
  40. package/build/constants/app.js +75 -3
  41. package/build/constants/assets.d.ts +17 -1
  42. package/build/constants/assets.js +22 -6
  43. package/build/constants/validation.d.ts +1 -0
  44. package/build/constants/validation.js +1 -0
  45. package/build/features/app/auth/authStore.d.ts +35 -0
  46. package/build/features/app/auth/authStore.js +148 -0
  47. package/build/features/app/bank/bankStore.d.ts +4 -0
  48. package/build/features/app/bank/bankStore.js +42 -22
  49. package/build/features/app/business/businessStore.js +53 -43
  50. package/build/features/app/connect/connectStore.d.ts +13 -1
  51. package/build/features/app/connect/connectStore.js +164 -4
  52. package/build/features/app/entity/entityStore.d.ts +53 -0
  53. package/build/features/app/entity/entityStore.js +461 -0
  54. package/build/features/app/individual/individualStore.js +19 -11
  55. package/build/features/app/otp/otpStore.d.ts +28 -0
  56. package/build/features/app/otp/otpStore.js +153 -0
  57. package/build/features/app/signIn/signInStore.js +2 -2
  58. package/build/features/auth/Auth.d.ts +10 -0
  59. package/build/features/auth/Auth.js +87 -0
  60. package/build/features/auth/index.d.ts +1 -0
  61. package/build/features/auth/index.js +1 -0
  62. package/build/features/auth/screens/OTP/OTP.d.ts +5 -0
  63. package/build/features/auth/screens/OTP/OTP.js +72 -0
  64. package/build/features/auth/screens/OTP/OTPInput.d.ts +5 -0
  65. package/build/features/auth/screens/OTP/OTPInput.js +44 -0
  66. package/build/features/auth/screens/OTP/index.d.ts +3 -0
  67. package/build/features/auth/screens/OTP/index.js +2 -0
  68. package/build/features/auth/screens/OTP/validation.d.ts +8 -0
  69. package/build/features/auth/screens/OTP/validation.js +4 -0
  70. package/build/features/bank/Bank.js +10 -4
  71. package/build/features/bank/screens/BankDetails/BankDetails.js +2 -2
  72. package/build/features/bank/screens/BankDetails/BankStatement.js +33 -8
  73. package/build/features/business/Business.d.ts +1 -1
  74. package/build/features/business/Business.js +12 -5
  75. package/build/features/business/screens/Activities/ActivitiesList.d.ts +1 -1
  76. package/build/features/business/screens/Activities/SalesChannels.js +1 -1
  77. package/build/features/business/screens/Customers/CustomerLocations.d.ts +2 -2
  78. package/build/features/business/screens/Customers/CustomerLocations.js +25 -7
  79. package/build/features/business/screens/Customers/ExpectedCustomers.js +16 -4
  80. package/build/features/business/screens/Customers/ExpectedSalesRange.js +32 -14
  81. package/build/features/connect/Connect.d.ts +2 -1
  82. package/build/features/connect/Connect.js +40 -10
  83. package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
  84. package/build/features/connect/screens/CivilID/CivilID.js +85 -0
  85. package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -0
  86. package/build/features/connect/screens/CivilID/IDNumber.js +59 -0
  87. package/build/features/connect/screens/CivilID/index.d.ts +3 -0
  88. package/build/features/connect/screens/CivilID/index.js +2 -0
  89. package/build/features/connect/screens/CivilID/validation.d.ts +8 -0
  90. package/build/features/connect/screens/CivilID/validation.js +4 -0
  91. package/build/features/connect/screens/Individual/Individual.js +6 -2
  92. package/build/features/connect/screens/Merchant/Merchant.js +35 -11
  93. package/build/features/connect/screens/Merchant/SalesChannels.d.ts +5 -0
  94. package/build/features/connect/screens/Merchant/SalesChannels.js +114 -0
  95. package/build/features/connect/screens/Merchant/SocialMedia.js +56 -11
  96. package/build/features/connect/screens/Merchant/validation.d.ts +87 -0
  97. package/build/features/connect/screens/Merchant/validation.js +68 -2
  98. package/build/features/connect/screens/Mobile/Mobile.js +7 -4
  99. package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  100. package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +169 -0
  101. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +5 -0
  102. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +22 -0
  103. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  104. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  105. package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -0
  106. package/build/features/connect/screens/VerifyPACI/index.js +2 -0
  107. package/build/features/entity/Entity.d.ts +7 -0
  108. package/build/features/entity/Entity.js +70 -0
  109. package/build/features/entity/index.d.ts +1 -0
  110. package/build/features/entity/index.js +1 -0
  111. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +54 -0
  112. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +139 -0
  113. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.d.ts +5 -0
  114. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +56 -0
  115. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.d.ts +5 -0
  116. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +17 -0
  117. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +5 -0
  118. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +28 -0
  119. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.d.ts +6 -0
  120. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +38 -0
  121. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.d.ts +5 -0
  122. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.js +112 -0
  123. package/build/features/entity/screens/EntityInfoConfirm/index.d.ts +2 -0
  124. package/build/features/entity/screens/EntityInfoConfirm/index.js +2 -0
  125. package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +107 -0
  126. package/build/features/entity/screens/EntityInfoConfirm/validation.js +17 -0
  127. package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
  128. package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
  129. package/build/features/entity/screens/ResetPasswordSuccess/index.d.ts +3 -0
  130. package/build/features/entity/screens/ResetPasswordSuccess/index.js +2 -0
  131. package/build/features/entity/screens/Success/Success.d.ts +5 -0
  132. package/build/features/entity/screens/Success/Success.js +16 -0
  133. package/build/features/entity/screens/Success/index.d.ts +3 -0
  134. package/build/features/entity/screens/Success/index.js +2 -0
  135. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
  136. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +109 -0
  137. package/build/features/entity/screens/SuccessWithFlowButtons/index.d.ts +2 -0
  138. package/build/features/entity/screens/SuccessWithFlowButtons/index.js +2 -0
  139. package/build/features/entity/screens/Verify/OTPInput.d.ts +7 -0
  140. package/build/features/entity/screens/Verify/OTPInput.js +47 -0
  141. package/build/features/entity/screens/Verify/Verify.d.ts +5 -0
  142. package/build/features/entity/screens/Verify/Verify.js +78 -0
  143. package/build/features/entity/screens/Verify/index.d.ts +2 -0
  144. package/build/features/entity/screens/Verify/index.js +2 -0
  145. package/build/features/entity/screens/Verify/validation.d.ts +8 -0
  146. package/build/features/entity/screens/Verify/validation.js +4 -0
  147. package/build/features/featuresScreens.d.ts +3 -0
  148. package/build/features/featuresScreens.js +48 -0
  149. package/build/features/individual/Individual.d.ts +1 -1
  150. package/build/features/individual/Individual.js +12 -5
  151. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +1 -1
  152. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +14 -3
  153. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +11 -3
  154. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +2 -2
  155. package/build/features/otp/OTP.d.ts +7 -0
  156. package/build/features/otp/OTP.js +58 -0
  157. package/build/features/otp/index.d.ts +0 -0
  158. package/build/features/otp/index.js +1 -0
  159. package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +6 -0
  160. package/build/features/otp/screens/OTPVerify/OTPInput.js +47 -0
  161. package/build/features/otp/screens/OTPVerify/Verify.d.ts +5 -0
  162. package/build/features/otp/screens/OTPVerify/Verify.js +49 -0
  163. package/build/features/otp/screens/OTPVerify/index.d.ts +2 -0
  164. package/build/features/otp/screens/OTPVerify/index.js +2 -0
  165. package/build/features/otp/screens/OTPVerify/validation.d.ts +8 -0
  166. package/build/features/otp/screens/OTPVerify/validation.js +4 -0
  167. package/build/features/password/Password.d.ts +1 -1
  168. package/build/features/password/Password.js +12 -5
  169. package/build/features/shared/Background/Background.d.ts +7 -5
  170. package/build/features/shared/Background/Background.js +16 -5
  171. package/build/features/shared/Dialog/CloseDialog.d.ts +11 -0
  172. package/build/features/shared/Dialog/CloseDialog.js +62 -0
  173. package/build/features/shared/Dialog/DialogContainer.d.ts +8 -0
  174. package/build/features/shared/Dialog/DialogContainer.js +56 -0
  175. package/build/features/shared/Dialog/index.d.ts +4 -0
  176. package/build/features/shared/Dialog/index.js +4 -0
  177. package/build/features/shared/Input/Input.d.ts +1 -1
  178. package/build/features/shared/Input/Input.js +2 -2
  179. package/build/features/shared/UploadFile/UploadFile.d.ts +8 -3
  180. package/build/features/shared/UploadFile/UploadFile.js +23 -8
  181. package/build/features/signIn/SignIn.d.ts +1 -1
  182. package/build/features/signIn/SignIn.js +12 -4
  183. package/build/features/tax/Tax.d.ts +1 -1
  184. package/build/features/tax/Tax.js +12 -4
  185. package/build/hooks/index.d.ts +1 -0
  186. package/build/hooks/index.js +1 -0
  187. package/build/hooks/useAppConfig.js +2 -0
  188. package/build/hooks/useAppDispatch.d.ts +3 -0
  189. package/build/hooks/useErrorListener.js +3 -2
  190. package/build/hooks/useScreen.d.ts +3 -0
  191. package/build/hooks/useScreen.js +14 -0
  192. package/build/index.d.ts +5 -2
  193. package/build/index.js +11 -2
  194. package/build/utils/device.d.ts +1 -0
  195. package/build/utils/device.js +13 -0
  196. package/build/utils/html.d.ts +1 -0
  197. package/build/utils/html.js +6 -0
  198. package/build/utils/locale.js +1 -1
  199. package/build/utils/rsa.d.ts +2 -2
  200. package/build/utils/rsa.js +1 -1
  201. package/build/utils/string.d.ts +22 -20
  202. package/build/utils/string.js +9 -0
  203. package/package.json +1 -1
@@ -192,7 +192,7 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
192
192
  case 1:
193
193
  data = (_k.sent()).data;
194
194
  brandInfo = undefined;
195
- if (!!data.errors) return [3, 13];
195
+ if (!!data.errors) return [3, 14];
196
196
  thunkApi.dispatch(updateStepName(stepName));
197
197
  return [4, thunkApi.dispatch(retrieveEntityList({ leadId: data === null || data === void 0 ? void 0 : data.id }))];
198
198
  case 2:
@@ -205,45 +205,47 @@ export var verifyLeadOTP = createAsyncThunk('verifyLeadOTP', function (params, t
205
205
  hasBusinessCustomersCompleted = hasKey(steps, BUSINESS_STEP_NAMES.BUSINESS_CUSTOMERS);
206
206
  if (!isNID) return [3, 3];
207
207
  thunkApi.dispatch(handleNextScreenStep());
208
- return [3, 13];
208
+ return [3, 14];
209
209
  case 3:
210
210
  if (!hasBusinessCompleted) return [3, 5];
211
211
  return [4, thunkApi.dispatch(retrieveBoardDetails(verifyResponse === null || verifyResponse === void 0 ? void 0 : verifyResponse.board_id))];
212
212
  case 4:
213
213
  _k.sent();
214
214
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
215
- return [3, 13];
215
+ return [3, 14];
216
216
  case 5:
217
217
  if (!(data.step_name === BUSINESS_STEP_NAMES.IDENTITY_AUTH)) return [3, 6];
218
218
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_IDBOD_STEP'));
219
- return [3, 13];
219
+ return [3, 14];
220
220
  case 6:
221
221
  if (!hasBusinessCustomersCompleted) return [3, 7];
222
222
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_SUCCESS_STEP'));
223
- return [3, 13];
223
+ return [3, 14];
224
224
  case 7:
225
- if (!hasBusinessCRActivitiesCompleted) return [3, 9];
225
+ if (!hasBusinessCRActivitiesCompleted) return [3, 10];
226
226
  thunkApi.dispatch(retrieveChannels());
227
- thunkApi.dispatch(retrieveDataList());
227
+ return [4, thunkApi.dispatch(retrieveDataList())];
228
+ case 8:
229
+ _k.sent();
228
230
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_CUSTOMERS_STEP'));
229
231
  return [4, API.brandService.retrieveBrand(brandID)];
230
- case 8:
231
- brandInfo = _k.sent();
232
- return [3, 13];
233
232
  case 9:
234
- if (!hasBusinessCRInfoCompleted) return [3, 12];
235
- return [4, thunkApi.dispatch(retrieveChannels())];
233
+ brandInfo = _k.sent();
234
+ return [3, 14];
236
235
  case 10:
236
+ if (!hasBusinessCRInfoCompleted) return [3, 13];
237
+ return [4, thunkApi.dispatch(retrieveChannels())];
238
+ case 11:
237
239
  _k.sent();
238
240
  return [4, API.brandService.retrieveBrand(brandID)];
239
- case 11:
241
+ case 12:
240
242
  brandInfo = _k.sent();
241
243
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_ACTIVITIES_STEP'));
242
- return [3, 13];
243
- case 12:
244
+ return [3, 14];
245
+ case 13:
244
246
  thunkApi.dispatch(handleNextScreenStep('BUSINESS_BUSINESS_TYPE_STEP'));
245
- _k.label = 13;
246
- case 13: return [2, { data: data, formData: __assign(__assign({}, params), { isNID: isNID }), brandInfo: brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.brand }];
247
+ _k.label = 14;
248
+ case 14: return [2, { data: data, formData: __assign(__assign({}, params), { isNID: isNID }), brandInfo: brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.brand }];
247
249
  }
248
250
  });
249
251
  }); });
@@ -302,12 +304,16 @@ export var resendOTPLeadIdentity = createAsyncThunk('resendOTPLeadIdentity', fun
302
304
  });
303
305
  }); });
304
306
  export var retrieveChannels = createAsyncThunk('retrieveChannels', function () { return __awaiter(void 0, void 0, void 0, function () {
305
- var data;
307
+ var body, data;
306
308
  return __generator(this, function (_a) {
307
309
  switch (_a.label) {
308
- case 0: return [4, API.dataService.getChannelsOfServices()];
310
+ case 0:
311
+ body = {
312
+ page: 0
313
+ };
314
+ return [4, API.dataService.getChannelsOfServices(body)];
309
315
  case 1:
310
- data = (_a.sent()).data;
316
+ data = _a.sent();
311
317
  return [2, data];
312
318
  }
313
319
  });
@@ -415,17 +421,21 @@ export var updateActivitiesInfo = createAsyncThunk('updateActivitiesInfo', funct
415
421
  }
416
422
  });
417
423
  }); });
418
- export var retrieveDataList = createAsyncThunk('bankRetrieveDataList', function () { return __awaiter(void 0, void 0, void 0, function () {
419
- var _a, customerBases, expectedSales, expectedCustomerSales;
424
+ export var retrieveDataList = createAsyncThunk('businessRetrieveDataList', function () { return __awaiter(void 0, void 0, void 0, function () {
425
+ var dataBody, _a, customerBases, expectedSales, expectedCustomerSales;
420
426
  return __generator(this, function (_b) {
421
427
  switch (_b.label) {
422
- case 0: return [4, Promise.all([
423
- API.dataService.getCustomerBases(),
424
- API.dataService.getExpectedSales(),
425
- API.dataService.getExpectedCustomerSales()
426
- ])];
428
+ case 0:
429
+ dataBody = {
430
+ page: 0
431
+ };
432
+ return [4, Promise.all([
433
+ API.dataService.getCustomerBases(dataBody),
434
+ API.dataService.getExpectedSales(dataBody),
435
+ API.dataService.getExpectedCustomerSales(dataBody)
436
+ ])];
427
437
  case 1:
428
- _a = _b.sent(), customerBases = _a[0].data, expectedSales = _a[1].data, expectedCustomerSales = _a[2].data;
438
+ _a = _b.sent(), customerBases = _a[0], expectedSales = _a[1], expectedCustomerSales = _a[2];
429
439
  return [2, {
430
440
  customerBases: customerBases,
431
441
  expectedSales: expectedSales,
@@ -450,7 +460,7 @@ export var updateCustomersInfo = createAsyncThunk('updateCustomersInfo', functio
450
460
  requestBody = {
451
461
  brand: {
452
462
  customers_base: customerBase,
453
- customers_served_monthly: parseInt(((_d = params.expectedCustomer) === null || _d === void 0 ? void 0 : _d.id) || '0'),
463
+ customers_served_monthly: (_d = params.expectedCustomer) === null || _d === void 0 ? void 0 : _d.id,
454
464
  monthly_sales_range: ((_e = params.expectedSale) === null || _e === void 0 ? void 0 : _e.id) || '',
455
465
  agree_refund: params.refundPolicy,
456
466
  agree_chargeback: params.transactionPolicy
@@ -609,8 +619,8 @@ export var businessSlice = createSlice({
609
619
  var isHasWebsite = (website === null || website === void 0 ? void 0 : website.length) > 0;
610
620
  var isHasTwitter = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('twitter.com'); });
611
621
  var isHasInstagram = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('instagram.com'); });
612
- var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'website'; });
613
- var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'social'; });
622
+ var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name.en.toLocaleLowerCase() === 'website'; });
623
+ var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name.en.toLocaleLowerCase() === 'social media'; });
614
624
  if (isHasWebsite && (isHasTwitter || isHasInstagram))
615
625
  selectedChannels = [websiteData, socialData];
616
626
  else if (isHasTwitter || isHasInstagram)
@@ -620,7 +630,7 @@ export var businessSlice = createSlice({
620
630
  if (((_d = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.channel_services) === null || _d === void 0 ? void 0 : _d.length) > 0) {
621
631
  selectedChannels = channels === null || channels === void 0 ? void 0 : channels.filter(function (channel) {
622
632
  var _a;
623
- return (_a = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.channel_services) === null || _a === void 0 ? void 0 : _a.find(function (storedChannel) { return channel.name_en.toLowerCase() === storedChannel.toLowerCase(); });
633
+ return (_a = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.channel_services) === null || _a === void 0 ? void 0 : _a.find(function (storedChannel) { return channel.id === storedChannel; });
624
634
  });
625
635
  }
626
636
  state.data.activitiesData.salesChannels = selectedChannels;
@@ -700,8 +710,8 @@ export var businessSlice = createSlice({
700
710
  var isHasWebsite = (website === null || website === void 0 ? void 0 : website.length) > 0;
701
711
  var isHasTwitter = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('twitter.com'); });
702
712
  var isHasInstagram = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('instagram.com'); });
703
- var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'website'; });
704
- var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'social'; });
713
+ var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name.en.toLocaleLowerCase() === 'website'; });
714
+ var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name.en.toLocaleLowerCase() === 'social media'; });
705
715
  if (isHasWebsite && (isHasTwitter || isHasInstagram))
706
716
  selectedChannels = [websiteData, socialData];
707
717
  else if (isHasTwitter || isHasInstagram)
@@ -711,7 +721,7 @@ export var businessSlice = createSlice({
711
721
  if (((_d = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.channel_services) === null || _d === void 0 ? void 0 : _d.length) > 0) {
712
722
  selectedChannels = channels === null || channels === void 0 ? void 0 : channels.filter(function (channel) {
713
723
  var _a;
714
- return (_a = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.channel_services) === null || _a === void 0 ? void 0 : _a.find(function (storedChannel) { return channel.name_en.toLowerCase() === storedChannel.toLowerCase(); });
724
+ return (_a = brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.channel_services) === null || _a === void 0 ? void 0 : _a.find(function (storedChannel) { return channel.name.en.toLowerCase() === storedChannel.toLowerCase(); });
715
725
  });
716
726
  }
717
727
  state.data.activitiesData.salesChannels = selectedChannels;
@@ -851,7 +861,7 @@ export var businessSlice = createSlice({
851
861
  state.error = description;
852
862
  return;
853
863
  }
854
- var channels = data || [];
864
+ var channels = data.list || [];
855
865
  state.data.businessTypeData.responseBody = __assign(__assign({}, state.data.businessTypeData.responseBody), { channelList: channels });
856
866
  var brand = (state.data.verify.responseBody || {}).brand;
857
867
  var selectedChannels = (!!(channels === null || channels === void 0 ? void 0 : channels[0]) && [channels === null || channels === void 0 ? void 0 : channels[0]]) || [];
@@ -859,8 +869,8 @@ export var businessSlice = createSlice({
859
869
  var isHasWebsite = (website === null || website === void 0 ? void 0 : website.length) > 0;
860
870
  var isHasTwitter = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('twitter.com'); });
861
871
  var isHasInstagram = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('instagram.com'); });
862
- var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'website'; });
863
- var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name_en.toLocaleLowerCase() === 'social'; });
872
+ var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name.en.toLocaleLowerCase() === 'website'; });
873
+ var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.name.en.toLocaleLowerCase() === 'social media'; });
864
874
  if (isHasWebsite && (isHasTwitter || isHasInstagram))
865
875
  selectedChannels = [websiteData, socialData];
866
876
  else if (isHasTwitter || isHasInstagram)
@@ -927,15 +937,15 @@ export var businessSlice = createSlice({
927
937
  state.error = null;
928
938
  })
929
939
  .addCase(retrieveDataList.fulfilled, function (state, action) {
930
- var _a, _b;
940
+ var _a, _b, _c, _d, _e;
931
941
  state.loading = false;
932
942
  state.error = null;
933
943
  var payload = action.payload;
934
- var customerBases = payload.customerBases || [];
944
+ var customerBases = ((_a = payload.customerBases) === null || _a === void 0 ? void 0 : _a.list) || [];
935
945
  var customerBase = customerBases === null || customerBases === void 0 ? void 0 : customerBases[1];
936
- var expectedSales = payload.expectedSales || [];
937
- var expectedSale = (_b = (_a = expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales[0]) === null || _a === void 0 ? void 0 : _a.sub) === null || _b === void 0 ? void 0 : _b[4];
938
- var expectedCustomerSales = payload.expectedCustomerSales || [];
946
+ var expectedSales = ((_b = payload.expectedSales) === null || _b === void 0 ? void 0 : _b.list) || [];
947
+ var expectedSale = (_d = (_c = expectedSales === null || expectedSales === void 0 ? void 0 : expectedSales[0]) === null || _c === void 0 ? void 0 : _c.sub) === null || _d === void 0 ? void 0 : _d[4];
948
+ var expectedCustomerSales = ((_e = payload.expectedCustomerSales) === null || _e === void 0 ? void 0 : _e.list) || [];
939
949
  var expectedCustomerSale = expectedCustomerSales === null || expectedCustomerSales === void 0 ? void 0 : expectedCustomerSales[3];
940
950
  state.data.activitiesData.responseBody = __assign(__assign({}, state.data.activitiesData.responseBody), { customerBases: customerBases, expectedSales: expectedSales, expectedCustomerSales: expectedCustomerSales });
941
951
  if (!!customerBase)
@@ -1,10 +1,14 @@
1
1
  import { RootState } from '../../../app/store';
2
- import { ResponseData, MobileFormValues, NIDFormValues, OTPFormValues, IndividualFormValues, SharedState, BrandFormValues, FlowsTypes } from '../../../@types';
2
+ import { ResponseData, MobileFormValues, NIDFormValues, CivilFormValues, OTPFormValues, IndividualFormValues, SharedState, BrandFormValues, FlowsTypes } from '../../../@types';
3
3
  import { CancelToken } from 'axios';
4
4
  export declare const createMobileAuth: import("@reduxjs/toolkit").AsyncThunk<{
5
5
  response: any;
6
6
  formData: MobileFormValues;
7
7
  }, MobileFormValues, {}>;
8
+ export declare const createCivilIdAuth: import("@reduxjs/toolkit").AsyncThunk<{
9
+ response: any;
10
+ formData: CivilFormValues;
11
+ }, CivilFormValues, {}>;
8
12
  export declare const resendOTPMobile: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
9
13
  export declare const createNIDAuth: import("@reduxjs/toolkit").AsyncThunk<{
10
14
  response: any;
@@ -19,6 +23,12 @@ export declare const verifyAuth: import("@reduxjs/toolkit").AsyncThunk<{
19
23
  response: any;
20
24
  formData: OTPFormValues;
21
25
  }, OTPFormValues, {}>;
26
+ interface verifyPACIParams {
27
+ onSuccess?: () => void | Promise<void>;
28
+ }
29
+ export declare const verifyPACI: import("@reduxjs/toolkit").AsyncThunk<{
30
+ response: any;
31
+ }, verifyPACIParams, {}>;
22
32
  export declare const retrieveLead: import("@reduxjs/toolkit").AsyncThunk<{
23
33
  response: any;
24
34
  formData: {
@@ -40,6 +50,7 @@ export declare const createLead: import("@reduxjs/toolkit").AsyncThunk<{
40
50
  stepName: string;
41
51
  }, {}>;
42
52
  export declare const retrieveBrandList: import("@reduxjs/toolkit").AsyncThunk<any, string, {}>;
53
+ export declare const retrieveChannels: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
43
54
  export declare const updateLeadIndividual: import("@reduxjs/toolkit").AsyncThunk<{
44
55
  response: any;
45
56
  formData: IndividualFormValues;
@@ -75,6 +86,7 @@ export interface ConnectData {
75
86
  nidData: NIDFormValues & ResponseData & {
76
87
  type: string;
77
88
  };
89
+ civilIdData: CivilFormValues & ResponseData;
78
90
  otpData: OTPFormValues & ResponseData & {
79
91
  isAbsher: boolean;
80
92
  };
@@ -90,6 +90,34 @@ export var createMobileAuth = createAsyncThunk('createMobileAuth', function (par
90
90
  }
91
91
  });
92
92
  }); });
93
+ export var createCivilIdAuth = createAsyncThunk('createCivilIdAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
94
+ var settings, requestBody, data;
95
+ var _a, _b;
96
+ return __generator(this, function (_c) {
97
+ switch (_c.label) {
98
+ case 0:
99
+ settings = thunkApi.getState().settings;
100
+ requestBody = {
101
+ lang: settings.data.language,
102
+ user_credentail: {
103
+ identification_id: params.civilId,
104
+ country_code: 'KW'
105
+ },
106
+ sign_in: false,
107
+ step_name: CONNECT_STEP_NAMES.CREATE_AUTH_CIVIL_ID,
108
+ encryption_contract: ['user_credentail.civil_id']
109
+ };
110
+ return [4, API.authService.createAuth(requestBody)];
111
+ case 1:
112
+ data = (_c.sent()).data;
113
+ if (!data.errors) {
114
+ thunkApi.dispatch(handleNextScreenStep());
115
+ (_b = (_a = settings.data.appConfig).onStepCompleted) === null || _b === void 0 ? void 0 : _b.call(_a, settings.data.activeScreen.name, requestBody.user_credentail);
116
+ }
117
+ return [2, { response: data, formData: params }];
118
+ }
119
+ });
120
+ }); });
93
121
  export var resendOTPMobile = createAsyncThunk('resendOTPMobile', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
94
122
  var _a, settings, connect, _b, mobile, countryCode, requestBody, data;
95
123
  return __generator(this, function (_c) {
@@ -207,7 +235,7 @@ export var verifyAuth = createAsyncThunk('verifyAuth', function (params, thunkAp
207
235
  return [4, API.authService.verifyAuth(payload)];
208
236
  case 1:
209
237
  data = (_e.sent()).data;
210
- if (!!data.errors) return [3, 4];
238
+ if (!!data.errors) return [3, 5];
211
239
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
212
240
  if (!(responseBody === null || responseBody === void 0 ? void 0 : responseBody.new_user)) return [3, 2];
213
241
  params_1 = {
@@ -215,9 +243,12 @@ export var verifyAuth = createAsyncThunk('verifyAuth', function (params, thunkAp
215
243
  stepName: 'CONNECT_INDIVIDUAL_STEP'
216
244
  };
217
245
  thunkApi.dispatch(retrieveLead(params_1));
218
- return [3, 4];
246
+ return [3, 5];
219
247
  case 2: return [4, thunkApi.dispatch(retrieveBrandList(data === null || data === void 0 ? void 0 : data.individual_id))];
220
248
  case 3:
249
+ _e.sent();
250
+ return [4, thunkApi.dispatch(retrieveChannels())];
251
+ case 4:
221
252
  _e.sent();
222
253
  if (!(data === null || data === void 0 ? void 0 : data.lead_id)) {
223
254
  params_2 = {
@@ -229,8 +260,52 @@ export var verifyAuth = createAsyncThunk('verifyAuth', function (params, thunkAp
229
260
  else {
230
261
  thunkApi.dispatch(handleNextScreenStep('CONNECT_MERCHANT_INFO_STEP'));
231
262
  }
232
- _e.label = 4;
233
- case 4: return [2, { response: data, formData: params }];
263
+ _e.label = 5;
264
+ case 5: return [2, { response: data, formData: params }];
265
+ }
266
+ });
267
+ }); });
268
+ export var verifyPACI = createAsyncThunk('verifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
269
+ var _a, settings, connect, responseBody, data, params_3, params_4;
270
+ var _b, _c, _d, _e;
271
+ return __generator(this, function (_f) {
272
+ switch (_f.label) {
273
+ case 0:
274
+ _a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
275
+ responseBody = connect.data.civilIdData.responseBody;
276
+ return [4, API.authService.getVerifyAuth(responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token)];
277
+ case 1:
278
+ data = _f.sent();
279
+ if (!(((_b = data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success')) return [3, 6];
280
+ return [4, ((_c = params === null || params === void 0 ? void 0 : params.onSuccess) === null || _c === void 0 ? void 0 : _c.call(params))];
281
+ case 2:
282
+ _f.sent();
283
+ (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
284
+ if (!(responseBody === null || responseBody === void 0 ? void 0 : responseBody.new_user)) return [3, 3];
285
+ params_3 = {
286
+ leadId: data === null || data === void 0 ? void 0 : data.lead_id,
287
+ stepName: 'CONNECT_INDIVIDUAL_STEP'
288
+ };
289
+ thunkApi.dispatch(retrieveLead(params_3));
290
+ return [3, 6];
291
+ case 3: return [4, thunkApi.dispatch(retrieveBrandList(data === null || data === void 0 ? void 0 : data.individual_id))];
292
+ case 4:
293
+ _f.sent();
294
+ return [4, thunkApi.dispatch(retrieveChannels())];
295
+ case 5:
296
+ _f.sent();
297
+ if (!(data === null || data === void 0 ? void 0 : data.lead_id)) {
298
+ params_4 = {
299
+ individualId: data === null || data === void 0 ? void 0 : data.individual_id,
300
+ stepName: 'CONNECT_MERCHANT_INFO_STEP'
301
+ };
302
+ thunkApi.dispatch(createLead(params_4));
303
+ }
304
+ else {
305
+ thunkApi.dispatch(handleNextScreenStep('CONNECT_MERCHANT_INFO_STEP'));
306
+ }
307
+ _f.label = 6;
308
+ case 6: return [2, { response: data }];
234
309
  }
235
310
  });
236
311
  }); });
@@ -282,6 +357,21 @@ export var retrieveBrandList = createAsyncThunk('retrieveBrandList', function (i
282
357
  }
283
358
  });
284
359
  }); });
360
+ export var retrieveChannels = createAsyncThunk('retrieveChannels', function () { return __awaiter(void 0, void 0, void 0, function () {
361
+ var body, data;
362
+ return __generator(this, function (_a) {
363
+ switch (_a.label) {
364
+ case 0:
365
+ body = {
366
+ page: 0
367
+ };
368
+ return [4, API.dataService.getChannelsOfServices(body)];
369
+ case 1:
370
+ data = _a.sent();
371
+ return [2, data];
372
+ }
373
+ });
374
+ }); });
285
375
  export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
286
376
  var _a, settings, connect, isAbsher, payload, data;
287
377
  var _b, _c, _d, _e, _f, _g;
@@ -316,6 +406,9 @@ export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', funct
316
406
  return [4, API.leadService.updateLead(payload)];
317
407
  case 1:
318
408
  data = _h.sent();
409
+ return [4, thunkApi.dispatch(retrieveChannels())];
410
+ case 2:
411
+ _h.sent();
319
412
  thunkApi.dispatch(handleNextScreenStep());
320
413
  (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, params);
321
414
  return [2, { response: data, formData: params }];
@@ -458,6 +551,9 @@ var initialState = {
458
551
  dob: getEighteenYearsAgo(),
459
552
  type: ''
460
553
  },
554
+ civilIdData: {
555
+ civilId: ''
556
+ },
461
557
  otpData: {
462
558
  otp: '',
463
559
  isAbsher: false
@@ -470,6 +566,7 @@ var initialState = {
470
566
  },
471
567
  brandData: {
472
568
  brandName: '',
569
+ salesChannels: [],
473
570
  termAndConditionChecked: false,
474
571
  links: {
475
572
  website: '',
@@ -547,6 +644,39 @@ export var connectSlice = createSlice({
547
644
  })
548
645
  .addCase(resendOTPMobile.rejected, function (state, action) {
549
646
  state.error = action.error.message;
647
+ })
648
+ .addCase(createCivilIdAuth.pending, function (state, action) {
649
+ state.loading = true;
650
+ state.error = null;
651
+ })
652
+ .addCase(createCivilIdAuth.fulfilled, function (state, action) {
653
+ var _a;
654
+ state.loading = false;
655
+ state.error = null;
656
+ var _b = action.payload, formData = _b.formData, response = _b.response;
657
+ var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
658
+ if (description) {
659
+ state.error = description;
660
+ return;
661
+ }
662
+ state.data.civilIdData = __assign(__assign({}, formData), { responseBody: response });
663
+ })
664
+ .addCase(createCivilIdAuth.rejected, function (state, action) {
665
+ state.loading = false;
666
+ state.error = action.error.message;
667
+ })
668
+ .addCase(verifyPACI.pending, function (state) {
669
+ state.loading = true;
670
+ state.error = null;
671
+ })
672
+ .addCase(verifyPACI.fulfilled, function (state, action) {
673
+ state.loading = false;
674
+ state.error = null;
675
+ state.data.otpData.responseBody = action.payload.response;
676
+ })
677
+ .addCase(verifyPACI.rejected, function (state, action) {
678
+ state.loading = false;
679
+ state.error = action.error.message;
550
680
  })
551
681
  .addCase(createNIDAuth.fulfilled, function (state, action) {
552
682
  var _a;
@@ -768,6 +898,36 @@ export var connectSlice = createSlice({
768
898
  .addCase(updateLeadSuccess.rejected, function (state, action) {
769
899
  state.loading = false;
770
900
  state.error = action.error.message;
901
+ })
902
+ .addCase(retrieveChannels.pending, function (state) {
903
+ state.error = null;
904
+ state.loading = true;
905
+ })
906
+ .addCase(retrieveChannels.fulfilled, function (state, action) {
907
+ state.error = null;
908
+ state.loading = false;
909
+ var data = action.payload || {};
910
+ var channels = data.list || [];
911
+ state.data.brandData.responseBody = __assign(__assign({}, state.data.brandData.responseBody), { channelList: channels });
912
+ var selectedChannels = [];
913
+ var selectedBrandItem = (state.data.brandData || {}).selectedBrandItem;
914
+ var _a = selectedBrandItem || {}, website = _a.website, social = _a.social;
915
+ var isHasWebsite = (website === null || website === void 0 ? void 0 : website.length) > 0;
916
+ var isHasTwitter = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('twitter.com'); });
917
+ var isHasInstagram = social === null || social === void 0 ? void 0 : social.find(function (s) { return s.includes('instagram.com'); });
918
+ var websiteData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { return c.id.toLocaleLowerCase() === 'website'; });
919
+ var socialData = channels === null || channels === void 0 ? void 0 : channels.find(function (c) { var _a; return ((_a = c.name) === null || _a === void 0 ? void 0 : _a.en.toLocaleLowerCase()) === 'social'; });
920
+ if (isHasWebsite && (isHasTwitter || isHasInstagram))
921
+ selectedChannels = [websiteData, socialData];
922
+ else if (isHasTwitter || isHasInstagram)
923
+ selectedChannels = [socialData];
924
+ else if (isHasWebsite)
925
+ selectedChannels = [websiteData];
926
+ state.data.brandData.salesChannels = selectedChannels;
927
+ })
928
+ .addCase(retrieveChannels.rejected, function (state, action) {
929
+ state.error = action.error.message;
930
+ state.loading = false;
771
931
  });
772
932
  }
773
933
  });
@@ -0,0 +1,53 @@
1
+ import { RootState } from '../../../app/store';
2
+ import { EntityFormValues, FlowsTypes, OTPFormValues, ResponseData, SharedState } from '../../../@types';
3
+ export declare const verifyLeadToken: import("@reduxjs/toolkit").AsyncThunk<{
4
+ data: any;
5
+ boardResponse: {
6
+ flows: {
7
+ name: string;
8
+ status: string;
9
+ url: string;
10
+ }[];
11
+ };
12
+ token: string;
13
+ }, string, {}>;
14
+ export declare const resendOTP: import("@reduxjs/toolkit").AsyncThunk<{
15
+ data: any;
16
+ }, void, {}>;
17
+ export declare const verifyEntityLeadOTP: import("@reduxjs/toolkit").AsyncThunk<{
18
+ data: any;
19
+ formData: OTPFormValues;
20
+ }, OTPFormValues, {}>;
21
+ export declare const retrieveBoardDetails: import("@reduxjs/toolkit").AsyncThunk<{
22
+ data: any;
23
+ }, string, {}>;
24
+ export declare const updateEntityInfo: import("@reduxjs/toolkit").AsyncThunk<{
25
+ data: any;
26
+ formData: EntityFormValues;
27
+ }, EntityFormValues, {}>;
28
+ export declare const updateBoardSuccess: import("@reduxjs/toolkit").AsyncThunk<{
29
+ response: any;
30
+ formData: void;
31
+ } | undefined, void, {}>;
32
+ export declare const retrieveChannels: import("@reduxjs/toolkit").AsyncThunk<any, void, {}>;
33
+ declare type VerifyData = {
34
+ token: string;
35
+ };
36
+ export interface EntityData {
37
+ verify: ResponseData & VerifyData;
38
+ otpData: OTPFormValues & ResponseData;
39
+ entityData: EntityFormValues & ResponseData;
40
+ flowName: FlowsTypes;
41
+ }
42
+ export interface EntityState extends SharedState<EntityData> {
43
+ customLoading?: boolean;
44
+ }
45
+ export declare const entitySlice: import("@reduxjs/toolkit").Slice<EntityState, {
46
+ clearError: (state: EntityState) => void;
47
+ stopLoader: (state: EntityState) => void;
48
+ resetOTPScreen: (state: EntityState) => void;
49
+ }, "entity/store">;
50
+ export declare const clearError: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, stopLoader: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>, resetOTPScreen: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
51
+ declare const _default: import("redux").Reducer<EntityState, import("redux").AnyAction>;
52
+ export default _default;
53
+ export declare const entitySelector: (state: RootState) => EntityState;