@tap-payments/auth-jsconnect 1.0.94-test → 1.0.97-test

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 (88) hide show
  1. package/build/@types/app.d.ts +7 -2
  2. package/build/@types/form.d.ts +2 -1
  3. package/build/api/auth.d.ts +22 -3
  4. package/build/api/axios.d.ts +2 -2
  5. package/build/api/axios.js +62 -0
  6. package/build/api/country.d.ts +1 -2
  7. package/build/api/country.js +7 -8
  8. package/build/api/data.d.ts +1 -0
  9. package/build/api/data.js +9 -2
  10. package/build/api/entity.d.ts +3 -1
  11. package/build/api/entity.js +11 -2
  12. package/build/api/firebase.d.ts +1 -1
  13. package/build/api/firebase.js +5 -2
  14. package/build/api/index.d.ts +10 -9
  15. package/build/api/ip.d.ts +1 -1
  16. package/build/api/ip.js +5 -2
  17. package/build/api/lead.d.ts +4 -1
  18. package/build/api/lead.js +14 -2
  19. package/build/api/operator.d.ts +1 -1
  20. package/build/api/operator.js +60 -4
  21. package/build/app/settings.d.ts +6 -15
  22. package/build/app/settings.js +82 -142
  23. package/build/components/AnimationFlow/AnimationFlow.d.ts +2 -1
  24. package/build/components/AnimationFlow/AnimationFlow.js +2 -2
  25. package/build/components/AnimationFlow/BottomSheet.d.ts +2 -1
  26. package/build/components/AnimationFlow/BottomSheet.js +16 -4
  27. package/build/constants/api.d.ts +2 -1
  28. package/build/constants/api.js +5 -3
  29. package/build/constants/app.d.ts +6 -0
  30. package/build/constants/app.js +16 -4
  31. package/build/features/app/bank/bankStore.js +6 -4
  32. package/build/features/app/business/businessStore.d.ts +2 -4
  33. package/build/features/app/business/businessStore.js +66 -22
  34. package/build/features/app/connect/connectStore.d.ts +5 -10
  35. package/build/features/app/connect/connectStore.js +121 -27
  36. package/build/features/app/individual/individualStore.d.ts +3 -2
  37. package/build/features/app/individual/individualStore.js +27 -22
  38. package/build/features/app/password/passwordStore.d.ts +29 -1
  39. package/build/features/app/password/passwordStore.js +184 -8
  40. package/build/features/app/tax/taxStore.js +7 -5
  41. package/build/features/bank/Bank.js +4 -4
  42. package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +16 -4
  43. package/build/features/business/Business.js +4 -4
  44. package/build/features/business/screens/IDBOD/IDBOD.js +1 -1
  45. package/build/features/business/screens/OTP/OTPInput.js +3 -9
  46. package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +17 -6
  47. package/build/features/connect/Connect.js +1 -1
  48. package/build/features/connect/screens/Mobile/Mobile.js +1 -1
  49. package/build/features/connect/screens/NID/NID.js +1 -1
  50. package/build/features/connect/screens/OTP/OTPInput.js +3 -13
  51. package/build/features/featuresScreens.js +5 -0
  52. package/build/features/individual/Individual.js +4 -4
  53. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +7 -1
  54. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +10 -0
  55. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +89 -0
  56. package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +3 -0
  57. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +1 -0
  58. package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +16 -4
  59. package/build/features/password/Password.js +12 -6
  60. package/build/features/password/screens/CreatePassword/CreatePassword.js +9 -2
  61. package/build/features/password/screens/OTP/OTP.d.ts +8 -0
  62. package/build/features/password/screens/OTP/OTP.js +78 -0
  63. package/build/features/password/screens/OTP/OTPInput.d.ts +5 -0
  64. package/build/features/password/screens/OTP/OTPInput.js +46 -0
  65. package/build/features/password/screens/OTP/index.d.ts +3 -0
  66. package/build/features/password/screens/OTP/index.js +2 -0
  67. package/build/features/password/screens/OTP/validation.d.ts +8 -0
  68. package/build/features/password/screens/OTP/validation.js +4 -0
  69. package/build/features/password/screens/Success/Success.js +8 -2
  70. package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +17 -5
  71. package/build/features/password/screens/Verify/OTPInput.d.ts +2 -2
  72. package/build/features/password/screens/Verify/OTPInput.js +1 -1
  73. package/build/features/shared/Button/FlowsButtons.d.ts +8 -2
  74. package/build/features/shared/Button/FlowsButtons.js +94 -6
  75. package/build/features/shared/Button/SuccessButton.js +17 -13
  76. package/build/features/tax/Tax.js +3 -3
  77. package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +16 -4
  78. package/build/hooks/useAppConfig.d.ts +1 -4
  79. package/build/hooks/useAppConfig.js +13 -113
  80. package/build/hooks/useAppTheme.js +3 -2
  81. package/build/index.css +4 -0
  82. package/build/theme/theme.d.ts +1 -1
  83. package/build/theme/theme.js +1 -2
  84. package/build/utils/array.d.ts +3 -0
  85. package/build/utils/array.js +10 -0
  86. package/build/utils/string.d.ts +1 -0
  87. package/build/utils/string.js +4 -0
  88. package/package.json +1 -1
