@tap-payments/auth-jsconnect 2.3.25-test → 2.3.27-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 (155) hide show
  1. package/build/@types/app.d.ts +12 -1
  2. package/build/@types/app.js +1 -0
  3. package/build/@types/form.d.ts +2 -1
  4. package/build/app/settings.d.ts +3 -1
  5. package/build/app/settings.js +5 -1
  6. package/build/assets/locales/ar.json +3 -1
  7. package/build/assets/locales/en.json +3 -1
  8. package/build/constants/app.d.ts +2 -1
  9. package/build/constants/app.js +1 -0
  10. package/build/constants/validation.d.ts +1 -0
  11. package/build/constants/validation.js +1 -0
  12. package/build/features/app/brand/brandStore.d.ts +5 -2
  13. package/build/features/app/brand/brandStore.js +12 -3
  14. package/build/features/bank/screens/BankDetails/BankDetails.js +18 -4
  15. package/build/features/bank/screens/BankDetails/BankName.d.ts +4 -1
  16. package/build/features/bank/screens/BankDetails/BankName.js +8 -7
  17. package/build/features/bank/screens/BankDetails/BankStatement.d.ts +4 -1
  18. package/build/features/bank/screens/BankDetails/BankStatement.js +3 -8
  19. package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +2 -1
  20. package/build/features/bank/screens/BankDetails/Beneficiary.js +8 -7
  21. package/build/features/bank/screens/BankDetails/ConfirmPolicy.d.ts +4 -1
  22. package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +6 -3
  23. package/build/features/bank/screens/BankDetails/IBAN.d.ts +2 -1
  24. package/build/features/bank/screens/BankDetails/IBAN.js +2 -2
  25. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +3 -1
  26. package/build/features/brand/screens/BrandActivities/ActivitiesList.js +11 -6
  27. package/build/features/brand/screens/BrandActivities/BrandActivities.js +3 -1
  28. package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +2 -1
  29. package/build/features/brand/screens/BrandActivities/CustomerBase.js +12 -9
  30. package/build/features/brand/screens/BrandActivities/ExpectedCustomers.d.ts +2 -1
  31. package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +10 -7
  32. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.d.ts +2 -1
  33. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +9 -6
  34. package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +4 -1
  35. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +7 -4
  36. package/build/features/brand/screens/BrandActivities/TAC.d.ts +2 -1
  37. package/build/features/brand/screens/BrandActivities/TAC.js +3 -1
  38. package/build/features/brand/screens/BrandActivities/TransactionPolicy.d.ts +4 -1
  39. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +7 -4
  40. package/build/features/brand/screens/BrandInfo/BrandInfo.js +14 -9
  41. package/build/features/brand/screens/BrandInfo/BrandLogo.d.ts +9 -0
  42. package/build/features/brand/screens/BrandInfo/BrandLogo.js +52 -0
  43. package/build/features/brand/screens/BrandInfo/BrandName.d.ts +2 -1
  44. package/build/features/brand/screens/BrandInfo/BrandName.js +2 -2
  45. package/build/features/brand/screens/BrandInfo/SalesChannels.d.ts +2 -1
  46. package/build/features/brand/screens/BrandInfo/SalesChannels.js +2 -1
  47. package/build/features/brand/screens/BrandInfo/Segments.d.ts +2 -1
  48. package/build/features/brand/screens/BrandInfo/Segments.js +3 -1
  49. package/build/features/brand/screens/BrandInfo/TeamSize.d.ts +2 -1
  50. package/build/features/brand/screens/BrandInfo/TeamSize.js +3 -1
  51. package/build/features/brand/screens/BrandInfo/validation.d.ts +3 -0
  52. package/build/features/brand/screens/BrandInfo/validation.js +1 -0
  53. package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +2 -1
  54. package/build/features/entity/screens/EntityCapital/ActivityList.js +12 -22
  55. package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +2 -1
  56. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +2 -1
  57. package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +2 -1
  58. package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +2 -1
  59. package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +2 -1
  60. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +2 -1
  61. package/build/features/entity/screens/EntityCapital/EntityCapital.js +3 -1
  62. package/build/features/entity/screens/EntityName/Article.d.ts +4 -1
  63. package/build/features/entity/screens/EntityName/Article.js +3 -4
  64. package/build/features/entity/screens/EntityName/EntityName.js +6 -3
  65. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +2 -1
  66. package/build/features/entity/screens/EntityName/EntityTypeList.js +9 -19
  67. package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +2 -1
  68. package/build/features/entity/screens/EntityName/ExpiryDate.js +2 -2
  69. package/build/features/entity/screens/EntityName/IssuingDate.d.ts +2 -1
  70. package/build/features/entity/screens/EntityName/IssuingDate.js +2 -2
  71. package/build/features/entity/screens/EntityName/LegalName.d.ts +2 -1
  72. package/build/features/entity/screens/EntityName/LegalName.js +2 -1
  73. package/build/features/entity/screens/EntityName/LicenseCertificate.d.ts +4 -1
  74. package/build/features/entity/screens/EntityName/LicenseCertificate.js +3 -8
  75. package/build/features/entity/screens/EntityName/LicenseNumber.d.ts +2 -1
  76. package/build/features/entity/screens/EntityName/LicenseNumber.js +2 -2
  77. package/build/features/entity/screens/EntityName/UnifiedNumber.d.ts +2 -1
  78. package/build/features/entity/screens/EntityName/UnifiedNumber.js +2 -2
  79. package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +5 -2
  80. package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.d.ts +6 -3
  81. package/build/features/individual/screens/AdditionalIndividualInfo/CivilIDFile.js +3 -8
  82. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +2 -1
  83. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +3 -4
  84. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +2 -1
  85. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +11 -22
  86. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.d.ts +2 -1
  87. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +12 -23
  88. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +2 -1
  89. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +3 -4
  90. package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.d.ts +2 -1
  91. package/build/features/individual/screens/AdditionalIndividualInfo/ShareCount.js +2 -2
  92. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.d.ts +2 -1
  93. package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +2 -2
  94. package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.d.ts +4 -1
  95. package/build/features/individual/screens/AdditionalIndividualInfo/SignatureFile.js +3 -8
  96. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +2 -1
  97. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +12 -23
  98. package/build/features/individual/screens/IndividualList/MobileNumber.js +0 -1
  99. package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.d.ts +1 -0
  100. package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +3 -1
  101. package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.d.ts +1 -0
  102. package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +3 -1
  103. package/build/features/individual/screens/IndividualPersonalInfo/DOB.d.ts +2 -1
  104. package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +2 -2
  105. package/build/features/individual/screens/IndividualPersonalInfo/Email.d.ts +2 -1
  106. package/build/features/individual/screens/IndividualPersonalInfo/Email.js +2 -4
  107. package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.d.ts +2 -1
  108. package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +3 -4
  109. package/build/features/individual/screens/IndividualPersonalInfo/Gender.d.ts +2 -1
  110. package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +3 -1
  111. package/build/features/individual/screens/IndividualPersonalInfo/ID.d.ts +2 -1
  112. package/build/features/individual/screens/IndividualPersonalInfo/ID.js +2 -7
  113. package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +3 -3
  114. package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.d.ts +1 -0
  115. package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +4 -6
  116. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.d.ts +1 -0
  117. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +2 -4
  118. package/build/features/individual/screens/IndividualPersonalInfo/Name.d.ts +2 -1
  119. package/build/features/individual/screens/IndividualPersonalInfo/Name.js +2 -2
  120. package/build/features/individual/screens/IndividualPersonalInfo/Nationality.d.ts +1 -0
  121. package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +4 -6
  122. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.d.ts +1 -0
  123. package/build/features/individual/screens/IndividualPhoneInfo/MobileNumber.js +6 -3
  124. package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
  125. package/build/features/shared/SalesChannels/SaleChannelIconsInput.d.ts +2 -1
  126. package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +3 -3
  127. package/build/features/shared/SalesChannels/SalesChannel.d.ts +2 -1
  128. package/build/features/shared/SalesChannels/SalesChannel.js +3 -3
  129. package/build/features/shared/UploadFile/FileUpload.d.ts +3 -1
  130. package/build/features/shared/UploadFile/FileUpload.js +14 -10
  131. package/build/features/shared/UploadFile/UploadWrapper.d.ts +3 -1
  132. package/build/features/shared/UploadFile/UploadWrapper.js +3 -2
  133. package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +2 -1
  134. package/build/features/shared/UploadMultipleFile/UploadFile.js +9 -5
  135. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +2 -1
  136. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +3 -3
  137. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.d.ts +4 -1
  138. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +6 -3
  139. package/build/features/tax/screens/TaxDetails/TaxDetails.js +4 -2
  140. package/build/features/tax/screens/TaxDetails/TaxDocument.d.ts +4 -1
  141. package/build/features/tax/screens/TaxDetails/TaxDocument.js +3 -8
  142. package/build/features/tax/screens/TaxDetails/VATId.d.ts +4 -1
  143. package/build/features/tax/screens/TaxDetails/VATId.js +5 -7
  144. package/build/hooks/index.d.ts +2 -0
  145. package/build/hooks/index.js +2 -0
  146. package/build/hooks/useAppConfig.d.ts +1 -1
  147. package/build/hooks/useAppConfig.js +4 -2
  148. package/build/hooks/useDataNoneEditable.d.ts +2 -0
  149. package/build/hooks/useDataNoneEditable.js +19 -0
  150. package/build/hooks/useFormReadOnly.d.ts +6 -0
  151. package/build/hooks/useFormReadOnly.js +38 -0
  152. package/build/utils/string.js +7 -7
  153. package/package.json +1 -1
  154. package/build/features/brand/screens/BrandActivities/OperationStartDate.d.ts +0 -20
  155. package/build/features/brand/screens/BrandActivities/OperationStartDate.js +0 -45
