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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (557) hide show
  1. package/build/@types/app.d.ts +47 -4
  2. package/build/@types/app.js +22 -0
  3. package/build/@types/config.d.ts +4 -0
  4. package/build/@types/form.d.ts +11 -1
  5. package/build/@types/redux.d.ts +1 -0
  6. package/build/api/account.d.ts +4 -1
  7. package/build/api/account.js +15 -1
  8. package/build/api/auth.d.ts +35 -20
  9. package/build/api/auth.js +1 -1
  10. package/build/api/axios.js +1 -2
  11. package/build/api/data.d.ts +4 -17
  12. package/build/api/data.js +5 -45
  13. package/build/api/entity.d.ts +3 -2
  14. package/build/api/entity.js +12 -4
  15. package/build/api/firebase.js +68 -8
  16. package/build/api/index.d.ts +14 -25
  17. package/build/api/lead.d.ts +16 -3
  18. package/build/api/lead.js +16 -0
  19. package/build/api/user.d.ts +7 -0
  20. package/build/api/user.js +9 -1
  21. package/build/app/rootReducer.d.ts +1 -0
  22. package/build/app/rootReducer.js +3 -1
  23. package/build/app/settings.js +9 -8
  24. package/build/app/store.d.ts +2 -0
  25. package/build/assets/locales/ar.json +353 -151
  26. package/build/assets/locales/en.json +349 -150
  27. package/build/components/AnimationFlow/AnimationFlow.d.ts +9 -5
  28. package/build/components/AnimationFlow/AnimationFlow.js +5 -5
  29. package/build/components/AnimationFlow/BottomSheet.d.ts +3 -1
  30. package/build/components/AnimationFlow/BottomSheet.js +42 -14
  31. package/build/components/AnimationFlow/Dialog.d.ts +4 -3
  32. package/build/components/AnimationFlow/Dialog.js +5 -3
  33. package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +1 -1
  34. package/build/components/ArabicDatePicker/ArabicDatePicker.js +2 -2
  35. package/build/components/ArabicDatePicker/style.css +32 -3
  36. package/build/components/DatePicker/DatePicker.d.ts +1 -1
  37. package/build/components/DatePicker/DatePicker.js +2 -2
  38. package/build/components/Footer/Footer.js +2 -1
  39. package/build/components/Input/Input.js +1 -1
  40. package/build/components/Providers/ThemeProvider.js +3 -3
  41. package/build/components/Tooltip/Tooltip.js +1 -1
  42. package/build/constants/api.d.ts +5 -7
  43. package/build/constants/api.js +11 -15
  44. package/build/constants/app.d.ts +40 -0
  45. package/build/constants/app.js +368 -36
  46. package/build/constants/assets.d.ts +3 -0
  47. package/build/constants/assets.js +4 -1
  48. package/build/constants/dummy.d.ts +4 -219
  49. package/build/constants/dummy.js +64 -6194
  50. package/build/constants/flows.d.ts +26 -0
  51. package/build/constants/flows.js +27 -0
  52. package/build/constants/index.d.ts +1 -0
  53. package/build/constants/index.js +1 -0
  54. package/build/constants/validation.d.ts +3 -0
  55. package/build/constants/validation.js +3 -0
  56. package/build/features/app/auth/authStore.d.ts +29 -8
  57. package/build/features/app/auth/authStore.js +495 -149
  58. package/build/features/app/bank/bankStore.d.ts +13 -18
  59. package/build/features/app/bank/bankStore.js +186 -153
  60. package/build/features/app/board/boardStore.d.ts +5 -1
  61. package/build/features/app/board/boardStore.js +82 -51
  62. package/build/features/app/brand/brandStore.d.ts +17 -33
  63. package/build/features/app/brand/brandStore.js +254 -257
  64. package/build/features/app/business/businessStore.d.ts +37 -15
  65. package/build/features/app/business/businessStore.js +443 -235
  66. package/build/features/app/connect/connectStore.d.ts +33 -5
  67. package/build/features/app/connect/connectStore.js +355 -120
  68. package/build/features/app/connectExpress/connectExpressStore.d.ts +64 -27
  69. package/build/features/app/connectExpress/connectExpressStore.js +807 -394
  70. package/build/features/app/entity/entityStore.d.ts +20 -36
  71. package/build/features/app/entity/entityStore.js +204 -238
  72. package/build/features/app/individual/individualStore.d.ts +18 -34
  73. package/build/features/app/individual/individualStore.js +269 -292
  74. package/build/features/app/kyc/kycStore.d.ts +67 -0
  75. package/build/features/app/kyc/kycStore.js +432 -0
  76. package/build/features/app/password/passwordStore.d.ts +33 -18
  77. package/build/features/app/password/passwordStore.js +260 -219
  78. package/build/features/app/signIn/signInStore.js +19 -15
  79. package/build/features/app/tax/taxStore.d.ts +13 -7
  80. package/build/features/app/tax/taxStore.js +170 -136
  81. package/build/features/auth/Auth.d.ts +5 -6
  82. package/build/features/auth/Auth.js +40 -15
  83. package/build/features/auth/screens/AccountNotFound/AccountNotFound.js +2 -5
  84. package/build/features/auth/screens/AuthSwitch/AuthSwitch.d.ts +5 -0
  85. package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +58 -0
  86. package/build/features/auth/screens/AuthSwitch/index.d.ts +3 -0
  87. package/build/features/auth/screens/AuthSwitch/index.js +2 -0
  88. package/build/features/auth/screens/AuthenticationList/AuthenticationList.js +2 -8
  89. package/build/features/auth/screens/AuthenticationList/LicenseNumber.js +2 -2
  90. package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +8 -2
  91. package/build/features/auth/screens/CivilID/CivilID.js +4 -35
  92. package/build/features/auth/screens/{NID → DOB}/DOB.js +3 -3
  93. package/build/features/auth/screens/DOB/DOBForm.d.ts +5 -0
  94. package/build/features/auth/screens/DOB/DOBForm.js +59 -0
  95. package/build/features/auth/screens/DOB/index.d.ts +3 -0
  96. package/build/features/auth/screens/DOB/index.js +2 -0
  97. package/build/features/{connectExpress/screens/IdentityOTP → auth/screens/DOB}/validation.d.ts +4 -4
  98. package/build/features/auth/screens/DOB/validation.js +4 -0
  99. package/build/features/auth/screens/Email/Email.d.ts +5 -0
  100. package/build/features/auth/screens/Email/Email.js +57 -0
  101. package/build/features/auth/screens/Email/EmailField.d.ts +8 -0
  102. package/build/features/auth/screens/Email/EmailField.js +52 -0
  103. package/build/features/auth/screens/Email/index.d.ts +3 -0
  104. package/build/features/auth/screens/Email/index.js +2 -0
  105. package/build/features/auth/screens/Email/validation.d.ts +8 -0
  106. package/build/features/auth/screens/Email/validation.js +4 -0
  107. package/build/features/auth/screens/EmailSent/EmailSent.d.ts +5 -0
  108. package/build/features/auth/screens/EmailSent/EmailSent.js +79 -0
  109. package/build/features/auth/screens/EmailSent/index.d.ts +2 -0
  110. package/build/features/auth/screens/EmailSent/index.js +2 -0
  111. package/build/features/auth/screens/MigratingData/MigratingData.d.ts +5 -0
  112. package/build/features/auth/screens/MigratingData/MigratingData.js +44 -0
  113. package/build/features/auth/screens/MigratingData/index.d.ts +2 -0
  114. package/build/features/auth/screens/MigratingData/index.js +2 -0
  115. package/build/features/auth/screens/Mobile/Mobile.js +6 -38
  116. package/build/features/auth/screens/Mobile/MobileNumber.js +13 -15
  117. package/build/features/auth/screens/Mobile/validation.js +11 -3
  118. package/build/features/auth/screens/NID/IDNumber.js +1 -1
  119. package/build/features/auth/screens/NID/NID.js +7 -43
  120. package/build/features/auth/screens/NID/validation.d.ts +0 -3
  121. package/build/features/auth/screens/NID/validation.js +0 -1
  122. package/build/features/auth/screens/OTP/OTP.js +41 -10
  123. package/build/features/auth/screens/OTP/OTPInput.js +23 -6
  124. package/build/features/auth/screens/OperatorError/OperatorError.d.ts +5 -0
  125. package/build/features/auth/screens/OperatorError/OperatorError.js +9 -0
  126. package/build/features/auth/screens/OperatorError/index.d.ts +3 -0
  127. package/build/features/auth/screens/OperatorError/index.js +2 -0
  128. package/build/features/auth/screens/Password/Password.d.ts +5 -0
  129. package/build/features/auth/screens/Password/Password.js +61 -0
  130. package/build/features/auth/screens/Password/PasswordField.d.ts +5 -0
  131. package/build/features/auth/screens/Password/PasswordField.js +28 -0
  132. package/build/features/auth/screens/Password/index.d.ts +3 -0
  133. package/build/features/auth/screens/Password/index.js +2 -0
  134. package/build/features/auth/screens/Password/validation.d.ts +8 -0
  135. package/build/features/auth/screens/Password/validation.js +4 -0
  136. package/build/features/auth/screens/PreparingData/PreparingData.js +3 -0
  137. package/build/features/auth/screens/ResetPasswordMessage/ResetPasswordMessage.d.ts +5 -0
  138. package/build/features/auth/screens/ResetPasswordMessage/ResetPasswordMessage.js +21 -0
  139. package/build/features/auth/screens/ResetPasswordMessage/index.d.ts +3 -0
  140. package/build/features/auth/screens/ResetPasswordMessage/index.js +2 -0
  141. package/build/features/auth/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  142. package/build/features/auth/screens/VerifyNafath/VerifyNafath.js +35 -0
  143. package/build/features/auth/screens/VerifyNafath/index.d.ts +3 -0
  144. package/build/features/auth/screens/VerifyNafath/index.js +2 -0
  145. package/build/features/bank/Bank.d.ts +5 -1
  146. package/build/features/bank/Bank.js +22 -9
  147. package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
  148. package/build/features/bank/screens/OperatorError/OperatorError.d.ts +5 -0
  149. package/build/features/bank/screens/OperatorError/OperatorError.js +9 -0
  150. package/build/features/bank/screens/OperatorError/index.d.ts +3 -0
  151. package/build/features/bank/screens/OperatorError/index.js +2 -0
  152. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  153. package/build/features/bank/screens/Verify/Verify.js +7 -6
  154. package/build/features/board/Board.d.ts +2 -0
  155. package/build/features/board/Board.js +24 -13
  156. package/build/features/board/screens/OperatorError/OperatorError.d.ts +5 -0
  157. package/build/features/board/screens/OperatorError/OperatorError.js +9 -0
  158. package/build/features/board/screens/OperatorError/index.d.ts +3 -0
  159. package/build/features/board/screens/OperatorError/index.js +2 -0
  160. package/build/features/board/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
  161. package/build/features/board/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
  162. package/build/features/board/screens/PrepareDataLoading/index.d.ts +2 -0
  163. package/build/features/board/screens/PrepareDataLoading/index.js +2 -0
  164. package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -4
  165. package/build/features/board/screens/Verify/Verify.js +3 -2
  166. package/build/features/brand/Brand.d.ts +5 -1
  167. package/build/features/brand/Brand.js +22 -9
  168. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +5 -5
  169. package/build/features/brand/screens/BrandActivities/BrandActivities.js +48 -11
  170. package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +6 -6
  171. package/build/features/brand/screens/BrandActivities/CustomerBase.js +1 -1
  172. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +6 -3
  173. package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +4 -4
  174. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
  175. package/build/features/brand/screens/BrandActivities/TAC.d.ts +1 -1
  176. package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
  177. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
  178. package/build/features/brand/screens/BrandInfo/BrandInfo.js +22 -4
  179. package/build/features/brand/screens/BrandInfo/BrandName.js +5 -2
  180. package/build/features/brand/screens/BrandInfo/validation.js +2 -2
  181. package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +22 -6
  182. package/build/features/brand/screens/OperatorError/OperatorError.d.ts +5 -0
  183. package/build/features/brand/screens/OperatorError/OperatorError.js +9 -0
  184. package/build/features/brand/screens/OperatorError/index.d.ts +3 -0
  185. package/build/features/brand/screens/OperatorError/index.js +2 -0
  186. package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  187. package/build/features/brand/screens/Verify/Verify.js +3 -2
  188. package/build/features/business/Business.js +20 -12
  189. package/build/features/business/screens/Activities/Activities.js +26 -9
  190. package/build/features/business/screens/Activities/ActivitiesList.d.ts +4 -4
  191. package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
  192. package/build/features/business/screens/Activities/OperationStartDate.d.ts +5 -3
  193. package/build/features/business/screens/Activities/OperationStartDate.js +2 -2
  194. package/build/features/business/screens/BrandDetails/SalesChannel.d.ts +2 -2
  195. package/build/features/business/screens/BusinessType/BusinessType.js +11 -3
  196. package/build/features/business/screens/BusinessType/LicenseNumber.js +3 -3
  197. package/build/features/business/screens/Customers/CustomerLocations.d.ts +10 -8
  198. package/build/features/business/screens/Customers/CustomerLocations.js +5 -3
  199. package/build/features/business/screens/Customers/Customers.js +50 -10
  200. package/build/features/business/screens/Customers/ExpectedCustomers.d.ts +3 -1
  201. package/build/features/business/screens/Customers/ExpectedCustomers.js +5 -3
  202. package/build/features/business/screens/Customers/ExpectedSalesRange.d.ts +3 -1
  203. package/build/features/business/screens/Customers/ExpectedSalesRange.js +11 -5
  204. package/build/features/business/screens/Customers/RefundPolicy.d.ts +12 -5
  205. package/build/features/business/screens/Customers/RefundPolicy.js +13 -13
  206. package/build/features/business/screens/Customers/TransactionPolicy.d.ts +4 -1
  207. package/build/features/business/screens/Customers/TransactionPolicy.js +8 -5
  208. package/build/features/business/screens/Customers/validation.d.ts +6 -6
  209. package/build/features/business/screens/Customers/validation.js +3 -8
  210. package/build/features/business/screens/DOB/DOB.d.ts +6 -0
  211. package/build/features/business/screens/DOB/DOB.js +45 -0
  212. package/build/features/business/screens/DOB/DOBForm.d.ts +5 -0
  213. package/build/features/business/screens/DOB/DOBForm.js +72 -0
  214. package/build/features/business/screens/DOB/index.d.ts +3 -0
  215. package/build/features/business/screens/DOB/index.js +2 -0
  216. package/build/features/business/screens/DOB/validation.d.ts +8 -0
  217. package/build/features/business/screens/DOB/validation.js +4 -0
  218. package/build/features/business/screens/IDBOD/IDBOD.js +10 -2
  219. package/build/features/business/screens/IDBOD/validation.d.ts +0 -3
  220. package/build/features/business/screens/IDBOD/validation.js +0 -1
  221. package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
  222. package/build/features/business/screens/MobileOwnership/CollectMobileOwnership.js +103 -0
  223. package/build/features/{connectExpress/screens/IdentityOTP/OTP.d.ts → business/screens/MobileOwnership/MobileNumber.d.ts} +0 -2
  224. package/build/features/business/screens/MobileOwnership/MobileNumber.js +72 -0
  225. package/build/features/business/screens/MobileOwnership/index.d.ts +2 -0
  226. package/build/features/business/screens/MobileOwnership/index.js +2 -0
  227. package/build/features/business/screens/MobileOwnership/validation.d.ts +8 -0
  228. package/build/features/business/screens/MobileOwnership/validation.js +38 -0
  229. package/build/features/business/screens/OperatorError/OperatorError.d.ts +5 -0
  230. package/build/features/business/screens/OperatorError/OperatorError.js +9 -0
  231. package/build/features/business/screens/OperatorError/index.d.ts +3 -0
  232. package/build/features/business/screens/OperatorError/index.js +2 -0
  233. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -3
  234. package/build/features/business/screens/Verify/Verify.js +15 -4
  235. package/build/features/business/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  236. package/build/features/business/screens/VerifyNafath/VerifyNafath.js +35 -0
  237. package/build/features/business/screens/VerifyNafath/index.d.ts +3 -0
  238. package/build/features/business/screens/VerifyNafath/index.js +2 -0
  239. package/build/features/connect/Connect.d.ts +5 -1
  240. package/build/features/connect/Connect.js +16 -9
  241. package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +7 -1
  242. package/build/features/connect/screens/CivilID/CivilID.js +6 -1
  243. package/build/features/{auth/screens/NID → connect/screens/DOB}/DOB.d.ts +1 -2
  244. package/build/features/connect/screens/{NID → DOB}/DOB.js +2 -2
  245. package/build/features/connect/screens/DOB/DOBForm.d.ts +5 -0
  246. package/build/features/connect/screens/DOB/DOBForm.js +59 -0
  247. package/build/features/connect/screens/DOB/index.d.ts +3 -0
  248. package/build/features/connect/screens/DOB/index.js +2 -0
  249. package/build/features/connect/screens/DOB/validation.d.ts +8 -0
  250. package/build/features/connect/screens/DOB/validation.js +4 -0
  251. package/build/features/connect/screens/Individual/Email.js +1 -3
  252. package/build/features/connect/screens/Individual/Individual.js +11 -5
  253. package/build/features/connect/screens/Individual/MobileNumber.js +8 -7
  254. package/build/features/connect/screens/Individual/validation.js +11 -3
  255. package/build/features/connect/screens/Merchant/BrandName.js +5 -2
  256. package/build/features/connect/screens/Merchant/validation.js +2 -2
  257. package/build/features/connect/screens/Mobile/Mobile.js +12 -9
  258. package/build/features/connect/screens/Mobile/MobileNumber.js +8 -7
  259. package/build/features/connect/screens/Mobile/validation.js +11 -3
  260. package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
  261. package/build/features/connect/screens/MobileOwnership/CollectMobileOwnership.js +104 -0
  262. package/build/features/connect/screens/MobileOwnership/MobileNumber.d.ts +3 -0
  263. package/build/features/connect/screens/MobileOwnership/MobileNumber.js +72 -0
  264. package/build/features/connect/screens/MobileOwnership/index.d.ts +2 -0
  265. package/build/features/connect/screens/MobileOwnership/index.js +2 -0
  266. package/build/features/connect/screens/MobileOwnership/validation.d.ts +8 -0
  267. package/build/features/connect/screens/MobileOwnership/validation.js +38 -0
  268. package/build/features/connect/screens/NID/IDNumber.d.ts +1 -0
  269. package/build/features/connect/screens/NID/IDNumber.js +2 -2
  270. package/build/features/connect/screens/NID/NID.js +5 -11
  271. package/build/features/connect/screens/NID/validation.d.ts +0 -3
  272. package/build/features/connect/screens/NID/validation.js +0 -1
  273. package/build/features/connect/screens/OTP/OTP.js +6 -6
  274. package/build/features/connect/screens/OTP/OTPInput.js +3 -11
  275. package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
  276. package/build/features/connect/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  277. package/build/features/connect/screens/VerifyNafath/VerifyNafath.js +35 -0
  278. package/build/features/connect/screens/VerifyNafath/index.d.ts +3 -0
  279. package/build/features/connect/screens/VerifyNafath/index.js +2 -0
  280. package/build/features/connectExpress/ConnectExpress.d.ts +5 -2
  281. package/build/features/connectExpress/ConnectExpress.js +62 -39
  282. package/build/features/connectExpress/screens/AuthenticationList/LicenseNumber.js +2 -2
  283. package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +7 -1
  284. package/build/features/connectExpress/screens/CivilID/CivilID.js +6 -1
  285. package/build/features/connectExpress/screens/CollectBusinessInfo/BrandName.js +5 -2
  286. package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +8 -1
  287. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
  288. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +1 -1
  289. package/build/features/connectExpress/screens/CollectBusinessInfo/validation.js +2 -2
  290. package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +30 -7
  291. package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +1 -3
  292. package/build/features/connectExpress/screens/CollectIndividualInfo/MobileNumber.js +9 -8
  293. package/build/features/connectExpress/screens/CollectIndividualInfo/validation.js +11 -3
  294. package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +14 -24
  295. package/build/features/connectExpress/screens/{NID → DOB}/DOB.d.ts +1 -2
  296. package/build/features/connectExpress/screens/{NID → DOB}/DOB.js +3 -3
  297. package/build/features/connectExpress/screens/DOB/DOBForm.d.ts +5 -0
  298. package/build/features/connectExpress/screens/DOB/DOBForm.js +63 -0
  299. package/build/features/connectExpress/screens/DOB/index.d.ts +3 -0
  300. package/build/features/connectExpress/screens/DOB/index.js +2 -0
  301. package/build/features/connectExpress/screens/DOB/validation.d.ts +8 -0
  302. package/build/features/connectExpress/screens/DOB/validation.js +4 -0
  303. package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.d.ts +3 -0
  304. package/build/features/connectExpress/screens/GenericPrepareDataLoading/GenericPrepareDataLoading.js +9 -0
  305. package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.d.ts +2 -0
  306. package/build/features/connectExpress/screens/GenericPrepareDataLoading/index.js +2 -0
  307. package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.d.ts +5 -0
  308. package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.js +35 -0
  309. package/build/features/connectExpress/screens/IdentityVerifyNafath/index.d.ts +3 -0
  310. package/build/features/connectExpress/screens/IdentityVerifyNafath/index.js +2 -0
  311. package/build/features/connectExpress/screens/Mobile/Mobile.js +10 -3
  312. package/build/features/connectExpress/screens/Mobile/MobileNumber.js +9 -8
  313. package/build/features/connectExpress/screens/Mobile/validation.js +21 -6
  314. package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.d.ts +3 -0
  315. package/build/features/connectExpress/screens/MobileOwnership/CollectMobileOwnership.js +106 -0
  316. package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.d.ts +3 -0
  317. package/build/features/connectExpress/screens/MobileOwnership/MobileNumber.js +72 -0
  318. package/build/features/connectExpress/screens/MobileOwnership/index.d.ts +2 -0
  319. package/build/features/connectExpress/screens/MobileOwnership/index.js +2 -0
  320. package/build/features/connectExpress/screens/MobileOwnership/validation.d.ts +8 -0
  321. package/build/features/connectExpress/screens/MobileOwnership/validation.js +38 -0
  322. package/build/features/connectExpress/screens/NID/IDNumber.d.ts +1 -0
  323. package/build/features/connectExpress/screens/NID/IDNumber.js +2 -2
  324. package/build/features/connectExpress/screens/NID/NID.js +10 -10
  325. package/build/features/connectExpress/screens/NID/TAC.d.ts +1 -1
  326. package/build/features/connectExpress/screens/NID/TAC.js +2 -2
  327. package/build/features/connectExpress/screens/NID/validation.d.ts +0 -3
  328. package/build/features/connectExpress/screens/NID/validation.js +0 -2
  329. package/build/features/connectExpress/screens/NIDMissed/NID.js +3 -3
  330. package/build/features/connectExpress/screens/NIDMissed/validation.d.ts +0 -3
  331. package/build/features/connectExpress/screens/NIDMissed/validation.js +0 -1
  332. package/build/features/connectExpress/screens/OTP/OTP.js +13 -15
  333. package/build/features/connectExpress/screens/OTP/OTPInput.js +12 -10
  334. package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +5 -0
  335. package/build/features/connectExpress/screens/OperatorError/OperatorError.js +9 -0
  336. package/build/features/connectExpress/screens/OperatorError/index.d.ts +3 -0
  337. package/build/features/connectExpress/screens/OperatorError/index.js +2 -0
  338. package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +5 -0
  339. package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +34 -0
  340. package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +2 -0
  341. package/build/features/connectExpress/screens/PrepareDataLoading/index.js +2 -0
  342. package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -3
  343. package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/OTPInput.js +3 -3
  344. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/VerifyMobileAuthOTP.d.ts +5 -0
  345. package/build/features/connectExpress/screens/{IdentityOTP/OTP.js → VerifyMobileAuthOTP/VerifyMobileAuthOTP.js} +22 -21
  346. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.d.ts +3 -0
  347. package/build/features/connectExpress/screens/VerifyMobileAuthOTP/index.js +2 -0
  348. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  349. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +41 -0
  350. package/build/features/connectExpress/screens/VerifyNafath/index.d.ts +3 -0
  351. package/build/features/connectExpress/screens/VerifyNafath/index.js +2 -0
  352. package/build/features/entity/Entity.d.ts +4 -1
  353. package/build/features/entity/Entity.js +22 -9
  354. package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +4 -4
  355. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +8 -4
  356. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +8 -4
  357. package/build/features/entity/screens/EntityCapital/EntityCapital.js +33 -9
  358. package/build/features/entity/screens/EntityName/EntityName.js +31 -14
  359. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +5 -5
  360. package/build/features/entity/screens/EntityName/EntityTypeList.js +2 -3
  361. package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +2 -2
  362. package/build/features/entity/screens/EntityName/ExpiryDate.js +13 -8
  363. package/build/features/entity/screens/EntityName/IssuingDate.d.ts +2 -2
  364. package/build/features/entity/screens/EntityName/IssuingDate.js +15 -8
  365. package/build/features/entity/screens/EntityName/LegalName.js +1 -13
  366. package/build/features/entity/screens/EntityName/LicenseNumber.js +6 -8
  367. package/build/features/entity/screens/EntityName/UnifiedNumber.js +4 -6
  368. package/build/features/entity/screens/EntityName/validation.d.ts +3 -3
  369. package/build/features/entity/screens/EntityName/validation.js +1 -10
  370. package/build/features/entity/screens/OperatorError/OperatorError.d.ts +5 -0
  371. package/build/features/entity/screens/OperatorError/OperatorError.js +9 -0
  372. package/build/features/entity/screens/OperatorError/index.d.ts +3 -0
  373. package/build/features/entity/screens/OperatorError/index.js +2 -0
  374. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  375. package/build/features/entity/screens/Verify/Verify.js +3 -2
  376. package/build/features/featuresScreens.d.ts +1 -0
  377. package/build/features/featuresScreens.js +216 -13
  378. package/build/features/individual/Individual.d.ts +4 -1
  379. package/build/features/individual/Individual.js +22 -9
  380. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +2 -2
  381. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +44 -11
  382. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +5 -2
  383. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +8 -3
  384. package/build/features/individual/screens/IndividualList/Email.js +2 -3
  385. package/build/features/individual/screens/IndividualList/IndividualList.d.ts +4 -4
  386. package/build/features/individual/screens/IndividualList/IndividualList.js +18 -5
  387. package/build/features/individual/screens/IndividualList/MobileNumber.js +8 -10
  388. package/build/features/individual/screens/IndividualList/UserList.js +7 -7
  389. package/build/features/individual/screens/IndividualList/validation.js +11 -4
  390. package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
  391. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +2 -2
  392. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +73 -18
  393. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +6 -5
  394. package/build/features/individual/screens/IndividualPersonalInfo/validation.js +11 -3
  395. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +9 -11
  396. package/build/features/individual/screens/IndividualPhoneInfo/validation.js +11 -3
  397. package/build/features/individual/screens/OperatorError/OperatorError.d.ts +5 -0
  398. package/build/features/individual/screens/OperatorError/OperatorError.js +9 -0
  399. package/build/features/individual/screens/OperatorError/index.d.ts +3 -0
  400. package/build/features/individual/screens/OperatorError/index.js +2 -0
  401. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  402. package/build/features/individual/screens/Verify/Verify.js +3 -2
  403. package/build/features/kyc/KYC.d.ts +11 -0
  404. package/build/features/kyc/KYC.js +99 -0
  405. package/build/features/kyc/index.d.ts +1 -0
  406. package/build/features/kyc/index.js +1 -0
  407. package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.d.ts +5 -0
  408. package/build/features/kyc/screens/AlreadySubmitted/AlreadySubmitted.js +19 -0
  409. package/build/features/kyc/screens/AlreadySubmitted/index.d.ts +2 -0
  410. package/build/features/kyc/screens/AlreadySubmitted/index.js +2 -0
  411. package/build/features/kyc/screens/Loading/Loading.d.ts +4 -0
  412. package/build/features/kyc/screens/Loading/Loading.js +10 -0
  413. package/build/features/kyc/screens/Loading/index.d.ts +2 -0
  414. package/build/features/kyc/screens/Loading/index.js +2 -0
  415. package/build/features/kyc/screens/OperatorError/OperatorError.d.ts +5 -0
  416. package/build/features/kyc/screens/OperatorError/OperatorError.js +9 -0
  417. package/build/features/kyc/screens/OperatorError/index.d.ts +2 -0
  418. package/build/features/kyc/screens/OperatorError/index.js +2 -0
  419. package/build/features/kyc/screens/Success/Success.d.ts +5 -0
  420. package/build/features/kyc/screens/Success/Success.js +32 -0
  421. package/build/features/kyc/screens/Success/index.d.ts +2 -0
  422. package/build/features/kyc/screens/Success/index.js +2 -0
  423. package/build/features/kyc/screens/Terms/Header.d.ts +6 -0
  424. package/build/features/kyc/screens/Terms/Header.js +36 -0
  425. package/build/features/kyc/screens/Terms/Terms.d.ts +4 -0
  426. package/build/features/kyc/screens/Terms/Terms.js +87 -0
  427. package/build/features/kyc/screens/Terms/index.d.ts +2 -0
  428. package/build/features/kyc/screens/Terms/index.js +2 -0
  429. package/build/features/kyc/screens/TokenError/TokenError.d.ts +5 -0
  430. package/build/features/kyc/screens/TokenError/TokenError.js +9 -0
  431. package/build/features/kyc/screens/TokenError/index.d.ts +2 -0
  432. package/build/features/kyc/screens/TokenError/index.js +2 -0
  433. package/build/features/kyc/screens/Users/Users.d.ts +3 -0
  434. package/build/features/kyc/screens/Users/Users.js +76 -0
  435. package/build/features/kyc/screens/Users/index.d.ts +2 -0
  436. package/build/features/kyc/screens/Users/index.js +2 -0
  437. package/build/features/kyc/screens/VerifyNafath/VerifyNafath.d.ts +5 -0
  438. package/build/features/kyc/screens/VerifyNafath/VerifyNafath.js +45 -0
  439. package/build/features/kyc/screens/VerifyNafath/index.d.ts +3 -0
  440. package/build/features/kyc/screens/VerifyNafath/index.js +2 -0
  441. package/build/features/kyc/screens/VerifyPaci/VerifyPACI.d.ts +5 -0
  442. package/build/features/kyc/screens/VerifyPaci/VerifyPACI.js +44 -0
  443. package/build/features/kyc/screens/VerifyPaci/index.d.ts +3 -0
  444. package/build/features/kyc/screens/VerifyPaci/index.js +2 -0
  445. package/build/features/password/Password.d.ts +4 -1
  446. package/build/features/password/Password.js +88 -31
  447. package/build/features/password/screens/CreatePassword/CreatePassword.js +8 -4
  448. package/build/features/password/screens/OTP/OTP.js +3 -3
  449. package/build/features/password/screens/OperatorError/OperatorError.d.ts +5 -0
  450. package/build/features/password/screens/OperatorError/OperatorError.js +9 -0
  451. package/build/features/password/screens/OperatorError/index.d.ts +3 -0
  452. package/build/features/password/screens/OperatorError/index.js +2 -0
  453. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
  454. package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
  455. package/build/features/password/screens/PrepareDataLoading/index.d.ts +2 -0
  456. package/build/features/password/screens/PrepareDataLoading/index.js +2 -0
  457. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  458. package/build/features/password/screens/Verify/Verify.js +7 -6
  459. package/build/features/shared/Address/CountryList.d.ts +5 -5
  460. package/build/features/shared/Address/InputSelect.d.ts +5 -5
  461. package/build/features/shared/Background/Background.js +1 -1
  462. package/build/features/shared/BusinessCountry/BusinessCountry.js +1 -1
  463. package/build/features/shared/Button/Button.js +3 -1
  464. package/build/features/shared/Button/EmailProvidersButtons.js +2 -0
  465. package/build/features/shared/Button/FlowsButtons.js +18 -4
  466. package/build/features/shared/Button/NafathButton.d.ts +8 -0
  467. package/build/features/shared/Button/{AbsherButton.js → NafathButton.js} +12 -3
  468. package/build/features/shared/Button/index.d.ts +2 -2
  469. package/build/features/shared/Button/index.js +2 -2
  470. package/build/features/shared/Calender/Calender.d.ts +2 -1
  471. package/build/features/shared/Calender/Calender.js +3 -3
  472. package/build/features/shared/Containers/FeatureContainer.d.ts +2 -1
  473. package/build/features/shared/Containers/FeatureContainer.js +5 -3
  474. package/build/features/shared/Containers/ScreenContainer.d.ts +1 -1
  475. package/build/features/shared/Dialog/DialogContainer.js +5 -4
  476. package/build/features/shared/Input/Input.d.ts +2 -2
  477. package/build/features/shared/NafathVerification/NafathVerification.d.ts +14 -0
  478. package/build/features/shared/NafathVerification/NafathVerification.js +92 -0
  479. package/build/features/shared/NafathVerification/VerifyNafathLoading.d.ts +8 -0
  480. package/build/features/shared/NafathVerification/VerifyNafathLoading.js +53 -0
  481. package/build/features/shared/NafathVerification/VerifyNafathSuccess.d.ts +5 -0
  482. package/build/features/shared/NafathVerification/VerifyNafathSuccess.js +8 -0
  483. package/build/features/shared/NafathVerification/index.d.ts +2 -0
  484. package/build/features/shared/NafathVerification/index.js +2 -0
  485. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +6 -1
  486. package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +10 -13
  487. package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
  488. package/build/features/shared/UploadFile/FileUpload.d.ts +1 -1
  489. package/build/features/shared/UploadFile/UploadFile.d.ts +1 -1
  490. package/build/features/shared/UploadFile/UploadWrapper.d.ts +1 -1
  491. package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +1 -1
  492. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +1 -1
  493. package/build/features/signIn/SignIn.js +18 -7
  494. package/build/features/signIn/screens/Mobile/MobileNumber.js +8 -7
  495. package/build/features/signIn/screens/Mobile/validation.js +11 -3
  496. package/build/features/signIn/screens/OTP/OTP.js +5 -4
  497. package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +5 -0
  498. package/build/features/signIn/screens/OperatorError/OperatorError.js +9 -0
  499. package/build/features/signIn/screens/OperatorError/index.d.ts +3 -0
  500. package/build/features/signIn/screens/OperatorError/index.js +2 -0
  501. package/build/features/tax/Tax.d.ts +4 -1
  502. package/build/features/tax/Tax.js +22 -9
  503. package/build/features/tax/screens/OperatorError/OperatorError.d.ts +5 -0
  504. package/build/features/tax/screens/OperatorError/OperatorError.js +9 -0
  505. package/build/features/tax/screens/OperatorError/index.d.ts +3 -0
  506. package/build/features/tax/screens/OperatorError/index.js +2 -0
  507. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
  508. package/build/features/tax/screens/TaxDetails/TaxDetails.js +7 -2
  509. package/build/features/tax/screens/Verify/Verify.js +7 -6
  510. package/build/hooks/index.d.ts +3 -0
  511. package/build/hooks/index.js +3 -0
  512. package/build/hooks/useAppConfig.d.ts +1 -1
  513. package/build/hooks/useAppConfig.js +2 -2
  514. package/build/hooks/useAppDispatch.d.ts +1 -0
  515. package/build/hooks/useAppTheme.js +4 -3
  516. package/build/hooks/useCountDown.d.ts +10 -0
  517. package/build/hooks/useCountDown.js +17 -0
  518. package/build/hooks/useFormDirtyCheck.d.ts +10 -0
  519. package/build/hooks/useFormDirtyCheck.js +66 -0
  520. package/build/hooks/useSanitizedTranslation.d.ts +2 -0
  521. package/build/hooks/useSanitizedTranslation.js +15 -0
  522. package/build/hooks/useVerifyToken.d.ts +4 -2
  523. package/build/hooks/useVerifyToken.js +9 -4
  524. package/build/index.css +360 -120
  525. package/build/index.d.ts +3 -2
  526. package/build/index.js +4 -2
  527. package/build/theme/components.js +7 -0
  528. package/build/theme/palette.js +2 -1
  529. package/build/theme/shadows.js +1 -1
  530. package/build/theme/theme.d.ts +1 -1
  531. package/build/theme/theme.js +2 -2
  532. package/build/utils/array.js +2 -2
  533. package/build/utils/common.d.ts +1 -0
  534. package/build/utils/common.js +16 -3
  535. package/build/utils/error.d.ts +1 -0
  536. package/build/utils/error.js +3 -0
  537. package/build/utils/object.d.ts +1 -0
  538. package/build/utils/object.js +3 -0
  539. package/build/utils/string.d.ts +6 -2
  540. package/build/utils/string.js +28 -3
  541. package/build/utils/validation.d.ts +2 -0
  542. package/build/utils/validation.js +6 -0
  543. package/package.json +3 -4
  544. package/build/features/business/screens/OTP/OTP.d.ts +0 -8
  545. package/build/features/business/screens/OTP/OTP.js +0 -90
  546. package/build/features/business/screens/OTP/index.d.ts +0 -3
  547. package/build/features/business/screens/OTP/index.js +0 -2
  548. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.d.ts +0 -5
  549. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +0 -54
  550. package/build/features/connectExpress/screens/IdentityOTP/index.d.ts +0 -3
  551. package/build/features/connectExpress/screens/IdentityOTP/index.js +0 -2
  552. package/build/features/connectExpress/screens/IdentityOTP/validation.js +0 -4
  553. package/build/features/shared/Button/AbsherButton.d.ts +0 -8
  554. /package/build/features/{connect/screens/NID → auth/screens/DOB}/DOB.d.ts +0 -0
  555. /package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/OTPInput.d.ts +0 -0
  556. /package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/validation.d.ts +0 -0
  557. /package/build/features/{business/screens/OTP → connectExpress/screens/VerifyMobileAuthOTP}/validation.js +0 -0
