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

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 (566) 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.d.ts +1 -0
  24. package/build/app/settings.js +16 -11
  25. package/build/app/store.d.ts +2 -0
  26. package/build/assets/currencies/SARSymbol.d.ts +7 -0
  27. package/build/assets/currencies/SARSymbol.js +28 -0
  28. package/build/assets/currencies/index.d.ts +2 -0
  29. package/build/assets/currencies/index.js +2 -0
  30. package/build/assets/currencies/utils.d.ts +4 -0
  31. package/build/assets/currencies/utils.js +4 -0
  32. package/build/assets/locales/ar.json +358 -151
  33. package/build/assets/locales/en.json +354 -150
  34. package/build/components/AnimationFlow/AnimationFlow.d.ts +9 -5
  35. package/build/components/AnimationFlow/AnimationFlow.js +5 -5
  36. package/build/components/AnimationFlow/BottomSheet.d.ts +3 -1
  37. package/build/components/AnimationFlow/BottomSheet.js +42 -14
  38. package/build/components/AnimationFlow/Dialog.d.ts +4 -3
  39. package/build/components/AnimationFlow/Dialog.js +5 -3
  40. package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +1 -1
  41. package/build/components/ArabicDatePicker/ArabicDatePicker.js +2 -2
  42. package/build/components/ArabicDatePicker/style.css +32 -3
  43. package/build/components/DatePicker/DatePicker.d.ts +1 -1
  44. package/build/components/DatePicker/DatePicker.js +2 -2
  45. package/build/components/Footer/Footer.js +2 -1
  46. package/build/components/Input/Input.js +1 -1
  47. package/build/components/Providers/ThemeProvider.js +3 -3
  48. package/build/components/TextWithCurrency/TextWithCurrency.d.ts +7 -0
  49. package/build/components/TextWithCurrency/TextWithCurrency.js +14 -0
  50. package/build/components/TextWithCurrency/index.d.ts +2 -0
  51. package/build/components/TextWithCurrency/index.js +2 -0
  52. package/build/components/Tooltip/Tooltip.js +1 -1
  53. package/build/constants/api.d.ts +5 -7
  54. package/build/constants/api.js +11 -15
  55. package/build/constants/app.d.ts +41 -0
  56. package/build/constants/app.js +369 -36
  57. package/build/constants/assets.d.ts +7 -0
  58. package/build/constants/assets.js +11 -1
  59. package/build/constants/dummy.d.ts +4 -219
  60. package/build/constants/dummy.js +64 -6194
  61. package/build/constants/flows.d.ts +26 -0
  62. package/build/constants/flows.js +27 -0
  63. package/build/constants/index.d.ts +1 -0
  64. package/build/constants/index.js +1 -0
  65. package/build/constants/validation.d.ts +2 -0
  66. package/build/constants/validation.js +2 -0
  67. package/build/features/app/auth/authStore.d.ts +29 -8
  68. package/build/features/app/auth/authStore.js +495 -149
  69. package/build/features/app/bank/bankStore.d.ts +13 -18
  70. package/build/features/app/bank/bankStore.js +186 -153
  71. package/build/features/app/board/boardStore.d.ts +5 -1
  72. package/build/features/app/board/boardStore.js +82 -51
  73. package/build/features/app/brand/brandStore.d.ts +17 -33
  74. package/build/features/app/brand/brandStore.js +254 -257
  75. package/build/features/app/business/businessStore.d.ts +37 -15
  76. package/build/features/app/business/businessStore.js +443 -235
  77. package/build/features/app/connect/connectStore.d.ts +33 -5
  78. package/build/features/app/connect/connectStore.js +355 -120
  79. package/build/features/app/connectExpress/connectExpressStore.d.ts +64 -27
  80. package/build/features/app/connectExpress/connectExpressStore.js +826 -394
  81. package/build/features/app/entity/entityStore.d.ts +20 -36
  82. package/build/features/app/entity/entityStore.js +204 -238
  83. package/build/features/app/individual/individualStore.d.ts +18 -34
  84. package/build/features/app/individual/individualStore.js +269 -292
  85. package/build/features/app/kyc/kycStore.d.ts +67 -0
  86. package/build/features/app/kyc/kycStore.js +432 -0
  87. package/build/features/app/password/passwordStore.d.ts +33 -18
  88. package/build/features/app/password/passwordStore.js +260 -219
  89. package/build/features/app/signIn/signInStore.js +19 -15
  90. package/build/features/app/tax/taxStore.d.ts +13 -7
  91. package/build/features/app/tax/taxStore.js +170 -136
  92. package/build/features/auth/Auth.d.ts +5 -6
  93. package/build/features/auth/Auth.js +40 -15
  94. package/build/features/auth/screens/AccountNotFound/AccountNotFound.js +2 -5
  95. package/build/features/auth/screens/AuthSwitch/AuthSwitch.d.ts +5 -0
  96. package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +58 -0
  97. package/build/features/auth/screens/AuthSwitch/index.d.ts +3 -0
  98. package/build/features/auth/screens/AuthSwitch/index.js +2 -0
  99. package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +2 -8
  100. package/build/features/auth/screens/AuthenticationList/LicenseNumber.js +2 -2
  101. package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +8 -2
  102. package/build/features/auth/screens/CivilID/CivilID.js +4 -35
  103. package/build/features/auth/screens/{NID → DOB}/DOB.js +3 -3
  104. package/build/features/auth/screens/DOB/DOBForm.d.ts +5 -0
  105. package/build/features/auth/screens/DOB/DOBForm.js +59 -0
  106. package/build/features/auth/screens/DOB/index.d.ts +3 -0
  107. package/build/features/auth/screens/DOB/index.js +2 -0
  108. package/build/features/{connectExpress/screens/IdentityOTP → auth/screens/DOB}/validation.d.ts +4 -4
  109. package/build/features/auth/screens/DOB/validation.js +4 -0
  110. package/build/features/auth/screens/Email/Email.d.ts +5 -0
  111. package/build/features/auth/screens/Email/Email.js +57 -0
  112. package/build/features/auth/screens/Email/EmailField.d.ts +8 -0
  113. package/build/features/auth/screens/Email/EmailField.js +52 -0
  114. package/build/features/auth/screens/Email/index.d.ts +3 -0
  115. package/build/features/auth/screens/Email/index.js +2 -0
  116. package/build/features/auth/screens/Email/validation.d.ts +8 -0
  117. package/build/features/auth/screens/Email/validation.js +4 -0
  118. package/build/features/auth/screens/EmailSent/EmailSent.d.ts +5 -0
  119. package/build/features/auth/screens/EmailSent/EmailSent.js +79 -0
  120. package/build/features/auth/screens/EmailSent/index.d.ts +2 -0
  121. package/build/features/auth/screens/EmailSent/index.js +2 -0
  122. package/build/features/auth/screens/MigratingData/MigratingData.d.ts +5 -0
  123. package/build/features/auth/screens/MigratingData/MigratingData.js +44 -0
  124. package/build/features/auth/screens/MigratingData/index.d.ts +2 -0
  125. package/build/features/auth/screens/MigratingData/index.js +2 -0
  126. package/build/features/auth/screens/Mobile/Mobile.js +6 -38
  127. package/build/features/auth/screens/Mobile/MobileNumber.js +13 -15
  128. package/build/features/auth/screens/Mobile/validation.js +11 -3
  129. package/build/features/auth/screens/NID/IDNumber.js +1 -1
  130. package/build/features/auth/screens/NID/NID.js +7 -43
  131. package/build/features/auth/screens/NID/validation.d.ts +0 -3
  132. package/build/features/auth/screens/NID/validation.js +0 -1
  133. package/build/features/auth/screens/OTP/OTP.js +41 -10
  134. package/build/features/auth/screens/OTP/OTPInput.js +23 -6
  135. package/build/features/auth/screens/OperatorError/OperatorError.d.ts +5 -0
  136. package/build/features/auth/screens/OperatorError/OperatorError.js +9 -0
  137. package/build/features/auth/screens/OperatorError/index.d.ts +3 -0
  138. package/build/features/auth/screens/OperatorError/index.js +2 -0
  139. package/build/features/auth/screens/Password/Password.d.ts +5 -0
  140. package/build/features/auth/screens/Password/Password.js +61 -0
  141. package/build/features/auth/screens/Password/PasswordField.d.ts +5 -0
  142. package/build/features/auth/screens/Password/PasswordField.js +28 -0
  143. package/build/features/auth/screens/Password/index.d.ts +3 -0
  144. package/build/features/auth/screens/Password/index.js +2 -0
  145. package/build/features/auth/screens/Password/validation.d.ts +8 -0
  146. package/build/features/auth/screens/Password/validation.js +4 -0
  147. package/build/features/auth/screens/PreparingData/PreparingData.js +3 -0
  148. package/build/features/auth/screens/ResetPasswordMessage/ResetPasswordMessage.d.ts +5 -0
  149. package/build/features/auth/screens/ResetPasswordMessage/ResetPasswordMessage.js +21 -0
  150. package/build/features/auth/screens/ResetPasswordMessage/index.d.ts +3 -0
  151. package/build/features/auth/screens/ResetPasswordMessage/index.js +2 -0
  152. package/build/features/auth/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  153. package/build/features/auth/screens/VerifyNafath/VerifyNafath.js +35 -0
  154. package/build/features/auth/screens/VerifyNafath/index.d.ts +3 -0
  155. package/build/features/auth/screens/VerifyNafath/index.js +2 -0
  156. package/build/features/bank/Bank.d.ts +5 -1
  157. package/build/features/bank/Bank.js +22 -9
  158. package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
  159. package/build/features/bank/screens/OperatorError/OperatorError.d.ts +5 -0
  160. package/build/features/bank/screens/OperatorError/OperatorError.js +9 -0
  161. package/build/features/bank/screens/OperatorError/index.d.ts +3 -0
  162. package/build/features/bank/screens/OperatorError/index.js +2 -0
  163. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  164. package/build/features/bank/screens/Verify/Verify.js +7 -6
  165. package/build/features/board/Board.d.ts +2 -0
  166. package/build/features/board/Board.js +24 -13
  167. package/build/features/board/screens/OperatorError/OperatorError.d.ts +5 -0
  168. package/build/features/board/screens/OperatorError/OperatorError.js +9 -0
  169. package/build/features/board/screens/OperatorError/index.d.ts +3 -0
  170. package/build/features/board/screens/OperatorError/index.js +2 -0
  171. package/build/features/board/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
  172. package/build/features/board/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
  173. package/build/features/board/screens/PrepareDataLoading/index.d.ts +2 -0
  174. package/build/features/board/screens/PrepareDataLoading/index.js +2 -0
  175. package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -4
  176. package/build/features/board/screens/Verify/Verify.js +3 -2
  177. package/build/features/brand/Brand.d.ts +5 -1
  178. package/build/features/brand/Brand.js +22 -9
  179. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +5 -5
  180. package/build/features/brand/screens/BrandActivities/BrandActivities.js +48 -11
  181. package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +6 -6
  182. package/build/features/brand/screens/BrandActivities/CustomerBase.js +1 -1
  183. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +3 -5
  184. package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +4 -4
  185. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
  186. package/build/features/brand/screens/BrandActivities/TAC.d.ts +1 -1
  187. package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
  188. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
  189. package/build/features/brand/screens/BrandInfo/BrandInfo.js +22 -4
  190. package/build/features/brand/screens/BrandInfo/BrandName.js +2 -2
  191. package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +22 -6
  192. package/build/features/brand/screens/OperatorError/OperatorError.d.ts +5 -0
  193. package/build/features/brand/screens/OperatorError/OperatorError.js +9 -0
  194. package/build/features/brand/screens/OperatorError/index.d.ts +3 -0
  195. package/build/features/brand/screens/OperatorError/index.js +2 -0
  196. package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  197. package/build/features/brand/screens/Verify/Verify.js +3 -2
  198. package/build/features/business/Business.js +20 -12
  199. package/build/features/business/screens/Activities/Activities.js +26 -9
  200. package/build/features/business/screens/Activities/ActivitiesList.d.ts +4 -4
  201. package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
  202. package/build/features/business/screens/Activities/OperationStartDate.d.ts +5 -3
  203. package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
  204. package/build/features/business/screens/BrandDetails/SalesChannel.d.ts +2 -2
  205. package/build/features/business/screens/BusinessType/BusinessType.js +11 -3
  206. package/build/features/business/screens/BusinessType/LicenseNumber.js +3 -3
  207. package/build/features/business/screens/Customers/CustomerLocations.d.ts +10 -8
  208. package/build/features/business/screens/Customers/CustomerLocations.js +5 -3
  209. package/build/features/business/screens/Customers/Customers.js +50 -10
  210. package/build/features/business/screens/Customers/ExpectedCustomers.d.ts +3 -1
  211. package/build/features/business/screens/Customers/ExpectedCustomers.js +5 -3
  212. package/build/features/business/screens/Customers/ExpectedSalesRange.d.ts +3 -1
  213. package/build/features/business/screens/Customers/ExpectedSalesRange.js +7 -6
  214. package/build/features/business/screens/Customers/RefundPolicy.d.ts +12 -5
  215. package/build/features/business/screens/Customers/RefundPolicy.js +13 -13
  216. package/build/features/business/screens/Customers/TransactionPolicy.d.ts +4 -1
  217. package/build/features/business/screens/Customers/TransactionPolicy.js +8 -5
  218. package/build/features/business/screens/Customers/validation.d.ts +6 -6
  219. package/build/features/business/screens/Customers/validation.js +3 -8
  220. package/build/features/business/screens/DOB/DOB.d.ts +6 -0
  221. package/build/features/business/screens/DOB/DOB.js +45 -0
  222. package/build/features/business/screens/DOB/DOBForm.d.ts +5 -0
  223. package/build/features/business/screens/DOB/DOBForm.js +72 -0
  224. package/build/features/business/screens/DOB/index.d.ts +3 -0
  225. package/build/features/business/screens/DOB/index.js +2 -0
  226. package/build/features/business/screens/DOB/validation.d.ts +8 -0
  227. package/build/features/business/screens/DOB/validation.js +4 -0
  228. package/build/features/business/screens/IDBOD/IDBOD.js +10 -2
  229. package/build/features/business/screens/IDBOD/validation.d.ts +0 -3
  230. package/build/features/business/screens/IDBOD/validation.js +0 -1
  231. package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
  232. package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.js +103 -0
  233. package/build/features/{connectExpress/screens/IdentityOTP/OTP.d.ts → business/screens/MobileOwnership/MobileNumber.d.ts} +0 -2
  234. package/build/features/business/screens/MobileOwnership/MobileNumber.js +72 -0
  235. package/build/features/business/screens/MobileOwnership/index.d.ts +2 -0
  236. package/build/features/business/screens/MobileOwnership/index.js +2 -0
  237. package/build/features/business/screens/MobileOwnership/validation.d.ts +8 -0
  238. package/build/features/business/screens/MobileOwnership/validation.js +38 -0
  239. package/build/features/business/screens/OperatorError/OperatorError.d.ts +5 -0
  240. package/build/features/business/screens/OperatorError/OperatorError.js +9 -0
  241. package/build/features/business/screens/OperatorError/index.d.ts +3 -0
  242. package/build/features/business/screens/OperatorError/index.js +2 -0
  243. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -3
  244. package/build/features/business/screens/Verify/Verify.js +15 -4
  245. package/build/features/business/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  246. package/build/features/business/screens/VerifyNafath/VerifyNafath.js +35 -0
  247. package/build/features/business/screens/VerifyNafath/index.d.ts +3 -0
  248. package/build/features/business/screens/VerifyNafath/index.js +2 -0
  249. package/build/features/connect/Connect.d.ts +5 -1
  250. package/build/features/connect/Connect.js +16 -9
  251. package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +7 -1
  252. package/build/features/connect/screens/CivilID/CivilID.js +6 -1
  253. package/build/features/{auth/screens/NID → connect/screens/DOB}/DOB.d.ts +1 -2
  254. package/build/features/connect/screens/{NID → DOB}/DOB.js +2 -2
  255. package/build/features/connect/screens/DOB/DOBForm.d.ts +5 -0
  256. package/build/features/connect/screens/DOB/DOBForm.js +59 -0
  257. package/build/features/connect/screens/DOB/index.d.ts +3 -0
  258. package/build/features/connect/screens/DOB/index.js +2 -0
  259. package/build/features/connect/screens/DOB/validation.d.ts +8 -0
  260. package/build/features/connect/screens/DOB/validation.js +4 -0
  261. package/build/features/connect/screens/Individual/Email.js +1 -3
  262. package/build/features/connect/screens/Individual/Individual.js +11 -5
  263. package/build/features/connect/screens/Individual/MobileNumber.js +8 -7
  264. package/build/features/connect/screens/Individual/validation.js +11 -3
  265. package/build/features/connect/screens/Merchant/BrandName.js +2 -2
  266. package/build/features/connect/screens/Mobile/Mobile.js +12 -9
  267. package/build/features/connect/screens/Mobile/MobileNumber.js +8 -7
  268. package/build/features/connect/screens/Mobile/validation.js +11 -3
  269. package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
  270. package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.js +104 -0
  271. package/build/features/connect/screens/MobileOwnership/MobileNumber.d.ts +3 -0
  272. package/build/features/connect/screens/MobileOwnership/MobileNumber.js +72 -0
  273. package/build/features/connect/screens/MobileOwnership/index.d.ts +2 -0
  274. package/build/features/connect/screens/MobileOwnership/index.js +2 -0
  275. package/build/features/connect/screens/MobileOwnership/validation.d.ts +8 -0
  276. package/build/features/connect/screens/MobileOwnership/validation.js +38 -0
  277. package/build/features/connect/screens/NID/IDNumber.d.ts +1 -0
  278. package/build/features/connect/screens/NID/IDNumber.js +2 -2
  279. package/build/features/connect/screens/NID/NID.js +5 -11
  280. package/build/features/connect/screens/NID/validation.d.ts +0 -3
  281. package/build/features/connect/screens/NID/validation.js +0 -1
  282. package/build/features/connect/screens/OTP/OTP.js +6 -6
  283. package/build/features/connect/screens/OTP/OTPInput.js +3 -11
  284. package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
  285. package/build/features/connect/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  286. package/build/features/connect/screens/VerifyNafath/VerifyNafath.js +35 -0
  287. package/build/features/connect/screens/VerifyNafath/index.d.ts +3 -0
  288. package/build/features/connect/screens/VerifyNafath/index.js +2 -0
  289. package/build/features/connectExpress/ConnectExpress.d.ts +5 -2
  290. package/build/features/connectExpress/ConnectExpress.js +62 -39
  291. package/build/features/connectExpress/screens/AuthenticationList/LicenseNumber.js +2 -2
  292. package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +7 -1
  293. package/build/features/connectExpress/screens/CivilID/CivilID.js +6 -1
  294. package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +2 -2
  295. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +8 -1
  296. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
  297. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +1 -1
  298. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +30 -7
  299. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +1 -3
  300. package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +9 -8
  301. package/build/features/connectExpress/screens/CollectIndividualInfo/validation.js +11 -3
  302. package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +14 -24
  303. package/build/features/connectExpress/screens/{NID → DOB}/DOB.d.ts +1 -2
  304. package/build/features/connectExpress/screens/{NID → DOB}/DOB.js +3 -3
  305. package/build/features/connectExpress/screens/DOB/DOBForm.d.ts +5 -0
  306. package/build/features/connectExpress/screens/DOB/DOBForm.js +63 -0
  307. package/build/features/connectExpress/screens/DOB/index.d.ts +3 -0
  308. package/build/features/connectExpress/screens/DOB/index.js +2 -0
  309. package/build/features/connectExpress/screens/DOB/validation.d.ts +8 -0
  310. package/build/features/connectExpress/screens/DOB/validation.js +4 -0
  311. package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.d.ts +3 -0
  312. package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.js +9 -0
  313. package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.d.ts +2 -0
  314. package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.js +2 -0
  315. package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.d.ts +5 -0
  316. package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.js +35 -0
  317. package/build/features/connectExpress/screens/IdentityVerifyNafath/index.d.ts +3 -0
  318. package/build/features/connectExpress/screens/IdentityVerifyNafath/index.js +2 -0
  319. package/build/features/connectExpress/screens/Mobile/Mobile.js +10 -3
  320. package/build/features/connectExpress/screens/Mobile/MobileNumber.js +9 -8
  321. package/build/features/connectExpress/screens/Mobile/validation.js +21 -6
  322. package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
  323. package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.js +106 -0
  324. package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.d.ts +3 -0
  325. package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.js +72 -0
  326. package/build/features/connectExpress/screens/MobileOwnership/index.d.ts +2 -0
  327. package/build/features/connectExpress/screens/MobileOwnership/index.js +2 -0
  328. package/build/features/connectExpress/screens/MobileOwnership/validation.d.ts +8 -0
  329. package/build/features/connectExpress/screens/MobileOwnership/validation.js +38 -0
  330. package/build/features/connectExpress/screens/NID/IDNumber.d.ts +1 -0
  331. package/build/features/connectExpress/screens/NID/IDNumber.js +2 -2
  332. package/build/features/connectExpress/screens/NID/NID.js +10 -10
  333. package/build/features/connectExpress/screens/NID/TAC.d.ts +1 -1
  334. package/build/features/connectExpress/screens/NID/TAC.js +2 -2
  335. package/build/features/connectExpress/screens/NID/validation.d.ts +0 -3
  336. package/build/features/connectExpress/screens/NID/validation.js +0 -2
  337. package/build/features/connectExpress/screens/NIDMissed/NID.js +3 -3
  338. package/build/features/connectExpress/screens/NIDMissed/validation.d.ts +0 -3
  339. package/build/features/connectExpress/screens/NIDMissed/validation.js +0 -1
  340. package/build/features/connectExpress/screens/OTP/OTP.js +13 -15
  341. package/build/features/connectExpress/screens/OTP/OTPInput.js +12 -10
  342. package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +5 -0
  343. package/build/features/connectExpress/screens/OperatorError/OperatorError.js +9 -0
  344. package/build/features/connectExpress/screens/OperatorError/index.d.ts +3 -0
  345. package/build/features/connectExpress/screens/OperatorError/index.js +2 -0
  346. package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +5 -0
  347. package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +34 -0
  348. package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +2 -0
  349. package/build/features/connectExpress/screens/PrepareDataLoading/index.js +2 -0
  350. package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -3
  351. package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/OTPInput.js +3 -3
  352. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.d.ts +5 -0
  353. package/build/features/connectExpress/screens/{IdentityOTP/OTP.js → VerifyMobileAuthOTP/VerifyMobileAuthOTP.js} +22 -21
  354. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.d.ts +3 -0
  355. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.js +2 -0
  356. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  357. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +41 -0
  358. package/build/features/connectExpress/screens/VerifyNafath/index.d.ts +3 -0
  359. package/build/features/connectExpress/screens/VerifyNafath/index.js +2 -0
  360. package/build/features/entity/Entity.d.ts +4 -1
  361. package/build/features/entity/Entity.js +22 -9
  362. package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +4 -4
  363. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +5 -5
  364. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +5 -5
  365. package/build/features/entity/screens/EntityCapital/EntityCapital.js +33 -9
  366. package/build/features/entity/screens/EntityName/EntityName.js +31 -14
  367. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +5 -5
  368. package/build/features/entity/screens/EntityName/EntityTypeList.js +2 -3
  369. package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +2 -2
  370. package/build/features/entity/screens/EntityName/ExpiryDate.js +13 -8
  371. package/build/features/entity/screens/EntityName/IssuingDate.d.ts +2 -2
  372. package/build/features/entity/screens/EntityName/IssuingDate.js +15 -8
  373. package/build/features/entity/screens/EntityName/LegalName.js +1 -13
  374. package/build/features/entity/screens/EntityName/LicenseNumber.js +6 -8
  375. package/build/features/entity/screens/EntityName/UnifiedNumber.js +4 -6
  376. package/build/features/entity/screens/EntityName/validation.d.ts +3 -3
  377. package/build/features/entity/screens/EntityName/validation.js +1 -10
  378. package/build/features/entity/screens/OperatorError/OperatorError.d.ts +5 -0
  379. package/build/features/entity/screens/OperatorError/OperatorError.js +9 -0
  380. package/build/features/entity/screens/OperatorError/index.d.ts +3 -0
  381. package/build/features/entity/screens/OperatorError/index.js +2 -0
  382. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  383. package/build/features/entity/screens/Verify/Verify.js +3 -2
  384. package/build/features/featuresScreens.d.ts +1 -0
  385. package/build/features/featuresScreens.js +216 -13
  386. package/build/features/individual/Individual.d.ts +4 -1
  387. package/build/features/individual/Individual.js +22 -9
  388. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +2 -2
  389. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +44 -11
  390. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +2 -4
  391. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +4 -4
  392. package/build/features/individual/screens/IndividualList/Email.js +2 -3
  393. package/build/features/individual/screens/IndividualList/IndividualList.d.ts +4 -4
  394. package/build/features/individual/screens/IndividualList/IndividualList.js +18 -5
  395. package/build/features/individual/screens/IndividualList/MobileNumber.js +8 -10
  396. package/build/features/individual/screens/IndividualList/UserList.js +7 -7
  397. package/build/features/individual/screens/IndividualList/validation.js +11 -4
  398. package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
  399. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +2 -2
  400. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +73 -18
  401. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +6 -5
  402. package/build/features/individual/screens/IndividualPersonalInfo/validation.js +11 -3
  403. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +9 -11
  404. package/build/features/individual/screens/IndividualPhoneInfo/validation.js +11 -3
  405. package/build/features/individual/screens/OperatorError/OperatorError.d.ts +5 -0
  406. package/build/features/individual/screens/OperatorError/OperatorError.js +9 -0
  407. package/build/features/individual/screens/OperatorError/index.d.ts +3 -0
  408. package/build/features/individual/screens/OperatorError/index.js +2 -0
  409. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  410. package/build/features/individual/screens/Verify/Verify.js +3 -2
  411. package/build/features/kyc/KYC.d.ts +11 -0
  412. package/build/features/kyc/KYC.js +99 -0
  413. package/build/features/kyc/index.d.ts +1 -0
  414. package/build/features/kyc/index.js +1 -0
  415. package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.d.ts +5 -0
  416. package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.js +19 -0
  417. package/build/features/kyc/screens/AlreadySubmitted/index.d.ts +2 -0
  418. package/build/features/kyc/screens/AlreadySubmitted/index.js +2 -0
  419. package/build/features/kyc/screens/Loading/Loading.d.ts +4 -0
  420. package/build/features/kyc/screens/Loading/Loading.js +10 -0
  421. package/build/features/kyc/screens/Loading/index.d.ts +2 -0
  422. package/build/features/kyc/screens/Loading/index.js +2 -0
  423. package/build/features/kyc/screens/OperatorError/OperatorError.d.ts +5 -0
  424. package/build/features/kyc/screens/OperatorError/OperatorError.js +9 -0
  425. package/build/features/kyc/screens/OperatorError/index.d.ts +2 -0
  426. package/build/features/kyc/screens/OperatorError/index.js +2 -0
  427. package/build/features/kyc/screens/Success/Success.d.ts +5 -0
  428. package/build/features/kyc/screens/Success/Success.js +32 -0
  429. package/build/features/kyc/screens/Success/index.d.ts +2 -0
  430. package/build/features/kyc/screens/Success/index.js +2 -0
  431. package/build/features/kyc/screens/Terms/Header.d.ts +6 -0
  432. package/build/features/kyc/screens/Terms/Header.js +36 -0
  433. package/build/features/kyc/screens/Terms/Terms.d.ts +4 -0
  434. package/build/features/kyc/screens/Terms/Terms.js +87 -0
  435. package/build/features/kyc/screens/Terms/index.d.ts +2 -0
  436. package/build/features/kyc/screens/Terms/index.js +2 -0
  437. package/build/features/kyc/screens/TokenError/TokenError.d.ts +5 -0
  438. package/build/features/kyc/screens/TokenError/TokenError.js +9 -0
  439. package/build/features/kyc/screens/TokenError/index.d.ts +2 -0
  440. package/build/features/kyc/screens/TokenError/index.js +2 -0
  441. package/build/features/kyc/screens/Users/Users.d.ts +3 -0
  442. package/build/features/kyc/screens/Users/Users.js +76 -0
  443. package/build/features/kyc/screens/Users/index.d.ts +2 -0
  444. package/build/features/kyc/screens/Users/index.js +2 -0
  445. package/build/features/kyc/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  446. package/build/features/kyc/screens/VerifyNafath/VerifyNafath.js +45 -0
  447. package/build/features/kyc/screens/VerifyNafath/index.d.ts +3 -0
  448. package/build/features/kyc/screens/VerifyNafath/index.js +2 -0
  449. package/build/features/kyc/screens/VerifyPaci/VerifyPACI.d.ts +5 -0
  450. package/build/features/kyc/screens/VerifyPaci/VerifyPACI.js +44 -0
  451. package/build/features/kyc/screens/VerifyPaci/index.d.ts +3 -0
  452. package/build/features/kyc/screens/VerifyPaci/index.js +2 -0
  453. package/build/features/password/Password.d.ts +4 -1
  454. package/build/features/password/Password.js +88 -31
  455. package/build/features/password/screens/CreatePassword/CreatePassword.js +8 -4
  456. package/build/features/password/screens/OTP/OTP.js +3 -3
  457. package/build/features/password/screens/OperatorError/OperatorError.d.ts +5 -0
  458. package/build/features/password/screens/OperatorError/OperatorError.js +9 -0
  459. package/build/features/password/screens/OperatorError/index.d.ts +3 -0
  460. package/build/features/password/screens/OperatorError/index.js +2 -0
  461. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
  462. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
  463. package/build/features/password/screens/PrepareDataLoading/index.d.ts +2 -0
  464. package/build/features/password/screens/PrepareDataLoading/index.js +2 -0
  465. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  466. package/build/features/password/screens/Verify/Verify.js +7 -6
  467. package/build/features/shared/Address/CountryList.d.ts +5 -5
  468. package/build/features/shared/Address/InputSelect.d.ts +5 -5
  469. package/build/features/shared/Background/Background.js +1 -1
  470. package/build/features/shared/Background/LogoBackground.js +5 -17
  471. package/build/features/shared/BusinessCountry/BusinessCountry.js +1 -1
  472. package/build/features/shared/Button/Button.js +3 -1
  473. package/build/features/shared/Button/EmailProvidersButtons.js +2 -0
  474. package/build/features/shared/Button/FlowsButtons.js +18 -4
  475. package/build/features/shared/Button/NafathButton.d.ts +8 -0
  476. package/build/features/shared/Button/{AbsherButton.js → NafathButton.js} +12 -3
  477. package/build/features/shared/Button/index.d.ts +2 -2
  478. package/build/features/shared/Button/index.js +2 -2
  479. package/build/features/shared/Calender/Calender.d.ts +2 -1
  480. package/build/features/shared/Calender/Calender.js +3 -3
  481. package/build/features/shared/Containers/FeatureContainer.d.ts +2 -1
  482. package/build/features/shared/Containers/FeatureContainer.js +5 -3
  483. package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
  484. package/build/features/shared/Dialog/DialogContainer.js +5 -4
  485. package/build/features/shared/Input/Input.d.ts +3 -3
  486. package/build/features/shared/NafathVerification/NafathVerification.d.ts +14 -0
  487. package/build/features/shared/NafathVerification/NafathVerification.js +92 -0
  488. package/build/features/shared/NafathVerification/VerifyNafathLoading.d.ts +8 -0
  489. package/build/features/shared/NafathVerification/VerifyNafathLoading.js +53 -0
  490. package/build/features/shared/NafathVerification/VerifyNafathSuccess.d.ts +5 -0
  491. package/build/features/shared/NafathVerification/VerifyNafathSuccess.js +8 -0
  492. package/build/features/shared/NafathVerification/index.d.ts +2 -0
  493. package/build/features/shared/NafathVerification/index.js +2 -0
  494. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +6 -1
  495. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +10 -13
  496. package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
  497. package/build/features/shared/UploadFile/FileUpload.d.ts +1 -1
  498. package/build/features/shared/UploadFile/UploadFile.d.ts +1 -1
  499. package/build/features/shared/UploadFile/UploadWrapper.d.ts +1 -1
  500. package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +1 -1
  501. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +1 -1
  502. package/build/features/signIn/SignIn.js +18 -7
  503. package/build/features/signIn/screens/Mobile/MobileNumber.js +8 -7
  504. package/build/features/signIn/screens/Mobile/validation.js +11 -3
  505. package/build/features/signIn/screens/OTP/OTP.js +5 -4
  506. package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +5 -0
  507. package/build/features/signIn/screens/OperatorError/OperatorError.js +9 -0
  508. package/build/features/signIn/screens/OperatorError/index.d.ts +3 -0
  509. package/build/features/signIn/screens/OperatorError/index.js +2 -0
  510. package/build/features/tax/Tax.d.ts +4 -1
  511. package/build/features/tax/Tax.js +22 -9
  512. package/build/features/tax/screens/OperatorError/OperatorError.d.ts +5 -0
  513. package/build/features/tax/screens/OperatorError/OperatorError.js +9 -0
  514. package/build/features/tax/screens/OperatorError/index.d.ts +3 -0
  515. package/build/features/tax/screens/OperatorError/index.js +2 -0
  516. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  517. package/build/features/tax/screens/TaxDetails/TaxDetails.js +7 -2
  518. package/build/features/tax/screens/Verify/Verify.js +7 -6
  519. package/build/hooks/index.d.ts +3 -0
  520. package/build/hooks/index.js +3 -0
  521. package/build/hooks/useAppConfig.d.ts +1 -1
  522. package/build/hooks/useAppConfig.js +2 -2
  523. package/build/hooks/useAppDispatch.d.ts +1 -0
  524. package/build/hooks/useAppTheme.js +4 -3
  525. package/build/hooks/useCountDown.d.ts +10 -0
  526. package/build/hooks/useCountDown.js +17 -0
  527. package/build/hooks/useFormDirtyCheck.d.ts +10 -0
  528. package/build/hooks/useFormDirtyCheck.js +66 -0
  529. package/build/hooks/useSanitizedTranslation.d.ts +2 -0
  530. package/build/hooks/useSanitizedTranslation.js +15 -0
  531. package/build/hooks/useVerifyToken.d.ts +4 -2
  532. package/build/hooks/useVerifyToken.js +9 -4
  533. package/build/index.css +360 -120
  534. package/build/index.d.ts +3 -2
  535. package/build/index.js +4 -2
  536. package/build/theme/components.js +7 -0
  537. package/build/theme/palette.js +2 -1
  538. package/build/theme/shadows.js +1 -1
  539. package/build/theme/theme.d.ts +1 -1
  540. package/build/theme/theme.js +2 -2
  541. package/build/utils/array.js +2 -2
  542. package/build/utils/common.d.ts +1 -0
  543. package/build/utils/common.js +16 -3
  544. package/build/utils/error.d.ts +1 -0
  545. package/build/utils/error.js +3 -0
  546. package/build/utils/object.d.ts +1 -0
  547. package/build/utils/object.js +3 -0
  548. package/build/utils/string.d.ts +6 -2
  549. package/build/utils/string.js +28 -3
  550. package/build/utils/validation.d.ts +2 -0
  551. package/build/utils/validation.js +6 -0
  552. package/package.json +3 -4
  553. package/build/features/business/screens/OTP/OTP.d.ts +0 -8
  554. package/build/features/business/screens/OTP/OTP.js +0 -90
  555. package/build/features/business/screens/OTP/index.d.ts +0 -3
  556. package/build/features/business/screens/OTP/index.js +0 -2
  557. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.d.ts +0 -5
  558. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +0 -54
  559. package/build/features/connectExpress/screens/IdentityOTP/index.d.ts +0 -3
  560. package/build/features/connectExpress/screens/IdentityOTP/index.js +0 -2
  561. package/build/features/connectExpress/screens/IdentityOTP/validation.js +0 -4
  562. package/build/features/shared/Button/AbsherButton.d.ts +0 -8
  563. /package/build/features/{connect/screens/NID → auth/screens/DOB}/DOB.d.ts +0 -0
  564. /package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/OTPInput.d.ts +0 -0
  565. /package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/validation.d.ts +0 -0
  566. /package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/validation.js +0 -0
