@tap-payments/auth-jsconnect 2.8.73-development → 2.8.75-beta

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 (110) hide show
  1. package/build/@types/form.d.ts +1 -1
  2. package/build/api/auth.d.ts +0 -13
  3. package/build/api/index.d.ts +2 -2
  4. package/build/api/lead.d.ts +0 -6
  5. package/build/assets/locales/ar.json +1 -10
  6. package/build/assets/locales/en.json +1 -10
  7. package/build/components/Tooltip/Tooltip.js +1 -1
  8. package/build/constants/api.d.ts +1 -0
  9. package/build/constants/api.js +2 -0
  10. package/build/constants/app.d.ts +2 -1
  11. package/build/constants/app.js +14 -35
  12. package/build/constants/assets.d.ts +0 -2
  13. package/build/constants/assets.js +0 -2
  14. package/build/features/app/auth/authStore.d.ts +15 -5
  15. package/build/features/app/auth/authStore.js +113 -58
  16. package/build/features/app/business/businessStore.d.ts +11 -16
  17. package/build/features/app/business/businessStore.js +44 -58
  18. package/build/features/app/connect/connectStore.d.ts +12 -19
  19. package/build/features/app/connect/connectStore.js +82 -151
  20. package/build/features/app/connectExpress/connectExpressStore.d.ts +33 -10
  21. package/build/features/app/connectExpress/connectExpressStore.js +251 -156
  22. package/build/features/app/individual/individualStore.js +2 -4
  23. package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +2 -2
  24. package/build/features/auth/screens/AuthenticationList/LicenseNumber.js +2 -2
  25. package/build/features/auth/screens/NID/DOB.d.ts +6 -0
  26. package/build/features/auth/screens/NID/DOB.js +47 -0
  27. package/build/features/auth/screens/NID/IDNumber.js +1 -1
  28. package/build/features/auth/screens/NID/NID.js +10 -4
  29. package/build/features/auth/screens/NID/validation.d.ts +3 -0
  30. package/build/features/auth/screens/NID/validation.js +1 -0
  31. package/build/features/auth/screens/OTP/OTP.js +5 -1
  32. package/build/features/auth/screens/OTP/OTPInput.js +13 -2
  33. package/build/features/business/screens/BusinessType/LicenseNumber.js +2 -2
  34. package/build/features/business/screens/OTP/OTP.d.ts +8 -0
  35. package/build/features/business/screens/OTP/OTP.js +90 -0
  36. package/build/features/business/screens/OTP/OTPInput.d.ts +5 -0
  37. package/build/features/business/screens/OTP/OTPInput.js +49 -0
  38. package/build/features/business/screens/OTP/index.d.ts +3 -0
  39. package/build/features/business/screens/OTP/index.js +2 -0
  40. package/build/features/business/screens/OTP/validation.d.ts +8 -0
  41. package/build/features/business/screens/OTP/validation.js +4 -0
  42. package/build/features/connect/screens/Mobile/Mobile.js +2 -2
  43. package/build/features/connect/screens/NID/DOB.d.ts +5 -0
  44. package/build/features/connect/screens/NID/DOB.js +47 -0
  45. package/build/features/connect/screens/NID/IDNumber.d.ts +0 -1
  46. package/build/features/connect/screens/NID/IDNumber.js +2 -2
  47. package/build/features/connect/screens/NID/NID.js +11 -5
  48. package/build/features/connect/screens/NID/validation.d.ts +3 -0
  49. package/build/features/connect/screens/NID/validation.js +1 -0
  50. package/build/features/connect/screens/OTP/OTPInput.js +11 -3
  51. package/build/features/connectExpress/screens/AuthenticationList/LicenseNumber.js +2 -2
  52. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseNumber.js +2 -2
  53. package/build/features/{auth/screens/VerifyNafath/VerifyNafath.d.ts → connectExpress/screens/IdentityOTP/OTP.d.ts} +2 -2
  54. package/build/features/connectExpress/screens/IdentityOTP/OTP.js +88 -0
  55. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.d.ts +5 -0
  56. package/build/features/connectExpress/screens/IdentityOTP/OTPInput.js +56 -0
  57. package/build/features/connectExpress/screens/IdentityOTP/index.d.ts +3 -0
  58. package/build/features/connectExpress/screens/IdentityOTP/index.js +2 -0
  59. package/build/features/connectExpress/screens/IdentityOTP/validation.d.ts +8 -0
  60. package/build/features/connectExpress/screens/IdentityOTP/validation.js +4 -0
  61. package/build/features/connectExpress/screens/Mobile/Mobile.js +2 -2
  62. package/build/features/connectExpress/screens/NID/DOB.d.ts +6 -0
  63. package/build/features/connectExpress/screens/NID/DOB.js +47 -0
  64. package/build/features/connectExpress/screens/NID/IDNumber.d.ts +0 -1
  65. package/build/features/connectExpress/screens/NID/IDNumber.js +2 -2
  66. package/build/features/connectExpress/screens/NID/NID.js +9 -4
  67. package/build/features/connectExpress/screens/NID/validation.d.ts +3 -0
  68. package/build/features/connectExpress/screens/NID/validation.js +2 -0
  69. package/build/features/connectExpress/screens/NIDMissed/NID.js +2 -2
  70. package/build/features/connectExpress/screens/OTP/OTP.js +13 -5
  71. package/build/features/connectExpress/screens/OTP/OTPInput.js +11 -3
  72. package/build/features/entity/screens/EntityName/LicenseNumber.js +2 -2
  73. package/build/features/featuresScreens.js +6 -21
  74. package/build/features/shared/Button/AbsherButton.d.ts +7 -0
  75. package/build/features/shared/Button/{NafathButton.js → AbsherButton.js} +3 -13
  76. package/build/features/shared/Button/index.d.ts +2 -2
  77. package/build/features/shared/Button/index.js +2 -2
  78. package/build/theme/palette.js +1 -2
  79. package/build/utils/common.js +4 -4
  80. package/build/utils/validation.d.ts +1 -0
  81. package/build/utils/validation.js +3 -0
  82. package/package.json +2 -2
  83. package/build/features/auth/screens/VerifyNafath/VerifyNafath.js +0 -34
  84. package/build/features/auth/screens/VerifyNafath/index.d.ts +0 -3
  85. package/build/features/auth/screens/VerifyNafath/index.js +0 -2
  86. package/build/features/business/screens/VerifyNafath/VerifyNafath.d.ts +0 -5
  87. package/build/features/business/screens/VerifyNafath/VerifyNafath.js +0 -34
  88. package/build/features/business/screens/VerifyNafath/index.d.ts +0 -3
  89. package/build/features/business/screens/VerifyNafath/index.js +0 -2
  90. package/build/features/connect/screens/VerifyNafath/VerifyNafath.d.ts +0 -5
  91. package/build/features/connect/screens/VerifyNafath/VerifyNafath.js +0 -34
  92. package/build/features/connect/screens/VerifyNafath/index.d.ts +0 -3
  93. package/build/features/connect/screens/VerifyNafath/index.js +0 -2
  94. package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.d.ts +0 -5
  95. package/build/features/connectExpress/screens/IdentityVerifyNafath/IdentityVerifyNafath.js +0 -34
  96. package/build/features/connectExpress/screens/IdentityVerifyNafath/index.d.ts +0 -3
  97. package/build/features/connectExpress/screens/IdentityVerifyNafath/index.js +0 -2
  98. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.d.ts +0 -5
  99. package/build/features/connectExpress/screens/VerifyNafath/VerifyNafath.js +0 -34
  100. package/build/features/connectExpress/screens/VerifyNafath/index.d.ts +0 -3
  101. package/build/features/connectExpress/screens/VerifyNafath/index.js +0 -2
  102. package/build/features/shared/Button/NafathButton.d.ts +0 -7
  103. package/build/features/shared/NafathVerification/NafathVerification.d.ts +0 -13
  104. package/build/features/shared/NafathVerification/NafathVerification.js +0 -92
  105. package/build/features/shared/NafathVerification/VerifyNafathLoading.d.ts +0 -8
  106. package/build/features/shared/NafathVerification/VerifyNafathLoading.js +0 -53
  107. package/build/features/shared/NafathVerification/VerifyNafathSuccess.d.ts +0 -5
  108. package/build/features/shared/NafathVerification/VerifyNafathSuccess.js +0 -8
  109. package/build/features/shared/NafathVerification/index.d.ts +0 -2
  110. package/build/features/shared/NafathVerification/index.js +0 -2
