@tap-payments/auth-jsconnect 2.4.13-test → 2.4.15-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 (68) hide show
  1. package/build/@types/app.d.ts +28 -1
  2. package/build/components/DatePicker/DatePicker.d.ts +2 -1
  3. package/build/components/DatePicker/DatePicker.js +12 -11
  4. package/build/features/app/individual/individualStore.js +8 -5
  5. package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +0 -14
  6. package/build/features/entity/screens/EntityCapital/ActivityList.js +9 -14
  7. package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +2 -1
  8. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +4 -5
  9. package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +2 -1
  10. package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +3 -4
  11. package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +2 -1
  12. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +7 -8
  13. package/build/features/entity/screens/EntityCapital/EntityCapital.js +13 -5
  14. package/build/features/entity/screens/EntityName/Article.d.ts +2 -1
  15. package/build/features/entity/screens/EntityName/Article.js +3 -2
  16. package/build/features/entity/screens/EntityName/EntityName.js +34 -12
  17. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +1 -14
  18. package/build/features/entity/screens/EntityName/EntityTypeList.js +7 -16
  19. package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +2 -1
  20. package/build/features/entity/screens/EntityName/ExpiryDate.js +2 -4
  21. package/build/features/entity/screens/EntityName/IssuingDate.d.ts +2 -1
  22. package/build/features/entity/screens/EntityName/IssuingDate.js +2 -4
  23. package/build/features/entity/screens/EntityName/LegalName.d.ts +2 -1
  24. package/build/features/entity/screens/EntityName/LegalName.js +3 -4
  25. package/build/features/entity/screens/EntityName/LicenseCertificate.js +8 -2
  26. package/build/features/entity/screens/EntityName/LicenseNumber.d.ts +2 -1
  27. package/build/features/entity/screens/EntityName/LicenseNumber.js +4 -5
  28. package/build/features/entity/screens/EntityName/UnifiedNumber.d.ts +2 -1
  29. package/build/features/entity/screens/EntityName/UnifiedNumber.js +3 -4
  30. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +28 -21
  31. package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +10 -4
  32. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +2 -1
  33. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +13 -10
  34. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +14 -19
  35. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +1 -0
  36. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +9 -18
  37. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +2 -1
  38. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +12 -9
  39. package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +9 -3
  40. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +14 -18
  41. package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.d.ts +1 -0
  42. package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +5 -13
  43. package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.d.ts +1 -0
  44. package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +5 -13
  45. package/build/features/individual/screens/IndividualPersonalInfo/DOB.d.ts +2 -1
  46. package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +2 -2
  47. package/build/features/individual/screens/IndividualPersonalInfo/Email.d.ts +2 -1
  48. package/build/features/individual/screens/IndividualPersonalInfo/Email.js +3 -8
  49. package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.d.ts +2 -1
  50. package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +2 -3
  51. package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +2 -1
  52. package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +3 -2
  53. package/build/features/individual/screens/IndividualPersonalInfo/ID.d.ts +2 -1
  54. package/build/features/individual/screens/IndividualPersonalInfo/ID.js +3 -5
  55. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +58 -20
  56. package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.d.ts +1 -0
  57. package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +6 -15
  58. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.d.ts +1 -0
  59. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +5 -8
  60. package/build/features/individual/screens/IndividualPersonalInfo/Name.d.ts +2 -1
  61. package/build/features/individual/screens/IndividualPersonalInfo/Name.js +3 -10
  62. package/build/features/individual/screens/IndividualPersonalInfo/Nationality.d.ts +1 -0
  63. package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +6 -15
  64. package/build/features/shared/EndAdornment/EndAdornment.d.ts +1 -1
  65. package/build/features/shared/EndAdornment/EndAdornment.js +1 -1
  66. package/build/utils/date.d.ts +1 -0
  67. package/build/utils/date.js +6 -0
  68. package/package.json +1 -1
@@ -10,16 +10,18 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import { ScreenContainer } from '../../../../features/shared/Containers';
14
- import { styled } from '@mui/material/styles';
13
+ import React from 'react';
15
14
  import { useTranslation } from 'react-i18next';
16
15
  import { useController, useFormContext } from 'react-hook-form';
16
+ import { styled } from '@mui/material/styles';
17
17
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
18
18
  import { DocumentPurpose } from '../../../../@types';
19
19
  import { FileType } from '../../../../constants';
20
+ import { hasVerifiedValue } from '../../../../utils';
20
21
  import Collapse from '../../../../components/Collapse';
21
22
  import { civilIDUploadingStatus, clearError, individualSelector } from '../../../app/individual/individualStore';
22
23
  import UploadMultipleFile from '../../../shared/UploadMultipleFile';
24
+ import { ScreenContainer } from '../../../shared/Containers';
23
25
  var FeatureStyled = styled(ScreenContainer)(function (_a) {
24
26
  var theme = _a.theme;
25
27
  return ({
@@ -27,12 +29,16 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
27
29
  });
28
30
  });