@@ -56,11 +56,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
56
56
  };
57
57
  var _a;
58
58
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
59
- import { AuthForType, FlowsTypes } from '../../../@types';
60
- import { ADD_NEW_ENTITY, AUTH_STEP_NAMES, IDENTIFICATION_TYPE, defaultCountry } from '../../../constants';
59
+ import { AuthForType, AuthTypeNumber, FlowsTypes, MigrationStatus } from '../../../@types';
60
+ import { ADD_NEW_ENTITY, AUTH_STEP_NAMES, COLLECT_DOB_INFO_NAFATH, IDENTIFICATION_TYPE, NAFATH_PACI_TIMEOUT_DURATION, NAFATH_VERIFICATION_FAILED, SCOPE_AUTH, defaultCountry } from '../../../constants';
61
61
  import API from '../../../api';
62
- import { handleCurrentActiveScreen, handleNextScreenStep, handleOpen, handleSetCountryByIso2 } from '../../../app/settings';
63
- import { findCountryByIddPrefix, isSA, openConnect, sleep } from '../../../utils';
62
+ import { handleCurrentActiveScreen, handleNextScreenStep, handleOpen, handlePrevScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
63
+ import { findCountryByIddPrefix, isNetworkError, isTimeoutError, openConnect, sendCustomEventToGTM, sleep } from '../../../utils';
64
64
  export var updateBusinessCountry = createAsyncThunk('auth/updateBusinessCountry', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
65
65
  var auth, payload, data;
66
66
  return __generator(this, function (_a) {
@@ -101,6 +101,7 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('auth/retrieveLeadId
101
101
  if (phone === null || phone === void 0 ? void 0 : phone.country_code)
102
102
  countryCode = findCountryByIddPrefix(settingData.countries, phone.country_code);
103
103
  if (!businessCountryIso2 && ipCountryIso2 && settingData.appConfig.scope === 'auth') {
104
+ thunkApi.dispatch(storeIsBusinessCountryPassed(false));
104
105
  thunkApi.dispatch(handleSetCountryByIso2(ipCountryIso2));
105
106
  businessCountryIso2 = ipCountryIso2;
106
107
  }
@@ -108,38 +109,26 @@ export var retrieveLeadIdentityByIdAsync = createAsyncThunk('auth/retrieveLeadId
108
109
  thunkApi.dispatch(handleCurrentActiveScreen('AUTH_BUSINESS_COUNTRY_STEP'));
109
110
  return [2, { data: data, countryCode: countryCode }];
110
111
  }
111
- if (!(data === null || data === void 0 ? void 0 : data.identification) && phone) {
112
- thunkApi.dispatch(handleCurrentActiveScreen('AUTH_MOBILE_STEP'));
113
- return [2, { data: data, countryCode: countryCode }];
114
- }
115
- if (country_code && !businessCountryIso2) {
116
- thunkApi.dispatch(handleSetCountryByIso2(data.country_code));
117
- if (!isSA(data.country_code))
118
- thunkApi.dispatch(handleCurrentActiveScreen('AUTH_MOBILE_STEP'));
119
- return [2, { data: data, countryCode: countryCode }];
120
- }
121
- if (!isSA(businessCountryIso2)) {
122
- thunkApi.dispatch(handleCurrentActiveScreen('AUTH_MOBILE_STEP'));
123
- return [2, { data: data, countryCode: countryCode }];
124
- }
125
112
  return [2, { data: data, countryCode: countryCode }];
126
113
  }
127
114
  });
128
115
  }); });