@@ -3,7 +3,6 @@ import MobileScreen from './connect/screens/Mobile';
3
3
  import NIDScreen from './connect/screens/NID';
4
4
  import ConnectCivilIDScreen from '../features/connect/screens/CivilID';
5
5
  import ConnectVerifyPACIScreen from './connect/screens/VerifyPACI';
6
- import ConnectVerifyNafathScreen from './connect/screens/VerifyNafath';
7
6
  import IndividualScreen from './connect/screens/Individual';
8
7
  import MerchantInfoScreen from './connect/screens/Merchant';
9
8
  import BrandSegmentInfoScreen from './connect/screens/BrandSegment';
@@ -13,14 +12,13 @@ import OperatorError from './connect/screens/OperatorError';
13
12
  import ConnectExpressBusinessCountry from './connectExpress/screens/BusinessCountry/BusinessCountry';
14
13
  import ConnectExpressMobileScreen from './connectExpress/screens/Mobile';
15
14
  import ConnectExpressNIDScreen from './connectExpress/screens/NID';
16
- import ConnectExpressVerifyNafathScreen from './connectExpress/screens/VerifyNafath';
17
15
  import ConnectExpressCivilIDScreen from './connectExpress/screens/CivilID';
18
16
  import ConnectExpressVerifyPACIScreen from './connectExpress/screens/VerifyPACI';
19
17
  import ConnectExpressOTPScreen from './connectExpress/screens/OTP';
20
18
  import ConnectExpressNIDMissedScreen from './connectExpress/screens/NIDMissed';