@@ -63,14 +63,14 @@ import { BusinessType, DocumentPurpose, FlowsTypes, LicenseType } from '../../..
63
63
  import { handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
64
64
  import { ENTITY_STEP_NAMES } from '../../../constants';
65
65
  import moment from 'moment';
66
- import { convertNumbers2English, getRecentDocumentBasedOnPurpose, hasVerifiedValue, hasNoneEditableValue, sleep, formatNumberAsCurrency, removeAllCharsFromNumber, retrieveIndividualData } from '../../../utils';
66
+ import { convertNumbers2English, getRecentDocumentBasedOnPurpose, hasVerifiedValue, hasNoneEditableValue, sleep, formatNumberAsCurrency, removeAllCharsFromNumber, retrieveIndividualData, sendCustomEventToGTM } from '../../../utils';
67
67
  export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function (_a, thunkApi) {
68
68
  var token = _a.token, isInternally = _a.isInternally;
69
69
  return __awaiter(void 0, void 0, void 0, function () {
70
- var payload, data, boardData, boardInfoData, entityData, entityTypes, individualData, countryIso2, publicKey, _b, board_id, board_info_id, _c, id_1, type_1, serviceCallBack, _d, boardRes, individualRes, entityId;
71
- var _e, _f, _g, _h, _j, _k;
72
- return __generator(this, function (_l) {
73
- switch (_l.label) {
70
+ var payload, data, entityData, entityTypes, _b, country_code, config, publicKey, _c, entity_id, boardId, data_1;
71
+ var _d, _e, _f;
72
+ return __generator(this, function (_g) {
73
+ switch (_g.label) {
74
74
  case 0:
75
75
  payload = __assign({ service_name: 'tap_email', verify_token: token }, (isInternally && {
76
76
  notification: {
@@ -79,74 +79,47 @@ export var verifyLeadToken = createAsyncThunk('entityVerifyLeadToken', function
79
79
  }));
80
80
  return [4, API.leadService.verifyLeadToken(payload)];
81
81
  case 1:
82
- data = (_l.sent()).data;
83
- countryIso2 = undefined;
84
- if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 10];
82
+ data = (_g.sent()).data;
83
+ entityTypes = undefined;
84
+ if (((_d = data === null || data === void 0 ? void 0 : data.errors) === null || _d === void 0 ? void 0 : _d.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
85
+ throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
85
86
  if (isInternally)
86
87
  data.step_name = ENTITY_STEP_NAMES.ENTITY_INFO;
87
- if (data === null || data === void 0 ? void 0 : data.country_code) {
88
- countryIso2 = data === null || data === void 0 ? void 0 : data.country_code;
89
- if (countryIso2)
90
- thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
91
- }
92
- publicKey = (_e = data === null || data === void 0 ? void 0 : data.config) === null || _e === void 0 ? void 0 : _e.public_key;
93
- if (publicKey) {
88
+ _b = data || {}, country_code = _b.country_code, config = _b.config;
89
+ publicKey = config === null || config === void 0 ? void 0 : config.public_key;
90
+ if (country_code)
91
+ thunkApi.dispatch(handleSetCountryByIso2(country_code));
92
+ if (publicKey)
94
93
  thunkApi.dispatch(handlePublicKey(publicKey));
95
- }
96
- if (!(data.step_name !== ENTITY_STEP_NAMES.PHONE_AUTH)) return [3, 10];
97
- _b = data || {}, board_id = _b.id, board_info_id = _b.board_info_id;
98
- if (!board_id) return [3, 6];
99
- return [4, API.boardService.retrieveBoardDetails(board_id)];
94
+ if (!(data.step_name !== ENTITY_STEP_NAMES.PHONE_AUTH)) return [3, 7];
95
+ _c = data || {}, entity_id = _c.entity_id, boardId = _c.id;
96
+ if (!!entity_id) return [3, 3];
97
+ return [4, API.boardService.retrieveBoardDetails(boardId)];
100
98
  case 2:
101
- boardData = _l.sent();
102
- if (!board_info_id) return [3, 4];
103
- return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
104
- case 3:
105
- boardInfoData = _l.sent();
106
- _l.label = 4;
99
+ data_1 = _g.sent();
100
+ if (!((_e = data_1 === null || data_1 === void 0 ? void 0 : data_1.entity) === null || _e === void 0 ? void 0 : _e.id))
101
+ throw new Error('entity_id_missing');
102
+ entityData = data_1;
103
+ return [3, 5];
104
+ case 3: return [4, API.entityService.retrieveEntity(entity_id)];
107
105
  case 4:
108
- _c = ((_f = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _f === void 0 ? void 0 : _f.recipient) || {}, id_1 = _c.id, type_1 = _c.type;
109
- serviceCallBack = function () { return API.individualService.retrieveIndividual(id_1, type_1); };
110
- return [4, retrieveIndividualData(type_1, boardData, serviceCallBack)];
106
+ entityData = _g.sent();
107
+ _g.label = 5;
111
108
  case 5:
112
- _d = _l.sent(), boardRes = _d.boardRes, individualRes = _d.individualRes;
113
- boardData = boardRes;
114
- individualData = individualRes;
115
- _l.label = 6;
116
- case 6:
117
- entityId = (_g = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _g === void 0 ? void 0 : _g.id;
118
- if (!entityId) return [3, 8];
119
- return [4, API.entityService.retrieveEntity(entityId)];
120
- case 7:
121
- entityData = _l.sent();
122
- _l.label = 8;
123
- case 8:
124
- if (!countryIso2) {
125
- countryIso2 = (_h = entityData === null || entityData === void 0 ? void 0 : entityData.entity) === null || _h === void 0 ? void 0 : _h.country;
126
- if (countryIso2)
127
- thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
128
- }
109
+ if (!country_code && ((_f = entityData === null || entityData === void 0 ? void 0 : entityData.entity) === null || _f === void 0 ? void 0 : _f.country))
110
+ thunkApi.dispatch(handleSetCountryByIso2(entityData.entity.country));
129
111
  return [4, API.entityService.retrieveEntityType()];
130
- case 9:
131
- entityTypes = _l.sent();
132
- thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP'));
133
- _l.label = 10;
134
- case 10: return [2, {
112
+ case 6:
113
+ entityTypes = _g.sent();
114
+ if (isInternally)
115
+ sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP')); });
116
+ else
117
+ thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP'));
118
+ _g.label = 7;
119
+ case 7: return [2, {
135
120
  data: data,
136
- individualData: individualData,
137
- boardResponse: {
138
- user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
139
- brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
140
- bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
141
- entity: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
142
- merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
143
- name: (_j = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _j === void 0 ? void 0 : _j.names,
144
- contact: (_k = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _k === void 0 ? void 0 : _k.contact,
145
- individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
146
- business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
147
- entityTypes: entityTypes,
148
- notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification
149
- },
121
+ entityData: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
122
+ entityTypes: entityTypes,
150
123
  token: token
151
124
  }];
152
125
  }
@@ -171,122 +144,119 @@ export var resendOTP = createAsyncThunk('entityResendOTP', function (params, thu
171
144
  });
172
145
  }); });
173
146
  export var verifyEntityLeadOTP = createAsyncThunk('verifyEntityLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
174
- var _a, entity, settings, responseBody, payload, data, boardData, entityData, entityTypes, boardInfoData, individualData, _b, board_id, board_info_id, config, publicKey, _c, id_2, type_2, serviceCallBack, _d, boardRes, individualRes, entityId;
175
- var _e, _f, _g, _h, _j, _k, _l;
176
- return __generator(this, function (_m) {
177
- switch (_m.label) {
147
+ var _a, entity, settings, responseBody, payload, data, _b, entity_id, config, boardId, country_code, entityData, publicKey, countryIso2, data_2, entityTypes;
148
+ var _c, _d, _e, _f, _g, _h;
149
+ return __generator(this, function (_j) {
150
+ switch (_j.label) {
178
151
  case 0:
179
152
  _a = thunkApi.getState(), entity = _a.entity, settings = _a.settings;
180
153
  responseBody = entity.data.verify.responseBody;
181
154
  payload = {
182
155
  data: params.otp,
183
- service_name: (_e = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _e === void 0 ? void 0 : _e.service_name,
156
+ service_name: (_c = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _c === void 0 ? void 0 : _c.service_name,
184
157
  verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
185
158
  step_name: ENTITY_STEP_NAMES.PHONE_AUTH,
186
159
  encryption_contract: ['data']
187
160
  };
188
161
  return [4, API.leadService.verifyLeadOTP(payload)];
189
162
  case 1:
190
- data = (_m.sent()).data;
191
- individualData = undefined;
192
- if (!!data.errors) return [3, 10];
193
- _b = data || {}, board_id = _b.id, board_info_id = _b.board_info_id, config = _b.config;
163
+ data = (_j.sent()).data;
164
+ if ((_d = data === null || data === void 0 ? void 0 : data.errors) === null || _d === void 0 ? void 0 : _d.length)
165
+ throw new Error(data.errors[0].description);
166
+ _b = data || {}, entity_id = _b.entity_id, config = _b.config, boardId = _b.id, country_code = _b.country_code;
167
+ entityData = undefined;
194
168
  publicKey = config === null || config === void 0 ? void 0 : config.public_key;
195
- if (publicKey) {
169
+ countryIso2 = country_code || (responseBody === null || responseBody === void 0 ? void 0 : responseBody.country_code);
170
+ if (publicKey)
196
171
  thunkApi.dispatch(handlePublicKey(publicKey));
197
- }
198
- if (!board_id) return [3, 6];
199
- return [4, API.boardService.retrieveBoardDetails(board_id)];
172
+ if (countryIso2)
173
+ thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
174
+ if (!!entity_id) return [3, 3];
175
+ return [4, API.boardService.retrieveBoardDetails(boardId)];
200
176
  case 2:
201
- boardData = _m.sent();
202
- if (!board_info_id) return [3, 4];
203
- return [4, API.boardService.retrieveBoardInfo({ id: board_id, infoId: board_info_id })];
204
- case 3:
205
- boardInfoData = _m.sent();
206
- _m.label = 4;
177
+ data_2 = _j.sent();
178
+ if (!((_e = data_2 === null || data_2 === void 0 ? void 0 : data_2.entity) === null || _e === void 0 ? void 0 : _e.id))
179
+ throw new Error('entity_id_missing');
180
+ entityData = data_2;
181
+ return [3, 5];
182
+ case 3: return [4, API.entityService.retrieveEntity(entity_id)];
207
183
  case 4:
208
- _c = ((_f = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _f === void 0 ? void 0 : _f.recipient) || {}, id_2 = _c.id, type_2 = _c.type;
209
- serviceCallBack = function () { return API.individualService.retrieveIndividual(id_2, type_2); };
210
- return [4, retrieveIndividualData(type_2, boardData, serviceCallBack)];
184
+ entityData = _j.sent();
185
+ _j.label = 5;
211
186
  case 5:
212
- _d = _m.sent(), boardRes = _d.boardRes, individualRes = _d.individualRes;
213
- boardData = boardRes;
214
- individualData = individualRes;
215
- _m.label = 6;
216
- case 6:
217
- entityId = (_g = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _g === void 0 ? void 0 : _g.id;
218
- if (!entityId) return [3, 8];
219
- return [4, API.entityService.retrieveEntity(entityId)];
220
- case 7:
221
- entityData = _m.sent();
222
- _m.label = 8;
223
- case 8:
224
- (_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, { otp: params.otp });
187
+ if (!countryIso2 && ((_f = entityData === null || entityData === void 0 ? void 0 : entityData.entity) === null || _f === void 0 ? void 0 : _f.country))
188
+ thunkApi.dispatch(handleSetCountryByIso2(entityData.entity.country));
189
+ (_h = (_g = settings.data.appConfig).onStepCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, settings.data.activeScreen.name, { otp: params.otp });
225
190
  return [4, API.entityService.retrieveEntityType()];
226
- case 9:
227
- entityTypes = _m.sent();
191
+ case 6:
192
+ entityTypes = _j.sent();
228
193
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('ENTITY_NAME_STEP')); });
229
- _m.label = 10;
230
- case 10: return [2, {
231
- data: data,
232
- individualData: individualData,
233
- boardResponse: {
234
- user: boardData === null || boardData === void 0 ? void 0 : boardData.user,
235
- brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand,
236
- bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account,
237
- entity: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
238
- merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant,
239
- name: (_k = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _k === void 0 ? void 0 : _k.names,
240
- contact: (_l = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _l === void 0 ? void 0 : _l.contact,
241
- individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals,
242
- business: boardData === null || boardData === void 0 ? void 0 : boardData.business,
194
+ return [2, {
195
+ data: data,
196
+ entityData: entityData === null || entityData === void 0 ? void 0 : entityData.entity,
243
197
  entityTypes: entityTypes,
244
- notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification
245
- },
246
- formData: params
247
- }];
198
+ formData: params
199
+ }];
248
200
  }
249
201
  });
250
202
  }); });
251
203
  export var retrieveBoardStatus = createAsyncThunk('entity/retrieveBoardStatus', function (parmas, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
252
- var entity, board_id, data;
253
- return __generator(this, function (_a) {
254
- switch (_a.label) {
204
+ var entity, _a, board_id, board_info_id, recipient, _b, id, type, data;
205
+ return __generator(this, function (_c) {
206
+ switch (_c.label) {
255
207
  case 0:
256
208
  entity = thunkApi.getState().entity;
257
- board_id = (entity.data.verify.responseBody || {}).board_id;
258
- return [4, API.boardService.retrieveBoardInfoStatus(board_id)];
209
+ _a = entity.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id, recipient = _a.recipient;
210
+ if (!board_id || !board_info_id)
211
+ throw new Error('Internal server error');
212
+ _b = recipient || {}, id = _b.id, type = _b.type;
213
+ return [4, Promise.all([
214
+ API.boardService.retrieveBoardInfoStatus(board_id),
215
+ thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
216
+ ])];
259
217
  case 1:
260
- data = _a.sent();
218
+ data = (_c.sent())[0];
261
219
  thunkApi.dispatch(handlePrevScreenStep());
262
220
  return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
263
221
  }
264
222
  });
265
223
  }); });
266
- export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', function (boardId) { return __awaiter(void 0, void 0, void 0, function () {
267
- var data;
268
- var _a, _b;
269
- return __generator(this, function (_c) {
270
- switch (_c.label) {
271
- case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
272
- case 1:
273
- data = _c.sent();
274
- return [2, {
275
- data: __assign(__assign({}, data), { user: data === null || data === void 0 ? void 0 : data.user, brand: data === null || data === void 0 ? void 0 : data.brand, bank_account: data === null || data === void 0 ? void 0 : data.bank_account, entity: data === null || data === void 0 ? void 0 : data.entity, merchant: data === null || data === void 0 ? void 0 : data.merchant, name: (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.names, contact: (_b = data === null || data === void 0 ? void 0 : data.user) === null || _b === void 0 ? void 0 : _b.contact, individuals: data === null || data === void 0 ? void 0 : data.individuals })
276
- }];
277
- }
224
+ export var retrieveBoardDetails = createAsyncThunk('entityRetrieveEntityInfo', function (_a) {
225
+ var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
226
+ return __awaiter(void 0, void 0, void 0, function () {
227
+ var data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
228
+ var _c, _d, _e;
229
+ return __generator(this, function (_f) {
230
+ switch (_f.label) {
231
+ case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
232
+ case 1:
233
+ data = _f.sent();
234
+ individualData = data === null || data === void 0 ? void 0 : data.user;
235
+ boardData = data;
236
+ if (!(((_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.id) !== id)) return [3, 3];
237
+ serviceCallBack = function () { return API.individualService.retrieveIndividual(id, type); };
238
+ return [4, retrieveIndividualData(type, data, serviceCallBack)];
239
+ case 2:
240
+ _b = _f.sent(), boardRes = _b.boardRes, individualRes = _b.individualRes;
241
+ individualData = individualRes;
242
+ boardData = boardRes;
243
+ _f.label = 3;
244
+ case 3: return [2, __assign(__assign({}, boardData), { brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, name: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.names, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, contact: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _e === void 0 ? void 0 : _e.contact, user: individualData, board_status: boardData === null || boardData === void 0 ? void 0 : boardData.status })];
245
+ }
246
+ });
278
247
  });
279
- }); });
248
+ });
280
249
  export var updateEntityName = createAsyncThunk('entityUpdateEntityName', function (_a, thunkApi) {
281
- var formData = _a.formData, originalFormData = _a.originalFormData;
250
+ var formData = _a.formData, originalFormData = _a.originalFormData, isDirty = _a.isDirty;
282
251
  return __awaiter(void 0, void 0, void 0, function () {
283
- var _b, settings, entity, _c, id, data_status, data_verification, documents, issuingDate, expiryDate, licenseType, licenseNumber, articleId, unifiedNumber, legalName, certificateId, entityType, issueDate, expDate, isFL, isLegalNameENNonEditable, isLegalNameARNonEditable, isLicenseTypeNonEditable, isEntityTypeNonEditable, isLicenseNumberNonEditable, isUnifiedNumberNonEditable, isIssuingDateNonEditable, isExpiryDateNonEditable, isDocumentsNonEditable, isAOAFileNonEditable, isEntityTypeVerified, isLicenseNonEditable, isLicenseAvailable, payload, data, currencyData, documentResponse, document, documentBody, documentBody, list;
284
- var _d, _e, _f;
285
- return __generator(this, function (_g) {
286
- switch (_g.label) {
252
+ var _b, settings, entity, entityRes, _c, id, data_status, data_verification, documents, issuingDate, expiryDate, licenseType, licenseNumber, articleId, unifiedNumber, legalName, certificateId, entityType, issueDate, expDate, isFL, isLegalNameENNonEditable, isLegalNameARNonEditable, isLicenseTypeNonEditable, isEntityTypeNonEditable, isLicenseNumberNonEditable, isUnifiedNumberNonEditable, isIssuingDateNonEditable, isExpiryDateNonEditable, isDocumentsNonEditable, isAOAFileNonEditable, isEntityTypeVerified, isLicenseNonEditable, isLicenseAvailable, payload, entityData, documentData, activityList, entity_1, documentResponse, document, documentBody, documentBody, entity_2, list;
253
+ var _d, _e;
254
+ return __generator(this, function (_f) {
255
+ switch (_f.label) {
287
256
  case 0:
288
257
  _b = thunkApi.getState(), settings = _b.settings, entity = _b.entity;
289
- _c = ((_d = entity.data.verify.responseBody) === null || _d === void 0 ? void 0 : _d.entity) || {}, id = _c.id, data_status = _c.data_status, data_verification = _c.data_verification, documents = _c.documents;
258
+ entityRes = (entity.data.verify.responseBody || {}).entity;
259
+ _c = entityRes || {}, id = _c.id, data_status = _c.data_status, data_verification = _c.data_verification, documents = _c.documents;
290
260
  issuingDate = formData.issuingDate, expiryDate = formData.expiryDate, licenseType = formData.licenseType, licenseNumber = formData.licenseNumber, articleId = formData.articleId, unifiedNumber = formData.unifiedNumber, legalName = formData.legalName, certificateId = formData.certificateId, entityType = formData.entityType;
291
261
  issueDate = issuingDate && new Date(issuingDate).getTime();
292
262
  expDate = expiryDate && new Date(expiryDate).getTime();
@@ -326,12 +296,14 @@ export var updateEntityName = createAsyncThunk('entityUpdateEntityName', functio
326
296
  'license.additional_info.unified_number',
327
297
  'type'
328
298
  ] });
299
+ entityData = entityRes, activityList = undefined;
300
+ if (!isDirty) return [3, 2];
329
301
  return [4, API.entityService.updateEntity(payload)];
330
302
  case 1:
331
- data = _g.sent();
332
- return [4, API.countryService.getCurrency(settings.data.businessCountry.iso2)];
303
+ entity_1 = (_f.sent()).entity;
304
+ entityData = entity_1;
305
+ _f.label = 2;
333
306
  case 2:
334
- currencyData = _g.sent();
335
307
  documentResponse = undefined;
336
308
  document = getRecentDocumentBasedOnPurpose(documents, DocumentPurpose.CR);
337
309
  if (!(!isDocumentsNonEditable && (certificateId || []).length > 0)) return [3, 8];
@@ -342,7 +314,7 @@ export var updateEntityName = createAsyncThunk('entityUpdateEntityName', functio
342
314
  };
343
315
  return [4, API.documentService.addFilesToExistingDocument(documentBody)];
344
316
  case 3:
345
- documentResponse = _g.sent();
317
+ documentResponse = _f.sent();
346
318
  return [3, 6];
347
319
  case 4:
348
320
  documentBody = {
@@ -356,44 +328,47 @@ export var updateEntityName = createAsyncThunk('entityUpdateEntityName', functio
356
328
  };
357
329
  return [4, API.documentService.updateDocumentInfo(documentBody)];
358
330
  case 5:
359
- documentResponse = _g.sent();
360
- _g.label = 6;
331
+ documentResponse = _f.sent();
332
+ _f.label = 6;
361
333
  case 6: return [4, API.entityService.retrieveEntity(id)];
362
334
  case 7:
363
- data = _g.sent();
364
- data.documentData = documentResponse;
365
- _g.label = 8;
335
+ entity_2 = (_f.sent()).entity;
336
+ entityData = entity_2;
337
+ documentData = documentResponse;
338
+ _f.label = 8;
366
339
  case 8: return [4, API.dataService.getActivitiesIsIc()];
367
340
  case 9:
368
- list = (_g.sent()).list;
369
- data.activityList = list;
341
+ list = (_f.sent()).list;
342
+ activityList = list;
370
343
  sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep()); });
371
- (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
372
- return [2, { data: data, formData: originalFormData, currencyData: currencyData }];
344
+ (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, id);
345
+ return [2, { data: { entity: entityData, documentData: documentData, activityList: activityList }, formData: originalFormData }];
373
346
  }
374
347
  });
375
348
  });
376
349
  });
377
350
  export var updateEntityCapital = createAsyncThunk('entityUpdateEntityCapital', function (_a, thunkApi) {
378
- var formData = _a.formData, originalFormData = _a.originalFormData;
351
+ var formData = _a.formData, originalFormData = _a.originalFormData, isDirty = _a.isDirty;
379
352
  return __awaiter(void 0, void 0, void 0, function () {
380
- var _b, settings, entity, _c, id, data_status, entityActivities, isCapitalPaidNonEditable, isCapitalShareCountNonEditable, isCapitalShareValueNonEditable, isActivitiesNonEditable, capitalShareCount, capitalShareValue, activities, capitalPaid, hasCapitalShares, isCapitalNonEditable, removedActivities, payload_1, activityIds, payload, data;
381
- var _d, _e, _f;
382
- return __generator(this, function (_g) {
383
- switch (_g.label) {
353
+ var _b, settings, entity, entityRes, _c, id, data_status, entityActivities, isCapitalPaidNonEditable, isCapitalShareCountNonEditable, isCapitalShareValueNonEditable, isActivitiesNonEditable, capitalShareCount, capitalShareValue, activities, capitalPaid, entityData, hasCapitalShares, isCapitalNonEditable, removedActivities, payload_1, activityIds, payload, entity_3;
354
+ var _d, _e;
355
+ return __generator(this, function (_f) {
356
+ switch (_f.label) {
384
357
  case 0:
385
358
  _b = thunkApi.getState(), settings = _b.settings, entity = _b.entity;
386
- _c = ((_d = entity.data.verify.responseBody) === null || _d === void 0 ? void 0 : _d.entity) || {}, id = _c.id, data_status = _c.data_status, entityActivities = _c.activities;
359
+ entityRes = (entity.data.verify.responseBody || {}).entity;
360
+ _c = entityRes || {}, id = _c.id, data_status = _c.data_status, entityActivities = _c.activities;
387
361
  isCapitalPaidNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.capital, 'paid');
388
362
  isCapitalShareCountNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.capital, 'shares.count');
389
363
  isCapitalShareValueNonEditable = hasNoneEditableValue(data_status === null || data_status === void 0 ? void 0 : data_status.capital, 'shares.value');
390
364
  isActivitiesNonEditable = hasNoneEditableValue(data_status, 'activities');
391
365
  capitalShareCount = formData.capitalShareCount, capitalShareValue = formData.capitalShareValue, activities = formData.activities, capitalPaid = formData.capitalPaid;
366
+ entityData = entityRes;
392
367
  hasCapitalShares = capitalShareCount || capitalShareValue;
393
368
  isCapitalNonEditable = (isCapitalPaidNonEditable && isCapitalShareCountNonEditable && isCapitalShareValueNonEditable) || (!capitalPaid && !hasCapitalShares);
394
369
  removedActivities = (activities === null || activities === void 0 ? void 0 : activities.length) > 0 &&
395
370
  (entityActivities || []).filter(function (entityActivity) { return !(activities || []).some(function (activity) { return activity.id === entityActivity.id; }); });
396
- if (!(!isActivitiesNonEditable && (removedActivities === null || removedActivities === void 0 ? void 0 : removedActivities.length) > 0)) return [3, 2];
371
+ if (!(!isActivitiesNonEditable && (removedActivities === null || removedActivities === void 0 ? void 0 : removedActivities.length) > 0 && isDirty)) return [3, 2];
397
372
  payload_1 = {
398
373
  id: id,
399
374
  activities: removedActivities.map(function (a) { return ({
@@ -402,8 +377,8 @@ export var updateEntityCapital = createAsyncThunk('entityUpdateEntityCapital', f
402
377
  };
403
378
  return [4, API.entityService.removeEntityActivities(payload_1)];
404
379
  case 1:
405
- _g.sent();
406
- _g.label = 2;
380
+ _f.sent();
381
+ _f.label = 2;
407
382
  case 2:
408
383
  activityIds = (activities || []).map(function (_a) {
409
384
  var id = _a.id;
@@ -417,44 +392,61 @@ export var updateEntityCapital = createAsyncThunk('entityUpdateEntityCapital', f
417
392
  }
418
393
  }))
419
394
  }));
395
+ if (!isDirty) return [3, 4];
420
396
  return [4, API.entityService.updateEntity(payload)];
421
397
  case 3:
422
- data = _g.sent();
398
+ entity_3 = (_f.sent()).entity;
399
+ entityData = entity_3;
400
+ _f.label = 4;
401
+ case 4:
423
402
  thunkApi.dispatch(handleNextScreenStep());
424
- (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, id);
425
- return [2, { data: data, formData: originalFormData }];
403
+ (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, id);
404
+ return [2, { data: entityData, formData: originalFormData }];
426
405
  }
427
406
  });
428
407
  });
429
408
  });
430
409
  export var updateBoardSuccess = createAsyncThunk('updateBoardEntitySuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
431
- var _a, settings, entity, _b, id, infoId, payload, data, boardInfoData;
432
- var _c, _d, _e, _f;
433
- return __generator(this, function (_g) {
434
- switch (_g.label) {
410
+ var _a, settings, entity, _b, board_id, infoId, _c, showBoard, mode, payload, data, _d, id, type, boardInfoStatusData;
411
+ var _e, _f, _g, _h, _j, _k, _l, _m, _o;
412
+ return __generator(this, function (_p) {
413
+ switch (_p.label) {
435
414
  case 0:
436
415
  _a = thunkApi.getState(), settings = _a.settings, entity = _a.entity;
437
- _b = entity.data.verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id;
438
- if (!id)
416
+ _b = entity.data.verify.responseBody || {}, board_id = _b.board_id, infoId = _b.board_info_id;
417
+ _c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
418
+ if (!board_id)
439
419
  return [2];
440
420
  payload = {
441
421
  lang: settings.data.language,
442
422
  step_name: ENTITY_STEP_NAMES.ENTITY_SUCCESS,
443
- id: id
423
+ id: board_id
444
424
  };
445
- return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
425
+ return [4, API.boardService.updateBoardInfo(__assign({ id: board_id, infoId: infoId }, payload))];
446
426
  case 1:
447
- data = _g.sent();
448
- return [4, API.boardService.retrieveBoardInfoStatus(id)];
427
+ data = _p.sent();
428
+ sendCustomEventToGTM({
429
+ event: 'Send Event',
430
+ event_category: 'Board Flows - Entity',
431
+ event_action: 'Entity Update Success Page',
432
+ event_label: settings.data.businessCountry.iso2
433
+ });
434
+ if (!showBoard && mode === 'content') {
435
+ (_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
436
+ (_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, { data: data });
437
+ return [2, { data: data }];
438
+ }
439
+ _d = ((_j = data === null || data === void 0 ? void 0 : data.notification) === null || _j === void 0 ? void 0 : _j.recipient) || {}, id = _d.id, type = _d.type;
440
+ return [4, Promise.all([
441
+ API.boardService.retrieveBoardInfoStatus(board_id),
442
+ thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
443
+ ])];
449
444
  case 2:
450
- boardInfoData = _g.sent();
451
- return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
452
- case 3:
453
- _g.sent();
454
- (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, {});
455
- (_f = (_e = settings.data.appConfig).onFlowCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, { data: data });
445
+ boardInfoStatusData = (_p.sent())[0];
446
+ (_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, {});
447
+ (_o = (_m = settings.data.appConfig).onFlowCompleted) === null || _o === void 0 ? void 0 : _o.call(_m, { data: data });
456
448
  thunkApi.dispatch(handleNextScreenStep());
457
- return [2, { response: __assign(__assign({}, data), { flows: (boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.info) || [] }), formData: params }];
449
+ return [2, { data: data, flows: (boardInfoStatusData === null || boardInfoStatusData === void 0 ? void 0 : boardInfoStatusData.info) || [] }];
458
450
  }
459
451
  });
460
452
  }); });
@@ -480,7 +472,6 @@ var initialState = {
480
472
  uploadingArticle: false,
481
473
  data: {
482
474
  flowName: FlowsTypes.ENTITY,
483
- currency: '',
484
475
  verify: {
485
476
  token: ''
486
477
  },
@@ -535,28 +526,22 @@ export var entitySlice = createSlice({
535
526
  state.customLoading = true;
536
527
  })
537
528
  .addCase(verifyLeadToken.fulfilled, function (state, action) {
538
- var _a, _b, _c, _d;
529
+ var _a, _b, _c;
539
530
  state.error = null;
540
531
  state.customLoading = false;
541
- var _e = action.payload, data = _e.data, token = _e.token, boardResponse = _e.boardResponse, individualData = _e.individualData;
542
- var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
543
- if (description) {
544
- state.error = description;
545
- return;
546
- }
547
- state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), boardResponse), { board_id: data.id, individualData: individualData });
532
+ var _d = action.payload, data = _d.data, token = _d.token, entity = _d.entityData, entityTypes = _d.entityTypes;
533
+ state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { entity: entity, entityTypes: entityTypes, board_id: data.id });
548
534
  state.data.verify.token = token;
549
- var _f = boardResponse || {}, entity = _f.entity, entityTypes = _f.entityTypes;
550
535
  if (entity) {
551
- var _g = entity || {}, license = _g.license, type = _g.type, capital = _g.capital, activities = _g.activities, legal_name = _g.legal_name;
536
+ var _e = entity || {}, license = _e.license, type = _e.type, capital = _e.capital, activities = _e.activities, legal_name = _e.legal_name;
552
537
  var legalName = legal_name;
553
538
  var licenseNumber = license === null || license === void 0 ? void 0 : license.number;
554
- var unifiedNumber = (_b = license === null || license === void 0 ? void 0 : license.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number;
539
+ var unifiedNumber = (_a = license === null || license === void 0 ? void 0 : license.additional_info) === null || _a === void 0 ? void 0 : _a.unified_number;
555
540
  var licenseType = (license === null || license === void 0 ? void 0 : license.type) === 'freelance' ? BusinessType.FL : BusinessType.CR;
556
541
  var entityType = type || (entityTypes === null || entityTypes === void 0 ? void 0 : entityTypes[0]);
557
- var _h = capital || {}, paid = _h.paid, shares = _h.shares;
558
- var entityIssueDate = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.issuing_date;
559
- var entityExpiredDate = (_d = entity === null || entity === void 0 ? void 0 : entity.license) === null || _d === void 0 ? void 0 : _d.expiry_date;
542
+ var _f = capital || {}, paid = _f.paid, shares = _f.shares;
543
+ var entityIssueDate = (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date;
544
+ var entityExpiredDate = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.expiry_date;
560
545
  var issuingDate = void 0, expiryDate = undefined;
561
546
  if (entityIssueDate) {
562
547
  var date = new Date(entityIssueDate);
@@ -616,28 +601,22 @@ export var entitySlice = createSlice({
616
601
  state.error = null;
617
602
  })
618
603
  .addCase(verifyEntityLeadOTP.fulfilled, function (state, action) {
619
- var _a, _b, _c, _d;
604
+ var _a, _b, _c;
620
605
  state.loading = false;
621
606
  state.error = null;
622
- var _e = action.payload, data = _e.data, boardResponse = _e.boardResponse, formData = _e.formData, individualData = _e.individualData;
623
- var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
624
- if (description) {
625
- state.error = description;
626
- return;
627
- }
607
+ var _d = action.payload, data = _d.data, entity = _d.entityData, entityTypes = _d.entityTypes, formData = _d.formData;
628
608
  state.data.otpData = formData;
629
609
  state.data.otpData.responseBody = data;
630
- state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), boardResponse), { individualData: individualData });
631
- var _f = boardResponse || {}, entity = _f.entity, entityTypes = _f.entityTypes;
632
- var _g = entity || {}, license = _g.license, type = _g.type, capital = _g.capital, activities = _g.activities, legal_name = _g.legal_name;
610
+ state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { entity: entity, entityTypes: entityTypes });
611
+ var _e = entity || {}, license = _e.license, type = _e.type, capital = _e.capital, activities = _e.activities, legal_name = _e.legal_name;
633
612
  var legalName = legal_name;
634
613
  var licenseNumber = license === null || license === void 0 ? void 0 : license.number;
635
- var unifiedNumber = (_b = license === null || license === void 0 ? void 0 : license.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number;
614
+ var unifiedNumber = (_a = license === null || license === void 0 ? void 0 : license.additional_info) === null || _a === void 0 ? void 0 : _a.unified_number;
636
615
  var licenseType = (license === null || license === void 0 ? void 0 : license.type) === 'freelance' ? BusinessType.FL : BusinessType.CR;
637
616
  var entityType = type || (entityTypes === null || entityTypes === void 0 ? void 0 : entityTypes[0]);
638
- var _h = capital || {}, paid = _h.paid, shares = _h.shares;
639
- var entityIssueDate = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.issuing_date;
640
- var entityExpiredDate = (_d = entity === null || entity === void 0 ? void 0 : entity.license) === null || _d === void 0 ? void 0 : _d.expiry_date;
617
+ var _f = capital || {}, paid = _f.paid, shares = _f.shares;
618
+ var entityIssueDate = (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date;
619
+ var entityExpiredDate = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.expiry_date;
641
620
  var issuingDate, expiryDate = undefined;
642
621
  if (entityIssueDate) {
643
622
  var date = new Date(entityIssueDate);
@@ -679,18 +658,15 @@ export var entitySlice = createSlice({
679
658
  state.error = null;
680
659
  })
681
660
  .addCase(updateEntityName.fulfilled, function (state, action) {
682
- var _a;
683
661
  state.loading = false;
684
662
  state.error = null;
685
- var _b = action.payload, data = _b.data, formData = _b.formData, currencyData = _b.currencyData;
686
- var _c = data || {}, activityList = _c.activityList, rest = __rest(_c, ["activityList"]);
687
- if ((_a = currencyData === null || currencyData === void 0 ? void 0 : currencyData.code) === null || _a === void 0 ? void 0 : _a.english)
688
- state.data.currency = currencyData.code.english;
663
+ var _a = action.payload, data = _a.data, formData = _a.formData;
664
+ var _b = data || {}, entity = _b.entity, activityList = _b.activityList, rest = __rest(_b, ["entity", "activityList"]);
689
665
  state.data.entityNameData = __assign(__assign({}, formData), { certificateId: undefined });
690
666
  state.data.entityNameData.responseBody = __assign(__assign({}, state.data.entityNameData.responseBody), { rest: rest });
691
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { entity: data === null || data === void 0 ? void 0 : data.entity, activityList: activityList });
692
- if (rest === null || rest === void 0 ? void 0 : rest.activities)
693
- state.data.entityCapitalData = __assign(__assign({}, state.data.entityCapitalData), { activities: rest === null || rest === void 0 ? void 0 : rest.activities });
667
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { entity: entity, activityList: activityList });
668
+ if (entity === null || entity === void 0 ? void 0 : entity.activities)
669
+ state.data.entityCapitalData = __assign(__assign({}, state.data.entityCapitalData), { activities: entity === null || entity === void 0 ? void 0 : entity.activities });
694
670
  })
695
671
  .addCase(updateEntityName.rejected, function (state, action) {
696
672
  state.loading = false;
@@ -718,7 +694,7 @@ export var entitySlice = createSlice({
718
694
  .addCase(retrieveBoardDetails.fulfilled, function (state, action) {
719
695
  state.error = null;
720
696
  state.loading = false;
721
- var data = (action.payload || {}).data;
697
+ var data = action.payload || {};
722
698
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
723
699
  })
724
700
  .addCase(retrieveBoardDetails.rejected, function (state, action) {
@@ -732,7 +708,7 @@ export var entitySlice = createSlice({
732
708
  .addCase(retrieveBoardStatus.fulfilled, function (state, action) {
733
709
  state.error = null;
734
710
  state.loading = false;
735
- var flows = action.payload.flows;
711
+ var flows = (action.payload || {}).flows;
736
712
  state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
737
713
  })
738
714
  .addCase(retrieveBoardStatus.rejected, function (state, action) {
@@ -743,18 +719,8 @@ export var entitySlice = createSlice({
743
719
  var _a;
744
720
  state.loading = false;
745
721
  state.error = null;
746
- var response = (action.payload || {}).response;
747
- var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
748
- if (description) {
749
- state.error = description;
750
- return;
751
- }
752
- var flows = response.flows;
753
- var _b = state.data.verify.responseBody || {}, individuals = _b.individuals, individualData = _b.individualData;
754
- var data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? individuals : individualData) || {}).data_state;
755
- state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { user: individualData })), (data_state && {
756
- individuals: __assign(__assign({}, individuals), { data_state: data_state })
757
- }));
722
+ var _b = action.payload || {}, flows = _b.flows, data = _b.data;
723
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, recipient: (_a = data === null || data === void 0 ? void 0 : data.notification) === null || _a === void 0 ? void 0 : _a.recipient });
758
724
  })
759
725
  .addCase(updateBoardSuccess.pending, function (state) {
760
726
  state.loading = true;