@tap-payments/auth-jsconnect 2.7.9-test → 2.7.9

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 (557) hide show
  1. package/build/@types/app.d.ts +47 -4
  2. package/build/@types/app.js +22 -0
  3. package/build/@types/config.d.ts +4 -0
  4. package/build/@types/form.d.ts +11 -1
  5. package/build/@types/redux.d.ts +1 -0
  6. package/build/api/account.d.ts +4 -1
  7. package/build/api/account.js +15 -1
  8. package/build/api/auth.d.ts +35 -20
  9. package/build/api/auth.js +1 -1
  10. package/build/api/axios.js +1 -2
  11. package/build/api/data.d.ts +4 -17
  12. package/build/api/data.js +5 -45
  13. package/build/api/entity.d.ts +3 -2
  14. package/build/api/entity.js +12 -4
  15. package/build/api/firebase.js +68 -8
  16. package/build/api/index.d.ts +14 -25
  17. package/build/api/lead.d.ts +16 -3
  18. package/build/api/lead.js +16 -0
  19. package/build/api/user.d.ts +7 -0
  20. package/build/api/user.js +9 -1
  21. package/build/app/rootReducer.d.ts +1 -0
  22. package/build/app/rootReducer.js +3 -1
  23. package/build/app/settings.js +9 -8
  24. package/build/app/store.d.ts +2 -0
  25. package/build/assets/locales/ar.json +353 -151
  26. package/build/assets/locales/en.json +349 -150
  27. package/build/components/AnimationFlow/AnimationFlow.d.ts +9 -5
  28. package/build/components/AnimationFlow/AnimationFlow.js +5 -5
  29. package/build/components/AnimationFlow/BottomSheet.d.ts +3 -1
  30. package/build/components/AnimationFlow/BottomSheet.js +42 -14
  31. package/build/components/AnimationFlow/Dialog.d.ts +4 -3
  32. package/build/components/AnimationFlow/Dialog.js +5 -3
  33. package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +1 -1
  34. package/build/components/ArabicDatePicker/ArabicDatePicker.js +2 -2
  35. package/build/components/ArabicDatePicker/style.css +32 -3
  36. package/build/components/DatePicker/DatePicker.d.ts +1 -1
  37. package/build/components/DatePicker/DatePicker.js +2 -2
  38. package/build/components/Footer/Footer.js +2 -1
  39. package/build/components/Input/Input.js +1 -1
  40. package/build/components/Providers/ThemeProvider.js +3 -3
  41. package/build/components/Tooltip/Tooltip.js +1 -1
  42. package/build/constants/api.d.ts +5 -7
  43. package/build/constants/api.js +11 -15
  44. package/build/constants/app.d.ts +40 -0
  45. package/build/constants/app.js +368 -36
  46. package/build/constants/assets.d.ts +3 -0
  47. package/build/constants/assets.js +4 -1
  48. package/build/constants/dummy.d.ts +4 -219
  49. package/build/constants/dummy.js +64 -6194
  50. package/build/constants/flows.d.ts +26 -0
  51. package/build/constants/flows.js +27 -0
  52. package/build/constants/index.d.ts +1 -0
  53. package/build/constants/index.js +1 -0
  54. package/build/constants/validation.d.ts +3 -0
  55. package/build/constants/validation.js +3 -0
  56. package/build/features/app/auth/authStore.d.ts +29 -8
  57. package/build/features/app/auth/authStore.js +495 -149
  58. package/build/features/app/bank/bankStore.d.ts +13 -18
  59. package/build/features/app/bank/bankStore.js +186 -153
  60. package/build/features/app/board/boardStore.d.ts +5 -1
  61. package/build/features/app/board/boardStore.js +82 -51
  62. package/build/features/app/brand/brandStore.d.ts +17 -33
  63. package/build/features/app/brand/brandStore.js +254 -257
  64. package/build/features/app/business/businessStore.d.ts +37 -15
  65. package/build/features/app/business/businessStore.js +443 -235
  66. package/build/features/app/connect/connectStore.d.ts +33 -5
  67. package/build/features/app/connect/connectStore.js +355 -120
  68. package/build/features/app/connectExpress/connectExpressStore.d.ts +64 -27
  69. package/build/features/app/connectExpress/connectExpressStore.js +807 -394
  70. package/build/features/app/entity/entityStore.d.ts +20 -36
  71. package/build/features/app/entity/entityStore.js +204 -238
  72. package/build/features/app/individual/individualStore.d.ts +18 -34
  73. package/build/features/app/individual/individualStore.js +269 -292
  74. package/build/features/app/kyc/kycStore.d.ts +67 -0
  75. package/build/features/app/kyc/kycStore.js +432 -0
  76. package/build/features/app/password/passwordStore.d.ts +33 -18
  77. package/build/features/app/password/passwordStore.js +260 -219
  78. package/build/features/app/signIn/signInStore.js +19 -15
  79. package/build/features/app/tax/taxStore.d.ts +13 -7
  80. package/build/features/app/tax/taxStore.js +170 -136
  81. package/build/features/auth/Auth.d.ts +5 -6
  82. package/build/features/auth/Auth.js +40 -15
  83. package/build/features/auth/screens/AccountNotFound/AccountNotFound.js +2 -5
  84. package/build/features/auth/screens/AuthSwitch/AuthSwitch.d.ts +5 -0
  85. package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +58 -0
  86. package/build/features/auth/screens/AuthSwitch/index.d.ts +3 -0
  87. package/build/features/auth/screens/AuthSwitch/index.js +2 -0
  88. package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +2 -8
  89. package/build/features/auth/screens/AuthenticationList/LicenseNumber.js +2 -2
  90. package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +8 -2
  91. package/build/features/auth/screens/CivilID/CivilID.js +4 -35
  92. package/build/features/auth/screens/{NID → DOB}/DOB.js +3 -3
  93. package/build/features/auth/screens/DOB/DOBForm.d.ts +5 -0
  94. package/build/features/auth/screens/DOB/DOBForm.js +59 -0
  95. package/build/features/auth/screens/DOB/index.d.ts +3 -0
  96. package/build/features/auth/screens/DOB/index.js +2 -0
  97. package/build/features/{connectExpress/screens/IdentityOTP → auth/screens/DOB}/validation.d.ts +4 -4
  98. package/build/features/auth/screens/DOB/validation.js +4 -0
  99. package/build/features/auth/screens/Email/Email.d.ts +5 -0
  100. package/build/features/auth/screens/Email/Email.js +57 -0
  101. package/build/features/auth/screens/Email/EmailField.d.ts +8 -0
  102. package/build/features/auth/screens/Email/EmailField.js +52 -0
  103. package/build/features/auth/screens/Email/index.d.ts +3 -0
  104. package/build/features/auth/screens/Email/index.js +2 -0
  105. package/build/features/auth/screens/Email/validation.d.ts +8 -0
  106. package/build/features/auth/screens/Email/validation.js +4 -0
  107. package/build/features/auth/screens/EmailSent/EmailSent.d.ts +5 -0
  108. package/build/features/auth/screens/EmailSent/EmailSent.js +79 -0
  109. package/build/features/auth/screens/EmailSent/index.d.ts +2 -0
  110. package/build/features/auth/screens/EmailSent/index.js +2 -0
  111. package/build/features/auth/screens/MigratingData/MigratingData.d.ts +5 -0
  112. package/build/features/auth/screens/MigratingData/MigratingData.js +44 -0
  113. package/build/features/auth/screens/MigratingData/index.d.ts +2 -0
  114. package/build/features/auth/screens/MigratingData/index.js +2 -0
  115. package/build/features/auth/screens/Mobile/Mobile.js +6 -38
  116. package/build/features/auth/screens/Mobile/MobileNumber.js +13 -15
  117. package/build/features/auth/screens/Mobile/validation.js +11 -3
  118. package/build/features/auth/screens/NID/IDNumber.js +1 -1
  119. package/build/features/auth/screens/NID/NID.js +7 -43
  120. package/build/features/auth/screens/NID/validation.d.ts +0 -3
  121. package/build/features/auth/screens/NID/validation.js +0 -1
  122. package/build/features/auth/screens/OTP/OTP.js +41 -10
  123. package/build/features/auth/screens/OTP/OTPInput.js +23 -6
  124. package/build/features/auth/screens/OperatorError/OperatorError.d.ts +5 -0
  125. package/build/features/auth/screens/OperatorError/OperatorError.js +9 -0
  126. package/build/features/auth/screens/OperatorError/index.d.ts +3 -0
  127. package/build/features/auth/screens/OperatorError/index.js +2 -0
  128. package/build/features/auth/screens/Password/Password.d.ts +5 -0
  129. package/build/features/auth/screens/Password/Password.js +61 -0
  130. package/build/features/auth/screens/Password/PasswordField.d.ts +5 -0
  131. package/build/features/auth/screens/Password/PasswordField.js +28 -0
  132. package/build/features/auth/screens/Password/index.d.ts +3 -0
  133. package/build/features/auth/screens/Password/index.js +2 -0
  134. package/build/features/auth/screens/Password/validation.d.ts +8 -0
  135. package/build/features/auth/screens/Password/validation.js +4 -0
  136. package/build/features/auth/screens/PreparingData/PreparingData.js +3 -0
  137. package/build/features/auth/screens/ResetPasswordMessage/ResetPasswordMessage.d.ts +5 -0
  138. package/build/features/auth/screens/ResetPasswordMessage/ResetPasswordMessage.js +21 -0
  139. package/build/features/auth/screens/ResetPasswordMessage/index.d.ts +3 -0
  140. package/build/features/auth/screens/ResetPasswordMessage/index.js +2 -0
  141. package/build/features/auth/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  142. package/build/features/auth/screens/VerifyNafath/VerifyNafath.js +35 -0
  143. package/build/features/auth/screens/VerifyNafath/index.d.ts +3 -0
  144. package/build/features/auth/screens/VerifyNafath/index.js +2 -0
  145. package/build/features/bank/Bank.d.ts +5 -1
  146. package/build/features/bank/Bank.js +22 -9
  147. package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
  148. package/build/features/bank/screens/OperatorError/OperatorError.d.ts +5 -0
  149. package/build/features/bank/screens/OperatorError/OperatorError.js +9 -0
  150. package/build/features/bank/screens/OperatorError/index.d.ts +3 -0
  151. package/build/features/bank/screens/OperatorError/index.js +2 -0
  152. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  153. package/build/features/bank/screens/Verify/Verify.js +7 -6
  154. package/build/features/board/Board.d.ts +2 -0
  155. package/build/features/board/Board.js +24 -13
  156. package/build/features/board/screens/OperatorError/OperatorError.d.ts +5 -0
  157. package/build/features/board/screens/OperatorError/OperatorError.js +9 -0
  158. package/build/features/board/screens/OperatorError/index.d.ts +3 -0
  159. package/build/features/board/screens/OperatorError/index.js +2 -0
  160. package/build/features/board/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
  161. package/build/features/board/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
  162. package/build/features/board/screens/PrepareDataLoading/index.d.ts +2 -0
  163. package/build/features/board/screens/PrepareDataLoading/index.js +2 -0
  164. package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -4
  165. package/build/features/board/screens/Verify/Verify.js +3 -2
  166. package/build/features/brand/Brand.d.ts +5 -1
  167. package/build/features/brand/Brand.js +22 -9
  168. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +5 -5
  169. package/build/features/brand/screens/BrandActivities/BrandActivities.js +48 -11
  170. package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +6 -6
  171. package/build/features/brand/screens/BrandActivities/CustomerBase.js +1 -1
  172. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +6 -3
  173. package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +4 -4
  174. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
  175. package/build/features/brand/screens/BrandActivities/TAC.d.ts +1 -1
  176. package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
  177. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
  178. package/build/features/brand/screens/BrandInfo/BrandInfo.js +22 -4
  179. package/build/features/brand/screens/BrandInfo/BrandName.js +5 -2
  180. package/build/features/brand/screens/BrandInfo/validation.js +2 -2
  181. package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +22 -6
  182. package/build/features/brand/screens/OperatorError/OperatorError.d.ts +5 -0
  183. package/build/features/brand/screens/OperatorError/OperatorError.js +9 -0
  184. package/build/features/brand/screens/OperatorError/index.d.ts +3 -0
  185. package/build/features/brand/screens/OperatorError/index.js +2 -0
  186. package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  187. package/build/features/brand/screens/Verify/Verify.js +3 -2
  188. package/build/features/business/Business.js +20 -12
  189. package/build/features/business/screens/Activities/Activities.js +26 -9
  190. package/build/features/business/screens/Activities/ActivitiesList.d.ts +4 -4
  191. package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
  192. package/build/features/business/screens/Activities/OperationStartDate.d.ts +5 -3
  193. package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
  194. package/build/features/business/screens/BrandDetails/SalesChannel.d.ts +2 -2
  195. package/build/features/business/screens/BusinessType/BusinessType.js +11 -3
  196. package/build/features/business/screens/BusinessType/LicenseNumber.js +3 -3
  197. package/build/features/business/screens/Customers/CustomerLocations.d.ts +10 -8
  198. package/build/features/business/screens/Customers/CustomerLocations.js +5 -3
  199. package/build/features/business/screens/Customers/Customers.js +50 -10
  200. package/build/features/business/screens/Customers/ExpectedCustomers.d.ts +3 -1
  201. package/build/features/business/screens/Customers/ExpectedCustomers.js +5 -3
  202. package/build/features/business/screens/Customers/ExpectedSalesRange.d.ts +3 -1
  203. package/build/features/business/screens/Customers/ExpectedSalesRange.js +11 -5
  204. package/build/features/business/screens/Customers/RefundPolicy.d.ts +12 -5
  205. package/build/features/business/screens/Customers/RefundPolicy.js +13 -13
  206. package/build/features/business/screens/Customers/TransactionPolicy.d.ts +4 -1
  207. package/build/features/business/screens/Customers/TransactionPolicy.js +8 -5
  208. package/build/features/business/screens/Customers/validation.d.ts +6 -6
  209. package/build/features/business/screens/Customers/validation.js +3 -8
  210. package/build/features/business/screens/DOB/DOB.d.ts +6 -0
  211. package/build/features/business/screens/DOB/DOB.js +45 -0
  212. package/build/features/business/screens/DOB/DOBForm.d.ts +5 -0
  213. package/build/features/business/screens/DOB/DOBForm.js +72 -0
  214. package/build/features/business/screens/DOB/index.d.ts +3 -0
  215. package/build/features/business/screens/DOB/index.js +2 -0
  216. package/build/features/business/screens/DOB/validation.d.ts +8 -0
  217. package/build/features/business/screens/DOB/validation.js +4 -0
  218. package/build/features/business/screens/IDBOD/IDBOD.js +10 -2
  219. package/build/features/business/screens/IDBOD/validation.d.ts +0 -3
  220. package/build/features/business/screens/IDBOD/validation.js +0 -1
  221. package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
  222. package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.js +103 -0
  223. package/build/features/{connectExpress/screens/IdentityOTP/OTP.d.ts → business/screens/MobileOwnership/MobileNumber.d.ts} +0 -2
  224. package/build/features/business/screens/MobileOwnership/MobileNumber.js +72 -0
  225. package/build/features/business/screens/MobileOwnership/index.d.ts +2 -0
  226. package/build/features/business/screens/MobileOwnership/index.js +2 -0
  227. package/build/features/business/screens/MobileOwnership/validation.d.ts +8 -0
  228. package/build/features/business/screens/MobileOwnership/validation.js +38 -0
  229. package/build/features/business/screens/OperatorError/OperatorError.d.ts +5 -0
  230. package/build/features/business/screens/OperatorError/OperatorError.js +9 -0
  231. package/build/features/business/screens/OperatorError/index.d.ts +3 -0
  232. package/build/features/business/screens/OperatorError/index.js +2 -0
  233. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -3
  234. package/build/features/business/screens/Verify/Verify.js +15 -4
  235. package/build/features/business/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  236. package/build/features/business/screens/VerifyNafath/VerifyNafath.js +35 -0
  237. package/build/features/business/screens/VerifyNafath/index.d.ts +3 -0
  238. package/build/features/business/screens/VerifyNafath/index.js +2 -0
  239. package/build/features/connect/Connect.d.ts +5 -1
  240. package/build/features/connect/Connect.js +16 -9
  241. package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +7 -1
  242. package/build/features/connect/screens/CivilID/CivilID.js +6 -1
  243. package/build/features/{auth/screens/NID → connect/screens/DOB}/DOB.d.ts +1 -2
  244. package/build/features/connect/screens/{NID → DOB}/DOB.js +2 -2
  245. package/build/features/connect/screens/DOB/DOBForm.d.ts +5 -0
  246. package/build/features/connect/screens/DOB/DOBForm.js +59 -0
  247. package/build/features/connect/screens/DOB/index.d.ts +3 -0
  248. package/build/features/connect/screens/DOB/index.js +2 -0
  249. package/build/features/connect/screens/DOB/validation.d.ts +8 -0
  250. package/build/features/connect/screens/DOB/validation.js +4 -0
  251. package/build/features/connect/screens/Individual/Email.js +1 -3
  252. package/build/features/connect/screens/Individual/Individual.js +11 -5
  253. package/build/features/connect/screens/Individual/MobileNumber.js +8 -7
  254. package/build/features/connect/screens/Individual/validation.js +11 -3
  255. package/build/features/connect/screens/Merchant/BrandName.js +5 -2
  256. package/build/features/connect/screens/Merchant/validation.js +2 -2
  257. package/build/features/connect/screens/Mobile/Mobile.js +12 -9
  258. package/build/features/connect/screens/Mobile/MobileNumber.js +8 -7
  259. package/build/features/connect/screens/Mobile/validation.js +11 -3
  260. package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
  261. package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.js +104 -0
  262. package/build/features/connect/screens/MobileOwnership/MobileNumber.d.ts +3 -0
  263. package/build/features/connect/screens/MobileOwnership/MobileNumber.js +72 -0
  264. package/build/features/connect/screens/MobileOwnership/index.d.ts +2 -0
  265. package/build/features/connect/screens/MobileOwnership/index.js +2 -0
  266. package/build/features/connect/screens/MobileOwnership/validation.d.ts +8 -0
  267. package/build/features/connect/screens/MobileOwnership/validation.js +38 -0
  268. package/build/features/connect/screens/NID/IDNumber.d.ts +1 -0
  269. package/build/features/connect/screens/NID/IDNumber.js +2 -2
  270. package/build/features/connect/screens/NID/NID.js +5 -11
  271. package/build/features/connect/screens/NID/validation.d.ts +0 -3
  272. package/build/features/connect/screens/NID/validation.js +0 -1
  273. package/build/features/connect/screens/OTP/OTP.js +6 -6
  274. package/build/features/connect/screens/OTP/OTPInput.js +3 -11
  275. package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
  276. package/build/features/connect/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  277. package/build/features/connect/screens/VerifyNafath/VerifyNafath.js +35 -0
  278. package/build/features/connect/screens/VerifyNafath/index.d.ts +3 -0
  279. package/build/features/connect/screens/VerifyNafath/index.js +2 -0
  280. package/build/features/connectExpress/ConnectExpress.d.ts +5 -2
  281. package/build/features/connectExpress/ConnectExpress.js +62 -39
  282. package/build/features/connectExpress/screens/AuthenticationList/LicenseNumber.js +2 -2
  283. package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +7 -1
  284. package/build/features/connectExpress/screens/CivilID/CivilID.js +6 -1
  285. package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +5 -2
  286. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +8 -1
  287. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
  288. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +1 -1
  289. package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +2 -2
  290. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +30 -7
  291. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +1 -3
  292. package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +9 -8
  293. package/build/features/connectExpress/screens/CollectIndividualInfo/validation.js +11 -3
  294. package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +14 -24
  295. package/build/features/connectExpress/screens/{NID → DOB}/DOB.d.ts +1 -2
  296. package/build/features/connectExpress/screens/{NID → DOB}/DOB.js +3 -3
  297. package/build/features/connectExpress/screens/DOB/DOBForm.d.ts +5 -0
  298. package/build/features/connectExpress/screens/DOB/DOBForm.js +63 -0
  299. package/build/features/connectExpress/screens/DOB/index.d.ts +3 -0
  300. package/build/features/connectExpress/screens/DOB/index.js +2 -0
  301. package/build/features/connectExpress/screens/DOB/validation.d.ts +8 -0
  302. package/build/features/connectExpress/screens/DOB/validation.js +4 -0
  303. package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.d.ts +3 -0
  304. package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.js +9 -0
  305. package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.d.ts +2 -0
  306. package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.js +2 -0
  307. package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.d.ts +5 -0
  308. package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.js +35 -0
  309. package/build/features/connectExpress/screens/IdentityVerifyNafath/index.d.ts +3 -0
  310. package/build/features/connectExpress/screens/IdentityVerifyNafath/index.js +2 -0
  311. package/build/features/connectExpress/screens/Mobile/Mobile.js +10 -3
  312. package/build/features/connectExpress/screens/Mobile/MobileNumber.js +9 -8
  313. package/build/features/connectExpress/screens/Mobile/validation.js +21 -6
  314. package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
  315. package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.js +106 -0
  316. package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.d.ts +3 -0
  317. package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.js +72 -0
  318. package/build/features/connectExpress/screens/MobileOwnership/index.d.ts +2 -0
  319. package/build/features/connectExpress/screens/MobileOwnership/index.js +2 -0
  320. package/build/features/connectExpress/screens/MobileOwnership/validation.d.ts +8 -0
  321. package/build/features/connectExpress/screens/MobileOwnership/validation.js +38 -0
  322. package/build/features/connectExpress/screens/NID/IDNumber.d.ts +1 -0
  323. package/build/features/connectExpress/screens/NID/IDNumber.js +2 -2
  324. package/build/features/connectExpress/screens/NID/NID.js +10 -10
  325. package/build/features/connectExpress/screens/NID/TAC.d.ts +1 -1
  326. package/build/features/connectExpress/screens/NID/TAC.js +2 -2
  327. package/build/features/connectExpress/screens/NID/validation.d.ts +0 -3
  328. package/build/features/connectExpress/screens/NID/validation.js +0 -2
  329. package/build/features/connectExpress/screens/NIDMissed/NID.js +3 -3
  330. package/build/features/connectExpress/screens/NIDMissed/validation.d.ts +0 -3
  331. package/build/features/connectExpress/screens/NIDMissed/validation.js +0 -1
  332. package/build/features/connectExpress/screens/OTP/OTP.js +13 -15
  333. package/build/features/connectExpress/screens/OTP/OTPInput.js +12 -10
  334. package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +5 -0
  335. package/build/features/connectExpress/screens/OperatorError/OperatorError.js +9 -0
  336. package/build/features/connectExpress/screens/OperatorError/index.d.ts +3 -0
  337. package/build/features/connectExpress/screens/OperatorError/index.js +2 -0
  338. package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +5 -0
  339. package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +34 -0
  340. package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +2 -0
  341. package/build/features/connectExpress/screens/PrepareDataLoading/index.js +2 -0
  342. package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -3
  343. package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/OTPInput.js +3 -3
  344. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.d.ts +5 -0
  345. package/build/features/connectExpress/screens/{IdentityOTP/OTP.js → VerifyMobileAuthOTP/VerifyMobileAuthOTP.js} +22 -21
  346. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.d.ts +3 -0
  347. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.js +2 -0
  348. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  349. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +41 -0
  350. package/build/features/connectExpress/screens/VerifyNafath/index.d.ts +3 -0
  351. package/build/features/connectExpress/screens/VerifyNafath/index.js +2 -0
  352. package/build/features/entity/Entity.d.ts +4 -1
  353. package/build/features/entity/Entity.js +22 -9
  354. package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +4 -4
  355. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +8 -4
  356. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +8 -4
  357. package/build/features/entity/screens/EntityCapital/EntityCapital.js +33 -9
  358. package/build/features/entity/screens/EntityName/EntityName.js +31 -14
  359. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +5 -5
  360. package/build/features/entity/screens/EntityName/EntityTypeList.js +2 -3
  361. package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +2 -2
  362. package/build/features/entity/screens/EntityName/ExpiryDate.js +13 -8
  363. package/build/features/entity/screens/EntityName/IssuingDate.d.ts +2 -2
  364. package/build/features/entity/screens/EntityName/IssuingDate.js +15 -8
  365. package/build/features/entity/screens/EntityName/LegalName.js +1 -13
  366. package/build/features/entity/screens/EntityName/LicenseNumber.js +6 -8
  367. package/build/features/entity/screens/EntityName/UnifiedNumber.js +4 -6
  368. package/build/features/entity/screens/EntityName/validation.d.ts +3 -3
  369. package/build/features/entity/screens/EntityName/validation.js +1 -10
  370. package/build/features/entity/screens/OperatorError/OperatorError.d.ts +5 -0
  371. package/build/features/entity/screens/OperatorError/OperatorError.js +9 -0
  372. package/build/features/entity/screens/OperatorError/index.d.ts +3 -0
  373. package/build/features/entity/screens/OperatorError/index.js +2 -0
  374. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  375. package/build/features/entity/screens/Verify/Verify.js +3 -2
  376. package/build/features/featuresScreens.d.ts +1 -0
  377. package/build/features/featuresScreens.js +216 -13
  378. package/build/features/individual/Individual.d.ts +4 -1
  379. package/build/features/individual/Individual.js +22 -9
  380. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +2 -2
  381. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +44 -11
  382. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +5 -2
  383. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +8 -3
  384. package/build/features/individual/screens/IndividualList/Email.js +2 -3
  385. package/build/features/individual/screens/IndividualList/IndividualList.d.ts +4 -4
  386. package/build/features/individual/screens/IndividualList/IndividualList.js +18 -5
  387. package/build/features/individual/screens/IndividualList/MobileNumber.js +8 -10
  388. package/build/features/individual/screens/IndividualList/UserList.js +7 -7
  389. package/build/features/individual/screens/IndividualList/validation.js +11 -4
  390. package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
  391. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +2 -2
  392. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +73 -18
  393. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +6 -5
  394. package/build/features/individual/screens/IndividualPersonalInfo/validation.js +11 -3
  395. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +9 -11
  396. package/build/features/individual/screens/IndividualPhoneInfo/validation.js +11 -3
  397. package/build/features/individual/screens/OperatorError/OperatorError.d.ts +5 -0
  398. package/build/features/individual/screens/OperatorError/OperatorError.js +9 -0
  399. package/build/features/individual/screens/OperatorError/index.d.ts +3 -0
  400. package/build/features/individual/screens/OperatorError/index.js +2 -0
  401. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  402. package/build/features/individual/screens/Verify/Verify.js +3 -2
  403. package/build/features/kyc/KYC.d.ts +11 -0
  404. package/build/features/kyc/KYC.js +99 -0
  405. package/build/features/kyc/index.d.ts +1 -0
  406. package/build/features/kyc/index.js +1 -0
  407. package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.d.ts +5 -0
  408. package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.js +19 -0
  409. package/build/features/kyc/screens/AlreadySubmitted/index.d.ts +2 -0
  410. package/build/features/kyc/screens/AlreadySubmitted/index.js +2 -0
  411. package/build/features/kyc/screens/Loading/Loading.d.ts +4 -0
  412. package/build/features/kyc/screens/Loading/Loading.js +10 -0
  413. package/build/features/kyc/screens/Loading/index.d.ts +2 -0
  414. package/build/features/kyc/screens/Loading/index.js +2 -0
  415. package/build/features/kyc/screens/OperatorError/OperatorError.d.ts +5 -0
  416. package/build/features/kyc/screens/OperatorError/OperatorError.js +9 -0
  417. package/build/features/kyc/screens/OperatorError/index.d.ts +2 -0
  418. package/build/features/kyc/screens/OperatorError/index.js +2 -0
  419. package/build/features/kyc/screens/Success/Success.d.ts +5 -0
  420. package/build/features/kyc/screens/Success/Success.js +32 -0
  421. package/build/features/kyc/screens/Success/index.d.ts +2 -0
  422. package/build/features/kyc/screens/Success/index.js +2 -0
  423. package/build/features/kyc/screens/Terms/Header.d.ts +6 -0
  424. package/build/features/kyc/screens/Terms/Header.js +36 -0
  425. package/build/features/kyc/screens/Terms/Terms.d.ts +4 -0
  426. package/build/features/kyc/screens/Terms/Terms.js +87 -0
  427. package/build/features/kyc/screens/Terms/index.d.ts +2 -0
  428. package/build/features/kyc/screens/Terms/index.js +2 -0
  429. package/build/features/kyc/screens/TokenError/TokenError.d.ts +5 -0
  430. package/build/features/kyc/screens/TokenError/TokenError.js +9 -0
  431. package/build/features/kyc/screens/TokenError/index.d.ts +2 -0
  432. package/build/features/kyc/screens/TokenError/index.js +2 -0
  433. package/build/features/kyc/screens/Users/Users.d.ts +3 -0
  434. package/build/features/kyc/screens/Users/Users.js +76 -0
  435. package/build/features/kyc/screens/Users/index.d.ts +2 -0
  436. package/build/features/kyc/screens/Users/index.js +2 -0
  437. package/build/features/kyc/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  438. package/build/features/kyc/screens/VerifyNafath/VerifyNafath.js +45 -0
  439. package/build/features/kyc/screens/VerifyNafath/index.d.ts +3 -0
  440. package/build/features/kyc/screens/VerifyNafath/index.js +2 -0
  441. package/build/features/kyc/screens/VerifyPaci/VerifyPACI.d.ts +5 -0
  442. package/build/features/kyc/screens/VerifyPaci/VerifyPACI.js +44 -0
  443. package/build/features/kyc/screens/VerifyPaci/index.d.ts +3 -0
  444. package/build/features/kyc/screens/VerifyPaci/index.js +2 -0
  445. package/build/features/password/Password.d.ts +4 -1
  446. package/build/features/password/Password.js +88 -31
  447. package/build/features/password/screens/CreatePassword/CreatePassword.js +8 -4
  448. package/build/features/password/screens/OTP/OTP.js +3 -3
  449. package/build/features/password/screens/OperatorError/OperatorError.d.ts +5 -0
  450. package/build/features/password/screens/OperatorError/OperatorError.js +9 -0
  451. package/build/features/password/screens/OperatorError/index.d.ts +3 -0
  452. package/build/features/password/screens/OperatorError/index.js +2 -0
  453. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
  454. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
  455. package/build/features/password/screens/PrepareDataLoading/index.d.ts +2 -0
  456. package/build/features/password/screens/PrepareDataLoading/index.js +2 -0
  457. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  458. package/build/features/password/screens/Verify/Verify.js +7 -6
  459. package/build/features/shared/Address/CountryList.d.ts +5 -5
  460. package/build/features/shared/Address/InputSelect.d.ts +5 -5
  461. package/build/features/shared/Background/Background.js +1 -1
  462. package/build/features/shared/BusinessCountry/BusinessCountry.js +1 -1
  463. package/build/features/shared/Button/Button.js +3 -1
  464. package/build/features/shared/Button/EmailProvidersButtons.js +2 -0
  465. package/build/features/shared/Button/FlowsButtons.js +18 -4
  466. package/build/features/shared/Button/NafathButton.d.ts +8 -0
  467. package/build/features/shared/Button/{AbsherButton.js → NafathButton.js} +12 -3
  468. package/build/features/shared/Button/index.d.ts +2 -2
  469. package/build/features/shared/Button/index.js +2 -2
  470. package/build/features/shared/Calender/Calender.d.ts +2 -1
  471. package/build/features/shared/Calender/Calender.js +3 -3
  472. package/build/features/shared/Containers/FeatureContainer.d.ts +2 -1
  473. package/build/features/shared/Containers/FeatureContainer.js +5 -3
  474. package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
  475. package/build/features/shared/Dialog/DialogContainer.js +5 -4
  476. package/build/features/shared/Input/Input.d.ts +2 -2
  477. package/build/features/shared/NafathVerification/NafathVerification.d.ts +14 -0
  478. package/build/features/shared/NafathVerification/NafathVerification.js +92 -0
  479. package/build/features/shared/NafathVerification/VerifyNafathLoading.d.ts +8 -0
  480. package/build/features/shared/NafathVerification/VerifyNafathLoading.js +53 -0
  481. package/build/features/shared/NafathVerification/VerifyNafathSuccess.d.ts +5 -0
  482. package/build/features/shared/NafathVerification/VerifyNafathSuccess.js +8 -0
  483. package/build/features/shared/NafathVerification/index.d.ts +2 -0
  484. package/build/features/shared/NafathVerification/index.js +2 -0
  485. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +6 -1
  486. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +10 -13
  487. package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
  488. package/build/features/shared/UploadFile/FileUpload.d.ts +1 -1
  489. package/build/features/shared/UploadFile/UploadFile.d.ts +1 -1
  490. package/build/features/shared/UploadFile/UploadWrapper.d.ts +1 -1
  491. package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +1 -1
  492. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +1 -1
  493. package/build/features/signIn/SignIn.js +18 -7
  494. package/build/features/signIn/screens/Mobile/MobileNumber.js +8 -7
  495. package/build/features/signIn/screens/Mobile/validation.js +11 -3
  496. package/build/features/signIn/screens/OTP/OTP.js +5 -4
  497. package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +5 -0
  498. package/build/features/signIn/screens/OperatorError/OperatorError.js +9 -0
  499. package/build/features/signIn/screens/OperatorError/index.d.ts +3 -0
  500. package/build/features/signIn/screens/OperatorError/index.js +2 -0
  501. package/build/features/tax/Tax.d.ts +4 -1
  502. package/build/features/tax/Tax.js +22 -9
  503. package/build/features/tax/screens/OperatorError/OperatorError.d.ts +5 -0
  504. package/build/features/tax/screens/OperatorError/OperatorError.js +9 -0
  505. package/build/features/tax/screens/OperatorError/index.d.ts +3 -0
  506. package/build/features/tax/screens/OperatorError/index.js +2 -0
  507. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  508. package/build/features/tax/screens/TaxDetails/TaxDetails.js +7 -2
  509. package/build/features/tax/screens/Verify/Verify.js +7 -6
  510. package/build/hooks/index.d.ts +3 -0
  511. package/build/hooks/index.js +3 -0
  512. package/build/hooks/useAppConfig.d.ts +1 -1
  513. package/build/hooks/useAppConfig.js +2 -2
  514. package/build/hooks/useAppDispatch.d.ts +1 -0
  515. package/build/hooks/useAppTheme.js +4 -3
  516. package/build/hooks/useCountDown.d.ts +10 -0
  517. package/build/hooks/useCountDown.js +17 -0
  518. package/build/hooks/useFormDirtyCheck.d.ts +10 -0
  519. package/build/hooks/useFormDirtyCheck.js +66 -0
  520. package/build/hooks/useSanitizedTranslation.d.ts +2 -0
  521. package/build/hooks/useSanitizedTranslation.js +15 -0
  522. package/build/hooks/useVerifyToken.d.ts +4 -2
  523. package/build/hooks/useVerifyToken.js +9 -4
  524. package/build/index.css +360 -120
  525. package/build/index.d.ts +3 -2
  526. package/build/index.js +4 -2
  527. package/build/theme/components.js +7 -0
  528. package/build/theme/palette.js +2 -1
  529. package/build/theme/shadows.js +1 -1
  530. package/build/theme/theme.d.ts +1 -1
  531. package/build/theme/theme.js +2 -2
  532. package/build/utils/array.js +2 -2
  533. package/build/utils/common.d.ts +1 -0
  534. package/build/utils/common.js +16 -3
  535. package/build/utils/error.d.ts +1 -0
  536. package/build/utils/error.js +3 -0
  537. package/build/utils/object.d.ts +1 -0
  538. package/build/utils/object.js +3 -0
  539. package/build/utils/string.d.ts +6 -2
  540. package/build/utils/string.js +28 -3
  541. package/build/utils/validation.d.ts +2 -0
  542. package/build/utils/validation.js +6 -0
  543. package/package.json +3 -4
  544. package/build/features/business/screens/OTP/OTP.d.ts +0 -8
  545. package/build/features/business/screens/OTP/OTP.js +0 -90
  546. package/build/features/business/screens/OTP/index.d.ts +0 -3
  547. package/build/features/business/screens/OTP/index.js +0 -2
  548. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.d.ts +0 -5
  549. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +0 -54
  550. package/build/features/connectExpress/screens/IdentityOTP/index.d.ts +0 -3
  551. package/build/features/connectExpress/screens/IdentityOTP/index.js +0 -2
  552. package/build/features/connectExpress/screens/IdentityOTP/validation.js +0 -4
  553. package/build/features/shared/Button/AbsherButton.d.ts +0 -8
  554. /package/build/features/{connect/screens/NID → auth/screens/DOB}/DOB.d.ts +0 -0
  555. /package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/OTPInput.d.ts +0 -0
  556. /package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/validation.d.ts +0 -0
  557. /package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/validation.js +0 -0