21
19
  import ConnectExpressCivilIDMissedScreen from './connectExpress/screens/CivilIDMissed';
22
20
  import ConnectExpressIdentityVerifyPACIScreen from './connectExpress/screens/IdentityVerifyPACI';
23
- import ConnectExpressIdentityVerifyNafathScreen from './connectExpress/screens/IdentityVerifyNafath';
21
+ import ConnectExpressIdentityVerifyOTPScreen from './connectExpress/screens/IdentityOTP';
24
22
  import ConnectExpressCollectIndividualScreen from './connectExpress/screens/CollectIndividualInfo';
25
23
  import ConnectExpressCollectBusinessScreen from './connectExpress/screens/CollectBusinessInfo';
26
24
  import ConnectExpressCreateAccountLoaderScreen from './connectExpress/screens/CreateAccountLoader';
@@ -38,7 +36,6 @@ import AuthNIDScreen from './auth/screens/NID';
38
36
  import AuthEmailScreen from './auth/screens/Email';
39
37
  import AuthCivilIDScreen from './auth/screens/CivilID';
40
38
  import AuthVerifyPACIScreen from './auth/screens/VerifyPACI';
41
- import AuthVerifyNafathScreen from './auth/screens/VerifyNafath';
42
39
  import AuthOTPScreen from './auth/screens/OTP';
43
40
  import AuthPasswordScreen from './auth/screens/Password';
44
41
  import AuthResetPasswordMessageScreen from './auth/screens/ResetPasswordMessage';
@@ -53,7 +50,7 @@ import AuthOperatorError from './auth/screens/OperatorError';
53
50
  import CustomersPage from './business/screens/Customers';
54
51
  import IDBODPage from './business/screens/IDBOD';
55
52
  import BusinessVerifyPage from './business/screens/Verify';
56
- import BusinessVerifyNafathPage from './business/screens/VerifyNafath';
53
+ import BusinessOTPPage from './business/screens/OTP';
57
54
  import BusinessTypePage from './business/screens/BusinessType';
58
55
  import ActivitiesPage from './business/screens/Activities';
59
56
  import SuccessPage from './business/screens/Success';
@@ -147,10 +144,6 @@ export var connectFeatureScreens = [
147
144
  name: 'CONNECT_VERIFY_PACI_STEP',
148
145
  element: ConnectVerifyPACIScreen
149
146
  },