@@ -14,6 +14,7 @@ import SuccessPage from './business/screens/Success';
14
14
  import SuccessWithFlowButtonsPage from './business/screens/SuccessWithFlowButtons';
15
15
  import PasswordVerifyPage from './password/screens/Verify';
16
16
  import CreatePasswordPage from './password/screens/CreatePassword';
17
+ import PasswordOTPPage from './password/screens/OTP';
17
18
  import SuccessPasswordPage from './password/screens/Success';
18
19
  import PasswordSuccessWithFlowPage from './password/screens/SuccessWithFlowButtons';
19
20
  import IndividualVerifyPage from './individual/screens/Verify';
@@ -91,6 +92,10 @@ export var passwordFeatureScreens = [
91
92
  name: 'PASSWORD_CREATE_PASSWORD_STEP',
92
93
  element: CreatePasswordPage
93
94
  },
95
+ {
96
+ name: 'PASSWORD_RESET_PASSWORD_OTP_STEP',
97
+ element: PasswordOTPPage
98
+ },
94
99
  {
95
100
  name: 'PASSWORD_SUCCESS_STEP',
96
101
  element: SuccessPasswordPage
@@ -29,7 +29,7 @@ var Individual = memo(function (props) {
29
29
  var dispatch = useAppDispatch();
30
30
  var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
31
31
  var _b = useAppSelector(individualSelector), customLoading = _b.customLoading, individualError = _b.error;
32
- var loading = useAppConfig(__assign({ navigation: INDIVIDUAL_SCREENS_NAVIGATION }, props)).loading;
32
+ useAppConfig(__assign({ navigation: INDIVIDUAL_SCREENS_NAVIGATION }, props));
33
33
  useErrorListener(individualError || error);
34
34
  useStepStartedListener();
35
35
  var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
@@ -44,10 +44,10 @@ var Individual = memo(function (props) {
44
44
  dispatch(verifyLeadToken(token));
45
45
  };
46
46
  useEffect(function () {
47
- if (!loading)
47
+ if (!settingLoading)
48
48
  verifyToken();
49
- }, [loading]);
50
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: individualFeatureScreens.map(function (_a, index) {
49
+ }, [settingLoading]);
50
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: individualFeatureScreens.map(function (_a, index) {
51
51
  var Element = _a.element, name = _a.name;
52
52
  var isActive = activeScreen.name === name;
53
53
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -30,11 +30,13 @@ import EmployerName from './EmployerName';
30
30
  import EmployerLocation from './EmployerLocation';
31
31
  import SourceOfIncome from './SourceOfIncome';
32
32
  import { individualSelector, updateIndividualInfo } from '../../../app/individual/individualStore';
33
+ import Occupation from './Occupation';
33
34
  var ListType;
34
35
  (function (ListType) {
35
36
  ListType["SourceOfIncomeList"] = "SourceOfIncomeList";
36
37
  ListType["EmployerLocationList"] = "EmployerLocationList";
37
38
  ListType["MonthlyIncomeList"] = "MonthlyIncomeList";
39
+ ListType["OccupationList"] = "OccupationList";
38
40
  })(ListType || (ListType = {}));
39
41
  var AdditionalIndividualInfo = function (_a) {
40
42
  var t = useTranslation().t;
@@ -75,7 +77,11 @@ var AdditionalIndividualInfo = function (_a) {
75
77
  var isSourceOfIncomeListActive = listActive === ListType.SourceOfIncomeList;
76
78
  var isEmployerLocationListActive = listActive === ListType.EmployerLocationList;
77
79
  var isMonthlyIncomeListActive = listActive === ListType.MonthlyIncomeList;
78
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(SourceOfIncome, { onListOpen: function () { return handleMenuClick(ListType.SourceOfIncomeList); }, onListClose: function () { return handleMenuClick(); }, show: !isEmployerLocationListActive && !isMonthlyIncomeListActive }), _jsx(MonthlyIncome, { show: !isEmployerLocationListActive && !isSourceOfIncomeListActive, onListOpen: function () { return handleMenuClick(ListType.MonthlyIncomeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EmployerName, { show: false }), _jsx(EmployerLocation, { show: !isSourceOfIncomeListActive && employerFieldsActive && !isMonthlyIncomeListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.EmployerLocationList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(PEPSwitch, { show: !listActive }), _jsx(InfluencerSwitch, { show: !listActive })] }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
80
+ var isOccupationListActive = listActive === ListType.OccupationList;
81
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Occupation, { onListOpen: function () { return handleMenuClick(ListType.OccupationList); }, onListClose: function () { return handleMenuClick(); }, show: !isEmployerLocationListActive && !isMonthlyIncomeListActive && !isSourceOfIncomeListActive }), _jsx(SourceOfIncome, { onListOpen: function () { return handleMenuClick(ListType.SourceOfIncomeList); }, onListClose: function () { return handleMenuClick(); }, show: !isEmployerLocationListActive && !isMonthlyIncomeListActive && !isOccupationListActive }), _jsx(MonthlyIncome, { show: !isEmployerLocationListActive && !isSourceOfIncomeListActive && !isOccupationListActive, onListOpen: function () { return handleMenuClick(ListType.MonthlyIncomeList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(EmployerName, { show: false }), _jsx(EmployerLocation, { show: !isSourceOfIncomeListActive &&
82
+ employerFieldsActive &&
83
+ !isMonthlyIncomeListActive &&
84
+ !isOccupationListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.EmployerLocationList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(PEPSwitch, { show: !listActive }), _jsx(InfluencerSwitch, { show: !listActive })] }), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
79
85
  };
80
86
  export default React.memo(AdditionalIndividualInfo);
81
87
  AdditionalIndividualInfo.defaultProps = {};
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { Occupation as OccupationType } from '../../../../@types';
3
+ interface OccupationProps {
4
+ show: boolean;
5
+ onSelectOccupation?: (occupation: OccupationType) => void;
6
+ onListOpen?: () => void;
7
+ onListClose?: () => void;
8
+ }
9
+ declare const Occupation: ({ ...rest }: OccupationProps) => JSX.Element;
10
+ export default Occupation;
@@ -0,0 +1,89 @@
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
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import * as React from 'react';
25
+ import Box from '@mui/material/Box';
26
+ import { styled } from '@mui/material/styles';
27
+ import { useTranslation } from 'react-i18next';
28
+ import { useController, useFormContext } from 'react-hook-form';
29
+ import { useAppSelector, useLanguage } from '../../../../hooks';
30
+ import { individualSelector } from '../../../app/individual/individualStore';
31
+ import Text from '../../../../components/Text';
32
+ import Collapse from '../../../../components/Collapse';
33
+ import CheckIcon from '@mui/icons-material/Check';
34
+ import ScreenContainer from '../../../shared/Containers/ScreenContainer';
35
+ import Input from '../../../shared/Input';
36
+ import ExpandIcon from '../../../../components/ExpandIcon';
37
+ import SimpleList from '../../../../components/SimpleList';
38
+ var Container = styled(Box)(function () { return ({
39
+ display: 'flex'
40
+ }); });
41
+ var IncomeText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
42
+ var theme = _a.theme, isSelected = _a.isSelected;
43
+ return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
44
+ });
45
+ var CheckIconStyled = styled(CheckIcon)(function (_a) {
46
+ var theme = _a.theme;
47
+ return ({
48
+ color: theme.palette.success.main,
49
+ display: 'flex',
50
+ alignItems: 'flex-end'
51
+ });
52
+ });
53
+ var Occupation = function (_a) {
54
+ var _b, _c;
55
+ var rest = __rest(_a, []);
56
+ var _d = React.useState([]), occupationList = _d[0], setOccupationList = _d[1];
57
+ var _e = React.useState(null), anchorEl = _e[0], setAnchorEl = _e[1];
58
+ var t = useTranslation().t;
59
+ var isAr = useLanguage().isAr;
60
+ var data = useAppSelector(individualSelector).data;
61
+ var control = useFormContext().control;
62
+ var occupationsList = ((_b = data.individualData.responseBody) === null || _b === void 0 ? void 0 : _b.occupationList) || [];
63
+ var occupationControl = useController({ control: control, name: 'occupation' });
64
+ React.useEffect(function () {
65
+ if ((occupationsList === null || occupationsList === void 0 ? void 0 : occupationsList.length) > 0) {
66
+ setOccupationList(occupationsList);
67
+ }
68
+ }, [occupationsList === null || occupationsList === void 0 ? void 0 : occupationsList.occupation]);
69
+ var onOpenList = function (event) {
70
+ var _a;
71
+ setAnchorEl(event.currentTarget);
72
+ (_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
73
+ };
74
+ var onCloseList = function () {
75
+ var _a;
76
+ setAnchorEl(null);
77
+ (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
78
+ };
79
+ var onSelectItem = function (occupation) {
80
+ onCloseList();
81
+ occupationControl.field.onChange(occupation);
82
+ };
83
+ var occupation = occupationControl.field.value;
84
+ var error = (_c = occupationControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
85
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(Input, { required: true, label: t('occupation_title'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_occupation'), value: (isAr ? occupation === null || occupation === void 0 ? void 0 : occupation.name_ar : occupation === null || occupation === void 0 ? void 0 : occupation.name_en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name_en', list: occupationList, onSelectItem: onSelectItem, renderItem: function (item) {
86
+ return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id) }, { children: isAr ? item.name_ar : item === null || item === void 0 ? void 0 : item.name_en })) }), item.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id) && _jsx(CheckIconStyled, {})] }));
87
+ } }) }))] })) })));
88
+ };
89
+ export default Occupation;
@@ -2,18 +2,21 @@ import * as yup from 'yup';
2
2
  import { ObjectShape } from 'yup/lib/object';