@@ -51,7 +51,7 @@ var CheckIconStyled = styled(CheckIcon)(function (_a) {
51
51
  });
52
52
  var BirthCountry = React.forwardRef(function (_a, ref) {
53
53
  var _b, _c, _d;
54
- var countries = _a.countries, rest = __rest(_a, ["countries"]);
54
+ var countries = _a.countries, readOnly = _a.readOnly, rest = __rest(_a, ["countries", "readOnly"]);
55
55
  var _e = React.useState(countries), locationCountries = _e[0], setCountries = _e[1];
56
56
  var _f = React.useState(null), anchorEl = _f[0], setAnchorEl = _f[1];
57
57
  var t = useTranslation().t;
@@ -60,6 +60,8 @@ var BirthCountry = React.forwardRef(function (_a, ref) {
60
60
  var placeOfBirthCountryControl = useController({ control: control, name: 'placeOfBirthCountry' });
61
61
  var onOpenCountrySelect = function (event) {
62
62
  var _a;
63
+ if (readOnly)
64
+ return;
63
65
  setAnchorEl(event.currentTarget);
64
66
  (_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
65
67
  };
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  interface BODProps {
3
3
  show: boolean;
4
4
  onDateClicked?: (flag: boolean) => void;
5
+ readOnly?: boolean;
5
6
  }
6
- declare const _default: React.MemoExoticComponent<({ onDateClicked, show }: BODProps) => JSX.Element>;
7
+ declare const _default: React.MemoExoticComponent<({ onDateClicked, show, readOnly }: BODProps) => JSX.Element>;
7
8
  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;
29
+ var onDateClicked = _a.onDateClicked, show = _a.show, readOnly = _a.readOnly;
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, defaultValue: dateValue ? new Date(dateValue) : undefined, dir: 'ltr', locale: 'en', onClick: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true); }, onDatePicked: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(false); }, onDateChange: handleBirthDateChange })] }) })));
44
+ } } }, { children: t('enter_birth_date') })), _jsx(DatePicker, { readOnly: true, disabled: readOnly, defaultValue: dateValue ? new Date(dateValue) : new Date(), dir: 'ltr', locale: 'en', onClick: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true); }, onDatePicked: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(false); }, onDateChange: handleBirthDateChange })] }) })));
45
45
  };
46
46
  export default React.memo(BOD);
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  export interface EmailProps {
3
3
  show: boolean;
4
+ readOnly?: boolean;
4
5
  }
5
- declare const _default: React.MemoExoticComponent<({ show }: EmailProps) => JSX.Element>;
6
+ declare const _default: React.MemoExoticComponent<({ show, readOnly }: EmailProps) => JSX.Element>;
6
7
  export default _default;
@@ -28,15 +28,13 @@ var InputStyled = styled(Input)(function () { return ({
28
28
  }); });
29
29
  var Email = function (_a) {
30
30
  var _b;
31
- var show = _a.show;
31
+ var show = _a.show, readOnly = _a.readOnly;
32
32
  var t = useTranslation().t;
33
33
  var control = useFormContext().control;
34
34
  var emailControl = useController({ name: 'email', control: control });
35
35
  var data = useAppSelector(individualSelector).data;
36
36
  var emailValue = emailControl.field.value;
37
37
  var error = (_b = emailControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
38
- var verify = data.verify;
39
- var user = (verify.responseBody || {}).user;
40
38
  var handleEmailChange = function (event) {
41
39
  emailControl.field.onChange(event.target.value);
42
40
  };
@@ -44,6 +42,6 @@ var Email = function (_a) {
44
42
  emailControl.field.onChange('');
45
43
  };
46
44
  var disabled = false;
47
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(InputStyled, { label: t('signup_email_lable'), value: emailValue, onChange: handleEmailChange, type: 'email', disabled: disabled, placeholder: t('signup_email_placeholder'), warningType: 'alert', warningMessage: error && t(error), endAdornment: !error && emailValue ? _jsx(CheckIcon, {}) : emailValue && _jsx(ClearIcon, { onClick: clearNumber }) }) }) })));
45
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(InputStyled, { readOnly: readOnly, label: t('signup_email_lable'), value: emailValue, onChange: handleEmailChange, type: 'email', disabled: disabled, placeholder: t('signup_email_placeholder'), warningType: 'alert', warningMessage: error && t(error), endAdornment: !error && emailValue ? _jsx(CheckIcon, {}) : emailValue && _jsx(ClearIcon, { onClick: clearNumber }) }) }) })));
48
46
  };
49
47
  export default React.memo(Email);
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  interface ExpiryDateProps {
3
3
  show: boolean;
4
4
  onDateClicked?: (flag: boolean) => void;
5
+ readOnly?: boolean;
5
6
  }
6
- declare const _default: React.MemoExoticComponent<({ onDateClicked, show }: ExpiryDateProps) => JSX.Element>;
7
+ declare const _default: React.MemoExoticComponent<({ onDateClicked, show, readOnly }: ExpiryDateProps) => JSX.Element>;
7
8
  export default _default;
@@ -27,13 +27,12 @@ var InputLabelStyled = styled(Text)(function (_a) {
27
27
  });