@@ -71,134 +71,113 @@ import API from '../../../api';
71
71
  import { FlowsTypes, IndividualGender, DocumentPurpose } from '../../../@types';
72
72
  import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
73
73
  import { defaultCountry, IDENTIFICATION_TYPE, INDIVIDUAl_STEP_NAMES, MONTHLY_INCOME_LIST } from '../../../constants';
74
- import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, hasNoneEditableValue, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose, formatNumberAsCurrency, removeAllCharsFromNumber, mapUserList, sortUserList, getIndividualType, isOtherThanKWOrSA, isKWOrSA } from '../../../utils';
74
+ import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, hasNoneEditableValue, getUserNameObject, getUserName, sleep, isValidEmail, getRecentDocumentBasedOnPurpose, formatNumberAsCurrency, removeAllCharsFromNumber, mapUserList, sortUserList, getIndividualType, isOtherThanKWOrSA, isKWOrSA, sendCustomEventToGTM } from '../../../utils';
75
75
  export var verifyToken = createAsyncThunk('individual/verifyToken', function (_a, thunkApi) {
76
76
  var token = _a.token, isInternally = _a.isInternally, isUpdatePhoneInfo = _a.isUpdatePhoneInfo;
77
77
  return __awaiter(void 0, void 0, void 0, function () {
78
- var payload, settings, data, individualData, boardData, countryCode, boardInfoData, userList, boardInfoStatus, countries, publicKey, board_id, board_info_id, notification, _b, id, type, data_1, birthCountry, individuals, _c, is_authorized, data_state;
79
- var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
80
- return __generator(this, function (_p) {
81
- switch (_p.label) {
78
+ var settings, payload, data, userList, recipientData, countries, _b, country_code, config, boardId, countryCode, publicKey, data_1, _c, business_id, recipient, board_id, board_info_id, notification, _d, id_1, type, individualData, birthCountry;
79
+ var _e, _f, _g, _h;
80
+ return __generator(this, function (_j) {
81
+ switch (_j.label) {
82
82
  case 0:
83
+ settings = thunkApi.getState().settings;
83
84
  payload = __assign({ service_name: 'tap_email', verify_token: token }, (isInternally && {
84
85
  notification: {
85
86
  sms: false
86
87
  }
87
88
  }));
88
- settings = thunkApi.getState().settings;
89
89
  return [4, API.leadService.verifyLeadToken(payload)];
90
90
  case 1:
91
- data = (_p.sent()).data;
92
- individualData = undefined;
93
- boardInfoStatus = undefined;
91
+ data = (_j.sent()).data;
92
+ recipientData = undefined;
94
93
  countries = settings.data.countries;
95
- if (((_d = data.errors) === null || _d === void 0 ? void 0 : _d.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
94
+ if (((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
96
95
  throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
97
96
  if (isInternally)
98
97
  data.step_name = INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO;
99
- if (data === null || data === void 0 ? void 0 : data.country_code) {
100
- countryCode = data === null || data === void 0 ? void 0 : data.country_code;
101
- thunkApi.dispatch(handleSetCountryByIso2(countryCode));
102
- }
103
- publicKey = (_e = data === null || data === void 0 ? void 0 : data.config) === null || _e === void 0 ? void 0 : _e.public_key;
104
- if (publicKey) {
98
+ _b = data || {}, country_code = _b.country_code, config = _b.config, boardId = _b.id;
99
+ countryCode = country_code;
100
+ publicKey = config === null || config === void 0 ? void 0 : config.public_key;
101
+ if (country_code)
102
+ thunkApi.dispatch(handleSetCountryByIso2(country_code));
103
+ if (publicKey)
105
104
  thunkApi.dispatch(handlePublicKey(publicKey));
106
- }
107
- if (!(data.step_name === INDIVIDUAl_STEP_NAMES.PHONE_INFO)) return [3, 2];
108
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PHONE_INFO_STEP'));
109
- return [3, 20];
105
+ if (!!country_code) return [3, 3];
106
+ return [4, API.boardService.retrieveBoardDetails(boardId)];
110
107
  case 2:
111
- if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 19];
112
- board_id = data === null || data === void 0 ? void 0 : data.id;
113
- board_info_id = data === null || data === void 0 ? void 0 : data.board_info_id;
114
- if (!(board_id && board_info_id)) return [3, 5];
115
- return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
108
+ data_1 = _j.sent();
109
+ countryCode = (_f = data_1 === null || data_1 === void 0 ? void 0 : data_1.entity) === null || _f === void 0 ? void 0 : _f.country;
110
+ if (countryCode)
111
+ thunkApi.dispatch(handleSetCountryByIso2(countryCode));
112
+ _j.label = 3;
116
113
  case 3:
117
- boardInfoData = _p.sent();
118
- notification = (boardInfoData || {}).notification;
119
- _b = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _b.id, type = _b.type;
120
- if (!(id && type)) return [3, 5];
121
- return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
114
+ if (!(data.step_name === INDIVIDUAl_STEP_NAMES.PHONE_INFO)) return [3, 4];
115
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PHONE_INFO_STEP'));
116
+ return [3, 18];
122
117
  case 4:
123
- data_1 = (_p.sent()).data;
124
- individualData = data_1 || {};
125
- _p.label = 5;
118
+ if (!(data.step_name !== INDIVIDUAl_STEP_NAMES.PHONE_AUTH)) return [3, 17];
119
+ _c = data || {}, business_id = _c.business_id, recipient = _c.recipient, board_id = _c.id, board_info_id = _c.board_info_id;
120
+ recipientData = recipient;
121
+ if (!!((_g = data === null || data === void 0 ? void 0 : data.recipient) === null || _g === void 0 ? void 0 : _g.id)) return [3, 6];
122
+ if (!(board_id && board_info_id)) return [3, 6];
123
+ return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
126
124
  case 5:
127
- if (!board_id) return [3, 7];
128
- return [4, API.boardService.retrieveBoardDetails(board_id)];
125
+ notification = (_j.sent()).notification;
126
+ recipientData = notification === null || notification === void 0 ? void 0 : notification.recipient;
127
+ if (!(recipientData === null || recipientData === void 0 ? void 0 : recipientData.id))
128
+ throw new Error('individual_id_missing');
129
+ _j.label = 6;
129
130
  case 6:
130
- boardData = _p.sent();
131
- _p.label = 7;
131
+ _d = recipientData || {}, id_1 = _d.id, type = _d.type;
132
+ return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id_1, type: type, countryCode: countryCode })).unwrap()];
132
133
  case 7:
133
- if (!countryCode) {
134
- countryCode = (_f = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _f === void 0 ? void 0 : _f.country;
135
- if (countryCode)
136
- thunkApi.dispatch(handleSetCountryByIso2(countryCode));
137
- }
138
- if (!(!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) && !isKWOrSA(countryCode))) return [3, 11];
139
- if (!((_g = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _g === void 0 ? void 0 : _g.id)) return [3, 9];
140
- return [4, thunkApi.dispatch(getIndividualList((_h = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _h === void 0 ? void 0 : _h.id)).unwrap()];
134
+ individualData = (_j.sent()).data;
135
+ if (!(!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) && !isKWOrSA(countryCode))) return [3, 10];
136
+ if (!business_id) return [3, 9];
137
+ return [4, thunkApi.dispatch(getIndividualList(business_id)).unwrap()];
141
138
  case 8:
142
- userList = _p.sent();
143
- _p.label = 9;
139
+ userList = _j.sent();
140
+ _j.label = 9;
144
141
  case 9:
145
- userList = userList === null || userList === void 0 ? void 0 : userList.filter(function (user) { return user.id === (individualData === null || individualData === void 0 ? void 0 : individualData.id); });
146
- return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
147
- case 10:
148
- boardInfoStatus = _p.sent();
142
+ userList = userList === null || userList === void 0 ? void 0 : userList.filter(function (user) { return user.id === id_1; });
149
143
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
150
- return [3, 18];
144
+ return [3, 16];
145
+ case 10:
146
+ if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 13];
147
+ if (!business_id) return [3, 12];
148
+ return [4, thunkApi.dispatch(getIndividualList(business_id)).unwrap()];
151
149
  case 11:
152
- if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 15];
153
- if (!((_j = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _j === void 0 ? void 0 : _j.id)) return [3, 13];
154
- return [4, thunkApi.dispatch(getIndividualList((_k = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _k === void 0 ? void 0 : _k.id)).unwrap()];
150
+ userList = _j.sent();
151
+ _j.label = 12;
155
152
  case 12:
156
- userList = _p.sent();
157
- _p.label = 13;
158
- case 13: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
159
- case 14:
160
- boardInfoStatus = _p.sent();
161
153
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
162
- return [3, 18];
163
- case 15:
164
- birthCountry = ((_l = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _l === void 0 ? void 0 : _l.country) || countryCode;
165
- if (!birthCountry) return [3, 17];
154
+ return [3, 16];
155
+ case 13:
156
+ birthCountry = ((_h = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _h === void 0 ? void 0 : _h.country) || countryCode;
157
+ if (!birthCountry) return [3, 15];
166
158
  return [4, thunkApi.dispatch(getCityList(birthCountry))];
167
- case 16:
168
- _p.sent();
169
- _p.label = 17;
159
+ case 14:
160
+ _j.sent();
161
+ _j.label = 15;
162
+ case 15:
163
+ if (isInternally)
164
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
165
+ else
166
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
167
+ _j.label = 16;
168
+ case 16: return [3, 18];
170
169
  case 17:
171
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP'));
172
- _p.label = 18;
173
- case 18: return [3, 20];
174
- case 19:
175
170
  if (isUpdatePhoneInfo) {
176
171
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_VERIFY_STEP'));
177
172
  }
178
- _p.label = 20;
179
- case 20:
180
- individuals = (boardData || {}).individuals;
181
- _c = individualData || {}, is_authorized = _c.is_authorized, data_state = _c.data_state;
182
- return [2, {
183
- data: data,
184
- boardResponse: {
185
- brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
186
- bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
187
- entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
188
- merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
189
- merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
190
- name: (_m = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _m === void 0 ? void 0 : _m.names,
191
- contact: (_o = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _o === void 0 ? void 0 : _o.contact,
192
- individuals: is_authorized ? individuals : __assign(__assign({}, individuals), (!!data_state && { data_state: data_state })),
193
- countries: countries,
194
- countryCode: countryCode,
195
- notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
196
- business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
197
- flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
198
- },
199
- token: token,
200
- userList: userList || []
201
- }];
173
+ _j.label = 18;
174
+ case 18: return [2, {
175
+ data: data,
176
+ countries: countries,
177
+ countryCode: countryCode,
178
+ token: token,
179
+ userList: userList || []
180
+ }];
202
181
  }
203
182
  });
204
183
  });
@@ -411,140 +390,139 @@ export var retrieveDataList = createAsyncThunk('individualRetrieveDataList', fun
411
390
  });
412
391
  }); });
413
392
  export var retrieveBoardStatus = createAsyncThunk('individual/retrieveBoardStatus', function (parmas, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
414
- var individual, board_id, data;
415
- return __generator(this, function (_a) {
416
- switch (_a.label) {
393
+ var individual, _a, board_id, board_info_id, data;
394
+ return __generator(this, function (_b) {
395
+ switch (_b.label) {
417
396
  case 0:
418
397
  individual = thunkApi.getState().individual;
419
- board_id = (individual.data.verify.responseBody || {}).board_id;
398
+ _a = individual.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id;
399
+ if (!board_id || !board_info_id)
400
+ throw new Error('Internal server error');
420
401
  return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
421
402
  case 1:
422
- data = _a.sent();
403
+ data = _b.sent();
404
+ return [4, thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id })).unwrap()];
405
+ case 2:
406
+ _b.sent();
423
407
  thunkApi.dispatch(handlePrevScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
424
408
  return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
425
409
  }
426
410
  });
427
411
  }); });
428
- export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetails', function (boardId) { return __awaiter(void 0, void 0, void 0, function () {
429
- var _a, user, data;
430
- var _b, _c;
431
- return __generator(this, function (_d) {
432
- switch (_d.label) {
433
- case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
434
- case 1:
435
- _a = _d.sent(), user = _a.user, data = __rest(_a, ["user"]);
436
- return [2, {
437
- data: __assign(__assign({}, data), { brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.names, individuals: data === null || data === void 0 ? void 0 : data.individuals, contact: (_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.contact })
438
- }];
439
- }
412
+ export var retrieveBoardDetails = createAsyncThunk('retrieveIndividualBoardDetails', function (_a, thunkApi) {
413
+ var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
414
+ return __awaiter(void 0, void 0, void 0, function () {
415
+ var _b, individual, settings, individualData, _c, user, data, data_3, data_state;
416
+ var _d, _e, _f;
417
+ return __generator(this, function (_g) {
418
+ switch (_g.label) {
419
+ case 0:
420
+ _b = thunkApi.getState(), individual = _b.individual, settings = _b.settings;
421
+ individualData = (_d = individual.data.verify.responseBody) === null || _d === void 0 ? void 0 : _d.user;
422
+ return [4, API.boardService.retrieveBoardDetails(boardId)];
423
+ case 1:
424
+ _c = _g.sent(), user = _c.user, data = __rest(_c, ["user"]);
425
+ if (!((individualData === null || individualData === void 0 ? void 0 : individualData.id) === (user === null || user === void 0 ? void 0 : user.id))) return [3, 2];
426
+ individualData = user;
427
+ return [3, 4];
428
+ case 2:
429
+ if (!(!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) && id && type)) return [3, 4];
430
+ return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: settings.data.businessCountry.iso2 })).unwrap()];
431
+ case 3:
432
+ data_3 = (_g.sent()).data;
433
+ individualData = data_3;
434
+ _g.label = 4;
435
+ case 4:
436
+ data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) && (data === null || data === void 0 ? void 0 : data.individuals) ? data === null || data === void 0 ? void 0 : data.individuals : individualData) || {}).data_state;
437
+ return [2, {
438
+ data: __assign(__assign(__assign(__assign({}, data), { brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_e = data === null || data === void 0 ? void 0 : data.user) === null || _e === void 0 ? void 0 : _e.names, individuals: data === null || data === void 0 ? void 0 : data.individuals, contact: (_f = data === null || data === void 0 ? void 0 : data.user) === null || _f === void 0 ? void 0 : _f.contact }), (data_state && {
439
+ individuals: __assign(__assign({}, data === null || data === void 0 ? void 0 : data.individuals), { data_state: data_state })
440
+ })), { board_status: data === null || data === void 0 ? void 0 : data.status })
441
+ }];
442
+ }
443
+ });
440
444
  });