129
116
  export var createMobileAuth = createAsyncThunk('auth/createMobileAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
130
- var _a, settings, auth, requestBody, data;
131
- var _b, _c;
132
- return __generator(this, function (_d) {
133
- switch (_d.label) {
117
+ var _a, settings, auth, isStartWithZero, mobileNumber, requestBody, data;
118
+ var _b, _c, _d;
119
+ return __generator(this, function (_e) {
120
+ switch (_e.label) {
134
121
  case 0:
135
122
  _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
123
+ isStartWithZero = (_b = params.mobile) === null || _b === void 0 ? void 0 : _b.startsWith('0');
124
+ mobileNumber = isStartWithZero ? params.mobile.slice(1) : params.mobile;
136
125
  requestBody = {
137
126
  country: settings.data.businessCountry.iso2,
138
127
  scope: settings.data.appConfig.scope,
139
128
  lang: settings.data.language,
140
129
  lead_id: auth.data.leadId,
141
130
  user_credentail: {
142
- phone: params.mobile || '',
131
+ phone: mobileNumber || '',
143
132
  code: params.countryCode.idd_prefix.toString()
144
133
  },
145
134
  sign_in: false,
@@ -149,26 +138,29 @@ export var createMobileAuth = createAsyncThunk('auth/createMobileAuth', function
149
138
  };
150
139
  return [4, API.authService.createAuth(requestBody)];
151
140
  case 1:
152
- data = _d.sent();
141
+ data = _e.sent();
153
142
  thunkApi.dispatch(handleNextScreenStep());
154
- (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody.user_credentail);
143
+ (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, requestBody.user_credentail);
155
144
  return [2, { response: data, formData: params }];
156
145
  }
157
146
  });
158
147
  }); });
159
148
  export var resendMobileAuthOTP = createAsyncThunk('auth/resendMobileAuthOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
160
- var _a, settings, auth, requestBody, data;
161
- return __generator(this, function (_b) {
162
- switch (_b.label) {
149
+ var _a, settings, auth, isStartWithZero, mobileNumber, requestBody, data;
150
+ var _b;
151
+ return __generator(this, function (_c) {
152
+ switch (_c.label) {
163
153
  case 0:
164
154
  _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
155
+ isStartWithZero = (_b = params.mobile) === null || _b === void 0 ? void 0 : _b.startsWith('0');
156
+ mobileNumber = isStartWithZero ? params.mobile.slice(1) : params.mobile;
165
157
  requestBody = {
166
158
  country: settings.data.businessCountry.iso2,
167
159
  scope: settings.data.appConfig.scope,
168
160
  lang: settings.data.language,
169
161
  lead_id: auth.data.leadId,
170
162
  user_credentail: {
171
- phone: params.mobile,
163
+ phone: mobileNumber,
172
164
  code: params.countryCode.idd_prefix.toString()
173
165
  },
174
166
  sign_in: false,
@@ -178,20 +170,20 @@ export var resendMobileAuthOTP = createAsyncThunk('auth/resendMobileAuthOTP', fu
178
170
  };
179
171
  return [4, API.authService.createAuth(requestBody)];
180
172
  case 1:
181
- data = _b.sent();
173
+ data = _c.sent();
182
174
  return [2, { response: data, formData: params }];
183
175
  }
184
176
  });
185
177
  }); });
186
178
  export var verifyMobileOtp = createAsyncThunk('auth/verifyMobileOtp', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
187
- var _a, settings, auth, _b, responseData, leadId, _c, auth_token, device_token, service_name, scope, payload, data;
179
+ var _a, settings, auth, _b, responseData, leadId, _c, auth_token, device_token, service_name, auth_type, sign_in, scope, payload, data;
188
180
  var _d, _e, _f, _g;
189
181
  return __generator(this, function (_h) {
190
182
  switch (_h.label) {
191
183
  case 0:
192
184
  _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
193
185
  _b = auth.data || {}, responseData = _b.responseData, leadId = _b.leadId;
194
- _c = (_d = responseData === null || responseData === void 0 ? void 0 : responseData.authResponse) !== null && _d !== void 0 ? _d : {}, auth_token = _c.auth_token, device_token = _c.device_token, service_name = _c.service_name;
186
+ _c = (_d = responseData === null || responseData === void 0 ? void 0 : responseData.authResponse) !== null && _d !== void 0 ? _d : {}, auth_token = _c.auth_token, device_token = _c.device_token, service_name = _c.service_name, auth_type = _c.auth_type, sign_in = _c.sign_in;
195
187
  if (!auth_token)
196
188
  throw new Error('Auth token is missing');
197
189
  scope = settings.data.appConfig.scope;
@@ -199,10 +191,10 @@ export var verifyMobileOtp = createAsyncThunk('auth/verifyMobileOtp', function (
199
191
  auth_token: auth_token,
200
192
  lead_id: leadId,
201
193
  data: params.otp,
202
- auth_type: 2,
194
+ auth_type: auth_type,
203
195
  device_token: device_token,
204
196
  service_name: service_name,
205
- sign_in: false,
197
+ sign_in: sign_in,
206
198
  step_name: AUTH_STEP_NAMES.VERIFY_AUTH_MOBILE,
207
199
  encryption_contract: ['data']
208
200
  };
@@ -211,6 +203,11 @@ export var verifyMobileOtp = createAsyncThunk('auth/verifyMobileOtp', function (
211
203
  data = (_h.sent()).data;
212
204
  if ((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length)
213
205
  throw new Error(data.errors[0].description);
206
+ sendCustomEventToGTM({
207
+ event: 'Send Event',
208
+ event_category: 'User Registration Flow',
209
+ event_action: 'First OTP Success'
210
+ });
214
211
  if (scope === 'merchant') {
215
212
  openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
216
213
  return [2, data];
@@ -221,92 +218,120 @@ export var verifyMobileOtp = createAsyncThunk('auth/verifyMobileOtp', function (
221
218
  }
222
219
  });
223
220
  }); });
224
- export var createNIDAuth = createAsyncThunk('auth/createNIDAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
225
- var _a, settings, auth, dob, nid, nidType, countryCode, requestBody, data;
221
+ export var createEmailAuth = createAsyncThunk('auth/createEmailAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
222
+ var _a, settings, auth, requestBody, data, screen;
226
223
  var _b, _c;
227
224
  return __generator(this, function (_d) {
228
225
  switch (_d.label) {
229
226
  case 0:
230
227
  _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
231
- dob = params.dob, nid = params.nid;
232
- nidType = nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
233
- countryCode = settings.data.businessCountry.iso2;
234
228
  requestBody = {
235
- country: countryCode,
229
+ country: settings.data.businessCountry.iso2,
236
230
  scope: settings.data.appConfig.scope,
237
231
  lang: settings.data.language,
238
232
  lead_id: auth.data.leadId,
239
233
  user_credentail: {
240
- identification_id: nid,
241
- identification_id_type: nidType,
242
- date_of_birth: dob,
243
- country_code: countryCode
234
+ email: params.email || ''
244
235
  },
245
- sign_in: false,
246
- is_lead: true,
247
- step_name: AUTH_STEP_NAMES.CREATE_AUTH_NID,
248
- encryption_contract: [
249
- 'user_credentail.country_code',
250
- 'user_credentail.identification_id',
251
- 'user_credentail.identification_id_type',
252
- 'user_credentail.date_of_birth'
253
- ]
236
+ sign_in: true,
237
+ is_lead: false,
238
+ step_name: AUTH_STEP_NAMES.CREATE_AUTH_EMAIL,
239
+ encryption_contract: ['user_credentail.email']
254
240
  };
255
241
  return [4, API.authService.createAuth(requestBody)];
256
242
  case 1:
257
243
  data = _d.sent();
258
- thunkApi.dispatch(handleNextScreenStep());
244
+ screen = 'AUTH_PASSWORD_STEP';
245
+ if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.RESET_PASSWORD)
246
+ screen = 'AUTH_RESET_PASSWORD_MESSAGE_STEP';
247
+ if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.EMAIL_OTP)
248
+ screen = 'AUTH_OTP_STEP';
249
+ thunkApi.dispatch(handleNextScreenStep(screen));
259
250
  (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody.user_credentail);
260
251
  return [2, { response: data, formData: params }];
261
252
  }
262
253
  });
263
254
  }); });
264
- export var resendNIDAuthOTP = createAsyncThunk('auth/resendNIDAuthOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
265
- var _a, settings, auth, dob, nid, nidType, countryCode, requestBody, data;
255
+ export var verifyEmailPassword = createAsyncThunk('auth/verifyEmailPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
256
+ var _a, settings, auth, _b, responseData, leadId, _c, auth_token, device_token, service_name, auth_type, sign_in, scope, payload, data;
257
+ var _d, _e, _f, _g;
258
+ return __generator(this, function (_h) {
259
+ switch (_h.label) {
260
+ case 0:
261
+ _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
262
+ _b = auth.data || {}, responseData = _b.responseData, leadId = _b.leadId;
263
+ _c = (_d = responseData === null || responseData === void 0 ? void 0 : responseData.authResponse) !== null && _d !== void 0 ? _d : {}, auth_token = _c.auth_token, device_token = _c.device_token, service_name = _c.service_name, auth_type = _c.auth_type, sign_in = _c.sign_in;
264
+ if (!auth_token)
265
+ throw new Error('Auth token is missing');
266
+ scope = settings.data.appConfig.scope;
267
+ payload = {
268
+ auth_token: auth_token,
269
+ lead_id: leadId,
270
+ data: params.password,
271
+ auth_type: auth_type,
272
+ device_token: device_token,
273
+ service_name: service_name,
274
+ sign_in: sign_in,
275
+ is_lead: false,
276
+ step_name: AUTH_STEP_NAMES.VERIFY_AUTH_EMAIL,
277
+ encryption_contract: ['data']
278
+ };
279
+ return [4, API.authService.verifyAuth(payload)];
280
+ case 1:
281
+ data = (_h.sent()).data;
282
+ if ((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length)
283
+ throw new Error(data.errors[0].description);
284
+ if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.MOBILE_OTP) {
285
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('AUTH_OTP_STEP')); });
286
+ return [2, data];
287
+ }
288
+ if (scope === 'merchant') {
289
+ openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
290
+ return [2, data];
291
+ }
292
+ (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, params);
293
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('AUTH_PREPARING_DATA_STEP')); });
294
+ return [2, data];
295
+ }
296
+ });
297
+ }); });
298
+ export var resendEmailAuthOTP = createAsyncThunk('auth/resendEmailAuthOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
299
+ var _a, settings, auth, requestBody, data;
266
300
  return __generator(this, function (_b) {
267
301
  switch (_b.label) {
268
302
  case 0:
269
303
  _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
270
- dob = params.dob, nid = params.nid;
271
- nidType = nid.startsWith('1') ? IDENTIFICATION_TYPE.NID : IDENTIFICATION_TYPE.IQAMA;
272
- countryCode = settings.data.businessCountry.iso2;
273
304
  requestBody = {
274
- country: countryCode,
305
+ country: settings.data.businessCountry.iso2,
275
306
  scope: settings.data.appConfig.scope,
276
307
  lang: settings.data.language,
277
308
  lead_id: auth.data.leadId,
278
309
  user_credentail: {
279
- identification_id: nid,
280
- identification_id_type: nidType,
281
- date_of_birth: dob,
282
- country_code: countryCode
310
+ email: params.email || ''
283
311
  },
284
- sign_in: false,
285
- is_lead: true,
286
- step_name: AUTH_STEP_NAMES.CREATE_AUTH_NID,
287
- encryption_contract: [
288
- 'user_credentail.country_code',
289
- 'user_credentail.identification_id',
290
- 'user_credentail.identification_id_type',
291
- 'user_credentail.date_of_birth'
292
- ]
312
+ sign_in: true,
313
+ is_lead: false,
314
+ step_name: AUTH_STEP_NAMES.CREATE_AUTH_EMAIL,
315
+ encryption_contract: ['user_credentail.email']
293
316
  };
294
317
  return [4, API.authService.createAuth(requestBody)];
295
318
  case 1:
296
319
  data = _b.sent();
320
+ if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.PASSWORD)
321
+ thunkApi.dispatch(handlePrevScreenStep('AUTH_PASSWORD_STEP'));
297
322
  return [2, { response: data, formData: params }];
298
323
  }
299
324
  });