28
28
  var ExpiryDate = function (_a) {
29
29
  var _b;
30
- var onDateClicked = _a.onDateClicked, show = _a.show;
30
+ var onDateClicked = _a.onDateClicked, show = _a.show, readOnly = _a.readOnly;
31
31
  var t = useTranslation().t;
32
32
  var control = useFormContext().control;
33
33
  var dispatch = useAppDispatch();
34
34
  var dobControl = useController({ control: control, name: 'expiryDate' });
35
- var _c = useAppSelector(individualSelector), error = _c.error, data = _c.data;
36
- var user = (data.verify.responseBody || {}).user;
35
+ var error = useAppSelector(individualSelector).error;
37
36
  var handleBirthDateChange = function (data) {
38
37
  if (error)
39
38
  dispatch(clearError());
@@ -44,6 +43,6 @@ var ExpiryDate = function (_a) {
44
43
  return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
45
44
  var spacing = _a.spacing;
46
45
  return spacing(2.5, 2.5, 2.5, 2.5);
47
- } } }, { children: t('enter_expiry_date') })), _jsx(DatePicker, { readOnly: true, disabled: disabled, defaultValue: dateValue ? new Date(dateValue) : new Date(), dir: 'ltr', locale: 'en', maxDate: getFutureDate(), onClick: disabled ? undefined : 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 })] }) })));
46
+ } } }, { children: t('enter_expiry_date') })), _jsx(DatePicker, { readOnly: true, disabled: disabled || readOnly, defaultValue: dateValue ? new Date(dateValue) : new Date(), dir: 'ltr', locale: 'en', maxDate: getFutureDate(), onClick: disabled ? undefined : 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 })] }) })));
48
47
  };
49
48
  export default React.memo(ExpiryDate);
@@ -29,6 +29,7 @@ export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledCom
29
29
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
30
30
  declare type GenderProps = {
31
31
  show: boolean;
32
+ readOnly?: boolean;
32
33
  };
33
- declare const Gender: ({ show }: GenderProps) => JSX.Element;
34
+ declare const Gender: ({ show, readOnly }: GenderProps) => JSX.Element;
34
35
  export default Gender;
@@ -67,12 +67,14 @@ export var InfoOutlinedIconStyled = styled(InfoOutlinedIcon)(function (_a) {
67
67
  });
68
68
  });
69
69
  var Gender = function (_a) {
70
- var show = _a.show;
70
+ var show = _a.show, readOnly = _a.readOnly;
71
71
  var t = useTranslation().t;
72
72
  var control = useFormContext().control;
73
73
  var genderControl = useController({ control: control, name: 'gender' });
74
74
  var handleOnChange = function (_a) {
75
75
  var target = _a.target;
76
+ if (readOnly)
77
+ return;
76
78
  genderControl.field.onChange(target.value);
77
79
  };
78
80
  var genderValue = genderControl.field.value;
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  interface IDNumberProps {
3
3
  show: boolean;
4
+ readOnly?: boolean;
4
5
  }
5
- declare const _default: React.MemoExoticComponent<({ show }: IDNumberProps) => JSX.Element>;
6
+ declare const _default: React.MemoExoticComponent<({ show, readOnly }: IDNumberProps) => JSX.Element>;
6
7
  export default _default;
@@ -14,22 +14,17 @@ import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import { removeAllCharsFromNumber } from '../../../../utils';
17
- import { useAppSelector } from '../../../../hooks';
18
17
  import { ID_NUMBER_LENGTH } from '../../../../constants';
19
18
  import Collapse from '../../../../components/Collapse';
20
19
  import { ScreenContainer } from '../../../shared/Containers';
21
20
  import Input from '../../../shared/Input';
22
21
  import ClearIcon from '../../../shared/ClearIcon';
23
22
  import CheckIcon from '../../../shared/CheckIcon';
24
- import { individualSelector } from '../../../app/individual/individualStore';
25
23
  var IDNumber = function (_a) {
26
24
  var _b;
27
- var show = _a.show;
25
+ var show = _a.show, readOnly = _a.readOnly;
28
26
  var t = useTranslation().t;
29
27
  var control = useFormContext().control;
30
- var data = useAppSelector(individualSelector).data;
31
- var verify = data.verify;
32
- var user = (verify.responseBody || {}).user;
33
28
  var nidControl = useController({ control: control, name: 'nid' });
34
29
  var handleIdChange = function (_a) {
35
30
  var target = _a.target;
@@ -42,6 +37,6 @@ var IDNumber = function (_a) {
42
37
  var nidValue = nidControl.field.value;
43
38
  var error = (_b = nidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
44
39
  var disabled = false;
45
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { label: t('enter_national_id'), disabled: disabled, inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment: !error && nidValue ? _jsx(CheckIcon, {}) : nidValue && _jsx(ClearIcon, { onClick: clearIdNumber }), placeholder: '0000000000', warningType: 'alert', warningMessage: error && t(error, { number: '1' }) }) }) })));
40
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { readOnly: readOnly, label: t('enter_national_id'), disabled: disabled, inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment: !error && nidValue ? _jsx(CheckIcon, {}) : nidValue && _jsx(ClearIcon, { onClick: clearIdNumber }), placeholder: '0000000000', warningType: 'alert', warningMessage: error && t(error, { number: '1' }) }) }) })));
46
41
  };
47
42
  export default React.memo(IDNumber);