29
31
  var CivilIDFile = function (_a) {
32
+ var _b;
30
33
  var defaultFiles = _a.defaultFiles, readOnly = _a.readOnly, show = _a.show;
31
34
  var t = useTranslation().t;
32
35
  var dispatch = useAppDispatch();
33
36
  var control = useFormContext().control;
34
37
  var civilIDFileIdControl = useController({ name: 'civilID', control: control });
35
- var _b = useAppSelector(individualSelector), loading = _b.loading, error = _b.error;
38
+ var _c = useAppSelector(individualSelector), loading = _c.loading, error = _c.error, data = _c.data;
39
+ var data_verification = (((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.user) || {}).data_verification;
40
+ var uploadedIds = civilIDFileIdControl.field.value;
41
+ var isDocumentVerified = React.useMemo(function () { var _a; return !!((_a = defaultFiles === null || defaultFiles === void 0 ? void 0 : defaultFiles[0]) === null || _a === void 0 ? void 0 : _a.docId) && hasVerifiedValue(data_verification, "documents.".concat(defaultFiles[0].docId)); }, [data_verification]);
36
42
  var handleCivilIDChange = function (ids) {
37
43
  if (error)
38
44
  dispatch(clearError());
@@ -43,6 +49,6 @@ var CivilIDFile = function (_a) {
43
49
  dispatch(clearError());
44
50
  civilIDFileIdControl.field.onChange(ids);
45
51
  };
46
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadMultipleFile, { readOnly: readOnly, id: 'civilID', control: control, label: t('title_civil_id'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop_civilID'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_civil_id'), onFileUploaded: handleCivilIDChange, isSubmitting: loading, onDeleteFile: handleReset, maxLimit: 4, defaultFiles: defaultFiles, purpose: DocumentPurpose.IDENTITY_DOCUMENT, fileUploadingStatus: function (uploading) { return dispatch(civilIDUploadingStatus(uploading)); }, fileType: FileType.IMAGES }) }) })));
52
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadMultipleFile, { readOnly: readOnly, id: 'civilID', control: control, label: t('title_civil_id'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop_civilID'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_civil_id'), onFileUploaded: handleCivilIDChange, isSubmitting: loading, onDeleteFile: handleReset, maxLimit: 4, defaultFiles: defaultFiles, purpose: DocumentPurpose.IDENTITY_DOCUMENT, fileUploadingStatus: function (uploading) { return dispatch(civilIDUploadingStatus(uploading)); }, fileType: FileType.IMAGES, isVerified: !(uploadedIds === null || uploadedIds === void 0 ? void 0 : uploadedIds.length) && isDocumentVerified }) }) })));
47
53
  };
48
54
  export default CivilIDFile;
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  export interface InfluencerSwitchProps {
3
3
  show: boolean;
4
4
  readOnly?: boolean;
5
+ isVerified?: boolean;
5
6
  }
6
- declare const _default: React.MemoExoticComponent<({ show, readOnly }: InfluencerSwitchProps) => JSX.Element>;
7
+ declare const _default: React.MemoExoticComponent<({ show, readOnly, isVerified }: InfluencerSwitchProps) => JSX.Element>;
7
8
  export default _default;
@@ -13,18 +13,19 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useFormContext, useController } from 'react-hook-form';
16
- import { ScreenContainer } from '../../../shared/Containers';
17
- import Collapse from '../../../../components/Collapse';
16
+ import Box from '@mui/material/Box';
18
17
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
19
- import { styled, alpha } from '@mui/material/styles';
20
- import Mandatory from '../../../shared/Mandatory';
18
+ import Collapse from '../../../../components/Collapse';
19
+ import Tooltip from '../../../../components/Tooltip';
21
20
  import Text from '../../../../components/Text';
22
21
  import RadioGroup from '../../../../components/RadioGroup';
23
22
  import RadioLabel from '../../../../components/RadioLabel';
24
- import { InfoIconStyled, InfoOutlinedIconStyled } from './PEPSwitch';
25
- import Box from '@mui/material/Box';
26
- import Tooltip from '../../../../components/Tooltip';
23
+ import { styled, alpha } from '@mui/material/styles';
24
+ import Mandatory from '../../../shared/Mandatory';
25
+ import CheckIcon from '../../../shared/CheckIcon';
26
+ import { ScreenContainer } from '../../../shared/Containers';
27
27
  import { individualSelector, clearError } from '../../../app/individual/individualStore';
28
+ import { InfoIconStyled, InfoOutlinedIconStyled } from './PEPSwitch';
28
29
  var LabelTextStyled = styled(Text)(function (_a) {
29
30
  var theme = _a.theme;
30
31
  return (__assign(__assign({}, theme.typography.caption), { color: alpha(theme.palette.text.primary, 0.6), marginBlockEnd: theme.spacing(0.625) }));
@@ -35,15 +36,17 @@ var RadioGroupStyled = styled(RadioGroup)(function (_a) {
35
36
  marginInlineStart: theme.spacing(0.25)
36
37
  });
37
38
  });
