@adyen/kyc-components 3.20.1 → 3.20.2
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.
- package/dist/es/adyen-kyc-components.es.js +279 -286
- package/dist/types/components/Dropins/RoleAndTypeDropin/components/RoleAndTypeDropinComponent.d.ts +1 -1
- package/dist/types/components/Dropins/RoleAndTypeDropin/types.d.ts +2 -0
- package/dist/types/components/TrustRoleAndEntityType/types.d.ts +1 -0
- package/dist/types/components/internal/LegalCompanyNameField/fieldConfig.d.ts +9 -0
- package/dist/types/core/hooks/useForm/types.d.ts +1 -0
- package/package.json +1 -1
- package/dist/types/components/internal/LegalCompanyNameField/validate.d.ts +0 -3
- package/dist/types/components/internal/StateField/validate.d.ts +0 -3
|
@@ -931,7 +931,8 @@ const legalCompanyName__US = "Legal name";
|
|
|
931
931
|
const legalCompanyName__helperText = "Enter the name exactly as it is on your company's official registration documents.";
|
|
932
932
|
const legalCompanyName__helperText__AU = "Enter the name exactly as it is on your Australian Securities and Investment Commission's (ASIC).";
|
|
933
933
|
const legalCompanyName__helperText__NL = "Enter the name exactly as it is on your Chamber of Commerce registration.";
|
|
934
|
-
const legalCompanyName__helperText__US = "
|
|
934
|
+
const legalCompanyName__helperText__US = "Enter the name exactly as it appears on your Secretary of State Registration.";
|
|
935
|
+
const legalCompanyName__helperText__US__business = "The legal name is used to identify a business with the government. This information came from a trusted data source and can not be edited.";
|
|
935
936
|
const legalCompanyName__helperText__PR = "Enter the name exactly as it appears on your Department of State Registration.";
|
|
936
937
|
const legalCompanyName__helperText__SG = "Enter the name exactly as it is on your Accounting and Corporate Regulatory Authority (ACRA) BizFile.";
|
|
937
938
|
const legalCompanyName__helperText__HK = "Enter the name exactly as it is on your Hong Kong Companies Registry's Certificate of Incorporation.";
|
|
@@ -2285,6 +2286,7 @@ const defaultTrans = {
|
|
|
2285
2286
|
legalCompanyName__helperText__AU,
|
|
2286
2287
|
legalCompanyName__helperText__NL,
|
|
2287
2288
|
legalCompanyName__helperText__US,
|
|
2289
|
+
legalCompanyName__helperText__US__business,
|
|
2288
2290
|
legalCompanyName__helperText__PR,
|
|
2289
2291
|
legalCompanyName__helperText__SG,
|
|
2290
2292
|
legalCompanyName__helperText__HK,
|
|
@@ -4332,6 +4334,15 @@ function useForm({
|
|
|
4332
4334
|
fieldProblems: state2.fieldProblems
|
|
4333
4335
|
};
|
|
4334
4336
|
}
|
|
4337
|
+
const resolveFieldMetadata = (countryEntry, params, defaultMetadata) => {
|
|
4338
|
+
if (typeof countryEntry === "object") {
|
|
4339
|
+
return countryEntry;
|
|
4340
|
+
}
|
|
4341
|
+
if (typeof countryEntry === "function") {
|
|
4342
|
+
return countryEntry(params);
|
|
4343
|
+
}
|
|
4344
|
+
return defaultMetadata;
|
|
4345
|
+
};
|
|
4335
4346
|
function useDataset(datasetIdentifier2, skip) {
|
|
4336
4347
|
const {
|
|
4337
4348
|
i18n
|
|
@@ -5387,189 +5398,6 @@ function LegalCompanyNameField({
|
|
|
5387
5398
|
})
|
|
5388
5399
|
});
|
|
5389
5400
|
}
|
|
5390
|
-
const Disclaimer = ({
|
|
5391
|
-
title,
|
|
5392
|
-
children
|
|
5393
|
-
}) => jsxs("div", {
|
|
5394
|
-
className: "adyen-kyc-disclaimer-container",
|
|
5395
|
-
children: [jsx("div", {
|
|
5396
|
-
className: "adyen-kyc-disclaimer__title",
|
|
5397
|
-
children: title
|
|
5398
|
-
}), jsx("div", {
|
|
5399
|
-
className: "adyen-kyc-disclaimer__content",
|
|
5400
|
-
children
|
|
5401
|
-
})]
|
|
5402
|
-
});
|
|
5403
|
-
const PatriotActDisclosure = () => {
|
|
5404
|
-
const {
|
|
5405
|
-
i18n
|
|
5406
|
-
} = useI18nContext();
|
|
5407
|
-
return jsxs(Disclaimer, {
|
|
5408
|
-
title: i18n.get("patriotActDisclosureTitle"),
|
|
5409
|
-
children: [jsx("p", {
|
|
5410
|
-
children: i18n.get("patriotActDisclosureTextParagraph1")
|
|
5411
|
-
}), jsx("p", {
|
|
5412
|
-
children: i18n.get("patriotActDisclosureTextParagraph2")
|
|
5413
|
-
})]
|
|
5414
|
-
});
|
|
5415
|
-
};
|
|
5416
|
-
const companyCountryValidationRules = {
|
|
5417
|
-
country: {
|
|
5418
|
-
modes: ["blur"],
|
|
5419
|
-
validate: (companyCountry) => !isEmpty(companyCountry),
|
|
5420
|
-
errorMessage: "fieldIsRequired"
|
|
5421
|
-
},
|
|
5422
|
-
legalCompanyName: {
|
|
5423
|
-
modes: ["blur"],
|
|
5424
|
-
validate: (legalCompanyName2) => !isEmpty(legalCompanyName2),
|
|
5425
|
-
errorMessage: "fieldIsRequired"
|
|
5426
|
-
},
|
|
5427
|
-
countryOfGoverningLaw: {
|
|
5428
|
-
modes: ["blur"],
|
|
5429
|
-
validate: (countryOfGoverningLaw2) => !isEmpty(countryOfGoverningLaw2),
|
|
5430
|
-
errorMessage: "fieldIsRequired"
|
|
5431
|
-
}
|
|
5432
|
-
};
|
|
5433
|
-
const countryWithGoverningLawFields = [...LEGAL_COMPANY_NAME_FIELD, ...COUNTRY_FIELD, ...COUNTRY_OF_GOVERNING_LAW_FIELD];
|
|
5434
|
-
const companyNameAndCountryFields = [...LEGAL_COMPANY_NAME_FIELD, ...COUNTRY_FIELD];
|
|
5435
|
-
function CompanyNameAndCountry(props) {
|
|
5436
|
-
const {
|
|
5437
|
-
i18n
|
|
5438
|
-
} = useI18nContext();
|
|
5439
|
-
const {
|
|
5440
|
-
isSettingEnabled
|
|
5441
|
-
} = useSettingsContext();
|
|
5442
|
-
const {
|
|
5443
|
-
id: id2,
|
|
5444
|
-
isTopLevelEntity
|
|
5445
|
-
} = props;
|
|
5446
|
-
const allowedCountries = useAllowedCountries();
|
|
5447
|
-
const {
|
|
5448
|
-
isExperimentEnabled
|
|
5449
|
-
} = useExperimentsContext();
|
|
5450
|
-
const {
|
|
5451
|
-
sliceData,
|
|
5452
|
-
updateStateSlice
|
|
5453
|
-
} = useGlobalDataSlice(id2);
|
|
5454
|
-
const schemaWithGoverningLaw = (sliceData == null ? void 0 : sliceData.country) === "GB" && (sliceData == null ? void 0 : sliceData.differentCountryOfGoverningLaw) ? countryWithGoverningLawFields : companyNameAndCountryFields;
|
|
5455
|
-
const {
|
|
5456
|
-
data: formData,
|
|
5457
|
-
valid: formValid,
|
|
5458
|
-
errors: formErrors,
|
|
5459
|
-
fieldProblems: formFieldProblems,
|
|
5460
|
-
handleChangeFor
|
|
5461
|
-
} = useForm({
|
|
5462
|
-
...props,
|
|
5463
|
-
schema: schemaWithGoverningLaw,
|
|
5464
|
-
defaultData: props == null ? void 0 : props.data,
|
|
5465
|
-
rules: (props == null ? void 0 : props.validators) || companyCountryValidationRules,
|
|
5466
|
-
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
5467
|
-
});
|
|
5468
|
-
const formUtils = formUtilities(props, i18n);
|
|
5469
|
-
const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
|
|
5470
|
-
const isCountryOfGoverningLawEnabled = isExperimentEnabled("EnableCountryOfGoverningLawForUKCompanies");
|
|
5471
|
-
const isCountryOfGoverningLawAllowed = formData.country === "GB";
|
|
5472
|
-
const showCountryOfGoverningLaw = isCountryOfGoverningLawEnabled && isCountryOfGoverningLawAllowed;
|
|
5473
|
-
useEffect(() => {
|
|
5474
|
-
updateStateSlice == null ? void 0 : updateStateSlice({
|
|
5475
|
-
data: {
|
|
5476
|
-
...sliceData,
|
|
5477
|
-
...formData
|
|
5478
|
-
},
|
|
5479
|
-
errors: formErrors,
|
|
5480
|
-
valid: formValid,
|
|
5481
|
-
fieldProblems: formFieldProblems
|
|
5482
|
-
});
|
|
5483
|
-
}, [formData, formErrors, formFieldProblems, formValid, updateStateSlice]);
|
|
5484
|
-
const handleChangeForCountries = (key) => (e) => {
|
|
5485
|
-
handleChangeFor(key)(e);
|
|
5486
|
-
if (!formData.differentCountryOfGoverningLaw && e.target.value === "GB") {
|
|
5487
|
-
const countryOfGoverningLawEvent = {
|
|
5488
|
-
target: {
|
|
5489
|
-
name: "countryOfGoverningLaw",
|
|
5490
|
-
value: e.target.value
|
|
5491
|
-
}
|
|
5492
|
-
};
|
|
5493
|
-
handleChangeFor("countryOfGoverningLaw")(countryOfGoverningLawEvent);
|
|
5494
|
-
}
|
|
5495
|
-
};
|
|
5496
|
-
return jsxs("form", {
|
|
5497
|
-
children: [jsx(FormHeader, {
|
|
5498
|
-
heading: props == null ? void 0 : props.heading
|
|
5499
|
-
}), jsx(ErrorPanel, {
|
|
5500
|
-
verificationErrors: props == null ? void 0 : props.formVerificationErrors,
|
|
5501
|
-
validationErrors: props == null ? void 0 : props.fieldValidationErrors,
|
|
5502
|
-
formUtils,
|
|
5503
|
-
id: "ariaErrorField"
|
|
5504
|
-
}), formData.country === "US" ? jsx(PatriotActDisclosure, {}) : void 0, formUtils.isRequiredField("legalCompanyName") && jsx(LegalCompanyNameField, {
|
|
5505
|
-
data: formUtils.getFieldData(formData, LEGAL_COMPANY_NAME_FIELD),
|
|
5506
|
-
valid: formUtils.getFieldValid(formValid, LEGAL_COMPANY_NAME_FIELD),
|
|
5507
|
-
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, LEGAL_COMPANY_NAME_FIELD),
|
|
5508
|
-
labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
|
|
5509
|
-
helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
|
|
5510
|
-
legalCompanyName: "legalCompanyName__helperText"
|
|
5511
|
-
}),
|
|
5512
|
-
readonly: formUtils.isReadOnly("legalCompanyName"),
|
|
5513
|
-
handleChangeFor
|
|
5514
|
-
}), formUtils.isRequiredField("country") && jsx(CountryField, {
|
|
5515
|
-
data: formUtils.getFieldData(formData, COUNTRY_FIELD),
|
|
5516
|
-
valid: formUtils.getFieldValid(formValid, COUNTRY_FIELD),
|
|
5517
|
-
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_FIELD),
|
|
5518
|
-
labels: formUtils.getFieldLabels(COUNTRY_FIELD, {
|
|
5519
|
-
country: "countryRegionOfEstablishment"
|
|
5520
|
-
}),
|
|
5521
|
-
readonly: !isAllowedEditPrefilledCountry || Boolean(props == null ? void 0 : props.disableCountry),
|
|
5522
|
-
classNameModifiers: ["country"],
|
|
5523
|
-
allowedCountries: isTopLevelEntity ? allowedCountries : void 0,
|
|
5524
|
-
handleChangeFor: handleChangeForCountries
|
|
5525
|
-
}), showCountryOfGoverningLaw && jsx(CountryOfGoverningLawField, {
|
|
5526
|
-
data: formUtils.getFieldData(formData, COUNTRY_OF_GOVERNING_LAW_FIELD),
|
|
5527
|
-
valid: formUtils.getFieldValid(formValid, COUNTRY_OF_GOVERNING_LAW_FIELD),
|
|
5528
|
-
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_OF_GOVERNING_LAW_FIELD),
|
|
5529
|
-
labels: formUtils.getFieldLabels(COUNTRY_OF_GOVERNING_LAW_FIELD),
|
|
5530
|
-
readonly: false,
|
|
5531
|
-
classNameModifiers: ["country"],
|
|
5532
|
-
allowedCountries: isTopLevelEntity ? allowedCountries : void 0,
|
|
5533
|
-
handleChangeFor
|
|
5534
|
-
})]
|
|
5535
|
-
});
|
|
5536
|
-
}
|
|
5537
|
-
const CompanyNameAndCountryComponent = memo(CompanyNameAndCountry, (prevProps, nextProps) => {
|
|
5538
|
-
var _a, _b;
|
|
5539
|
-
return objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.optionalFields, nextProps.optionalFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && ((_a = prevProps.data) == null ? void 0 : _a.country) === ((_b = nextProps.data) == null ? void 0 : _b.country) && prevProps.shouldValidate === nextProps.shouldValidate;
|
|
5540
|
-
});
|
|
5541
|
-
function StateContextSetter({
|
|
5542
|
-
stateRef
|
|
5543
|
-
}) {
|
|
5544
|
-
if (stateRef.current.setState) {
|
|
5545
|
-
return null;
|
|
5546
|
-
}
|
|
5547
|
-
return jsx(StateContext.Consumer, {
|
|
5548
|
-
children: (stateContextValue) => {
|
|
5549
|
-
if (!stateContextValue) {
|
|
5550
|
-
throw new Error("<StateContextSetter> needs to be mounted inside a <StateProvider>");
|
|
5551
|
-
}
|
|
5552
|
-
const {
|
|
5553
|
-
dispatch,
|
|
5554
|
-
setActiveForms
|
|
5555
|
-
} = stateContextValue;
|
|
5556
|
-
stateRef.current.setState = dispatch;
|
|
5557
|
-
stateRef.current.setActiveForms = setActiveForms;
|
|
5558
|
-
return null;
|
|
5559
|
-
}
|
|
5560
|
-
});
|
|
5561
|
-
}
|
|
5562
|
-
var CompanyTypesValue = /* @__PURE__ */ ((CompanyTypesValue2) => {
|
|
5563
|
-
CompanyTypesValue2["PRIVATE_COMPANY"] = "privateCompany";
|
|
5564
|
-
CompanyTypesValue2["PUBLIC_COMPANY"] = "listedPublicCompany";
|
|
5565
|
-
CompanyTypesValue2["UNLISTED_PUBLIC_COMPANY"] = "unlistedPublicCompany";
|
|
5566
|
-
CompanyTypesValue2["INCORPORATED_PARTNERSHIP"] = "partnershipIncorporated";
|
|
5567
|
-
CompanyTypesValue2["INCORPORATED_ASSOCIATION"] = "associationIncorporated";
|
|
5568
|
-
CompanyTypesValue2["GOVERNMENTAL_ORGANIZATION"] = "governmentalOrganization";
|
|
5569
|
-
CompanyTypesValue2["NON_PROFIT_OR_CHARITABLE"] = "nonProfit";
|
|
5570
|
-
CompanyTypesValue2["SOLE_PROPRIETORSHIP"] = "soleProprietorship";
|
|
5571
|
-
return CompanyTypesValue2;
|
|
5572
|
-
})(CompanyTypesValue || {});
|
|
5573
5401
|
var CountryCodes = /* @__PURE__ */ ((CountryCodes2) => {
|
|
5574
5402
|
CountryCodes2["Afghanistan"] = "AF";
|
|
5575
5403
|
CountryCodes2["AlandIslands"] = "AX";
|
|
@@ -5819,15 +5647,232 @@ var CountryCodes = /* @__PURE__ */ ((CountryCodes2) => {
|
|
|
5819
5647
|
CountryCodes2["Zimbabwe"] = "ZW";
|
|
5820
5648
|
return CountryCodes2;
|
|
5821
5649
|
})(CountryCodes || {});
|
|
5822
|
-
const
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5650
|
+
const validateNotEmptyOnBlur = {
|
|
5651
|
+
modes: ["blur"],
|
|
5652
|
+
validate: (val) => !isEmpty(val),
|
|
5653
|
+
errorMessage: "fieldIsRequired"
|
|
5654
|
+
};
|
|
5655
|
+
const validatePatternOnBlur = (pattern) => ({
|
|
5656
|
+
modes: ["blur"],
|
|
5657
|
+
validate: (val) => !!val && pattern.test(val)
|
|
5658
|
+
});
|
|
5659
|
+
const defaultFieldMetadata$a = {
|
|
5660
|
+
label: "legalCompanyName",
|
|
5661
|
+
helperText: "legalCompanyName__helperText",
|
|
5662
|
+
validators: validateNotEmptyOnBlur
|
|
5663
|
+
};
|
|
5664
|
+
const defaultFieldConfig$a = {
|
|
5665
|
+
[CountryCodes.Australia]: {
|
|
5666
|
+
label: "legalCompanyName",
|
|
5667
|
+
helperText: "legalCompanyName__helperText__AU",
|
|
5668
|
+
validators: validateNotEmptyOnBlur
|
|
5669
|
+
},
|
|
5670
|
+
[CountryCodes.HongKong]: {
|
|
5671
|
+
label: "legalCompanyName",
|
|
5672
|
+
helperText: "legalCompanyName__helperText__HK",
|
|
5673
|
+
validators: validateNotEmptyOnBlur
|
|
5674
|
+
},
|
|
5675
|
+
[CountryCodes.Netherlands]: {
|
|
5676
|
+
label: "legalCompanyName",
|
|
5677
|
+
helperText: "legalCompanyName__helperText__NL",
|
|
5678
|
+
validators: validateNotEmptyOnBlur
|
|
5679
|
+
},
|
|
5680
|
+
[CountryCodes.Singapore]: {
|
|
5681
|
+
label: "legalCompanyName",
|
|
5682
|
+
helperText: "legalCompanyName__helperText__SG",
|
|
5683
|
+
validators: validateNotEmptyOnBlur
|
|
5684
|
+
},
|
|
5685
|
+
[CountryCodes.UnitedStates]: ({
|
|
5686
|
+
isBusiness
|
|
5687
|
+
}) => ({
|
|
5688
|
+
label: "legalCompanyName__US",
|
|
5689
|
+
helperText: isBusiness ? "legalCompanyName__helperText__US__business" : "legalCompanyName__helperText__US",
|
|
5690
|
+
validators: validateNotEmptyOnBlur
|
|
5691
|
+
})
|
|
5692
|
+
};
|
|
5693
|
+
const Disclaimer = ({
|
|
5694
|
+
title,
|
|
5695
|
+
children
|
|
5696
|
+
}) => jsxs("div", {
|
|
5697
|
+
className: "adyen-kyc-disclaimer-container",
|
|
5698
|
+
children: [jsx("div", {
|
|
5699
|
+
className: "adyen-kyc-disclaimer__title",
|
|
5700
|
+
children: title
|
|
5701
|
+
}), jsx("div", {
|
|
5702
|
+
className: "adyen-kyc-disclaimer__content",
|
|
5703
|
+
children
|
|
5704
|
+
})]
|
|
5705
|
+
});
|
|
5706
|
+
const PatriotActDisclosure = () => {
|
|
5707
|
+
const {
|
|
5708
|
+
i18n
|
|
5709
|
+
} = useI18nContext();
|
|
5710
|
+
return jsxs(Disclaimer, {
|
|
5711
|
+
title: i18n.get("patriotActDisclosureTitle"),
|
|
5712
|
+
children: [jsx("p", {
|
|
5713
|
+
children: i18n.get("patriotActDisclosureTextParagraph1")
|
|
5714
|
+
}), jsx("p", {
|
|
5715
|
+
children: i18n.get("patriotActDisclosureTextParagraph2")
|
|
5716
|
+
})]
|
|
5717
|
+
});
|
|
5718
|
+
};
|
|
5719
|
+
const companyCountryValidationRules = {
|
|
5720
|
+
country: {
|
|
5721
|
+
modes: ["blur"],
|
|
5722
|
+
validate: (companyCountry) => !isEmpty(companyCountry),
|
|
5723
|
+
errorMessage: "fieldIsRequired"
|
|
5724
|
+
},
|
|
5725
|
+
legalCompanyName: {
|
|
5726
|
+
modes: ["blur"],
|
|
5727
|
+
validate: (legalCompanyName2) => !isEmpty(legalCompanyName2),
|
|
5728
|
+
errorMessage: "fieldIsRequired"
|
|
5729
|
+
},
|
|
5730
|
+
countryOfGoverningLaw: {
|
|
5731
|
+
modes: ["blur"],
|
|
5732
|
+
validate: (countryOfGoverningLaw2) => !isEmpty(countryOfGoverningLaw2),
|
|
5733
|
+
errorMessage: "fieldIsRequired"
|
|
5828
5734
|
}
|
|
5829
|
-
return defaultMetadata;
|
|
5830
5735
|
};
|
|
5736
|
+
const countryWithGoverningLawFields = [...LEGAL_COMPANY_NAME_FIELD, ...COUNTRY_FIELD, ...COUNTRY_OF_GOVERNING_LAW_FIELD];
|
|
5737
|
+
const companyNameAndCountryFields = [...LEGAL_COMPANY_NAME_FIELD, ...COUNTRY_FIELD];
|
|
5738
|
+
function CompanyNameAndCountry(props) {
|
|
5739
|
+
const {
|
|
5740
|
+
i18n
|
|
5741
|
+
} = useI18nContext();
|
|
5742
|
+
const {
|
|
5743
|
+
isSettingEnabled
|
|
5744
|
+
} = useSettingsContext();
|
|
5745
|
+
const allowedCountries = useAllowedCountries();
|
|
5746
|
+
const {
|
|
5747
|
+
isExperimentEnabled
|
|
5748
|
+
} = useExperimentsContext();
|
|
5749
|
+
const {
|
|
5750
|
+
sliceData,
|
|
5751
|
+
updateStateSlice
|
|
5752
|
+
} = useGlobalDataSlice(props.id);
|
|
5753
|
+
let mergedProps = props;
|
|
5754
|
+
mergedProps = mergeFieldMetadataIntoProps("legalCompanyName", resolveFieldMetadata(defaultFieldConfig$a[sliceData == null ? void 0 : sliceData.country], {
|
|
5755
|
+
isBusiness: false
|
|
5756
|
+
}, defaultFieldMetadata$a), mergedProps);
|
|
5757
|
+
const schemaWithGoverningLaw = (sliceData == null ? void 0 : sliceData.country) === "GB" && (sliceData == null ? void 0 : sliceData.differentCountryOfGoverningLaw) ? countryWithGoverningLawFields : companyNameAndCountryFields;
|
|
5758
|
+
const {
|
|
5759
|
+
data: formData,
|
|
5760
|
+
valid: formValid,
|
|
5761
|
+
errors: formErrors,
|
|
5762
|
+
fieldProblems: formFieldProblems,
|
|
5763
|
+
handleChangeFor
|
|
5764
|
+
} = useForm({
|
|
5765
|
+
...mergedProps,
|
|
5766
|
+
schema: schemaWithGoverningLaw,
|
|
5767
|
+
defaultData: mergedProps == null ? void 0 : mergedProps.data,
|
|
5768
|
+
rules: (mergedProps == null ? void 0 : mergedProps.validators) || companyCountryValidationRules,
|
|
5769
|
+
fieldProblems: mergedProps == null ? void 0 : mergedProps.fieldValidationErrors
|
|
5770
|
+
});
|
|
5771
|
+
const formUtils = formUtilities(mergedProps, i18n);
|
|
5772
|
+
const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
|
|
5773
|
+
const isCountryOfGoverningLawEnabled = isExperimentEnabled("EnableCountryOfGoverningLawForUKCompanies");
|
|
5774
|
+
const isCountryOfGoverningLawAllowed = formData.country === "GB";
|
|
5775
|
+
const showCountryOfGoverningLaw = isCountryOfGoverningLawEnabled && isCountryOfGoverningLawAllowed;
|
|
5776
|
+
useEffect(() => {
|
|
5777
|
+
updateStateSlice == null ? void 0 : updateStateSlice({
|
|
5778
|
+
data: {
|
|
5779
|
+
...sliceData,
|
|
5780
|
+
...formData
|
|
5781
|
+
},
|
|
5782
|
+
errors: formErrors,
|
|
5783
|
+
valid: formValid,
|
|
5784
|
+
fieldProblems: formFieldProblems
|
|
5785
|
+
});
|
|
5786
|
+
}, [formData, formErrors, formFieldProblems, formValid, updateStateSlice]);
|
|
5787
|
+
const handleChangeForCountries = (key) => (e) => {
|
|
5788
|
+
handleChangeFor(key)(e);
|
|
5789
|
+
if (!formData.differentCountryOfGoverningLaw && e.target.value === "GB") {
|
|
5790
|
+
const countryOfGoverningLawEvent = {
|
|
5791
|
+
target: {
|
|
5792
|
+
name: "countryOfGoverningLaw",
|
|
5793
|
+
value: e.target.value
|
|
5794
|
+
}
|
|
5795
|
+
};
|
|
5796
|
+
handleChangeFor("countryOfGoverningLaw")(countryOfGoverningLawEvent);
|
|
5797
|
+
}
|
|
5798
|
+
};
|
|
5799
|
+
return jsxs("form", {
|
|
5800
|
+
children: [jsx(FormHeader, {
|
|
5801
|
+
heading: props == null ? void 0 : props.heading
|
|
5802
|
+
}), jsx(ErrorPanel, {
|
|
5803
|
+
verificationErrors: props == null ? void 0 : props.formVerificationErrors,
|
|
5804
|
+
validationErrors: props == null ? void 0 : props.fieldValidationErrors,
|
|
5805
|
+
formUtils,
|
|
5806
|
+
id: "ariaErrorField"
|
|
5807
|
+
}), formData.country === "US" ? jsx(PatriotActDisclosure, {}) : void 0, formUtils.isRequiredField("legalCompanyName") && jsx(LegalCompanyNameField, {
|
|
5808
|
+
data: formUtils.getFieldData(formData, LEGAL_COMPANY_NAME_FIELD),
|
|
5809
|
+
valid: formUtils.getFieldValid(formValid, LEGAL_COMPANY_NAME_FIELD),
|
|
5810
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, LEGAL_COMPANY_NAME_FIELD),
|
|
5811
|
+
labels: formUtils.getFieldLabels(LEGAL_COMPANY_NAME_FIELD),
|
|
5812
|
+
helperText: formUtils.getFieldHelperText(LEGAL_COMPANY_NAME_FIELD, {
|
|
5813
|
+
legalCompanyName: "legalCompanyName__helperText"
|
|
5814
|
+
}),
|
|
5815
|
+
readonly: formUtils.isReadOnly("legalCompanyName"),
|
|
5816
|
+
handleChangeFor
|
|
5817
|
+
}), formUtils.isRequiredField("country") && jsx(CountryField, {
|
|
5818
|
+
data: formUtils.getFieldData(formData, COUNTRY_FIELD),
|
|
5819
|
+
valid: formUtils.getFieldValid(formValid, COUNTRY_FIELD),
|
|
5820
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_FIELD),
|
|
5821
|
+
labels: formUtils.getFieldLabels(COUNTRY_FIELD, {
|
|
5822
|
+
country: "countryRegionOfEstablishment"
|
|
5823
|
+
}),
|
|
5824
|
+
readonly: !isAllowedEditPrefilledCountry || Boolean(props == null ? void 0 : props.disableCountry),
|
|
5825
|
+
classNameModifiers: ["country"],
|
|
5826
|
+
allowedCountries: mergedProps.isTopLevelEntity ? allowedCountries : void 0,
|
|
5827
|
+
handleChangeFor: handleChangeForCountries
|
|
5828
|
+
}), showCountryOfGoverningLaw && jsx(CountryOfGoverningLawField, {
|
|
5829
|
+
data: formUtils.getFieldData(formData, COUNTRY_OF_GOVERNING_LAW_FIELD),
|
|
5830
|
+
valid: formUtils.getFieldValid(formValid, COUNTRY_OF_GOVERNING_LAW_FIELD),
|
|
5831
|
+
errors: formUtils.getFieldErrors(formErrors, formFieldProblems, COUNTRY_OF_GOVERNING_LAW_FIELD),
|
|
5832
|
+
labels: formUtils.getFieldLabels(COUNTRY_OF_GOVERNING_LAW_FIELD),
|
|
5833
|
+
readonly: false,
|
|
5834
|
+
classNameModifiers: ["country"],
|
|
5835
|
+
allowedCountries: mergedProps.isTopLevelEntity ? allowedCountries : void 0,
|
|
5836
|
+
handleChangeFor
|
|
5837
|
+
})]
|
|
5838
|
+
});
|
|
5839
|
+
}
|
|
5840
|
+
const CompanyNameAndCountryComponent = memo(CompanyNameAndCountry, (prevProps, nextProps) => {
|
|
5841
|
+
var _a, _b;
|
|
5842
|
+
return objectsDeepEqual(prevProps.requiredFields, nextProps.requiredFields) && objectsDeepEqual(prevProps.optionalFields, nextProps.optionalFields) && objectsDeepEqual(prevProps.data, nextProps.data) && objectsDeepEqual(prevProps.formVerificationErrors, nextProps.formVerificationErrors) && objectsDeepEqual(prevProps.fieldValidationErrors, nextProps.fieldValidationErrors) && ((_a = prevProps.data) == null ? void 0 : _a.country) === ((_b = nextProps.data) == null ? void 0 : _b.country) && prevProps.shouldValidate === nextProps.shouldValidate;
|
|
5843
|
+
});
|
|
5844
|
+
function StateContextSetter({
|
|
5845
|
+
stateRef
|
|
5846
|
+
}) {
|
|
5847
|
+
if (stateRef.current.setState) {
|
|
5848
|
+
return null;
|
|
5849
|
+
}
|
|
5850
|
+
return jsx(StateContext.Consumer, {
|
|
5851
|
+
children: (stateContextValue) => {
|
|
5852
|
+
if (!stateContextValue) {
|
|
5853
|
+
throw new Error("<StateContextSetter> needs to be mounted inside a <StateProvider>");
|
|
5854
|
+
}
|
|
5855
|
+
const {
|
|
5856
|
+
dispatch,
|
|
5857
|
+
setActiveForms
|
|
5858
|
+
} = stateContextValue;
|
|
5859
|
+
stateRef.current.setState = dispatch;
|
|
5860
|
+
stateRef.current.setActiveForms = setActiveForms;
|
|
5861
|
+
return null;
|
|
5862
|
+
}
|
|
5863
|
+
});
|
|
5864
|
+
}
|
|
5865
|
+
var CompanyTypesValue = /* @__PURE__ */ ((CompanyTypesValue2) => {
|
|
5866
|
+
CompanyTypesValue2["PRIVATE_COMPANY"] = "privateCompany";
|
|
5867
|
+
CompanyTypesValue2["PUBLIC_COMPANY"] = "listedPublicCompany";
|
|
5868
|
+
CompanyTypesValue2["UNLISTED_PUBLIC_COMPANY"] = "unlistedPublicCompany";
|
|
5869
|
+
CompanyTypesValue2["INCORPORATED_PARTNERSHIP"] = "partnershipIncorporated";
|
|
5870
|
+
CompanyTypesValue2["INCORPORATED_ASSOCIATION"] = "associationIncorporated";
|
|
5871
|
+
CompanyTypesValue2["GOVERNMENTAL_ORGANIZATION"] = "governmentalOrganization";
|
|
5872
|
+
CompanyTypesValue2["NON_PROFIT_OR_CHARITABLE"] = "nonProfit";
|
|
5873
|
+
CompanyTypesValue2["SOLE_PROPRIETORSHIP"] = "soleProprietorship";
|
|
5874
|
+
return CompanyTypesValue2;
|
|
5875
|
+
})(CompanyTypesValue || {});
|
|
5831
5876
|
const cachedStripPatterns = /* @__PURE__ */ new Map();
|
|
5832
5877
|
const makeStripPattern = (mask) => {
|
|
5833
5878
|
const inputPatterns = mask.tokens.filter((token) => token.type === "input" && !!token.allow).map((token) => token.allow);
|
|
@@ -7717,15 +7762,6 @@ const PassportNumberPatterns = {
|
|
|
7717
7762
|
const ProofOfIdentityCardPatterns = {
|
|
7718
7763
|
[CountryCodes.HongKong]: /^[A-Z]{1,2}[0-9]{6}[0-9A]$/
|
|
7719
7764
|
};
|
|
7720
|
-
const validateNotEmptyOnBlur = {
|
|
7721
|
-
modes: ["blur"],
|
|
7722
|
-
validate: (val) => !isEmpty(val),
|
|
7723
|
-
errorMessage: "fieldIsRequired"
|
|
7724
|
-
};
|
|
7725
|
-
const validatePatternOnBlur = (pattern) => ({
|
|
7726
|
-
modes: ["blur"],
|
|
7727
|
-
validate: (val) => !!val && pattern.test(val)
|
|
7728
|
-
});
|
|
7729
7765
|
const defaultFieldMetadata$9 = {
|
|
7730
7766
|
label: "registrationNumber"
|
|
7731
7767
|
};
|
|
@@ -10756,9 +10792,6 @@ const businessDetailsFieldsPerScenario = {
|
|
|
10756
10792
|
};
|
|
10757
10793
|
const countryConfig$3 = {
|
|
10758
10794
|
[CountryCodes.Australia]: {
|
|
10759
|
-
legalCompanyName: {
|
|
10760
|
-
helperText: "legalCompanyName__helperText__AU"
|
|
10761
|
-
},
|
|
10762
10795
|
legalEntityType: {
|
|
10763
10796
|
label: "companyType"
|
|
10764
10797
|
}
|
|
@@ -10811,9 +10844,6 @@ const countryConfig$3 = {
|
|
|
10811
10844
|
[CountryCodes.Gibraltar]: {},
|
|
10812
10845
|
[CountryCodes.Guernsey]: {},
|
|
10813
10846
|
[CountryCodes.HongKong]: {
|
|
10814
|
-
legalCompanyName: {
|
|
10815
|
-
helperText: "legalCompanyName__helperText__HK"
|
|
10816
|
-
},
|
|
10817
10847
|
legalEntityType: {
|
|
10818
10848
|
label: "typeOfCompany"
|
|
10819
10849
|
},
|
|
@@ -10867,9 +10897,6 @@ const countryConfig$3 = {
|
|
|
10867
10897
|
},
|
|
10868
10898
|
[CountryCodes.Monaco]: {},
|
|
10869
10899
|
[CountryCodes.Netherlands]: {
|
|
10870
|
-
legalCompanyName: {
|
|
10871
|
-
helperText: "legalCompanyName__helperText__NL"
|
|
10872
|
-
},
|
|
10873
10900
|
vatAbsenceReason: {
|
|
10874
10901
|
label: "vatAbsenceReason"
|
|
10875
10902
|
}
|
|
@@ -10905,9 +10932,6 @@ const countryConfig$3 = {
|
|
|
10905
10932
|
country: {
|
|
10906
10933
|
label: "country__US__business"
|
|
10907
10934
|
},
|
|
10908
|
-
legalCompanyName: {
|
|
10909
|
-
helperText: "legalCompanyName__helperText__US"
|
|
10910
|
-
},
|
|
10911
10935
|
tradingName: {
|
|
10912
10936
|
label: "doingBusinessAs"
|
|
10913
10937
|
},
|
|
@@ -10927,9 +10951,6 @@ const countryConfig$3 = {
|
|
|
10927
10951
|
registrationNumber: {
|
|
10928
10952
|
label: "uen"
|
|
10929
10953
|
},
|
|
10930
|
-
legalCompanyName: {
|
|
10931
|
-
helperText: "legalCompanyName__helperText__SG"
|
|
10932
|
-
},
|
|
10933
10954
|
legalEntityType: {
|
|
10934
10955
|
label: "companyType"
|
|
10935
10956
|
},
|
|
@@ -10958,10 +10979,6 @@ const countryConfig$3 = {
|
|
|
10958
10979
|
stateOrProvince: {
|
|
10959
10980
|
label: "stateOrProvince__US__business"
|
|
10960
10981
|
},
|
|
10961
|
-
legalCompanyName: {
|
|
10962
|
-
label: "legalCompanyName__US",
|
|
10963
|
-
helperText: "legalCompanyName__helperText__US"
|
|
10964
|
-
},
|
|
10965
10982
|
tradingName: {
|
|
10966
10983
|
label: "doingBusinessAs"
|
|
10967
10984
|
},
|
|
@@ -24259,13 +24276,6 @@ const dbaNameFieldMetadata = {
|
|
|
24259
24276
|
label: "dbaName",
|
|
24260
24277
|
validators: validateNotEmptyOnBlur
|
|
24261
24278
|
};
|
|
24262
|
-
const LegalCompanyNameFieldValidation = () => ({
|
|
24263
|
-
legalCompanyName: {
|
|
24264
|
-
modes: ["blur"],
|
|
24265
|
-
validate: (legalCompanyName2) => !isEmpty(legalCompanyName2),
|
|
24266
|
-
errorMessage: "fieldIsRequired"
|
|
24267
|
-
}
|
|
24268
|
-
});
|
|
24269
24279
|
const TAX_INFORMATION_FIELD = ["taxInformation", "exemptedFromTax", "isUen"];
|
|
24270
24280
|
function TaxInformationField({
|
|
24271
24281
|
data,
|
|
@@ -24622,13 +24632,9 @@ function AdditionalInformationComponent({
|
|
|
24622
24632
|
return (_a2 = initialFormUtilsProps.allFields) == null ? void 0 : _a2.reduce((acc, field) => {
|
|
24623
24633
|
switch (field) {
|
|
24624
24634
|
case "legalCompanyName":
|
|
24625
|
-
return {
|
|
24626
|
-
|
|
24627
|
-
|
|
24628
|
-
...acc.validators,
|
|
24629
|
-
...LegalCompanyNameFieldValidation()
|
|
24630
|
-
}
|
|
24631
|
-
};
|
|
24635
|
+
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$a[country2], {
|
|
24636
|
+
isBusiness: true
|
|
24637
|
+
}, defaultFieldMetadata$a), acc);
|
|
24632
24638
|
case "dbaName":
|
|
24633
24639
|
return mergeFieldMetadataIntoProps("dbaName", dbaNameFieldMetadata, acc);
|
|
24634
24640
|
case "registrationNumber":
|
|
@@ -27790,13 +27796,6 @@ function CompanyLookup({
|
|
|
27790
27796
|
});
|
|
27791
27797
|
}
|
|
27792
27798
|
const CompanyLookupComponent = memo(CompanyLookup, (prevProps, nextProps) => objectsDeepEqual(prevProps.defaultData, nextProps.defaultData) && prevProps.canVerify === nextProps.canVerify && prevProps.legalCompanyName === nextProps.legalCompanyName && prevProps.country === nextProps.country && prevProps.stateOrProvince === nextProps.stateOrProvince && prevProps.taxInformationNumber === nextProps.taxInformationNumber && prevProps.setLoading === nextProps.setLoading && prevProps.setKompanyAddress === nextProps.setKompanyAddress && prevProps.handleCompanyIndexSearch === nextProps.handleCompanyIndexSearch && prevProps.handleCompanyDeepSearch === nextProps.handleCompanyDeepSearch && prevProps.handleGetCompanyDataset === nextProps.handleGetCompanyDataset && prevProps.handleRefreshCompanyDataset === nextProps.handleRefreshCompanyDataset && prevProps.handleVerifyTin === nextProps.handleVerifyTin);
|
|
27793
|
-
const StateFieldValidation = () => ({
|
|
27794
|
-
stateOrProvince: {
|
|
27795
|
-
modes: ["blur"],
|
|
27796
|
-
validate: (stateOrProvince2) => !isEmpty(stateOrProvince2),
|
|
27797
|
-
errorMessage: "fieldIsRequired"
|
|
27798
|
-
}
|
|
27799
|
-
});
|
|
27800
27799
|
const COMPANY_BASICS_FORM_ID = "companyBasics";
|
|
27801
27800
|
const companyBasicsFields = [...LEGAL_COMPANY_NAME_FIELD, ...COUNTRY_FIELD, ...STATE_FIELD, ...TAX_INFORMATION_FIELD];
|
|
27802
27801
|
function CompanyBasics({
|
|
@@ -27860,13 +27859,9 @@ function CompanyBasics({
|
|
|
27860
27859
|
return (_a2 = initialFormUtilsProps.allFields) == null ? void 0 : _a2.reduce((acc, field) => {
|
|
27861
27860
|
switch (field) {
|
|
27862
27861
|
case "legalCompanyName":
|
|
27863
|
-
return {
|
|
27864
|
-
|
|
27865
|
-
|
|
27866
|
-
...acc.validators,
|
|
27867
|
-
...LegalCompanyNameFieldValidation()
|
|
27868
|
-
}
|
|
27869
|
-
};
|
|
27862
|
+
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$a[country2], {
|
|
27863
|
+
isBusiness: false
|
|
27864
|
+
}, defaultFieldMetadata$a), acc);
|
|
27870
27865
|
case "country":
|
|
27871
27866
|
return {
|
|
27872
27867
|
...acc,
|
|
@@ -27876,13 +27871,9 @@ function CompanyBasics({
|
|
|
27876
27871
|
}
|
|
27877
27872
|
};
|
|
27878
27873
|
case "stateOrProvince":
|
|
27879
|
-
return {
|
|
27880
|
-
|
|
27881
|
-
|
|
27882
|
-
...acc.validators,
|
|
27883
|
-
...StateFieldValidation()
|
|
27884
|
-
}
|
|
27885
|
-
};
|
|
27874
|
+
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
|
|
27875
|
+
isBusiness: false
|
|
27876
|
+
}, defaultFieldMetadata), acc);
|
|
27886
27877
|
case "taxInformation":
|
|
27887
27878
|
return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$1[country2], {
|
|
27888
27879
|
taxIdNumberType,
|
|
@@ -27892,7 +27883,7 @@ function CompanyBasics({
|
|
|
27892
27883
|
return acc;
|
|
27893
27884
|
}
|
|
27894
27885
|
}, initialFormUtilsProps);
|
|
27895
|
-
}, [country2, initialFormUtilsProps, taxIdNumberType]);
|
|
27886
|
+
}, [companyType2, country2, initialFormUtilsProps, taxIdNumberType]);
|
|
27896
27887
|
const schema = (requiredFields == null ? void 0 : requiredFields.length) ? requiredFields : ["legalCompanyName", "country"];
|
|
27897
27888
|
const {
|
|
27898
27889
|
schema: formSchema,
|
|
@@ -33597,28 +33588,28 @@ const convertExistingTrustMemberToDefaultData = (trustMember, allowMoreRolesForM
|
|
|
33597
33588
|
return convertExistingTrustMember(trustMember);
|
|
33598
33589
|
};
|
|
33599
33590
|
const TrustRoleAndEntityType = (props) => {
|
|
33600
|
-
|
|
33601
|
-
existingTrustMember,
|
|
33602
|
-
id: id2,
|
|
33603
|
-
getLegalEntityHandler,
|
|
33604
|
-
isOrganizationSettlorWithExemptionEnabled
|
|
33605
|
-
} = props;
|
|
33591
|
+
var _a;
|
|
33606
33592
|
const {
|
|
33607
33593
|
i18n
|
|
33608
33594
|
} = useI18nContext();
|
|
33595
|
+
const country2 = props.country;
|
|
33596
|
+
let mergedProps = props;
|
|
33597
|
+
mergedProps = mergeFieldMetadataIntoProps("legalCompanyName", resolveFieldMetadata(defaultFieldConfig$a[country2], {
|
|
33598
|
+
isBusiness: false
|
|
33599
|
+
}, defaultFieldMetadata$a), mergedProps);
|
|
33609
33600
|
const {
|
|
33610
33601
|
isExperimentEnabled
|
|
33611
33602
|
} = useExperimentsContext();
|
|
33612
33603
|
const allowMoreRolesForMainRootTrusteeEnabled = isExperimentEnabled("AllowMoreRolesForMainRootTrustee");
|
|
33613
|
-
const defaultData = convertExistingTrustMemberToDefaultData(existingTrustMember, allowMoreRolesForMainRootTrusteeEnabled);
|
|
33614
|
-
const formUtils = formUtilities(
|
|
33604
|
+
const defaultData = convertExistingTrustMemberToDefaultData(props.existingTrustMember, allowMoreRolesForMainRootTrusteeEnabled);
|
|
33605
|
+
const formUtils = formUtilities(mergedProps, i18n);
|
|
33615
33606
|
const decideFields = (data2) => {
|
|
33616
|
-
var
|
|
33617
|
-
if ((
|
|
33607
|
+
var _a2, _b;
|
|
33608
|
+
if ((_a2 = data2.role) == null ? void 0 : _a2.includes("undefinedBeneficiary")) {
|
|
33618
33609
|
return ["role", "descriptionUndefinedBeneficiary"];
|
|
33619
33610
|
}
|
|
33620
33611
|
if ((_b = data2.role) == null ? void 0 : _b.length) {
|
|
33621
|
-
if (isOrganizationSettlorWithExemptionEnabled && isOrganizationAndSettlor(data2)) {
|
|
33612
|
+
if (props.isOrganizationSettlorWithExemptionEnabled && isOrganizationAndSettlor(data2)) {
|
|
33622
33613
|
return ["role", "entityType", "settlorExemptionReason", "country", "legalCompanyName"];
|
|
33623
33614
|
}
|
|
33624
33615
|
if (couldBeExemptSettlor(data2)) {
|
|
@@ -33646,31 +33637,31 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
33646
33637
|
defaultData,
|
|
33647
33638
|
fieldProblems: props == null ? void 0 : props.fieldValidationErrors
|
|
33648
33639
|
});
|
|
33649
|
-
const availableRoles = allowMoreRolesForMainRootTrusteeEnabled && (existingTrustMember == null ? void 0 :
|
|
33640
|
+
const availableRoles = allowMoreRolesForMainRootTrusteeEnabled && ((_a = props.existingTrustMember) == null ? void 0 : _a.trustMemberType) === "rootTrustee" ? getAvailableRolesByTrustMemberTypeAndLegalEntityType(data.role, props.existingTrustMember) : getAvailableRoles(data.role);
|
|
33650
33641
|
useEffect(() => {
|
|
33651
33642
|
(async () => {
|
|
33652
|
-
var
|
|
33653
|
-
if (isOrganizationSettlorWithExemptionEnabled && existingTrustMember && existingTrustMember.trustMemberType === "exemptSettlor" && existingTrustMember.legalEntityId !== "isNewEntry" && existingTrustMember.roles !== void 0 && existingTrustMember.roles.length === 1 && existingTrustMember.roles[0] === "settlor" && getLegalEntityHandler) {
|
|
33654
|
-
const response = await getLegalEntityHandler(existingTrustMember.legalEntityId);
|
|
33655
|
-
const
|
|
33643
|
+
var _a2;
|
|
33644
|
+
if (props.isOrganizationSettlorWithExemptionEnabled && props.existingTrustMember && props.existingTrustMember.trustMemberType === "exemptSettlor" && props.existingTrustMember.legalEntityId !== "isNewEntry" && props.existingTrustMember.roles !== void 0 && props.existingTrustMember.roles.length === 1 && props.existingTrustMember.roles[0] === "settlor" && props.getLegalEntityHandler) {
|
|
33645
|
+
const response = await props.getLegalEntityHandler(props.existingTrustMember.legalEntityId);
|
|
33646
|
+
const country22 = (_a2 = response == null ? void 0 : response.organization) == null ? void 0 : _a2.registeredAddress.country;
|
|
33656
33647
|
if (response && response.organization) {
|
|
33657
|
-
handleChangeFor("country")(
|
|
33648
|
+
handleChangeFor("country")(country22);
|
|
33658
33649
|
}
|
|
33659
33650
|
}
|
|
33660
33651
|
})();
|
|
33661
33652
|
}, []);
|
|
33662
33653
|
useEffect(() => {
|
|
33663
|
-
var
|
|
33664
|
-
(
|
|
33654
|
+
var _a2;
|
|
33655
|
+
(_a2 = props.onChange) == null ? void 0 : _a2.call(props, {
|
|
33665
33656
|
schema,
|
|
33666
33657
|
data,
|
|
33667
33658
|
errors,
|
|
33668
33659
|
valid,
|
|
33669
33660
|
isValid,
|
|
33670
|
-
dataStoreId:
|
|
33661
|
+
dataStoreId: props.id,
|
|
33671
33662
|
fieldProblems
|
|
33672
33663
|
});
|
|
33673
|
-
}, [schema, data, isValid, i18n, errors, valid,
|
|
33664
|
+
}, [schema, data, isValid, i18n, errors, valid, props.id, fieldProblems]);
|
|
33674
33665
|
const onInputDescription = (e) => {
|
|
33675
33666
|
const {
|
|
33676
33667
|
value
|
|
@@ -33686,9 +33677,9 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
33686
33677
|
}
|
|
33687
33678
|
};
|
|
33688
33679
|
const changeSettlorExemptionReasons = (exemptionReasons) => {
|
|
33689
|
-
var
|
|
33680
|
+
var _a2;
|
|
33690
33681
|
if (exemptionReasons.includes("noneOfTheAbove")) {
|
|
33691
|
-
handleChangeFor("settlorExemptionReason")(((
|
|
33682
|
+
handleChangeFor("settlorExemptionReason")(((_a2 = data.settlorExemptionReason) == null ? void 0 : _a2.includes("noneOfTheAbove")) ? exemptionReasons.filter((reason) => reason !== "noneOfTheAbove") : ["noneOfTheAbove"]);
|
|
33692
33683
|
return;
|
|
33693
33684
|
}
|
|
33694
33685
|
handleChangeFor("settlorExemptionReason")(exemptionReasons);
|
|
@@ -33707,8 +33698,8 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
33707
33698
|
setErrors("lastName", errors2.lastName);
|
|
33708
33699
|
};
|
|
33709
33700
|
const onEntityTypeChange = (value) => {
|
|
33710
|
-
var
|
|
33711
|
-
if (isOrganizationSettlorWithExemptionEnabled && value === LegalEntityType.ORGANIZATION && ((
|
|
33701
|
+
var _a2;
|
|
33702
|
+
if (props.isOrganizationSettlorWithExemptionEnabled && value === LegalEntityType.ORGANIZATION && ((_a2 = data.role) == null ? void 0 : _a2.length) === 1 && data.role[0] === "settlor") {
|
|
33712
33703
|
changeSettlorExemptionReasons(["professionalServiceProvider"]);
|
|
33713
33704
|
}
|
|
33714
33705
|
handleChangeFor("entityType")(value);
|
|
@@ -33746,7 +33737,7 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
33746
33737
|
errorMessage: formUtils.getErrorMessage("entityType", errors, fieldProblems),
|
|
33747
33738
|
label: formUtils.getLabel("entityType", "whatTypeOfYourMembersEntity"),
|
|
33748
33739
|
classNameModifiers: ["entityType"],
|
|
33749
|
-
disabled: Boolean(existingTrustMember),
|
|
33740
|
+
disabled: Boolean(props.existingTrustMember),
|
|
33750
33741
|
children: (childProps) => jsx(RadioCardSelect, {
|
|
33751
33742
|
...childProps,
|
|
33752
33743
|
options: trustMemberLegalEntityTypes,
|
|
@@ -33806,8 +33797,8 @@ const TrustRoleAndEntityType = (props) => {
|
|
|
33806
33797
|
enterLastNameExactlyAsAppearInID: "enterSettlorsLastNameExactlyAsItAppearsInID"
|
|
33807
33798
|
},
|
|
33808
33799
|
onChange: onNameChange,
|
|
33809
|
-
dataStoreId:
|
|
33810
|
-
}) : void 0, isOrganizationSettlorWithExemptionEnabled && (schema == null ? void 0 : schema.includes("country")) && (schema == null ? void 0 : schema.includes("legalCompanyName")) ? jsxs(Fragment, {
|
|
33800
|
+
dataStoreId: props.id
|
|
33801
|
+
}) : void 0, props.isOrganizationSettlorWithExemptionEnabled && (schema == null ? void 0 : schema.includes("country")) && (schema == null ? void 0 : schema.includes("legalCompanyName")) ? jsxs(Fragment, {
|
|
33811
33802
|
children: [jsx(CountryField, {
|
|
33812
33803
|
data: formUtils.getFieldData(data, COUNTRY_FIELD),
|
|
33813
33804
|
valid: formUtils.getFieldValid(valid, COUNTRY_FIELD),
|
|
@@ -33946,7 +33937,8 @@ function RoleAndTypeDropinComponent({
|
|
|
33946
33937
|
navigateBack,
|
|
33947
33938
|
addOrUpdateTrustMember,
|
|
33948
33939
|
getLegalEntityHandler,
|
|
33949
|
-
isOrganizationSettlorWithExemptionEnabled
|
|
33940
|
+
isOrganizationSettlorWithExemptionEnabled,
|
|
33941
|
+
country: country2
|
|
33950
33942
|
}) {
|
|
33951
33943
|
var _a, _b;
|
|
33952
33944
|
const {
|
|
@@ -34039,7 +34031,8 @@ function RoleAndTypeDropinComponent({
|
|
|
34039
34031
|
onChange: onTrustMemberChange,
|
|
34040
34032
|
shouldValidate,
|
|
34041
34033
|
getLegalEntityHandler,
|
|
34042
|
-
isOrganizationSettlorWithExemptionEnabled
|
|
34034
|
+
isOrganizationSettlorWithExemptionEnabled,
|
|
34035
|
+
country: country2
|
|
34043
34036
|
})
|
|
34044
34037
|
}), isSummaryStep && jsx("div", {
|
|
34045
34038
|
className: "adyen-kyc-form-wrapper",
|
|
@@ -38632,7 +38625,7 @@ const ConfigurationApiProvider = ({
|
|
|
38632
38625
|
isEmbeddedDropin,
|
|
38633
38626
|
loadingContext
|
|
38634
38627
|
} = authContext;
|
|
38635
|
-
const sdkVersion = "3.20.
|
|
38628
|
+
const sdkVersion = "3.20.2";
|
|
38636
38629
|
useAnalytics({
|
|
38637
38630
|
onUserEvent,
|
|
38638
38631
|
legalEntityId: rootLegalEntityId,
|
package/dist/types/components/Dropins/RoleAndTypeDropin/components/RoleAndTypeDropinComponent.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { RoleAndTypeDropinProps } from '../types';
|
|
2
|
-
export declare function RoleAndTypeDropinComponent({ existingTrustMember, navigateToFullDropinFor, navigateBack, addOrUpdateTrustMember, getLegalEntityHandler, isOrganizationSettlorWithExemptionEnabled, }: RoleAndTypeDropinProps): import("preact").JSX.Element;
|
|
2
|
+
export declare function RoleAndTypeDropinComponent({ existingTrustMember, navigateToFullDropinFor, navigateBack, addOrUpdateTrustMember, getLegalEntityHandler, isOrganizationSettlorWithExemptionEnabled, country, }: RoleAndTypeDropinProps): import("preact").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ExistingLegalEntity } from '../../../core/models/api/legal-entity';
|
|
2
|
+
import type { CountryCode } from '../../../core/models/country-code';
|
|
2
3
|
import type { CompanyTrustMember, RegularTrustMember, TrustMember } from '../../TrustMembers/types';
|
|
3
4
|
import type { TrustRoleAndEntityTypeSchema } from '../../TrustRoleAndEntityType/types';
|
|
4
5
|
export interface RoleAndTypeDropinProps {
|
|
@@ -8,6 +9,7 @@ export interface RoleAndTypeDropinProps {
|
|
|
8
9
|
addOrUpdateTrustMember: (newOrUpdated: TrustMember) => void;
|
|
9
10
|
getLegalEntityHandler?(legalEntityId: string): Promise<ExistingLegalEntity>;
|
|
10
11
|
isOrganizationSettlorWithExemptionEnabled?: boolean;
|
|
12
|
+
country?: CountryCode;
|
|
11
13
|
}
|
|
12
14
|
export interface TrustMemberSchema {
|
|
13
15
|
roleAndEntityType: TrustRoleAndEntityTypeSchema;
|
|
@@ -26,6 +26,7 @@ export interface TrustRoleAndEntityTypeProps extends BaseInnerFormProps<TrustRol
|
|
|
26
26
|
existingTrustMember?: TrustMember;
|
|
27
27
|
getLegalEntityHandler?(legalEntityId: string): Promise<ExistingLegalEntity>;
|
|
28
28
|
isOrganizationSettlorWithExemptionEnabled?: boolean;
|
|
29
|
+
country?: CountryCode;
|
|
29
30
|
}
|
|
30
31
|
export declare const couldBeExemptSettlor: (data: TrustRoleAndEntityTypeSchema) => boolean;
|
|
31
32
|
export declare const isExemptSettlor: (data: TrustRoleAndEntityTypeSchema) => data is TrustRoleAndEntityTypeSchema & {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FieldMetadata } from '../../../core/models/country-config';
|
|
2
|
+
import type { PerCountryFieldConfig } from '../../../core/models/field-configurations';
|
|
3
|
+
import type { LegalCompanyNameFieldSchema } from './types';
|
|
4
|
+
interface FieldConfigParams {
|
|
5
|
+
isBusiness?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const defaultFieldMetadata: FieldMetadata<LegalCompanyNameFieldSchema, 'legalCompanyName'>;
|
|
8
|
+
export declare const defaultFieldConfig: PerCountryFieldConfig<LegalCompanyNameFieldSchema, 'legalCompanyName', FieldConfigParams>;
|
|
9
|
+
export {};
|
package/package.json
CHANGED