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

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 (292) hide show
  1. package/build/@types/app.d.ts +59 -20
  2. package/build/@types/app.js +16 -1
  3. package/build/@types/form.d.ts +21 -7
  4. package/build/api/auth.d.ts +24 -2
  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 +28 -5
  14. package/build/api/entity.js +23 -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 +41 -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 +8 -6
  21. package/build/app/rootReducer.d.ts +2 -0
  22. package/build/app/rootReducer.js +5 -1
  23. package/build/app/settings.d.ts +8 -2
  24. package/build/app/settings.js +29 -12
  25. package/build/app/store.d.ts +5 -1
  26. package/build/assets/locales/ar.json +256 -179
  27. package/build/assets/locales/en.json +188 -104
  28. package/build/components/AnimationFlow/AnimationFlow.d.ts +5 -1
  29. package/build/components/AnimationFlow/AnimationFlow.js +6 -8
  30. package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
  31. package/build/components/AnimationFlow/BottomSheet.js +4 -3
  32. package/build/components/AnimationFlow/Dialog.d.ts +5 -1
  33. package/build/components/AnimationFlow/Dialog.js +11 -5
  34. package/build/components/FileInput/DragAndDrop.d.ts +10 -1
  35. package/build/components/FileInput/DragAndDrop.js +107 -8
  36. package/build/components/Lottie/Lottie.d.ts +878 -0
  37. package/build/components/Lottie/Lottie.js +58 -0
  38. package/build/components/Lottie/files/pulsating_circle_waves.json +236 -0
  39. package/build/components/Lottie/files/success.json +425 -0
  40. package/build/components/Lottie/index.d.ts +3 -0
  41. package/build/components/Lottie/index.js +3 -0
  42. package/build/components/OTPField/OTPField.d.ts +2 -1
  43. package/build/components/OTPField/OTPField.js +2 -2
  44. package/build/components/OTPTimer/OTPTimer.js +1 -1
  45. package/build/components/ProgressBar/CircularProgressBar.d.ts +14 -0
  46. package/build/components/ProgressBar/CircularProgressBar.js +48 -0
  47. package/build/components/ProgressBar/index.d.ts +2 -0
  48. package/build/components/ProgressBar/index.js +2 -0
  49. package/build/components/RadioLabel/RadioLabel.d.ts +2 -1
  50. package/build/components/RadioLabel/RadioLabel.js +2 -2
  51. package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +1 -4
  52. package/build/components/SocialMediaGroup/SocialMediaGroup.js +3 -55
  53. package/build/constants/api.d.ts +6 -0
  54. package/build/constants/api.js +14 -1
  55. package/build/constants/app.d.ts +18 -0
  56. package/build/constants/app.js +98 -15
  57. package/build/constants/assets.d.ts +20 -1
  58. package/build/constants/assets.js +27 -8
  59. package/build/constants/dummy.d.ts +1 -1
  60. package/build/constants/dummy.js +2 -2
  61. package/build/constants/validation.d.ts +7 -0
  62. package/build/constants/validation.js +8 -1
  63. package/build/features/app/auth/authStore.d.ts +47 -0
  64. package/build/features/app/auth/authStore.js +265 -0
  65. package/build/features/app/bank/bankStore.d.ts +21 -1
  66. package/build/features/app/bank/bankStore.js +84 -40
  67. package/build/features/app/business/businessStore.d.ts +22 -3
  68. package/build/features/app/business/businessStore.js +458 -257
  69. package/build/features/app/connect/connectStore.d.ts +33 -30
  70. package/build/features/app/connect/connectStore.js +398 -258
  71. package/build/features/app/entity/entityStore.d.ts +53 -0
  72. package/build/features/app/entity/entityStore.js +461 -0
  73. package/build/features/app/individual/individualStore.d.ts +22 -1
  74. package/build/features/app/individual/individualStore.js +170 -86
  75. package/build/features/app/password/passwordStore.d.ts +10 -2
  76. package/build/features/app/password/passwordStore.js +5 -5
  77. package/build/features/app/tax/taxStore.js +6 -5
  78. package/build/features/auth/Auth.d.ts +10 -0
  79. package/build/features/auth/Auth.js +87 -0
  80. package/build/features/auth/index.d.ts +1 -0
  81. package/build/features/auth/index.js +1 -0
  82. package/build/features/auth/screens/NID/DOB.d.ts +7 -0
  83. package/build/features/auth/screens/NID/DOB.js +47 -0
  84. package/build/features/auth/screens/NID/IDNumber.d.ts +3 -0
  85. package/build/features/auth/screens/NID/IDNumber.js +64 -0
  86. package/build/features/auth/screens/NID/NID.d.ts +5 -0
  87. package/build/features/auth/screens/NID/NID.js +67 -0
  88. package/build/features/auth/screens/NID/TAC.d.ts +3 -0
  89. package/build/features/auth/screens/NID/TAC.js +87 -0
  90. package/build/features/auth/screens/NID/index.d.ts +3 -0
  91. package/build/features/auth/screens/NID/index.js +2 -0
  92. package/build/features/auth/screens/NID/validation.d.ts +27 -0
  93. package/build/features/auth/screens/NID/validation.js +19 -0
  94. package/build/features/auth/screens/OTP/OTP.d.ts +5 -0
  95. package/build/features/auth/screens/OTP/OTP.js +76 -0
  96. package/build/features/auth/screens/OTP/OTPInput.d.ts +5 -0
  97. package/build/features/auth/screens/OTP/OTPInput.js +51 -0
  98. package/build/features/auth/screens/OTP/index.d.ts +3 -0
  99. package/build/features/auth/screens/OTP/index.js +2 -0
  100. package/build/features/auth/screens/OTP/validation.d.ts +8 -0
  101. package/build/features/auth/screens/OTP/validation.js +4 -0
  102. package/build/features/bank/Bank.js +12 -6
  103. package/build/features/bank/screens/BankDetails/BankDetails.js +2 -2
  104. package/build/features/bank/screens/BankDetails/BankStatement.js +41 -8
  105. package/build/features/bank/screens/BankDetails/Beneficiary.js +10 -9
  106. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -9
  107. package/build/features/business/Business.d.ts +1 -1
  108. package/build/features/business/Business.js +14 -7
  109. package/build/features/business/screens/Activities/Activities.js +1 -6
  110. package/build/features/business/screens/Activities/ActivitiesList.d.ts +37 -1
  111. package/build/features/business/screens/Activities/ActivitiesList.js +51 -12
  112. package/build/features/business/screens/Activities/OperationStartDate.d.ts +15 -1
  113. package/build/features/business/screens/Activities/OperationStartDate.js +21 -2
  114. package/build/features/business/screens/Activities/validation.d.ts +0 -51
  115. package/build/features/business/screens/Activities/validation.js +0 -9
  116. package/build/features/business/screens/BusinessType/BusinessType.js +20 -7
  117. package/build/features/business/screens/BusinessType/EntityName.d.ts +6 -0
  118. package/build/features/business/screens/BusinessType/EntityName.js +56 -0
  119. package/build/features/business/screens/BusinessType/LicenseCertificate.d.ts +6 -0
  120. package/build/features/business/screens/BusinessType/LicenseCertificate.js +76 -0
  121. package/build/features/business/screens/BusinessType/LicenseList.js +24 -7
  122. package/build/features/business/screens/BusinessType/LicenseNumber.js +14 -8
  123. package/build/features/business/screens/BusinessType/LicenseType.d.ts +6 -0
  124. package/build/features/business/screens/BusinessType/LicenseType.js +67 -0
  125. package/build/features/business/screens/BusinessType/validation.d.ts +19 -0
  126. package/build/features/business/screens/BusinessType/validation.js +50 -1
  127. package/build/features/business/screens/CivilID/CivilID.d.ts +5 -0
  128. package/build/features/business/screens/CivilID/CivilID.js +84 -0
  129. package/build/features/business/screens/CivilID/IDNumber.d.ts +7 -0
  130. package/build/features/business/screens/CivilID/IDNumber.js +59 -0
  131. package/build/features/business/screens/CivilID/index.d.ts +3 -0
  132. package/build/features/business/screens/CivilID/index.js +2 -0
  133. package/build/features/business/screens/CivilID/validation.d.ts +8 -0
  134. package/build/features/business/screens/CivilID/validation.js +4 -0
  135. package/build/features/business/screens/Customers/CustomerLocations.d.ts +15 -2
  136. package/build/features/business/screens/Customers/CustomerLocations.js +32 -8
  137. package/build/features/business/screens/Customers/ExpectedCustomers.js +16 -4
  138. package/build/features/business/screens/Customers/ExpectedSalesRange.js +32 -14
  139. package/build/features/business/screens/Customers/RefundPolicy.js +8 -2
  140. package/build/features/business/screens/Customers/TransactionPolicy.js +8 -2
  141. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +11 -8
  142. package/build/features/business/screens/Verify/Verify.js +4 -4
  143. package/build/features/business/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  144. package/build/features/business/screens/VerifyPACI/VerifyPACI.js +156 -0
  145. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.d.ts +5 -0
  146. package/build/features/business/screens/VerifyPACI/VerifyPACILoading.js +22 -0
  147. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  148. package/build/features/business/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  149. package/build/features/business/screens/VerifyPACI/index.d.ts +3 -0
  150. package/build/features/business/screens/VerifyPACI/index.js +2 -0
  151. package/build/features/connect/Connect.d.ts +2 -1
  152. package/build/features/connect/Connect.js +47 -12
  153. package/build/features/connect/screens/CivilID/CivilID.d.ts +5 -0
  154. package/build/features/connect/screens/CivilID/CivilID.js +86 -0
  155. package/build/features/connect/screens/CivilID/IDNumber.d.ts +7 -0
  156. package/build/features/connect/screens/CivilID/IDNumber.js +59 -0
  157. package/build/features/connect/screens/CivilID/index.d.ts +3 -0
  158. package/build/features/connect/screens/CivilID/index.js +2 -0
  159. package/build/features/connect/screens/CivilID/validation.d.ts +8 -0
  160. package/build/features/connect/screens/CivilID/validation.js +4 -0
  161. package/build/features/connect/screens/Individual/Email.js +11 -3
  162. package/build/features/connect/screens/Individual/Individual.js +27 -14
  163. package/build/features/connect/screens/Merchant/BrandList.js +15 -7
  164. package/build/features/connect/screens/Merchant/BrandName.js +7 -4
  165. package/build/features/connect/screens/Merchant/Merchant.js +47 -50
  166. package/build/features/connect/screens/Merchant/SalesChannels.d.ts +7 -0
  167. package/build/features/connect/screens/Merchant/SalesChannels.js +113 -0
  168. package/build/features/connect/screens/Merchant/SocialMedia.d.ts +1 -4
  169. package/build/features/connect/screens/Merchant/SocialMedia.js +131 -66
  170. package/build/features/connect/screens/Merchant/TAC.js +8 -2
  171. package/build/features/connect/screens/Merchant/validation.d.ts +22 -45
  172. package/build/features/connect/screens/Merchant/validation.js +117 -116
  173. package/build/features/connect/screens/Mobile/Mobile.js +15 -6
  174. package/build/features/connect/screens/NID/NID.js +2 -1
  175. package/build/features/connect/screens/OTP/OTP.js +5 -4
  176. package/build/features/connect/screens/OTP/OTPInput.js +3 -2
  177. package/build/features/connect/screens/VerifyPACI/VerifyPACI.d.ts +5 -0
  178. package/build/features/connect/screens/VerifyPACI/VerifyPACI.js +158 -0
  179. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.d.ts +5 -0
  180. package/build/features/connect/screens/VerifyPACI/VerifyPACILoading.js +22 -0
  181. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.d.ts +5 -0
  182. package/build/features/connect/screens/VerifyPACI/VerifyPACISuccess.js +8 -0
  183. package/build/features/connect/screens/VerifyPACI/index.d.ts +3 -0
  184. package/build/features/connect/screens/VerifyPACI/index.js +2 -0
  185. package/build/features/entity/Entity.d.ts +7 -0
  186. package/build/features/entity/Entity.js +70 -0
  187. package/build/features/entity/index.d.ts +1 -0
  188. package/build/features/entity/index.js +1 -0
  189. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +54 -0
  190. package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +140 -0
  191. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.d.ts +5 -0
  192. package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +56 -0
  193. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.d.ts +5 -0
  194. package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +17 -0
  195. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +5 -0
  196. package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +28 -0
  197. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.d.ts +6 -0
  198. package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +38 -0
  199. package/build/features/{business/screens/Activities → entity/screens/EntityInfoConfirm}/SalesChannels.d.ts +0 -0
  200. package/build/features/{business/screens/Activities → entity/screens/EntityInfoConfirm}/SalesChannels.js +8 -4
  201. package/build/features/entity/screens/EntityInfoConfirm/index.d.ts +2 -0
  202. package/build/features/entity/screens/EntityInfoConfirm/index.js +2 -0
  203. package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +107 -0
  204. package/build/features/entity/screens/EntityInfoConfirm/validation.js +17 -0
  205. package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.d.ts +5 -0
  206. package/build/features/entity/screens/ResetPasswordSuccess/ResetPasswordSuccess.js +9 -0
  207. package/build/features/entity/screens/ResetPasswordSuccess/index.d.ts +3 -0
  208. package/build/features/entity/screens/ResetPasswordSuccess/index.js +2 -0
  209. package/build/features/entity/screens/Success/Success.d.ts +5 -0
  210. package/build/features/entity/screens/Success/Success.js +16 -0
  211. package/build/features/entity/screens/Success/index.d.ts +3 -0
  212. package/build/features/entity/screens/Success/index.js +2 -0
  213. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.d.ts +3 -0
  214. package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +110 -0
  215. package/build/features/entity/screens/SuccessWithFlowButtons/index.d.ts +2 -0
  216. package/build/features/entity/screens/SuccessWithFlowButtons/index.js +2 -0
  217. package/build/features/entity/screens/Verify/OTPInput.d.ts +7 -0
  218. package/build/features/entity/screens/Verify/OTPInput.js +47 -0
  219. package/build/features/entity/screens/Verify/Verify.d.ts +5 -0
  220. package/build/features/entity/screens/Verify/Verify.js +78 -0
  221. package/build/features/entity/screens/Verify/index.d.ts +2 -0
  222. package/build/features/entity/screens/Verify/index.js +2 -0
  223. package/build/features/entity/screens/Verify/validation.d.ts +8 -0
  224. package/build/features/entity/screens/Verify/validation.js +4 -0
  225. package/build/features/featuresScreens.d.ts +2 -0
  226. package/build/features/featuresScreens.js +56 -0
  227. package/build/features/individual/Individual.d.ts +1 -1
  228. package/build/features/individual/Individual.js +14 -7
  229. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +1 -1
  230. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +15 -3
  231. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +11 -3
  232. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +2 -2
  233. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -9
  234. package/build/features/individual/screens/Verify/Verify.js +4 -4
  235. package/build/features/password/Password.d.ts +1 -1
  236. package/build/features/password/Password.js +14 -7
  237. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +13 -10
  238. package/build/features/shared/Background/Background.d.ts +7 -5
  239. package/build/features/shared/Background/Background.js +16 -5
  240. package/build/features/shared/Button/Button.d.ts +2 -1
  241. package/build/features/shared/Button/Button.js +2 -2
  242. package/build/features/shared/Button/EmailProvidersButtons.d.ts +2 -1
  243. package/build/features/shared/Button/EmailProvidersButtons.js +7 -2
  244. package/build/features/shared/Button/MobileButton.d.ts +2 -1
  245. package/build/features/shared/Button/MobileButton.js +2 -2
  246. package/build/features/shared/Button/SuccessButton.js +1 -1
  247. package/build/features/shared/Dialog/CloseDialog.d.ts +11 -0
  248. package/build/features/shared/Dialog/CloseDialog.js +71 -0
  249. package/build/features/shared/Dialog/DialogContainer.d.ts +8 -0
  250. package/build/features/shared/Dialog/DialogContainer.js +56 -0
  251. package/build/features/shared/Dialog/index.d.ts +4 -0
  252. package/build/features/shared/Dialog/index.js +4 -0
  253. package/build/features/shared/Input/Input.d.ts +1 -1
  254. package/build/features/shared/Input/Input.js +2 -2
  255. package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
  256. package/build/features/shared/UploadFile/UploadFile.d.ts +9 -3
  257. package/build/features/shared/UploadFile/UploadFile.js +23 -8
  258. package/build/features/signIn/SignIn.d.ts +1 -1
  259. package/build/features/signIn/SignIn.js +14 -6
  260. package/build/features/tax/Tax.d.ts +1 -1
  261. package/build/features/tax/Tax.js +16 -8
  262. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -8
  263. package/build/hooks/index.d.ts +1 -0
  264. package/build/hooks/index.js +1 -0
  265. package/build/hooks/useAppConfig.d.ts +3 -1
  266. package/build/hooks/useAppConfig.js +4 -2
  267. package/build/hooks/useAppDispatch.d.ts +2 -0
  268. package/build/hooks/useErrorListener.js +0 -5
  269. package/build/hooks/useScreen.d.ts +3 -0
  270. package/build/hooks/useScreen.js +14 -0
  271. package/build/index.d.ts +4 -2
  272. package/build/index.js +8 -2
  273. package/build/utils/array.d.ts +13 -1
  274. package/build/utils/array.js +26 -0
  275. package/build/utils/common.d.ts +1 -0
  276. package/build/utils/common.js +3 -0
  277. package/build/utils/device.d.ts +1 -0
  278. package/build/utils/device.js +13 -0
  279. package/build/utils/html.d.ts +1 -0
  280. package/build/utils/html.js +6 -0
  281. package/build/utils/index.d.ts +1 -0
  282. package/build/utils/index.js +1 -0
  283. package/build/utils/locale.js +1 -1
  284. package/build/utils/object.d.ts +1 -0
  285. package/build/utils/object.js +12 -0
  286. package/build/utils/rsa.d.ts +2 -2
  287. package/build/utils/rsa.js +1 -1
  288. package/build/utils/string.d.ts +33 -20
  289. package/build/utils/string.js +71 -1
  290. package/build/utils/validation.d.ts +1 -0
  291. package/build/utils/validation.js +3 -0
  292. package/package.json +3 -2
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import { ScreenContainer } from '../../../shared/Containers';
5
+ import Input from '../../../shared/Input';
6
+ import { useAppSelector, useLanguage } from '../../../../hooks';
7
+ import { entitySelector } from '../../../app/entity/entityStore';
8
+ var LicenseName = function (_a) {
9
+ var _b, _c, _d;
10
+ var t = useTranslation().t;
11
+ var isAr = useLanguage().isAr;
12
+ var data = useAppSelector(entitySelector).data;
13
+ var entity = (((_b = data.verify) === null || _b === void 0 ? void 0 : _b.responseBody) || {}).entity;
14
+ var name = isAr ? (_c = entity === null || entity === void 0 ? void 0 : entity.legal_name) === null || _c === void 0 ? void 0 : _c.ar : (_d = entity === null || entity === void 0 ? void 0 : entity.legal_name) === null || _d === void 0 ? void 0 : _d.en;
15
+ return (_jsx(ScreenContainer, { children: _jsx(Input, { label: t('license_name_label'), readOnly: !!name, placeholder: t('license_name_label'), value: name, sx: { '& .MuiInputBase-input': { cursor: 'auto' } } }) }));
16
+ };
17
+ export default React.memo(LicenseName);
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ interface LicenseNumberProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: LicenseNumberProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,28 @@
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 } from "react/jsx-runtime";
13
+ import * as React from 'react';
14
+ import { useTranslation } from 'react-i18next';
15
+ import { ScreenContainer } from '../../../shared/Containers';
16
+ import Input from '../../../shared/Input';
17
+ import Collapse from '../../../../components/Collapse';
18
+ import { useAppSelector } from '../../../../hooks';
19
+ import { entitySelector } from '../../../app/entity/entityStore';
20
+ var LicenseNumber = function (_a) {
21
+ var _b, _c;
22
+ var t = useTranslation().t;
23
+ var data = useAppSelector(entitySelector).data;
24
+ var entity = (((_b = data.verify) === null || _b === void 0 ? void 0 : _b.responseBody) || {}).entity;
25
+ var number = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.number;
26
+ return (_jsx(Collapse, __assign({ in: !!number }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { label: t('license_number_label'), readOnly: true, value: number, sx: { '& .MuiInputBase-input': { cursor: 'auto' } } }) })) })));
27
+ };
28
+ export default React.memo(LicenseNumber);
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export interface OperationStartDateProps {
3
+ onDateClicked?: (flag: boolean) => void;
4
+ }
5
+ declare const OperationStartDate: ({ onDateClicked }: OperationStartDateProps) => JSX.Element;
6
+ export default OperationStartDate;
@@ -0,0 +1,38 @@
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 { useTranslation } from 'react-i18next';
14
+ import { useController, useFormContext } from 'react-hook-form';
15
+ import Input from '../../../shared/Input';
16
+ import { ScreenContainer } from '../../../shared/Containers';
17
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
18
+ import { entitySelector, clearError } from '../../../app/entity/entityStore';
19
+ import DatePicker from '../../../../components/DatePicker';
20
+ import { InputLabelStyled } from './ActivitiesList';
21
+ var OperationStartDate = function (_a) {
22
+ var _b, _c, _d;
23
+ var onDateClicked = _a.onDateClicked;
24
+ var t = useTranslation().t;
25
+ var dispatch = useAppDispatch();
26
+ var control = useFormContext().control;
27
+ var _e = useAppSelector(entitySelector), data = _e.data, error = _e.error;
28
+ var oDateControl = useController({ control: control, name: 'operationStartDate' });
29
+ var handleOperationStartDateChange = function (data) {
30
+ if (error)
31
+ dispatch(clearError());
32
+ oDateControl.field.onChange(data);
33
+ };
34
+ var dateValue = (_b = oDateControl === null || oDateControl === void 0 ? void 0 : oDateControl.field) === null || _b === void 0 ? void 0 : _b.value;
35
+ var storedDate = (_d = (_c = data.verify.responseBody) === null || _c === void 0 ? void 0 : _c.brand) === null || _d === void 0 ? void 0 : _d.business_operation_start_at;
36
+ return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: !!storedDate ? (_jsx(Input, { label: t('business_start_date'), readOnly: true, value: dateValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } } })) : (_jsxs(_Fragment, { children: [_jsx(InputLabelStyled, { children: t('business_start_date') }), _jsx(DatePicker, { readOnly: true, defaultValue: dateValue ? new Date(dateValue) : new Date(), dir: 'ltr', locale: 'en', onClick: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true); }, onDatePicked: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(false); }, onDateChange: handleOperationStartDateChange })] })) })));
37
+ };
38
+ export default OperationStartDate;
@@ -26,7 +26,7 @@ import { useTranslation } from 'react-i18next';
26
26
  import { useController, useFormContext } from 'react-hook-form';