39
+ var RadioLabelStyled = styled('span')(function () { return ({
40
+ display: 'flex'
41
+ }); });
38
42
  var InfluencerSwitch = function (_a) {
39
- var show = _a.show, readOnly = _a.readOnly;
43
+ var show = _a.show, readOnly = _a.readOnly, isVerified = _a.isVerified;
40
44
  var _b = React.useState(false), isHovered = _b[0], setIsHovered = _b[1];
41
45
  var control = useFormContext().control;
42
46
  var t = useTranslation().t;
43
47
  var dispatch = useAppDispatch();
44
48
  var influencerControl = useController({ name: 'isInfluencer', control: control });
45
49
  var error = useAppSelector(individualSelector).error;
46
- var disabled = false;
47
50
  var handleOnChange = function (_a) {
48
51
  var target = _a.target;
49
52
  if (error)
@@ -51,6 +54,6 @@ var InfluencerSwitch = function (_a) {
51
54
  influencerControl.field.onChange(target.value === 'yes');
52
55
  };
53
56
  var influencerValue = influencerControl.field.value;
54
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pt: 2.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(Box, __assign({ style: { display: 'flex', justifyContent: 'space-between' } }, { children: [_jsxs(LabelTextStyled, { children: [t('tap_js_are_you_an_influencer'), _jsx(Mandatory, {})] }), _jsx(Tooltip, __assign({ title: t('influencer_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] })), _jsxs(RadioGroupStyled, __assign({ readOnly: readOnly, value: influencerValue != null ? (influencerValue ? 'yes' : 'no') : false, onChange: disabled || readOnly ? undefined : handleOnChange }, { children: [_jsx(RadioLabel, { value: 'yes', label: t('yes') }), _jsx(RadioLabel, { value: 'no', label: t('no') })] }))] })) })));
57
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pt: 2.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(Box, __assign({ style: { display: 'flex', justifyContent: 'space-between' } }, { children: [_jsxs(LabelTextStyled, { children: [t('tap_js_are_you_an_influencer'), _jsx(Mandatory, {})] }), _jsx(Tooltip, __assign({ title: t('influencer_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] })), _jsxs(RadioGroupStyled, __assign({ readOnly: readOnly, value: influencerValue != null ? (influencerValue ? 'yes' : 'no') : false, onChange: readOnly ? undefined : handleOnChange }, { children: [_jsx(RadioLabel, { value: 'yes', label: _jsxs(RadioLabelStyled, { children: [t('yes'), influencerValue && isVerified && _jsx(CheckIcon, { sx: { marginInlineStart: '5px' }, isVerified: isVerified })] }) }), _jsx(RadioLabel, { value: 'no', label: _jsxs(RadioLabelStyled, { children: [t('no'), influencerValue === false && isVerified && _jsx(CheckIcon, { sx: { marginInlineStart: '5px' }, isVerified: isVerified })] }) })] }))] })) })));
55
58
  };
56
59
  export default React.memo(InfluencerSwitch);
@@ -9,23 +9,23 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import Box from '@mui/material/Box';
17
17
  import { styled } from '@mui/material/styles';
18
- import { ScreenContainer } from '../../../shared/Containers';
19
- import Input from '../../../shared/Input';
20
- import CheckIcon from '../../../shared/CheckIcon';
21
- import Collapse from '../../../../components/Collapse';
18
+ import { settingsSelector } from '../../../../app/settings';
19
+ import { findCurrencyByIso2, hasVerifiedValue } from '../../../../utils';
22
20
  import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
23
- import { individualSelector, clearError } from '../../../app/individual/individualStore';
21
+ import Collapse from '../../../../components/Collapse';
24
22
  import Text from '../../../../components/Text';
25
23
  import ExpandIcon from '../../../../components/ExpandIcon';
26
24
  import SimpleList from '../../../../components/SimpleList';
27
- import { findCurrencyByIso2 } from '../../../../utils';
28
- import { settingsSelector } from '../../../../app/settings';
25
+ import { individualSelector, clearError } from '../../../app/individual/individualStore';
26
+ import Input from '../../../shared/Input';
27
+ import CheckIcon from '../../../shared/CheckIcon';
28
+ import { ScreenContainer } from '../../../shared/Containers';
29
29
  var Container = styled(Box)(function () { return ({
30
30
  display: 'flex'
31
31
  }); });
@@ -41,14 +41,6 @@ var IncomeText = styled(Text, { shouldForwardProp: function (prop) { return prop
41
41
  var theme = _a.theme, isSelected = _a.isSelected;
42
42
  return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
43
43
  });
44
- var CheckIconStyled = styled(CheckIcon)(function (_a) {
45
- var theme = _a.theme;
46
- return ({
47
- color: theme.palette.success.main,
48
- display: 'flex',
49
- alignItems: 'flex-end'
50
- });
51
- });
52
44
  var MonthlyIncome = function (props) {
53
45
  var _a;
54
46
  var _b = React.useState([]), incomeList = _b[0], setIncomeList = _b[1];
@@ -62,7 +54,10 @@ var MonthlyIncome = function (props) {
62
54
  var monthlyIncomeList = (data.individualData.responseBody || {}).monthlyIncomeList;
63
55
  var monthlyIncomeControl = useController({ control: control, name: 'monthlyIncome' });
64
56
  var countryCode = settingsData.businessCountry;
65
- var disabled = false;
57
+ var user = (data.verify.responseBody || {}).user;
58
+ var isMonthlyIncomeVerified = function (item) {
59
+ return hasVerifiedValue(user === null || user === void 0 ? void 0 : user.data_verification, "monthly_income.".concat(item.id));
60
+ };
66
61
  React.useEffect(function () {
67
62
  if ((monthlyIncomeList === null || monthlyIncomeList === void 0 ? void 0 : monthlyIncomeList.length) > 0) {
68
63
  setIncomeList(monthlyIncomeList);
@@ -93,8 +88,8 @@ var MonthlyIncome = function (props) {
93
88
  var error = (_a = monthlyIncomeControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
94
89
  return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 0 } }, { children: [_jsx(InputStyled, { label: t('please_enter_actual_income', {
95
90
  currency: t(findCurrencyByIso2(countryCode.iso2))
96
- }), disabled: disabled, readOnly: props.readOnly, onClick: disabled ? undefined : !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: disabled ? _jsx(_Fragment, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_source_of_income'), value: (isAr ? income === null || income === void 0 ? void 0 : income.range.ar : income === null || income === void 0 ? void 0 : income.range.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'range.en', searchValuePath: ['range.en', 'range.ar'], list: incomeList, onSelectItem: onSelectItem, renderItem: function (item) {
97
- return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (income === null || income === void 0 ? void 0 : income.id) }, { children: isAr ? item.range.ar : item === null || item === void 0 ? void 0 : item.range.en })) }), item.id === (income === null || income === void 0 ? void 0 : income.id) && _jsx(CheckIconStyled, {})] }));
91
+ }), readOnly: props.readOnly, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_source_of_income'), value: (isAr ? income === null || income === void 0 ? void 0 : income.range.ar : income === null || income === void 0 ? void 0 : income.range.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'range.en', searchValuePath: ['range.en', 'range.ar'], list: incomeList, onSelectItem: onSelectItem, renderItem: function (item) {
92
+ return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (income === null || income === void 0 ? void 0 : income.id) }, { children: isAr ? item.range.ar : item === null || item === void 0 ? void 0 : item.range.en })) }), item.id === (income === null || income === void 0 ? void 0 : income.id) && _jsx(CheckIcon, { isVerified: isMonthlyIncomeVerified(item) })] }));
98
93
  } }) }))] })) })));
99
94
  };
100
95
  export default React.memo(MonthlyIncome);
@@ -6,6 +6,7 @@ interface OccupationProps {
6
6
  onListOpen?: () => void;
7
7
  onListClose?: () => void;
8
8
  readOnly?: boolean;
9
+ isVerified?: boolean;
9
10
  }
