@adyen/kyc-components 2.53.1 → 2.54.0
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 +449 -373
- package/dist/es/circle-F380_Tya.js +8 -0
- package/dist/style.css +55 -33
- package/dist/types/components/AdditionalInformation/component/AdditionalInformationComponent.d.ts +2 -2
- package/dist/types/components/AdditionalInformation/types.d.ts +5 -1
- package/dist/types/components/BusinessDetails/forms.d.ts +0 -6
- package/dist/types/components/BusinessDetails/types.d.ts +0 -2
- package/dist/types/components/DecisionMakers/component/DecisionMakersComponent.d.ts +1 -1
- package/dist/types/components/DecisionMakers/types.d.ts +2 -2
- package/dist/types/components/Dropins/BusinessDetailsDropin/utils.d.ts +1 -2
- package/dist/types/components/Dropins/CompanyDropin/types.d.ts +0 -2
- package/dist/types/components/Dropins/IndividualDropin/components/IndividualDropinComponent.d.ts +1 -1
- package/dist/types/components/Individual/types.d.ts +3 -0
- package/dist/types/components/PersonalDetails/types.d.ts +2 -1
- package/dist/types/components/StepProgressIndicator/StepProgressIndicator.d.ts +2 -1
- package/dist/types/components/internal/Address/types.d.ts +4 -0
- package/dist/types/components/internal/Address/utils.d.ts +5 -5
- package/dist/types/components/internal/DecisionMakerRole/types.d.ts +2 -0
- package/dist/types/components/internal/EntityGuidanceStatus/types.d.ts +1 -1
- package/dist/types/components/internal/Modal/Modal.d.ts +1 -1
- package/dist/types/components/internal/Svg/svgs.d.ts +2 -1
- package/dist/types/core/hooks/singpass/useSingpassMyInfoLogin.d.ts +3 -0
- package/dist/types/utils/entity-status-util.d.ts +12 -1
- package/dist/types/utils/mapping/componentApiMapping.d.ts +15 -19
- package/package.json +1 -1
- package/dist/es/cross-circle-fill-BafKD3Av.js +0 -8
- package/dist/types/components/Company/trusted-fields.d.ts +0 -7
- package/dist/types/components/internal/EntityGuidanceStatus/component/EntityGuidanceLegend.d.ts +0 -3
- package/dist/types/components/internal/EntityGuidanceStatus/index.d.ts +0 -3
|
@@ -125,6 +125,7 @@ const defaultTrans = {
|
|
|
125
125
|
annualTurnover: "Annual turnover",
|
|
126
126
|
annualTurnoverHelper: "The annual sales revenue minus all discounts and sales taxes. Also known as net sales.",
|
|
127
127
|
apartmentSuite: "Apartment / Suite",
|
|
128
|
+
apartmentSuiteOther: "Apt, suite, other",
|
|
128
129
|
apartmentSuiteOptional: "Apartment / Suite (optional)",
|
|
129
130
|
areYouACompany: "Are you a company?",
|
|
130
131
|
areYouAnIndividual: "Are you an individual?",
|
|
@@ -985,7 +986,7 @@ const defaultTrans = {
|
|
|
985
986
|
orSoleProprietorshipName: "or sole proprietorship's name",
|
|
986
987
|
organisasjonsnummer: "Organisasjonsnummer",
|
|
987
988
|
organisationsnummer: "Organisationsnummer",
|
|
988
|
-
otherAddressInformation: "Other address information
|
|
989
|
+
otherAddressInformation: "Other address information",
|
|
989
990
|
otherBusinessInformation: "Other business information",
|
|
990
991
|
otherInformation: "Other information",
|
|
991
992
|
otherTrust: "Other trust",
|
|
@@ -1041,6 +1042,8 @@ const defaultTrans = {
|
|
|
1041
1042
|
postalCode: "Postal code",
|
|
1042
1043
|
poweredBy: "Powered by",
|
|
1043
1044
|
previous: "Previous",
|
|
1045
|
+
principalPlaceOfBusiness: "Principal place of business",
|
|
1046
|
+
principalPlaceOfBusinessDescription: "The physical location where a business's key officers oversee and manage its operations: this is usually the main office or headquarters.",
|
|
1044
1047
|
privateCompanyDescription: "Your company is owned privately and not traded on a public stock exchange. ",
|
|
1045
1048
|
privateCompanyTitle: "Private company",
|
|
1046
1049
|
processing: "Processing",
|
|
@@ -1087,6 +1090,8 @@ const defaultTrans = {
|
|
|
1087
1090
|
registeredAddressHeaderDescription__PR: "Your address as it appears on your Department of State Registration.",
|
|
1088
1091
|
registeredAddressHeaderDescription__US: "Your address as it appears on your Secretary of State Registration.",
|
|
1089
1092
|
registeredAddressTrustHeaderDescription: "The address registered to your trust",
|
|
1093
|
+
registeredBusinessAddress: "Registered business address",
|
|
1094
|
+
registeredBusinessAddressDescription: "Your business's official address used for government and other legal purposes.",
|
|
1090
1095
|
registrationAddress: "Registration address",
|
|
1091
1096
|
registrationDetails: "Registration details",
|
|
1092
1097
|
registrationDocument: "Registration document",
|
|
@@ -1168,6 +1173,7 @@ const defaultTrans = {
|
|
|
1168
1173
|
roleAndEntityType: "Role and entity type",
|
|
1169
1174
|
routingNumberVisible: "Includes your routing number",
|
|
1170
1175
|
salarySlip: "Salary slip",
|
|
1176
|
+
sameAsRegisteredAddress: "Same as registered business address",
|
|
1171
1177
|
sameNameAsLegalName: "Same as legal name of the company",
|
|
1172
1178
|
"save&Leave": "Save & leave",
|
|
1173
1179
|
saveAndGoToOverview: "Save and go to overview",
|
|
@@ -1422,6 +1428,7 @@ const defaultTrans = {
|
|
|
1422
1428
|
xCharactersLeft: "%{charactersLeft} characters left",
|
|
1423
1429
|
xMinutes: "%{minutes} minutes",
|
|
1424
1430
|
xMinutesAndYSeconds: "%{minutes} and %{seconds}",
|
|
1431
|
+
XOfYSteps: "%{currentStep} of %{totalSteps} ",
|
|
1425
1432
|
xSeconds: "%{seconds} seconds",
|
|
1426
1433
|
yes: "Yes",
|
|
1427
1434
|
yesBankruptcyInsolvency: "Yes, the company is filling for bankruptcy or insolvency",
|
|
@@ -2369,11 +2376,13 @@ const svgs = {
|
|
|
2369
2376
|
bin: lazy(() => import("./bin-D7a-dmmy.js")),
|
|
2370
2377
|
check: lazy(() => import("./checkmark-DS0ypPvH.js")),
|
|
2371
2378
|
checkmark: lazy(() => import("./checkmark-circle-fill-hZq1T5e9.js")),
|
|
2379
|
+
"checkmark-circle-fill": lazy(() => import("./checkmark-circle-fill-hZq1T5e9.js")),
|
|
2372
2380
|
"checkmark-small": lazy(() => import("./checkmark-small-4ciES6ZR.js")),
|
|
2373
2381
|
"chevron-down": lazy(() => import("./chevron-down-CSdvSDZq.js")),
|
|
2374
2382
|
"chevron-right": lazy(() => import("./chevron-right-B5NJn8is.js")),
|
|
2375
2383
|
"chevron-left": lazy(() => import("./chevron-left-Ctf1pv5s.js")),
|
|
2376
2384
|
"chevron-up": lazy(() => import("./chevron-up-CXPd5NYI.js")),
|
|
2385
|
+
circle: lazy(() => import("./circle-F380_Tya.js")),
|
|
2377
2386
|
company: lazy(() => import("./headquarter-BVHLaPzn.js")),
|
|
2378
2387
|
"company-2": lazy(() => import("./hotel-DLFFe_Ls.js")),
|
|
2379
2388
|
contract: lazy(() => import("./contract-DFZ6WwMd.js")),
|
|
@@ -2404,7 +2413,6 @@ const svgs = {
|
|
|
2404
2413
|
upload: lazy(() => import("./upload-XwV0PfcC.js")),
|
|
2405
2414
|
"users-3": lazy(() => import("./4-people-BTQ6Okmp.js")),
|
|
2406
2415
|
warning: lazy(() => import("./warning-filled-Od0v7tGX.js")),
|
|
2407
|
-
wrong: lazy(() => import("./cross-circle-fill-BafKD3Av.js")),
|
|
2408
2416
|
// images
|
|
2409
2417
|
"document-blurred": lazy(() => import("./document-blurred-gtj03M4x.js")),
|
|
2410
2418
|
"document-cutoff": lazy(() => import("./document-cut-off-D2vCeeIS.js")),
|
|
@@ -2434,7 +2442,7 @@ const svgs = {
|
|
|
2434
2442
|
"plaid-logo": lazy(() => import("./plaid-logo-4nYeR9iX.js")),
|
|
2435
2443
|
"trustly-logo": lazy(() => import("./trustly-logo-YJslAOYF.js"))
|
|
2436
2444
|
};
|
|
2437
|
-
const unscalableIconNames = ["
|
|
2445
|
+
const unscalableIconNames = ["bin", "check", "checkmark", "checkmark-small", "chevron-right", "chevron-left", "company", "contract", "cross", "decision-maker", "document", "download", "edit", "info-circle", "image", "location", "payout", "pci", "plus", "remove", "save", "search", "trust", "user", "upload", "warning"];
|
|
2438
2446
|
const logger$D = createLogger("Icon");
|
|
2439
2447
|
const Svg = ({
|
|
2440
2448
|
className,
|
|
@@ -2450,7 +2458,7 @@ const Svg = ({
|
|
|
2450
2458
|
return null;
|
|
2451
2459
|
}
|
|
2452
2460
|
return jsx("span", {
|
|
2453
|
-
className: cx(`adyen-kyc-${type}
|
|
2461
|
+
className: cx(`adyen-kyc-${type}`, className),
|
|
2454
2462
|
"data-testid": testId,
|
|
2455
2463
|
children: jsx(Suspense, {
|
|
2456
2464
|
fallback: null,
|
|
@@ -2733,15 +2741,6 @@ function useFormRouterContext() {
|
|
|
2733
2741
|
return context;
|
|
2734
2742
|
}
|
|
2735
2743
|
const logger$C = createLogger("Link");
|
|
2736
|
-
const getIconClass = (icon, external) => {
|
|
2737
|
-
if (external) {
|
|
2738
|
-
return "adyen-kyc-link__icon adyen-kyc-icon-external-link";
|
|
2739
|
-
}
|
|
2740
|
-
if (icon) {
|
|
2741
|
-
return `adyen-kyc-link__icon`;
|
|
2742
|
-
}
|
|
2743
|
-
return null;
|
|
2744
|
-
};
|
|
2745
2744
|
const isValidLink = (href) => {
|
|
2746
2745
|
if (href === "#") {
|
|
2747
2746
|
logger$C.error('Links must include a valid href. If your href is "#", consider using a Button instead');
|
|
@@ -2762,7 +2761,6 @@ const Link = ({
|
|
|
2762
2761
|
const target = external ? "_blank" : "_self";
|
|
2763
2762
|
const rel = external ? "external noopener noreferrer" : void 0;
|
|
2764
2763
|
const showIcon = icon || external;
|
|
2765
|
-
const iconClass = showIcon && getIconClass(icon, external);
|
|
2766
2764
|
const classNames = showAsButton ? cx("adyen-kyc-button", className, {
|
|
2767
2765
|
"adyen-kyc-button--icon": showIcon
|
|
2768
2766
|
}) : cx("adyen-kyc-link", className, {
|
|
@@ -2777,9 +2775,9 @@ const Link = ({
|
|
|
2777
2775
|
children: [jsx("span", {
|
|
2778
2776
|
className: "adyen-kyc-link__text adyen-kyc-link--inherit",
|
|
2779
2777
|
children
|
|
2780
|
-
}), showIcon && icon &&
|
|
2778
|
+
}), showIcon && icon && jsx(Icon, {
|
|
2781
2779
|
name: icon,
|
|
2782
|
-
className:
|
|
2780
|
+
className: "adyen-kyc-link__icon"
|
|
2783
2781
|
})]
|
|
2784
2782
|
});
|
|
2785
2783
|
};
|
|
@@ -2884,7 +2882,7 @@ function getFormProps(props, innerFormId) {
|
|
|
2884
2882
|
return null;
|
|
2885
2883
|
}
|
|
2886
2884
|
const activeFormId = (_a = props.activeForm) == null ? void 0 : _a.formId;
|
|
2887
|
-
const
|
|
2885
|
+
const trustedFields = ((_b = props.trustedFields) == null ? void 0 : _b[innerFormId]) ?? [];
|
|
2888
2886
|
const readOnlyFields = ((_c = props.readOnlyFields) == null ? void 0 : _c[innerFormId]) ?? [];
|
|
2889
2887
|
return {
|
|
2890
2888
|
placeholders: ((_d = props.placeholders) == null ? void 0 : _d[innerFormId]) ?? {},
|
|
@@ -2893,12 +2891,12 @@ function getFormProps(props, innerFormId) {
|
|
|
2893
2891
|
masks: ((_g = props.masks) == null ? void 0 : _g[innerFormId]) ?? {},
|
|
2894
2892
|
data: ((_h = props.data) == null ? void 0 : _h[innerFormId]) ?? {},
|
|
2895
2893
|
allFields: ((_i = props.allFields) == null ? void 0 : _i[innerFormId]) ?? [],
|
|
2896
|
-
readOnlyFields: [...readOnlyFields, ...
|
|
2894
|
+
readOnlyFields: [...readOnlyFields, ...trustedFields],
|
|
2897
2895
|
requiredFields: ((_j = props.requiredFields) == null ? void 0 : _j[innerFormId]) ?? [],
|
|
2898
2896
|
optionalFields: ((_k = props.optionalFields) == null ? void 0 : _k[innerFormId]) ?? [],
|
|
2899
2897
|
obscuredFields: ((_l = props.obscuredFields) == null ? void 0 : _l[innerFormId]) ?? [],
|
|
2900
2898
|
verifyFields: ((_m = props.verifyFields) == null ? void 0 : _m[innerFormId]) ?? [],
|
|
2901
|
-
trustedFields
|
|
2899
|
+
trustedFields,
|
|
2902
2900
|
trustedFieldsProvider: props.trustedFields,
|
|
2903
2901
|
formVerificationErrors: ((_o = (_n = props.problems) == null ? void 0 : _n.verificationErrors) == null ? void 0 : _o[innerFormId]) ?? {},
|
|
2904
2902
|
fieldValidationErrors: ((_q = (_p = props.problems) == null ? void 0 : _p.validationErrors) == null ? void 0 : _q[innerFormId]) ?? {},
|
|
@@ -2934,7 +2932,7 @@ function getNestedOuterFormPropsFromOuterFormProps(props, innerFormId) {
|
|
|
2934
2932
|
optionalFields,
|
|
2935
2933
|
obscuredFields,
|
|
2936
2934
|
verifyFields,
|
|
2937
|
-
trustedFields
|
|
2935
|
+
trustedFields,
|
|
2938
2936
|
problems,
|
|
2939
2937
|
validators: validators2,
|
|
2940
2938
|
shouldValidate
|
|
@@ -2951,7 +2949,7 @@ function getNestedOuterFormPropsFromOuterFormProps(props, innerFormId) {
|
|
|
2951
2949
|
optionalFields,
|
|
2952
2950
|
obscuredFields,
|
|
2953
2951
|
verifyFields,
|
|
2954
|
-
trustedFields
|
|
2952
|
+
trustedFields,
|
|
2955
2953
|
// the rest we just pass along for now, as they will be eventually be processed by getFormProps
|
|
2956
2954
|
problems,
|
|
2957
2955
|
validators: validators2,
|
|
@@ -3161,7 +3159,7 @@ function init({
|
|
|
3161
3159
|
fieldProblems,
|
|
3162
3160
|
obscuredFields,
|
|
3163
3161
|
optionalFields,
|
|
3164
|
-
trustedFields
|
|
3162
|
+
trustedFields,
|
|
3165
3163
|
formatters,
|
|
3166
3164
|
staticValidate,
|
|
3167
3165
|
asyncValidate
|
|
@@ -3178,7 +3176,7 @@ function init({
|
|
|
3178
3176
|
data: defaultData,
|
|
3179
3177
|
obscuredFields,
|
|
3180
3178
|
optionalFields,
|
|
3181
|
-
trustedFields
|
|
3179
|
+
trustedFields
|
|
3182
3180
|
}
|
|
3183
3181
|
},
|
|
3184
3182
|
staticValidate,
|
|
@@ -3234,7 +3232,7 @@ function init({
|
|
|
3234
3232
|
fieldProblems: {},
|
|
3235
3233
|
obscuredFields,
|
|
3236
3234
|
optionalFields,
|
|
3237
|
-
trustedFields
|
|
3235
|
+
trustedFields
|
|
3238
3236
|
});
|
|
3239
3237
|
return formData;
|
|
3240
3238
|
}
|
|
@@ -3243,7 +3241,7 @@ function reducer({
|
|
|
3243
3241
|
asyncValidate,
|
|
3244
3242
|
obscuredFields,
|
|
3245
3243
|
optionalFields,
|
|
3246
|
-
trustedFields
|
|
3244
|
+
trustedFields,
|
|
3247
3245
|
formatters
|
|
3248
3246
|
}) {
|
|
3249
3247
|
return (state, {
|
|
@@ -3315,7 +3313,7 @@ function reducer({
|
|
|
3315
3313
|
fieldProblems,
|
|
3316
3314
|
obscuredFields,
|
|
3317
3315
|
optionalFields,
|
|
3318
|
-
trustedFields
|
|
3316
|
+
trustedFields,
|
|
3319
3317
|
staticValidate,
|
|
3320
3318
|
asyncValidate
|
|
3321
3319
|
});
|
|
@@ -3349,7 +3347,7 @@ function reducer({
|
|
|
3349
3347
|
fieldProblems: updatedFieldProblems,
|
|
3350
3348
|
obscuredFields,
|
|
3351
3349
|
optionalFields,
|
|
3352
|
-
trustedFields
|
|
3350
|
+
trustedFields,
|
|
3353
3351
|
local
|
|
3354
3352
|
};
|
|
3355
3353
|
}
|
|
@@ -3543,7 +3541,7 @@ function useForm({
|
|
|
3543
3541
|
fieldProblems,
|
|
3544
3542
|
obscuredFields,
|
|
3545
3543
|
optionalFields,
|
|
3546
|
-
trustedFields
|
|
3544
|
+
trustedFields,
|
|
3547
3545
|
formatters,
|
|
3548
3546
|
shouldValidate = false
|
|
3549
3547
|
}) {
|
|
@@ -3561,20 +3559,20 @@ function useForm({
|
|
|
3561
3559
|
asyncValidate: triggerAsyncValidation,
|
|
3562
3560
|
obscuredFields,
|
|
3563
3561
|
optionalFields,
|
|
3564
|
-
trustedFields
|
|
3562
|
+
trustedFields,
|
|
3565
3563
|
formatters
|
|
3566
|
-
}), [triggerStaticValidation, triggerAsyncValidation, obscuredFields, optionalFields,
|
|
3564
|
+
}), [triggerStaticValidation, triggerAsyncValidation, obscuredFields, optionalFields, trustedFields, formatters]);
|
|
3567
3565
|
const initialData = useMemo(() => ({
|
|
3568
3566
|
schema: getSchema,
|
|
3569
3567
|
defaultData,
|
|
3570
3568
|
fieldProblems,
|
|
3571
3569
|
obscuredFields,
|
|
3572
3570
|
optionalFields,
|
|
3573
|
-
trustedFields
|
|
3571
|
+
trustedFields,
|
|
3574
3572
|
formatters,
|
|
3575
3573
|
staticValidate: triggerStaticValidation,
|
|
3576
3574
|
asyncValidate: triggerAsyncValidation
|
|
3577
|
-
}), [getSchema, defaultData, fieldProblems, obscuredFields, optionalFields,
|
|
3575
|
+
}), [getSchema, defaultData, fieldProblems, obscuredFields, optionalFields, trustedFields, formatters, triggerStaticValidation, triggerAsyncValidation]);
|
|
3578
3576
|
const [state, dispatch] = useReducer(getReducer(), initialData, init);
|
|
3579
3577
|
const isValid = useMemo(() => {
|
|
3580
3578
|
var _a;
|
|
@@ -11874,10 +11872,10 @@ const LABELS = {
|
|
|
11874
11872
|
},
|
|
11875
11873
|
otherAddressInformation: {
|
|
11876
11874
|
default: OTHER_ADDRESS_INFORMATION,
|
|
11877
|
-
[CountryCodes.Canada]: "
|
|
11878
|
-
[CountryCodes.PuertoRico]: "
|
|
11875
|
+
[CountryCodes.Canada]: "apartmentSuiteOther",
|
|
11876
|
+
[CountryCodes.PuertoRico]: "apartmentSuiteOther",
|
|
11879
11877
|
// should exactly match CountryCodes.UnitedStates
|
|
11880
|
-
[CountryCodes.UnitedStates]: "
|
|
11878
|
+
[CountryCodes.UnitedStates]: "apartmentSuiteOther"
|
|
11881
11879
|
},
|
|
11882
11880
|
postalCode: {
|
|
11883
11881
|
default: POSTAL_CODE,
|
|
@@ -11906,13 +11904,17 @@ const LABELS = {
|
|
|
11906
11904
|
};
|
|
11907
11905
|
const getKeyForField = (fieldName, country) => country ? LABELS[fieldName][country] || LABELS[fieldName].default : LABELS[fieldName].default;
|
|
11908
11906
|
const getAddressSchemaForCountry = (country) => ADDRESS_SCHEMAS[country] || ADDRESS_SCHEMAS.default;
|
|
11907
|
+
const getAddressSchemaLabelsByCountry = (country) => {
|
|
11908
|
+
const schema = getAddressSchemaForCountry(country);
|
|
11909
|
+
return schema.reduce((labels2, field) => ({
|
|
11910
|
+
...labels2,
|
|
11911
|
+
[field]: getKeyForField(field, country)
|
|
11912
|
+
}), {});
|
|
11913
|
+
};
|
|
11909
11914
|
const mapAddressLabels = (data, datasetUtils) => {
|
|
11910
|
-
|
|
11911
|
-
country
|
|
11912
|
-
} = data;
|
|
11913
|
-
if (country) {
|
|
11915
|
+
if (data == null ? void 0 : data.country) {
|
|
11914
11916
|
return Object.entries(data).reduce((mappedAddress, [field, value]) => {
|
|
11915
|
-
const mappedKey = getKeyForField(field, country);
|
|
11917
|
+
const mappedKey = getKeyForField(field, data.country);
|
|
11916
11918
|
switch (field) {
|
|
11917
11919
|
case "country":
|
|
11918
11920
|
return {
|
|
@@ -11922,7 +11924,7 @@ const mapAddressLabels = (data, datasetUtils) => {
|
|
|
11922
11924
|
case "stateOrProvince":
|
|
11923
11925
|
return {
|
|
11924
11926
|
...mappedAddress,
|
|
11925
|
-
[mappedKey]: datasetUtils.getStateName(value, country)
|
|
11927
|
+
[mappedKey]: datasetUtils.getStateName(value, data.country)
|
|
11926
11928
|
};
|
|
11927
11929
|
default:
|
|
11928
11930
|
return {
|
|
@@ -11988,7 +11990,8 @@ function FieldContainer(props) {
|
|
|
11988
11990
|
hideField,
|
|
11989
11991
|
maxlength,
|
|
11990
11992
|
handleChangeFor,
|
|
11991
|
-
readOnly
|
|
11993
|
+
readOnly,
|
|
11994
|
+
optional
|
|
11992
11995
|
} = props;
|
|
11993
11996
|
const formUtils = formUtilities(props, i18n);
|
|
11994
11997
|
const errorMessage = formUtils.getErrorMessage(fieldName, errors, fieldProblems);
|
|
@@ -12008,7 +12011,7 @@ function FieldContainer(props) {
|
|
|
12008
12011
|
country: errorMessage
|
|
12009
12012
|
},
|
|
12010
12013
|
labels: {
|
|
12011
|
-
country: formUtils.getLabel(field)
|
|
12014
|
+
country: formUtils.getLabel(field, labelKey)
|
|
12012
12015
|
},
|
|
12013
12016
|
readonly: readOnly,
|
|
12014
12017
|
classNameModifiers,
|
|
@@ -12027,7 +12030,7 @@ function FieldContainer(props) {
|
|
|
12027
12030
|
stateOrProvince: errorMessage
|
|
12028
12031
|
},
|
|
12029
12032
|
labels: {
|
|
12030
|
-
stateOrProvince: formUtils.getLabel(field)
|
|
12033
|
+
stateOrProvince: formUtils.getLabel(field, labelKey)
|
|
12031
12034
|
},
|
|
12032
12035
|
readonly: readOnly,
|
|
12033
12036
|
classNameModifiers,
|
|
@@ -12041,6 +12044,7 @@ function FieldContainer(props) {
|
|
|
12041
12044
|
classNameModifiers,
|
|
12042
12045
|
errorMessage,
|
|
12043
12046
|
isValid: valid[field],
|
|
12047
|
+
optional,
|
|
12044
12048
|
children: (childProps) => jsx(InputText, {
|
|
12045
12049
|
...childProps,
|
|
12046
12050
|
classNameModifiers,
|
|
@@ -12622,7 +12626,11 @@ const addressValidationRulesV4 = (country, i18n) => {
|
|
|
12622
12626
|
errorMessage: "fieldIsRequired"
|
|
12623
12627
|
}, {
|
|
12624
12628
|
modes: ["blur"],
|
|
12625
|
-
validate: (
|
|
12629
|
+
validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
|
|
12630
|
+
errorMessage: "nameMustContainLetters"
|
|
12631
|
+
}, {
|
|
12632
|
+
modes: ["blur"],
|
|
12633
|
+
validate: (val) => !matchesRegex(EMOJI_REGEX, val) && !hasRepeatedCharacters(val) && !isInvalidName(val) && matchesRegex(INDIVIDUAL_VALID_CHAR_REGEX, val),
|
|
12626
12634
|
errorMessage: "checkForTypos"
|
|
12627
12635
|
}, {
|
|
12628
12636
|
modes: ["blur"],
|
|
@@ -12654,7 +12662,11 @@ const addressValidationRulesV4 = (country, i18n) => {
|
|
|
12654
12662
|
errorMessage: "fieldIsRequired"
|
|
12655
12663
|
}, {
|
|
12656
12664
|
modes: ["blur"],
|
|
12657
|
-
validate: (
|
|
12665
|
+
validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
|
|
12666
|
+
errorMessage: "nameMustContainLetters"
|
|
12667
|
+
}, {
|
|
12668
|
+
modes: ["blur"],
|
|
12669
|
+
validate: (val) => !matchesRegex(EMOJI_REGEX, val) && !hasRepeatedCharacters(val) && !isInvalidName(val) && matchesRegex(INDIVIDUAL_VALID_CHAR_REGEX, val),
|
|
12658
12670
|
errorMessage: "checkForTypos"
|
|
12659
12671
|
}, {
|
|
12660
12672
|
modes: ["blur"],
|
|
@@ -12671,6 +12683,10 @@ const addressValidationRulesV4 = (country, i18n) => {
|
|
|
12671
12683
|
modes: ["blur"],
|
|
12672
12684
|
validate: (val) => !!val,
|
|
12673
12685
|
errorMessage: "fieldIsRequired"
|
|
12686
|
+
}, {
|
|
12687
|
+
modes: ["blur"],
|
|
12688
|
+
validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
|
|
12689
|
+
errorMessage: "nameMustContainLetters"
|
|
12674
12690
|
}, {
|
|
12675
12691
|
modes: ["blur"],
|
|
12676
12692
|
validate: (val) => !hasRepeatedCharacters(val) && !isInvalidName(val),
|
|
@@ -12682,7 +12698,11 @@ const addressValidationRulesV4 = (country, i18n) => {
|
|
|
12682
12698
|
errorMessage: "fieldIsRequired"
|
|
12683
12699
|
}, {
|
|
12684
12700
|
modes: ["blur"],
|
|
12685
|
-
validate: (
|
|
12701
|
+
validate: (input) => !matchesRegex(NO_ALPHABET_REGEX, input),
|
|
12702
|
+
errorMessage: "nameMustContainLetters"
|
|
12703
|
+
}, {
|
|
12704
|
+
modes: ["blur"],
|
|
12705
|
+
validate: (val) => !matchesRegex(EMOJI_REGEX, val) && !hasRepeatedCharacters(val) && !isInvalidName(val) && matchesRegex(INDIVIDUAL_VALID_CHAR_REGEX, val),
|
|
12686
12706
|
errorMessage: "checkForTypos"
|
|
12687
12707
|
}]
|
|
12688
12708
|
};
|
|
@@ -12691,6 +12711,7 @@ function Address(props) {
|
|
|
12691
12711
|
const {
|
|
12692
12712
|
data: dataProp,
|
|
12693
12713
|
requiredFields: requiredFieldsProp,
|
|
12714
|
+
optionalFields: optionalFieldsProp = ["otherAddressInformation"],
|
|
12694
12715
|
fieldValidationErrors: fieldValidationErrorsProp,
|
|
12695
12716
|
formVerificationErrors: formVerificationErrorsProp,
|
|
12696
12717
|
legalEntityId,
|
|
@@ -12741,11 +12762,13 @@ function Address(props) {
|
|
|
12741
12762
|
formatters: addressFormatters,
|
|
12742
12763
|
rules: isStrictNameAndAddressValidationEnabled ? rulesV4 : rules2,
|
|
12743
12764
|
fieldProblems: fieldValidationErrorsProp,
|
|
12765
|
+
optionalFields: optionalFieldsProp,
|
|
12744
12766
|
obscuredFields: []
|
|
12745
12767
|
});
|
|
12746
12768
|
const formUtils = formUtilities({
|
|
12747
12769
|
...props,
|
|
12748
|
-
requiredFields
|
|
12770
|
+
requiredFields,
|
|
12771
|
+
optionalFields: optionalFieldsProp
|
|
12749
12772
|
}, i18n);
|
|
12750
12773
|
useEffect(() => {
|
|
12751
12774
|
if (dataProp.country !== data.country && dataProp.country) {
|
|
@@ -12842,7 +12865,7 @@ function Address(props) {
|
|
|
12842
12865
|
}
|
|
12843
12866
|
}, [canAutofillVerifiedBusinessAddress, verifiedBusiness]);
|
|
12844
12867
|
const getComponent = (fieldName) => {
|
|
12845
|
-
if (!formUtils.isRequiredField(fieldName)) return null;
|
|
12868
|
+
if (!formUtils.isRequiredField(fieldName) && !formUtils.isOptionalField(fieldName)) return null;
|
|
12846
12869
|
const hideField = fieldName === "country" && hideCountry;
|
|
12847
12870
|
return jsx(FieldContainer, {
|
|
12848
12871
|
classNameModifiers: [fieldName],
|
|
@@ -12856,6 +12879,7 @@ function Address(props) {
|
|
|
12856
12879
|
hideField,
|
|
12857
12880
|
"aria-label": formUtils.getLabel(fieldName, fieldName),
|
|
12858
12881
|
readOnly: formUtils.isReadOnly(fieldName),
|
|
12882
|
+
optional: formUtils.isOptionalField(fieldName),
|
|
12859
12883
|
trimOnBlur: true
|
|
12860
12884
|
}, fieldName);
|
|
12861
12885
|
};
|
|
@@ -13903,32 +13927,30 @@ const businessDetailsBaseMapping = {
|
|
|
13903
13927
|
"basicInformation.stateOrProvince": "organization.registeredAddress.stateOrProvince",
|
|
13904
13928
|
"basicInformation.registrationNumber": "organization.registrationNumber",
|
|
13905
13929
|
"basicInformation.taxInformation": "organization.taxInformation",
|
|
13906
|
-
"basicInformation.isUen": "organization.isUen",
|
|
13907
13930
|
"companyStructure.entityType": "organization.type",
|
|
13908
13931
|
"additionalInformation.legalCompanyName": "organization.legalName",
|
|
13909
13932
|
"additionalInformation.legalFormDescription": "organization.legalFormDescription",
|
|
13910
13933
|
"additionalInformation.dbaName": "organization.doingBusinessAs",
|
|
13911
13934
|
"additionalInformation.registrationNumber": "organization.registrationNumber",
|
|
13912
13935
|
"additionalInformation.taxInformation": "organization.taxInformation",
|
|
13913
|
-
"additionalInformation.isUen": "organization.isUen",
|
|
13914
13936
|
"additionalInformation.vatNumber": "organization.vatNumber",
|
|
13915
13937
|
"additionalInformation.vatAbsenceReason": "organization.vatAbsenceReason",
|
|
13916
13938
|
"additionalInformation.dateOfIncorporation": "organization.dateOfIncorporation",
|
|
13917
13939
|
"additionalInformation.stockExchangeMIC": "organization.stockData.marketIdentifier",
|
|
13918
13940
|
"additionalInformation.stockISIN": "organization.stockData.stockNumber",
|
|
13919
13941
|
"additionalInformation.stockTickerSymbol": "organization.stockData.tickerSymbol",
|
|
13920
|
-
"
|
|
13921
|
-
"
|
|
13922
|
-
"
|
|
13923
|
-
"
|
|
13924
|
-
"
|
|
13925
|
-
"
|
|
13926
|
-
"
|
|
13927
|
-
"
|
|
13928
|
-
"
|
|
13929
|
-
"
|
|
13930
|
-
"
|
|
13931
|
-
"
|
|
13942
|
+
"additionalInformation.registrationAddress.city": "organization.registeredAddress.city",
|
|
13943
|
+
"additionalInformation.registrationAddress.country": "organization.registeredAddress.country",
|
|
13944
|
+
"additionalInformation.registrationAddress.postalCode": "organization.registeredAddress.postalCode",
|
|
13945
|
+
"additionalInformation.registrationAddress.stateOrProvince": "organization.registeredAddress.stateOrProvince",
|
|
13946
|
+
"additionalInformation.registrationAddress.address": "organization.registeredAddress.street",
|
|
13947
|
+
"additionalInformation.registrationAddress.otherAddressInformation": "organization.registeredAddress.street2",
|
|
13948
|
+
"additionalInformation.operationalAddress.city": "organization.principalPlaceOfBusiness.city",
|
|
13949
|
+
"additionalInformation.operationalAddress.country": "organization.principalPlaceOfBusiness.country",
|
|
13950
|
+
"additionalInformation.operationalAddress.postalCode": "organization.principalPlaceOfBusiness.postalCode",
|
|
13951
|
+
"additionalInformation.operationalAddress.stateOrProvince": "organization.principalPlaceOfBusiness.stateOrProvince",
|
|
13952
|
+
"additionalInformation.operationalAddress.address": "organization.principalPlaceOfBusiness.street",
|
|
13953
|
+
"additionalInformation.operationalAddress.otherAddressInformation": "organization.principalPlaceOfBusiness.street2"
|
|
13932
13954
|
};
|
|
13933
13955
|
const companyBaseMapping = {
|
|
13934
13956
|
"companyNameAndCountry.country": "organization.registeredAddress.country",
|
|
@@ -13941,7 +13963,6 @@ const companyBaseMapping = {
|
|
|
13941
13963
|
"companyRegistrationDetails.vatNumber": "organization.vatNumber",
|
|
13942
13964
|
"companyRegistrationDetails.vatAbsenceReason": "organization.vatAbsenceReason",
|
|
13943
13965
|
"companyRegistrationDetails.dateOfIncorporation": "organization.dateOfIncorporation",
|
|
13944
|
-
"companyRegistrationDetails.isUen": "organization.isUen",
|
|
13945
13966
|
"companyRegistrationDetails.stockExchangeMIC": "organization.stockData.marketIdentifier",
|
|
13946
13967
|
"companyRegistrationDetails.stockISIN": "organization.stockData.stockNumber",
|
|
13947
13968
|
"companyRegistrationDetails.stockTickerSymbol": "organization.stockData.tickerSymbol",
|
|
@@ -13982,7 +14003,6 @@ const companySearchBaseMapping = {
|
|
|
13982
14003
|
"companyOtherDetails.vatNumber": "organization.vatNumber",
|
|
13983
14004
|
"companyOtherDetails.vatAbsenceReason": "organization.vatAbsenceReason",
|
|
13984
14005
|
"companyOtherDetails.dateOfIncorporation": "organization.dateOfIncorporation",
|
|
13985
|
-
"companyOtherDetails.isUen": "organization.isUen",
|
|
13986
14006
|
"companyOtherDetails.stockExchangeMIC": "organization.stockData.marketIdentifier",
|
|
13987
14007
|
"companyOtherDetails.stockISIN": "organization.stockData.stockNumber",
|
|
13988
14008
|
"companyOtherDetails.stockTickerSymbol": "organization.stockData.tickerSymbol"
|
|
@@ -14338,23 +14358,23 @@ const mapLegalEntityToCompany = (legalEntity, isChangingType, accountHolder) =>
|
|
|
14338
14358
|
return companyCompData;
|
|
14339
14359
|
};
|
|
14340
14360
|
const mapCompanyToLegalEntity = (data) => {
|
|
14341
|
-
var _a, _b, _c, _d, _e, _f;
|
|
14361
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
14342
14362
|
const requestObj = {
|
|
14343
14363
|
...formatObject(data, companyApiKeyMapping)
|
|
14344
14364
|
};
|
|
14345
14365
|
if (requestObj.organization.vatAbsenceReason) {
|
|
14346
14366
|
requestObj.organization.vatNumber = "";
|
|
14347
14367
|
}
|
|
14348
|
-
const taxId = (_a = data.companyRegistrationDetails.taxInformation) == null ? void 0 : _a.find((tax) => {
|
|
14368
|
+
const taxId = (_b = (_a = data.companyRegistrationDetails.taxInformation) == null ? void 0 : _a.find((tax) => {
|
|
14349
14369
|
var _a2;
|
|
14350
14370
|
return tax.country === ((_a2 = data.companyNameAndCountry) == null ? void 0 : _a2.country);
|
|
14351
|
-
}).number;
|
|
14352
|
-
if (taxId || ((
|
|
14371
|
+
})) == null ? void 0 : _b.number;
|
|
14372
|
+
if (taxId || ((_c = data.companyRegistrationDetails) == null ? void 0 : _c.isUen)) {
|
|
14353
14373
|
requestObj.organization = updateTaxInformation({
|
|
14354
|
-
taxId: ((
|
|
14355
|
-
country: (
|
|
14356
|
-
exemptedFromTax: (
|
|
14357
|
-
isUen: (
|
|
14374
|
+
taxId: ((_d = data.companyRegistrationDetails) == null ? void 0 : _d.isUen) ? data.companyRegistrationDetails.registrationNumber : taxId,
|
|
14375
|
+
country: (_e = data.companyNameAndCountry) == null ? void 0 : _e.country,
|
|
14376
|
+
exemptedFromTax: (_f = data.companyRegistrationDetails) == null ? void 0 : _f.exemptedFromTax,
|
|
14377
|
+
isUen: (_g = data.companyRegistrationDetails) == null ? void 0 : _g.isUen,
|
|
14358
14378
|
entity: requestObj.organization
|
|
14359
14379
|
});
|
|
14360
14380
|
}
|
|
@@ -16510,7 +16530,8 @@ const DecisionMakerRoleComponent = (props) => {
|
|
|
16510
16530
|
validators: validators2,
|
|
16511
16531
|
fieldValidationErrors,
|
|
16512
16532
|
requiredFields,
|
|
16513
|
-
allowedRoles
|
|
16533
|
+
allowedRoles,
|
|
16534
|
+
trustedRoles
|
|
16514
16535
|
} = props;
|
|
16515
16536
|
const {
|
|
16516
16537
|
i18n
|
|
@@ -16568,7 +16589,7 @@ const DecisionMakerRoleComponent = (props) => {
|
|
|
16568
16589
|
onSelect: changeRoles,
|
|
16569
16590
|
mapToSelectItem: (role) => ({
|
|
16570
16591
|
...makeSelectItemForRole(role, i18n),
|
|
16571
|
-
disabled: !(allowedRoles == null ? void 0 : allowedRoles.includes(role))
|
|
16592
|
+
disabled: allowedRoles ? !(allowedRoles == null ? void 0 : allowedRoles.includes(role)) : trustedRoles.includes(role)
|
|
16572
16593
|
})
|
|
16573
16594
|
})
|
|
16574
16595
|
})]
|
|
@@ -17464,10 +17485,13 @@ function PersonalDetailsComponent(props) {
|
|
|
17464
17485
|
isExperimentEnabled
|
|
17465
17486
|
} = useExperimentsContext();
|
|
17466
17487
|
const isAgeVerificationEnabled = isExperimentEnabled("EnableAgeVerification");
|
|
17467
|
-
const PERSONAL_DETAILS = props.id;
|
|
17468
17488
|
const {
|
|
17469
|
-
|
|
17470
|
-
|
|
17489
|
+
id: PERSONAL_DETAILS,
|
|
17490
|
+
trustedRoles,
|
|
17491
|
+
data: {
|
|
17492
|
+
residencyCountry
|
|
17493
|
+
}
|
|
17494
|
+
} = props;
|
|
17471
17495
|
const [externalErrors, setExternalErrors] = useState(null);
|
|
17472
17496
|
const [status, setStatus] = useState("success");
|
|
17473
17497
|
const stateRef = useRef({
|
|
@@ -17646,7 +17670,8 @@ function PersonalDetailsComponent(props) {
|
|
|
17646
17670
|
...decisionMakerRoleProps,
|
|
17647
17671
|
taskType: props.taskType,
|
|
17648
17672
|
dataStoreId: PERSONAL_DETAILS,
|
|
17649
|
-
allowedRoles: props == null ? void 0 : props.allowedRoles
|
|
17673
|
+
allowedRoles: props == null ? void 0 : props.allowedRoles,
|
|
17674
|
+
trustedRoles
|
|
17650
17675
|
}), hasRequiredFields(nameProps) && jsx(Name, {
|
|
17651
17676
|
...nameProps,
|
|
17652
17677
|
dataStoreId: PERSONAL_DETAILS
|
|
@@ -18097,7 +18122,8 @@ function IndividualComponent(props) {
|
|
|
18097
18122
|
allowedRoles: props == null ? void 0 : props.allowedRoles,
|
|
18098
18123
|
capabilities: props.capabilities,
|
|
18099
18124
|
parentLegalEntity: props.parentLegalEntity,
|
|
18100
|
-
trustedFieldsProvider: props.trustedFieldsProvider
|
|
18125
|
+
trustedFieldsProvider: props.trustedFieldsProvider,
|
|
18126
|
+
trustedRoles: props.trustedRoles
|
|
18101
18127
|
})
|
|
18102
18128
|
}), jsx("div", {
|
|
18103
18129
|
className: activeForm.formId !== addressFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
|
|
@@ -19558,12 +19584,9 @@ function BankVerification(props) {
|
|
|
19558
19584
|
heading
|
|
19559
19585
|
}), jsxs("div", {
|
|
19560
19586
|
className: "adyen-kyc-bank-verification-success",
|
|
19561
|
-
children: [jsx(
|
|
19562
|
-
|
|
19563
|
-
|
|
19564
|
-
role: "img",
|
|
19565
|
-
"aria-hidden": "true"
|
|
19566
|
-
})
|
|
19587
|
+
children: [jsx(Icon, {
|
|
19588
|
+
name: "check",
|
|
19589
|
+
className: "adyen-kyc-u-margin-x-24"
|
|
19567
19590
|
}), jsxs("span", {
|
|
19568
19591
|
children: [" ", i18n.get("youSuccessfullyVerifiedAccount")]
|
|
19569
19592
|
})]
|
|
@@ -22525,7 +22548,7 @@ const entityProblemInitialState = {
|
|
|
22525
22548
|
// default status - if the entity is not listed in the problems array
|
|
22526
22549
|
validationErrors: {}
|
|
22527
22550
|
};
|
|
22528
|
-
const UNRELATED_DATA_MISSING_ERROR_CODES = ["2_8036", "2_8064", "2_8067", "2_8183", "2_8189"];
|
|
22551
|
+
const UNRELATED_DATA_MISSING_ERROR_CODES = ["2_8036", "2_8064", "2_8067", "2_8183", "2_8189", "2_8190", "2_8191", "2_8193"];
|
|
22529
22552
|
const UNRELATED_INVALID_INPUT_ERROR_CODES = ["1_14", "2_901", "2_902"];
|
|
22530
22553
|
function getCapabilityProblems(response, country, isExperimentEnabled) {
|
|
22531
22554
|
const capabilities = (response == null ? void 0 : response.capabilities) || {};
|
|
@@ -23667,7 +23690,7 @@ function getPropsFromConfigurations(scenarioConfiguration, forms2, remediationAc
|
|
|
23667
23690
|
const masks = {};
|
|
23668
23691
|
const validators2 = {};
|
|
23669
23692
|
const obscuredFields = {};
|
|
23670
|
-
const
|
|
23693
|
+
const trustedFields = {};
|
|
23671
23694
|
if (!scenarioConfiguration) {
|
|
23672
23695
|
return;
|
|
23673
23696
|
}
|
|
@@ -23703,7 +23726,7 @@ function getPropsFromConfigurations(scenarioConfiguration, forms2, remediationAc
|
|
|
23703
23726
|
}
|
|
23704
23727
|
const isFieldTrusted = isTrustedField(trustedMappings, formId, field);
|
|
23705
23728
|
if (isFieldTrusted) {
|
|
23706
|
-
|
|
23729
|
+
trustedFields[formId] = trustedFields[formId] ? [...trustedFields[formId], field] : [field];
|
|
23707
23730
|
}
|
|
23708
23731
|
if (fieldConfigurations) {
|
|
23709
23732
|
const customLabel = (_a3 = customLabels2 == null ? void 0 : customLabels2[field]) == null ? void 0 : _a3.call(customLabels2);
|
|
@@ -23774,7 +23797,7 @@ function getPropsFromConfigurations(scenarioConfiguration, forms2, remediationAc
|
|
|
23774
23797
|
placeholders,
|
|
23775
23798
|
validators: validators2,
|
|
23776
23799
|
obscuredFields,
|
|
23777
|
-
trustedFields
|
|
23800
|
+
trustedFields,
|
|
23778
23801
|
helperText,
|
|
23779
23802
|
masks
|
|
23780
23803
|
};
|
|
@@ -23795,7 +23818,7 @@ const isFieldRequiredToRemediateDataMissingError = (formId, field, dataMissingEr
|
|
|
23795
23818
|
const missingAndLinkedFields = addLinkedFields(missingFields);
|
|
23796
23819
|
return missingAndLinkedFields.includes(makeTLDSFieldName(formId, field));
|
|
23797
23820
|
};
|
|
23798
|
-
const isTrustedField = (
|
|
23821
|
+
const isTrustedField = (trustedFields, formId, field) => trustedFields == null ? void 0 : trustedFields.some((trustedField) => {
|
|
23799
23822
|
const split = trustedField.split(".");
|
|
23800
23823
|
return split[0] === formId && split[split.length - 1] === field;
|
|
23801
23824
|
});
|
|
@@ -24032,11 +24055,8 @@ function VerifiedBusinessCard({
|
|
|
24032
24055
|
})]
|
|
24033
24056
|
})
|
|
24034
24057
|
}].filter((item) => !!item.value), [address, addressLink, i18n, verifiedBusiness == null ? void 0 : verifiedBusiness.legalForm]);
|
|
24035
|
-
return
|
|
24036
|
-
children:
|
|
24037
|
-
el: "h3",
|
|
24038
|
-
children: i18n.get("verifiedInformation")
|
|
24039
|
-
}), jsxs("div", {
|
|
24058
|
+
return jsx("section", {
|
|
24059
|
+
children: jsxs("div", {
|
|
24040
24060
|
className: "adyen-kyc-verified-business-card",
|
|
24041
24061
|
children: [jsx(StructuredList, {
|
|
24042
24062
|
items: baseItems
|
|
@@ -24052,11 +24072,11 @@ function VerifiedBusinessCard({
|
|
|
24052
24072
|
onClick: () => setExpanded(!expanded)
|
|
24053
24073
|
})
|
|
24054
24074
|
})]
|
|
24055
|
-
})
|
|
24075
|
+
})
|
|
24056
24076
|
});
|
|
24057
24077
|
}
|
|
24058
24078
|
const ADDITIONAL_INFORMATION_FORM_ID = "additionalInformation";
|
|
24059
|
-
const ADDITIONAL_INFORMATION_FIELDS = [...LEGAL_COMPANY_NAME_FIELD, ...DBA_NAME_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...STOCK_TICKER_SYMBOL_FIELD, "legalFormDescription"];
|
|
24079
|
+
const ADDITIONAL_INFORMATION_FIELDS = [...LEGAL_COMPANY_NAME_FIELD, ...DBA_NAME_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...STOCK_TICKER_SYMBOL_FIELD, "legalFormDescription", ...registrationAddressFields];
|
|
24060
24080
|
function AdditionalInformationComponent({
|
|
24061
24081
|
data,
|
|
24062
24082
|
labels: labels2,
|
|
@@ -24073,11 +24093,13 @@ function AdditionalInformationComponent({
|
|
|
24073
24093
|
obscuredFields,
|
|
24074
24094
|
optionalFields,
|
|
24075
24095
|
readOnlyFields,
|
|
24076
|
-
trustedFields
|
|
24096
|
+
trustedFields,
|
|
24077
24097
|
country,
|
|
24078
24098
|
companyType = CompanyTypesValue.PRIVATE_COMPANY,
|
|
24079
24099
|
verifiedBusiness,
|
|
24080
|
-
showCompanyStructure
|
|
24100
|
+
showCompanyStructure,
|
|
24101
|
+
handleAddressSearch,
|
|
24102
|
+
handleFindAddress
|
|
24081
24103
|
}) {
|
|
24082
24104
|
var _a, _b, _c, _d;
|
|
24083
24105
|
const {
|
|
@@ -24088,6 +24110,12 @@ function AdditionalInformationComponent({
|
|
|
24088
24110
|
} = useI18nContext();
|
|
24089
24111
|
const showVerified = !!verifiedBusiness;
|
|
24090
24112
|
const showStockData = companyType === CompanyTypesValue.PUBLIC_COMPANY;
|
|
24113
|
+
const ADDRESS_SCHEMA2 = getAddressSchemaForCountry(country).filter((field) => {
|
|
24114
|
+
if (!COUNTRIES_WITH_STATES_DATASET.includes(country)) {
|
|
24115
|
+
return field !== "otherAddressInformation" && field !== "stateOrProvince";
|
|
24116
|
+
}
|
|
24117
|
+
return field !== "otherAddressInformation";
|
|
24118
|
+
});
|
|
24091
24119
|
const initialFormUtilsProps = useMemo(() => ({
|
|
24092
24120
|
data,
|
|
24093
24121
|
labels: labels2,
|
|
@@ -24099,9 +24127,9 @@ function AdditionalInformationComponent({
|
|
|
24099
24127
|
readOnlyFields,
|
|
24100
24128
|
optionalFields,
|
|
24101
24129
|
obscuredFields,
|
|
24102
|
-
trustedFields
|
|
24130
|
+
trustedFields,
|
|
24103
24131
|
shouldValidate
|
|
24104
|
-
}), [data, labels2, placeholders, helperText, readOnly, allFields, requiredFields, readOnlyFields, optionalFields, obscuredFields,
|
|
24132
|
+
}), [data, labels2, placeholders, helperText, readOnly, allFields, requiredFields, readOnlyFields, optionalFields, obscuredFields, trustedFields, shouldValidate]);
|
|
24105
24133
|
const registrationNumberOptions = useMemo(() => getCompanyRegistrationNumberOptions(country, companyType), [country, companyType]);
|
|
24106
24134
|
const defaultRegistrationNumberType = (data == null ? void 0 : data.registrationNumber) ? inferCompanyRegistrationNumberType(data == null ? void 0 : data.registrationNumber, country, companyType) : registrationNumberOptions == null ? void 0 : registrationNumberOptions[0].id;
|
|
24107
24135
|
const [registrationNumberType, setRegistrationNumberType] = useState(defaultRegistrationNumberType);
|
|
@@ -24176,6 +24204,20 @@ function AdditionalInformationComponent({
|
|
|
24176
24204
|
}
|
|
24177
24205
|
}, initialFormUtilsProps);
|
|
24178
24206
|
}, [companyType, country, initialFormUtilsProps, registrationNumberType, taxIdNumberType, vatNumberType]);
|
|
24207
|
+
const mergedDefaultData = useMemo(() => {
|
|
24208
|
+
if (!verifiedBusiness) return data;
|
|
24209
|
+
return {
|
|
24210
|
+
...data,
|
|
24211
|
+
legalCompanyName: verifiedBusiness.name,
|
|
24212
|
+
registrationAddress: {
|
|
24213
|
+
address: verifiedBusiness.street,
|
|
24214
|
+
city: verifiedBusiness.city,
|
|
24215
|
+
postalCode: verifiedBusiness.zipcode,
|
|
24216
|
+
stateOrProvince: verifiedBusiness.state,
|
|
24217
|
+
country: verifiedBusiness.country
|
|
24218
|
+
}
|
|
24219
|
+
};
|
|
24220
|
+
}, [data, verifiedBusiness]);
|
|
24179
24221
|
const {
|
|
24180
24222
|
schema: formSchema,
|
|
24181
24223
|
data: formData,
|
|
@@ -24184,10 +24226,11 @@ function AdditionalInformationComponent({
|
|
|
24184
24226
|
fieldProblems: formFieldProblems,
|
|
24185
24227
|
handleChangeFor,
|
|
24186
24228
|
resetToDefaultData,
|
|
24187
|
-
setErrors
|
|
24229
|
+
setErrors,
|
|
24230
|
+
setValid
|
|
24188
24231
|
} = useForm({
|
|
24189
24232
|
schema: getFormSchema2,
|
|
24190
|
-
defaultData:
|
|
24233
|
+
defaultData: mergedDefaultData,
|
|
24191
24234
|
rules: mergedFieldProps == null ? void 0 : mergedFieldProps.validators,
|
|
24192
24235
|
optionalFields: mergedFieldProps == null ? void 0 : mergedFieldProps.optionalFields,
|
|
24193
24236
|
obscuredFields: mergedFieldProps == null ? void 0 : mergedFieldProps.obscuredFields,
|
|
@@ -24209,9 +24252,7 @@ function AdditionalInformationComponent({
|
|
|
24209
24252
|
if (verifiedBusiness && verifiedBusiness.name !== formData.legalCompanyName) return handleChangeFor("legalCompanyName")(verifiedBusiness.name);
|
|
24210
24253
|
}, [formData.legalCompanyName, verifiedBusiness, showCompanyStructure]);
|
|
24211
24254
|
useEffect(() => {
|
|
24212
|
-
if (!verifiedBusiness && !showCompanyStructure)
|
|
24213
|
-
return resetToDefaultData();
|
|
24214
|
-
}
|
|
24255
|
+
if (!verifiedBusiness && !showCompanyStructure) resetToDefaultData();
|
|
24215
24256
|
}, [verifiedBusiness]);
|
|
24216
24257
|
const showField = (fieldKeys) => fieldKeys.some((field) => {
|
|
24217
24258
|
switch (field) {
|
|
@@ -24222,6 +24263,15 @@ function AdditionalInformationComponent({
|
|
|
24222
24263
|
return formUtils.isRequiredField(field) || formUtils.isOptionalField(field);
|
|
24223
24264
|
}
|
|
24224
24265
|
});
|
|
24266
|
+
const handleRegistrationAddressChange = (state) => {
|
|
24267
|
+
handleChangeFor("registrationAddress")(state.data);
|
|
24268
|
+
setValid("registrationAddress", Boolean(state.isValid));
|
|
24269
|
+
};
|
|
24270
|
+
const handleOperationalAddressChange = (state) => {
|
|
24271
|
+
handleChangeFor("operationalAddress")(state.data);
|
|
24272
|
+
setValid("operationalAddress", Boolean(state.isValid));
|
|
24273
|
+
};
|
|
24274
|
+
const handleOperationalAddressIsSameChange = (isChecked) => isChecked ? handleChangeFor("operationalAddressIsSame")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME) : handleChangeFor("operationalAddressIsSame")(operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME);
|
|
24225
24275
|
return jsxs("form", {
|
|
24226
24276
|
id: ADDITIONAL_INFORMATION_FORM_ID,
|
|
24227
24277
|
className: "adyen-kyc-additional-information",
|
|
@@ -24233,12 +24283,25 @@ function AdditionalInformationComponent({
|
|
|
24233
24283
|
verificationErrors: formVerificationErrors,
|
|
24234
24284
|
validationErrors: fieldValidationErrors,
|
|
24235
24285
|
formUtils
|
|
24236
|
-
}), showVerified &&
|
|
24237
|
-
|
|
24286
|
+
}), showVerified && jsxs("div", {
|
|
24287
|
+
children: [jsx("div", {
|
|
24288
|
+
className: "adyen-kyc-additional-information__section-heading",
|
|
24289
|
+
children: jsx(Typography, {
|
|
24290
|
+
el: "h3",
|
|
24291
|
+
variant: "title",
|
|
24292
|
+
children: i18n.get("verifiedInformation")
|
|
24293
|
+
})
|
|
24294
|
+
}), jsx(VerifiedBusinessCard, {
|
|
24295
|
+
verifiedBusiness
|
|
24296
|
+
})]
|
|
24238
24297
|
}), jsxs("fieldset", {
|
|
24239
|
-
children: [showVerified && jsx(
|
|
24240
|
-
|
|
24241
|
-
children:
|
|
24298
|
+
children: [showVerified && jsx("div", {
|
|
24299
|
+
className: "adyen-kyc-additional-information__section-heading",
|
|
24300
|
+
children: jsx(Typography, {
|
|
24301
|
+
el: "h3",
|
|
24302
|
+
variant: "title",
|
|
24303
|
+
children: i18n.get("otherBusinessInformation")
|
|
24304
|
+
})
|
|
24242
24305
|
}), showField(LEGAL_COMPANY_NAME_FIELD) && jsx("div", {
|
|
24243
24306
|
className: "adyen-kyc-field-wrapper",
|
|
24244
24307
|
children: jsx(LegalCompanyNameField, {
|
|
@@ -24329,7 +24392,8 @@ function AdditionalInformationComponent({
|
|
|
24329
24392
|
country,
|
|
24330
24393
|
canExempt: formUtils.isRequiredField("exemptedFromVat"),
|
|
24331
24394
|
vatNumberType,
|
|
24332
|
-
setVatNumberType
|
|
24395
|
+
setVatNumberType,
|
|
24396
|
+
shouldValidate
|
|
24333
24397
|
})
|
|
24334
24398
|
}), showField(DATE_OF_INCORPORATION_FIELD) && jsx("div", {
|
|
24335
24399
|
className: "adyen-kyc-field-wrapper",
|
|
@@ -24346,9 +24410,13 @@ function AdditionalInformationComponent({
|
|
|
24346
24410
|
})
|
|
24347
24411
|
})]
|
|
24348
24412
|
}), showStockData && jsxs("fieldset", {
|
|
24349
|
-
children: [jsx(
|
|
24350
|
-
|
|
24351
|
-
children:
|
|
24413
|
+
children: [jsx("div", {
|
|
24414
|
+
className: "adyen-kyc-additional-information__section-heading",
|
|
24415
|
+
children: jsx(Typography, {
|
|
24416
|
+
el: "h3",
|
|
24417
|
+
variant: "title",
|
|
24418
|
+
children: i18n.get("stockExchangeInformation")
|
|
24419
|
+
})
|
|
24352
24420
|
}), showField(STOCK_EXCHANGE_MIC_FIELD) && jsx("div", {
|
|
24353
24421
|
className: "adyen-kyc-field-wrapper",
|
|
24354
24422
|
children: jsx(StockExchangeMICField, {
|
|
@@ -24392,6 +24460,79 @@ function AdditionalInformationComponent({
|
|
|
24392
24460
|
handleChangeFor
|
|
24393
24461
|
})
|
|
24394
24462
|
})]
|
|
24463
|
+
}), jsxs("fieldset", {
|
|
24464
|
+
children: [jsxs("div", {
|
|
24465
|
+
className: "adyen-kyc-additional-information__section-heading",
|
|
24466
|
+
children: [jsx(Typography, {
|
|
24467
|
+
el: "h3",
|
|
24468
|
+
variant: "title",
|
|
24469
|
+
children: i18n.get("registeredBusinessAddress")
|
|
24470
|
+
}), jsx(Typography, {
|
|
24471
|
+
el: "h4",
|
|
24472
|
+
variant: "caption",
|
|
24473
|
+
children: i18n.get("registeredBusinessAddressDescription")
|
|
24474
|
+
})]
|
|
24475
|
+
}), jsx(Address, {
|
|
24476
|
+
id: ADDITIONAL_INFORMATION_FORM_ID,
|
|
24477
|
+
addressType: "registrationAddress",
|
|
24478
|
+
data: {
|
|
24479
|
+
...mergedDefaultData == null ? void 0 : mergedDefaultData.registrationAddress,
|
|
24480
|
+
country
|
|
24481
|
+
},
|
|
24482
|
+
labels: getAddressSchemaLabelsByCountry(country),
|
|
24483
|
+
countryCode: country,
|
|
24484
|
+
requiredFields: ADDRESS_SCHEMA2,
|
|
24485
|
+
shouldValidate,
|
|
24486
|
+
hideCountry: true,
|
|
24487
|
+
optionalFields: ["otherAddressInformation"],
|
|
24488
|
+
onChange: handleRegistrationAddressChange,
|
|
24489
|
+
handleAddressSearch,
|
|
24490
|
+
handleFindAddress,
|
|
24491
|
+
verifiedBusiness
|
|
24492
|
+
})]
|
|
24493
|
+
}), jsxs("fieldset", {
|
|
24494
|
+
children: [jsxs("div", {
|
|
24495
|
+
className: "adyen-kyc-additional-information__section-heading",
|
|
24496
|
+
children: [jsx(Typography, {
|
|
24497
|
+
el: "h3",
|
|
24498
|
+
variant: "title",
|
|
24499
|
+
children: i18n.get("principalPlaceOfBusiness")
|
|
24500
|
+
}), jsx(Typography, {
|
|
24501
|
+
el: "h4",
|
|
24502
|
+
variant: "caption",
|
|
24503
|
+
children: i18n.get("principalPlaceOfBusinessDescription")
|
|
24504
|
+
})]
|
|
24505
|
+
}), jsx(Field, {
|
|
24506
|
+
name: "operationalAddressIsSame",
|
|
24507
|
+
classNameModifiers: ["operationalAddressIsSame"],
|
|
24508
|
+
errorMessage: formErrors.operationalAddressIsSame,
|
|
24509
|
+
isValid: formValid.operationalAddressIsSame,
|
|
24510
|
+
children: (childProps) => jsx(Checkbox, {
|
|
24511
|
+
...childProps,
|
|
24512
|
+
"aria-required": formUtils.isRequiredField("operationalAddressIsSame"),
|
|
24513
|
+
"aria-label": formUtils.getLabel("sameAsRegisteredAddress"),
|
|
24514
|
+
"aria-invalid": !formValid.operationalAddressIsSame,
|
|
24515
|
+
name: "operationalAddressIsSame",
|
|
24516
|
+
label: formUtils.getLabel("sameAsRegisteredAddress"),
|
|
24517
|
+
checked: formData.operationalAddressIsSame ? formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME : true,
|
|
24518
|
+
onChange: handleOperationalAddressIsSameChange
|
|
24519
|
+
})
|
|
24520
|
+
}), formData.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME && jsx(Address, {
|
|
24521
|
+
id: ADDITIONAL_INFORMATION_FORM_ID,
|
|
24522
|
+
addressType: "operationalAddress",
|
|
24523
|
+
data: {
|
|
24524
|
+
...mergedDefaultData == null ? void 0 : mergedDefaultData.operationalAddress,
|
|
24525
|
+
country
|
|
24526
|
+
},
|
|
24527
|
+
labels: getAddressSchemaLabelsByCountry(country),
|
|
24528
|
+
countryCode: country,
|
|
24529
|
+
requiredFields: ADDRESS_SCHEMA2,
|
|
24530
|
+
shouldValidate,
|
|
24531
|
+
optionalFields: ["otherAddressInformation"],
|
|
24532
|
+
onChange: handleOperationalAddressChange,
|
|
24533
|
+
handleAddressSearch,
|
|
24534
|
+
handleFindAddress
|
|
24535
|
+
})]
|
|
24395
24536
|
})]
|
|
24396
24537
|
});
|
|
24397
24538
|
}
|
|
@@ -24802,7 +24943,7 @@ function BasicInformationComponent({
|
|
|
24802
24943
|
obscuredFields,
|
|
24803
24944
|
optionalFields,
|
|
24804
24945
|
readOnlyFields,
|
|
24805
|
-
trustedFields
|
|
24946
|
+
trustedFields,
|
|
24806
24947
|
country,
|
|
24807
24948
|
companyType = CompanyTypesValue.PRIVATE_COMPANY,
|
|
24808
24949
|
isTopLevelEntity,
|
|
@@ -24856,9 +24997,9 @@ function BasicInformationComponent({
|
|
|
24856
24997
|
readOnlyFields,
|
|
24857
24998
|
optionalFields,
|
|
24858
24999
|
obscuredFields,
|
|
24859
|
-
trustedFields
|
|
25000
|
+
trustedFields,
|
|
24860
25001
|
shouldValidate
|
|
24861
|
-
}), [allFields, helperText, labels2, obscuredFields, optionalFields, placeholders, readOnly, readOnlyFields, requiredFields,
|
|
25002
|
+
}), [allFields, helperText, labels2, obscuredFields, optionalFields, placeholders, readOnly, readOnlyFields, requiredFields, trustedFields, shouldValidate]);
|
|
24862
25003
|
const registrationNumberOptions = useMemo(() => getCompanyRegistrationNumberOptions(country, companyType), [country, companyType]);
|
|
24863
25004
|
const defaultRegistrationNumberType = (data == null ? void 0 : data.registrationNumber) ? inferCompanyRegistrationNumberType(data == null ? void 0 : data.registrationNumber, country, companyType) : (_a = registrationNumberOptions == null ? void 0 : registrationNumberOptions[0]) == null ? void 0 : _a.id;
|
|
24864
25005
|
const [registrationNumberType, setRegistrationNumberType] = useState(defaultRegistrationNumberType);
|
|
@@ -24925,6 +25066,9 @@ function BasicInformationComponent({
|
|
|
24925
25066
|
fieldProblems: formFieldProblems
|
|
24926
25067
|
});
|
|
24927
25068
|
}, [formSchema, formData, formErrors, formFieldProblems, formValid, updateStateSlice]);
|
|
25069
|
+
useEffect(() => {
|
|
25070
|
+
if (!isActiveForm && !(searchResults == null ? void 0 : searchResults.length)) setShowBusinessSelection(false);
|
|
25071
|
+
}, [isActiveForm, searchResults == null ? void 0 : searchResults.length, setShowBusinessSelection]);
|
|
24928
25072
|
useEffect(() => {
|
|
24929
25073
|
if (showBusinessSelection && showCompanyStructure && isActiveForm) {
|
|
24930
25074
|
handleNextClick();
|
|
@@ -25390,12 +25534,6 @@ const getForms = (country) => ({
|
|
|
25390
25534
|
formHeading: "additionalInformationFormHeading",
|
|
25391
25535
|
fields: COUNTRIES_USING_COMPANY_SEARCH.includes(country) ? ADDITIONAL_INFORMATION_FIELDS.filter((field) => !FIELDS_NEEDED_FOR_COMPANY_SEARCH.includes(field)) : ADDITIONAL_INFORMATION_FIELDS
|
|
25392
25536
|
},
|
|
25393
|
-
companyRegistrationAddress: {
|
|
25394
|
-
formId: "companyRegistrationAddress",
|
|
25395
|
-
formName: "companyRegistrationAddressFormName",
|
|
25396
|
-
formDescription: "companyRegistrationAddressFormDescription",
|
|
25397
|
-
fields: ["registrationAddress", "operationalAddress", "operationalAddressIsSame"]
|
|
25398
|
-
},
|
|
25399
25537
|
companyRegistrationDocument: {
|
|
25400
25538
|
formId: "companyRegistrationDocument",
|
|
25401
25539
|
formName: "companyRegistrationDocumentFormName",
|
|
@@ -25437,7 +25575,7 @@ const mapBasicInformation = (data) => {
|
|
|
25437
25575
|
}, {});
|
|
25438
25576
|
};
|
|
25439
25577
|
const mapAdditionalInformation = (data, legalEntity) => {
|
|
25440
|
-
var _a, _b, _c, _d;
|
|
25578
|
+
var _a, _b, _c, _d, _e;
|
|
25441
25579
|
if (!data) return;
|
|
25442
25580
|
const dbaName = ((_a = legalEntity.organization) == null ? void 0 : _a.doingBusinessAs) ? ((_b = legalEntity.organization) == null ? void 0 : _b.doingBusinessAs) !== ((_c = legalEntity.organization) == null ? void 0 : _c.legalName) ? {
|
|
25443
25581
|
hasDba: true
|
|
@@ -25445,6 +25583,7 @@ const mapAdditionalInformation = (data, legalEntity) => {
|
|
|
25445
25583
|
hasDba: false
|
|
25446
25584
|
} : {};
|
|
25447
25585
|
const currentCountry = (_d = legalEntity.organization) == null ? void 0 : _d.registeredAddress.country;
|
|
25586
|
+
const operationalAddressIsSame = ((_e = legalEntity.organization) == null ? void 0 : _e.principalPlaceOfBusiness) ? operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME : operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME;
|
|
25448
25587
|
return entriesOf(data).reduce((acc, [field]) => {
|
|
25449
25588
|
if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) {
|
|
25450
25589
|
return {
|
|
@@ -25460,7 +25599,8 @@ const mapAdditionalInformation = (data, legalEntity) => {
|
|
|
25460
25599
|
}
|
|
25461
25600
|
return acc;
|
|
25462
25601
|
}, {
|
|
25463
|
-
...dbaName
|
|
25602
|
+
...dbaName,
|
|
25603
|
+
operationalAddressIsSame
|
|
25464
25604
|
});
|
|
25465
25605
|
};
|
|
25466
25606
|
const mapLegalEntityToBusinessDetailsSchema = (legalEntity, isChangingType, accountHolder) => {
|
|
@@ -25474,7 +25614,6 @@ const mapLegalEntityToBusinessDetailsSchema = (legalEntity, isChangingType, acco
|
|
|
25474
25614
|
companyTaxDocument
|
|
25475
25615
|
};
|
|
25476
25616
|
return entriesOf(businessDetailsSchema).reduce((componentData, [key]) => {
|
|
25477
|
-
var _a;
|
|
25478
25617
|
switch (key) {
|
|
25479
25618
|
case "basicInformation": {
|
|
25480
25619
|
return {
|
|
@@ -25497,15 +25636,6 @@ const mapLegalEntityToBusinessDetailsSchema = (legalEntity, isChangingType, acco
|
|
|
25497
25636
|
[key]: mapAdditionalInformation(businessDetailsSchema[key], legalEntity)
|
|
25498
25637
|
};
|
|
25499
25638
|
}
|
|
25500
|
-
case "companyRegistrationAddress": {
|
|
25501
|
-
return {
|
|
25502
|
-
...componentData,
|
|
25503
|
-
[key]: {
|
|
25504
|
-
...businessDetailsSchema[key],
|
|
25505
|
-
operationalAddressIsSame: ((_a = legalEntity.organization) == null ? void 0 : _a.principalPlaceOfBusiness) ? operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME : operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_SAME
|
|
25506
|
-
}
|
|
25507
|
-
};
|
|
25508
|
-
}
|
|
25509
25639
|
case "companyRegistrationDocument": {
|
|
25510
25640
|
return {
|
|
25511
25641
|
...componentData,
|
|
@@ -25534,7 +25664,6 @@ function BusinessDetailsComponent(props) {
|
|
|
25534
25664
|
country,
|
|
25535
25665
|
isTopLevelEntity,
|
|
25536
25666
|
activeForm,
|
|
25537
|
-
problems,
|
|
25538
25667
|
baseTrackingPayload,
|
|
25539
25668
|
showCompanyStructure,
|
|
25540
25669
|
showBusinessSelection,
|
|
@@ -25619,22 +25748,9 @@ function BusinessDetailsComponent(props) {
|
|
|
25619
25748
|
country,
|
|
25620
25749
|
companyType: companyStructure == null ? void 0 : companyStructure.entityType,
|
|
25621
25750
|
verifiedBusiness,
|
|
25622
|
-
showCompanyStructure
|
|
25623
|
-
})
|
|
25624
|
-
}), jsx("div", {
|
|
25625
|
-
className: formWrapperClasses(forms2.companyRegistrationAddress.formId),
|
|
25626
|
-
children: jsx(RegistrationAddressComponent, {
|
|
25627
|
-
...getNestedOuterFormPropsFromOuterFormProps(props, forms2.companyRegistrationAddress.formId),
|
|
25628
|
-
id: forms2.companyRegistrationAddress.formId,
|
|
25629
|
-
heading: i18n.get(forms2.companyRegistrationAddress.formName),
|
|
25630
|
-
description: i18n.get(forms2.companyRegistrationAddress.formDescription, {
|
|
25631
|
-
localizeFor: country
|
|
25632
|
-
}),
|
|
25633
|
-
country,
|
|
25634
|
-
problems,
|
|
25751
|
+
showCompanyStructure,
|
|
25635
25752
|
handleAddressSearch,
|
|
25636
|
-
handleFindAddress
|
|
25637
|
-
verifiedBusiness
|
|
25753
|
+
handleFindAddress
|
|
25638
25754
|
})
|
|
25639
25755
|
}), jsx("div", {
|
|
25640
25756
|
className: formWrapperClasses(forms2.companyRegistrationDocument.formId),
|
|
@@ -25888,32 +26004,37 @@ const Modal = ({
|
|
|
25888
26004
|
onClose,
|
|
25889
26005
|
children: jsxs("div", {
|
|
25890
26006
|
className: "adyen-kyc-modal__wrapper",
|
|
25891
|
-
children: [
|
|
25892
|
-
className: "adyen-kyc-
|
|
25893
|
-
children:
|
|
25894
|
-
|
|
25895
|
-
|
|
25896
|
-
|
|
26007
|
+
children: [jsxs("div", {
|
|
26008
|
+
className: "adyen-kyc-modal__main",
|
|
26009
|
+
children: [jsxs("section", {
|
|
26010
|
+
className: "adyen-kyc-modal-top-bar",
|
|
26011
|
+
children: [onBack ? jsx(Button, {
|
|
26012
|
+
tertiary: true,
|
|
26013
|
+
"aria-label": "back",
|
|
26014
|
+
icon: "arrow-left",
|
|
26015
|
+
className: "adyen-kyc-modal-button-blur",
|
|
26016
|
+
onClick: onBack,
|
|
26017
|
+
shaded: true
|
|
26018
|
+
}) : jsx("div", {}), onClose ? jsx(Button, {
|
|
26019
|
+
tertiary: true,
|
|
26020
|
+
"aria-label": "close",
|
|
26021
|
+
icon: "cross",
|
|
26022
|
+
className: "adyen-kyc-modal-button-blur",
|
|
26023
|
+
onClick: onClose,
|
|
26024
|
+
shaded: true
|
|
26025
|
+
}) : jsx("div", {})]
|
|
26026
|
+
}), header && jsx("header", {
|
|
26027
|
+
className: "adyen-kyc-modal__header",
|
|
26028
|
+
children: header
|
|
26029
|
+
}), jsx("section", {
|
|
26030
|
+
className: "adyen-kyc-modal__content",
|
|
26031
|
+
children
|
|
26032
|
+
})]
|
|
25897
26033
|
}), jsx("div", {
|
|
25898
26034
|
children: footer && jsx("footer", {
|
|
25899
26035
|
className: "adyen-kyc-modal__footer",
|
|
25900
26036
|
children: footer
|
|
25901
26037
|
})
|
|
25902
|
-
}), jsxs("section", {
|
|
25903
|
-
className: "adyen-kyc-modal-top-bar",
|
|
25904
|
-
children: [onBack ? jsx(Button, {
|
|
25905
|
-
tertiary: true,
|
|
25906
|
-
"aria-label": "back",
|
|
25907
|
-
icon: "arrow-left",
|
|
25908
|
-
onClick: onBack,
|
|
25909
|
-
shaded: true
|
|
25910
|
-
}) : jsx("div", {}), jsx(Button, {
|
|
25911
|
-
tertiary: true,
|
|
25912
|
-
"aria-label": "close",
|
|
25913
|
-
icon: "cross",
|
|
25914
|
-
onClick: onClose,
|
|
25915
|
-
shaded: true
|
|
25916
|
-
})]
|
|
25917
26038
|
})]
|
|
25918
26039
|
})
|
|
25919
26040
|
});
|
|
@@ -26150,30 +26271,48 @@ const StepProgressIndicator = ({
|
|
|
26150
26271
|
activeStepIndex,
|
|
26151
26272
|
stepsCount,
|
|
26152
26273
|
fillBefore,
|
|
26153
|
-
thick
|
|
26154
|
-
|
|
26155
|
-
|
|
26156
|
-
|
|
26157
|
-
|
|
26158
|
-
|
|
26159
|
-
|
|
26160
|
-
|
|
26161
|
-
|
|
26162
|
-
|
|
26163
|
-
|
|
26164
|
-
|
|
26165
|
-
|
|
26166
|
-
|
|
26167
|
-
|
|
26168
|
-
|
|
26169
|
-
|
|
26170
|
-
|
|
26171
|
-
|
|
26172
|
-
|
|
26173
|
-
|
|
26274
|
+
thick,
|
|
26275
|
+
circles
|
|
26276
|
+
}) => {
|
|
26277
|
+
const {
|
|
26278
|
+
i18n
|
|
26279
|
+
} = useI18nContext();
|
|
26280
|
+
if (stepsCount === 0 || stepsCount > 10) {
|
|
26281
|
+
return jsx(Typography, {
|
|
26282
|
+
variant: "caption",
|
|
26283
|
+
children: i18n.get("XOfYSteps", {
|
|
26284
|
+
values: {
|
|
26285
|
+
currentStep: activeStepIndex,
|
|
26286
|
+
totalSteps: stepsCount
|
|
26287
|
+
}
|
|
26288
|
+
})
|
|
26289
|
+
});
|
|
26290
|
+
}
|
|
26291
|
+
return jsx("div", {
|
|
26292
|
+
"aria-label": `Step ${activeStepIndex} of ${stepsCount}`,
|
|
26293
|
+
className: "adyen-kyc-progress",
|
|
26294
|
+
role: "group",
|
|
26295
|
+
children: jsx("ol", {
|
|
26296
|
+
className: cx("adyen-kyc-progress__bar", {
|
|
26297
|
+
"adyen-kyc-progress__bar--thick": thick,
|
|
26298
|
+
"adyen-kyc-progress__bar--circles": circles
|
|
26299
|
+
}),
|
|
26300
|
+
children: range(stepsCount).map((stepNumber) => {
|
|
26301
|
+
const isHighlighted = shouldHighlight(activeStepIndex, stepNumber, fillBefore);
|
|
26302
|
+
return jsx("li", {
|
|
26303
|
+
"aria-current": isHighlighted ? "step" : void 0,
|
|
26304
|
+
className: cx("adyen-kyc-progress__step", {
|
|
26305
|
+
"adyen-kyc-progress__step--active": isHighlighted
|
|
26306
|
+
}),
|
|
26307
|
+
children: jsx("span", {
|
|
26308
|
+
className: "adyen-kyc-progress__step-label",
|
|
26309
|
+
children: `Step ${stepNumber}: ${stepNumber < activeStepIndex ? "completed" : "not completed"}`
|
|
26310
|
+
})
|
|
26311
|
+
}, stepNumber);
|
|
26312
|
+
})
|
|
26174
26313
|
})
|
|
26175
|
-
})
|
|
26176
|
-
}
|
|
26314
|
+
});
|
|
26315
|
+
};
|
|
26177
26316
|
const DropinLayout = ({
|
|
26178
26317
|
content,
|
|
26179
26318
|
footer,
|
|
@@ -26215,7 +26354,6 @@ const DropinLayout = ({
|
|
|
26215
26354
|
children: jsx("div", {
|
|
26216
26355
|
className: "adyen-kyc-dropin__content",
|
|
26217
26356
|
children: jsx("div", {
|
|
26218
|
-
className: "adyen-kyc-dropin__content-main",
|
|
26219
26357
|
children: content
|
|
26220
26358
|
})
|
|
26221
26359
|
})
|
|
@@ -26601,21 +26739,7 @@ const canSubmit$3 = (data) => MANDATORY_API_FIELDS.every((detail) => {
|
|
|
26601
26739
|
return !isEmpty(value);
|
|
26602
26740
|
});
|
|
26603
26741
|
const isDocumentsRequired$3 = (forms2) => forms2.some((form) => documentFormsIds.includes(form.formId));
|
|
26604
|
-
const removeConditionalForms = (forms2,
|
|
26605
|
-
var _a;
|
|
26606
|
-
const filteredForCompanyStructure = isSkippingCompanyStructure ? forms2.filter((f) => f.formId !== "companyStructure" && f.formId !== "companyType") : forms2;
|
|
26607
|
-
switch (problems == null ? void 0 : problems.status) {
|
|
26608
|
-
case 6:
|
|
26609
|
-
return isSkippingCompanyRegistrationDocument && !Object.keys((problems == null ? void 0 : problems.remediationActions) ?? {}).includes("1_501") ? filteredForCompanyStructure.filter((f) => f.formId !== "companyRegistrationDocument") : filteredForCompanyStructure;
|
|
26610
|
-
case 3:
|
|
26611
|
-
return isSkippingCompanyRegistrationDocument && !((_a = problems == null ? void 0 : problems.missingData) == null ? void 0 : _a.some((missingData) => {
|
|
26612
|
-
var _a2;
|
|
26613
|
-
return (_a2 = missingData.remediatingActions) == null ? void 0 : _a2.some((remediation) => remediation.code === "1_501");
|
|
26614
|
-
})) ? filteredForCompanyStructure.filter((f) => f.formId !== "companyRegistrationDocument") : filteredForCompanyStructure;
|
|
26615
|
-
default:
|
|
26616
|
-
return isSkippingCompanyRegistrationDocument ? filteredForCompanyStructure.filter((f) => f.formId !== "companyRegistrationDocument") : filteredForCompanyStructure;
|
|
26617
|
-
}
|
|
26618
|
-
};
|
|
26742
|
+
const removeConditionalForms = (forms2, isSkippingCompanyStructure) => isSkippingCompanyStructure ? forms2.filter((f) => f.formId !== "companyStructure" && f.formId !== "companyType") : forms2;
|
|
26619
26743
|
const formatBasicInformation = (data, labels2, datasetUtils, companyType) => {
|
|
26620
26744
|
var _a, _b, _c;
|
|
26621
26745
|
const country = data == null ? void 0 : data.country;
|
|
@@ -26682,15 +26806,11 @@ const formatDataForSummary$1 = (data, forms2, labels2, i18n) => {
|
|
|
26682
26806
|
}
|
|
26683
26807
|
};
|
|
26684
26808
|
case "additionalInformation":
|
|
26685
|
-
return {
|
|
26686
|
-
...summaryData,
|
|
26687
|
-
[form]: formatAdditionalInformation(data[form], labels2, (_e = data.basicInformation) == null ? void 0 : _e.country, (_f = data.companyStructure) == null ? void 0 : _f.entityType)
|
|
26688
|
-
};
|
|
26689
|
-
case "companyRegistrationAddress":
|
|
26690
26809
|
return {
|
|
26691
26810
|
...summaryData,
|
|
26692
26811
|
[form]: {
|
|
26693
26812
|
hasInnerForms: true,
|
|
26813
|
+
additionalInformationFormName: formatAdditionalInformation(data[form], labels2, (_e = data.basicInformation) == null ? void 0 : _e.country, (_f = data.companyStructure) == null ? void 0 : _f.entityType),
|
|
26694
26814
|
registrationAddress: mapAddressLabels(data[form].registrationAddress, datasetUtils),
|
|
26695
26815
|
operationalAddress: data[form].operationalAddress ? mapAddressLabels(data[form].operationalAddress, datasetUtils) : void 0
|
|
26696
26816
|
}
|
|
@@ -26779,7 +26899,7 @@ async function submit({
|
|
|
26779
26899
|
companyStructure: ((_a = data.companyStructure) == null ? void 0 : _a.entityType) ?? null,
|
|
26780
26900
|
countryOfRegistration: ((_b = data.basicInformation) == null ? void 0 : _b.country) ?? null,
|
|
26781
26901
|
legalEntityName: ((_c = data.additionalInformation) == null ? void 0 : _c.legalCompanyName) ?? null,
|
|
26782
|
-
usedAdditionalAddress: ((_d = data.
|
|
26902
|
+
usedAdditionalAddress: ((_d = data.additionalInformation) == null ? void 0 : _d.operationalAddressIsSame) === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME
|
|
26783
26903
|
};
|
|
26784
26904
|
const savedLegalEntityData = mapLegalEntityToBusinessDetailsSchema(legalEntityResponse, isTargetLegalEntityType);
|
|
26785
26905
|
const filteredData = removeOldDataBySchema(data, savedLegalEntityData);
|
|
@@ -26879,7 +26999,7 @@ function BusinessDetailsDropinComponent({
|
|
|
26879
26999
|
handleClearCompanyData,
|
|
26880
27000
|
onTypeSwitch
|
|
26881
27001
|
}) {
|
|
26882
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m
|
|
27002
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
26883
27003
|
const {
|
|
26884
27004
|
state: {
|
|
26885
27005
|
currentState
|
|
@@ -26919,7 +27039,7 @@ function BusinessDetailsDropinComponent({
|
|
|
26919
27039
|
return ((_a2 = currentState.data.basicInformation) == null ? void 0 : _a2.country) ?? country;
|
|
26920
27040
|
}, [(_a = currentState.data.basicInformation) == null ? void 0 : _a.country, country]);
|
|
26921
27041
|
const [initialData, setInitialData] = useState(mapLegalEntityToBusinessDetailsSchema(legalEntityResponse, Boolean(isTargetLegalEntityType), isNewEntryFlowEnabled ? accountHolder : void 0));
|
|
26922
|
-
const [
|
|
27042
|
+
const [trustedFields, setTrustedFields] = useState(legalEntityResponse.trustedFields);
|
|
26923
27043
|
const documentUtils = documentApiUtils(handleCreateDocument, handleGetDocument, handleUpdateDocument);
|
|
26924
27044
|
useEffect(() => {
|
|
26925
27045
|
var _a2;
|
|
@@ -26964,14 +27084,13 @@ function BusinessDetailsDropinComponent({
|
|
|
26964
27084
|
isExperimentEnabled
|
|
26965
27085
|
}), [currentCountry, currentState.data, isExperimentEnabled, taskType]);
|
|
26966
27086
|
const initialForms = useMemo(() => getForms(currentCountry), [currentCountry]);
|
|
26967
|
-
const derivedProps = useMemo(() => getPropsFromConfigurations(fieldConfigurations, initialForms, (currentProblems == null ? void 0 : currentProblems.remediationActions) ? Object.values(currentProblems == null ? void 0 : currentProblems.remediationActions) : [], (currentProblems == null ? void 0 : currentProblems.missingData) ?? [], legalEntityResponse ? getFieldsWithExistingData(legalEntityResponse, isExperimentEnabled) : [], customRules, {}, {},
|
|
27087
|
+
const derivedProps = useMemo(() => getPropsFromConfigurations(fieldConfigurations, initialForms, (currentProblems == null ? void 0 : currentProblems.remediationActions) ? Object.values(currentProblems == null ? void 0 : currentProblems.remediationActions) : [], (currentProblems == null ? void 0 : currentProblems.missingData) ?? [], legalEntityResponse ? getFieldsWithExistingData(legalEntityResponse, isExperimentEnabled) : [], customRules, {}, {}, trustedFields), [fieldConfigurations, initialForms, currentProblems == null ? void 0 : currentProblems.remediationActions, currentProblems == null ? void 0 : currentProblems.missingData, legalEntityResponse, isExperimentEnabled, customRules, trustedFields]);
|
|
26968
27088
|
const isSkippingCompanyStructure = useEnableNewEntryFlow() && organizationTypesToSkipCompanyStructureForm.includes((_d = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _d.type) && accountHolder !== "aTrust";
|
|
26969
|
-
const isSkippingCompanyRegistrationDocument = currentCountry === "CA" && ((_e = currentState.data.additionalInformation) == null ? void 0 : _e.registrationNumber) && ((_f = currentState.valid.additionalInformation) == null ? void 0 : _f.registrationNumber) && !((_g = currentState.data.companyRegistrationDocument) == null ? void 0 : _g.registrationDocument);
|
|
26970
27089
|
const forms2 = useMemo(() => {
|
|
26971
27090
|
const requiredForms = getRequiredForms(initialForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
|
|
26972
27091
|
const validityAddedForms = addValidityToForms(requiredForms, currentState.validityByForm, currentProblems);
|
|
26973
|
-
return removeConditionalForms(validityAddedForms,
|
|
26974
|
-
}, [initialForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, currentState.validityByForm, currentProblems, currentCountry, isSkippingCompanyStructure, showCompanyStructure
|
|
27092
|
+
return removeConditionalForms(validityAddedForms, currentCountry !== "US" ? isSkippingCompanyStructure : !showCompanyStructure);
|
|
27093
|
+
}, [initialForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, currentState.validityByForm, currentProblems, currentCountry, isSkippingCompanyStructure, showCompanyStructure]);
|
|
26975
27094
|
const canSubmitForm = useMemo(() => canSubmit$3(currentState.data) && hasDataChanged(initialData, currentState.data), [initialData, currentState.data]);
|
|
26976
27095
|
const summaryData = useMemo(() => ({
|
|
26977
27096
|
data: formatDataForSummary$1(currentState.data, forms2, derivedProps == null ? void 0 : derivedProps.labels, i18n),
|
|
@@ -27049,7 +27168,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27049
27168
|
return tinMatch ? handleNextClick() : void 0;
|
|
27050
27169
|
}
|
|
27051
27170
|
}
|
|
27052
|
-
}, [currentCountry, (
|
|
27171
|
+
}, [currentCountry, (_e = currentState.data.basicInformation) == null ? void 0 : _e.taxInformation, fetchBusinessData, handleNextClick, searchForBusiness, handleVerifyBusinessData]);
|
|
27053
27172
|
useEffect(() => {
|
|
27054
27173
|
if (searchResults && !searchResults.length || isSearching === "error") {
|
|
27055
27174
|
setShowCompanyStructure(true);
|
|
@@ -27061,7 +27180,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27061
27180
|
setShowCompanyStructure(false);
|
|
27062
27181
|
resetBusinessData();
|
|
27063
27182
|
}
|
|
27064
|
-
}, [currentSearchName, (
|
|
27183
|
+
}, [currentSearchName, (_f = currentState.data.basicInformation) == null ? void 0 : _f.businessName]);
|
|
27065
27184
|
const [showBusinessSelection, setShowBusinessSelection] = useState(false);
|
|
27066
27185
|
const isBusinessSelection = useMemo(() => showBusinessSelection && activeForm.formId === "basicInformation", [activeForm.formId, showBusinessSelection]);
|
|
27067
27186
|
const hideBack = useMemo(() => {
|
|
@@ -27092,7 +27211,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27092
27211
|
return gotoFormByFormIndex(index);
|
|
27093
27212
|
}
|
|
27094
27213
|
case "additionalInformation": {
|
|
27095
|
-
if (verifiedBusiness) return gotoFormByFormIndex(index);
|
|
27214
|
+
if (verifiedBusiness || activeForm.formId !== "basicInformation") return gotoFormByFormIndex(index);
|
|
27096
27215
|
if (!isBusinessSelection) {
|
|
27097
27216
|
if (!!((_a2 = currentState.data.basicInformation) == null ? void 0 : _a2.businessName) && !!((_b2 = currentState.data.basicInformation) == null ? void 0 : _b2.country) && !!((_c2 = currentState.data.basicInformation) == null ? void 0 : _c2.stateOrProvince)) {
|
|
27098
27217
|
findBusiness({
|
|
@@ -27108,7 +27227,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27108
27227
|
default:
|
|
27109
27228
|
return gotoFormByFormIndex(index);
|
|
27110
27229
|
}
|
|
27111
|
-
}, [canSubmitForm, currentCountry, (
|
|
27230
|
+
}, [canSubmitForm, currentCountry, (_g = currentState.data.basicInformation) == null ? void 0 : _g.businessName, (_h = currentState.data.basicInformation) == null ? void 0 : _h.country, (_i = currentState.data.basicInformation) == null ? void 0 : _i.stateOrProvince, findBusiness, forms2, gotoFormByFormIndex, isBusinessSelection, searchResults, verifiedBusiness, activeForm.formId]);
|
|
27112
27231
|
const nextClick = useCallback(() => {
|
|
27113
27232
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
|
27114
27233
|
if (!COUNTRIES_USING_COMPANY_SEARCH.includes(currentCountry)) return handleNextClick();
|
|
@@ -27131,7 +27250,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27131
27250
|
default:
|
|
27132
27251
|
return handleNextClick();
|
|
27133
27252
|
}
|
|
27134
|
-
}, [currentCountry, handleNextClick, activeForm.formId, verifiedBusiness, (
|
|
27253
|
+
}, [currentCountry, handleNextClick, activeForm.formId, verifiedBusiness, (_j = currentState.validityByForm) == null ? void 0 : _j.basicInformation, (_k = currentState.data.basicInformation) == null ? void 0 : _k.businessName, (_l = currentState.data.basicInformation) == null ? void 0 : _l.country, (_m = currentState.data.basicInformation) == null ? void 0 : _m.stateOrProvince, isBusinessSelection, findBusiness]);
|
|
27135
27254
|
const backClick = useCallback(() => {
|
|
27136
27255
|
if (!COUNTRIES_USING_COMPANY_SEARCH.includes(country)) return handleNextClick();
|
|
27137
27256
|
switch (activeForm.formId) {
|
|
@@ -27164,7 +27283,7 @@ function BusinessDetailsDropinComponent({
|
|
|
27164
27283
|
}, [clearTrustedBusinessData]);
|
|
27165
27284
|
useEffect(() => {
|
|
27166
27285
|
var _a2;
|
|
27167
|
-
if ((
|
|
27286
|
+
if ((trustedFields == null ? void 0 : trustedFields.length) && ((_a2 = legalEntityResponse.organization) == null ? void 0 : _a2.registeredAddress.country) !== currentCountry) {
|
|
27168
27287
|
setTrustedFields(void 0);
|
|
27169
27288
|
}
|
|
27170
27289
|
}, [currentCountry]);
|
|
@@ -27273,9 +27392,9 @@ function CompanyDropinComponent({
|
|
|
27273
27392
|
handleHomeClick,
|
|
27274
27393
|
onTypeSwitch,
|
|
27275
27394
|
onChange,
|
|
27276
|
-
trustedFields
|
|
27395
|
+
trustedFields
|
|
27277
27396
|
}) {
|
|
27278
|
-
var _a, _b
|
|
27397
|
+
var _a, _b;
|
|
27279
27398
|
const {
|
|
27280
27399
|
accountHolder,
|
|
27281
27400
|
setAccountHolder
|
|
@@ -27354,12 +27473,11 @@ function CompanyDropinComponent({
|
|
|
27354
27473
|
onChange == null ? void 0 : onChange(currentState);
|
|
27355
27474
|
}, [currentState]);
|
|
27356
27475
|
const isSkippingCompanyStructure = useEnableNewEntryFlow() && organizationTypesToSkipCompanyStructureForm.includes((_b = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _b.type) && accountHolder !== "aTrust";
|
|
27357
|
-
const isSkippingCompanyRegistrationDocument = country === "CA" && ((_c = currentState.data.companyRegistrationDetails) == null ? void 0 : _c.registrationNumber) && ((_d = currentState.valid.companyRegistrationDetails) == null ? void 0 : _d.registrationNumber) && !((_e = currentState.data.companyRegistrationDocument) == null ? void 0 : _e.registrationDocument);
|
|
27358
27476
|
const forms2 = useMemo(() => {
|
|
27359
27477
|
const requiredForms = getRequiredForms(companyForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
|
|
27360
27478
|
const validityAddedForms = addValidityToForms(requiredForms, formValidity, problems);
|
|
27361
|
-
return removeConditionalForms(validityAddedForms,
|
|
27362
|
-
}, [derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, formValidity, problems, isSkippingCompanyStructure
|
|
27479
|
+
return removeConditionalForms(validityAddedForms, isSkippingCompanyStructure);
|
|
27480
|
+
}, [derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, formValidity, problems, isSkippingCompanyStructure]);
|
|
27363
27481
|
const submitDocuments2 = async ({
|
|
27364
27482
|
forms: forms22,
|
|
27365
27483
|
legalEntity,
|
|
@@ -27510,7 +27628,7 @@ function CompanyDropinComponent({
|
|
|
27510
27628
|
}, []);
|
|
27511
27629
|
const datasetUtils = datasetUtilities(i18n.locale);
|
|
27512
27630
|
const formatDataForSummary2 = (data2, forms22) => {
|
|
27513
|
-
var _a2, _b2,
|
|
27631
|
+
var _a2, _b2, _c, _d, _e, _f, _g;
|
|
27514
27632
|
let summaryData = cloneObject(data2);
|
|
27515
27633
|
if (summaryData.companyNameAndCountry) {
|
|
27516
27634
|
if (isCountryOfGoverningLawEnabled) {
|
|
@@ -27525,14 +27643,14 @@ function CompanyDropinComponent({
|
|
|
27525
27643
|
const companyType = (_b2 = companyTypes.find((type) => type.id === summaryData.companyType.entityType)) == null ? void 0 : _b2.name;
|
|
27526
27644
|
summaryData.companyType.entityType = i18n.get(companyType);
|
|
27527
27645
|
}
|
|
27528
|
-
if ((
|
|
27646
|
+
if ((_c = summaryData.companyType) == null ? void 0 : _c.accountHolder) {
|
|
27529
27647
|
summaryData.companyType.accountHolder = i18n.get(summaryData.companyType.accountHolder);
|
|
27530
27648
|
}
|
|
27531
|
-
if ((
|
|
27649
|
+
if ((_d = summaryData.companyRegistrationAddress) == null ? void 0 : _d.registrationAddress) {
|
|
27532
27650
|
summaryData.companyRegistrationAddress.hasInnerForms = true;
|
|
27533
27651
|
summaryData.companyRegistrationAddress.registrationAddress = mapAddressLabels(summaryData.companyRegistrationAddress.registrationAddress, datasetUtils);
|
|
27534
27652
|
}
|
|
27535
|
-
if ((
|
|
27653
|
+
if ((_e = summaryData.companyRegistrationAddress) == null ? void 0 : _e.operationalAddress) {
|
|
27536
27654
|
summaryData.companyRegistrationAddress.operationalAddress = mapAddressLabels(summaryData.companyRegistrationAddress.operationalAddress, datasetUtils);
|
|
27537
27655
|
}
|
|
27538
27656
|
if ((_f = summaryData.companyRegistrationDetails) == null ? void 0 : _f.vatAbsenceReason) {
|
|
@@ -27614,7 +27732,7 @@ function CompanyDropinComponent({
|
|
|
27614
27732
|
ref: formRef,
|
|
27615
27733
|
shouldValidate,
|
|
27616
27734
|
isTopLevelEntity: taskType === TaskTypes.COMPANY,
|
|
27617
|
-
readOnlyFields:
|
|
27735
|
+
readOnlyFields: trustedFields
|
|
27618
27736
|
})
|
|
27619
27737
|
});
|
|
27620
27738
|
}
|
|
@@ -28907,9 +29025,9 @@ function CompanySearchDropinComponent({
|
|
|
28907
29025
|
handleRefreshCompanyDataset,
|
|
28908
29026
|
handleVerifyTin,
|
|
28909
29027
|
onTypeSwitch,
|
|
28910
|
-
trustedFields
|
|
29028
|
+
trustedFields
|
|
28911
29029
|
}) {
|
|
28912
|
-
var _a, _b, _c, _d
|
|
29030
|
+
var _a, _b, _c, _d;
|
|
28913
29031
|
const {
|
|
28914
29032
|
state: {
|
|
28915
29033
|
currentState
|
|
@@ -28994,12 +29112,11 @@ function CompanySearchDropinComponent({
|
|
|
28994
29112
|
}
|
|
28995
29113
|
}, [fieldConfigurations, problems == null ? void 0 : problems.remediationActions, problems == null ? void 0 : problems.missingData, legalEntityResponse, isExperimentEnabled, customRules, country]);
|
|
28996
29114
|
const isSkippingCompanyStructure = useEnableNewEntryFlow() && organizationTypesToSkipCompanyStructureForm.includes((_d = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _d.type) && accountHolder !== "aTrust";
|
|
28997
|
-
const isSkippingCompanyRegistrationDocument = country === "CA" && ((_e = currentState.data.companyOtherDetails) == null ? void 0 : _e.registrationNumber) && ((_f = currentState.valid.companyOtherDetails) == null ? void 0 : _f.registrationNumber) && !((_g = currentState.data.companyRegistrationDocument) == null ? void 0 : _g.registrationDocument);
|
|
28998
29115
|
const forms$1 = useMemo(() => {
|
|
28999
29116
|
const requiredForms = getRequiredForms(forms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
|
|
29000
29117
|
const validityAddedForms = addValidityToForms(requiredForms, currentState.validityByForm, problems);
|
|
29001
|
-
return removeConditionalForms(validityAddedForms,
|
|
29002
|
-
}, [derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, currentState.validityByForm, problems, isSkippingCompanyStructure
|
|
29118
|
+
return removeConditionalForms(validityAddedForms, isSkippingCompanyStructure);
|
|
29119
|
+
}, [derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields, currentState.validityByForm, problems, isSkippingCompanyStructure]);
|
|
29003
29120
|
const summaryData = useMemo(() => ({
|
|
29004
29121
|
data: formatDataForSummary(currentState.data, forms$1, derivedProps == null ? void 0 : derivedProps.labels, i18n),
|
|
29005
29122
|
omittedKeys: ["operationalAddressIsSame"]
|
|
@@ -29091,7 +29208,7 @@ function CompanySearchDropinComponent({
|
|
|
29091
29208
|
handleGetCompanyDataset,
|
|
29092
29209
|
handleRefreshCompanyDataset,
|
|
29093
29210
|
handleVerifyTin,
|
|
29094
|
-
readOnlyFields:
|
|
29211
|
+
readOnlyFields: trustedFields
|
|
29095
29212
|
})
|
|
29096
29213
|
});
|
|
29097
29214
|
}
|
|
@@ -29191,10 +29308,9 @@ const useHasSeenSingpassSelection = ({
|
|
|
29191
29308
|
setHasSeenSingpassSelection
|
|
29192
29309
|
};
|
|
29193
29310
|
};
|
|
29194
|
-
const
|
|
29195
|
-
const parseTrustedFieldsIntoReadOnlyFields = (trustedFields2, mapping) => {
|
|
29311
|
+
const parseTrustedFieldsIntoReadOnlyFields = (trustedFields, mapping) => {
|
|
29196
29312
|
const formFieldsMapped = [];
|
|
29197
|
-
|
|
29313
|
+
trustedFields.forEach((field) => {
|
|
29198
29314
|
for (const [key, value] of Object.entries(mapping)) {
|
|
29199
29315
|
if (value === field) {
|
|
29200
29316
|
formFieldsMapped.push(key);
|
|
@@ -29216,17 +29332,6 @@ const parseTrustedFieldsIntoReadOnlyFields = (trustedFields2, mapping) => {
|
|
|
29216
29332
|
});
|
|
29217
29333
|
return readOnlyFields;
|
|
29218
29334
|
};
|
|
29219
|
-
const trustedFields = ({
|
|
29220
|
-
fields,
|
|
29221
|
-
trustedFieldsProvider,
|
|
29222
|
-
apiMapping
|
|
29223
|
-
}) => {
|
|
29224
|
-
if (!fields || !trustedFieldsProvider || !apiMapping) {
|
|
29225
|
-
return {};
|
|
29226
|
-
}
|
|
29227
|
-
const trustedFieldsOfProvider = getTrustedFieldsByProvider(trustedFieldsProvider, fields);
|
|
29228
|
-
return trustedFieldsOfProvider ? parseTrustedFieldsIntoReadOnlyFields(trustedFieldsOfProvider, apiMapping) : {};
|
|
29229
|
-
};
|
|
29230
29335
|
const defaultSingpassState = {
|
|
29231
29336
|
isLoading: false,
|
|
29232
29337
|
isSuccess: false
|
|
@@ -29270,6 +29375,27 @@ const getApiMapping = (enableCompanySearchFlow, legalEntity) => {
|
|
|
29270
29375
|
return companyComponentsKeyMapping;
|
|
29271
29376
|
}
|
|
29272
29377
|
};
|
|
29378
|
+
const getTrustedEntityAssociations = (legalEntityTrustedFields) => {
|
|
29379
|
+
const rawTrustedEntityAssociations = legalEntityTrustedFields.filter((f) => f.startsWith("entityAssociations")) ?? [];
|
|
29380
|
+
const leIdMap = {};
|
|
29381
|
+
rawTrustedEntityAssociations.forEach((rtea) => {
|
|
29382
|
+
const [_, role, leId] = rtea.split(".");
|
|
29383
|
+
const trustedRole = role;
|
|
29384
|
+
if (!leIdMap[leId]) {
|
|
29385
|
+
leIdMap[leId] = {
|
|
29386
|
+
roles: [trustedRole]
|
|
29387
|
+
};
|
|
29388
|
+
} else {
|
|
29389
|
+
leIdMap[leId] = {
|
|
29390
|
+
roles: [...leIdMap[leId].roles, trustedRole]
|
|
29391
|
+
};
|
|
29392
|
+
}
|
|
29393
|
+
});
|
|
29394
|
+
return Object.keys(leIdMap).map((reference) => ({
|
|
29395
|
+
reference,
|
|
29396
|
+
types: leIdMap[reference].roles
|
|
29397
|
+
}));
|
|
29398
|
+
};
|
|
29273
29399
|
const useSingpassMyInfoLogin = ({
|
|
29274
29400
|
legalEntity,
|
|
29275
29401
|
accountHolder,
|
|
@@ -29283,6 +29409,7 @@ const useSingpassMyInfoLogin = ({
|
|
|
29283
29409
|
const isSingpassForIndividualsEnabled = isExperimentEnabled("ShowSingPassButtonForIndividuals");
|
|
29284
29410
|
const enableCompanySearchFlow = isExperimentEnabled("EnableCompanySearchFlow");
|
|
29285
29411
|
const apiMapping = getApiMapping(enableCompanySearchFlow, legalEntity);
|
|
29412
|
+
const legalEntityTrustedFields = legalEntity == null ? void 0 : legalEntity.trustedFields;
|
|
29286
29413
|
const isEligibleForSingpass = useMemo(() => {
|
|
29287
29414
|
if (!legalEntity) {
|
|
29288
29415
|
return false;
|
|
@@ -29303,17 +29430,13 @@ const useSingpassMyInfoLogin = ({
|
|
|
29303
29430
|
const isVanillaIndividual = legalEntityType === LegalEntityType.INDIVIDUAL && !hasSoleProprietor;
|
|
29304
29431
|
return isVanillaOrganization && isSingpassForCompaniesEnabled || isVanillaIndividual && isSingpassForIndividualsEnabled;
|
|
29305
29432
|
}, [legalEntity, accountHolder, handleOpenSingpassAuthorizationLink]);
|
|
29306
|
-
const
|
|
29307
|
-
|
|
29308
|
-
|
|
29309
|
-
|
|
29310
|
-
|
|
29311
|
-
|
|
29312
|
-
|
|
29313
|
-
trustedFieldsProvider: TrustedFieldsProvider.SINGPASS,
|
|
29314
|
-
apiMapping
|
|
29315
|
-
});
|
|
29316
|
-
}, [legalEntity, isEligibleForSingpass, apiMapping]);
|
|
29433
|
+
const singpassTrustedFields = useMemo(() => {
|
|
29434
|
+
var _a;
|
|
29435
|
+
const allTrustedFields = isEligibleForSingpass && legalEntityTrustedFields ? legalEntityTrustedFields : [];
|
|
29436
|
+
return ((_a = allTrustedFields.find((tf) => tf.provider === TrustedFieldsProvider.SINGPASS)) == null ? void 0 : _a.fields) || [];
|
|
29437
|
+
}, [isEligibleForSingpass, legalEntity]);
|
|
29438
|
+
const trustedFields = useMemo(() => apiMapping ? parseTrustedFieldsIntoReadOnlyFields(singpassTrustedFields, apiMapping) : {}, [singpassTrustedFields, apiMapping]);
|
|
29439
|
+
const trustedEntityAssociations = useMemo(() => getTrustedEntityAssociations(singpassTrustedFields), [singpassTrustedFields]);
|
|
29317
29440
|
const handleInitiateSingpassMyInfoLogin = async () => {
|
|
29318
29441
|
if (handleOpenSingpassAuthorizationLink) {
|
|
29319
29442
|
dispatch({
|
|
@@ -29358,7 +29481,8 @@ const useSingpassMyInfoLogin = ({
|
|
|
29358
29481
|
handleSingpassMyInfoLoginSuccess,
|
|
29359
29482
|
handleSingpassMyInfoLoginFailure,
|
|
29360
29483
|
handleSingpassMyInfoLoginReset,
|
|
29361
|
-
trustedFields
|
|
29484
|
+
trustedFields,
|
|
29485
|
+
trustedEntityAssociations
|
|
29362
29486
|
};
|
|
29363
29487
|
};
|
|
29364
29488
|
const logger$i = createLogger("useAssociatedLegalArrangement");
|
|
@@ -30198,17 +30322,9 @@ function useDataMissingRemediations({
|
|
|
30198
30322
|
}
|
|
30199
30323
|
};
|
|
30200
30324
|
}
|
|
30201
|
-
const iconStatus = (current, min
|
|
30202
|
-
const
|
|
30203
|
-
|
|
30204
|
-
const isWithinConditionalRange = current >= min;
|
|
30205
|
-
if (isEmpty2) {
|
|
30206
|
-
return min > 0 ? "obligatoryEmpty" : "conditionalEmpty";
|
|
30207
|
-
}
|
|
30208
|
-
if (isWithinObligatoryRange) {
|
|
30209
|
-
return "obligatoryFinished";
|
|
30210
|
-
}
|
|
30211
|
-
return isWithinConditionalRange ? "conditionalFinished" : "conditionalEmpty";
|
|
30325
|
+
const iconStatus = (current, min) => {
|
|
30326
|
+
const isSatisfied = current > 0 && current >= min;
|
|
30327
|
+
return isSatisfied ? "satisfied" : "empty";
|
|
30212
30328
|
};
|
|
30213
30329
|
const getEntityStatusRuleDescription = (country, currentTask, entityLabel) => currentTask === TaskTypes.TRUST_MEMBER_OVERVIEW ? TRUST_DEFAULT_DESCRIPTIONS_MAP[entityLabel] : getDecisionMakerDescriptionMap(country)[entityLabel];
|
|
30214
30330
|
const Status = ({
|
|
@@ -30563,67 +30679,26 @@ const EntityStatusIcon = ({
|
|
|
30563
30679
|
status
|
|
30564
30680
|
}) => {
|
|
30565
30681
|
switch (status) {
|
|
30566
|
-
case "
|
|
30682
|
+
case "empty":
|
|
30567
30683
|
return jsx(Icon, {
|
|
30568
|
-
name: "
|
|
30569
|
-
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--
|
|
30570
|
-
testId: "
|
|
30684
|
+
name: "circle",
|
|
30685
|
+
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--empty",
|
|
30686
|
+
testId: "empty-icon"
|
|
30571
30687
|
});
|
|
30572
|
-
case "
|
|
30688
|
+
case "satisfied":
|
|
30573
30689
|
return jsx(Icon, {
|
|
30574
|
-
name: "checkmark-
|
|
30575
|
-
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--
|
|
30576
|
-
testId: "
|
|
30577
|
-
});
|
|
30578
|
-
case "obligatoryFinished":
|
|
30579
|
-
return jsx(Icon, {
|
|
30580
|
-
name: "checkmark-small",
|
|
30581
|
-
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--obligatory-success",
|
|
30582
|
-
testId: "obligatoryFinished-icon"
|
|
30583
|
-
});
|
|
30584
|
-
case "conditionalFinished":
|
|
30585
|
-
return jsx(Icon, {
|
|
30586
|
-
name: "checkmark-small",
|
|
30587
|
-
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--conditional-success",
|
|
30588
|
-
testId: "conditionalFinished-icon"
|
|
30690
|
+
name: "checkmark-circle-fill",
|
|
30691
|
+
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--satisfied",
|
|
30692
|
+
testId: "satisfied-icon"
|
|
30589
30693
|
});
|
|
30590
30694
|
default:
|
|
30591
30695
|
return jsx(Icon, {
|
|
30592
|
-
name: "
|
|
30593
|
-
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--
|
|
30594
|
-
testId: "
|
|
30696
|
+
name: "circle",
|
|
30697
|
+
className: "adyen-kyc-entity-status__icon adyen-kyc-entity-status__icon--empty",
|
|
30698
|
+
testId: "empty-icon"
|
|
30595
30699
|
});
|
|
30596
30700
|
}
|
|
30597
30701
|
};
|
|
30598
|
-
const EntityGuidanceLegend = () => {
|
|
30599
|
-
const {
|
|
30600
|
-
i18n
|
|
30601
|
-
} = useI18nContext();
|
|
30602
|
-
return jsxs("div", {
|
|
30603
|
-
className: "adyen-kyc-entity-status__legend",
|
|
30604
|
-
children: [jsxs("span", {
|
|
30605
|
-
className: "adyen-kyc-entity-status__legend--rule",
|
|
30606
|
-
children: [jsx(EntityStatusIcon, {
|
|
30607
|
-
status: "obligatoryEmpty"
|
|
30608
|
-
}), jsx("span", {
|
|
30609
|
-
className: "adyen-kyc-entity-status--text",
|
|
30610
|
-
dangerouslySetInnerHTML: {
|
|
30611
|
-
__html: i18n.get("obligatory")
|
|
30612
|
-
}
|
|
30613
|
-
})]
|
|
30614
|
-
}), jsxs("span", {
|
|
30615
|
-
className: "adyen-kyc-entity-status__legend--rule",
|
|
30616
|
-
children: [jsx(EntityStatusIcon, {
|
|
30617
|
-
status: "conditionalEmpty"
|
|
30618
|
-
}), jsx("span", {
|
|
30619
|
-
className: "adyen-kyc-entity-status--text",
|
|
30620
|
-
dangerouslySetInnerHTML: {
|
|
30621
|
-
__html: i18n.get("requiredIfApplicable")
|
|
30622
|
-
}
|
|
30623
|
-
})]
|
|
30624
|
-
})]
|
|
30625
|
-
});
|
|
30626
|
-
};
|
|
30627
30702
|
const EntityGuidanceStatus = ({
|
|
30628
30703
|
country,
|
|
30629
30704
|
currentTask,
|
|
@@ -30659,8 +30734,7 @@ const DecisionMakersComponent = ({
|
|
|
30659
30734
|
handleUpdateLegalEntity,
|
|
30660
30735
|
navigateBackToTaskList,
|
|
30661
30736
|
onDecisionMakerDelete,
|
|
30662
|
-
|
|
30663
|
-
disableDeleteDecisionMakers
|
|
30737
|
+
trustedEntityAssociations
|
|
30664
30738
|
}) => {
|
|
30665
30739
|
var _a, _b;
|
|
30666
30740
|
const {
|
|
@@ -30756,17 +30830,16 @@ const DecisionMakersComponent = ({
|
|
|
30756
30830
|
children: [hasExpired && jsx(ExpiredBanner, {}), jsx(FormHeader, {
|
|
30757
30831
|
heading: i18n.get("decisionMaker"),
|
|
30758
30832
|
description: i18n.get("decisionMakerDescription")
|
|
30759
|
-
}), jsx(
|
|
30833
|
+
}), jsx("div", {
|
|
30760
30834
|
className: "adyen-kyc-decision-makers__container",
|
|
30761
30835
|
children: availableDecisionMakers.map(({
|
|
30762
30836
|
roleType,
|
|
30763
|
-
min
|
|
30764
|
-
max
|
|
30837
|
+
min
|
|
30765
30838
|
}) => jsx(EntityGuidanceStatus, {
|
|
30766
30839
|
country: registeredCountry,
|
|
30767
30840
|
currentTask: TaskTypes.DECISION_MAKER_OVERVIEW,
|
|
30768
30841
|
entityLabel: roleType,
|
|
30769
|
-
status: iconStatus(uniqueDecisionMakersPerType(roleType), min
|
|
30842
|
+
status: iconStatus(uniqueDecisionMakersPerType(roleType), min)
|
|
30770
30843
|
}, roleType))
|
|
30771
30844
|
}), jsx(ContextGuidance, {
|
|
30772
30845
|
page: "Decision makers",
|
|
@@ -30800,7 +30873,7 @@ const DecisionMakersComponent = ({
|
|
|
30800
30873
|
removeEntity: () => {
|
|
30801
30874
|
deleteDecisionMaker(decisionMaker);
|
|
30802
30875
|
},
|
|
30803
|
-
isRemoveDisabled: isRemoveDisabled ||
|
|
30876
|
+
isRemoveDisabled: isRemoveDisabled || trustedEntityAssociations.some((ea) => ea.reference === decisionMaker.reference),
|
|
30804
30877
|
handleIsRemoveDisabled: setIsRemoveDisabled
|
|
30805
30878
|
}, decisionMaker.reference))
|
|
30806
30879
|
}) : null, jsx(Button, {
|
|
@@ -30811,7 +30884,7 @@ const DecisionMakersComponent = ({
|
|
|
30811
30884
|
icon: "plus",
|
|
30812
30885
|
onClick: addDecisionMakerOnClick,
|
|
30813
30886
|
label: i18n.get("addDecisionMaker"),
|
|
30814
|
-
disabled: haveMaxDecisionMakers
|
|
30887
|
+
disabled: haveMaxDecisionMakers
|
|
30815
30888
|
}), jsx(ActionBar, {
|
|
30816
30889
|
onHome: () => {
|
|
30817
30890
|
userEvents.addEvent("Saved decision makers list", {
|
|
@@ -32189,18 +32262,17 @@ const TrustMembersOverview = ({
|
|
|
32189
32262
|
children: [hasExpired && jsx(ExpiredBanner, {}), jsx(FormHeader, {
|
|
32190
32263
|
heading: i18n.get("trustMembers"),
|
|
32191
32264
|
description: i18n.get("trustMembersDescription")
|
|
32192
|
-
}), jsx(
|
|
32265
|
+
}), jsx("div", {
|
|
32193
32266
|
className: "adyen-kyc-trust-members__container",
|
|
32194
32267
|
children: trustMemberRequirements.map(({
|
|
32195
32268
|
roleTypes,
|
|
32196
32269
|
min,
|
|
32197
|
-
max,
|
|
32198
32270
|
label
|
|
32199
32271
|
}) => jsx(EntityGuidanceStatus, {
|
|
32200
32272
|
country: CountryCodes.Australia,
|
|
32201
32273
|
currentTask: TaskTypes.TRUST_MEMBER_OVERVIEW,
|
|
32202
32274
|
entityLabel: label,
|
|
32203
|
-
status: iconStatus(trustMembersWithOneOfGivenRoles(roleTypes).length, min
|
|
32275
|
+
status: iconStatus(trustMembersWithOneOfGivenRoles(roleTypes).length, min)
|
|
32204
32276
|
}, label))
|
|
32205
32277
|
}), jsx(ContextGuidance, {
|
|
32206
32278
|
page: "Trust members",
|
|
@@ -32390,8 +32462,9 @@ function IndividualDropinComponent({
|
|
|
32390
32462
|
hideNavigation = false,
|
|
32391
32463
|
asModal = false,
|
|
32392
32464
|
handleBackClick: externalBackClick,
|
|
32393
|
-
trustedFields
|
|
32394
|
-
trustedFieldsProvider
|
|
32465
|
+
trustedFields,
|
|
32466
|
+
trustedFieldsProvider,
|
|
32467
|
+
trustedRoles
|
|
32395
32468
|
}) {
|
|
32396
32469
|
var _a, _b, _c, _d;
|
|
32397
32470
|
const {
|
|
@@ -32417,7 +32490,7 @@ function IndividualDropinComponent({
|
|
|
32417
32490
|
let dataFromResponse = mapLegalEntityToIndividual(legalEntityResponse, isTargetLegalEntityType);
|
|
32418
32491
|
const documentUtils = documentApiUtils(handleCreateDocument, handleGetDocument, handleUpdateDocument);
|
|
32419
32492
|
let roleTypes = [];
|
|
32420
|
-
const [newDecisionMaker
|
|
32493
|
+
const [newDecisionMaker] = useState();
|
|
32421
32494
|
const [problems, setProblems] = useState(propProblems);
|
|
32422
32495
|
const formRef = useRef(null);
|
|
32423
32496
|
const [loadingStatus, setLoadingStatus] = useState("success");
|
|
@@ -32426,7 +32499,7 @@ function IndividualDropinComponent({
|
|
|
32426
32499
|
const [country, setCountry] = useState(((_a = dataFromResponse == null ? void 0 : dataFromResponse.personalDetails) == null ? void 0 : _a.residencyCountry) ?? parentCountry);
|
|
32427
32500
|
const [hideFooter, setHideFooter] = useState(false);
|
|
32428
32501
|
const {
|
|
32429
|
-
trustedFields:
|
|
32502
|
+
trustedFields: associatedLegalEntityTrustedFields
|
|
32430
32503
|
} = useSingpassMyInfoLogin({
|
|
32431
32504
|
legalEntity: legalEntityResponse,
|
|
32432
32505
|
accountHolder,
|
|
@@ -32552,7 +32625,6 @@ function IndividualDropinComponent({
|
|
|
32552
32625
|
throw new Error("Provide handler to create legalEntity");
|
|
32553
32626
|
}
|
|
32554
32627
|
updatedLegalEntity = await handleCreateLegalEntity(legalEntity);
|
|
32555
|
-
setNewDecisionMaker(legalEntity);
|
|
32556
32628
|
userEvents.addEvent("Added decision maker", {
|
|
32557
32629
|
segmentation: {
|
|
32558
32630
|
...baseTrackingPayload,
|
|
@@ -32883,8 +32955,9 @@ function IndividualDropinComponent({
|
|
|
32883
32955
|
shouldValidate,
|
|
32884
32956
|
accountHolder,
|
|
32885
32957
|
parentLegalEntity,
|
|
32886
|
-
trustedFields: !parentLegalEntity ?
|
|
32887
|
-
trustedFieldsProvider
|
|
32958
|
+
trustedFields: !parentLegalEntity ? trustedFields : associatedLegalEntityTrustedFields,
|
|
32959
|
+
trustedFieldsProvider,
|
|
32960
|
+
trustedRoles
|
|
32888
32961
|
})
|
|
32889
32962
|
});
|
|
32890
32963
|
}
|
|
@@ -35474,7 +35547,7 @@ function DropinComposerComponent({
|
|
|
35474
35547
|
onNavigate = noop,
|
|
35475
35548
|
...args
|
|
35476
35549
|
}) {
|
|
35477
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
35550
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
35478
35551
|
const {
|
|
35479
35552
|
contextCountry,
|
|
35480
35553
|
accountHolder,
|
|
@@ -35518,13 +35591,14 @@ function DropinComposerComponent({
|
|
|
35518
35591
|
handleSingpassMyInfoLoginSuccess,
|
|
35519
35592
|
handleSingpassMyInfoLoginFailure,
|
|
35520
35593
|
handleSingpassMyInfoLoginReset,
|
|
35521
|
-
trustedFields: singpassTrustedFields
|
|
35594
|
+
trustedFields: singpassTrustedFields,
|
|
35595
|
+
trustedEntityAssociations
|
|
35522
35596
|
} = useSingpassMyInfoLogin({
|
|
35523
35597
|
legalEntity: rootLegalEntity,
|
|
35524
35598
|
accountHolder,
|
|
35525
35599
|
handleOpenSingpassAuthorizationLink
|
|
35526
35600
|
});
|
|
35527
|
-
const
|
|
35601
|
+
const singpassTabRef = useRef(null);
|
|
35528
35602
|
const rootLegalEntityCountry = getLegalEntityCountry(rootLegalEntity);
|
|
35529
35603
|
const [associatedLegalEntity, setAssociatedLegalEntity] = useState(null);
|
|
35530
35604
|
const {
|
|
@@ -35836,7 +35910,8 @@ function DropinComposerComponent({
|
|
|
35836
35910
|
try {
|
|
35837
35911
|
const authUrl = await handleInitiateSingpassMyInfoLogin();
|
|
35838
35912
|
setHasSeenSingpassSelection(true);
|
|
35839
|
-
window.open(authUrl, "_blank")
|
|
35913
|
+
singpassTabRef.current = window.open(authUrl, "_blank");
|
|
35914
|
+
singpassTabRef.current.focus();
|
|
35840
35915
|
} catch (e) {
|
|
35841
35916
|
logger$d.error(e);
|
|
35842
35917
|
handleSingpassMyInfoLoginFailure(e);
|
|
@@ -36074,7 +36149,8 @@ function DropinComposerComponent({
|
|
|
36074
36149
|
onClick: async () => {
|
|
36075
36150
|
try {
|
|
36076
36151
|
const authUrl = await handleInitiateSingpassMyInfoLogin();
|
|
36077
|
-
window.open(authUrl
|
|
36152
|
+
singpassTabRef.current = window.open(authUrl);
|
|
36153
|
+
singpassTabRef.current.focus();
|
|
36078
36154
|
} catch (e) {
|
|
36079
36155
|
logger$d.error(e);
|
|
36080
36156
|
handleSingpassMyInfoLoginFailure(e);
|
|
@@ -36088,6 +36164,7 @@ function DropinComposerComponent({
|
|
|
36088
36164
|
if (isSuccessful) {
|
|
36089
36165
|
handleSingpassMyInfoLoginSuccess();
|
|
36090
36166
|
await refreshLegalEntity();
|
|
36167
|
+
singpassTabRef.current.close();
|
|
36091
36168
|
} else {
|
|
36092
36169
|
handleSingpassMyInfoLoginFailure(legalEntityResponse.type === LegalEntityType.INDIVIDUAL ? "weCouldntConnectToMyinfo" : "weCouldntConnectToMyinfoBusiness");
|
|
36093
36170
|
}
|
|
@@ -36164,8 +36241,7 @@ function DropinComposerComponent({
|
|
|
36164
36241
|
navigateBackToTaskList: navigateBack,
|
|
36165
36242
|
onDecisionMakerDelete: refreshLegalEntity,
|
|
36166
36243
|
capabilityProblems,
|
|
36167
|
-
|
|
36168
|
-
disableDeleteDecisionMakers: hasUsedSingpass
|
|
36244
|
+
trustedEntityAssociations
|
|
36169
36245
|
});
|
|
36170
36246
|
case TaskTypes.INDIVIDUAL:
|
|
36171
36247
|
return jsx(IndividualDropinComponent, {
|
|
@@ -36234,7 +36310,8 @@ function DropinComposerComponent({
|
|
|
36234
36310
|
handleGetIdVerificationStartCheck: args == null ? void 0 : args.handleGetIdVerificationStartCheck,
|
|
36235
36311
|
handleOpenSingpassAuthorizationLink: args == null ? void 0 : args.handleOpenSingpassAuthorizationLink,
|
|
36236
36312
|
trustedFields: singpassTrustedFields,
|
|
36237
|
-
trustedFieldsProvider: isEligibleForSingpass && TrustedFieldsProvider.SINGPASS
|
|
36313
|
+
trustedFieldsProvider: isEligibleForSingpass && TrustedFieldsProvider.SINGPASS,
|
|
36314
|
+
trustedRoles: ((_d = trustedEntityAssociations.find((ea) => ea.reference === (associatedLegalEntity == null ? void 0 : associatedLegalEntity.id))) == null ? void 0 : _d.types) || []
|
|
36238
36315
|
});
|
|
36239
36316
|
case TaskTypes.TRUST_MEMBER_COMPANY_OWNER:
|
|
36240
36317
|
return jsx(IndividualDropinComponent, {
|
|
@@ -36315,8 +36392,7 @@ function DropinComposerComponent({
|
|
|
36315
36392
|
handleFindAddress: args == null ? void 0 : args.handleFindAddress,
|
|
36316
36393
|
onTypeSwitch: navigateToTypeSwitcher,
|
|
36317
36394
|
isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION,
|
|
36318
|
-
trustedFields: singpassTrustedFields
|
|
36319
|
-
trustedFieldsProvider: isEligibleForSingpass && TrustedFieldsProvider.SINGPASS
|
|
36395
|
+
trustedFields: singpassTrustedFields
|
|
36320
36396
|
});
|
|
36321
36397
|
case TaskTypes.COMPANY_SEARCH:
|
|
36322
36398
|
return jsx(CompanySearchDropinComponent, {
|
|
@@ -36406,7 +36482,7 @@ function DropinComposerComponent({
|
|
|
36406
36482
|
parentLegalEntity: associatedLegalArrangement,
|
|
36407
36483
|
legalEntityResponse: associatedLegalEntity,
|
|
36408
36484
|
capabilities: getCapabilities(legalEntityResponse),
|
|
36409
|
-
problems: (
|
|
36485
|
+
problems: (_e = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _e[rootLegalEntity.id],
|
|
36410
36486
|
onChange: componentOnChange,
|
|
36411
36487
|
onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 2),
|
|
36412
36488
|
handleBackClick: navigateBack,
|
|
@@ -36424,7 +36500,7 @@ function DropinComposerComponent({
|
|
|
36424
36500
|
},
|
|
36425
36501
|
taskType: currentTask,
|
|
36426
36502
|
taskName: currentTask === TaskTypes.PAYIN ? "payinDetails" : "payoutDetails",
|
|
36427
|
-
problems: (
|
|
36503
|
+
problems: (_f = capabilityProblems == null ? void 0 : capabilityProblems.BankAccount) == null ? void 0 : _f[transferInstrument == null ? void 0 : transferInstrument.id],
|
|
36428
36504
|
transferInstrument,
|
|
36429
36505
|
setTransferInstrument,
|
|
36430
36506
|
legalEntityResponse: rootLegalEntity,
|
|
@@ -36452,7 +36528,7 @@ function DropinComposerComponent({
|
|
|
36452
36528
|
topLevelLegalEntity: legalEntityResponse
|
|
36453
36529
|
},
|
|
36454
36530
|
taskType: TaskTypes.TRUST,
|
|
36455
|
-
problems: (
|
|
36531
|
+
problems: (_g = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _g[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
|
|
36456
36532
|
parentLegalEntity: rootLegalEntity,
|
|
36457
36533
|
legalEntityResponse: associatedLegalArrangement,
|
|
36458
36534
|
capabilities: getCapabilities(legalEntityResponse),
|
|
@@ -36460,7 +36536,7 @@ function DropinComposerComponent({
|
|
|
36460
36536
|
onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 1),
|
|
36461
36537
|
handleHomeClick: navigateBack,
|
|
36462
36538
|
homeButtonLabel: i18n.get("saveAndGoToOverview"),
|
|
36463
|
-
country: (((
|
|
36539
|
+
country: (((_h = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.trust) == null ? void 0 : _h.countryOfGoverningLaw) || ((_i = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.trust) == null ? void 0 : _i.registeredAddress.country)) ?? rootLegalEntityCountry,
|
|
36464
36540
|
handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
|
|
36465
36541
|
handleFindAddress: args == null ? void 0 : args.handleFindAddress
|
|
36466
36542
|
});
|
|
@@ -36506,12 +36582,12 @@ function DropinComposerComponent({
|
|
|
36506
36582
|
parentLegalEntity: rootLegalEntity,
|
|
36507
36583
|
legalEntityResponse: associatedLegalArrangement,
|
|
36508
36584
|
capabilities: getCapabilities(legalEntityResponse),
|
|
36509
|
-
problems: (
|
|
36585
|
+
problems: (_j = capabilityProblems == null ? void 0 : capabilityProblems.LegalEntity) == null ? void 0 : _j[associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.id],
|
|
36510
36586
|
onChange: componentOnChange,
|
|
36511
36587
|
onSubmit: (data) => refreshLegalArrangementAndRunOnSubmit(data, 1),
|
|
36512
36588
|
handleHomeClick: navigateBack,
|
|
36513
36589
|
homeButtonLabel: i18n.get("saveAndGoToOverview"),
|
|
36514
|
-
country: (((
|
|
36590
|
+
country: (((_k = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.soleProprietorship) == null ? void 0 : _k.countryOfGoverningLaw) || ((_m = (_l = associatedLegalArrangement == null ? void 0 : associatedLegalArrangement.soleProprietorship) == null ? void 0 : _l.registeredAddress) == null ? void 0 : _m.country)) ?? rootLegalEntityCountry,
|
|
36515
36591
|
handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
|
|
36516
36592
|
handleFindAddress: args == null ? void 0 : args.handleFindAddress
|
|
36517
36593
|
});
|
|
@@ -39360,7 +39436,7 @@ const ConfigurationApiProvider = ({
|
|
|
39360
39436
|
isEmbeddedDropin,
|
|
39361
39437
|
loadingContext
|
|
39362
39438
|
} = authContext;
|
|
39363
|
-
const sdkVersion = "2.
|
|
39439
|
+
const sdkVersion = "2.54.0";
|
|
39364
39440
|
useAnalytics({
|
|
39365
39441
|
onUserEvent,
|
|
39366
39442
|
legalEntityId: rootLegalEntityId,
|
|
@@ -40038,7 +40114,7 @@ const DebugModal = ({
|
|
|
40038
40114
|
};
|
|
40039
40115
|
const copyToClipboard = async () => {
|
|
40040
40116
|
const toCopy = {
|
|
40041
|
-
sdkVersion: "2.
|
|
40117
|
+
sdkVersion: "2.54.0",
|
|
40042
40118
|
experiments: Object.fromEntries(allExperimentsWithValues),
|
|
40043
40119
|
settings: Object.fromEntries(allSettingsWithValues)
|
|
40044
40120
|
};
|
|
@@ -40077,7 +40153,7 @@ const DebugModal = ({
|
|
|
40077
40153
|
children: [jsxs("div", {
|
|
40078
40154
|
className: "adyen-kyc-debug-modal__meta",
|
|
40079
40155
|
children: [jsxs("span", {
|
|
40080
|
-
children: ["SDK version: ", "2.
|
|
40156
|
+
children: ["SDK version: ", "2.54.0"]
|
|
40081
40157
|
}), jsxs("span", {
|
|
40082
40158
|
children: ["rootLegalEntityId: ", rootLegalEntityId]
|
|
40083
40159
|
})]
|