27
27
  import { useLanguage, useAppSelector, useAppDispatch } from '../../../../hooks';
28
28
  import Text from '../../../../components/Text';
29
- import { businessSelector, clearError } from '../../../app/business/businessStore';
29
+ import { entitySelector, clearError } from '../../../app/entity/entityStore';
30
30
  import CheckBox from '../../../../components/CheckBox';
31
31
  import Warning from '../../../../components/Warning';
32
32
  import Collapse from '../../../../components/Collapse';
@@ -83,8 +83,9 @@ var SalesChannels = function () {
83
83
  var channelsControl = useController({ name: 'salesChannels', control: control });
84
84
  var channelsChecked = channelsControl.field.value;
85
85
  var warningMessage = (_a = channelsControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
86
- var _c = useAppSelector(businessSelector), data = _c.data, error = _c.error;
87
- var channelList = (data.businessTypeData.responseBody || {}).channelList;
86
+ var _c = useAppSelector(entitySelector), data = _c.data, error = _c.error;
87
+ var channelList = (data.verify.responseBody || {}).channelList;
88
+ var salesChannels = (data.entityData || {}).salesChannels;
88
89
  React.useEffect(function () {
89
90
  if ((channelList === null || channelList === void 0 ? void 0 : channelList.length) > 0) {
90
91
  setChannelsMenuList(channelList);
@@ -106,6 +107,9 @@ var SalesChannels = function () {
106
107
  if (channelsChecked)
107
108
  return !!(channelsChecked === null || channelsChecked === void 0 ? void 0 : channelsChecked.find(function (channel) { return channel.id === (item === null || item === void 0 ? void 0 : item.id); }));
108
109
  };
109
- return (_jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [t('channel_of_service'), " ", _jsx(MandatoryStyled, { children: "*" })] }), channelsMenuList.map(function (channel) { return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id, disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: getSelectedChannelsFlag(channel), onChange: handleSalesChannelChange }), _jsxs(TextStyled, { children: [isAr ? channel.name_ar : channel.name_en, " "] })] }, channel.id)); }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(warningMessage) })) }))] }));
110
+ return (_jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('channel_of_service') }), channelsMenuList.map(function (channel) {
111
+ var _a, _b;
112
+ return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id, disableRipple: true, disableFocusRipple: true, focusRipple: false, disabled: (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.find(function (c) { return c.id === (channel === null || channel === void 0 ? void 0 : channel.id); })) ? true : false, checked: getSelectedChannelsFlag(channel), onChange: handleSalesChannelChange }), _jsxs(TextStyled, { children: [isAr ? (_a = channel === null || channel === void 0 ? void 0 : channel.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = channel === null || channel === void 0 ? void 0 : channel.name) === null || _b === void 0 ? void 0 : _b.en, " "] })] }, channel.id));
113
+ }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(warningMessage) })) }))] }));
110
114
  };