10
11
  declare const Occupation: (props: OccupationProps) => JSX.Element;
11
12
  export default Occupation;
@@ -9,21 +9,21 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
- import Box from '@mui/material/Box';
15
- import { styled } from '@mui/material/styles';
16
14
  import { useTranslation } from 'react-i18next';
17
15
  import { useController, useFormContext } from 'react-hook-form';
16
+ import Box from '@mui/material/Box';
17
+ import { styled } from '@mui/material/styles';
18
18
  import { useAppSelector, useLanguage, useAppDispatch } from '../../../../hooks';
19
- import { individualSelector, clearError } from '../../../app/individual/individualStore';
20
19
  import Text from '../../../../components/Text';
20
+ import SimpleList from '../../../../components/SimpleList';
21
21
  import Collapse from '../../../../components/Collapse';
22
- import CheckIcon from '@mui/icons-material/Check';
23
22
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
24
23
  import Input from '../../../shared/Input';
25
- import ExpandIcon from '../../../../components/ExpandIcon';
26
- import SimpleList from '../../../../components/SimpleList';
24
+ import { EndAdornmentExpanded } from '../../../shared/EndAdornment';
25
+ import CheckIcon from '../../../shared/CheckIcon';
26
+ import { individualSelector, clearError } from '../../../app/individual/individualStore';
27
27
  var Container = styled(Box)(function () { return ({
28
28
  display: 'flex'
29
29
  }); });
@@ -39,14 +39,6 @@ var IncomeText = styled(Text, { shouldForwardProp: function (prop) { return prop
39
39
  var theme = _a.theme, isSelected = _a.isSelected;
40
40
  return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
41
41
  });
42
- var CheckIconStyled = styled(CheckIcon)(function (_a) {
43
- var theme = _a.theme;
44
- return ({
45
- color: theme.palette.success.main,
46
- display: 'flex',
47
- alignItems: 'flex-end'
48
- });
49
- });
50
42
  var Occupation = function (props) {
51
43
  var _a, _b;
52
44
  var _c = React.useState([]), occupationList = _c[0], setOccupationList = _c[1];
@@ -58,7 +50,6 @@ var Occupation = function (props) {
58
50
  var control = useFormContext().control;
59
51
  var occupationsList = ((_a = data.individualData.responseBody) === null || _a === void 0 ? void 0 : _a.occupationList) || [];
60
52
  var occupationControl = useController({ control: control, name: 'occupation' });
61
- var disabled = false;
62
53
  React.useEffect(function () {
63
54
  if ((occupationsList === null || occupationsList === void 0 ? void 0 : occupationsList.length) > 0) {
64
55
  setOccupationList(occupationsList);
@@ -84,9 +75,9 @@ var Occupation = function (props) {
84
75
  };
85
76
  var occupation = occupationControl.field.value;
86
77
  var error = (_b = occupationControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
87
- return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(InputStyled, { required: true, disabled: disabled, label: t('occupation_title'), readOnly: props.readOnly, onClick: disabled ? undefined : !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: disabled ? _jsx(_Fragment, {}) : _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', searchValuePath: ['name.en', 'name.ar'], list: occupationList, onSelectItem: onSelectItem, renderItem: function (item) {
78
+ return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(InputStyled, { required: true, label: t('occupation_title'), readOnly: props.readOnly, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(EndAdornmentExpanded, { isVerified: props.isVerified, 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', searchValuePath: ['name.en', 'name.ar'], list: occupationList, onSelectItem: onSelectItem, renderItem: function (item) {
88
79
  var _a, _b;
89
- return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id) }, { children: isAr ? (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en })) }), item.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id) && _jsx(CheckIconStyled, {})] }));
80
+ return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id) }, { children: isAr ? (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en })) }), item.id === (occupation === null || occupation === void 0 ? void 0 : occupation.id) && _jsx(CheckIcon, { isVerified: props.isVerified })] }));
90
81
  } }) }))] })) })));
91
82
  };
92
83
  export default Occupation;
@@ -30,6 +30,7 @@ export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledCom
30
30
  export interface PEPSwitchProps {
31
31
  show: boolean;
32
32
  readOnly?: boolean;
33
+ isVerified?: boolean;
33
34
  }
34
- declare const _default: React.MemoExoticComponent<({ show, readOnly }: PEPSwitchProps) => JSX.Element>;
35
+ declare const _default: React.MemoExoticComponent<({ show, readOnly, isVerified }: PEPSwitchProps) => JSX.Element>;
35
36
  export default _default;
@@ -14,17 +14,18 @@ import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useFormContext, useController } from 'react-hook-form';
16
16
  import { styled, alpha } from '@mui/material/styles';
17
+ import InfoIcon from '@mui/icons-material/Info';
18
+ import Box from '@mui/material/Box';
19
+ import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
17
20
  import { ScreenContainer } from '../../../shared/Containers';
18
- import Collapse from '../../../../components/Collapse';
19
- import Mandatory from '../../../shared/Mandatory';
20
- import Text from '../../../../components/Text';
21
21
  import { useAppSelector, useAppDispatch } from '../../../../hooks';
22
+ import Collapse from '../../../../components/Collapse';
22
23
  import RadioGroup from '../../../../components/RadioGroup';
23
24
  import RadioLabel from '../../../../components/RadioLabel';
25
+ import Text from '../../../../components/Text';
24
26
  import Tooltip from '../../../../components/Tooltip';
25
- import InfoIcon from '@mui/icons-material/Info';
26
- import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
27
- import Box from '@mui/material/Box';
27
+ import Mandatory from '../../../shared/Mandatory';
28
+ import CheckIcon from '../../../shared/CheckIcon';
28
29
  import { individualSelector, clearError } from '../../../app/individual/individualStore';