@@ -129,11 +129,11 @@ var IndividualPersonalInfo = function (_a) {
129
129
  var isBirthCountryListActive = listActive === ListType.BirthCountryList;
130
130
  var isBirthCityListActive = listActive === ListType.BirthCityList;
131
131
  var isNationalityListActive = listActive === ListType.NationalityList;
132
- return (_jsxs(ScreenContainer, { children: [_jsx(Collapse, __assign({ in: showField && !!(user === null || user === void 0 ? void 0 : user.is_authorized), timeout: 500 }, { children: _jsxs(TextBoxStyled, { children: [getUserName() || '', _jsx(RoleTextStyled, { children: getUserOccupation() || '' })] }) })), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Name, { show: showField }), _jsx(MobileNumber, { show: !isDateFieldActive && !isBirthCountryListActive && !isBirthCityListActive && !isNationalityListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.MobileCountryList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(Email, { show: showField }), _jsx(Gender, { show: showField }), _jsx(ID, { show: showField }), _jsx(IssuedCountry, { show: !isMobileCountryListActive && !isDateFieldActive && !isBirthCountryListActive && !isBirthCityListActive && !isNationalityListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.IssuedCountryList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ExpiryDate, { show: !listActive && !dobActive, onDateClicked: handleExpiryDateActive }), _jsx(DOB, { show: !listActive && !expiryDateActive, onDateClicked: handleDobActive }), _jsx(BirthCountry, { show: !isMobileCountryListActive && !isDateFieldActive && !isIssuedCountryListActive && !isBirthCityListActive && !isNationalityListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.BirthCountryList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(BirthCity, { show: !isMobileCountryListActive &&
132
+ return (_jsxs(ScreenContainer, { children: [_jsx(Collapse, __assign({ in: showField && !!(user === null || user === void 0 ? void 0 : user.is_authorized), timeout: 500 }, { children: _jsxs(TextBoxStyled, { children: [getUserName() || '', _jsx(RoleTextStyled, { children: getUserOccupation() || '' })] }) })), _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Box, { children: [_jsx(Name, { show: showField, readOnly: !settingsData.boardMaturity && !!name }), _jsx(MobileNumber, { readOnly: !settingsData.boardMaturity && !!mobile, show: !isDateFieldActive && !isBirthCountryListActive && !isBirthCityListActive && !isNationalityListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.MobileCountryList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(Email, { show: showField, readOnly: !settingsData.boardMaturity && !!email }), _jsx(Gender, { show: showField, readOnly: !settingsData.boardMaturity && !!gender }), _jsx(ID, { show: showField, readOnly: !settingsData.boardMaturity && !!nid }), _jsx(IssuedCountry, { readOnly: !settingsData.boardMaturity && !!issuedCountry, show: !isMobileCountryListActive && !isDateFieldActive && !isBirthCountryListActive && !isBirthCityListActive && !isNationalityListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.IssuedCountryList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(ExpiryDate, { show: !listActive && !dobActive, onDateClicked: handleExpiryDateActive, readOnly: !settingsData.boardMaturity && !!expiryDate }), _jsx(DOB, { show: !listActive && !expiryDateActive, onDateClicked: handleDobActive, readOnly: !settingsData.boardMaturity && !!dob }), _jsx(BirthCountry, { readOnly: !settingsData.boardMaturity && !!placeOfBirthCountry, show: !isMobileCountryListActive && !isDateFieldActive && !isIssuedCountryListActive && !isBirthCityListActive && !isNationalityListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.BirthCountryList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(BirthCity, { readOnly: !settingsData.boardMaturity && !!placeOfBirthCity, show: !isMobileCountryListActive &&
133
133
  !isDateFieldActive &&
134
134
  !isIssuedCountryListActive &&
135
135
  !isBirthCountryListActive &&
136
- !isNationalityListActive, onListOpen: function () { return handleMenuClick(ListType.BirthCityList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(Nationality, { show: !isMobileCountryListActive && !isDateFieldActive && !isIssuedCountryListActive && !isBirthCityListActive && !isBirthCountryListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.NationalityList); }, onListClose: function () { return handleMenuClick(); } })] }), _jsx(Collapse, __assign({ in: showField, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disableBack: !(user === null || user === void 0 ? void 0 : user.is_authorized), disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) }))] }));
136
+ !isNationalityListActive, onListOpen: function () { return handleMenuClick(ListType.BirthCityList); }, onListClose: function () { return handleMenuClick(); } }), _jsx(Nationality, { readOnly: !settingsData.boardMaturity && !!nationality, show: !isMobileCountryListActive && !isDateFieldActive && !isIssuedCountryListActive && !isBirthCityListActive && !isBirthCountryListActive, countries: countries, onListOpen: function () { return handleMenuClick(ListType.NationalityList); }, onListClose: function () { return handleMenuClick(); } })] }), _jsx(Collapse, __assign({ in: showField, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disableBack: !(user === null || user === void 0 ? void 0 : user.is_authorized), disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) }))] }));
137
137
  };
138
- export default React.memo(IndividualPersonalInfo);
139
138
  IndividualPersonalInfo.defaultProps = {};
139
+ export default React.memo(IndividualPersonalInfo);
@@ -5,6 +5,7 @@ interface IssuedCountryProps {
5
5
  show: boolean;
6
6
  onListOpen?: () => void;
7
7
  onListClose?: () => void;
8
+ readOnly?: boolean;
8
9
  }
9
10
  declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<IssuedCountryProps & React.RefAttributes<unknown>>>;
10
11
  export default _default;
@@ -27,14 +27,13 @@ import { useTranslation } from 'react-i18next';
27
27
  import { useController, useFormContext } from 'react-hook-form';
28
28
  import { styled } from '@mui/material/styles';
29
29
  import CheckIcon from '@mui/icons-material/Check';
30
- import { useLanguage, useAppSelector } from '../../../../hooks';
30
+ import { useLanguage } from '../../../../hooks';
31
31
  import Collapse from '../../../../components/Collapse';
32
32
  import ExpandIcon from '../../../../components/ExpandIcon';
33
33
  import Text from '../../../../components/Text';
34
34
  import SimpleList from '../../../../components/SimpleList';
35
35
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
36
36
  import Input from '../../../shared/Input';
37
- import { individualSelector } from '../../../app/individual/individualStore';
38
37
  var CountryItemContainer = styled(Box)(function () { return ({
39
38
  display: 'flex'
40
39
  }); });
@@ -52,19 +51,18 @@ var CheckIconStyled = styled(CheckIcon)(function (_a) {
52
51
  });
53
52
  var IssuedCountry = React.forwardRef(function (_a, ref) {
54
53
  var _b, _c, _d;
55
- var countries = _a.countries, rest = __rest(_a, ["countries"]);
54
+ var countries = _a.countries, readOnly = _a.readOnly, rest = __rest(_a, ["countries", "readOnly"]);
56
55
  var _e = React.useState(countries), locationCountries = _e[0], setCountries = _e[1];
57
56
  var _f = React.useState(null), anchorEl = _f[0], setAnchorEl = _f[1];
58
57
  var t = useTranslation().t;
59
58
  var isAr = useLanguage().isAr;
60
59
  var control = useFormContext().control;
61
- var data = useAppSelector(individualSelector).data;
62
- var verify = data.verify;
63
- var user = (verify.responseBody || {}).user;
64
60
  var issuedCountryControl = useController({ control: control, name: 'issuedCountry' });
65
61
  var disabled = false;
66
62
  var onOpenCountrySelect = function (event) {
67
63
  var _a;
64
+ if (readOnly)
65
+ return;
68
66
  setAnchorEl(event.currentTarget);
69
67
  (_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
70
68
  };
@@ -5,6 +5,7 @@ interface MobileNumberProps {
5
5
  show: boolean;
6
6
  onListOpen?: () => void;
7
7
  onListClose?: () => void;
8
+ readOnly?: boolean;
8
9
  }
9
10
  declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<MobileNumberProps & React.RefAttributes<unknown>>>;
10
11
  export default _default;
@@ -80,7 +80,7 @@ var InputStyled = styled(Input)(function () { return ({
80
80
  }); });
81
81
  var MobileNumber = React.forwardRef(function (_a, ref) {
82
82
  var _b, _c, _d;
83
- var countries = _a.countries, rest = __rest(_a, ["countries"]);
83
+ var countries = _a.countries, readOnly = _a.readOnly, rest = __rest(_a, ["countries", "readOnly"]);
84
84
  var _e = React.useState(countries || []), countriesCode = _e[0], setCountries = _e[1];
85
85
  var _f = React.useState(null), anchorEl = _f[0], setAnchorEl = _f[1];
86
86
  var t = useTranslation().t;
@@ -97,8 +97,6 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
97
97
  var mobileLen = countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.digits;
98
98
  var isStartsWith5 = mobileValue.startsWith('5');
99
99
  var requiredLen = isSA && isStartsWith5 ? mobileLen - 1 : mobileLen;
100
- var verify = data.verify;
101
- var user = (verify.responseBody || {}).user;
102
100
  var disabled = false;
103
101
  React.useEffect(function () {
104
102
  if (mobileValue)
@@ -137,7 +135,7 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
137
135
  setValue('mobile', '');
138
136
  countryCodeControl.field.onChange(country);
139
137
  };
140
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { mb: 3 } }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('signup_enter_mobile') }) }), _jsx(InputStyled, { inputProps: { maxLength: requiredLen }, type: 'tel', disabled: disabled || !!anchorEl, onClick: onCloseCountryList, onChange: onPhoneNumberChange, value: !!anchorEl ? countryName : mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: disabled ? undefined : function () { return toggleCountryList(); } }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), !anchorEl && _jsx(ExpandIconStyled, { anchorEl: !!anchorEl })] })), endAdornment: disabled ? (_jsx(_Fragment, {})) : !!anchorEl ? (_jsx(ExpandIconStyled, { onClick: function () { return toggleCountryList(); }, anchorEl: !!anchorEl })) : !error && mobileValue ? (_jsx(CheckIcon, {})) : (mobileValue && _jsx(ClearIcon, { onClick: clearMobileNumber })), placeholder: "".concat(isSA ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: error && t(error, { length: requiredLen, number: '05|5' }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', searchValuePath: ['name.arabic', 'name.english'], list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
138
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: { mb: 3 } }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('signup_enter_mobile') }) }), _jsx(InputStyled, { readOnly: readOnly, inputProps: { maxLength: requiredLen }, type: 'tel', disabled: disabled || !!anchorEl, onClick: onCloseCountryList, onChange: onPhoneNumberChange, value: !!anchorEl ? countryName : mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: disabled || readOnly ? undefined : function () { return toggleCountryList(); } }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), !anchorEl && _jsx(ExpandIconStyled, { anchorEl: !!anchorEl })] })), endAdornment: disabled ? (_jsx(_Fragment, {})) : !!anchorEl ? (_jsx(ExpandIconStyled, { onClick: function () { return toggleCountryList(); }, anchorEl: !!anchorEl })) : !error && mobileValue ? (_jsx(CheckIcon, {})) : (mobileValue && _jsx(ClearIcon, { onClick: clearMobileNumber })), placeholder: "".concat(isSA ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: error && t(error, { length: requiredLen, number: '05|5' }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', searchValuePath: ['name.arabic', 'name.english'], list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
141
139
  return (_jsxs(_Fragment, { children: [_jsxs(CountryItemContainer, { children: [_jsxs(CountryCodeText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: ["+", item.idd_prefix] })), _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english }))] }), item.idd_prefix === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) && _jsx(CheckIcon, {})] }));