111
115
  export default SalesChannels;
@@ -0,0 +1,2 @@
1
+ import EntityInfo from './EntityInfo';
2
+ export default EntityInfo;
@@ -0,0 +1,2 @@
1
+ import EntityInfo from './EntityInfo';
2
+ export default EntityInfo;
@@ -0,0 +1,107 @@
1
+ import * as yup from 'yup';
2
+ export declare const EntityInfoValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
+ activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
4
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
5
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
6
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
7
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
8
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
9
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
10
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
11
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
12
+ }>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
13
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
14
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
15
+ }>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
16
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
17
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
18
+ }>>[] | undefined>;
19
+ salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
20
+ id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
21
+ name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
22
+ name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
23
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
24
+ id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
25
+ name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
26
+ name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
27
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
28
+ id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
29
+ name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
30
+ name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
31
+ }>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
32
+ id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
33
+ name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
34
+ name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
35
+ }>>[] | undefined>;
36
+ operationStartDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
37
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
38
+ activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
39
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
40
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
41
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
42
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
43
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
44
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
45
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
46
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
47
+ }>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
48
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
49
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
50
+ }>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
51
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
52
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
53
+ }>>[] | undefined>;
54
+ salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
55
+ id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
56
+ name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
57
+ name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
58
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
59
+ id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
60
+ name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
61
+ name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
62
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
63
+ id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
64
+ name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
65
+ name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
66
+ }>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
67
+ id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
68
+ name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
69
+ name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
70
+ }>>[] | undefined>;
71
+ operationStartDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
72
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
73
+ activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
74
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
75
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
76
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
77
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
78
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
79
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
80
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
81
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
82
+ }>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
83
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
84
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
85
+ }>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
86
+ ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
87
+ en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
88
+ }>>[] | undefined>;
89
+ salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
90
+ id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
91
+ name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
92
+ name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
93
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
94
+ id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
95
+ name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
96
+ name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
97
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
98
+ id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
99
+ name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
100
+ name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
101
+ }>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
102
+ id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
103
+ name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
104
+ name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
105
+ }>>[] | undefined>;
106
+ operationStartDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
107
+ }>>>;
@@ -0,0 +1,17 @@
1
+ import * as yup from 'yup';
2
+ export var EntityInfoValidationSchema = yup.object().shape({
3
+ activities: yup.array().of(yup.object().shape({
4
+ ar: yup.string(),
5
+ en: yup.string()
6
+ })),
7
+ salesChannels: yup
8
+ .array()
9
+ .min(1, 'choose_atleast_one_channel')
10
+ .of(yup.object().shape({
11
+ id: yup.string(),
12
+ name_en: yup.string(),
13
+ name_ar: yup.string()
14
+ }))
15
+ .required('choose_atleast_one_channel'),
16
+ operationStartDate: yup.string().required('choose_any_business_date')
17
+ });
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface ResetPasswordSuccessProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: ResetPasswordSuccessProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import SuccessScreen from '../../../shared/SuccessScreen';
5
+ var ResetPasswordSuccess = function (_a) {
6
+ var t = useTranslation().t;
7
+ return (_jsx(SuccessScreen, { title: t("reset_password_success_title"), description: t("reset_password_success_description"), showEmailProviders: true }));
8
+ };
9
+ export default React.memo(ResetPasswordSuccess);
@@ -0,0 +1,3 @@
1
+ import ResetPasswordSuccess, { ResetPasswordSuccessProps } from './ResetPasswordSuccess';
2
+ export type { ResetPasswordSuccessProps };
3
+ export default ResetPasswordSuccess;
@@ -0,0 +1,2 @@
1
+ import ResetPasswordSuccess from './ResetPasswordSuccess';
2
+ export default ResetPasswordSuccess;
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface SuccessProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: SuccessProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { useTranslation } from 'react-i18next';
4
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
5
+ import { updateBoardSuccess, entitySelector } from '../../../app/entity/entityStore';
6
+ import SuccessScreen from '../../../shared/SuccessScreen';
7
+ var Success = function (_a) {
8
+ var t = useTranslation().t;
9
+ var dispatch = useAppDispatch();
10
+ var _b = useAppSelector(entitySelector), loading = _b.loading, error = _b.error;
11
+ var onSuccess = function () {
12
+ dispatch(updateBoardSuccess());
13
+ };
14
+ return (_jsx(SuccessScreen, { title: t('entity_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: loading, error: error || '' }));
15
+ };
16
+ export default React.memo(Success);
@@ -0,0 +1,3 @@
1
+ import Success, { SuccessProps } from './Success';
2
+ export type { SuccessProps };
3
+ export default Success;
@@ -0,0 +1,2 @@
1
+ import Success from './Success';
2
+ export default Success;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: React.MemoExoticComponent<() => JSX.Element>;
3
+ export default _default;
@@ -0,0 +1,110 @@
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 { memo, useEffect, useState } from 'react';
14
+ import { useTranslation } from 'react-i18next';
15
+ import { styled } from '@mui/material/styles';
16
+ import { FlowsButtons } from '../../../shared/Button';
17
+ import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
18
+ import { useAppSelector, useLanguage } from '../../../../hooks';
19
+ import { getResetFlowUrl, showLastFour } from '../../../../utils';
20
+ import { entitySelector } from '../../../app/entity/entityStore';
21
+ import Box from '@mui/material/Box';
22
+ import Text from '../../../../components/Text';
23
+ import Container from '../../../shared/Containers/ScreenContainer';
24
+ import AcceptancePayouts from '../../../shared/AcceptancePayouts';
25
+ import { settingsSelector } from '../../../../app/settings';
26
+ var TitleStyled = styled(Text)(function (_a) {
27
+ var _b;
28
+ var theme = _a.theme;
29
+ return (__assign(__assign({}, theme.typography.body1), (_b = { fontWeight: theme.typography.fontWeightBold, color: theme.palette.text.primary, lineHeight: 1.75, paddingBottom: theme.spacing(3) }, _b[theme.breakpoints.down('sm')] = {}, _b)));
30
+ });
31
+ var ContainerStyled = styled(Container)(function (_a) {
32
+ var theme = _a.theme;
33
+ return ({
34
+ justifyContent: 'space-between',
35
+ minHeight: theme.spacing(30),
36
+ alignItems: 'center'
37
+ });
38
+ });
39
+ var ButtonGroupStyled = styled(Box)(function (_a) {
40
+ var theme = _a.theme;
41
+ return ({
42
+ width: '100%',
43
+ paddingTop: theme.spacing(3)
44
+ });
45
+ });
46
+ var SuccessWithFlowButtons = function () {
47
+ var _a, _b, _c, _d;
48
+ var t = useTranslation().t;
49
+ var isAr = useLanguage().isAr;
50
+ var data = useAppSelector(entitySelector).data;
51
+ var _e = data.verify.responseBody || {}, flows = _e.flows, nameObj = _e.name, entity = _e.entity, brand = _e.brand, bank = _e.bank, merchant = _e.merchant, identification_id = _e.identification_id, vatID = _e.vatID, user = _e.user;
52
+ var _f = useState([]), buttons = _f[0], setButtons = _f[1];
53
+ var username = ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.first) || '') + ' ' + ((nameObj === null || nameObj === void 0 ? void 0 : nameObj.last) || '');
54
+ 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');
56
+ var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
57
+ var taxID = vatID || '';
58
+ 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
+ var isAcceptance = merchant === null || merchant === void 0 ? void 0 : merchant.is_acceptance_allowed;
60
+ var isPayout = merchant === null || merchant === void 0 ? void 0 : merchant.is_payout_allowed;
61
+ var identification = user.identification;
62
+ 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
+ var settings = useAppSelector(settingsSelector);
64
+ var _g = data.verify.responseBody || { contact: {}, board_id: '' }, contact = _g.contact, board_id = _g.board_id, board_info_id = _g.board_info_id;
65
+ var email = (contact || { email: '' }).email;
66
+ var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, board_id, board_info_id);
67
+ var reMapFlowData = function (flows) {
68
+ if (flows === void 0) { flows = []; }
69
+ var images = ICONS_NAMES;
70
+ var mappedFlows = flows
71
+ .filter(function (item) { return item.name; })
72
+ .map(function (_a) {
73
+ var name = _a.name, url = _a.url, status = _a.status;
74
+ var type = status === 'initiated' || status === 'in_progress' ? 'pending' : 'completed';
75
+ var title = t("".concat(name, "_flow_").concat(type), {
76
+ individual_name: username.toLowerCase() + maskedId,
77
+ business_type: brandName,
78
+ license_number: t('masking_symbols') + showLastFour(licenseNumber),
79
+ bank_name: bankName,
80
+ iban: t('masking_symbols') + iban,
81
+ tax_id: t('masking_symbols') + showLastFour(taxID)
82
+ });
83
+ var isCompleted = status === 'completed' && name !== 'password';
84
+ var isIndividual = name === 'individual';
85
+ var src = isCompleted ? "".concat(name, "_green_icon") : "".concat(name, "_filled_icon");
86
+ var hoverSrc = "".concat(name, "_white_icon");
87
+ return {
88
+ name: name,
89
+ status: status,
90
+ title: title,
91
+ href: url,
92
+ src: images[src],
93
+ hoverSrc: images[hoverSrc],
94
+ isCompleted: isCompleted,
95
+ sx: isIndividual ? { textTransform: 'capitalize' } : {}
96
+ };
97
+ });
98
+ setButtons(mappedFlows);
99
+ };
100
+ useEffect(function () {
101
+ if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
102
+ reMapFlowData(flows);
103
+ }, [flows, isAr]);
104
+ return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, data: {
105
+ flowName: data.flowName,
106
+ email: email,
107
+ emailUrl: url
108
+ } }) })] }));
109
+ };
110
+ export default memo(SuccessWithFlowButtons);
@@ -0,0 +1,2 @@
1
+ import SuccessWithFlowButtons from './SuccessWithFlowButtons';
2
+ export default SuccessWithFlowButtons;
@@ -0,0 +1,2 @@
1
+ import SuccessWithFlowButtons from './SuccessWithFlowButtons';
2
+ export default SuccessWithFlowButtons;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ export interface OTPProps {
3
+ loading: boolean;
4
+ setLoading: (flag: boolean) => void;
5
+ }
6
+ declare const _default: React.MemoExoticComponent<({ loading, setLoading }: OTPProps) => JSX.Element>;
7
+ export default _default;
@@ -0,0 +1,47 @@
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 } from "react/jsx-runtime";
13
+ import * as React from 'react';
14
+ import Box from '@mui/material/Box/Box';
15
+ import { styled } from '@mui/material/styles';
16
+ import OTPField from '../../../shared/OTP';
17
+ import { useController, useFormContext } from 'react-hook-form';
18
+ import { useTranslation } from 'react-i18next';
19
+ import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
+ import { useAppDispatch } from '../../../../hooks';
21
+ import { resendOTP } from '../../../app/entity/entityStore';
22
+ var BoxStyled = styled(Box)(function (_a) {
23
+ var theme = _a.theme;
24
+ return ({
25
+ display: 'flex',
26
+ flexDirection: 'column',
27
+ fontFamily: theme.typography.fontFamily
28
+ });
29
+ });
30
+ var OTPInput = function (_a) {
31
+ var loading = _a.loading, setLoading = _a.setLoading;
32
+ var _b = useFormContext(), control = _b.control, setValue = _b.setValue;
33
+ var t = useTranslation().t;
34
+ var otpControl = useController({ name: 'otp', control: control });
35
+ var dispatch = useAppDispatch();
36
+ var handleOnOTPChange = function (otp) {
37
+ otpControl.field.onChange(otp);
38
+ };
39
+ var handleOnResendOTP = function () {
40
+ if (otpControl.field.value)
41
+ setValue('otp', '', { shouldValidate: true });
42
+ dispatch(resendOTP());
43
+ };
44
+ var otpValue = otpControl.field.value;
45
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
46
+ };
47
+ export default React.memo(OTPInput);
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface OTPProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<({}: OTPProps) => JSX.Element>;
5
+ export default _default;
@@ -0,0 +1,78 @@
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, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import * as React from 'react';
14
+ import { useAppDispatch } from '../../../../hooks';
15
+ import { useTranslation } from 'react-i18next';
16
+ import { useForm, FormProvider } from 'react-hook-form';
17
+ import { yupResolver } from '@hookform/resolvers/yup';
18
+ import Box from '@mui/material/Box/Box';
19
+ import { styled } from '@mui/material/styles';
20
+ import { handlePrevScreenStep } from '../../../../app/settings';
21
+ import { useLanguage, useAppSelector } from '../../../../hooks';
22
+ import { maskPhone } from '../../../../utils';
23
+ import Form from '../../../../components/Form';
24
+ import Text from '../../../../components/Text';
25
+ import { ScreenContainer } from '../../../shared/Containers';
26
+ import { entitySelector, clearError, resetOTPScreen, verifyEntityLeadOTP } from '../../../app/entity/entityStore';
27
+ import Button from '../../../shared/Button';
28
+ import { OTPValidation } from './validation';
29
+ import OTPInput from './OTPInput';
30
+ var OTPTitleContainerStyled = styled(Box)(function (_a) {
31
+ var theme = _a.theme;
32
+ return ({
33
+ background: theme.palette.common.white,
34
+ border: '1px solid',
35
+ borderColor: theme.palette.divider,
36
+ direction: theme.direction,
37
+ borderRadius: theme.spacing(0, 0, 1.25, 1.25),
38
+ marginBottom: theme.spacing(5.75)
39
+ });
40
+ });
41
+ var OTPTitleStyled = styled(Text)(function (_a) {
42
+ var theme = _a.theme;
43
+ return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightLight, marginBlock: theme.spacing(1.75), marginInlineStart: theme.spacing(2.5), lineHeight: 1.75 }));
44
+ });
45
+ var FormStyled = styled(Form)(function () { return ({
46
+ display: 'flex',
47
+ flexDirection: 'column'
48
+ }); });
49
+ var VerifyNumber = function (_a) {
50
+ var _b, _c, _d;
51
+ var dispatch = useAppDispatch();
52
+ var _e = useAppSelector(entitySelector), data = _e.data, loading = _e.loading, error = _e.error;
53
+ var methods = useForm({
54
+ resolver: yupResolver(OTPValidation),
55
+ defaultValues: data.otpData,
56
+ mode: 'onChange'
57
+ });
58
+ var t = useTranslation().t;
59
+ var isAr = useLanguage().isAr;
60
+ var _f = React.useState(false), resendLoading = _f[0], setResendLoading = _f[1];
61
+ 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
+ React.useEffect(function () {
63
+ if (error && methods.formState.isValid && phone)
64
+ dispatch(clearError());
65
+ return function () {
66
+ dispatch(resetOTPScreen());
67
+ };
68
+ }, [methods.formState.isValid]);
69
+ var onSubmit = function (formData) {
70
+ dispatch(verifyEntityLeadOTP(formData));
71
+ };
72
+ var onBack = function () {
73
+ dispatch(handlePrevScreenStep());
74
+ };
75
+ var disabled = !methods.formState.isValid || !!error || !phone || resendLoading;
76
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(OTPTitleContainerStyled, { children: _jsxs(OTPTitleStyled, { children: [loading ? t('ide_otp_waiting_title') : t('ide_opt_sent_title'), !loading && phone && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, { loading: resendLoading, setLoading: setResendLoading }), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
77
+ };
78
+ export default React.memo(VerifyNumber);
@@ -0,0 +1,2 @@
1
+ import OTP from './Verify';
2
+ export default OTP;
@@ -0,0 +1,2 @@
1
+ import OTP from './Verify';
2
+ export default OTP;