29
30
  var LabelTextStyled = styled(Text)(function (_a) {
30
31
  var theme = _a.theme;
@@ -54,15 +55,17 @@ export var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
54
55
  color: alpha(theme.palette.text.primary, 0.4)
55
56
  });
56
57
  });
58
+ var RadioLabelStyled = styled('span')(function () { return ({
59
+ display: 'flex'
60
+ }); });
57
61
  var PEPSwitch = function (_a) {
58
- var show = _a.show, readOnly = _a.readOnly;
62
+ var show = _a.show, readOnly = _a.readOnly, isVerified = _a.isVerified;
59
63
  var _b = React.useState(false), isHovered = _b[0], setIsHovered = _b[1];
60
64
  var control = useFormContext().control;
61
65
  var t = useTranslation().t;
62
66
  var pepControl = useController({ name: 'isPEP', control: control });
63
67
  var error = useAppSelector(individualSelector).error;
64
68
  var dispatch = useAppDispatch();
65
- var disabled = false;
66
69
  var handleOnChange = function (_a) {
67
70
  var target = _a.target;
68
71
  if (error)
@@ -70,6 +73,6 @@ var PEPSwitch = function (_a) {
70
73
  pepControl.field.onChange(target.value === 'yes');
71
74
  };
72
75
  var pepValue = pepControl.field.value;
73
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pt: 2.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(Box, __assign({ style: { display: 'flex', justifyContent: 'space-between' } }, { children: [_jsxs(LabelTextStyled, { children: [t('tap_js_is_close_relative_in_pep'), _jsx(Mandatory, {})] }), _jsx(Tooltip, __assign({ title: t('pep_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] })), _jsxs(RadioGroupStyled, __assign({ readOnly: readOnly, value: pepValue != null ? (pepValue ? 'yes' : 'no') : false, onChange: disabled || readOnly ? undefined : handleOnChange }, { children: [_jsx(RadioLabel, { value: 'yes', label: t('yes') }), _jsx(RadioLabel, { value: 'no', label: t('no') })] }))] })) })));
76
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pt: 2.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(Box, __assign({ style: { display: 'flex', justifyContent: 'space-between' } }, { children: [_jsxs(LabelTextStyled, { children: [t('tap_js_is_close_relative_in_pep'), _jsx(Mandatory, {})] }), _jsx(Tooltip, __assign({ title: t('pep_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] })), _jsxs(RadioGroupStyled, __assign({ readOnly: readOnly, value: pepValue != null ? (pepValue ? 'yes' : 'no') : false, onChange: readOnly ? undefined : handleOnChange }, { children: [_jsx(RadioLabel, { value: 'yes', label: _jsxs(RadioLabelStyled, { children: [t('yes'), pepValue && isVerified && _jsx(CheckIcon, { sx: { marginInlineStart: '5px' }, isVerified: isVerified })] }) }), _jsx(RadioLabel, { value: 'no', label: _jsxs(RadioLabelStyled, { children: [t('no'), pepValue === false && isVerified && _jsx(CheckIcon, { sx: { marginInlineStart: '5px' }, isVerified: isVerified })] }) })] }))] })) })));
74
77
  };
75
78
  export default React.memo(PEPSwitch);
@@ -10,12 +10,14 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ import React from 'react';
13
14
  import { useTranslation } from 'react-i18next';
14
15
  import { useController, useFormContext } from 'react-hook-form';
15
16
  import { styled } from '@mui/material/styles';
16
17
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
17
18
  import { DocumentPurpose } from '../../../../@types';
18
19
  import { FileType } from '../../../../constants';
20
+ import { hasVerifiedValue } from '../../../../utils';
19
21
  import UploadMultipleFile from '../../../shared/UploadMultipleFile';
20
22
  import { ScreenContainer } from '../../../shared/Containers';
21
23
  import { individualSelector, signatureFileUploadingStatus, clearError } from '../../../app/individual/individualStore';
@@ -27,12 +29,16 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
27
29
  });
28
30
  });
29
31
  var SignatureFile = function (_a) {
32
+ var _b;
30
33
  var show = _a.show, readOnly = _a.readOnly, defaultFiles = _a.defaultFiles;
31
34
  var t = useTranslation().t;
32
35
  var control = useFormContext().control;
33
- var signatureFileIdControl = useController({ name: 'signatureFileId', control: control });
34
- var _b = useAppSelector(individualSelector), loading = _b.loading, error = _b.error;
35
36
  var dispatch = useAppDispatch();
37
+ var signatureFileIdControl = useController({ name: 'signatureFileId', control: control });
38
+ var _c = useAppSelector(individualSelector), loading = _c.loading, error = _c.error, data = _c.data;
39
+ var data_verification = (((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.user) || {}).data_verification;
40
+ var uploadedIds = signatureFileIdControl.field.value;
41
+ var isDocumentVerified = React.useMemo(function () { var _a; return !!((_a = defaultFiles === null || defaultFiles === void 0 ? void 0 : defaultFiles[0]) === null || _a === void 0 ? void 0 : _a.docId) && hasVerifiedValue(data_verification, "documents.".concat(defaultFiles[0].docId)); }, [data_verification]);
36
42
  var handleSignatureChange = function (ids) {
37
43
  if (error)
38
44
  dispatch(clearError());
@@ -43,6 +49,6 @@ var SignatureFile = function (_a) {
43
49
  dispatch(clearError());
44
50
  signatureFileIdControl.field.onChange(ids);
45
51
  };
46
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadMultipleFile, { readOnly: readOnly, id: 'signatureFileId', control: control, label: t('title_signature_file'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop_signature'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_signature_file'), onFileUploaded: handleSignatureChange, isSubmitting: loading, onDeleteFile: handleReset, maxLimit: 4, defaultFiles: defaultFiles, purpose: DocumentPurpose.CUSTOMER_SIGNATURE, fileUploadingStatus: function (uploading) { return dispatch(signatureFileUploadingStatus(uploading)); }, fileType: FileType.IMAGES }) }) })));
52
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadMultipleFile, { readOnly: readOnly, id: 'signatureFileId', control: control, label: t('title_signature_file'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop_signature'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_signature_file'), onFileUploaded: handleSignatureChange, isSubmitting: loading, onDeleteFile: handleReset, maxLimit: 4, defaultFiles: defaultFiles, purpose: DocumentPurpose.CUSTOMER_SIGNATURE, fileUploadingStatus: function (uploading) { return dispatch(signatureFileUploadingStatus(uploading)); }, fileType: FileType.IMAGES, isVerified: !(uploadedIds === null || uploadedIds === void 0 ? void 0 : uploadedIds.length) && isDocumentVerified }) }) })));
47
53
  };
48
54
  export default SignatureFile;
@@ -9,21 +9,22 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
- import Box from '@mui/material/Box';
15
- import { styled } from '@mui/material/styles';
16
14
  import { useTranslation } from 'react-i18next';
17
15
  import { useController, useFormContext } from 'react-hook-form';
16
+ import Box from '@mui/material/Box';
17
+ import { styled } from '@mui/material/styles';
18
18
  import { useAppSelector, useLanguage, useAppDispatch } from '../../../../hooks';
19
- import { individualSelector, clearError } from '../../../app/individual/individualStore';
19
+ import { hasVerifiedValue } from '../../../../utils';
20
20
  import Text from '../../../../components/Text';
21
21
  import Collapse from '../../../../components/Collapse';
22
- import CheckIcon from '@mui/icons-material/Check';
23
- import ScreenContainer from '../../../shared/Containers/ScreenContainer';
24
- import Input from '../../../shared/Input';
25
22
  import ExpandIcon from '../../../../components/ExpandIcon';
26
23
  import SimpleList from '../../../../components/SimpleList';
24
+ import CheckIcon from '../../../shared/CheckIcon';
25
+ import ScreenContainer from '../../../shared/Containers/ScreenContainer';
26
+ import Input from '../../../shared/Input';
27
+ import { individualSelector, clearError } from '../../../app/individual/individualStore';
27
28
  var InputStyled = styled(Input)(function (_a) {
28
29
  var readOnly = _a.readOnly;
29
30
  return ({
@@ -39,14 +40,6 @@ var IncomeText = styled(Text, { shouldForwardProp: function (prop) { return prop
39
40
  var theme = _a.theme, isSelected = _a.isSelected;
40
41
  return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
41
42
  });
42
- var CheckIconStyled = styled(CheckIcon)(function (_a) {
43
- var theme = _a.theme;
44
- return ({
45
- color: theme.palette.success.main,
46
- display: 'flex',
47
- alignItems: 'flex-end'
48
- });
49
- });
50
43
  var SourceOfIncome = function (props) {
51
44
  var _a, _b;
52
45
  var _c = React.useState([]), sourceList = _c[0], setSourceList = _c[1];
@@ -54,11 +47,14 @@ var SourceOfIncome = function (props) {
54
47
  var t = useTranslation().t;
55
48
  var isAr = useLanguage().isAr;
56
49
  var _e = useAppSelector(individualSelector), data = _e.data, bckError = _e.error;
50
+ var user = (data.verify.responseBody || {}).user;
57
51
  var dispatch = useAppDispatch();
58
52
  var control = useFormContext().control;
59
53
  var sourceIncomeList = ((_a = data.individualData.responseBody) === null || _a === void 0 ? void 0 : _a.sourceIncomeList) || [];
60
54
  var sourceIncomeControl = useController({ control: control, name: 'sourceIncome' });
61
- var disabled = false;
55
+ var isSourceIncomeVerified = function (item) {
56
+ return hasVerifiedValue(user === null || user === void 0 ? void 0 : user.data_verification, "source_of_income.".concat(item.id));
57
+ };
62
58
  React.useEffect(function () {
63
59
  if ((sourceIncomeList === null || sourceIncomeList === void 0 ? void 0 : sourceIncomeList.length) > 0) {
64
60
  setSourceList(sourceIncomeList);
@@ -84,8 +80,8 @@ var SourceOfIncome = function (props) {
84
80
  };
85
81
  var source = sourceIncomeControl.field.value;
86
82
  var error = (_b = sourceIncomeControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
87
- return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(InputStyled, { required: true, disabled: disabled, label: t('tap_js_source_of_income'), readOnly: props.readOnly, onClick: disabled ? undefined : !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: disabled ? _jsx(_Fragment, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_source_of_income'), value: (isAr ? source === null || source === void 0 ? void 0 : source.name.ar : source === null || source === void 0 ? void 0 : source.name.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', list: sourceList, onSelectItem: onSelectItem, renderItem: function (item) {
88
- return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (source === null || source === void 0 ? void 0 : source.id) }, { children: isAr ? item.name.ar : item === null || item === void 0 ? void 0 : item.name.en })) }), item.id === (source === null || source === void 0 ? void 0 : source.id) && _jsx(CheckIconStyled, {})] }));
83
+ return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(InputStyled, { required: true, label: t('tap_js_source_of_income'), readOnly: props.readOnly, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_source_of_income'), value: (isAr ? source === null || source === void 0 ? void 0 : source.name.ar : source === null || source === void 0 ? void 0 : source.name.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', list: sourceList, onSelectItem: onSelectItem, renderItem: function (item) {
84
+ return (_jsxs(_Fragment, { children: [_jsx(Container, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (source === null || source === void 0 ? void 0 : source.id) }, { children: isAr ? item.name.ar : item === null || item === void 0 ? void 0 : item.name.en })) }), item.id === (source === null || source === void 0 ? void 0 : source.id) && _jsx(CheckIcon, { isVerified: isSourceIncomeVerified(item) })] }));
89
85
  } }) }))] })) })));
