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

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 (314) hide show
  1. package/build/@types/app.d.ts +50 -20
  2. package/build/@types/app.js +9 -3
  3. package/build/@types/form.d.ts +21 -12
  4. package/build/api/auth.d.ts +28 -5
  5. package/build/api/auth.js +36 -1
  6. package/build/api/axios.js +2 -2
  7. package/build/api/brand.d.ts +2 -1
  8. package/build/api/brand.js +10 -1
  9. package/build/api/country.d.ts +3 -1
  10. package/build/api/country.js +3 -1
  11. package/build/api/data.d.ts +38 -7
  12. package/build/api/data.js +57 -17
  13. package/build/api/entity.d.ts +51 -5
  14. package/build/api/entity.js +39 -9
  15. package/build/api/firebase.d.ts +1 -1
  16. package/build/api/firebase.js +3 -1
  17. package/build/api/index.d.ts +44 -14
  18. package/build/api/individual.d.ts +76 -19
  19. package/build/api/individual.js +29 -2
  20. package/build/api/lead.d.ts +9 -6
  21. package/build/api/lead.js +8 -1
  22. package/build/app/rootReducer.d.ts +0 -1
  23. package/build/app/rootReducer.js +0 -2
  24. package/build/app/settings.d.ts +9 -2
  25. package/build/app/settings.js +22 -11
  26. package/build/app/store.d.ts +0 -2
  27. package/build/assets/locales/ar.json +258 -183
  28. package/build/assets/locales/en.json +190 -108
  29. package/build/components/AnimationFlow/AnimationFlow.d.ts +4 -1
  30. package/build/components/AnimationFlow/AnimationFlow.js +6 -8
  31. package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
  32. package/build/components/AnimationFlow/BottomSheet.js +4 -3
  33. package/build/components/AnimationFlow/Dialog.d.ts +4 -1
  34. package/build/components/AnimationFlow/Dialog.js +5 -3
  35. package/build/components/ArabicDatePicker/ArabicDatePicker.d.ts +13 -0
  36. package/build/components/ArabicDatePicker/ArabicDatePicker.js +94 -0
  37. package/build/components/ArabicDatePicker/index.d.ts +2 -0
  38. package/build/components/ArabicDatePicker/index.js +2 -0
  39. package/build/components/ArabicDatePicker/style.css +24 -0
  40. package/build/components/FileInput/DragAndDrop.d.ts +10 -1
  41. package/build/components/FileInput/DragAndDrop.js +108 -8
  42. package/build/components/Lottie/Lottie.d.ts +878 -0
  43. package/build/components/Lottie/Lottie.js +58 -0
  44. package/build/components/Lottie/files/pulsating_circle_waves.json +236 -0
  45. package/build/components/Lottie/files/success.json +425 -0
  46. package/build/components/Lottie/index.d.ts +3 -0
  47. package/build/components/Lottie/index.js +3 -0
  48. package/build/components/OTPField/OTPField.d.ts +2 -1
  49. package/build/components/OTPField/OTPField.js +2 -2
  50. package/build/components/OTPTimer/OTPTimer.js +1 -1
  51. package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -0
  52. package/build/components/ProgressBar/CircularProgressBar.js +48 -0
  53. package/build/components/ProgressBar/index.d.ts +2 -0
  54. package/build/components/ProgressBar/index.js +2 -0
  55. package/build/components/RadioLabel/RadioLabel.d.ts +2 -1
  56. package/build/components/RadioLabel/RadioLabel.js +2 -2
  57. package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +2 -6
  58. package/build/components/SocialMediaGroup/SocialMediaGroup.js +4 -49
  59. package/build/constants/api.d.ts +6 -0
  60. package/build/constants/api.js +14 -1
  61. package/build/constants/app.d.ts +5 -5
  62. package/build/constants/app.js +62 -32
  63. package/build/constants/assets.d.ts +14 -0
  64. package/build/constants/assets.js +16 -2
  65. package/build/constants/dummy.d.ts +1 -1
  66. package/build/constants/dummy.js +2 -2
  67. package/build/constants/validation.d.ts +10 -0
  68. package/build/constants/validation.js +11 -1
  69. package/build/features/app/auth/authStore.d.ts +30 -4
  70. package/build/features/app/auth/authStore.js +182 -20
  71. package/build/features/app/bank/bankStore.d.ts +16 -0
  72. package/build/features/app/bank/bankStore.js +88 -41
  73. package/build/features/app/business/businessStore.d.ts +33 -5
  74. package/build/features/app/business/businessStore.js +487 -350
  75. package/build/features/app/connect/connectStore.d.ts +34 -31
  76. package/build/features/app/connect/connectStore.js +427 -300
  77. package/build/features/app/entity/entityStore.d.ts +40 -8
  78. package/build/features/app/entity/entityStore.js +387 -149
  79. package/build/features/app/individual/individualStore.d.ts +18 -0
  80. package/build/features/app/individual/individualStore.js +168 -89
  81. package/build/features/app/password/passwordStore.d.ts +1 -7
  82. package/build/features/app/password/passwordStore.js +31 -20
  83. package/build/features/app/tax/taxStore.js +23 -16
  84. package/build/features/auth/Auth.d.ts +2 -1
  85. package/build/features/auth/Auth.js +37 -9
  86. package/build/features/auth/screens/NID/DOB.d.ts +7 -0
  87. package/build/features/auth/screens/NID/DOB.js +47 -0
  88. package/build/features/auth/screens/NID/IDNumber.d.ts +3 -0
  89. package/build/features/auth/screens/NID/IDNumber.js +64 -0
  90. package/build/features/auth/screens/NID/NID.d.ts +5 -0
  91. package/build/features/auth/screens/NID/NID.js +68 -0
  92. package/build/features/auth/screens/NID/TAC.d.ts +3 -0
  93. package/build/features/auth/screens/NID/TAC.js +87 -0
  94. package/build/features/auth/screens/NID/index.d.ts +3 -0
  95. package/build/features/auth/screens/NID/index.js +2 -0
  96. package/build/features/auth/screens/NID/validation.d.ts +27 -0
  97. package/build/features/auth/screens/NID/validation.js +19 -0
  98. package/build/features/auth/screens/OTP/OTP.js +8 -4
  99. package/build/features/auth/screens/OTP/OTPInput.js +9 -2
  100. package/build/features/bank/Bank.js +4 -4
  101. package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
  102. package/build/features/bank/screens/BankDetails/BankName.js +2 -1
  103. package/build/features/bank/screens/BankDetails/BankStatement.js +41 -8
  104. package/build/features/bank/screens/BankDetails/Beneficiary.js +10 -11
  105. package/build/features/bank/screens/BankDetails/IBAN.js +4 -1
  106. package/build/features/bank/screens/BankDetails/validation.js +2 -2
  107. package/build/features/bank/screens/Success/Success.js +7 -3
  108. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +16 -12
  109. package/build/features/business/Business.js +4 -4
  110. package/build/features/business/screens/Activities/Activities.js +16 -17
  111. package/build/features/business/screens/Activities/ActivitiesList.d.ts +37 -1
  112. package/build/features/business/screens/Activities/ActivitiesList.js +51 -12
  113. package/build/features/business/screens/Activities/OperationStartDate.d.ts +15 -1
  114. package/build/features/business/screens/Activities/OperationStartDate.js +21 -2
  115. package/build/features/business/screens/Activities/validation.d.ts +0 -51
  116. package/build/features/business/screens/Activities/validation.js +4 -10
  117. package/build/features/business/screens/BusinessType/BusinessType.js +20 -7
  118. package/build/features/business/screens/BusinessType/EntityName.d.ts +6 -0
  119. package/build/features/business/screens/BusinessType/EntityName.js +56 -0
  120. package/build/features/business/screens/BusinessType/LicenseCertificate.d.ts +6 -0
  121. package/build/features/business/screens/BusinessType/LicenseCertificate.js +76 -0
  122. package/build/features/business/screens/BusinessType/LicenseList.js +26 -7
  123. package/build/features/business/screens/BusinessType/LicenseNumber.js +12 -6
  124. package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
  125. package/build/features/business/screens/BusinessType/LicenseType.js +78 -0
  126. package/build/features/business/screens/BusinessType/validation.d.ts +19 -0
  127. package/build/features/business/screens/BusinessType/validation.js +52 -3
  128. package/build/features/business/screens/CivilID/CivilID.d.ts +5 -0
  129. package/build/features/business/screens/CivilID/CivilID.js +67 -0
  130. package/build/features/business/screens/CivilID/IDNumber.d.ts +7 -0
  131. package/build/features/business/screens/CivilID/IDNumber.js +59 -0
  132. package/build/features/business/screens/CivilID/index.d.ts +3 -0
  133. package/build/features/business/screens/CivilID/index.js +2 -0
  134. package/build/features/business/screens/CivilID/validation.d.ts +8 -0
  135. package/build/features/business/screens/CivilID/validation.js +4 -0
  136. package/build/features/business/screens/Customers/CustomerLocations.d.ts +15 -2
  137. package/build/features/business/screens/Customers/CustomerLocations.js +32 -8
  138. package/build/features/business/screens/Customers/Customers.js +15 -9
  139. package/build/features/business/screens/Customers/ExpectedCustomers.js +16 -4
  140. package/build/features/business/screens/Customers/ExpectedSalesRange.js +32 -14
  141. package/build/features/business/screens/Customers/RefundPolicy.js +8 -2
  142. package/build/features/business/screens/Customers/TransactionPolicy.js +8 -2
  143. package/build/features/business/screens/IDBOD/IDBOD.js +15 -2
  144. package/build/features/business/screens/OTP/OTP.js +15 -2
  145. package/build/features/business/screens/Success/Success.js +10 -3
  146. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -11
  147. package/build/features/business/screens/Verify/Verify.js +4 -4
  148. package/build/features/business/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  149. package/build/features/business/screens/VerifyPACI/VerifyPACI.js +159 -0
  150. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
  151. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +23 -0
  152. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  153. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  154. package/build/features/business/screens/VerifyPACI/index.d.ts +3 -0
  155. package/build/features/business/screens/VerifyPACI/index.js +2 -0
  156. package/build/features/connect/Connect.d.ts +1 -0
  157. package/build/features/connect/Connect.js +38 -10
  158. package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
  159. package/build/features/connect/screens/CivilID/CivilID.js +102 -0
  160. package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -0
  161. package/build/features/connect/screens/CivilID/IDNumber.js +59 -0
  162. package/build/features/connect/screens/CivilID/index.d.ts +3 -0
  163. package/build/features/connect/screens/CivilID/index.js +2 -0
  164. package/build/features/connect/screens/CivilID/validation.d.ts +8 -0
  165. package/build/features/connect/screens/CivilID/validation.js +4 -0
  166. package/build/features/connect/screens/Individual/Email.js +11 -3
  167. package/build/features/connect/screens/Individual/Individual.js +44 -28
  168. package/build/features/connect/screens/Merchant/BrandList.js +15 -7
  169. package/build/features/connect/screens/Merchant/BrandName.js +7 -4
  170. package/build/features/connect/screens/Merchant/Merchant.js +48 -65
  171. package/build/features/connect/screens/Merchant/SalesChannels.d.ts +4 -1
  172. package/build/features/connect/screens/Merchant/SalesChannels.js +28 -31
  173. package/build/features/connect/screens/Merchant/SocialMedia.d.ts +3 -4
  174. package/build/features/connect/screens/Merchant/SocialMedia.js +106 -112
  175. package/build/features/connect/screens/Merchant/TAC.js +8 -2
  176. package/build/features/connect/screens/Merchant/validation.d.ts +13 -123
  177. package/build/features/connect/screens/Merchant/validation.js +106 -173
  178. package/build/features/connect/screens/Mobile/Mobile.js +33 -12
  179. package/build/features/connect/screens/NID/NID.js +5 -1
  180. package/build/features/connect/screens/OTP/OTP.js +20 -6
  181. package/build/features/connect/screens/OTP/OTPInput.js +3 -2
  182. package/build/features/connect/screens/ThankYou/ThankYou.js +8 -2
  183. package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  184. package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +159 -0
  185. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +6 -0
  186. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +23 -0
  187. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  188. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  189. package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -0
  190. package/build/features/connect/screens/VerifyPACI/index.js +2 -0
  191. package/build/features/entity/Entity.js +6 -6
  192. package/build/features/entity/screens/Customers/CustomerLocations.d.ts +118 -0
  193. package/build/features/entity/screens/Customers/CustomerLocations.js +171 -0
  194. package/build/features/entity/screens/Customers/Customers.d.ts +5 -0
  195. package/build/features/entity/screens/Customers/Customers.js +90 -0
  196. package/build/features/entity/screens/Customers/ExpectedCustomers.d.ts +8 -0
  197. package/build/features/entity/screens/Customers/ExpectedCustomers.js +98 -0
  198. package/build/features/entity/screens/Customers/ExpectedSalesRange.d.ts +8 -0
  199. package/build/features/entity/screens/Customers/ExpectedSalesRange.js +127 -0
  200. package/build/features/entity/screens/Customers/RefundPolicy.d.ts +36 -0
  201. package/build/features/entity/screens/Customers/RefundPolicy.js +84 -0
  202. package/build/features/entity/screens/Customers/TransactionPolicy.d.ts +3 -0
  203. package/build/features/entity/screens/Customers/TransactionPolicy.js +44 -0
  204. package/build/features/entity/screens/Customers/index.d.ts +3 -0
  205. package/build/features/entity/screens/Customers/index.js +2 -0
  206. package/build/features/entity/screens/Customers/validation.d.ts +20 -0
  207. package/build/features/entity/screens/Customers/validation.js +13 -0
  208. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +2 -1
  209. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +25 -15
  210. package/build/features/entity/screens/EntityInfoConfirm/Article.d.ts +3 -0
  211. package/build/features/entity/screens/EntityInfoConfirm/Article.js +73 -0
  212. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +38 -10
  213. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +20 -5
  214. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +2 -1
  215. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +34 -5
  216. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +13 -18
  217. package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +75 -41
  218. package/build/features/entity/screens/EntityInfoConfirm/validation.js +76 -10
  219. package/build/features/entity/screens/Success/Success.js +7 -3
  220. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +11 -10
  221. package/build/features/entity/screens/Verify/Verify.js +18 -5
  222. package/build/features/featuresScreens.d.ts +0 -1
  223. package/build/features/featuresScreens.js +30 -7
  224. package/build/features/individual/Individual.js +4 -4
  225. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +18 -25
  226. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +15 -3
  227. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +11 -3
  228. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +2 -2
  229. package/build/features/individual/screens/Success/Success.js +7 -3
  230. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +16 -12
  231. package/build/features/individual/screens/Verify/Verify.js +18 -5
  232. package/build/features/password/Password.js +4 -4
  233. package/build/features/password/screens/CreatePassword/CreatePassword.js +16 -3
  234. package/build/features/password/screens/OTP/OTP.js +15 -2
  235. package/build/features/password/screens/Success/Success.js +7 -3
  236. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +16 -13
  237. package/build/features/password/screens/Verify/Verify.js +16 -3
  238. package/build/features/shared/Background/Background.d.ts +2 -5
  239. package/build/features/shared/Background/Background.js +7 -3
  240. package/build/features/shared/Button/Button.js +1 -0
  241. package/build/features/shared/Button/EmailProvidersButtons.d.ts +2 -1
  242. package/build/features/shared/Button/EmailProvidersButtons.js +7 -2
  243. package/build/features/shared/Button/MobileButton.d.ts +2 -1
  244. package/build/features/shared/Button/MobileButton.js +2 -2
  245. package/build/features/shared/Dialog/CloseDialog.d.ts +11 -0
  246. package/build/features/shared/Dialog/CloseDialog.js +71 -0
  247. package/build/features/shared/Dialog/DialogContainer.d.ts +8 -0
  248. package/build/features/shared/Dialog/DialogContainer.js +56 -0
  249. package/build/features/shared/Dialog/index.d.ts +4 -0
  250. package/build/features/shared/Dialog/index.js +4 -0
  251. package/build/features/shared/Input/Input.d.ts +1 -1
  252. package/build/features/shared/Input/Input.js +2 -2
  253. package/build/features/shared/SuccessScreen/SuccessScreen.d.ts +1 -1
  254. package/build/features/shared/SuccessScreen/SuccessScreen.js +3 -2
  255. package/build/features/shared/UploadFile/UploadFile.d.ts +10 -3
  256. package/build/features/shared/UploadFile/UploadFile.js +24 -9
  257. package/build/features/signIn/SignIn.js +4 -4
  258. package/build/features/signIn/screens/Email/Email.js +4 -2
  259. package/build/features/signIn/screens/Mobile/Mobile.js +5 -1
  260. package/build/features/signIn/screens/OTP/OTP.js +14 -1
  261. package/build/features/signIn/screens/Password/Password.js +15 -2
  262. package/build/features/tax/Tax.js +6 -6
  263. package/build/features/tax/screens/Success/Success.js +9 -3
  264. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +15 -11
  265. package/build/features/tax/screens/TaxDetails/TaxDetails.js +16 -3
  266. package/build/features/tax/screens/Verify/Verify.js +16 -3
  267. package/build/hooks/index.d.ts +2 -0
  268. package/build/hooks/index.js +2 -0
  269. package/build/hooks/useAppConfig.d.ts +3 -1
  270. package/build/hooks/useAppConfig.js +2 -2
  271. package/build/hooks/useAppDispatch.d.ts +0 -1
  272. package/build/hooks/useErrorListener.js +0 -6
  273. package/build/hooks/useScreen.d.ts +3 -0
  274. package/build/hooks/useScreen.js +14 -0
  275. package/build/hooks/useSetFromDefaultValues.d.ts +2 -0
  276. package/build/hooks/useSetFromDefaultValues.js +24 -0
  277. package/build/index.d.ts +2 -3
  278. package/build/index.js +1 -4
  279. package/build/utils/array.d.ts +50 -1
  280. package/build/utils/array.js +66 -0
  281. package/build/utils/common.d.ts +1 -0
  282. package/build/utils/common.js +3 -0
  283. package/build/utils/date.d.ts +1 -0
  284. package/build/utils/date.js +5 -0
  285. package/build/utils/device.d.ts +1 -0
  286. package/build/utils/device.js +13 -0
  287. package/build/utils/index.d.ts +2 -0
  288. package/build/utils/index.js +2 -0
  289. package/build/utils/locale.js +1 -1
  290. package/build/utils/object.d.ts +1 -0
  291. package/build/utils/object.js +12 -0
  292. package/build/utils/string.d.ts +14 -0
  293. package/build/utils/string.js +85 -3
  294. package/build/utils/validation.d.ts +2 -0
  295. package/build/utils/validation.js +6 -0
  296. package/package.json +4 -3
  297. package/build/features/app/otp/otpStore.d.ts +0 -28
  298. package/build/features/app/otp/otpStore.js +0 -153
  299. package/build/features/business/screens/Activities/SalesChannels.d.ts +0 -5
  300. package/build/features/business/screens/Activities/SalesChannels.js +0 -112
  301. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.d.ts +0 -5
  302. package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.js +0 -112
  303. package/build/features/otp/OTP.d.ts +0 -7
  304. package/build/features/otp/OTP.js +0 -58
  305. package/build/features/otp/index.d.ts +0 -0
  306. package/build/features/otp/index.js +0 -1
  307. package/build/features/otp/screens/OTPVerify/OTPInput.d.ts +0 -6
  308. package/build/features/otp/screens/OTPVerify/OTPInput.js +0 -47
  309. package/build/features/otp/screens/OTPVerify/Verify.d.ts +0 -5
  310. package/build/features/otp/screens/OTPVerify/Verify.js +0 -49
  311. package/build/features/otp/screens/OTPVerify/index.d.ts +0 -2
  312. package/build/features/otp/screens/OTPVerify/index.js +0 -2
  313. package/build/features/otp/screens/OTPVerify/validation.d.ts +0 -8
  314. package/build/features/otp/screens/OTPVerify/validation.js +0 -4