300
325
  }); });
301
- export var verifyNIDOtp = createAsyncThunk('auth/verifyNIDOtp', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
302
- var _a, settings, auth, _b, responseData, leadId, _c, auth_token, device_token, service_name, scope, payload, data;
326
+ export var verifyEmailOtp = createAsyncThunk('auth/verifyEmailOtp', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
327
+ var _a, settings, auth, _b, responseData, leadId, _c, auth_token, device_token, service_name, auth_type, sign_in, scope, payload, data, stepName;
303
328
  var _d, _e, _f, _g;
304
329
  return __generator(this, function (_h) {
305
330
  switch (_h.label) {
306
331
  case 0:
307
332
  _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
308
333
  _b = auth.data || {}, responseData = _b.responseData, leadId = _b.leadId;
309
- _c = (_d = responseData === null || responseData === void 0 ? void 0 : responseData.authResponse) !== null && _d !== void 0 ? _d : {}, auth_token = _c.auth_token, device_token = _c.device_token, service_name = _c.service_name;
334
+ _c = (_d = responseData === null || responseData === void 0 ? void 0 : responseData.authResponse) !== null && _d !== void 0 ? _d : {}, auth_token = _c.auth_token, device_token = _c.device_token, service_name = _c.service_name, auth_type = _c.auth_type, sign_in = _c.sign_in;
310
335
  if (!auth_token)
311
336
  throw new Error('Auth token is missing');
312
337
  scope = settings.data.appConfig.scope;
@@ -314,11 +339,12 @@ export var verifyNIDOtp = createAsyncThunk('auth/verifyNIDOtp', function (params
314
339
  auth_token: auth_token,
315
340
  lead_id: leadId,
316
341
  data: params.otp,
317
- auth_type: 2,
342
+ auth_type: auth_type,
318
343
  device_token: device_token,
319
- service_name: service_name || 'ABSHER',
320
- sign_in: false,
321
- step_name: AUTH_STEP_NAMES.VERIFY_AUTH_NID,
344
+ service_name: service_name,
345
+ sign_in: sign_in,
346
+ is_lead: false,
347
+ step_name: AUTH_STEP_NAMES.VERIFY_AUTH_MOBILE,
322
348
  encryption_contract: ['data']
323
349
  };
324
350
  return [4, API.authService.verifyAuth(payload)];
@@ -326,28 +352,168 @@ export var verifyNIDOtp = createAsyncThunk('auth/verifyNIDOtp', function (params
326
352
  data = (_h.sent()).data;
327
353
  if ((_e = data.errors) === null || _e === void 0 ? void 0 : _e.length)
328
354
  throw new Error(data.errors[0].description);
355
+ sendCustomEventToGTM({
356
+ event: 'Send Event',
357
+ event_category: 'User Registration Flow',
358
+ event_action: 'First OTP Success'
359
+ });
329
360
  if (scope === 'merchant') {
330
361
  openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
331
362
  return [2, data];
332
363
  }
364
+ stepName = 'AUTH_PREPARING_DATA_STEP';
365
+ if ((data === null || data === void 0 ? void 0 : data.auth_type) === AuthTypeNumber.MIGRATION)
366
+ stepName = 'AUTH_MIGRATING_DATA_STEP';
333
367
  (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, params);
334
- sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('AUTH_PREPARING_DATA_STEP')); });
368
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep(stepName)); });
335
369
  return [2, data];
336
370
  }
337
371
  });