90
86
  };
91
87
  export default React.memo(SourceOfIncome);
@@ -4,6 +4,7 @@ interface BirthCityProps {
4
4
  onListOpen?: () => void;
5
5
  onListClose?: () => void;
6
6
  readOnly?: boolean;
7
+ isVerified?: boolean;
7
8
  }
8
9
  declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<BirthCityProps & React.RefAttributes<unknown>>>;
9
10
  export default _default;
@@ -24,16 +24,16 @@ import Box from '@mui/material/Box';
24
24
  import { useTranslation } from 'react-i18next';
25
25
  import { useController, useFormContext } from 'react-hook-form';
26
26
  import { styled } from '@mui/material/styles';
27
- import CheckIcon from '@mui/icons-material/Check';
28
27
  import CircularProgress from '@mui/material/CircularProgress';
29
28
  import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
30
29
  import Collapse from '../../../../components/Collapse';
31
- import ExpandIcon from '../../../../components/ExpandIcon';
32
30
  import Text from '../../../../components/Text';
33
31
  import SimpleList from '../../../../components/SimpleList';
34
32
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
35
33
  import Input from '../../../shared/Input';
36
34
  import { getCityList, individualSelector } from '../../../app/individual/individualStore';
35
+ import { EndAdornmentExpanded } from '../../../shared/EndAdornment';
36
+ import CheckIcon from '../../../shared/CheckIcon';
37
37
  var CountryItemContainer = styled(Box)(function () { return ({
38
38
  display: 'flex'
39
39
  }); });