441
- }); });
445
+ });
442
446
  export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
443
- var _a, individual, settings, responseBody, _b, board_id, board_info_id, countries, payload, data, individualData, boardInfoData, userList, boardData, boardInfoStatus, publicKey, countryCode, notification, _c, id, type, data_3, birthCountry, individuals, _d, is_authorized, data_state;
444
- var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
445
- return __generator(this, function (_t) {
446
- switch (_t.label) {
447
+ var _a, individual, settings, responseBody, countries, payload, data, userList, recipientData, publicKey, countryCode, _b, business_id, recipient, board_id, board_info_id, notification, _c, id, type, individualData, birthCountry;
448
+ var _d, _e, _f, _g, _h, _j, _k, _l;
449
+ return __generator(this, function (_m) {
450
+ switch (_m.label) {
447
451
  case 0:
448
452
  _a = thunkApi.getState(), individual = _a.individual, settings = _a.settings;
449
453
  responseBody = individual.data.verify.responseBody;
450
- _b = responseBody || {}, board_id = _b.board_id, board_info_id = _b.board_info_id;
451
454
  countries = settings.data.countries;
452
455
  payload = {
453
456
  data: params.otp,
454
- service_name: (_e = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _e === void 0 ? void 0 : _e.service_name,
457
+ service_name: (_d = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _d === void 0 ? void 0 : _d.service_name,
455
458
  verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
456
459
  step_name: INDIVIDUAl_STEP_NAMES.PHONE_AUTH,
457
460
  encryption_contract: ['data']
458
461
  };
459
462
  return [4, API.leadService.verifyLeadOTP(payload)];
460
463
  case 1:
461
- data = (_t.sent()).data;
462
- individualData = undefined;
463
- boardInfoStatus = undefined;
464
- if ((_f = data.errors) === null || _f === void 0 ? void 0 : _f.length)
464
+ data = (_m.sent()).data;
465
+ recipientData = undefined;
466
+ if ((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length)
465
467
  throw new Error(data.errors[0].description);
466
- publicKey = (_g = data === null || data === void 0 ? void 0 : data.config) === null || _g === void 0 ? void 0 : _g.public_key;
467
- if (publicKey) {
468
+ publicKey = (_f = data === null || data === void 0 ? void 0 : data.config) === null || _f === void 0 ? void 0 : _f.public_key;
469
+ countryCode = data === null || data === void 0 ? void 0 : data.country_code;
470
+ if (publicKey)
468
471
  thunkApi.dispatch(handlePublicKey(publicKey));
469
- }
470
- if (!board_id) return [3, 3];
471
- return [4, API.boardService.retrieveBoardDetails(board_id)];
472
+ if (!((_g = settings.data.businessCountry) === null || _g === void 0 ? void 0 : _g.iso2) && countryCode)
473
+ thunkApi.dispatch(handleSetCountryByIso2(countryCode));
474
+ _b = data || {}, business_id = _b.business_id, recipient = _b.recipient, board_id = _b.id, board_info_id = _b.board_info_id;
475
+ recipientData = recipient;
476
+ if (!!((_h = data === null || data === void 0 ? void 0 : data.recipient) === null || _h === void 0 ? void 0 : _h.id)) return [3, 3];
477
+ if (!(board_id && board_info_id)) return [3, 3];
478
+ return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
472
479
  case 2:
473
- boardData = _t.sent();
474
- _t.label = 3;
480
+ notification = (_m.sent()).notification;
481
+ recipientData = notification === null || notification === void 0 ? void 0 : notification.recipient;
482
+ if (!(recipientData === null || recipientData === void 0 ? void 0 : recipientData.id))
483
+ throw new Error('individual_id_missing');
484
+ _m.label = 3;
475
485
  case 3:
476
- countryCode = (_h = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _h === void 0 ? void 0 : _h.country;
477
- if (!(board_id && board_info_id)) return [3, 6];
478
- return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
479
- case 4:
480
- boardInfoData = _t.sent();
481
- notification = (boardInfoData || {}).notification;
482
- _c = (notification === null || notification === void 0 ? void 0 : notification.recipient) || {}, id = _c.id, type = _c.type;
483
- if (!(id && type)) return [3, 6];
486
+ _c = recipientData || {}, id = _c.id, type = _c.type;
484
487
  return [4, thunkApi.dispatch(retrieveIndividualInfo({ id: id, type: type, countryCode: countryCode })).unwrap()];
488
+ case 4:
489
+ individualData = (_m.sent()).data;
490
+ if (!(!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) && !isKWOrSA(countryCode))) return [3, 7];
491
+ if (!business_id) return [3, 6];
492
+ return [4, thunkApi.dispatch(getIndividualList(business_id)).unwrap()];
485
493
  case 5:
486
- data_3 = (_t.sent()).data;
487
- individualData = data_3 || {};
488
- _t.label = 6;
494
+ userList = _m.sent();
495
+ _m.label = 6;
489
496
  case 6:
490
- if (countryCode)
491
- thunkApi.dispatch(handleSetCountryByIso2(countryCode));
492
- if (!(!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) && !isKWOrSA(countryCode))) return [3, 10];
493
- if (!((_j = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _j === void 0 ? void 0 : _j.id)) return [3, 8];
494
- return [4, thunkApi.dispatch(getIndividualList((_k = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _k === void 0 ? void 0 : _k.id)).unwrap()];
497
+ userList = userList === null || userList === void 0 ? void 0 : userList.filter(function (user) { return user.id === id; });
498
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
499
+ return [3, 13];
495
500
  case 7:
496
- userList = _t.sent();
497
- _t.label = 8;
501
+ if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 10];
502
+ if (!business_id) return [3, 9];
503
+ return [4, thunkApi.dispatch(getIndividualList(business_id)).unwrap()];
498
504
  case 8:
499
- userList = userList === null || userList === void 0 ? void 0 : userList.filter(function (user) { return user.id === (individualData === null || individualData === void 0 ? void 0 : individualData.id); });
500
- return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
505
+ userList = _m.sent();
506
+ _m.label = 9;
501
507
  case 9:
502
- boardInfoStatus = _t.sent();
503
508
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
504
- return [3, 17];
509
+ return [3, 13];
505
510
  case 10:
506
- if (!(individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized)) return [3, 14];
507
- if (!((_l = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _l === void 0 ? void 0 : _l.id)) return [3, 12];
508
- return [4, thunkApi.dispatch(getIndividualList((_m = boardData === null || boardData === void 0 ? void 0 : boardData.business) === null || _m === void 0 ? void 0 : _m.id))];
509
- case 11:
510
- _t.sent();
511
- _t.label = 12;
512
- case 12: return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
513
- case 13:
514
- boardInfoStatus = _t.sent();
515
- thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_LIST_STEP'));
516
- return [3, 17];
517
- case 14:
518
- birthCountry = ((_o = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _o === void 0 ? void 0 : _o.country) || countryCode;
519
- if (!birthCountry) return [3, 16];
511
+ birthCountry = ((_j = individualData === null || individualData === void 0 ? void 0 : individualData.birth) === null || _j === void 0 ? void 0 : _j.country) || countryCode;
512
+ if (!birthCountry) return [3, 12];
520
513
  return [4, thunkApi.dispatch(getCityList(birthCountry))];
521
- case 15:
522
- _t.sent();
523
- _t.label = 16;
524
- case 16:
514
+ case 11:
515
+ _m.sent();
516
+ _m.label = 12;
517
+ case 12:
525
518
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_PERSONAL_INDIVIDUAL_INFO_STEP')); });
526
- _t.label = 17;
527
- case 17:
528
- (_q = (_p = settings.data.appConfig).onStepCompleted) === null || _q === void 0 ? void 0 : _q.call(_p, settings.data.activeScreen.name, { otp: params.otp });
529
- individuals = (boardData || {}).individuals;
530
- _d = individualData || {}, is_authorized = _d.is_authorized, data_state = _d.data_state;
519
+ _m.label = 13;
520
+ case 13:
521
+ (_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, { otp: params.otp });
531
522
  return [2, {
532
523
  data: data,
533
- boardResponse: {
534
- brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
535
- bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
536
- entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity,
537
- merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
538
- merchant_id: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.merchant_id,
539
- name: (_r = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _r === void 0 ? void 0 : _r.names,
540
- contact: (_s = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _s === void 0 ? void 0 : _s.contact,
541
- individuals: is_authorized ? individuals : __assign(__assign({}, individuals), (!!data_state && { data_state: data_state })),
542
- countries: countries,
543
- countryCode: countryCode,
544
- notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification,
545
- business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
546
- flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || []
547
- },
524
+ countries: countries,
525
+ countryCode: countryCode,
548
526
  formData: __assign({}, params),
549
527
  userList: userList
550
528
  }];
@@ -584,21 +562,20 @@ export var updatePhoneInfo = createAsyncThunk('individual/updatePhoneInfo', func
584
562
  });
585
563
  });
586
564
  export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateIndividualPersonalInfo', function (_a, thunkApi) {
587
- var formData = _a.formData, originalFormData = _a.originalFormData;
565
+ var formData = _a.formData, originalFormData = _a.originalFormData, isDirty = _a.isDirty;
588
566
  return __awaiter(void 0, void 0, void 0, function () {
589
- var _b, settings, individual, _c, notification, user, entity, id, _d, objects, ids, countryCode, name, email, mobile, gender, nid, issuedCountry, expiryDate, dob, placeOfBirthCountry, placeOfBirthCity, nationality, code, data_status, userName, identification_id_type, isGenderNonEditable, isNameENNonEditable, isNameARNonEditable, isEmailNonEditable, isMobileNumberNonEditable, isMobileCountryNonEditable, isNidNonEditable, isIssuedCountryNonEditable, isExpiryNonEditable, isIdTypeNonEditable, isNationalityNonEditable, isDOBNonEditable, isBirthCityNonEditable, isBirthCountryNonEditable, hasContact, hasPhone, hasIdentification, hasBirth, nameIsEditable, contact, requestBody, data, currencyData, _e, isUser, isBuyer, isUserORBuyerType;
567
+ var _b, settings, individual, _c, recipient, user, entity, id, countryCode, name, email, mobile, gender, nid, issuedCountry, expiryDate, dob, placeOfBirthCountry, placeOfBirthCity, nationality, code, _d, data_status, objects, ids, userName, identification_id_type, isGenderNonEditable, isNameENNonEditable, isNameARNonEditable, isEmailNonEditable, isMobileNumberNonEditable, isMobileCountryNonEditable, isNidNonEditable, isIssuedCountryNonEditable, isExpiryNonEditable, isIdTypeNonEditable, isNationalityNonEditable, isDOBNonEditable, isBirthCityNonEditable, isBirthCountryNonEditable, hasContact, hasPhone, hasIdentification, hasBirth, nameIsEditable, contact, requestBody, individualData, data, _e, isUser, isBuyer, isUserORBuyerType;
590
568
  var _f, _g, _h, _j, _k;
591
569
  return __generator(this, function (_l) {
592
570
  switch (_l.label) {
593
571
  case 0:
594
572
  _b = thunkApi.getState(), settings = _b.settings, individual = _b.individual;
595
- _c = individual.data.verify.responseBody || {}, notification = _c.notification, user = _c.user, entity = _c.entity;
596
- id = (((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}).id;
597
- _d = user || {}, objects = _d.objects, ids = _d.ids;
573
+ _c = individual.data.verify.responseBody || {}, recipient = _c.recipient, user = _c.user, entity = _c.entity;
574
+ id = (((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : recipient) || {}).id;
598
575
  countryCode = (originalFormData || {}).countryCode;
599
576
  name = formData.name, email = formData.email, mobile = formData.mobile, gender = formData.gender, nid = formData.nid, issuedCountry = formData.issuedCountry, expiryDate = formData.expiryDate, dob = formData.dob, placeOfBirthCountry = formData.placeOfBirthCountry, placeOfBirthCity = formData.placeOfBirthCity, nationality = formData.nationality;
600
577
  code = entity === null || entity === void 0 ? void 0 : entity.country;
601
- data_status = (user || {}).data_status;
578
+ _d = user || {}, data_status = _d.data_status, objects = _d.objects, ids = _d.ids;
602
579
  userName = getUserNameObject(name);
603
580
  identification_id_type = nid ? (nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA) : undefined;
604
581
  if (isOtherThanKWOrSA(settings.data.businessCountry.iso2)) {
@@ -667,12 +644,14 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
667
644
  'date_of_birth',
668
645
  'nationality'
669
646
  ], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_PERSONAL_INFO });
647
+ individualData = undefined;
648
+ if (!isDirty) return [3, 2];
670
649
  return [4, API.individualService.updateMultipleIndividual(requestBody)];
671
650
  case 1:
672
651
  data = _l.sent();
673
- return [4, API.countryService.getCurrency(settings.data.businessCountry.iso2)];
652
+ individualData = data;
653
+ _l.label = 2;
674
654
  case 2:
675
- currencyData = _l.sent();
676
655
  _e = getIndividualType(objects), isUser = _e.isUser, isBuyer = _e.isBuyer;
677
656
  isUserORBuyerType = isUser || isBuyer;
678
657
  if (!isUserORBuyerType) return [3, 4];
@@ -683,31 +662,35 @@ export var updateIndividualPersonalInfo = createAsyncThunk('individual/updateInd
683
662
  case 4:
684
663
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
685
664
  (_k = (_j = settings.data.appConfig).onStepCompleted) === null || _k === void 0 ? void 0 : _k.call(_j, settings.data.activeScreen.name, requestBody);
686
- return [2, { data: data, formData: originalFormData, currencyData: currencyData }];
665
+ return [2, { data: individualData, formData: originalFormData }];
687
666
  }
688
667
  });
689
668
  });
690
669
  });
691
670
  export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', function (_a, thunkApi) {
692
- var formData = _a.formData, originalFormData = _a.originalFormData;
671
+ var formData = _a.formData, originalFormData = _a.originalFormData, isDirty = _a.isDirty;
693
672
  return __awaiter(void 0, void 0, void 0, function () {
694
- var _b, settings, individual, _c, notification, user, userList, business, id, _d, objects, ids, isKWOrSAValue, occupation, sourceIncome, monthlyIncome, isPEP, isInfluencer, shareCount, shareValue, civilID, signatureFileId, isAuthorized, isOccupationNonEditable, isSourceIncomeNonEditable, isPEPNonEditable, isInfluencerNonEditable, isMonthlyIncomeNonEditable, isAuthorizedNonEditable, isSharesAvailable, pepInfo, influencerInfo, occupationInfo, sourceIncomeInfo, monthlyIncomeInfo, isAuthorizedInfo, userPayload, shareHolderPayload, boardMemberPayload, buyerMemberPayload, _e, isUser, isShareholder, isBoardMember, isBuyer, isCustomer, isUserORBuyerType, payload, businessCountry, hasCivilIdDocument, hasSignatureDocument, isSendSignatureFile, civilIdDocument, signatureDocument, documentBody, documentBody, documentsList, documentBody, requestBody, data, individualData, userListRes;
695
- var _f, _g;
696
- return __generator(this, function (_h) {
697
- switch (_h.label) {
673
+ var _b, settings, individual, _c, verify, individualPersonalData, _d, recipient, user, userList, business, individualResData, userRes, userResInfo, id, _e, objects, ids, isKWOrSAValue, occupation, sourceIncome, monthlyIncome, isPEP, isInfluencer, shareCount, shareValue, civilID, signatureFileId, isAuthorized, isOccupationNonEditable, isSourceIncomeNonEditable, isPEPNonEditable, isInfluencerNonEditable, isMonthlyIncomeNonEditable, isAuthorizedNonEditable, isSharesAvailable, pepInfo, influencerInfo, occupationInfo, sourceIncomeInfo, monthlyIncomeInfo, isAuthorizedInfo, userPayload, shareHolderPayload, boardMemberPayload, buyerMemberPayload, _f, isUser, isShareholder, isBoardMember, isBuyer, isCustomer, isUserORBuyerType, payload, businessCountry, hasCivilIdDocument, hasSignatureDocument, isSendSignatureFile, civilIdDocument, signatureDocument, documentBody, documentBody, documentsList, documentBody, data, individualData, requestBody, user_2, userListRes;
674
+ var _g, _h;
675
+ return __generator(this, function (_j) {
676
+ switch (_j.label) {
698
677
  case 0:
699
678
  _b = thunkApi.getState(), settings = _b.settings, individual = _b.individual;
700
- _c = individual.data.verify.responseBody || {}, notification = _c.notification, user = _c.user, userList = _c.userList, business = _c.business;
701
- id = (((user === null || user === void 0 ? void 0 : user.is_authorized) ? user : notification === null || notification === void 0 ? void 0 : notification.recipient) || {}).id;
702
- _d = user || {}, objects = _d.objects, ids = _d.ids;
679
+ _c = individual.data, verify = _c.verify, individualPersonalData = _c.individualPersonalData;
680
+ _d = verify.responseBody || {}, recipient = _d.recipient, user = _d.user, userList = _d.userList, business = _d.business;
681
+ individualResData = individualPersonalData.responseBody || {};
682
+ userRes = (sortUserList(mapUserList(individualResData === null || individualResData === void 0 ? void 0 : individualResData.individuals)) || [])[0];
683
+ userResInfo = userRes || user;
684
+ id = (((userResInfo === null || userResInfo === void 0 ? void 0 : userResInfo.is_authorized) ? userResInfo : recipient) || {}).id;
685
+ _e = userResInfo || {}, objects = _e.objects, ids = _e.ids;
703
686
  isKWOrSAValue = isKWOrSA(settings.data.businessCountry.iso2);
704
687
  occupation = formData.occupation, sourceIncome = formData.sourceIncome, monthlyIncome = formData.monthlyIncome, isPEP = formData.isPEP, isInfluencer = formData.isInfluencer, shareCount = formData.shareCount, shareValue = formData.shareValue, civilID = formData.civilID, signatureFileId = formData.signatureFileId, isAuthorized = formData.isAuthorized;
705
- isOccupationNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'occupation');
706
- isSourceIncomeNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'source_of_income');
707
- isPEPNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_relative_PEP');
708
- isInfluencerNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_influencer');
709
- isMonthlyIncomeNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'monthly_income');
710
- isAuthorizedNonEditable = hasNoneEditableValue(user === null || user === void 0 ? void 0 : user.data_status, 'is_authorized');
688
+ isOccupationNonEditable = hasNoneEditableValue(userResInfo === null || userResInfo === void 0 ? void 0 : userResInfo.data_status, 'occupation');
689
+ isSourceIncomeNonEditable = hasNoneEditableValue(userResInfo === null || userResInfo === void 0 ? void 0 : userResInfo.data_status, 'source_of_income');
690
+ isPEPNonEditable = hasNoneEditableValue(userResInfo === null || userResInfo === void 0 ? void 0 : userResInfo.data_status, 'is_relative_PEP');
691
+ isInfluencerNonEditable = hasNoneEditableValue(userResInfo === null || userResInfo === void 0 ? void 0 : userResInfo.data_status, 'is_influencer');
692
+ isMonthlyIncomeNonEditable = hasNoneEditableValue(userResInfo === null || userResInfo === void 0 ? void 0 : userResInfo.data_status, 'monthly_income');
693
+ isAuthorizedNonEditable = hasNoneEditableValue(userResInfo === null || userResInfo === void 0 ? void 0 : userResInfo.data_status, 'is_authorized');
711
694
  isSharesAvailable = shareCount || shareValue;
712
695
  pepInfo = isPEPNonEditable || isPEP === null ? undefined : isPEP;
713
696
  influencerInfo = isInfluencerNonEditable || isInfluencer === null ? undefined : isInfluencer;
@@ -739,7 +722,7 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
739
722
  source_income: sourceIncomeInfo,
740
723
  monthly_income: monthlyIncomeInfo
741
724
  };
742
- _e = getIndividualType(objects), isUser = _e.isUser, isShareholder = _e.isShareholder, isBoardMember = _e.isBoardMember, isBuyer = _e.isBuyer, isCustomer = _e.isCustomer;
725
+ _f = getIndividualType(objects), isUser = _f.isUser, isShareholder = _f.isShareholder, isBoardMember = _f.isBoardMember, isBuyer = _f.isBuyer, isCustomer = _f.isCustomer;
743
726
  isUserORBuyerType = isUser || isBuyer;
744
727
  payload = userPayload;
745
728
  if (objects === null || objects === void 0 ? void 0 : objects.length) {
@@ -749,8 +732,8 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
749
732
  hasCivilIdDocument = (civilID || []).length > 0;
750
733
  hasSignatureDocument = (signatureFileId || []).length > 0;
751
734
  isSendSignatureFile = isAuthorized && isUserORBuyerType;
752
- civilIdDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.IDENTITY_DOCUMENT);
753
- signatureDocument = getRecentDocumentBasedOnPurpose(user === null || user === void 0 ? void 0 : user.documents, DocumentPurpose.CUSTOMER_SIGNATURE);
735
+ civilIdDocument = getRecentDocumentBasedOnPurpose(userResInfo === null || userResInfo === void 0 ? void 0 : userResInfo.documents, DocumentPurpose.IDENTITY_DOCUMENT);
736
+ signatureDocument = getRecentDocumentBasedOnPurpose(userResInfo === null || userResInfo === void 0 ? void 0 : userResInfo.documents, DocumentPurpose.CUSTOMER_SIGNATURE);
754
737
  if (!((civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id) && hasCivilIdDocument)) return [3, 2];
755
738
  documentBody = {
756
739
  id: civilIdDocument.id,
@@ -758,8 +741,8 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
758
741
  };
759
742
  return [4, API.documentService.addFilesToExistingDocument(documentBody)];
760
743
  case 1:
761
- _h.sent();
762
- _h.label = 2;
744
+ _j.sent();
745
+ _j.label = 2;
763
746
  case 2:
764
747
  if (!((signatureDocument === null || signatureDocument === void 0 ? void 0 : signatureDocument.id) && hasSignatureDocument && isSendSignatureFile)) return [3, 4];
765
748
  documentBody = {
@@ -768,8 +751,8 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
768
751
  };
769
752
  return [4, API.documentService.addFilesToExistingDocument(documentBody)];
770
753
  case 3:
771
- _h.sent();
772
- _h.label = 4;
754
+ _j.sent();
755
+ _j.label = 4;
773
756
  case 4:
774
757
  documentsList = [];
775
758
  if (hasCivilIdDocument && !(civilIdDocument === null || civilIdDocument === void 0 ? void 0 : civilIdDocument.id))
@@ -784,23 +767,33 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
784
767
  };
785
768
  return [4, API.documentService.updateDocumentInfo(documentBody)];
786
769
  case 5:
787
- _h.sent();
788
- _h.label = 6;
770
+ _j.sent();
771
+ _j.label = 6;
789
772
  case 6:
773
+ data = undefined, individualData = userResInfo || {};
790
774
  requestBody = __assign(__assign({ ids: (ids === null || ids === void 0 ? void 0 : ids.length) ? ids : [id] }, payload), { encryption_contract: [], step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO });
775
+ if (!isDirty) return [3, 8];
791
776
  return [4, API.individualService.updateMultipleIndividual(requestBody)];
792
777
  case 7:
793
- data = _h.sent();
794
- individualData = (sortUserList(mapUserList(data === null || data === void 0 ? void 0 : data.individuals)) || [])[0];
778
+ data = _j.sent();
779
+ user_2 = (sortUserList(mapUserList(data === null || data === void 0 ? void 0 : data.individuals)) || [])[0];
780
+ individualData = user_2;
781
+ _j.label = 8;
782
+ case 8:
795
783
  userListRes = userList || [];
796
- if (!((user === null || user === void 0 ? void 0 : user.id) === (individualData === null || individualData === void 0 ? void 0 : individualData.id) && !(user === null || user === void 0 ? void 0 : user.is_authorized) && isAuthorized && (business === null || business === void 0 ? void 0 : business.id))) return [3, 9];
784
+ userListRes = userListRes.map(function (u) {
785
+ if (u.id === individualData.id) {
786
+ return individualData;
787
+ }
788
+ });
789
+ if (!((userResInfo === null || userResInfo === void 0 ? void 0 : userResInfo.id) === (individualData === null || individualData === void 0 ? void 0 : individualData.id) && !(userResInfo === null || userResInfo === void 0 ? void 0 : userResInfo.is_authorized) && isAuthorized && (business === null || business === void 0 ? void 0 : business.id))) return [3, 10];
797
790
  return [4, thunkApi.dispatch(getIndividualList(business === null || business === void 0 ? void 0 : business.id)).unwrap()];
798
- case 8:
799
- userListRes = _h.sent();
800
- _h.label = 9;
801
791
  case 9:
792
+ userListRes = _j.sent();
793
+ _j.label = 10;
794
+ case 10:
802
795
  thunkApi.dispatch(handleNextScreenStep());
803
- (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, requestBody);
796
+ (_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, requestBody);
804
797
  return [2, { data: data, formData: originalFormData, individualData: individualData, userList: userListRes, isKWOrSACountry: isKWOrSAValue }];
805
798
  }
806
799
  });
@@ -832,43 +825,45 @@ export var checkEmailAvailability = createAsyncThunk('checkEmailAvailability', f
832
825
  });
833
826
  });
834
827
  export var updateBoardSuccess = createAsyncThunk('individualUpdateBoardSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
835
- var _a, settings, individual, _b, id, infoId, primaryUser, payload, data, boardInfoStatus, individualDataRes, _c, is_authorized, userId, type;
836
- var _d, _e, _f, _g;
837
- return __generator(this, function (_h) {
838
- switch (_h.label) {
828
+ var _a, settings, individual, _b, board_id, infoId, _c, showBoard, mode, payload, data, _d, id, iType, boardInfoStatusData;
829
+ var _e, _f, _g, _h, _j, _k, _l, _m, _o;
830
+ return __generator(this, function (_p) {
831
+ switch (_p.label) {
839
832
  case 0:
840
833
  _a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
841
- _b = individual.data.verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id, primaryUser = _b.primaryUser;
842
- if (!id)
834
+ _b = individual.data.verify.responseBody || {}, board_id = _b.board_id, infoId = _b.board_info_id;
835
+ _c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
836
+ if (!board_id)
843
837
  return [2];
844
838
  payload = {
845
839
  lang: settings.data.language,
846
- step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_SUCCESS,
847
- id: id
840
+ step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_SUCCESS
848
841
  };
849
- return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
842
+ return [4, API.boardService.updateBoardInfo(__assign({ id: board_id, infoId: infoId }, payload))];
850
843
  case 1:
851
- data = _h.sent();
852
- return [4, API.boardService.retrieveBoardInfoStatus(id)];
844
+ data = _p.sent();
845
+ sendCustomEventToGTM({
846
+ event: 'Send Event',
847
+ event_category: 'Board Flows - Individual',
848
+ event_action: 'Individual Update Success Page',
849
+ event_label: settings.data.businessCountry.iso2
850
+ });
851
+ if (!showBoard && mode === 'content') {
852
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
853
+ (_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, { data: data });
854
+ return [2, { response: __assign({}, data), formData: params }];
855
+ }
856
+ _d = ((_j = data === null || data === void 0 ? void 0 : data.notification) === null || _j === void 0 ? void 0 : _j.recipient) || {}, id = _d.id, iType = _d.type;
857
+ return [4, Promise.all([
858
+ API.boardService.retrieveBoardInfoStatus(board_id),
859
+ thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: iType })).unwrap()
860
+ ])];
853
861
  case 2:
854
- boardInfoStatus = _h.sent();
855
- return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
856
- case 3:
857
- _h.sent();
858
- individualDataRes = undefined;
859
- _c = primaryUser || {}, is_authorized = _c.is_authorized, userId = _c.id, type = _c.object;
860
- if (!!is_authorized) return [3, 5];
861
- return [4, thunkApi
862
- .dispatch(retrieveIndividualInfo({ id: userId, type: type, countryCode: settings.data.businessCountry.iso2 }))
863
- .unwrap()];
864
- case 4:
865
- individualDataRes = _h.sent();
866
- _h.label = 5;
867
- case 5:
868
- (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
869
- (_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, { data: data });
862
+ boardInfoStatusData = (_p.sent())[0];
863
+ (_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, {});
864
+ (_o = (_m = settings.data.appConfig).onFlowCompleted) === null || _o === void 0 ? void 0 : _o.call(_m, { data: data });
870
865
  thunkApi.dispatch(handleNextScreenStep());
871
- return [2, { response: __assign(__assign({}, data), { flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || [] }), formData: params, individualData: individualDataRes === null || individualDataRes === void 0 ? void 0 : individualDataRes.data }];
866
+ return [2, { data: data, flows: (boardInfoStatusData === null || boardInfoStatusData === void 0 ? void 0 : boardInfoStatusData.info) || [] }];
872
867
  }
873
868
  });
874
869
  }); });
@@ -890,9 +885,9 @@ var initialState = {
890
885
  error: null,
891
886
  loading: false,
892
887
  cityLoading: false,
888
+ addOrRequestDetailLoading: false,
893
889
  data: {
894
890
  flowName: FlowsTypes.INDIVIDUAL,
895
- currency: '',
896
891
  verify: {
897
892
  token: ''
898
893
  },
@@ -966,8 +961,8 @@ export var individualSlice = createSlice({
966
961
  })
967
962
  .addCase(verifyToken.fulfilled, function (state, action) {
968
963
  state.error = null;
969
- var _a = action.payload, data = _a.data, token = _a.token, boardResponse = _a.boardResponse, userList = _a.userList;
970
- state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id, userList: userList });
964
+ var _a = action.payload, data = _a.data, token = _a.token, countries = _a.countries, countryCode = _a.countryCode, userList = _a.userList;
965
+ state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { countries: countries, countryCode: countryCode, board_id: data.id, userList: userList });
971
966
  state.data.verify.token = token;
972
967
  })
973
968
  .addCase(verifyToken.rejected, function (state, action) {
@@ -1007,30 +1002,24 @@ export var individualSlice = createSlice({
1007
1002
  state.error = null;
1008
1003
  })
1009
1004
  .addCase(verifyLeadOTP.fulfilled, function (state, action) {
1010
- var _a;
1011
1005
  state.loading = false;
1012
1006
  state.error = null;
1013
- var _b = action.payload, data = _b.data, formData = _b.formData, boardResponse = _b.boardResponse, userList = _b.userList;
1014
- var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
1015
- if (description) {
1016
- state.error = description;
1017
- return;
1018
- }
1007
+ var _a = action.payload, data = _a.data, countries = _a.countries, countryCode = _a.countryCode, userList = _a.userList, formData = _a.formData;
1019
1008
  state.data.otpData = formData;
1020
1009
  state.data.otpData.responseBody = data;
1021
- state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), boardResponse), { userList: userList });
1010
+ state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { countries: countries, countryCode: countryCode, userList: userList });
1022
1011
  })
1023
1012
  .addCase(verifyLeadOTP.rejected, function (state, action) {
1024
1013
  state.loading = false;
1025
1014
  state.error = action.error.message;
1026
1015
  })
1027
1016
  .addCase(addDetailsAsync.pending, function (state) {
1028
- state.loading = true;
1017
+ state.addOrRequestDetailLoading = true;
1029
1018
  state.error = null;
1030
1019
  })
1031
1020
  .addCase(addDetailsAsync.fulfilled, function (state, action) {
1032
1021
  var _a, _b, _c, _d;
1033
- state.loading = false;
1022
+ state.addOrRequestDetailLoading = false;
1034
1023
  state.error = null;
1035
1024
  var _e = action.payload, userList = _e.userList, individualId = _e.individualId, countries = _e.countries;
1036
1025
  var primaryUser = (state.data.verify.responseBody || {}).user;
@@ -1099,15 +1088,15 @@ export var individualSlice = createSlice({
1099
1088
  state.data.individualData.isAuthorized = is_authorized;
1100
1089
  })
1101
1090
  .addCase(addDetailsAsync.rejected, function (state, action) {
1102
- state.loading = false;
1091
+ state.addOrRequestDetailLoading = false;
1103
1092
  state.error = action.error.message;
1104
1093
  })
1105
1094
  .addCase(requestDetailsByEmail.pending, function (state) {
1106
- state.loading = true;
1095
+ state.addOrRequestDetailLoading = true;
1107
1096
  state.error = null;
1108
1097
  })
1109
1098
  .addCase(requestDetailsByEmail.fulfilled, function (state, action) {
1110
- state.loading = false;
1099
+ state.addOrRequestDetailLoading = false;
1111
1100
  state.error = null;
1112
1101
  var _a = action.payload, data = _a.data, individualData = _a.individualData;
1113
1102
  var userList = (state.data.verify.responseBody || {}).userList;
@@ -1120,7 +1109,7 @@ export var individualSlice = createSlice({
1120
1109
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { requestEmailData: data, userList: list });
1121
1110
  })
1122
1111
  .addCase(requestDetailsByEmail.rejected, function (state, action) {
1123
- state.loading = false;
1112
+ state.addOrRequestDetailLoading = false;
1124
1113
  state.error = action.error.message;
1125
1114
  })
1126
1115
  .addCase(retrieveIndividualInfo.pending, function (state) {
@@ -1192,6 +1181,7 @@ export var individualSlice = createSlice({
1192
1181
  state.data.individualData.isAuthorized = is_authorized;
1193
1182
  })
1194
1183
  .addCase(retrieveIndividualInfo.rejected, function (state, action) {
1184
+ state.addOrRequestDetailLoading = false;
1195
1185
  state.error = action.error.message;
1196
1186
  })
1197
1187
  .addCase(getIndividualList.pending, function (state) {
@@ -1280,14 +1270,11 @@ export var individualSlice = createSlice({
1280
1270
  state.error = null;
1281
1271
  })
1282
1272
  .addCase(updateIndividualPersonalInfo.fulfilled, function (state, action) {
1283
- var _a;
1284
1273
  state.loading = false;
1285
1274
  state.error = null;
1286
- var _b = action.payload, data = _b.data, formData = _b.formData, currencyData = _b.currencyData;
1275
+ var _a = action.payload, data = _a.data, formData = _a.formData;
1287
1276
  state.data.individualPersonalData = formData;
1288
1277
  state.data.individualPersonalData.responseBody = data;
1289
- if ((_a = currencyData === null || currencyData === void 0 ? void 0 : currencyData.code) === null || _a === void 0 ? void 0 : _a.english)
1290
- state.data.currency = currencyData.code.english;
1291
1278
  })
1292
1279
  .addCase(updateIndividualPersonalInfo.rejected, function (state, action) {
1293
1280
  state.loading = false;
@@ -1301,11 +1288,11 @@ export var individualSlice = createSlice({
1301
1288
  state.loading = false;
1302
1289
  state.error = null;
1303
1290
  var _a = action.payload, data = _a.data, formData = _a.formData, individualData = _a.individualData, userList = _a.userList, isKWOrSACountry = _a.isKWOrSACountry;
1304
- state.data.individualData = formData;
1291
+ state.data.individualData = __assign(__assign({}, formData), { civilID: undefined, signatureFileId: undefined });
1305
1292
  state.data.individualData.responseBody = data;
1306
1293
  var user = (state.data.verify.responseBody || {}).user;
1307
1294
  var isSameUser = (user === null || user === void 0 ? void 0 : user.id) === (individualData === null || individualData === void 0 ? void 0 : individualData.id);
1308
- var userInfo = __assign(__assign({}, user), (isSameUser && (individualData === null || individualData === void 0 ? void 0 : individualData.documents) && { documents: individualData === null || individualData === void 0 ? void 0 : individualData.documents }));
1295
+ var userInfo = __assign(__assign({}, user), (isSameUser && individualData && __assign({}, individualData)));
1309
1296
  if (isSameUser && !isKWOrSACountry)
1310
1297
  userInfo = __assign(__assign({}, user), { is_authorized: individualData.is_authorized });
1311
1298
  var list = userList || [];
@@ -1365,18 +1352,8 @@ export var individualSlice = createSlice({
1365
1352
  var _a;
1366
1353
  state.loading = false;
1367
1354
  state.error = null;
1368
- var _b = action.payload || {}, response = _b.response, individualData = _b.individualData;
1369
- var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
1370
- if (description) {
1371
- state.error = description;
1372
- return;
1373
- }
1374
- var flows = response.flows;
1375
- var individuals = (state.data.verify.responseBody || {}).individuals;
1376
- var data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? individuals : individualData) || {}).data_state;
1377
- state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (data_state && {
1378
- individuals: __assign(__assign({}, individuals), { data_state: data_state })
1379
- }));
1355
+ var _b = action.payload || {}, flows = _b.flows, data = _b.data;
1356
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, recipient: (_a = data === null || data === void 0 ? void 0 : data.notification) === null || _a === void 0 ? void 0 : _a.recipient });
1380
1357
  })
1381
1358
  .addCase(updateBoardSuccess.pending, function (state) {
1382
1359
  state.loading = true;