142
140
  } }) }))] })) })));
143
141
  });
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  export interface NameProps {
3
3
  show: boolean;
4
+ readOnly?: boolean;
4
5
  }
5
- declare const _default: React.MemoExoticComponent<({ show }: NameProps) => JSX.Element>;
6
+ declare const _default: React.MemoExoticComponent<({ show, readOnly }: NameProps) => JSX.Element>;
6
7
  export default _default;
@@ -29,7 +29,7 @@ var InputStyled = styled(Input)(function () { return ({
29
29
  }); });
30
30
  var Name = function (_a) {
31
31
  var _b;
32
- var show = _a.show;
32
+ var show = _a.show, readOnly = _a.readOnly;
33
33
  var t = useTranslation().t;
34
34
  var control = useFormContext().control;
35
35
  var nameControl = useController({ name: 'name', control: control });
@@ -46,6 +46,6 @@ var Name = function (_a) {
46
46
  var clearNumber = function () {
47
47
  nameControl.field.onChange('');
48
48
  };
49
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mb: 3, mt: 2.5 } }, { children: _jsx(InputStyled, { label: t('signup_merchant_name_label'), value: nameValue, disabled: disabled, onChange: handleNameChange, placeholder: t('signup_merchant_name_label'), warningType: 'alert', warningMessage: error && t(error), endAdornment: !error && nameValue ? _jsx(CheckIcon, {}) : nameValue && _jsx(ClearIcon, { onClick: clearNumber }) }) })) })));
49
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, __assign({ sx: { mb: 3, mt: 2.5 } }, { children: _jsx(InputStyled, { readOnly: readOnly, label: t('signup_merchant_name_label'), value: nameValue, disabled: disabled, onChange: handleNameChange, placeholder: t('signup_merchant_name_label'), warningType: 'alert', warningMessage: error && t(error), endAdornment: !error && nameValue ? _jsx(CheckIcon, {}) : nameValue && _jsx(ClearIcon, { onClick: clearNumber }) }) })) })));
50
50
  };
51
51
  export default React.memo(Name);
@@ -5,6 +5,7 @@ interface NationalityProps {
5
5
  show: boolean;
6
6
  onListOpen?: () => void;
7
7
  onListClose?: () => void;
8
+ readOnly?: boolean;
8
9
  }
9
10
  declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<NationalityProps & React.RefAttributes<unknown>>>;
10
11
  export default _default;
@@ -27,14 +27,13 @@ import { useTranslation } from 'react-i18next';
27
27
  import { useController, useFormContext } from 'react-hook-form';
28
28
  import { styled } from '@mui/material/styles';
29
29
  import CheckIcon from '@mui/icons-material/Check';
30
- import { useLanguage, useAppSelector } from '../../../../hooks';
30
+ import { useLanguage } from '../../../../hooks';
31
31
  import Collapse from '../../../../components/Collapse';
32
32
  import ExpandIcon from '../../../../components/ExpandIcon';
33
33
  import Text from '../../../../components/Text';
34
34
  import SimpleList from '../../../../components/SimpleList';
35
35
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
36
36
  import Input from '../../../shared/Input';
37
- import { individualSelector } from '../../../app/individual/individualStore';
38
37
  var CountryItemContainer = styled(Box)(function () { return ({
39
38
  display: 'flex'
40
39
  }); });
@@ -52,19 +51,18 @@ var CheckIconStyled = styled(CheckIcon)(function (_a) {
52
51
  });