@@ -49,17 +49,9 @@ var CountryNameText = styled(Text, { shouldForwardProp: function (prop) { return
49
49
  var theme = _a.theme, isSelected = _a.isSelected;
50
50
  return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
51
51
  });
52
- var CheckIconStyled = styled(CheckIcon)(function (_a) {
53
- var theme = _a.theme;
54
- return ({
55
- color: theme.palette.success.main,
56
- display: 'flex',
57
- alignItems: 'flex-end'
58
- });
59
- });
60
52
  var BirthCity = React.forwardRef(function (_a, ref) {
61
53
  var _b;
62
- var show = _a.show, onListOpen = _a.onListOpen, onListClose = _a.onListClose, readOnly = _a.readOnly;
54
+ var show = _a.show, onListOpen = _a.onListOpen, onListClose = _a.onListClose, readOnly = _a.readOnly, isVerified = _a.isVerified;
63
55
  var _c = React.useState([]), locationCities = _c[0], setCities = _c[1];
64
56
  var _d = React.useState(null), anchorEl = _d[0], setAnchorEl = _d[1];
65
57
  var t = useTranslation().t;
@@ -112,8 +104,8 @@ var BirthCity = React.forwardRef(function (_a, ref) {
112
104
  var _a, _b;
113
105
  return isAr ? (_a = city === null || city === void 0 ? void 0 : city.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = city === null || city === void 0 ? void 0 : city.name) === null || _b === void 0 ? void 0 : _b.en;
114
106
  };
115
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { pt: 2.5 } }, { children: [_jsx(InputStyled, { label: t('place_birth_city_label'), readOnly: readOnly, placeholder: t('choose_place_birth_city'), value: getName(cityValue) || '', warningMessage: error && t(error), onClick: cityLoading ? undefined : !!anchorEl ? function () { return onCloseCitySelect(); } : onOpenCitySelect, endAdornment: cityLoading ? _jsx(CircularProgress, { size: 25, thickness: 5, sx: { height: 'auto !important' } }) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', searchValuePath: ['name.en'], list: locationCities, onSelectItem: onSelectItem, renderItem: function (item) {
116
- return (_jsxs(_Fragment, { children: [_jsx(CountryItemContainer, { children: _jsx(CountryNameText, __assign({ isSelected: item.id === (cityValue === null || cityValue === void 0 ? void 0 : cityValue.id) }, { children: getName(item) })) }), item.id === (cityValue === null || cityValue === void 0 ? void 0 : cityValue.id) && _jsx(CheckIconStyled, {})] }));
107
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { pt: 2.5 } }, { children: [_jsx(InputStyled, { label: t('place_birth_city_label'), readOnly: readOnly, placeholder: t('choose_place_birth_city'), value: getName(cityValue) || '', warningMessage: error && t(error), onClick: cityLoading ? undefined : !!anchorEl ? function () { return onCloseCitySelect(); } : onOpenCitySelect, endAdornment: cityLoading ? (_jsx(CircularProgress, { size: 25, thickness: 5, sx: { height: 'auto !important' } })) : (_jsx(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified })) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', searchValuePath: ['name.en'], list: locationCities, onSelectItem: onSelectItem, renderItem: function (item) {
108
+ return (_jsxs(_Fragment, { children: [_jsx(CountryItemContainer, { children: _jsx(CountryNameText, __assign({ isSelected: item.id === (cityValue === null || cityValue === void 0 ? void 0 : cityValue.id) }, { children: getName(item) })) }), item.id === (cityValue === null || cityValue === void 0 ? void 0 : cityValue.id) && _jsx(CheckIcon, { isVerified: isVerified })] }));
117
109
  } }) }))] })) })));
118
110
  });
119
111
  export default React.memo(BirthCity);
@@ -6,6 +6,7 @@ interface BirthCountryProps {
6
6
  onListOpen?: () => void;
7
7
  onListClose?: () => void;
8
8
  readOnly?: boolean;
9
+ isVerified?: boolean;
9
10
  }
10
11
  declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<BirthCountryProps & React.RefAttributes<unknown>>>;
11
12
  export default _default;
@@ -26,14 +26,14 @@ import Box from '@mui/material/Box';
26
26
  import { useTranslation } from 'react-i18next';
27
27
  import { useController, useFormContext } from 'react-hook-form';
28
28
  import { styled } from '@mui/material/styles';
29
- import CheckIcon from '@mui/icons-material/Check';
30
29
  import { useLanguage } from '../../../../hooks';
31
30
  import Collapse from '../../../../components/Collapse';
32
- import ExpandIcon from '../../../../components/ExpandIcon';
33
31
  import Text from '../../../../components/Text';
34
32
  import SimpleList from '../../../../components/SimpleList';