3
3
  import { CountryCode } from '../../../../@types';
4
4
  export declare const IndividualInfoValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<ObjectShape, {
5
+ occupation: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
5
6
  sourceIncome: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
6
7
  monthlyIncome: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
7
8
  employerLocation: import("yup/lib/object").OptionalObjectSchema<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>>>;
8
9
  isPEP: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
9
10
  isInfluencer: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
10
11
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<ObjectShape, {
12
+ occupation: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
11
13
  sourceIncome: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
12
14
  monthlyIncome: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
13
15
  employerLocation: import("yup/lib/object").OptionalObjectSchema<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>>>;
14
16
  isPEP: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
15
17
  isInfluencer: import("yup/lib/boolean").RequiredBooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject>;
16
18
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<ObjectShape, {
19
+ occupation: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
17
20
  sourceIncome: import("yup/lib/object").RequiredObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
18
21
  monthlyIncome: import("yup/lib/object").OptionalObjectSchema<ObjectShape, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<ObjectShape>>;
19
22
  employerLocation: import("yup/lib/object").OptionalObjectSchema<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<Partial<Record<keyof CountryCode, yup.AnySchema<any, any, any> | import("yup/lib/Reference").default<unknown> | import("yup/lib/Lazy").default<any, any>>>>>;
@@ -1,5 +1,6 @@
1
1
  import * as yup from 'yup';
2
2
  export var IndividualInfoValidationSchema = yup.object().shape({
3
+ occupation: yup.object().required('alert_choose_occupation'),
3
4
  sourceIncome: yup.object().required('choose_any_source_of_income'),
4
5
  monthlyIncome: yup.object().optional(),
5
6
  employerLocation: yup.object().when('sourceIncome', function (sourceIncome) {
@@ -14,14 +14,15 @@ import React, { memo, useEffect, useState } from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { styled } from '@mui/material/styles';
16
16
  import { FlowsButtons } from '../../../shared/Button';
17
- import { ICONS_NAMES } from '../../../../constants';
17
+ import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
18
18
  import { useAppSelector, useLanguage } from '../../../../hooks';
19
- import { allAreTruthy, showLastFour } from '../../../../utils';
19
+ import { allAreTruthy, getResetFlowUrl, showLastFour } from '../../../../utils';
20
20
  import { individualSelector } from '../../../app/individual/individualStore';
21
21
  import Box from '@mui/material/Box';
22
22
  import Text from '../../../../components/Text';
23
23
  import Container from '../../../shared/Containers/ScreenContainer';
24
24
  import AcceptancePayouts from '../../../shared/AcceptancePayouts';
25
+ import { settingsSelector } from '../../../../app/settings';
25
26
  var TitleStyled = styled(Text)(function (_a) {
26
27
  var _b;
27
28
  var theme = _a.theme;
@@ -57,10 +58,16 @@ var SuccessWithFlowButtons = function () {
57
58
  var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
58
59
  var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
59
60
  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) || '';
61
+ var settings = useAppSelector(settingsSelector);
62
+ var _h = data.verify.responseBody || { contact: {}, id: '' }, contact = _h.contact, id = _h.id;
63
+ var email = (contact || { email: '' }).email;
64
+ var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
60
65
  var reMapFlowData = function (flows) {
61
66
  if (flows === void 0) { flows = []; }
62
67
  var images = ICONS_NAMES;
63
- var mappedFlows = flows.map(function (_a) {
68
+ var mappedFlows = flows
69
+ .filter(function (item) { return item.name; })
70
+ .map(function (_a) {
64
71
  var name = _a.name, url = _a.url, status = _a.status;
65
72
  var type = status === 'initiated' ? 'pending' : 'completed';
66
73
  var title = t("".concat(name, "_flow_").concat(type), {
@@ -79,6 +86,7 @@ var SuccessWithFlowButtons = function () {
79
86
  var hoverSrc = "".concat(name, "_white_icon");
80
87
  return {
81
88
  name: name,
89
+ status: status,
82
90
  title: title,
83
91
  href: url,
84
92
  src: images[src],
@@ -96,6 +104,10 @@ var SuccessWithFlowButtons = function () {
96
104
  if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
97
105
  reMapFlowData(flows);
98
106
  }, [flows, isAr]);
99
- return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, flowName: data.flowName }) })] }));
107
+ return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, data: {
108
+ flowName: data.flowName,
109
+ email: email,
110
+ emailUrl: url
111
+ } }) })] }));
100
112
  };