53
52
  var Nationality = React.forwardRef(function (_a, ref) {
54
53
  var _b, _c, _d;
55
- var countries = _a.countries, rest = __rest(_a, ["countries"]);
54
+ var countries = _a.countries, readOnly = _a.readOnly, rest = __rest(_a, ["countries", "readOnly"]);
56
55
  var _e = React.useState(countries), locationCountries = _e[0], setCountries = _e[1];
57
56
  var _f = React.useState(null), anchorEl = _f[0], setAnchorEl = _f[1];
58
57
  var t = useTranslation().t;
59
58
  var isAr = useLanguage().isAr;
60
59
  var control = useFormContext().control;
61
- var data = useAppSelector(individualSelector).data;
62
- var verify = data.verify;
63
- var user = (verify.responseBody || {}).user;
64
60
  var nationalityControl = useController({ control: control, name: 'nationality' });
65
61
  var disabled = false;
66
62
  var onOpenCountrySelect = function (event) {
67
63
  var _a;
64
+ if (readOnly)
65
+ return;
68
66
  setAnchorEl(event.currentTarget);
69
67
  (_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
70
68
  };
@@ -7,6 +7,7 @@ interface MobileNumberProps {
7
7
  onListOpen?: () => void;
8
8
  onListClose?: () => void;
9
9
  sx?: SxProps<Theme>;
10
+ readOnly?: boolean;
10
11
  }
11
12
  declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<MobileNumberProps & React.RefAttributes<unknown>>>;
12
13
  export default _default;
@@ -80,7 +80,7 @@ var InputStyled = styled(Input)(function () { return ({
80
80
  }); });
81
81
  var MobileNumber = React.forwardRef(function (_a, ref) {
82
82
  var _b, _c, _d;
83
- var countries = _a.countries, sx = _a.sx, rest = __rest(_a, ["countries", "sx"]);
83
+ var countries = _a.countries, sx = _a.sx, readOnly = _a.readOnly, rest = __rest(_a, ["countries", "sx", "readOnly"]);
84
84
  var _e = React.useState(countries || []), countriesCode = _e[0], setCountries = _e[1];
85
85
  var _f = React.useState(null), anchorEl = _f[0], setAnchorEl = _f[1];
86
86
  var t = useTranslation().t;
@@ -98,7 +98,6 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
98
98
  var isStartsWith5 = mobileValue.startsWith('5');
99
99
  var requiredLen = isSA && isStartsWith5 ? mobileLen - 1 : mobileLen;
100
100
  var verify = data.verify;
101
- var user = (verify.responseBody || {}).user;
102
101
  React.useEffect(function () {
103
102
  if (mobileValue)
104
103
  setValue('mobile', mobileValue, { shouldValidate: true });
@@ -136,7 +135,11 @@ var MobileNumber = React.forwardRef(function (_a, ref) {
136
135
  setValue('mobile', '');
137
136
  countryCodeControl.field.onChange(country);
138
137
  };
139
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: sx }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('signup_enter_mobile') }) }), _jsx(InputStyled, { inputProps: { maxLength: requiredLen }, type: 'tel', disabled: !!anchorEl, onClick: onCloseCountryList, onChange: onPhoneNumberChange, value: !!anchorEl ? countryName : mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: function () { return toggleCountryList(); } }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), !anchorEl && _jsx(ExpandIconStyled, { anchorEl: !!anchorEl })] })), endAdornment: !!anchorEl ? (_jsx(ExpandIconStyled, { onClick: function () { return toggleCountryList(); }, anchorEl: !!anchorEl })) : !error && mobileValue ? (_jsx(CheckIcon, {})) : (mobileValue && _jsx(ClearIcon, { onClick: clearMobileNumber })), placeholder: "".concat(isSA ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: error && t(error, { length: requiredLen, number: '05|5' }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', searchValuePath: ['name.arabic', 'name.english'], list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
138
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, __assign({ ref: ref, sx: sx }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('signup_enter_mobile') }) }), _jsx(InputStyled, { readOnly: readOnly, inputProps: { maxLength: requiredLen }, type: 'tel', disabled: !!anchorEl, onClick: onCloseCountryList, onChange: onPhoneNumberChange, value: !!anchorEl ? countryName : mobileValue, startAdornment: _jsxs(CountryCodeStyled, __assign({ onClick: function () {
139
+ if (readOnly)
140
+ return;
141
+ toggleCountryList();
142
+ } }, { children: ["+".concat(countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix), !anchorEl && _jsx(ExpandIconStyled, { anchorEl: !!anchorEl })] })), endAdornment: !!anchorEl ? (_jsx(ExpandIconStyled, { onClick: function () { return toggleCountryList(); }, anchorEl: !!anchorEl })) : !error && mobileValue ? (_jsx(CheckIcon, {})) : (mobileValue && _jsx(ClearIcon, { onClick: clearMobileNumber })), placeholder: "".concat(isSA ? '5' : '0', "00000000"), warningType: 'alert', warningMessage: error && t(error, { length: requiredLen, number: '05|5' }) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.english', searchValuePath: ['name.arabic', 'name.english'], list: countriesCode, onSelectItem: onSelectItem, renderItem: function (item) {
140
143
  return (_jsxs(_Fragment, { children: [_jsxs(CountryItemContainer, { children: [_jsxs(CountryCodeText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: ["+", item.idd_prefix] })), _jsx(CountryNameText, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.idd_prefix) === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) }, { children: isAr ? item.name.arabic : item.name.english }))] }), item.idd_prefix === (countryCodeValue === null || countryCodeValue === void 0 ? void 0 : countryCodeValue.idd_prefix) && _jsx(CheckIcon, {})] }));
141
144
  } }) }))] })) })));
142
145
  });
@@ -55,6 +55,6 @@ var PhoneInfo = function (_a) {
55
55
  dispatch(clearError());
56
56
  }, [methods.formState.isValid]);
57
57
  var disabled = !methods.formState.isValid || !!error;