35
33
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
36
34
  import Input from '../../../shared/Input';
35
+ import { EndAdornmentExpanded } from '../../../shared/EndAdornment';
36
+ import CheckIcon from '../../../shared/CheckIcon';
37
37
  var CountryItemContainer = styled(Box)(function () { return ({
38
38
  display: 'flex'
39
39
  }); });
@@ -49,17 +49,9 @@ var CountryNameText = styled(Text, { shouldForwardProp: function (prop) { return
49
49
  var theme = _a.theme, isSelected = _a.isSelected;
50
50
  return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
51
51
  });
52
- var CheckIconStyled = styled(CheckIcon)(function (_a) {
53
- var theme = _a.theme;
54
- return ({
55
- color: theme.palette.success.main,
56
- display: 'flex',
57
- alignItems: 'flex-end'
58
- });
59
- });
60
52
  var BirthCountry = React.forwardRef(function (_a, ref) {
61
53
  var _b, _c, _d;
62
- var countries = _a.countries, readOnly = _a.readOnly, rest = __rest(_a, ["countries", "readOnly"]);
54
+ var countries = _a.countries, readOnly = _a.readOnly, isVerified = _a.isVerified, rest = __rest(_a, ["countries", "readOnly", "isVerified"]);
63
55
  var _e = React.useState(countries), locationCountries = _e[0], setCountries = _e[1];
64
56
  var _f = React.useState(null), anchorEl = _f[0], setAnchorEl = _f[1];
65
57
  var t = useTranslation().t;
@@ -85,8 +77,8 @@ var BirthCountry = React.forwardRef(function (_a, ref) {
85
77
  };
86
78
  var location = placeOfBirthCountryControl.field.value;
87
79
  var error = (_b = placeOfBirthCountryControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
88
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { pt: 2.5 } }, { children: [_jsx(InputStyled, { label: t('place_of_birth_country_label'), readOnly: readOnly, onClick: !!anchorEl ? function () { return onCloseCountrySelect(); } : onOpenCountrySelect, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_place_of_birth_country'), value: (isAr ? (_c = location === null || location === void 0 ? void 0 : location.name) === null || _c === void 0 ? void 0 : _c.arabic : (_d = location === null || location === void 0 ? void 0 : location.name) === null || _d === void 0 ? void 0 : _d.english) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', searchValuePath: ['name.arabic', 'name.english'], list: locationCountries, onSelectItem: onSelectItem, renderItem: function (item) {
89
- return (_jsxs(_Fragment, { children: [_jsx(CountryItemContainer, { children: _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (location === null || location === void 0 ? void 0 : location.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english })) }), item.idd_prefix === (location === null || location === void 0 ? void 0 : location.idd_prefix) && _jsx(CheckIconStyled, {})] }));
80
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { pt: 2.5 } }, { children: [_jsx(InputStyled, { label: t('place_of_birth_country_label'), readOnly: readOnly, onClick: !!anchorEl ? function () { return onCloseCountrySelect(); } : onOpenCountrySelect, endAdornment: _jsx(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified }), placeholder: t('choose_place_of_birth_country'), value: (isAr ? (_c = location === null || location === void 0 ? void 0 : location.name) === null || _c === void 0 ? void 0 : _c.arabic : (_d = location === null || location === void 0 ? void 0 : location.name) === null || _d === void 0 ? void 0 : _d.english) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', searchValuePath: ['name.arabic', 'name.english'], list: locationCountries, onSelectItem: onSelectItem, renderItem: function (item) {
81
+ return (_jsxs(_Fragment, { children: [_jsx(CountryItemContainer, { children: _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (location === null || location === void 0 ? void 0 : location.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english })) }), item.idd_prefix === (location === null || location === void 0 ? void 0 : location.idd_prefix) && _jsx(CheckIcon, { isVerified: isVerified })] }));
90
82
  } }) }))] })) })));
91
83
  });
92
84
  export default React.memo(BirthCountry);
@@ -2,7 +2,8 @@ import * as React from 'react';
2
2
  interface BODProps {
3
3
  show: boolean;
4
4
  onDateClicked?: (flag: boolean) => void;
5
+ isVerified?: boolean;
5
6
  readOnly?: boolean;
6
7
  }
7
- declare const _default: React.MemoExoticComponent<({ onDateClicked, show, readOnly }: BODProps) => JSX.Element>;
8
+ declare const _default: React.MemoExoticComponent<({ onDateClicked, show, readOnly, isVerified }: BODProps) => JSX.Element>;
8
9
  export default _default;
@@ -26,7 +26,7 @@ var InputLabelStyled = styled(Text)(function (_a) {
26
26
  });
27
27
  var BOD = function (_a) {
28
28
  var _b;
29
- var onDateClicked = _a.onDateClicked, show = _a.show, readOnly = _a.readOnly;
29
+ var onDateClicked = _a.onDateClicked, show = _a.show, readOnly = _a.readOnly, isVerified = _a.isVerified;
30
30
  var t = useTranslation().t;
31
31
  var control = useFormContext().control;
32
32
  var dispatch = useAppDispatch();
@@ -41,6 +41,6 @@ var BOD = function (_a) {
41
41
  return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
42
42
  var spacing = _a.spacing;
43
43
  return spacing(2.5, 2.5, 2.5, 2.5);
44
- } } }, { children: t('enter_birth_date') })), _jsx(DatePicker, { readOnly: true, disabled: readOnly, defaultValue: dateValue ? new Date(dateValue) : undefined, dir: 'ltr', isDob: true, 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: handleBirthDateChange })] }) })));
44
+ } } }, { children: t('enter_birth_date') })), _jsx(DatePicker, { readOnly: true, isVerified: isVerified, disabled: readOnly, defaultValue: dateValue ? new Date(dateValue) : undefined, dir: 'ltr', isDob: true, 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: handleBirthDateChange })] }) })));
45
45
  };
46
46
  export default React.memo(BOD);