101
113
  export default memo(SuccessWithFlowButtons);
@@ -19,9 +19,9 @@ import { ReduxProvider, ThemeProvider } from '../../components/Providers';
19
19
  import Collapse from '../../components/Collapse';
20
20
  import { FeatureContainer } from '../shared/Containers';
21
21
  import { getParameterByName, reactElement } from '../../utils';
22
- import { PASSWORD_SCREENS_NAVIGATION } from '../../constants';
22
+ import { PASSWORD_OPERATION_TYPE, PASSWORD_SCREENS_NAVIGATION } from '../../constants';
23
23
  import { passwordFeatureScreens } from '../featuresScreens';
24
- import { passwordSelector, verifyLeadToken } from '../app/password/passwordStore';
24
+ import { passwordSelector, verifyLeadToken, verifyOperationToken } from '../app/password/passwordStore';
25
25
  import CustomFooter from '../shared/Footer';
26
26
  import Background from '../shared/Background';
27
27
  var Password = memo(function (props) {
@@ -29,25 +29,31 @@ var Password = memo(function (props) {
29
29
  var dispatch = useAppDispatch();
30
30
  var _a = useAppSelector(settingsSelector), data = _a.data, error = _a.error, settingLoading = _a.loading;
31
31
  var _b = useAppSelector(passwordSelector), customLoading = _b.customLoading, passwordError = _b.error;
32
- var loading = useAppConfig(__assign({ navigation: PASSWORD_SCREENS_NAVIGATION }, props)).loading;
32
+ useAppConfig(__assign({ navigation: PASSWORD_SCREENS_NAVIGATION }, props));
33
33
  useErrorListener(passwordError || error);
34
34
  useStepStartedListener();
35
35
  var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
36
36
  var verifyToken = function () {
37
37
  var token = getParameterByName('token');
38
38
  var lang = getParameterByName('lang');
39
+ var operationType = getParameterByName('operation_type');
40
+ var leadId = getParameterByName('lead_id') || '';
39
41
  if (!token)
40
42
  throw new Error('Auth token is not found!');
41
43
  if (!lang)
42
44
  throw new Error('Language is not found!');
43
45
  dispatch(handleLanguage(lang));
46
+ if (operationType === PASSWORD_OPERATION_TYPE.RESET_PASSWORD) {
47
+ dispatch(verifyOperationToken({ token: token, leadId: leadId }));
48
+ return;
49
+ }
44
50
  dispatch(verifyLeadToken(token));
45
51
  };
46
52
  useEffect(function () {
47
- if (!loading)
53
+ if (!settingLoading)
48
54
  verifyToken();
49
- }, [loading]);
50
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: passwordFeatureScreens.map(function (_a, index) {
55
+ }, [settingLoading]);
56
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: passwordFeatureScreens.map(function (_a, index) {
51
57
  var Element = _a.element, name = _a.name;
52
58
  var isActive = activeScreen.name === name;
53
59
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -17,14 +17,15 @@ import { yupResolver } from '@hookform/resolvers/yup';
17
17
  import Box from '@mui/material/Box';
18
18
  import { styled } from '@mui/material/styles';
19
19
  import { useAppDispatch } from '../../../../hooks';
20
- import { handleCurrentActiveScreen } from '../../../../app/settings';
20
+ import { handleCurrentActiveScreen, handleNextScreenStep } from '../../../../app/settings';
21
21
  import Form from '../../../../components/Form';
22
22
  import { useLanguage } from '../../../../hooks';
23
+ import { PASSWORD_OPERATION_TYPE } from '../../../../constants';
23
24
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
24
25
  import Button from '../../../shared/Button';
25
26
  import { PasswordValidation } from './validation';
26
27
  import Password from './Password';
27
- import { createPassword, passwordSelector } from '../../../app/password/passwordStore';
28
+ import { createPassword, passwordSelector, storePasswordScreen } from '../../../app/password/passwordStore';
28
29
  import { useSelector } from 'react-redux';
29
30
  var InputsContainerStyled = styled(Box)(function (_a) {
30
31
  var theme = _a.theme;
@@ -37,12 +38,18 @@ var CreatePassword = function (_a) {
37
38
  var isAr = useLanguage().isAr;
38
39
  var dispatch = useAppDispatch();
39
40
  var _b = useSelector(passwordSelector), data = _b.data, loading = _b.loading, error = _b.error;
41
+ var operationType = data.verify.operationType;
40
42
  var methods = useForm({
41
43
  resolver: yupResolver(PasswordValidation),
42
44
  defaultValues: data.passwordData,
43
45
  mode: 'onChange'
44
46
  });
45
47
  var onSubmit = function (data) {
48
+ if (operationType === PASSWORD_OPERATION_TYPE.RESET_PASSWORD) {
49
+ dispatch(storePasswordScreen(data));
50
+ dispatch(handleNextScreenStep('PASSWORD_RESET_PASSWORD_OTP_STEP'));
51
+ return;
52
+ }
46
53
  dispatch(createPassword(data));
47
54
  };
48
55
  var onBack = function () {
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ export interface OTPProps {
3
+ }
4
+ declare const _default: React.MemoExoticComponent<{
5
+ ({}: OTPProps): JSX.Element;
6
+ defaultProps: {};
7
+ }>;
8
+ 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, useAppSelector } 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 } from '../../../../hooks';
22
+ import Form from '../../../../components/Form';
23
+ import Text from '../../../../components/Text';
24
+ import { ScreenContainer } from '../../../shared/Containers';
25
+ import { passwordSelector, clearError, resetOTPScreen, resetPassword } from '../../../app/password/passwordStore';
26
+ import Button from '../../../shared/Button';
27
+ import { maskPhone } from '../../../../utils';
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), { fontWeight: theme.typography.fontWeightLight, color: theme.palette.text.primary, marginBlock: theme.spacing(1.75), marginInline: theme.spacing(2.5), lineHeight: 1.75, whiteSpace: 'pre-line' }));
44
+ });
45
+ var FormStyled = styled(Form)(function () { return ({
46
+ display: 'flex',
47
+ flexDirection: 'column'
48
+ }); });
49
+ var OTP = function (_a) {
50
+ var _b, _c;
51
+ var _d = useAppSelector(passwordSelector), data = _d.data, loading = _d.loading, error = _d.error;
52
+ var dispatch = useAppDispatch();
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
+ React.useEffect(function () {
61
+ if (error)
62
+ dispatch(clearError());
63
+ return function () {
64
+ dispatch(resetOTPScreen());
65
+ };
66
+ }, [methods.formState.isValid]);
67
+ var onSubmit = function (formData) {
68
+ dispatch(resetPassword(formData));
69
+ };
70
+ var onBack = function () {
71
+ dispatch(handlePrevScreenStep());
72
+ };
73
+ var disabled = !methods.formState.isValid || !!error;
74
+ var phone = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.auth_info) === null || _c === void 0 ? void 0 : _c.phone;
75
+ 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('opt_nid_sent_title', { provider: 'ABSHER' }), ' ', !loading && _jsx("span", __assign({ dir: 'ltr' }, { children: "".concat(maskPhone(phone || '')) }))] }) }), _jsx(OTPInput, {}), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] })) })) }));
76
+ };
77
+ OTP.defaultProps = {};
78
+ export default React.memo(OTP);
@@ -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,46 @@
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 { useController, useFormContext } from 'react-hook-form';
15
+ import { useTranslation } from 'react-i18next';
16
+ import Box from '@mui/material/Box/Box';
17
+ import { styled } from '@mui/material/styles';
18
+ import OTPField from '../../../shared/OTP';
19
+ import { DEFAULT_TIMER_VALUE } from '../../../../constants';
20
+ import { useAppDispatch } from '../../../../hooks';
21
+ import { resendOperationOTP } from '../../../../features/app/password/passwordStore';
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 _b = useFormContext(), control = _b.control, setValue = _b.setValue;
32
+ var t = useTranslation().t;
33
+ var dispatch = useAppDispatch();
34
+ var otpControl = useController({ name: 'otp', control: control });
35
+ var handleOnOTPChange = function (otp) {
36
+ otpControl.field.onChange(otp);
37
+ };
38
+ var handleOnResendOTP = function () {
39
+ if (otpControl.field.value)
40
+ setValue('otp', '', { shouldValidate: true });
41
+ dispatch(resendOperationOTP());
42
+ };
43
+ var otpValue = otpControl.field.value;
44
+ return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
45
+ };
46
+ export default React.memo(OTPInput);
@@ -0,0 +1,3 @@
1
+ import OTP, { OTPProps } from './OTP';
2
+ export type { OTPProps };
3
+ export default OTP;
@@ -0,0 +1,2 @@
1
+ import OTP from './OTP';
2
+ export default OTP;
@@ -0,0 +1,8 @@
1
+ import * as yup from 'yup';
2
+ export declare const OTPValidation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
+ otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
4
+ }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
5
+ otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
6
+ }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
7
+ otp: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
8
+ }>>>;
@@ -0,0 +1,4 @@
1
+ import * as yup from 'yup';
2
+ export var OTPValidation = yup.object().shape({
3
+ otp: yup.string().min(6, 'otp_min_length').required('otp_required')
4
+ });
@@ -2,13 +2,19 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as React from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
5
- import { updateLeadSuccess, passwordSelector } from '../../../app/password/passwordStore';
5
+ import { updateLeadSuccess, passwordSelector, retrieveLead } from '../../../app/password/passwordStore';
6
6
  import SuccessScreen from '../../../shared/SuccessScreen';