58
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(MobileNumber, { show: true, sx: { mb: 7.5 }, countries: countries, onListOpen: function () { return setListActive(true); }, onListClose: function () { return setListActive(false); } }), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
58
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(MobileNumber, { readOnly: !settingsData.boardMaturity && !!mobile, show: true, sx: { mb: 7.5 }, countries: countries, onListOpen: function () { return setListActive(true); }, onListClose: function () { return setListActive(false); } }), _jsx(Collapse, __assign({ in: !listActive }, { children: _jsx(Button, __assign({ disableBack: true, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
59
59
  };
60
60
  export default React.memo(PhoneInfo);
@@ -6,6 +6,7 @@ interface SaleChannelIconsInputProps {
6
6
  selectedIconId: string;
7
7
  onChangeValue: (val: string, id: string) => void;
8
8
  error: string | undefined;
9
+ readOnly?: boolean;
9
10
  }
10
- export default function SaleChannelIconsInput({ selectedChannels, onSelectIcon, selectedIconId, onChangeValue, error }: SaleChannelIconsInputProps): JSX.Element;
11
+ export default function SaleChannelIconsInput({ selectedChannels, onSelectIcon, selectedIconId, onChangeValue, error, readOnly }: SaleChannelIconsInputProps): JSX.Element;
11
12
  export {};
@@ -67,7 +67,7 @@ var SocialMediaButtonStyled = styled(ToggleButton, {
67
67
  });
68
68
  });
69
69
  export default function SaleChannelIconsInput(_a) {
70
- var selectedChannels = _a.selectedChannels, onSelectIcon = _a.onSelectIcon, selectedIconId = _a.selectedIconId, onChangeValue = _a.onChangeValue, error = _a.error;
70
+ var selectedChannels = _a.selectedChannels, onSelectIcon = _a.onSelectIcon, selectedIconId = _a.selectedIconId, onChangeValue = _a.onChangeValue, error = _a.error, readOnly = _a.readOnly;
71
71
  var isAr = useLanguage().isAr;
72
72
  var t = useTranslation().t;
73
73
  var getPlaceHolder = function (item) {
@@ -90,10 +90,10 @@ export default function SaleChannelIconsInput(_a) {
90
90
  var isActive = selectedIconId === channel.id;
91
91
  return ((_a = channel.sub) === null || _a === void 0 ? void 0 : _a.length) ? (channel.sub.map(function (sub, subIndex) {
92
92
  var isSubActive = selectedIconId === sub.id;
93
- return (_jsx(Collapse, __assign({ in: isSubActive, timeout: 300 }, { children: _jsx(InputStyled, { onChange: function (e) {
93
+ return (_jsx(Collapse, __assign({ in: isSubActive, timeout: 300 }, { children: _jsx(InputStyled, { readOnly: readOnly, onChange: function (e) {
94
94
  onChangeValue(e.target.value, sub.id);
95
95
  }, value: sub.address || '', startAdornment: _jsx(TextStyled, __assign({ sx: __assign({}, (isTwitter(sub.code) && { fontSize: '20px' })) }, { children: isWebsite(sub.code) ? "https://www." : isTwitter(sub.code) ? "@" : '' })), placeholder: t(getPlaceHolder(sub)) }) }), "sub_".concat(subIndex)));
96
- })) : (_jsx(Collapse, __assign({ in: isActive, timeout: 300 }, { children: _jsx(InputStyled, { onChange: function (e) {
96
+ })) : (_jsx(Collapse, __assign({ in: isActive, timeout: 300 }, { children: _jsx(InputStyled, { readOnly: readOnly, onChange: function (e) {
97
97
  onChangeValue(e.target.value, channel.id);
98
98
  }, value: channel.address || '', startAdornment: _jsx(TextStyled, __assign({ sx: __assign({}, (isTwitter(channel.code) && { fontSize: '20px' })) }, { children: isWebsite(channel.code) ? "https://www." : isTwitter(channel.code) ? "@" : '' })), placeholder: t(getPlaceHolder(channel)) }) }), index));
99
99
  }), _jsx(Collapse, __assign({ in: !!(error && error !== 'choose_atleast_one_channel') }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(error) })) }))] })) })));
@@ -7,6 +7,7 @@ interface SalesChannelProps {
7
7
  defaultValue?: SaleChannel[];
8
8
  selectFirstIconListener?: string | number | boolean;
9
9
  disabled?: boolean;
10
+ readOnly?: boolean;
10
11
  }
11
- declare const _default: React.MemoExoticComponent<({ list, onChange, error, disabled, defaultValue, selectFirstIconListener }: SalesChannelProps) => JSX.Element>;
12
+ declare const _default: React.MemoExoticComponent<({ list, onChange, error, disabled, readOnly, defaultValue, selectFirstIconListener }: SalesChannelProps) => JSX.Element>;
12
13
  export default _default;
@@ -74,7 +74,7 @@ var CollapseStyled = styled(Collapse)(function (_a) {
74
74
  });
75
75
  });
76
76
  var SalesChannel = function (_a) {
77
- var _b = _a.list, list = _b === void 0 ? [] : _b, onChange = _a.onChange, error = _a.error, disabled = _a.disabled, _c = _a.defaultValue, defaultValue = _c === void 0 ? [] : _c, _d = _a.selectFirstIconListener, selectFirstIconListener = _d === void 0 ? '' : _d;
77
+ var _b = _a.list, list = _b === void 0 ? [] : _b, onChange = _a.onChange, error = _a.error, disabled = _a.disabled, readOnly = _a.readOnly, _c = _a.defaultValue, defaultValue = _c === void 0 ? [] : _c, _d = _a.selectFirstIconListener, selectFirstIconListener = _d === void 0 ? '' : _d;
78
78
  var _e = React.useState(''), activeSaleIconId = _e[0], setActiveSaleIconId = _e[1];
79
79
  var _f = React.useState([]), selectedSalas = _f[0], setSelectedSales = _f[1];
80
80
  var t = useTranslation().t;
@@ -143,7 +143,7 @@ var SalesChannel = function (_a) {
143
143
  }, [selectFirstIconListener]);
144
144
  return (_jsxs(_Fragment, { children: [_jsxs(Box, __assign({ sx: { mb: 3 } }, { children: [_jsxs(InputLabelStyled, { children: [t('channel_of_service'), " ", _jsx(MandatoryStyled, { children: "*" })] }), list.map(function (channel, index) {
145
145
  var _a, _b;
146
- return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id, disableRipple: true, disabled: disabled, disableFocusRipple: true, focusRipple: false, checked: isChecked(channel.id), onChange: function () { return onSelectSalesChannel(channel); } }), _jsxs(TextStyled, { children: [isAr ? (_a = channel === null || channel === void 0 ? void 0 : channel.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = channel === null || channel === void 0 ? void 0 : channel.name) === null || _b === void 0 ? void 0 : _b.en, " "] })] }, "".concat(channel.id, "-indx").concat(index)));
147
- }), _jsx(CollapseStyled, __assign({ in: error === 'choose_atleast_one_channel' }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(error) })) }))] }), 'salesChannels'), _jsx(SaleChannelIconsInput, { error: error, selectedIconId: activeSaleIconId, onSelectIcon: onChangeActiveSaleIcon, onChangeValue: onValueChange, selectedChannels: selectedSalas }, 'saleChannelIconsInput')] }));
146
+ return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id, disableRipple: true, disabled: disabled || readOnly, disableFocusRipple: true, focusRipple: false, checked: isChecked(channel.id), onChange: function () { return onSelectSalesChannel(channel); } }), _jsxs(TextStyled, { children: [isAr ? (_a = channel === null || channel === void 0 ? void 0 : channel.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = channel === null || channel === void 0 ? void 0 : channel.name) === null || _b === void 0 ? void 0 : _b.en, " "] })] }, "".concat(channel.id, "-indx").concat(index)));
147
+ }), _jsx(CollapseStyled, __assign({ in: error === 'choose_atleast_one_channel' }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(error) })) }))] }), 'salesChannels'), _jsx(SaleChannelIconsInput, { readOnly: readOnly, error: error, selectedIconId: activeSaleIconId, onSelectIcon: onChangeActiveSaleIcon, onChangeValue: onValueChange, selectedChannels: selectedSalas }, 'saleChannelIconsInput')] }));
148
148
  };
149
149
  export default React.memo(SalesChannel);
@@ -24,6 +24,8 @@ export declare type FileUploadProps = {
24
24
  sx?: SxProps<Theme> | undefined;
25
25
  isSubmitting?: boolean;
26
26
  initialFileId?: string;
27
+ validFileFormats?: Array<string>;
28
+ readOnly?: boolean;
27
29
  };
28
- declare const FileUpload: ({ key, show, title, file, uploadedFile, onSuccess, onDelete, onUpdate, sx, purpose, isSubmitting, fileRemoveType, initialFileId }: FileUploadProps) => JSX.Element;
30
+ declare const FileUpload: ({ key, show, title, file, uploadedFile, onSuccess, onDelete, onUpdate, sx, purpose, isSubmitting, fileRemoveType, initialFileId, validFileFormats, readOnly }: FileUploadProps) => JSX.Element;
29
31
  export default FileUpload;
@@ -64,9 +64,9 @@ var BoxStyled = styled(Box)(function (_a) {
64
64
  var theme = _a.theme;
65
65
  return (__assign(__assign({ direction: theme.direction }, theme.typography.subtitle2), { color: theme.palette.primary.main, fontWeight: theme.typography.fontWeightBold, background: theme.palette.background.default, padding: theme.spacing(0, 2.5, 0), width: '88%', wordBreak: 'break-all', display: 'flex', justifyContent: 'space-between' }));
66
66
  });