@@ -9,9 +9,20 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
12
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
24
  import * as React from 'react';
14
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
25
+ import { useAppDispatch, useAppSelector, useSetFromDefaultValues } from '../../../../hooks';
15
26
  import { useTranslation } from 'react-i18next';
16
27
  import { useForm, FormProvider } from 'react-hook-form';
17
28
  import { yupResolver } from '@hookform/resolvers/yup';
@@ -50,11 +61,13 @@ var OTP = function (_a) {
50
61
  var _b, _c;
51
62
  var _d = useAppSelector(passwordSelector), data = _d.data, loading = _d.loading, error = _d.error;
52
63
  var dispatch = useAppDispatch();
64
+ var _e = data.otpData, responseBody = _e.responseBody, defaultValues = __rest(_e, ["responseBody"]);
53
65
  var methods = useForm({
54
66
  resolver: yupResolver(OTPValidation),
55
- defaultValues: data.otpData,
67
+ defaultValues: defaultValues,
56
68
  mode: 'onChange'
57
69
  });
70
+ useSetFromDefaultValues(methods, defaultValues);
58
71
  var t = useTranslation().t;
59
72
  var isAr = useLanguage().isAr;
60
73
  React.useEffect(function () {
@@ -8,15 +8,19 @@ import { PASSWORD_OPERATION_TYPE } from '../../../../constants';
8
8
  var Success = function (_a) {
9
9
  var t = useTranslation().t;
10
10
  var dispatch = useAppDispatch();
11
- var _b = useAppSelector(passwordSelector), loading = _b.loading, error = _b.error, data = _b.data;
11
+ var _b = useAppSelector(passwordSelector), error = _b.error, loading = _b.loading, data = _b.data;
12
12
  var operationType = data.verify.operationType;
13
- var onSuccess = function () {
13
+ var _c = React.useState(false), clicked = _c[0], setClicked = _c[1];
14
+ React.useEffect(function () {
14
15
  if (operationType === PASSWORD_OPERATION_TYPE.RESET_PASSWORD) {
15
16
  dispatch(retrieveBoardResetPasswordSuccess());
16
17
  return;
17
18
  }
18
19
  dispatch(updateBoardSuccess());
20
+ }, []);
21
+ var onSuccess = function () {
22
+ setClicked(true);
19
23
  };
20
- return (_jsx(SuccessScreen, { title: t('password_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: loading, error: error || '' }));
24
+ return (_jsx(SuccessScreen, { title: t('password_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: clicked && loading, error: error || '' }));
21
25
  };
22
26
  export default React.memo(Success);
@@ -16,7 +16,7 @@ import { styled } from '@mui/material/styles';
16
16
  import { FlowsButtons } from '../../../shared/Button';
17
17
  import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
18
18
  import { useAppSelector, useLanguage } from '../../../../hooks';
19
- import { getResetFlowUrl, showLastFour } from '../../../../utils';
19
+ import { getResetFlowUrl, showLastFour, concatenateObjectValues, shortenBankName } from '../../../../utils';
20
20
  import { passwordSelector } from '../../../app/password/passwordStore';
21
21
  import Box from '@mui/material/Box';
22
22
  import Text from '../../../../components/Text';
@@ -44,24 +44,27 @@ var ButtonGroupStyled = styled(Box)(function (_a) {
44
44
  });
45
45
  });
46
46
  var SuccessWithFlowButtons = function () {
47
- var _a, _b, _c;
47
+ var _a, _b, _c, _d;
48
48
  var t = useTranslation().t;
49
49
  var isAr = useLanguage().isAr;
50
50
  var data = useAppSelector(passwordSelector).data;
51
- var _d = data.verify.responseBody || {}, flows = _d.flows, nameObj = _d.name, entity = _d.entity, brand = _d.brand, bank = _d.bank_account, merchant = _d.merchant, identification_id = _d.identification_id;
52
- var _e = useState([]), buttons = _e[0], setButtons = _e[1];
53
- var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
51
+ var _e = data.verify.responseBody || {}, flows = _e.flows, nameObj = _e.name, entity = _e.entity, brand = _e.brand, bank = _e.bank_account, merchant = _e.merchant, user = _e.user;
52
+ var _f = useState([]), buttons = _f[0], setButtons = _f[1];
53
+ var _g = nameObj || {}, en = _g.en, ar = _g.ar;
54
+ var username = isAr
55
+ ? concatenateObjectValues(ar || en, ['first', 'last'])
56
+ : concatenateObjectValues(en, ['first', 'last']);
54
57
  var licenseNumber = ((_a = entity === null || entity === void 0 ? void 0 : entity.license) === null || _a === void 0 ? void 0 : _a.number) || '';
55
- var bankName = (bank === null || bank === void 0 ? void 0 : bank.bank_name) || t('bank');
58
+ var bankName = shortenBankName(bank === null || bank === void 0 ? void 0 : bank.bank_name) || t('bank');
56
59
  var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
57
- var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
60
+ var taxID = (entity === null || entity === void 0 ? void 0 : entity.vat_id) || '';
58
61
  var brandName = (isAr ? (_b = brand === null || brand === void 0 ? void 0 : brand.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = brand === null || brand === void 0 ? void 0 : brand.name) === null || _c === void 0 ? void 0 : _c.en) || '';
59
62
  var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
60
63
  var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
61
- var maskedId = !!identification_id ? " ".concat(t('masking_symbols')).concat(identification_id) : '';
62
- console.log(username);
64
+ var identification = user.identification;
65
+ var maskedId = (identification === null || identification === void 0 ? void 0 : identification.id) ? " ".concat(t('masking_symbols')).concat((_d = identification === null || identification === void 0 ? void 0 : identification.id) === null || _d === void 0 ? void 0 : _d.slice(-2)) : '';
63
66
  var settings = useAppSelector(settingsSelector);
64
- var _f = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _f.contact, board_id = _f.board_id, board_info_id = _f.board_info_id;
67
+ var _h = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _h.contact, board_id = _h.board_id, board_info_id = _h.board_info_id;
65
68
  var email = (contact || { email: '' }).email;
66
69
  var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, board_id, board_info_id);
67
70
  var reMapFlowData = function (flows) {
@@ -75,10 +78,10 @@ var SuccessWithFlowButtons = function () {
75
78
  var title = t("".concat(name, "_flow_").concat(type), {
76
79
  individual_name: username.toLowerCase() + maskedId,
77
80
  business_type: brandName,
78
- license_number: t('masking_symbols') + showLastFour(licenseNumber),
81
+ license_number: licenseNumber ? t('masking_symbols') + showLastFour(licenseNumber) : '',
79
82
  bank_name: bankName,
80
- iban: t('masking_symbols') + iban,
81
- tax_id: t('masking_symbols') + showLastFour(taxID)
83
+ iban: iban ? t('masking_symbols') + iban : '',
84
+ tax_id: taxID ? t('masking_symbols') + showLastFour(taxID) : ''
82
85
  });
83
86
  var isCompleted = status === 'completed' && name !== 'password';
84
87
  var isIndividual = name === 'individual';
@@ -9,9 +9,20 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
12
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
24
  import * as React from 'react';
14
- import { useAppDispatch } from '../../../../hooks';
25
+ import { useAppDispatch, useSetFromDefaultValues } from '../../../../hooks';
15
26
  import { useTranslation } from 'react-i18next';
16
27
  import { useForm, FormProvider } from 'react-hook-form';
17
28
  import { yupResolver } from '@hookform/resolvers/yup';
@@ -50,14 +61,16 @@ var VerifyNumber = function (_a) {
50
61
  var _b, _c, _d;
51
62
  var dispatch = useAppDispatch();
52
63
  var _e = useAppSelector(passwordSelector), data = _e.data, loading = _e.loading, error = _e.error;
64
+ var _f = data.otpData, responseBody = _f.responseBody, defaultValues = __rest(_f, ["responseBody"]);
53
65
  var methods = useForm({
54
66
  resolver: yupResolver(OTPValidation),
55
- defaultValues: data.otpData,
67
+ defaultValues: defaultValues,
56
68
  mode: 'onChange'
57
69
  });
70
+ useSetFromDefaultValues(methods, defaultValues);
58
71
  var t = useTranslation().t;
59
72
  var isAr = useLanguage().isAr;
60
- var _f = React.useState(false), resendLoading = _f[0], setResendLoading = _f[1];
73
+ var _g = React.useState(false), resendLoading = _g[0], setResendLoading = _g[1];
61
74
  var phone = (_d = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.contact) === null || _c === void 0 ? void 0 : _c.phone) === null || _d === void 0 ? void 0 : _d.number;
62
75
  React.useEffect(function () {
63
76
  if (error && methods.formState.isValid && phone)
@@ -1,15 +1,12 @@
1
1
  import React from 'react';
2
2
  import { SxProps, Theme } from '@mui/material/styles';
3
- declare type TapOrigin = {
4
- isTapOrigin: boolean;
5
- open: boolean;
6
- };
7
- interface BackgroundProps extends TapOrigin {
3
+ interface BackgroundProps {
8
4
  children: React.ReactNode;
9
5
  loading?: boolean;
10
6
  hideLogo?: boolean;
11
7
  sx?: SxProps<Theme>;
12
8
  open: boolean;
9
+ isTapOrigin: boolean;
13
10
  }
14
11
  declare const _default: React.MemoExoticComponent<({ children, isTapOrigin, loading, hideLogo, sx, open }: BackgroundProps) => JSX.Element>;
15
12
  export default _default;
@@ -15,13 +15,16 @@ import { styled } from '@mui/material/styles';
15
15
  import Box from '@mui/material/Box';
16
16
  import LogoBackground from './LogoBackground';
17
17
  import { BACKGROUND_ID } from '../../../constants';
18
+ import { useScreen } from '../../../hooks';
18
19
  var BackgroundStyled = styled(Box, {
19
- shouldForwardProp: function (prop) { return !['isTapOrigin', 'open'].includes(prop); }
20
+ shouldForwardProp: function (prop) { return !['isTapOrigin', 'open', 'isSmall'].includes(prop); }
20
21
  })(function (_a) {
21
- var isTapOrigin = _a.isTapOrigin, open = _a.open;
22
+ var isTapOrigin = _a.isTapOrigin, open = _a.open, isSmall = _a.isSmall;
22
23
  return ({
23
24
  width: '100vw',
24
25
  height: '100vh',
26
+ zIndex: isSmall ? 'auto' : 999,
27
+ position: 'absolute',
25
28
  background: !open
26
29
  ? 'inherit'
27
30
  : isTapOrigin
@@ -32,6 +35,7 @@ var BackgroundStyled = styled(Box, {
32
35
  var Background = function (_a) {
33
36
  var children = _a.children, isTapOrigin = _a.isTapOrigin, loading = _a.loading, hideLogo = _a.hideLogo, sx = _a.sx, open = _a.open;
34
37
  var showLogo = !loading && isTapOrigin;
35
- return (_jsxs(BackgroundStyled, __assign({ id: BACKGROUND_ID, isTapOrigin: isTapOrigin, sx: sx, open: open }, { children: [showLogo && !hideLogo && _jsx(LogoBackground, {}), children] })));
38
+ var small = useScreen().small;
39
+ return (_jsxs(BackgroundStyled, __assign({ id: BACKGROUND_ID, isSmall: small, isTapOrigin: isTapOrigin, sx: sx, open: open }, { children: [showLogo && !hideLogo && _jsx(LogoBackground, {}), children] })));
36
40
  };
37
41
  export default memo(Background);
@@ -54,6 +54,7 @@ var ButtonBoxStyled = styled(Box)(function (_a) {
54
54
  return ({
55
55
  margin: theme.spacing(0, 2.5, 2.5, 2.5),
56
56
  marginBlockStart: theme.spacing(5),
57
+ maxHeight: theme.spacing(5.375),
57
58
  display: 'flex',
58
59
  alignItems: 'center',
59
60
  justifyContent: 'center'
@@ -8,6 +8,7 @@ export interface EmailProvidersButtonsProps extends ButtonProps {
8
8
  gmail: buttonProps;
9
9
  outlook: buttonProps;
10
10
  apple: buttonProps;
11
+ mail: buttonProps;
11
12
  }
12
- export default function EmailProvidersButtons({ gmail, outlook, apple }: EmailProvidersButtonsProps): JSX.Element;
13
+ export default function EmailProvidersButtons({ gmail, outlook, apple, mail }: EmailProvidersButtonsProps): JSX.Element;
13
14
  export {};
@@ -10,11 +10,13 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import React from 'react';
13
14
  import Button from '../../../components/Button';
14
15
  import { styled } from '@mui/material/styles';
15
16
  import Box from '@mui/material/Box';
16
17
  import Link from '@mui/material/Link';
17
18
  import { ICONS_NAMES } from '../../../constants';
19
+ import { getBrowserInfo } from '../../../utils';
18
20
  var Image = styled('img')(function (_a) {
19
21
  var theme = _a.theme;
20
22
  return ({
@@ -57,6 +59,9 @@ var AppleButtonStyled = styled(Button)(function (_a) {
57
59
  });
58
60
  });
59
61
  export default function EmailProvidersButtons(_a) {
60
- var gmail = _a.gmail, outlook = _a.outlook, apple = _a.apple;
61
- return (_jsxs(ButtonBoxStyled, { children: [_jsx(Link, __assign({ href: gmail.href, underline: 'none', target: '_blank' }, { children: _jsx(GMailButtonStyled, __assign({ variant: 'outlined', startIcon: _jsx(Image, { src: ICONS_NAMES.GMAIL_Filled_ICON, alt: gmail.title }), type: 'button' }, { children: gmail.title })) })), _jsx(Link, __assign({ href: apple.href, underline: 'none', target: '_blank' }, { children: _jsx(AppleButtonStyled, __assign({ variant: 'outlined', startIcon: _jsx(Image, { src: ICONS_NAMES.Apple_Filled_ICON, alt: apple.title }), type: 'button' }, { children: apple.title })) })), _jsx(Link, __assign({ href: outlook.href, underline: 'none', target: '_blank' }, { children: _jsx(OutlookButtonStyled, __assign({ variant: 'outlined', startIcon: _jsx(Image, { src: ICONS_NAMES.outlook_Filled_ICON, alt: outlook.title }), type: 'button' }, { children: outlook.title })) }))] }));
62
+ var _b;
63
+ var gmail = _a.gmail, outlook = _a.outlook, apple = _a.apple, mail = _a.mail;
64
+ var os = getBrowserInfo().os;
65
+ var _c = React.useState(false), hoverApple = _c[0], setHoverApple = _c[1];
66
+ return (_jsxs(ButtonBoxStyled, { children: [_jsx(Link, __assign({ href: gmail.href, underline: 'none', target: '_blank' }, { children: _jsx(GMailButtonStyled, __assign({ variant: 'outlined', startIcon: _jsx(Image, { src: ICONS_NAMES.GMAIL_Filled_ICON, alt: gmail.title }), type: 'button' }, { children: gmail.title })) })), ((_b = os === null || os === void 0 ? void 0 : os.name) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'windows' ? (_jsx(Link, __assign({ href: mail.href, underline: 'none', target: '_blank' }, { children: _jsx(OutlookButtonStyled, __assign({ variant: 'outlined', onMouseDown: function () { return setHoverApple(true); }, onMouseUp: function () { return setHoverApple(false); }, startIcon: _jsx(Image, { src: ICONS_NAMES.Mail_Filled_icon, alt: outlook.title }), type: 'button' }, { children: mail.title })) }))) : (_jsx(Link, __assign({ href: apple.href, underline: 'none', target: '_blank' }, { children: _jsx(AppleButtonStyled, __assign({ variant: 'outlined', onMouseEnter: function () { return setHoverApple(true); }, onMouseLeave: function () { return setHoverApple(false); }, startIcon: _jsx(Image, { src: hoverApple ? ICONS_NAMES.apple_white_icon : ICONS_NAMES.Apple_Filled_ICON, alt: apple.title }), type: 'button' }, { children: apple.title })) }))), _jsx(Link, __assign({ href: outlook.href, underline: 'none', target: '_blank' }, { children: _jsx(OutlookButtonStyled, __assign({ variant: 'outlined', startIcon: _jsx(Image, { src: ICONS_NAMES.outlook_Filled_ICON, alt: outlook.title }), type: 'button' }, { children: outlook.title })) }))] }));
62
67
  }
@@ -3,6 +3,7 @@ import { ButtonProps } from '../../../components/Button';
3
3
  interface MobileButtonProps extends ButtonProps {
4
4
  loading?: boolean;
5
5
  hideIcon?: boolean;
6
+ icon?: string;
6
7
  }
7
- export default function MobileButton({ children, hideIcon, disabled, ...props }: MobileButtonProps): JSX.Element;
8
+ export default function MobileButton({ children, hideIcon, icon, disabled, ...props }: MobileButtonProps): JSX.Element;
8
9
  export {};
@@ -39,6 +39,6 @@ var ButtonBoxStyled = styled(Box)(function (_a) {
39
39
  });
40
40
  });
41
41
  export default function MobileButton(_a) {
42
- var children = _a.children, hideIcon = _a.hideIcon, disabled = _a.disabled, props = __rest(_a, ["children", "hideIcon", "disabled"]);
43
- return (_jsx(ButtonBoxStyled, { children: _jsx(Button, __assign({ disabled: disabled, type: 'button', variant: 'outlined', startIcon: !hideIcon && _jsx(IconStyled, { disabled: disabled, src: ICONS_NAMES.MOBILE_ICON }) }, props, { children: children })) }));
42
+ var children = _a.children, hideIcon = _a.hideIcon, icon = _a.icon, disabled = _a.disabled, props = __rest(_a, ["children", "hideIcon", "icon", "disabled"]);
43
+ return (_jsx(ButtonBoxStyled, { children: _jsx(Button, __assign({ disabled: disabled, type: 'button', variant: 'outlined', startIcon: !hideIcon && _jsx(IconStyled, { disabled: disabled, src: !!icon ? icon : ICONS_NAMES.MOBILE_ICON }) }, props, { children: children })) }));
44
44
  }
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ interface CloseDialogStyledProps {
3
+ message?: string;
4
+ confirmTitle: string;
5
+ closeTitle: string;
6
+ open: boolean;
7
+ onConfirm?: () => void;
8
+ onCancel?: () => void;
9
+ }
10
+ export default function CloseDialog({ message, confirmTitle, closeTitle, open, onConfirm, onCancel }: CloseDialogStyledProps): JSX.Element;
11
+ export {};
@@ -0,0 +1,71 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
13
+ import { alpha, styled, useTheme } from '@mui/material/styles';
14
+ import Collapse from '../../../components/Collapse';
15
+ import Text from '../../../components/Text';
16
+ import Box from '@mui/material/Box';
17
+ var ConfirmCloseBox = styled(Box)(function (_a) {
18
+ var theme = _a.theme;
19
+ return ({
20
+ position: 'absolute',
21
+ backgroundColor: theme.palette.common.white,
22
+ borderRadius: theme.spacing(1),
23
+ height: theme.spacing(5.5),
24
+ display: 'flex',
25
+ justifyContent: 'space-between',
26
+ flexDirection: 'row',
27
+ alignItems: 'center',
28
+ zIndex: 20,
29
+ width: '100%',
30
+ bottom: theme.spacing(2.625),
31
+ paddingInlineStart: theme.spacing(2.25),
32
+ paddingInlineEnd: theme.spacing(2.25)
33
+ });
34
+ });
35
+ var DisableBoxStyled = styled(Box)(function (_a) {
36
+ var theme = _a.theme;
37
+ return ({
38
+ backgroundColor: alpha(theme.palette.common.black, 0.5),
39
+ zIndex: 10,
40
+ position: 'absolute',
41
+ top: 0,
42
+ left: 0,
43
+ width: '100%',
44
+ height: '100%',
45
+ borderRadius: theme.spacing(1.5)
46
+ });
47
+ });
48
+ var YesTextStyled = styled(Text)(function (_a) {
49
+ var theme = _a.theme;
50
+ return ({
51
+ color: theme.palette.primary.main,
52
+ cursor: 'pointer',
53
+ paddingInlineEnd: theme.spacing(2.5)
54
+ });
55
+ });
56
+ var NoTextStyled = styled(Text)(function (_a) {
57
+ var theme = _a.theme;
58
+ return ({
59
+ color: theme.palette.text.secondary,
60
+ cursor: 'pointer'
61
+ });
62
+ });
63
+ var ConfirmEnd = styled(Box)(function () { return ({
64
+ display: 'flex',
65
+ flexDirection: 'row'
66
+ }); });
67
+ export default function CloseDialog(_a) {
68
+ var message = _a.message, confirmTitle = _a.confirmTitle, closeTitle = _a.closeTitle, open = _a.open, onConfirm = _a.onConfirm, onCancel = _a.onCancel;
69
+ var theme = useTheme();
70
+ return (_jsxs(Collapse, __assign({ in: open }, { children: [_jsx(Box, __assign({ sx: { direction: theme.direction } }, { children: _jsxs(ConfirmCloseBox, { children: [_jsxs(Text, { children: [" ", message] }), _jsxs(ConfirmEnd, { children: [_jsx(YesTextStyled, __assign({ onClick: onConfirm }, { children: confirmTitle })), _jsx(NoTextStyled, __assign({ onClick: onCancel }, { children: closeTitle }))] })] }) })), _jsx(DisableBoxStyled, { id: 'disable-container' })] })));
71
+ }
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export interface DialogProps {
3
+ onClose?: () => void;
4
+ onConfirm?: () => void;
5
+ children: React.ReactElement;
6
+ isTapOrigin?: boolean;
7
+ }
8
+ export default function Dialog({ isTapOrigin, onClose, children, onConfirm }: DialogProps): JSX.Element;
@@ -0,0 +1,56 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import React from 'react';
14
+ import { styled } from '@mui/material/styles';
15
+ import { useTranslation } from 'react-i18next';
16
+ import Icon from '../../../components/Icon';
17
+ import Box from '@mui/material/Box';
18
+ import { ICONS_NAMES } from '../../../constants';
19
+ import CloseDialog from './CloseDialog';
20
+ var CloseIconStyled = styled(Icon)(function (_a) {
21
+ var theme = _a.theme;
22
+ return ({
23
+ width: theme.spacing(3.75),
24
+ height: theme.spacing(3.75)
25
+ });
26
+ });
27
+ var CloseBox = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'isTapOrigin'; } })(function (_a) {
28
+ var theme = _a.theme, isTapOrigin = _a.isTapOrigin;
29
+ return ({
30
+ display: 'flex',
31
+ justifyContent: 'end',
32
+ marginBlockStart: theme.spacing(2),
33
+ marginInlineEnd: theme.spacing(2),
34
+ cursor: 'pointer',
35
+ direction: theme.direction,
36
+ position: isTapOrigin ? 'initial' : 'absolute',
37
+ right: 0,
38
+ left: 0
39
+ });
40
+ });
41
+ export default function Dialog(_a) {
42
+ var isTapOrigin = _a.isTapOrigin, onClose = _a.onClose, children = _a.children, onConfirm = _a.onConfirm;
43
+ var _b = React.useState(false), open = _b[0], setOpen = _b[1];
44
+ var t = useTranslation().t;
45
+ var handleOnCloseButton = function () {
46
+ setOpen(true);
47
+ onClose && onClose();
48
+ };
49
+ var handleOnConfirm = function () {
50
+ onConfirm && onConfirm();
51
+ };
52
+ var handleOnCancel = function () {
53
+ setOpen(false);
54
+ };
55
+ return (_jsxs(_Fragment, { children: [onClose && (_jsx(CloseBox, __assign({ isTapOrigin: isTapOrigin, id: 'close-container', onClick: handleOnCloseButton }, { children: _jsx(CloseIconStyled, { src: ICONS_NAMES.CLOSE_ICON }) }))), children, onClose && (_jsx(CloseDialog, { message: t('confirm_close_flow_title'), confirmTitle: t('confirm_close_flow_yes'), closeTitle: t('confirm_close_flow_no'), open: open, onConfirm: handleOnConfirm, onCancel: handleOnCancel }))] }));
56
+ }
@@ -0,0 +1,4 @@
1
+ import DialogContainer from './DialogContainer';
2
+ import CloseDialog from './CloseDialog';
3
+ export { CloseDialog };
4
+ export default DialogContainer;
@@ -0,0 +1,4 @@
1
+ import DialogContainer from './DialogContainer';
2
+ import CloseDialog from './CloseDialog';
3
+ export { CloseDialog };
4
+ export default DialogContainer;
@@ -22,5 +22,5 @@ interface CustomButtonProps extends InputProps {
22
22
  label?: string;
23
23
  required?: boolean;
24
24
  }
25
- export default function CustomInput({ label, required, ...props }: CustomButtonProps): JSX.Element;
25
+ export default function CustomInput({ label, required, placeholder, ...props }: CustomButtonProps): JSX.Element;
26
26
  export {};
@@ -51,6 +51,6 @@ var LabelContainerStyled = styled(Box)(function (_a) {
51
51
  });
52
52
  });
53
53
  export default function CustomInput(_a) {
54
- var label = _a.label, required = _a.required, props = __rest(_a, ["label", "required"]);
55
- return (_jsxs(_Fragment, { children: [label && (_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: label }), required && _jsx(Mandatory, {})] })), _jsx(InputStyled, __assign({}, props))] }));
54
+ var label = _a.label, required = _a.required, placeholder = _a.placeholder, props = __rest(_a, ["label", "required", "placeholder"]);
55
+ return (_jsxs(_Fragment, { children: [label && (_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: label }), required && _jsx(Mandatory, {})] })), _jsx(InputStyled, __assign({}, props, { placeholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.toString() }))] }));
56
56
  }
@@ -6,7 +6,7 @@ export interface ThankYouProps {
6
6
  successTitle?: string;
7
7
  loading?: boolean;
8
8
  error?: string;
9
- description?: string;
9
+ description?: string | React.ReactElement;
10
10
  }
11
11
  declare const _default: React.MemoExoticComponent<({ title, description, showEmailProviders, onSuccess, successTitle, loading, error }: ThankYouProps) => JSX.Element>;
12
12
  export default _default;
@@ -36,7 +36,8 @@ var ContainerStyled = styled(Container)(function (_a) {
36
36
  return ({
37
37
  justifyContent: 'space-between',
38
38
  minHeight: theme.spacing(30),
39
- alignItems: 'center'
39
+ alignItems: 'center',
40
+ pointerEvents: 'auto'
40
41
  });
41
42
  });
42
43
  var IconStyled = styled(Icon)(function (_a) {
@@ -56,6 +57,6 @@ var ThankYou = function (_a) {
56
57
  var title = _a.title, description = _a.description, showEmailProviders = _a.showEmailProviders, onSuccess = _a.onSuccess, successTitle = _a.successTitle, loading = _a.loading, error = _a.error;
57
58
  var t = useTranslation().t;
58
59
  var isAr = useLanguage().isAr;
59
- return (_jsxs(ContainerStyled, { children: [_jsx(IconStyled, { src: ICONS_NAMES.SUCCESS_GIF, alt: 'loading...' }), _jsxs(TitleStyled, { children: [title, " "] }), _jsx(DescriptionStyled, { children: description }), showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(EmailProvidersButton, { gmail: { title: t('gmail_btn_open_title'), href: 'https://mail.google.com/mail/u/0/#inbox' }, outlook: { title: t('outlook_btn_open_title'), href: 'https://outlook.live.com/mail/0/' }, apple: { title: t('apple_btn_open_title'), href: 'https://www.icloud.com/mail/' } }) })), onSuccess && !showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(SuccessButton, __assign({ onClick: onSuccess, disableBack: true, disableNextIcon: true, disabled: loading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t(successTitle || '') })) }))] }));
60
+ return (_jsxs(ContainerStyled, { children: [_jsx(IconStyled, { src: ICONS_NAMES.SUCCESS_GIF, alt: 'loading...' }), _jsxs(TitleStyled, { children: [title, " "] }), _jsx(DescriptionStyled, { children: description }), showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(EmailProvidersButton, { gmail: { title: t('gmail_btn_open_title'), href: 'https://mail.google.com/mail/u/0/#inbox' }, outlook: { title: t('outlook_btn_open_title'), href: 'https://outlook.live.com/mail/0/' }, apple: { title: t('apple_btn_open_title'), href: 'mailto:' }, mail: { title: t('mail_btn_open_title'), href: 'mailto:' } }) })), onSuccess && !showEmailProviders && (_jsx(MailBoxStyled, { children: _jsx(SuccessButton, __assign({ onClick: onSuccess, disableBack: true, disableNextIcon: true, disabled: loading, isAr: isAr, loading: loading, error: t(error || '') }, { children: t(successTitle || '') })) }))] }));
60
61
  };
61
62
  export default React.memo(ThankYou);
@@ -10,12 +10,19 @@ export declare const InputContainerStyled: import("@emotion/styled").StyledCompo
10
10
  interface UploadFileProps {
11
11
  label: string;
12
12
  required?: boolean;
13
- dragTitle: string;
14
- uploadTitle: string;
13
+ title: string;
14
+ subTitle: string;
15
+ dragDescription: string;
16
+ uploadingTitle: string;
17
+ successTitle: string;
15
18
  error?: string;
19
+ progress?: number;
16
20
  isSubmitting?: boolean;
21
+ isUploading?: boolean;
22
+ isFileUploaded?: boolean;
17
23
  onFileUploaded: (file: File) => void;
18
24
  onReset: () => void;
25
+ initialFileName?: string;
19
26
  }
20
- declare const UploadFile: ({ label, required, dragTitle, uploadTitle, isSubmitting, error, onFileUploaded, onReset }: UploadFileProps) => JSX.Element;
27
+ declare const UploadFile: ({ label, required, title, subTitle, dragDescription, uploadingTitle, successTitle, isSubmitting, isUploading, isFileUploaded, error, progress, onFileUploaded, onReset, initialFileName }: UploadFileProps) => JSX.Element;
21
28
  export default UploadFile;
@@ -16,10 +16,14 @@ import { ScreenContainer } from '../../shared/Containers';
16
16
  import Box from '@mui/material/Box';
17
17
  import { InputLabelStyled } from '../../shared/Input/Input';
18
18
  import Mandatory from '../../shared/Mandatory';
19
- import { DragAndDrop, UploadInput } from '../../../components/FileInput';
19
+ import { DragAndDrop } from '../../../components/FileInput';
20
20
  import Collapse from '../../../components/Collapse';
21
- import Warning from '../../../components/Warning';
22
21
  import ClearIcon from '@mui/icons-material/Clear';
22
+ import CheckIcon from '../../../features/shared/CheckIcon';
23
+ import { maskFileName } from '../../../utils';
24
+ import Icon from '../../../components/Icon';
25
+ import { ICONS_NAMES } from '../../../constants';
26
+ import Text from '../../../components/Text';
23
27
  var FeatureStyled = styled(ScreenContainer)(function (_a) {
24
28
  var theme = _a.theme;
25
29
  return ({
@@ -36,11 +40,11 @@ var LabelContainerStyled = styled(Box)(function (_a) {
36
40
  });
37
41
  var BoxStyled = styled(Box)(function (_a) {
38
42
  var theme = _a.theme;
39
- return (__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: theme.palette.primary.main, fontWeight: theme.typography.fontWeightBold, background: theme.palette.background.default, padding: theme.spacing(1.5, 2.5, 1.5), width: '85%', wordBreak: 'break-all' }));
43
+ return (__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: theme.palette.primary.main, fontWeight: theme.typography.fontWeightBold, background: theme.palette.background.default, padding: theme.spacing(1.5, 2.5, 1.5), width: '88%', wordBreak: 'break-all', display: 'flex', justifyContent: 'space-between' }));
40
44
  });
41
45
  var UploadBoxStyled = styled(Box)(function (_a) {
42
46
  var theme = _a.theme;
43
- return (__assign(__assign({}, theme.typography.caption), { background: theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular, cursor: 'pointer', width: '15%', display: 'flex', justifyContent: 'center', alignItems: 'center' }));
47
+ return (__assign(__assign({}, theme.typography.caption), { background: theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular, cursor: 'pointer', width: '12%', display: 'flex', justifyContent: 'center', alignItems: 'center' }));
44
48
  });
45
49
  var ClearIconStyled = styled(ClearIcon)(function (_a) {
46
50
  var theme = _a.theme;
@@ -55,14 +59,16 @@ export var InputContainerStyled = styled(Box)(function (_a) {
55
59
  var theme = _a.theme;
56
60
  return ({
57
61
  display: 'flex',
58
- width: '100%'
62
+ width: '100%',
63
+ justifyContent: 'center'
59
64
  });
60
65
  });
61
66
  var UploadFile = function (_a) {
62
- var label = _a.label, required = _a.required, dragTitle = _a.dragTitle, uploadTitle = _a.uploadTitle, isSubmitting = _a.isSubmitting, error = _a.error, onFileUploaded = _a.onFileUploaded, onReset = _a.onReset;
63
- var _b = React.useState(''), fileName = _b[0], setFileName = _b[1];
67
+ var label = _a.label, required = _a.required, title = _a.title, subTitle = _a.subTitle, dragDescription = _a.dragDescription, uploadingTitle = _a.uploadingTitle, successTitle = _a.successTitle, isSubmitting = _a.isSubmitting, isUploading = _a.isUploading, isFileUploaded = _a.isFileUploaded, error = _a.error, progress = _a.progress, onFileUploaded = _a.onFileUploaded, onReset = _a.onReset, initialFileName = _a.initialFileName;
68
+ var _b = React.useState(initialFileName || ''), fileName = _b[0], setFileName = _b[1];
69
+ var _c = React.useState(!!initialFileName), showFile = _c[0], setShowFile = _c[1];
64
70
  var handleFileChange = function (file) {
65
- setFileName(file === null || file === void 0 ? void 0 : file.name);
71
+ setFileName(maskFileName(file === null || file === void 0 ? void 0 : file.name));
66
72
  onFileUploaded === null || onFileUploaded === void 0 ? void 0 : onFileUploaded(file);
67
73
  };
68
74
  var handleReset = function () {
@@ -71,6 +77,15 @@ var UploadFile = function (_a) {
71
77
  onReset === null || onReset === void 0 ? void 0 : onReset();
72
78
  }
73
79
  };
74
- return (_jsxs(FeatureStyled, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: label }), required && _jsx(Mandatory, {})] }), _jsx(Collapse, __assign({ in: !fileName }, { children: _jsxs(InputContainerStyled, { children: [_jsx(DragAndDrop, { title: dragTitle, onSuccess: handleFileChange }), _jsx(UploadInput, { title: uploadTitle, onChange: handleFileChange })] }) })), _jsx(Collapse, __assign({ in: !!fileName }, { children: _jsxs(InputContainerStyled, { children: [_jsx(BoxStyled, { children: fileName }), _jsx(UploadBoxStyled, __assign({ onClick: handleReset }, { children: _jsx(ClearIconStyled, {}) }))] }) })), _jsx(Collapse, __assign({ in: !!error, timeout: 400 }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: error })) }))] }));
80
+ React.useEffect(function () {
81
+ if (isFileUploaded && !!fileName) {
82
+ setTimeout(function () {
83
+ setShowFile(true);
84
+ }, 600);
85
+ }
86
+ else
87
+ setShowFile(false);
88
+ }, [isFileUploaded]);
89
+ return (_jsxs(FeatureStyled, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: label }), required && _jsx(Mandatory, {})] }), _jsx(Collapse, __assign({ in: !showFile }, { children: _jsx(InputContainerStyled, { children: _jsx(DragAndDrop, { title: title, subTitle: subTitle, description: dragDescription, fileExists: !!fileName, uploadingTitle: uploadingTitle, successTitle: successTitle, progress: progress, uploading: isUploading, uploadSuccess: isFileUploaded, onSuccess: handleFileChange, error: error }) }) })), _jsx(Collapse, __assign({ in: showFile, timeout: 300 }, { children: _jsxs(InputContainerStyled, { children: [_jsxs(BoxStyled, { children: [_jsxs(Box, __assign({ sx: { display: 'flex' } }, { children: [_jsx(Icon, { src: ICONS_NAMES.DOC_ICON }), _jsx(Text, { children: fileName })] })), _jsx(Box, { children: _jsx(CheckIcon, {}) })] }), _jsx(UploadBoxStyled, __assign({ onClick: handleReset }, { children: _jsx(ClearIconStyled, {}) }))] }) }))] }));
75
90
  };