7
+ import { PASSWORD_OPERATION_TYPE } from '../../../../constants';
7
8
  var Success = function (_a) {
8
9
  var t = useTranslation().t;
9
10
  var dispatch = useAppDispatch();
10
- var _b = useAppSelector(passwordSelector), loading = _b.loading, error = _b.error;
11
+ var _b = useAppSelector(passwordSelector), loading = _b.loading, error = _b.error, data = _b.data;
12
+ var operationType = data.verify.operationType;
11
13
  var onSuccess = function () {
14
+ if (operationType === PASSWORD_OPERATION_TYPE.RESET_PASSWORD) {
15
+ dispatch(retrieveLead());
16
+ return;
17
+ }
12
18
  dispatch(updateLeadSuccess());
13
19
  };
14
20
  return (_jsx(SuccessScreen, { title: t('password_success_title'), onSuccess: onSuccess, successTitle: t('continue'), loading: loading, error: error || '' }));
@@ -14,14 +14,15 @@ import React, { memo, useEffect, useState } from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { styled } from '@mui/material/styles';
16
16
  import { FlowsButtons } from '../../../shared/Button';
17
- import { ICONS_NAMES } from '../../../../constants';
17
+ import { ICONS_NAMES, PASSWORD_OPERATION_TYPE } from '../../../../constants';
18
18
  import { useAppSelector, useLanguage } from '../../../../hooks';
19
- import { allAreTruthy, showLastFour } from '../../../../utils';
19
+ import { allAreTruthy, getResetFlowUrl, showLastFour } from '../../../../utils';
20
20
  import { passwordSelector } from '../../../app/password/passwordStore';
21
21
  import Box from '@mui/material/Box';
22
22
  import Text from '../../../../components/Text';
23
23
  import Container from '../../../shared/Containers/ScreenContainer';
24
- import AcceptancePayouts from '../../../../features/shared/AcceptancePayouts';
24
+ import AcceptancePayouts from '../../../shared/AcceptancePayouts';
25
+ import { settingsSelector } from '../../../../app/settings';
25
26
  var TitleStyled = styled(Text)(function (_a) {
26
27
  var _b;
27
28
  var theme = _a.theme;
@@ -57,10 +58,16 @@ var SuccessWithFlowButtons = function () {
57
58
  var iban = showLastFour((bank === null || bank === void 0 ? void 0 : bank.iban) || '');
58
59
  var taxID = (entity === null || entity === void 0 ? void 0 : entity.tax_number) || '';
59
60
  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) || '';
61
+ var settings = useAppSelector(settingsSelector);
62
+ var _h = data.verify.responseBody || { contact: {}, id: '' }, contact = _h.contact, id = _h.id;
63
+ var email = (contact || { email: '' }).email;
64
+ var url = getResetFlowUrl('/password', settings.data.language, PASSWORD_OPERATION_TYPE.RESET_PASSWORD, id);
60
65
  var reMapFlowData = function (flows) {
61
66
  if (flows === void 0) { flows = []; }
62
67
  var images = ICONS_NAMES;
63
- var mappedFlows = flows.map(function (_a) {
68
+ var mappedFlows = flows
69
+ .filter(function (item) { return item.name; })
70
+ .map(function (_a) {
64
71
  var name = _a.name, url = _a.url, status = _a.status;
65
72
  var type = status === 'initiated' ? 'pending' : 'completed';
66
73
  var title = t("".concat(name, "_flow_").concat(type), {
@@ -79,6 +86,7 @@ var SuccessWithFlowButtons = function () {
79
86
  var hoverSrc = "".concat(name, "_white_icon");
80
87
  return {
81
88
  name: name,
89
+ status: status,
82
90
  title: title,
83
91
  href: url,
84
92
  src: images[src],
@@ -96,6 +104,10 @@ var SuccessWithFlowButtons = function () {
96
104
  if ((flows === null || flows === void 0 ? void 0 : flows.length) > 0)
97
105
  reMapFlowData(flows);
98
106
  }, [flows, isAr]);
99
- return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, flowName: data.flowName }) })] }));
107
+ return (_jsxs(ContainerStyled, { children: [_jsxs(TitleStyled, { children: [t('account_details'), " "] }), _jsx(AcceptancePayouts, { showAcceptance: isAcceptance, showPayout: isPayout }), _jsx(ButtonGroupStyled, { children: _jsx(FlowsButtons, { buttons: buttons, data: {
108
+ flowName: data.flowName,
109
+ email: email,
110
+ emailUrl: url
111
+ } }) })] }));
100
112
  };
101
113
  export default memo(SuccessWithFlowButtons);
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  export interface OTPProps {
3
3
  loading: boolean;
4
- setLoading: (flag: boolean) => void;
4
+ setLoading?: (flag: boolean) => void;
5
5
  }
6
- declare const _default: React.MemoExoticComponent<({ loading, setLoading }: OTPProps) => JSX.Element>;
6
+ declare const _default: React.MemoExoticComponent<({ loading }: OTPProps) => JSX.Element>;
7
7
  export default _default;
@@ -28,7 +28,7 @@ var BoxStyled = styled(Box)(function (_a) {
28
28
  });
29
29
  });
30
30
  var OTPInput = function (_a) {
31
- var loading = _a.loading, setLoading = _a.setLoading;
31
+ var loading = _a.loading;
32
32
  var _b = useFormContext(), control = _b.control, setValue = _b.setValue;
33
33
  var t = useTranslation().t;
34
34
  var otpControl = useController({ name: 'otp', control: control });