150
- {
151
- name: 'CONNECT_VERIFY_NAFATH_STEP',
152
- element: ConnectVerifyNafathScreen
153
- },
154
147
  {
155
148
  name: 'CONNECT_INDIVIDUAL_STEP',
156
149
  element: IndividualScreen
@@ -193,10 +186,6 @@ export var connectExpressFeatureScreens = [
193
186
  name: 'CONNECT_EXPRESS_OTP_STEP',
194
187
  element: ConnectExpressOTPScreen
195
188
  },
196
- {
197
- name: 'CONNECT_EXPRESS_VERIFY_NAFATH_STEP',
198
- element: ConnectExpressVerifyNafathScreen
199
- },
200
189
  {
201
190
  name: 'CONNECT_EXPRESS_VERIFY_PACI_STEP',
202
191
  element: ConnectExpressVerifyPACIScreen
@@ -214,8 +203,8 @@ export var connectExpressFeatureScreens = [
214
203
  element: ConnectExpressIdentityVerifyPACIScreen
215
204
  },
216
205
  {
217
- name: 'CONNECT_EXPRESS_IDENTITY_VERIFY_NAFATH_STEP',
218
- element: ConnectExpressIdentityVerifyNafathScreen
206
+ name: 'CONNECT_EXPRESS_OTP_IDENTITY_STEP',
207
+ element: ConnectExpressIdentityVerifyOTPScreen
219
208
  },
220
209
  {
221
210
  name: 'CONNECT_EXPRESS_WAITING_FOR_CREATING_ACCOUNT_STEP',
@@ -299,10 +288,6 @@ export var authFeatureScreens = [
299
288
  name: 'AUTH_VERIFY_PACI_STEP',
300
289
  element: AuthVerifyPACIScreen
301
290
  },
302
- {
303
- name: 'AUTH_NAFATH_VERIFY_STEP',
304
- element: AuthVerifyNafathScreen
305
- },
306
291
  {
307
292
  name: 'AUTH_ACCOUNT_NOT_FOUND_STEP',
308
293
  element: AccountNotFoundScreen
@@ -354,8 +339,8 @@ export var businessFeatureScreens = [
354
339
  element: BusVerifyPACIScreen
355
340
  },
356
341
  {
357
- name: 'BUSINESS_VERIFY_NAFATH_STEP',
358
- element: BusinessVerifyNafathPage
342
+ name: 'BUSINESS_OTP_STEP',
343
+ element: BusinessOTPPage
359
344
  },
360
345
  {
361
346
  name: 'BUSINESS_BUSINESS_TYPE_STEP',
@@ -0,0 +1,7 @@
1
+ import { ButtonProps } from '../../../components/Button';
2
+ interface AbsherButtonProps extends ButtonProps {
3
+ loading?: boolean;
4
+ hideIcon?: boolean;
5
+ }
6
+ export default function AbsherButton({ children, hideIcon, disabled, ...props }: AbsherButtonProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -28,7 +28,7 @@ import Box from '@mui/material/Box';
28
28
  import { ICONS_NAMES } from '../../../constants';
29
29
  var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'disabled'; } })(function (_a) {
30
30
  var theme = _a.theme, disabled = _a.disabled;
31
- return (__assign({ width: theme.spacing(3), height: theme.spacing(3) }, (disabled && {
31
+ return (__assign({ width: theme.spacing(3), height: theme.spacing(3), marginInlineStart: theme.spacing(0.75) }, (disabled && {
32
32
  opacity: 0.3
33
33
  })));
34
34
  });
@@ -38,19 +38,9 @@ var ButtonBoxStyled = styled(Box)(function (_a) {
38
38
  margin: theme.spacing(0, 2.5, 2.5, 2.5)
39
39
  });
40
40
  });
41
- var ButtonStyled = styled(Button)(function (_a) {
42
- var theme = _a.theme;
43
- return ({
44
- paddingInlineStart: theme.spacing(1.75),
45
- fontWeight: theme.typography.fontWeightRegular,
46
- '& .MuiButton-startIcon': {
47
- margin: theme.spacing(0)
48
- }
49
- });
50
- });
51
- export default function NafathButton(_a) {
41
+ export default function AbsherButton(_a) {
52
42
  var children = _a.children, hideIcon = _a.hideIcon, disabled = _a.disabled, props = __rest(_a, ["children", "hideIcon", "disabled"]);
53
43
  var theme = useTheme();
54
44
  var btnColor = theme.palette.primary.light;
55
- return (_jsx(ButtonBoxStyled, { children: _jsx(ButtonStyled, __assign({ outLineColor: btnColor, variant: 'outlined', disabled: disabled, type: 'button', startIcon: !hideIcon && _jsx(IconStyled, { disabled: disabled, src: ICONS_NAMES.NAFATH_LOGO }) }, props, { children: children })) }));
45
+ return (_jsx(ButtonBoxStyled, { children: _jsx(Button, __assign({ outLineColor: btnColor, variant: 'outlined', disabled: disabled, type: 'button', startIcon: !hideIcon && _jsx(IconStyled, { disabled: disabled, src: ICONS_NAMES.ABSHER_LOGO }) }, props, { children: children })) }));
56
46
  }
@@ -1,9 +1,9 @@
1
1
  import Button from './Button';
2
- import NafathButton from './NafathButton';
2
+ import AbsherButton from './AbsherButton';
3
3
  import MobileButton from './MobileButton';
4
4
  import EmailProvidersButton from './EmailProvidersButtons';
5
5
  import FlowsButtons from './FlowsButtons';
6
6
  import SuccessButton from './SuccessButton';
7
7
  import ListButton from './IndividualActionButtons';
8
- export { NafathButton, MobileButton, EmailProvidersButton, FlowsButtons, SuccessButton, Button, ListButton };
8
+ export { AbsherButton, MobileButton, EmailProvidersButton, FlowsButtons, SuccessButton, Button, ListButton };
9
9
  export default Button;
@@ -1,9 +1,9 @@
1
1
  import Button from './Button';
2
- import NafathButton from './NafathButton';
2
+ import AbsherButton from './AbsherButton';
3
3
  import MobileButton from './MobileButton';
4
4
  import EmailProvidersButton from './EmailProvidersButtons';
5
5
  import FlowsButtons from './FlowsButtons';
6
6
  import SuccessButton from './SuccessButton';
7
7
  import ListButton from './IndividualActionButtons';
8
- export { NafathButton, MobileButton, EmailProvidersButton, FlowsButtons, SuccessButton, Button, ListButton };
8
+ export { AbsherButton, MobileButton, EmailProvidersButton, FlowsButtons, SuccessButton, Button, ListButton };
9
9
  export default Button;
@@ -4,8 +4,7 @@ export var lightPalette = {
4
4
  primary: {
5
5
  main: '#007aff',
6
6
  dark: '#9CA0A94D',
7
- light: '#0A9A8F',
8
- contrastText: '#e2e0f8'
7
+ light: '#0E9346'
9
8
  },
10
9
  success: {
11
10
  light: '#2CCE01',
@@ -1,5 +1,5 @@
1
1
  import { axiosInstance } from '../api';
2
- import { ENDPOINT_PATHS, CONNECT_DEV_URL, CONNECT_PROD_URL } from '../constants';
2
+ import { ENDPOINT_PATHS, CONNECT_SANDBOX_URL, CONNECT_BETA_URL } from '../constants';
3
3
  export var sleep = function (milliseconds) {
4
4
  if (milliseconds === void 0) { milliseconds = 1000; }
5
5
  return new Promise(function (resolve) { return setTimeout(resolve, milliseconds); });
@@ -13,10 +13,10 @@ export var dangerousMessage = function (message, callBack) {
13
13
  export var setBaseUrl = function (publicKey) {
14
14
  var isProd = publicKey.includes('pk_live');
15
15
  if (isProd) {
16
- axiosInstance.defaults.baseURL = ENDPOINT_PATHS.PRODUCTION_BASE_URL;
16
+ axiosInstance.defaults.baseURL = ENDPOINT_PATHS.BETA_BASE_URL;
17
17
  return;
18
18
  }
19
- axiosInstance.defaults.baseURL = ENDPOINT_PATHS.DEV_BASE_URL;
19
+ axiosInstance.defaults.baseURL = ENDPOINT_PATHS.SANDBOX_BASE_URL;
20
20
  };
21
21
  export var updateLocationUrlWithCountry = function (countryIso2) {
22
22
  var country = countryIso2.toLowerCase();
@@ -35,7 +35,7 @@ export var updateLocationUrlWithCountry = function (countryIso2) {
35
35
  window.history.replaceState({}, '', newUrl);
36
36
  };
37
37
  export var openConnect = function (pk, countryCode) {
38
- var newUrl = new URL(pk.includes('pk_live') ? CONNECT_PROD_URL : CONNECT_DEV_URL);
38
+ var newUrl = new URL(pk.includes('pk_live') ? CONNECT_BETA_URL : CONNECT_SANDBOX_URL);
39
39
  if (countryCode) {
40
40
  newUrl.pathname = "/".concat(countryCode.toLowerCase());
41
41
  }
@@ -6,6 +6,7 @@ export declare const removeAllOtherThanAlphabetAndSpace: (str: string) => string
6
6
  export declare const removeAllNumberFromChars: (str: string) => string;
7
7
  export declare const keepEmailCharacters: (str: string) => string;
8
8
  export declare const removeAllOtherThanCharsAndNumber: (str: string) => string;
9
+ export declare const cleanFLandCRNumber: (str: string) => string;
9
10
  export declare const removeAllOtherThanCharsNumberSlashAndHyphen: (str: string) => string;
10
11
  export declare const removeAllOtherThanCharsNumbersAtAndDot: (str: string) => string;
11
12
  export declare const removeAllOtherThanCharsNumbersAndSpace: (str: string) => string;
@@ -22,6 +22,9 @@ export var keepEmailCharacters = function (str) {
22
22
  export var removeAllOtherThanCharsAndNumber = function (str) {
23
23
  return str.replace(/[^A-Za-z0-9]/g, '');
24
24
  };
25
+ export var cleanFLandCRNumber = function (str) {
26
+ return str.replace(/[^a-zA-Z0-9_-]/g, '');
27
+ };
25
28
  export var removeAllOtherThanCharsNumberSlashAndHyphen = function (str) {
26
29
  return str.replace(/[^A-Za-z0-9/-]/g, '');
27
30
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.8.73-development",
3
+ "version": "2.8.75-beta",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",
@@ -21,7 +21,7 @@
21
21
  "copy:files": "copyfiles -u 1 src/**/*.css build/",
22
22
  "tsc:alias": "tsc-alias -p tsconfig.json",
23
23
  "ts:build": "rm -rf build && tsc -p tsconfig.json && tsc-alias -p tsconfig.json && yarn copy:files",
24
- "push": "npm publish --access public --tag development"
24
+ "push": "npm publish --access public --tag beta"
25
25
  },
26
26
  "keywords": [],
27
27
  "author": {
@@ -1,34 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as React from 'react';
3
- import { authSelector, verifyNafath as verifyNafathFun } from '../../../app/auth/authStore';
4
- import NafathVerification from '../../../shared/NafathVerification';
5
- import { handlePrevScreenStep } from '../../../../app/settings';
6
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
7
- var VerifyNafath = function () {
8
- var _a;
9
- var _b = React.useState(false), success = _b[0], setSuccess = _b[1];
10
- var _c = React.useState(false), isReady = _c[0], setIsReady = _c[1];
11
- var dispatch = useAppDispatch();
12
- var data = useAppSelector(authSelector).data;
13
- var _d = ((_a = data.responseData) === null || _a === void 0 ? void 0 : _a.authResponse) || {}, expiry = _d.expiry, app_url_android = _d.app_url_android, app_url_ios = _d.app_url_ios, random = _d.random;
14
- React.useEffect(function () {
15
- if (data.responseData && !isReady) {
16
- setIsReady(true);
17
- }
18
- }, [data.responseData]);
19
- React.useEffect(function () {
20
- if (!isReady)
21
- return;
22
- var promise = dispatch(verifyNafathFun({ onSuccess: function () { return setSuccess(true); } }));
23
- return function () {
24
- promise === null || promise === void 0 ? void 0 : promise.abort();
25
- };
26
- }, [isReady]);
27
- var onBack = React.useCallback(function () {
28
- dispatch(handlePrevScreenStep());
29
- }, []);
30
- if (!isReady)
31
- return null;
32
- return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
33
- };
34
- export default React.memo(VerifyNafath);
@@ -1,3 +0,0 @@
1
- import VerifyNafath, { VerifyNafathProps } from './VerifyNafath';
2
- export type { VerifyNafathProps };
3
- export default VerifyNafath;
@@ -1,2 +0,0 @@
1
- import VerifyNafath from './VerifyNafath';
2
- export default VerifyNafath;
@@ -1,5 +0,0 @@
1
- import * as React from 'react';
2
- export interface VerifyNafathProps {
3
- }
4
- declare const _default: React.MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element | null>;
5
- export default _default;
@@ -1,34 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as React from 'react';
3
- import { businessSelector, verifyNafath } from '../../../app/business/businessStore';
4
- import NafathVerification from '../../../shared/NafathVerification';
5
- import { handlePrevScreenStep } from '../../../../app/settings';
6
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
7
- var VerifyNafath = function () {
8
- var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
9
- var _b = React.useState(false), isReady = _b[0], setIsReady = _b[1];
10
- var dispatch = useAppDispatch();
11
- var data = useAppSelector(businessSelector).data;
12
- var responseBody = data.nidData.responseBody;
13
- var _c = responseBody || {}, expiry = _c.expiry, app_url_android = _c.app_url_android, app_url_ios = _c.app_url_ios, random = _c.random;
14
- React.useEffect(function () {
15
- if (responseBody && !isReady) {
16
- setIsReady(true);
17
- }
18
- }, [responseBody]);
19
- React.useEffect(function () {
20
- if (!isReady)
21
- return;
22
- var promise = dispatch(verifyNafath({ onSuccess: function () { return setSuccess(true); } }));
23
- return function () {
24
- promise === null || promise === void 0 ? void 0 : promise.abort();
25
- };
26
- }, [isReady]);
27
- var onBack = React.useCallback(function () {
28
- dispatch(handlePrevScreenStep());
29
- }, []);
30
- if (!isReady)
31
- return null;
32
- return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
33
- };
34
- export default React.memo(VerifyNafath);
@@ -1,3 +0,0 @@
1
- import VerifyNafath, { VerifyNafathProps } from './VerifyNafath';
2
- export type { VerifyNafathProps };
3
- export default VerifyNafath;
@@ -1,2 +0,0 @@
1
- import VerifyNafath from './VerifyNafath';
2
- export default VerifyNafath;
@@ -1,5 +0,0 @@
1
- import * as React from 'react';
2
- export interface VerifyNafathProps {
3
- }
4
- declare const _default: React.MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element | null>;
5
- export default _default;
@@ -1,34 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as React from 'react';
3
- import { connectSelector, verifyNafath as verifyNafathFun } from '../../../app/connect/connectStore';
4
- import NafathVerification from '../../../shared/NafathVerification';
5
- import { handlePrevScreenStep } from '../../../../app/settings';
6
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
7
- var VerifyNafath = function () {
8
- var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
9
- var _b = React.useState(false), isReady = _b[0], setIsReady = _b[1];
10
- var dispatch = useAppDispatch();
11
- var data = useAppSelector(connectSelector).data;
12
- var responseBody = data.nidData.responseBody;
13
- var _c = responseBody || {}, expiry = _c.expiry, app_url_android = _c.app_url_android, app_url_ios = _c.app_url_ios, random = _c.random;
14
- React.useEffect(function () {
15
- if (responseBody && !isReady) {
16
- setIsReady(true);
17
- }
18
- }, [responseBody]);
19
- React.useEffect(function () {
20
- if (!isReady)
21
- return;
22
- var promise = dispatch(verifyNafathFun({ onSuccess: function () { return setSuccess(true); } }));
23
- return function () {
24
- promise === null || promise === void 0 ? void 0 : promise.abort();
25
- };
26
- }, [isReady]);
27
- var onBack = React.useCallback(function () {
28
- dispatch(handlePrevScreenStep());
29
- }, []);
30
- if (!isReady)
31
- return null;
32
- return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
33
- };
34
- export default React.memo(VerifyNafath);
@@ -1,3 +0,0 @@
1
- import VerifyNafath, { VerifyNafathProps } from './VerifyNafath';
2
- export type { VerifyNafathProps };
3
- export default VerifyNafath;
@@ -1,2 +0,0 @@
1
- import VerifyNafath from './VerifyNafath';
2
- export default VerifyNafath;
@@ -1,5 +0,0 @@
1
- import * as React from 'react';
2
- export interface IdentityVerifyNafathProps {
3
- }
4
- declare const _default: React.MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element | null>;
5
- export default _default;
@@ -1,34 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as React from 'react';
3
- import { connectExpressSelector, verifyNafathIdentityAsync } from '../../../app/connectExpress/connectExpressStore';
4
- import NafathVerification from '../../../shared/NafathVerification';
5
- import { handlePrevScreenStep } from '../../../../app/settings';
6
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
7
- var IdentityVerifyNafath = function () {
8
- var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
9
- var _b = React.useState(false), isReady = _b[0], setIsReady = _b[1];
10
- var dispatch = useAppDispatch();
11
- var data = useAppSelector(connectExpressSelector).data;
12
- var authData = (data.responseData || {}).authData;
13
- var _c = authData || {}, expiry = _c.expiry, app_url_android = _c.app_url_android, app_url_ios = _c.app_url_ios, random = _c.random;
14
- React.useEffect(function () {
15
- if (authData && !isReady) {
16
- setIsReady(true);
17
- }
18
- }, [authData]);
19
- React.useEffect(function () {
20
- if (!isReady)
21
- return;
22
- var promise = dispatch(verifyNafathIdentityAsync({ onSuccess: function () { return setSuccess(true); } }));
23
- return function () {
24
- promise === null || promise === void 0 ? void 0 : promise.abort();
25
- };
26
- }, [isReady]);
27
- var onBack = React.useCallback(function () {
28
- dispatch(handlePrevScreenStep());
29
- }, []);
30
- if (!isReady)
31
- return null;
32
- return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
33
- };
34
- export default React.memo(IdentityVerifyNafath);
@@ -1,3 +0,0 @@
1
- import IdentityVerifyNafath, { IdentityVerifyNafathProps } from './IdentityVerifyNafath';
2
- export type { IdentityVerifyNafathProps };
3
- export default IdentityVerifyNafath;
@@ -1,2 +0,0 @@
1
- import IdentityVerifyNafath from './IdentityVerifyNafath';
2
- export default IdentityVerifyNafath;
@@ -1,5 +0,0 @@
1
- import * as React from 'react';
2
- export interface VerifyNafathProps {
3
- }
4
- declare const _default: React.MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element | null>;
5
- export default _default;
@@ -1,34 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import * as React from 'react';
3
- import { connectExpressSelector, verifyNafathAsync } from '../../../app/connectExpress/connectExpressStore';
4
- import NafathVerification from '../../../shared/NafathVerification';
5
- import { handlePrevScreenStep } from '../../../../app/settings';
6
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
7
- var VerifyNafath = function () {
8
- var _a = React.useState(false), success = _a[0], setSuccess = _a[1];
9
- var _b = React.useState(false), isReady = _b[0], setIsReady = _b[1];
10
- var dispatch = useAppDispatch();
11
- var data = useAppSelector(connectExpressSelector).data;
12
- var authData = (data.responseData || {}).authData;
13
- var _c = authData || {}, expiry = _c.expiry, app_url_android = _c.app_url_android, app_url_ios = _c.app_url_ios, random = _c.random;
14
- React.useEffect(function () {
15
- if (authData && !isReady) {
16
- setIsReady(true);
17
- }
18
- }, [authData]);
19
- React.useEffect(function () {
20
- if (!isReady)
21
- return;
22
- var promise = dispatch(verifyNafathAsync({ onSuccess: function () { return setSuccess(true); } }));
23
- return function () {
24
- promise === null || promise === void 0 ? void 0 : promise.abort();
25
- };
26
- }, [isReady]);
27
- var onBack = React.useCallback(function () {
28
- dispatch(handlePrevScreenStep());
29
- }, []);
30
- if (!isReady)
31
- return null;
32
- return (_jsx(NafathVerification, { randomNumber: random, expiryInSeconds: expiry, success: success, urls: { android: app_url_android, ios: app_url_ios }, onFinish: function () { return onBack(); } }));
33
- };
34
- export default React.memo(VerifyNafath);
@@ -1,3 +0,0 @@
1
- import VerifyNafath, { VerifyNafathProps } from './VerifyNafath';
2
- export type { VerifyNafathProps };
3
- export default VerifyNafath;
@@ -1,2 +0,0 @@
1
- import VerifyNafath from './VerifyNafath';
2
- export default VerifyNafath;
@@ -1,7 +0,0 @@
1
- import { ButtonProps } from '../../../components/Button';
2
- interface NafathButtonProps extends ButtonProps {
3
- loading?: boolean;
4
- hideIcon?: boolean;
5
- }
6
- export default function NafathButton({ children, hideIcon, disabled, ...props }: NafathButtonProps): import("react/jsx-runtime").JSX.Element;
7
- export {};
@@ -1,13 +0,0 @@
1
- import * as React from 'react';
2
- export interface VerifyNafathProps {
3
- randomNumber: string;
4
- success: boolean;
5
- expiryInSeconds: number;
6
- urls?: {
7
- android: string;
8
- ios: string;
9
- };
10
- onFinish?: () => void;
11
- }
12
- declare const _default: React.MemoExoticComponent<({ randomNumber, success, expiryInSeconds, urls, onFinish }: VerifyNafathProps) => import("react/jsx-runtime").JSX.Element>;
13
- export default _default;
@@ -1,92 +0,0 @@
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 * as React from 'react';
14
- import Box from '@mui/material/Box/Box';
15
- import { styled } from '@mui/material/styles';
16
- import { useTranslation } from 'react-i18next';
17
- import Text from '../../../components/Text';
18
- import { ScreenContainer } from '../../shared/Containers';
19
- import { MobileButton } from '../../shared/Button';
20
- import { mobileOS } from '../../../utils';
21
- import { useCountUp } from '../../../hooks';
22
- import VerifyNafathLoading from './VerifyNafathLoading';
23
- import VerifyNafathSuccess from './VerifyNafathSuccess';
24
- var VerifyNafathTitleContainerStyled = styled(Box)(function (_a) {
25
- var theme = _a.theme;
26
- return ({
27
- direction: theme.direction,
28
- display: 'flex',
29
- flexDirection: 'column',
30
- alignItems: 'center',
31
- marginBottom: theme.spacing(2.5)
32
- });
33
- });
34
- var VerifyNafathTitleStyled = styled(Text)(function (_a) {
35
- var theme = _a.theme;
36
- return (__assign(__assign({}, theme.typography.body1), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightBold, marginBottom: theme.spacing(2.4), lineHeight: '19.2px' }));
37
- });
38
- var VerifyNafathSubTitleStyled = styled(Text)(function (_a) {
39
- var theme = _a.theme;
40
- return (__assign(__assign({}, theme.typography.body2), { color: theme.palette.text.primary, fontWeight: theme.typography.fontWeightMedium, lineHeight: '16.8px', textAlign: 'center', marginLeft: theme.spacing(3), marginRight: theme.spacing(3) }));
41
- });
42
- var Container = styled(Box)(function (_a) {
43
- var theme = _a.theme;
44
- return ({
45
- position: 'relative',
46
- display: 'flex',
47
- justifyContent: 'center',
48
- alignItems: 'center',
49
- maxHeight: '300px',
50
- marginBottom: theme.spacing(3.25)
51
- });
52
- });
53
- var VerifyNafath = function (_a) {
54
- var randomNumber = _a.randomNumber, success = _a.success, expiryInSeconds = _a.expiryInSeconds, urls = _a.urls, onFinish = _a.onFinish;
55
- var t = useTranslation().t;
56
- var count = useCountUp({ start: 0, end: expiryInSeconds, sleepMS: 1000 }).count;
57
- var errorWaitingTime = 3;
58
- var phases = 2;
59
- var remainingTime = expiryInSeconds - errorWaitingTime;
60
- var phaseNumber = Math.floor((count / remainingTime) * phases) + 1;
61
- var isEnded = count === expiryInSeconds;
62
- var endPhaseStarted = count >= remainingTime;
63
- console.log('VerifyNafath', VerifyNafath);
64
- React.useEffect(function () {
65
- if (isEnded && onFinish)
66
- onFinish();
67
- }, [isEnded]);
68
- var onRedirect = React.useCallback(function () {
69
- if (os === 'Android') {
70
- window.open(urls === null || urls === void 0 ? void 0 : urls.android, '_blank');
71
- }
72
- if (os === 'iOS') {
73
- window.open(urls === null || urls === void 0 ? void 0 : urls.ios, '_blank');
74
- }
75
- }, [urls]);
76
- var os = React.useMemo(function () { return mobileOS(); }, []);
77
- var isAndroid = React.useMemo(function () { return os === 'Android' && (urls === null || urls === void 0 ? void 0 : urls.android); }, [os, urls]);
78
- var isIOS = React.useMemo(function () { return os === 'iOS' && (urls === null || urls === void 0 ? void 0 : urls.ios); }, [os, urls]);
79
- var title = React.useMemo(function () {
80
- if (phaseNumber === 1)
81
- return 'nafath_verification_title_wait';
82
- return 'nafath_verification_title_check';
83
- }, [phaseNumber]);
84
- var description = React.useMemo(function () {
85
- if (phaseNumber === 1)
86
- return 'nafath_verification_description_wait';
87
- return 'nafath_verification_description_check';
88
- }, [phaseNumber]);
89
- var isErrorPhase = endPhaseStarted && !success;
90
- return (_jsxs(ScreenContainer, __assign({ sx: { mb: 2.5 } }, { children: [_jsxs(VerifyNafathTitleContainerStyled, { children: [_jsx(Container, { children: success ? _jsx(VerifyNafathSuccess, {}) : _jsx(VerifyNafathLoading, { randomNumber: randomNumber, type: isErrorPhase ? 3 : phaseNumber }) }), isErrorPhase ? (_jsxs(_Fragment, { children: [_jsx(VerifyNafathTitleStyled, { children: t('nafath_verification_title_error') }), _jsx(VerifyNafathSubTitleStyled, __assign({ sx: { pb: 1 } }, { children: t('nafath_verification_description_error') })), _jsx(VerifyNafathSubTitleStyled, { children: t('nafath_verification_redirection_message') })] })) : (_jsxs(_Fragment, { children: [_jsx(VerifyNafathTitleStyled, { children: t(title) }), _jsx(VerifyNafathSubTitleStyled, { children: t(description) })] }))] }), (isAndroid || isIOS) && (_jsx(MobileButton, __assign({ onClick: onRedirect, hideIcon: true }, { children: t('open_nafath_app') })))] })));
91
- };
92
- export default React.memo(VerifyNafath);
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- interface VerifyNafathLoadingProps {
3
- loop?: boolean;
4
- type: number;
5
- randomNumber: string;
6
- }
7
- declare const _default: React.NamedExoticComponent<VerifyNafathLoadingProps>;
8
- export default _default;