76
91
  export default UploadFile;
@@ -26,13 +26,13 @@ import { signInSelector } from '../app/signIn/signInStore';
26
26
  import Background from '../shared/Background';
27
27
  var SignIn = memo(function (props) {
28
28
  var theme = useAppTheme().theme;
29
- var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, loading = _a.loading;
30
- var signInError = useAppSelector(signInSelector).error;
29
+ var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
30
+ var _b = useAppSelector(signInSelector), signInError = _b.error, loading = _b.loading;
31
31
  useAppConfig(__assign({ navigation: SigIn_SCREENS_NAVIGATION }, props));
32
32
  useErrorListener(signInError || error);
33
33
  useStepStartedListener();
34
34
  var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
35
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: loading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, open: open, error: error, loading: loading, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: signInFeatureScreens.map(function (_a, index) {
35
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ pointerEvents: loading ? 'none' : 'auto', isTapOrigin: isTapOrigin, open: open, error: error, loading: settingLoading, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: signInFeatureScreens.map(function (_a, index) {
36
36
  var Element = _a.element, name = _a.name;
37
37
  var isActive = activeScreen.name === name;
38
38
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -52,6 +52,6 @@ export function unmountSignInLib(elementId, unmountTimeout) {
52
52
  var _a;
53
53
  ((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
54
54
  dialogEl && dialogEl.remove();
55
- reactElement(elementId).unmount();
55
+ elementId && reactElement(elementId).unmount();
56
56
  }, unmountTimeout);
57
57
  }