338
372
  }); });
373
+ export var createNafathAuth = createAsyncThunk('auth/createNafathAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
374
+ var _a, settings, auth, requestBody, data;
375
+ var _b, _c;
376
+ return __generator(this, function (_d) {
377
+ switch (_d.label) {
378
+ case 0:
379
+ _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
380
+ requestBody = {
381
+ country: settings.data.businessCountry.iso2,
382
+ scope: settings.data.appConfig.scope,
383
+ lang: settings.data.language,
384
+ lead_id: auth.data.leadId,
385
+ user_credentail: {
386
+ identification_id: params.nid,
387
+ identification_id_type: IDENTIFICATION_TYPE.NAFATH,
388
+ country_code: settings.data.businessCountry.iso2
389
+ },
390
+ sign_in: false,
391
+ is_lead: true,
392
+ step_name: AUTH_STEP_NAMES.CREATE_AUTH_NID,
393
+ encryption_contract: ['user_credentail.country_code', 'user_credentail.identification_id', 'user_credentail.identification_id_type']
394
+ };
395
+ return [4, API.authService.createAuthKitNID(requestBody)];
396
+ case 1:
397
+ data = _d.sent();
398
+ thunkApi.dispatch(handleNextScreenStep());
399
+ (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody);
400
+ return [2, { response: data, formData: params }];
401
+ }
402
+ });
403
+ }); });
404
+ export var verifyNafath = createAsyncThunk('auth/verifyNafath', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
405
+ var _a, settings, auth, authResponse, expiry, scope, interval, maxCalls, _loop_1, count, state_1;
406
+ var _b, _c, _d, _e, _f;
407
+ return __generator(this, function (_g) {
408
+ switch (_g.label) {
409
+ case 0:
410
+ _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
411
+ authResponse = (auth.data.responseData || {}).authResponse;
412
+ expiry = (authResponse === null || authResponse === void 0 ? void 0 : authResponse.expiry) || 120;
413
+ scope = settings.data.appConfig.scope;
414
+ interval = 3;
415
+ maxCalls = Math.floor(expiry / interval);
416
+ _loop_1 = function (count) {
417
+ var data, error_1, isSuccess, isFailed, screen_1;
418
+ return __generator(this, function (_h) {
419
+ switch (_h.label) {
420
+ case 0:
421
+ if (thunkApi.signal.aborted) {
422
+ return [2, "break"];
423
+ }
424
+ data = void 0;
425
+ _h.label = 1;
426
+ case 1:
427
+ _h.trys.push([1, 3, , 4]);
428
+ return [4, API.authService.getVerifyAuth(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_token, { timeout: NAFATH_PACI_TIMEOUT_DURATION })];
429
+ case 2:
430
+ data = _h.sent();
431
+ return [3, 4];
432
+ case 3:
433
+ error_1 = _h.sent();
434
+ if (!isNetworkError(error_1.message) && !isTimeoutError(error_1.message)) {
435
+ throw new Error(error_1);
436
+ }
437
+ return [3, 4];
438
+ case 4:
439
+ isSuccess = ((_b = data === null || data === void 0 ? void 0 : data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
440
+ isFailed = ((_c = data === null || data === void 0 ? void 0 : data.status) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === 'failed';
441
+ if (isFailed) {
442
+ (_d = params.onFailure) === null || _d === void 0 ? void 0 : _d.call(params);
443
+ return [2, { value: data }];
444
+ }
445
+ if (isSuccess) {
446
+ if (scope === 'merchant') {
447
+ openConnect(settings.data.appConfig.publicKey, settings.data.businessCountry.iso2);
448
+ return [2, { value: data }];
449
+ }
450
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, params);
451
+ screen_1 = data.step_name === COLLECT_DOB_INFO_NAFATH ? 'AUTH_DOB_STEP' : 'AUTH_PREPARING_DATA_STEP';
452
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep(screen_1)); });
453
+ return [2, { value: data }];
454
+ }
455
+ return [4, sleep(interval * 1000)];
456
+ case 5:
457
+ _h.sent();
458
+ return [2];
459
+ }
460
+ });
461
+ };
462
+ count = 1;
463
+ _g.label = 1;
464
+ case 1:
465
+ if (!(count <= maxCalls)) return [3, 4];
466
+ return [5, _loop_1(count)];
467
+ case 2:
468
+ state_1 = _g.sent();
469
+ if (typeof state_1 === "object")
470
+ return [2, state_1.value];
471
+ if (state_1 === "break")
472
+ return [3, 4];
473
+ _g.label = 3;
474
+ case 3:
475
+ count++;
476
+ return [3, 1];
477
+ case 4: throw new Error(NAFATH_VERIFICATION_FAILED);
478
+ }
479
+ });
480
+ }); });
481
+ export var updateLeadDOB = createAsyncThunk('auth/updateLeadDOB', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
482
+ var _a, settings, auth, leadId, requestBody, data;
483
+ var _b, _c, _d, _e;
484
+ return __generator(this, function (_f) {
485
+ switch (_f.label) {
486
+ case 0:
487
+ _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
488
+ leadId = ((_c = (_b = auth.data.responseData) === null || _b === void 0 ? void 0 : _b.authResponse) === null || _c === void 0 ? void 0 : _c.lead_id) || '';
489
+ requestBody = {
490
+ id: leadId,
491
+ date_of_birth: params.dob,
492
+ step_name: AUTH_STEP_NAMES.UPDATE_DOB_INFO,
493
+ encryption_contract: ['date_of_birth']
494
+ };
495
+ return [4, API.leadService.updateLead(requestBody)];
496
+ case 1:
497
+ data = _f.sent();
498
+ thunkApi.dispatch(handleNextScreenStep());
499
+ (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
500
+ return [2, { data: data, formData: params }];
501
+ }
502
+ });
503
+ }); });
339
504
  export var createCivilIdAuth = createAsyncThunk('auth/createCivilAuth', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
340
- var settings, countryCode, requestBody, data;
341
- var _a, _b;
342
- return __generator(this, function (_c) {
343
- switch (_c.label) {
505
+ var _a, settings, auth, countryCode, requestBody, data;
506
+ var _b, _c;
507
+ return __generator(this, function (_d) {
508
+ switch (_d.label) {
344
509
  case 0:
345
- settings = thunkApi.getState().settings;
510
+ _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
346
511
  countryCode = settings.data.businessCountry.iso2;
347
512
  requestBody = {
348
513
  country: settings.data.businessCountry.iso2,
349
514
  scope: settings.data.appConfig.scope,
350
515
  lang: settings.data.language,
516
+ lead_id: auth.data.leadId,
351
517
  user_credentail: {
352
518
  identification_id: params.civilId,
353
519
  country_code: countryCode
@@ -359,15 +525,15 @@ export var createCivilIdAuth = createAsyncThunk('auth/createCivilAuth', function
359
525
  };
360
526
  return [4, API.authService.createAuth(requestBody)];
361
527
  case 1:
362
- data = _c.sent();
528
+ data = _d.sent();
363
529
  thunkApi.dispatch(handleNextScreenStep());
364
- (_b = (_a = settings.data.appConfig).onStepCompleted) === null || _b === void 0 ? void 0 : _b.call(_a, settings.data.activeScreen.name, requestBody.user_credentail);
530
+ (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, requestBody.user_credentail);
365
531
  return [2, { response: data, formData: params }];
366
532
  }
367
533
  });
368
534
  }); });
369
535
  export var verifyPACI = createAsyncThunk('auth/verifyPACI', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
370
- var _a, settings, auth, authResponse, scope, expiry, interval, maxCalls, count, data, isSuccess;
536
+ var _a, settings, auth, authResponse, scope, expiry, interval, maxCalls, count, data, error_2, isSuccess;
371
537
  var _b, _c, _d;
372
538
  return __generator(this, function (_e) {
373
539
  switch (_e.label) {
@@ -381,13 +547,25 @@ export var verifyPACI = createAsyncThunk('auth/verifyPACI', function (params, th
381
547
  count = 1;
382
548
  _e.label = 1;
383
549
  case 1:
384
- if (!(count <= maxCalls)) return [3, 5];
550
+ if (!(count <= maxCalls)) return [3, 8];
385
551
  if (thunkApi.signal.aborted) {
386
- return [3, 5];
552
+ return [3, 8];
387
553
  }
388
- return [4, API.authService.getVerifyAuth(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_token)];
554
+ data = void 0;
555
+ _e.label = 2;
389
556
  case 2:
557
+ _e.trys.push([2, 4, , 5]);
558
+ return [4, API.authService.getVerifyAuth(authResponse === null || authResponse === void 0 ? void 0 : authResponse.auth_token, { timeout: NAFATH_PACI_TIMEOUT_DURATION })];
559
+ case 3:
390
560
  data = _e.sent();
561
+ return [3, 5];
562
+ case 4:
563
+ error_2 = _e.sent();
564
+ if (!isNetworkError(error_2.message) && !isTimeoutError(error_2.message)) {
565
+ throw new Error(error_2);
566
+ }
567
+ return [3, 5];
568
+ case 5:
391
569
  isSuccess = ((_b = data === null || data === void 0 ? void 0 : data.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success';
392
570
  if (isSuccess) {
393
571
  if (scope === 'merchant') {
@@ -399,41 +577,101 @@ export var verifyPACI = createAsyncThunk('auth/verifyPACI', function (params, th
399
577
  return [2, data];
400
578
  }
401
579
  return [4, sleep(interval * 1000)];
402
- case 3:
580
+ case 6:
403
581
  _e.sent();
404
- _e.label = 4;
405
- case 4:
582
+ _e.label = 7;
583
+ case 7:
406
584
  count++;
407
585
  return [3, 1];
408
- case 5: throw new Error('paci_verification_failed');
586
+ case 8: throw new Error('paci_verification_failed');
587
+ }
588
+ });
589
+ }); });
590
+ export var checkMigrationStatus = createAsyncThunk('auth/checkMigrationStatus', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
591
+ var auth, jobId, authId, migrationData, checkStatusRecursive;
592
+ var _a, _b, _c, _d;
593
+ return __generator(this, function (_e) {
594
+ switch (_e.label) {
595
+ case 0:
596
+ auth = thunkApi.getState().auth;
597
+ jobId = (_b = (_a = auth.data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse) === null || _b === void 0 ? void 0 : _b.job_id;
598
+ authId = (_d = (_c = auth.data.responseData) === null || _c === void 0 ? void 0 : _c.authResponse) === null || _d === void 0 ? void 0 : _d.id;
599
+ migrationData = undefined;
600
+ checkStatusRecursive = function () { return __awaiter(void 0, void 0, void 0, function () {
601
+ var data;
602
+ return __generator(this, function (_a) {
603
+ switch (_a.label) {
604
+ case 0: return [4, API.accountService.checkMigrationStatus(jobId)];
605
+ case 1:
606
+ data = _a.sent();
607
+ migrationData = data;
608
+ if (!((data === null || data === void 0 ? void 0 : data.status) === MigrationStatus.IN_PROGRESS)) return [3, 4];
609
+ return [4, sleep(3000)];
610
+ case 2:
611
+ _a.sent();
612
+ return [4, checkStatusRecursive()];
613
+ case 3:
614
+ _a.sent();
615
+ return [2];
616
+ case 4:
617
+ if ((data === null || data === void 0 ? void 0 : data.status) === MigrationStatus.FAILED) {
618
+ throw new Error('please_try_again_after_few_minutes');
619
+ }
620
+ _a.label = 5;
621
+ case 5:
622
+ sendCustomEventToGTM({
623
+ event: 'Send Event',
624
+ event_category: 'User Registration Flow',
625
+ event_action: 'Migration Completed'
626
+ });
627
+ return [4, thunkApi.dispatch(confirmInfo({ authId: authId }))];
628
+ case 6:
629
+ _a.sent();
630
+ return [2];
631
+ }
632
+ });
633
+ }); };
634
+ return [4, checkStatusRecursive()];
635
+ case 1:
636
+ _e.sent();
637
+ return [2, migrationData];
409
638
  }
410
639
  });
411
640
  }); });
412
641
  export var checkAccountAvailability = createAsyncThunk('auth/checkAccountAvailability', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
413
- var _a, settings, auth, authConfigData, isDataHasIndividualOnly, data, authId, accountData, _b, step_name, brands, entities, brandList, entityList, isExistingUser;
642
+ var _a, settings, auth, authConfigData, authDataHasValue, isDataHasIndividualOnly, data, authId, accountData, _b, step_name, brands, entities, brandList, entityList, isExistingUser;
414
643
  var _c;
415
644
  return __generator(this, function (_d) {
416
645
  switch (_d.label) {
417
646
  case 0:
418
647
  _a = thunkApi.getState(), settings = _a.settings, auth = _a.auth;
419
648
  authConfigData = settings.data.appConfig.data;
649
+ authDataHasValue = authConfigData === null || authConfigData === void 0 ? void 0 : authConfigData.length;
420
650
  isDataHasIndividualOnly = (authConfigData === null || authConfigData === void 0 ? void 0 : authConfigData.length) === 1 && authConfigData.includes('individual');
421
651
  data = (_c = auth.data.responseData) === null || _c === void 0 ? void 0 : _c.authResponse;
422
- authId = data === null || data === void 0 ? void 0 : data.id;
423
- return [4, API.accountService.checkAccountAvailability(data === null || data === void 0 ? void 0 : data.individual_id)];
652
+ authId = (data || {}).id;
653
+ accountData = undefined;
654
+ if (!isDataHasIndividualOnly) return [3, 2];
655
+ return [4, API.accountService.checkAccountAvailabilityStatus(data === null || data === void 0 ? void 0 : data.individual_id)];
424
656
  case 1:
425
657
  accountData = _d.sent();
658
+ return [3, 4];
659
+ case 2: return [4, API.accountService.checkAccountAvailability(data === null || data === void 0 ? void 0 : data.individual_id)];
660
+ case 3:
661
+ accountData = _d.sent();
662
+ _d.label = 4;
663
+ case 4:
426
664
  _b = accountData || {}, step_name = _b.step_name, brands = _b.brands, entities = _b.entities;
427
665
  brandList = brands || [];
428
666
  entityList = entities || [];
429
667
  isExistingUser = step_name === 'select_account';
430
- if (!(isExistingUser && isDataHasIndividualOnly && authId)) return [3, 3];
668
+ if (!(isExistingUser && isDataHasIndividualOnly && authId)) return [3, 6];
431
669
  return [4, thunkApi.dispatch(confirmInfo({ authId: authId }))];
432
- case 2:
670
+ case 5:
433
671
  _d.sent();
434
672
  return [2, { brandList: brandList, entityList: entityList }];
435
- case 3:
436
- if (isExistingUser && !isDataHasIndividualOnly && brandList.length && entityList.length) {
673
+ case 6:
674
+ if (isExistingUser && authDataHasValue && brandList.length && entityList.length) {
437
675
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('AUTH_AUTHENTICATION_LIST_STEP')); });
438
676
  return [2, { brandList: brandList, entityList: entityList }];
439
677
  }
@@ -449,24 +687,22 @@ export var checkAccountAvailability = createAsyncThunk('auth/checkAccountAvailab
449
687
  export var getMerchantList = createAsyncThunk('auth/getMerchantList', function (_a, thunkApi) {
450
688
  var brandInfo = _a.brandInfo, entityInfo = _a.entityInfo;
451
689
  return __awaiter(void 0, void 0, void 0, function () {
452
- var _b, settings, auth, platforms, payment_provider, payload, merchants, list;
453
- var _c, _d, _e, _f, _g, _h;
454
- return __generator(this, function (_j) {
455
- switch (_j.label) {
690
+ var _b, settings, auth, platforms, payment_provider, isScopeAuthentication, leadId, payload, merchants, list;
691
+ var _c, _d, _e, _f, _g, _h, _j, _k;
692
+ return __generator(this, function (_l) {
693
+ switch (_l.label) {
456
694
  case 0:
457
695
  _b = thunkApi.getState(), settings = _b.settings, auth = _b.auth;
458
696
  platforms = (_e = (_d = (_c = auth.data.responseData) === null || _c === void 0 ? void 0 : _c.leadResponse) === null || _d === void 0 ? void 0 : _d.platforms) !== null && _e !== void 0 ? _e : settings.data.appConfig.platforms;
459
697
  payment_provider = (_h = (_g = (_f = auth.data.responseData) === null || _f === void 0 ? void 0 : _f.leadResponse) === null || _g === void 0 ? void 0 : _g.payment_provider) !== null && _h !== void 0 ? _h : settings.data.appConfig.paymentProvider;
460
- payload = {
461
- business_entity_id: (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) || '',
462
- brand_id: (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.id) || '',
463
- create_if_not_present: true,
464
- platforms: platforms,
465
- payment_provider: payment_provider
466
- };
698
+ isScopeAuthentication = settings.data.appConfig.scope === SCOPE_AUTH;
699
+ leadId = (_k = (_j = auth.data.responseData) === null || _j === void 0 ? void 0 : _j.authResponse) === null || _k === void 0 ? void 0 : _k.lead_id;
700
+ payload = __assign({ business_entity_id: (entityInfo === null || entityInfo === void 0 ? void 0 : entityInfo.id) || '', brand_id: (brandInfo === null || brandInfo === void 0 ? void 0 : brandInfo.id) || '', create_if_not_present: true, platforms: platforms, payment_provider: payment_provider }, (isScopeAuthentication && {
701
+ lead_id: leadId
702
+ }));
467
703
  return [4, API.entityService.getMerchantListUsingEntityId(payload)];
468
704
  case 1:
469
- merchants = (_j.sent()).merchants;
705
+ merchants = (_l.sent()).merchants;
470
706
  list = merchants || [];
471
707
  if ((list === null || list === void 0 ? void 0 : list.length) > 1) {
472
708
  thunkApi.dispatch(handleNextScreenStep('AUTH_MERCHANT_LIST_STEP'));
@@ -510,16 +746,16 @@ export var createEntity = createAsyncThunk('auth/createEntity', function (params
510
746
  export var confirmInfo = createAsyncThunk('auth/confirmInfo', function (_a, thunkApi) {
511
747
  var brandInfo = _a.brandInfo, entityInfo = _a.entityInfo, merchantInfo = _a.merchantInfo, authId = _a.authId;
512
748
  return __awaiter(void 0, void 0, void 0, function () {
513
- var _b, auth, settings, authResponse, _c, postURL, redirectUrl, bi, authenticationId, body, data, urlQueryStart;
514
- var _d, _e, _f;
515
- return __generator(this, function (_g) {
516
- switch (_g.label) {
749
+ var _b, auth, settings, authResponse, _c, postURL, redirectUrl, showBoard, bi, authenticationId, body, data, urlQueryStart;
750
+ var _d, _e, _f, _g, _h, _j;
751
+ return __generator(this, function (_k) {
752
+ switch (_k.label) {
517
753
  case 0:
518
754
  _b = thunkApi.getState(), auth = _b.auth, settings = _b.settings;
519
755
  authResponse = ((_d = auth.data.responseData) !== null && _d !== void 0 ? _d : {}).authResponse;
520
- _c = settings.data.appConfig, postURL = _c.postURL, redirectUrl = _c.redirectUrl;
756
+ _c = settings.data.appConfig, postURL = _c.postURL, redirectUrl = _c.redirectUrl, showBoard = _c.showBoard;
521
757
  bi = settings.data.deviceInfo.browser.browser_id;
522
- authenticationId = authId || (authResponse === null || authResponse === void 0 ? void 0 : authResponse.id);
758
+ authenticationId = (_e = authId !== null && authId !== void 0 ? authId : authResponse === null || authResponse === void 0 ? void 0 : authResponse.id) !== null && _e !== void 0 ? _e : '';
523
759
  body = {
524
760
  post_url: postURL || '',
525
761
  authentication_id: authenticationId,
@@ -531,8 +767,13 @@ export var confirmInfo = createAsyncThunk('auth/confirmInfo', function (_a, thun
531
767
  };
532
768
  return [4, API.operatorService.confirm(body)];
533
769
  case 1:
534
- data = _g.sent();
535
- (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, data);
770
+ data = _k.sent();
771
+ (_g = (_f = settings.data.appConfig).onStepCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, settings.data.activeScreen.name, data);
772
+ if (showBoard && (merchantInfo === null || merchantInfo === void 0 ? void 0 : merchantInfo.board_id)) {
773
+ settings.data.appConfig.onFlowCompleted({ auth_id: authenticationId, bi: bi });
774
+ (_j = (_h = settings.data.appConfig).onSwitchToBoard) === null || _j === void 0 ? void 0 : _j.call(_h, (merchantInfo === null || merchantInfo === void 0 ? void 0 : merchantInfo.board_id) || '', authenticationId);
775
+ return [2];
776
+ }
536
777
  if (authenticationId) {
537
778
  if (settings.data.appConfig.mode === 'popup') {
538
779
  settings.data.appConfig.onFlowCompleted({ auth_id: authenticationId, bi: bi });
@@ -550,28 +791,41 @@ export var confirmInfo = createAsyncThunk('auth/confirmInfo', function (_a, thun
550
791
  });
551
792
  });
552
793
  export var onSignUp = createAsyncThunk('auth/onSignUp', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
553
- var _a, auth, settings, authResponse, _b, appConfig, businessCountry, isMaturityExpress, language, publicKey, boardMaturity, merchantDomain, scope, postURL, body, data, redirectUrl;
554
- var _c, _d, _e, _f;
555
- return __generator(this, function (_g) {
556
- switch (_g.label) {
794
+ var _a, auth, settings, responseData, authResponse, _b, appConfig, language, boardMaturity, scope, postURL, authData, dialogEdgeFormat, redirectUrl, body, data, connectUrl;
795
+ var _c, _d, _e;
796
+ return __generator(this, function (_f) {
797
+ switch (_f.label) {
557
798
  case 0:
558
799
  _a = thunkApi.getState(), auth = _a.auth, settings = _a.settings;
559
- authResponse = ((_c = auth.data.responseData) !== null && _c !== void 0 ? _c : {}).authResponse;
560
- _b = settings.data, appConfig = _b.appConfig, businessCountry = _b.businessCountry, isMaturityExpress = _b.isMaturityExpress, language = _b.language;
561
- publicKey = appConfig.publicKey, boardMaturity = appConfig.boardMaturity, merchantDomain = appConfig.merchantDomain, scope = appConfig.scope, postURL = appConfig.postURL;
562
- body = __assign({ board: true, public_key: publicKey, board_maturity: boardMaturity, domain: merchantDomain, language: language, country: businessCountry.iso2, scope: scope, lead_id: authResponse === null || authResponse === void 0 ? void 0 : authResponse.lead_id, maturity: !isMaturityExpress }, (postURL && {
800
+ responseData = auth.data.responseData;
801
+ authResponse = (responseData !== null && responseData !== void 0 ? responseData : {}).authResponse;
802
+ _b = settings.data, appConfig = _b.appConfig, language = _b.language;
803
+ boardMaturity = appConfig.boardMaturity, scope = appConfig.scope, postURL = appConfig.postURL, authData = appConfig.data, dialogEdgeFormat = appConfig.dialogEdgeFormat, redirectUrl = appConfig.redirectUrl;
804
+ body = __assign(__assign({ scope: scope, data: authData, lead: {
805
+ id: authResponse === null || authResponse === void 0 ? void 0 : authResponse.lead_id
806
+ }, board: {
807
+ display: true,
808
+ editable: boardMaturity
809
+ }, interface: {
810
+ locale: language,
811
+ edges: dialogEdgeFormat
812
+ } }, (redirectUrl && {
813
+ post: {
814
+ url: redirectUrl
815
+ }
816
+ })), (postURL && {
563
817
  post: {
564
818
  url: postURL
565
819
  }
566
820
  }));
567
821
  return [4, API.authService.generateConfigToken(body)];
568
822
  case 1:
569
- data = _g.sent();
570
- (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, data);
571
- redirectUrl = (_f = data === null || data === void 0 ? void 0 : data.redirect) === null || _f === void 0 ? void 0 : _f.url;
572
- if (!redirectUrl)
823
+ data = _f.sent();
824
+ (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, data);
825
+ connectUrl = (_e = data === null || data === void 0 ? void 0 : data.connect) === null || _e === void 0 ? void 0 : _e.url;
826
+ if (!connectUrl)
573
827
  throw new Error('Internal server error');
574
- window.open(redirectUrl, '_self');
828
+ window.open(connectUrl, '_self');
575
829
  return [2];
576
830
  }
577
831
  });
@@ -582,6 +836,7 @@ var initialState = {
582
836
  customLoading: false,
583
837
  data: {
584
838
  isStartFromBusinessCountry: false,
839
+ isBusinessCountryPassed: true,
585
840
  flowName: FlowsTypes.AUTH,
586
841
  mobileData: {
587
842
  countryCode: defaultCountry,
@@ -596,10 +851,19 @@ var initialState = {
596
851
  civilIdData: {
597
852
  civilId: ''
598
853
  },
854
+ emailData: {
855
+ email: ''
856
+ },
857
+ dobData: {
858
+ dob: ''
859
+ },
599
860
  otpData: {
600
861
  otp: '',
601
862
  authFor: AuthForType.MOBILE
602
863
  },
864
+ passwordData: {
865
+ password: ''
866
+ },
603
867
  authenticationData: {
604
868
  brandInfo: undefined,
605
869
  entityInfo: undefined
@@ -625,12 +889,18 @@ export var authSlice = createSlice({
625
889
  storeIsStartFromBusinessCountry: function (state, action) {
626
890
  state.data.isStartFromBusinessCountry = action.payload;
627
891
  },
892
+ storeIsBusinessCountryPassed: function (state, action) {
893
+ state.data.isBusinessCountryPassed = action.payload;
894
+ },
628
895
  resetStore: function (state) {
629
896
  state.data = __assign(__assign({}, state.data), { responseData: undefined });
630
897
  },
631
898
  resetOTPValue: function (state) {
632
899
  state.data.otpData.otp = '';
633
900
  },
901
+ resetPasswordValue: function (state) {
902
+ state.data.passwordData.password = '';
903
+ },
634
904
  resetAuthenticationScreen: function (state) {
635
905
  state.data.authenticationData = __assign(__assign({}, state.data.authenticationData), initialState.data.authenticationData);
636
906
  }
@@ -661,13 +931,16 @@ export var authSlice = createSlice({
661
931
  state.data.nidData.nid = identification === null || identification === void 0 ? void 0 : identification.id;
662
932
  if (date_of_birth)
663
933
  state.data.nidData.dob = date_of_birth;
664
- var phone = (contact || {}).phone;
934
+ var _c = contact || {}, phone = _c.phone, email = _c.email;
665
935
  if (phone) {
666
936
  state.data.mobileData.mobile = phone === null || phone === void 0 ? void 0 : phone.number;
667
937
  }
668
938
  if (countryCode) {
669
939
  state.data.mobileData.countryCode = countryCode;
670
940
  }
941
+ if (email) {
942
+ state.data.emailData.email = email;
943
+ }
671
944
  state.data.responseData = __assign(__assign({}, state.data.responseData), { leadResponse: data });
672
945
  })
673
946
  .addCase(retrieveLeadIdentityByIdAsync.rejected, function (state, action) {
@@ -713,42 +986,102 @@ export var authSlice = createSlice({
713
986
  state.loading = false;
714
987
  state.error = action.error.message;
715
988
  })
716
- .addCase(createNIDAuth.pending, function (state) {
989
+ .addCase(createEmailAuth.pending, function (state) {
717
990
  state.loading = true;
718
991
  state.error = null;
719
992
  })
720
- .addCase(createNIDAuth.fulfilled, function (state, action) {
993
+ .addCase(createEmailAuth.fulfilled, function (state, action) {
721
994
  state.loading = false;
722
- state.data.nidData = action.payload.formData;
723
- state.data.otpData.authFor = AuthForType.NATIONAL_ID;
995
+ state.data.emailData = action.payload.formData;
996
+ state.data.otpData.authFor = AuthForType.EMAIL;
997
+ state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: action.payload.response });
998
+ })
999
+ .addCase(createEmailAuth.rejected, function (state, action) {
1000
+ state.loading = false;
1001
+ state.error = action.error.message;
1002
+ })
1003
+ .addCase(verifyEmailPassword.pending, function (state) {
1004
+ state.loading = true;
1005
+ state.error = null;
1006
+ })
1007
+ .addCase(verifyEmailPassword.fulfilled, function (state, action) {
1008
+ var _a;
1009
+ state.loading = false;
1010
+ var data = action.payload;
1011
+ state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse), data) });
1012
+ })
1013
+ .addCase(verifyEmailPassword.rejected, function (state, action) {
1014
+ state.loading = false;
1015
+ state.error = action.error.message;
1016
+ })
1017
+ .addCase(resendEmailAuthOTP.pending, function (state) {
1018
+ state.error = null;
1019
+ })
1020
+ .addCase(resendEmailAuthOTP.fulfilled, function (state, action) {
1021
+ state.data.emailData = action.payload.formData;
1022
+ state.data.otpData.authFor = AuthForType.EMAIL;
724
1023
  state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: action.payload.response });
725
1024
  })
726
- .addCase(createNIDAuth.rejected, function (state, action) {
1025
+ .addCase(resendEmailAuthOTP.rejected, function (state, action) {
1026
+ state.error = action.error.message;
1027
+ })
1028
+ .addCase(verifyEmailOtp.pending, function (state) {
1029
+ state.loading = true;
1030
+ state.error = null;
1031
+ })
1032
+ .addCase(verifyEmailOtp.fulfilled, function (state, action) {
1033
+ var _a;
1034
+ state.loading = false;
1035
+ var data = action.payload;
1036
+ state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse), data) });
1037
+ })
1038
+ .addCase(verifyEmailOtp.rejected, function (state, action) {
727
1039
  state.loading = false;
728
1040
  state.error = action.error.message;
729
1041
  })
730
- .addCase(resendNIDAuthOTP.pending, function (state) {
1042
+ .addCase(createNafathAuth.pending, function (state) {
1043
+ state.loading = true;
731
1044
  state.error = null;
732
1045
  })
733
- .addCase(resendNIDAuthOTP.fulfilled, function (state, action) {
1046
+ .addCase(createNafathAuth.fulfilled, function (state, action) {
1047
+ state.loading = false;
734
1048
  state.data.nidData = action.payload.formData;
735
1049
  state.data.otpData.authFor = AuthForType.NATIONAL_ID;
736
1050
  state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: action.payload.response });
737
1051
  })
738
- .addCase(resendNIDAuthOTP.rejected, function (state, action) {
1052
+ .addCase(createNafathAuth.rejected, function (state, action) {
1053
+ state.loading = false;
739
1054
  state.error = action.error.message;
740
1055
  })
741
- .addCase(verifyNIDOtp.pending, function (state) {
1056
+ .addCase(verifyNafath.pending, function (state) {
742
1057
  state.loading = true;
743
1058
  state.error = null;
744
1059
  })
745
- .addCase(verifyNIDOtp.fulfilled, function (state, action) {
1060
+ .addCase(verifyNafath.fulfilled, function (state, action) {
746
1061
  var _a;
747
1062
  state.loading = false;
748
1063
  var data = action.payload;
749
1064
  state.data.responseData = __assign(__assign({}, state.data.responseData), { authResponse: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse), data) });
750
1065
  })
751
- .addCase(verifyNIDOtp.rejected, function (state, action) {
1066
+ .addCase(verifyNafath.rejected, function (state, action) {
1067
+ state.loading = false;
1068
+ var error = action.error.message;
1069
+ if (error !== 'Aborted') {
1070
+ state.error = error;
1071
+ }
1072
+ })
1073
+ .addCase(updateLeadDOB.pending, function (state, action) {
1074
+ state.loading = true;
1075
+ state.error = null;
1076
+ })
1077
+ .addCase(updateLeadDOB.fulfilled, function (state, action) {
1078
+ var _a;
1079
+ state.loading = false;
1080
+ var _b = action.payload, data = _b.data, formData = _b.formData;
1081
+ state.data.dobData = formData;
1082
+ state.data.responseData = __assign(__assign({}, state.data.responseData), { leadResponse: __assign(__assign({}, (_a = state.data.responseData) === null || _a === void 0 ? void 0 : _a.leadResponse), data) });
1083
+ })
1084
+ .addCase(updateLeadDOB.rejected, function (state, action) {
752
1085
  state.loading = false;
753
1086
  state.error = action.error.message;
754
1087
  })
@@ -799,6 +1132,19 @@ export var authSlice = createSlice({
799
1132
  .addCase(checkAccountAvailability.rejected, function (state, action) {
800
1133
  state.loading = false;
801
1134
  state.error = action.error.message;
1135
+ })
1136
+ .addCase(checkMigrationStatus.pending, function (state) {
1137
+ state.loading = true;
1138
+ state.error = null;
1139
+ })
1140
+ .addCase(checkMigrationStatus.fulfilled, function (state, action) {
1141
+ state.error = null;
1142
+ state.loading = false;
1143
+ state.data.responseData = __assign(__assign({}, state.data.responseData), { migrationData: action.payload });
1144
+ })
1145
+ .addCase(checkMigrationStatus.rejected, function (state, action) {
1146
+ state.loading = false;
1147
+ state.error = action.error.message;
802
1148
  })
803
1149
  .addCase(getMerchantList.pending, function (state) {
804
1150
  state.loading = true;
@@ -865,6 +1211,6 @@ export var authSlice = createSlice({
865
1211
  });
866
1212
  }
867
1213
  });
868
- export var clearError = (_a = authSlice.actions, _a.clearError), resetStore = _a.resetStore, setMobileCountryCode = _a.setMobileCountryCode, setLeadId = _a.setLeadId, resetOTPValue = _a.resetOTPValue, storeIsStartFromBusinessCountry = _a.storeIsStartFromBusinessCountry, resetAuthenticationScreen = _a.resetAuthenticationScreen;
1214
+ export var clearError = (_a = authSlice.actions, _a.clearError), resetStore = _a.resetStore, setMobileCountryCode = _a.setMobileCountryCode, setLeadId = _a.setLeadId, resetOTPValue = _a.resetOTPValue, storeIsStartFromBusinessCountry = _a.storeIsStartFromBusinessCountry, resetAuthenticationScreen = _a.resetAuthenticationScreen, storeIsBusinessCountryPassed = _a.storeIsBusinessCountryPassed, resetPasswordValue = _a.resetPasswordValue;
869
1215
  export default authSlice.reducer;
870
1216
  export var authSelector = function (state) { return state.auth; };