67
- var UploadBoxStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'uploading'; } })(function (_a) {
68
- var theme = _a.theme, uploading = _a.uploading;
69
- return (__assign(__assign({}, theme.typography.caption), { background: uploading ? alpha(theme.palette.primary.main, 0.5) : theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular, cursor: 'pointer', width: '12%', display: 'flex', justifyContent: 'center', alignItems: 'center' }));
67
+ var UploadBoxStyled = styled(Box, { shouldForwardProp: function (prop) { return !['uploading', 'readOnly'].includes(prop.toString()); } })(function (_a) {
68
+ var theme = _a.theme, uploading = _a.uploading, readOnly = _a.readOnly;
69
+ return (__assign(__assign(__assign({}, theme.typography.caption), { background: theme.palette.primary.main, color: theme.palette.common.white, fontWeight: theme.typography.fontWeightRegular, cursor: 'pointer', width: '12%', display: 'flex', justifyContent: 'center', alignItems: 'center' }), ((readOnly || uploading) && { background: alpha(theme.palette.primary.main, 0.5), cursor: 'default' })));
70
70
  });
71
71
  var ClearIconStyled = styled(ClearIcon)(function (_a) {
72
72
  var theme = _a.theme;
@@ -108,11 +108,11 @@ var WarningContainer = styled(Box)(function (_a) {
108
108
  return (__assign({ background: alpha(theme.palette.warning.main, 0.1), paddingBlock: theme.spacing(1.5), paddingInlineStart: theme.spacing(2.5), flexDirection: 'row', display: 'flex', justifyContent: 'center', color: theme.palette.warning.light, padding: theme.spacing(0.5, 1), borderRadius: '101px', alignItems: 'center', marginTop: theme.spacing(1.25) }, theme.typography.caption));
109
109
  });
110
110
  var FileUpload = function (_a) {
111
- var key = _a.key, show = _a.show, title = _a.title, file = _a.file, uploadedFile = _a.uploadedFile, onSuccess = _a.onSuccess, onDelete = _a.onDelete, onUpdate = _a.onUpdate, sx = _a.sx, purpose = _a.purpose, isSubmitting = _a.isSubmitting, fileRemoveType = _a.fileRemoveType, initialFileId = _a.initialFileId;
111
+ var key = _a.key, show = _a.show, title = _a.title, file = _a.file, uploadedFile = _a.uploadedFile, onSuccess = _a.onSuccess, onDelete = _a.onDelete, onUpdate = _a.onUpdate, sx = _a.sx, purpose = _a.purpose, isSubmitting = _a.isSubmitting, fileRemoveType = _a.fileRemoveType, initialFileId = _a.initialFileId, _b = _a.validFileFormats, validFileFormats = _b === void 0 ? VALID_FILE_FORMATS : _b, readOnly = _a.readOnly;
112
112
  var theme = useTheme();
113
113
  var t = useTranslation().t;
114
- var _b = file || {}, name = _b.name, size = _b.size, type = _b.type;
115
- var _c = uploadedFile || {}, status = _c.status, progress = _c.progress, error = _c.error, fileId = _c.fileId, deleteStatus = _c.deleteStatus;
114
+ var _c = file || {}, name = _c.name, size = _c.size, type = _c.type;
115
+ var _d = uploadedFile || {}, status = _d.status, progress = _d.progress, error = _d.error, fileId = _d.fileId, deleteStatus = _d.deleteStatus, docId = _d.docId;
116
116
  var uploadFile = function () { return __awaiter(void 0, void 0, void 0, function () {
117
117
  var uploadPayload, onUploadProgress, data, fileId;
118
118
  return __generator(this, function (_a) {
@@ -188,7 +188,7 @@ var FileUpload = function (_a) {
188
188
  onUpdate(uploadedFile, true);
189
189
  if (!(fileRemoveType === FileRemoveType.AOA_FILE_ID)) return [3, 2];
190
190
  payload = (_b = {
191
- id: uploadedFile.docId
191
+ id: docId
192
192
  },
193
193
  _b[fileRemoveType] = '',
194
194
  _b);
@@ -217,7 +217,7 @@ var FileUpload = function (_a) {
217
217
  });
218
218
  }); };
219
219
  var handleDeleteFile = function () {
220
- if (initialFileId === uploadedFile.fileId) {
220
+ if (initialFileId === uploadedFile.fileId && docId) {
221
221
  deleteFile();
222
222
  return;
223
223
  }
@@ -237,7 +237,7 @@ var FileUpload = function (_a) {
237
237
  React.useEffect(function () {
238
238
  if (!file)
239
239
  return;
240
- else if (!VALID_FILE_FORMATS.includes(type)) {
240
+ else if (!validFileFormats.includes(type)) {
241
241
  uploadedFile = __assign(__assign({}, uploadedFile), { status: FileStatus.ERROR, error: t('file_not_supported_alert') });
242
242
  onUpdate(uploadedFile, false);
243
243
  }
@@ -258,6 +258,10 @@ var FileUpload = function (_a) {
258
258
  flexDirection: 'column',
259
259
  padding: theme.spacing(1.5, 0, 1.5),
260
260
  width: '100%'
261
- } }, { children: [_jsxs(Box, __assign({ sx: { display: 'flex', flexDirection: 'row', cursor: canDownloadFile ? 'pointer' : 'auto' }, onClick: canDownloadFile ? function () { return downloadFile(); } : undefined }, { children: [_jsx(Icon, { src: ICONS_NAMES.DOC_ICON }), _jsx(Text, { children: name && maskFileName(name) })] })), _jsx(Box, __assign({ sx: { display: 'flex', flexDirection: 'row', justifyContent: 'center' } }, { children: _jsx(Collapse, __assign({ in: !!error, timeout: 400 }, { children: _jsxs(WarningContainer, { children: [_jsx(WarningIconStyled, { src: ICONS_NAMES.WARNING_ICON }), _jsx(Text, { children: t(error) })] }) })) }))] })), _jsx(ProgressBoxStyled, { children: getProgressComponent() })] }), _jsx(UploadBoxStyled, __assign({ uploading: status === FileStatus.UPLOADING || status === FileStatus.DOWNLOADING, onClick: canDeleteFile ? function () { return handleDeleteFile(); } : undefined }, { children: deleteStatus === DeleteFileStatus.DELETING ? (_jsx(MUICircularProgress, { size: 25, thickness: 5, sx: { color: theme.palette.common.white } })) : (_jsx(ClearIconStyled, {})) }))] })) }), key) })));
261
+ } }, { children: [_jsxs(Box, __assign({ sx: { display: 'flex', flexDirection: 'row', cursor: canDownloadFile ? 'pointer' : 'auto' }, onClick: canDownloadFile ? function () { return downloadFile(); } : undefined }, { children: [_jsx(Icon, { src: ICONS_NAMES.DOC_ICON }), _jsx(Text, { children: name && maskFileName(name) })] })), _jsx(Box, __assign({ sx: { display: 'flex', flexDirection: 'row', justifyContent: 'center' } }, { children: _jsx(Collapse, __assign({ in: !!error, timeout: 400 }, { children: _jsxs(WarningContainer, { children: [_jsx(WarningIconStyled, { src: ICONS_NAMES.WARNING_ICON }), _jsx(Text, { children: t(error) })] }) })) }))] })), _jsx(ProgressBoxStyled, { children: getProgressComponent() })] }), _jsx(UploadBoxStyled, __assign({ readOnly: readOnly, uploading: status === FileStatus.UPLOADING || status === FileStatus.DOWNLOADING, onClick: function () {
262
+ if (readOnly)
263
+ return;
264
+ canDeleteFile && handleDeleteFile();
265
+ } }, { children: deleteStatus === DeleteFileStatus.DELETING ? (_jsx(MUICircularProgress, { size: 25, thickness: 5, sx: { color: theme.palette.common.white } })) : (_jsx(ClearIconStyled, {})) }))] })) }), key) })));
262
266
  };
263
267
  export default FileUpload;
@@ -28,6 +28,8 @@ interface UploadWrapperProps {
28
28
  fileUploadingStatus?: (uploading: boolean) => void;
29
29
  onDeleteFile: () => void;
30
30
  defaultFile?: FileDetails;
31
+ validFileFormats?: Array<string>;
32
+ readOnly?: boolean;
31
33
  }
32
- declare const _default: React.MemoExoticComponent<({ id, label, control, required, fileRemoveType, title, subTitle, dragDescription, uploadingTitle, successTitle, isSubmitting, onFileUploaded, fileUploadingStatus, onDeleteFile, purpose, fileTitle, defaultFile }: UploadWrapperProps) => JSX.Element>;
34
+ declare const _default: React.MemoExoticComponent<({ id, label, control, required, fileRemoveType, title, subTitle, dragDescription, uploadingTitle, successTitle, isSubmitting, onFileUploaded, fileUploadingStatus, onDeleteFile, purpose, fileTitle, defaultFile, validFileFormats, readOnly }: UploadWrapperProps) => JSX.Element>;
33
35
  export default _default;