@adyen/kyc-components 2.44.1 → 2.45.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/es/adyen-kyc-components.es.js +1169 -379
  2. package/dist/style.css +1104 -2254
  3. package/dist/types/components/BusinessDetails/forms.d.ts +2 -1
  4. package/dist/types/components/CompanyOtherDetails/types.d.ts +2 -1
  5. package/dist/types/components/CompanyRegistrationDetails/types.d.ts +1 -0
  6. package/dist/types/components/Dropins/CompanyDropin/components/CompanyDropinComponent.d.ts +1 -1
  7. package/dist/types/components/Dropins/CompanyDropin/types.d.ts +0 -2
  8. package/dist/types/components/Dropins/HighExposureDropin/components/AdditionalFieldsForHighExposureCompany.d.ts +4 -0
  9. package/dist/types/components/Dropins/HighExposureDropin/components/AdditionalFieldsForHighExposureParentCompany.d.ts +4 -0
  10. package/dist/types/components/Dropins/HighExposureDropin/components/AdditionalFieldsForHighExposureUltimateParentCompany.d.ts +4 -0
  11. package/dist/types/components/Dropins/HighExposureDropin/components/HighExposureDropinComponent.d.ts +6 -0
  12. package/dist/types/components/Dropins/HighExposureDropin/types.d.ts +34 -0
  13. package/dist/types/components/Dropins/HighExposureDropin/validate.d.ts +3 -0
  14. package/dist/types/components/EmbeddedDropins/UpdateLegalEntityForHighExposure/UpdateLegalEntityForHighExposure.d.ts +2 -0
  15. package/dist/types/components/Individual/types.d.ts +3 -1
  16. package/dist/types/components/index.d.ts +2 -0
  17. package/dist/types/components/internal/FormFields/Field/Field.d.ts +5 -3
  18. package/dist/types/components/internal/IdFieldTypeSelector/countryIdNumberTypes.d.ts +8 -0
  19. package/dist/types/components/internal/IdFieldTypeSelector/inferTaxIdNumberType.d.ts +4 -1
  20. package/dist/types/components/internal/StockISINField/types.d.ts +1 -1
  21. package/dist/types/components/internal/StockTickerSymbol/StockTickerSymbolField.d.ts +3 -0
  22. package/dist/types/components/internal/StockTickerSymbol/fieldConfig.d.ts +3 -0
  23. package/dist/types/components/internal/StockTickerSymbol/index.d.ts +1 -0
  24. package/dist/types/components/internal/StockTickerSymbol/types.d.ts +5 -0
  25. package/dist/types/components/internal/TaxId/fieldConfig.d.ts +3 -0
  26. package/dist/types/core/Context/StateContext/types.d.ts +2 -1
  27. package/dist/types/core/Services/componentApi/push-events.d.ts +1 -2
  28. package/dist/types/core/hooks/useAnalytics.d.ts +9 -3
  29. package/dist/types/core/hooks/useCanSeeEntitySelection.d.ts +6 -0
  30. package/dist/types/core/process-field-configurations.d.ts +2 -0
  31. package/dist/types/core/user-events.d.ts +4 -8
  32. package/dist/types/core/utils.d.ts +1 -1
  33. package/dist/types/utils/api/processValidationErrors.d.ts +4 -1
  34. package/dist/types/utils/get-props.d.ts +17 -0
  35. package/dist/types/utils/getNestedPropertyKeys.d.ts +1 -1
  36. package/dist/types/utils/mapping/componentApiMapping.d.ts +16 -3
  37. package/dist/types/utils/mapping/mapping.d.ts +3 -0
  38. package/package.json +4 -2
@@ -4,9 +4,12 @@ import { sanitize } from "isomorphic-dompurify";
4
4
  import cx from "classnames";
5
5
  import { lazy, Suspense, useId, forwardRef, memo, useMemo as useMemo$1, useEffect as useEffect$1, useState as useState$1 } from "preact/compat";
6
6
  import { jsx, jsxs, Fragment } from "preact/jsx-runtime";
7
- import { debounce, noop as noop$1, isEmpty as isEmpty$1, range } from "lodash";
7
+ import debounce from "lodash-es/debounce";
8
8
  import isISIN from "validator/es/lib/isISIN.js";
9
9
  import OpenBankingSDK from "@adyen/openbankingsdk";
10
+ import isEmpty$1 from "lodash-es/isEmpty";
11
+ import noop$1 from "lodash-es/noop";
12
+ import range from "lodash-es/range";
10
13
  import { jsxs as jsxs$1, jsx as jsx$1 } from "preact/compat/jsx-runtime";
11
14
  import "@adyen/adyen-document-viewer/dist/adyen-document-viewer.min.css";
12
15
  import AdyenDocumentViewer from "@adyen/adyen-document-viewer";
@@ -43,7 +46,8 @@ const payoutAccount = "Payout account";
43
46
  const payinAccount = "Payin account";
44
47
  const firstName = "First name";
45
48
  const lastName = "Last name";
46
- const country = "Country/region of establishment";
49
+ const country = "Country/region";
50
+ const countryRegionOfEstablishment = "Country/region of establishment";
47
51
  const street = "Street";
48
52
  const otherAddressInformation = "Other address information (optional)";
49
53
  const postalCode = "Postal code";
@@ -477,6 +481,7 @@ const companyLegalName = "Company legal name";
477
481
  const companyName = "Company name";
478
482
  const companyType = "Company type";
479
483
  const taxReferenceNumber = "Tax reference number";
484
+ const taxpayerReferenceNumber = "Taxpayer reference number";
480
485
  const SST = "SST";
481
486
  const companyProfile = "Company profile";
482
487
  const companyNumber = "Company number";
@@ -576,7 +581,6 @@ const otherTrust = "Other trust";
576
581
  const pooledSuperannuationTrust = "Pooled superannuation trust";
577
582
  const publicTradingTrust = "Public trading trust";
578
583
  const unlistedPublicUnitTrust = "Unlisted public unit trust";
579
- const countryRegionOfEstablishment = "Country/region of establishment";
580
584
  const nameOfTrustAgreement = "Name of trust agreement";
581
585
  const typeOfTrustAgreement = "Type of trust agreement";
582
586
  const objectOfCharitableTrust = "Object of charitable trust";
@@ -927,6 +931,7 @@ const taxInformationNumber = "Tax Identification Number";
927
931
  const taxInformationNumber__HK = "Business Registration number (BRN)";
928
932
  const stockExchangeMIC = "Market Identifier Code (MIC)";
929
933
  const stockISIN = "International Securities Identification Number (ISIN)";
934
+ const stockTickerSymbol = "Stock ticker symbol";
930
935
  const companyLookupResultsHeader = "Let's find your company";
931
936
  const companyLookupResultsHeader__searching = "Searching for companies...";
932
937
  const companyLookupResultsHeader__verifying = "Verifying company selection...";
@@ -1326,6 +1331,14 @@ const thisPageIsNowInactive = "This page is now inactive";
1326
1331
  const startANewSessionFromTheSamePlaceYouOriginallyAccessed = "Start a new session from the same place you originally accessed this page.";
1327
1332
  const differentCountryOfGoverningLaw = "This company has a different country/region of governing law";
1328
1333
  const countryOfGoverningLaw = "Country/region of governing law";
1334
+ const nationalInsuranceNumber = "National Insurance Number (NINO)";
1335
+ const detailsForCapital = "Details for capital";
1336
+ const parentCompany = "Parent company";
1337
+ const ultimateParentCompany = "Ultimate parent company";
1338
+ const numberOfEmployees = "Number of employees";
1339
+ const parentCompanyDetails = "Parent company details";
1340
+ const ultimateParentCompanyDetails = "Ultimate parent company details";
1341
+ const euFinancialRegulationsRequireUs = "EU financial regulations require us to collect this information. This won’t affect your business credit score.";
1329
1342
  const defaultTrans = {
1330
1343
  smartling,
1331
1344
  close,
@@ -1335,6 +1348,7 @@ const defaultTrans = {
1335
1348
  firstName,
1336
1349
  lastName,
1337
1350
  country,
1351
+ countryRegionOfEstablishment,
1338
1352
  street,
1339
1353
  otherAddressInformation,
1340
1354
  postalCode,
@@ -1768,6 +1782,7 @@ const defaultTrans = {
1768
1782
  companyName,
1769
1783
  companyType,
1770
1784
  taxReferenceNumber,
1785
+ taxpayerReferenceNumber,
1771
1786
  SST,
1772
1787
  companyProfile,
1773
1788
  companyNumber,
@@ -1872,7 +1887,6 @@ const defaultTrans = {
1872
1887
  pooledSuperannuationTrust,
1873
1888
  publicTradingTrust,
1874
1889
  unlistedPublicUnitTrust,
1875
- countryRegionOfEstablishment,
1876
1890
  nameOfTrustAgreement,
1877
1891
  typeOfTrustAgreement,
1878
1892
  objectOfCharitableTrust,
@@ -2226,6 +2240,7 @@ const defaultTrans = {
2226
2240
  taxInformationNumber__HK,
2227
2241
  stockExchangeMIC,
2228
2242
  stockISIN,
2243
+ stockTickerSymbol,
2229
2244
  companyLookupResultsHeader,
2230
2245
  companyLookupResultsHeader__searching,
2231
2246
  companyLookupResultsHeader__verifying,
@@ -2626,7 +2641,15 @@ const defaultTrans = {
2626
2641
  thisPageIsNowInactive,
2627
2642
  startANewSessionFromTheSamePlaceYouOriginallyAccessed,
2628
2643
  differentCountryOfGoverningLaw,
2629
- countryOfGoverningLaw
2644
+ countryOfGoverningLaw,
2645
+ nationalInsuranceNumber,
2646
+ detailsForCapital,
2647
+ parentCompany,
2648
+ ultimateParentCompany,
2649
+ numberOfEmployees,
2650
+ parentCompanyDetails,
2651
+ ultimateParentCompanyDetails,
2652
+ euFinancialRegulationsRequireUs
2630
2653
  };
2631
2654
  const FALLBACK_LOCALE = "en-US";
2632
2655
  const defaultTranslation = Object.entries(defaultTrans).reduce((acc, [translationKey, translationValue]) => translationKey !== "smartling" ? {
@@ -3057,7 +3080,7 @@ const icons = {
3057
3080
  warning: lazy(() => import("./warning-99uFf1WU.js")),
3058
3081
  wrong: lazy(() => import("./wrong-1wvh7nZe.js"))
3059
3082
  };
3060
- const logger$v = createLogger("Icon");
3083
+ const logger$w = createLogger("Icon");
3061
3084
  const Icon = ({
3062
3085
  className,
3063
3086
  name,
@@ -3065,7 +3088,7 @@ const Icon = ({
3065
3088
  }) => {
3066
3089
  const LazyLoadedIcon = icons[name];
3067
3090
  if (!LazyLoadedIcon) {
3068
- logger$v.error(`No such icon: "${name}"`);
3091
+ logger$w.error(`No such icon: "${name}"`);
3069
3092
  return null;
3070
3093
  }
3071
3094
  return jsx("span", {
@@ -3281,7 +3304,7 @@ function useFormRouterContext() {
3281
3304
  }
3282
3305
  return context;
3283
3306
  }
3284
- const logger$u = createLogger("Link");
3307
+ const logger$v = createLogger("Link");
3285
3308
  const getIconClass = (icon, external) => {
3286
3309
  if (external) {
3287
3310
  return "adyen-kyc-link__icon adyen-kyc-icon-external-link";
@@ -3293,7 +3316,7 @@ const getIconClass = (icon, external) => {
3293
3316
  };
3294
3317
  const isValidLink = (href) => {
3295
3318
  if (href === "#") {
3296
- logger$u.error('Links must include a valid href. If your href is "#", consider using a Button instead');
3319
+ logger$v.error('Links must include a valid href. If your href is "#", consider using a Button instead');
3297
3320
  return false;
3298
3321
  }
3299
3322
  return true;
@@ -3468,6 +3491,49 @@ function getFormProps(props, innerFormId) {
3468
3491
  shouldValidate: (activeFormId ? activeFormId === innerFormId : true) && props.shouldValidate
3469
3492
  };
3470
3493
  }
3494
+ function removeFormLayer(obj, formId) {
3495
+ if (!obj) {
3496
+ return obj;
3497
+ }
3498
+ const formIdWithDelimiter = `${formId}.`;
3499
+ return Object.entries(obj).reduce((acc, [key, value]) => {
3500
+ const newKey = key.startsWith(formIdWithDelimiter) ? key.substring(formIdWithDelimiter.length, key.length) : key;
3501
+ return {
3502
+ ...acc,
3503
+ [newKey]: value
3504
+ };
3505
+ }, {});
3506
+ }
3507
+ function getNestedOuterFormPropsFromOuterFormProps(props, innerFormId) {
3508
+ const newProps = getFormProps(props, innerFormId);
3509
+ if (newProps === null) {
3510
+ return null;
3511
+ }
3512
+ const {
3513
+ placeholders,
3514
+ labels: labels2,
3515
+ data,
3516
+ helperText,
3517
+ masks
3518
+ } = newProps;
3519
+ return {
3520
+ placeholders,
3521
+ labels: labels2,
3522
+ data,
3523
+ helperText,
3524
+ masks,
3525
+ // maintain the structure of the special fields
3526
+ readOnlyFields: removeFormLayer(props.readOnlyFields, innerFormId),
3527
+ requiredFields: removeFormLayer(props.requiredFields, innerFormId),
3528
+ optionalFields: removeFormLayer(props.optionalFields, innerFormId),
3529
+ obscuredFields: removeFormLayer(props.obscuredFields, innerFormId),
3530
+ verifyFields: removeFormLayer(props.verifyFields, innerFormId),
3531
+ // the rest we just pass along for now, as they will be eventually be processed by getFormProps
3532
+ problems: props.problems,
3533
+ validators: props.validators,
3534
+ shouldValidate: props.shouldValidate
3535
+ };
3536
+ }
3471
3537
  function getFieldProps(props, innerFormFields) {
3472
3538
  if (innerFormFields) {
3473
3539
  const nestedFormProps = {
@@ -3608,7 +3674,7 @@ const useSetting = (settingName) => {
3608
3674
  } = context;
3609
3675
  return getSetting(settingName);
3610
3676
  };
3611
- const logger$t = createLogger("useAllowedCountries");
3677
+ const logger$u = createLogger("useAllowedCountries");
3612
3678
  const useAllowedCountries = () => {
3613
3679
  const acceptedCountries = useSetting("acceptedCountries");
3614
3680
  const {
@@ -3617,7 +3683,7 @@ const useAllowedCountries = () => {
3617
3683
  const [allowedCountries, setAllowedCountries] = useState(acceptedCountries);
3618
3684
  useEffect(() => {
3619
3685
  if (acceptedCountries !== void 0) return;
3620
- getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$t.error);
3686
+ getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$u.error);
3621
3687
  }, [acceptedCountries]);
3622
3688
  return allowedCountries;
3623
3689
  };
@@ -3970,7 +4036,7 @@ function reducer({
3970
4036
  }
3971
4037
  };
3972
4038
  }
3973
- const logger$s = createLogger("useAsyncValidator");
4039
+ const logger$t = createLogger("useAsyncValidator");
3974
4040
  const useAsyncValidator = (asyncRules) => {
3975
4041
  const [asyncValidationResults, setAsyncValidationResults] = useState({});
3976
4042
  const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
@@ -3991,7 +4057,7 @@ const useAsyncValidator = (asyncRules) => {
3991
4057
  hasError: !isValid
3992
4058
  }])
3993
4059
  });
3994
- }).catch(logger$s.error);
4060
+ }).catch(logger$t.error);
3995
4061
  }, [asyncRules, clearAsyncValidationResults]);
3996
4062
  return {
3997
4063
  asyncValidationResults,
@@ -4268,10 +4334,13 @@ const ARIA_ERROR_SUFFIX = "-ariaError";
4268
4334
  const MaybeLabelElement = ({
4269
4335
  children,
4270
4336
  ...props
4271
- }) => props.useLabelElement === true ? jsx("label", {
4272
- ...props,
4273
- children
4274
- }) : jsx("div", {
4337
+ }) => props.useLabelElement === true ? (
4338
+ // eslint-disable-next-line jsx-a11y/label-has-associated-control
4339
+ jsx("label", {
4340
+ ...props,
4341
+ children
4342
+ })
4343
+ ) : jsx("div", {
4275
4344
  ...props,
4276
4345
  role: "form",
4277
4346
  children
@@ -5916,7 +5985,7 @@ const deriveInputState = (isValid, isFocused, isDisabled, isOptional, hasNullish
5916
5985
  };
5917
5986
  };
5918
5987
  const MISMATCH_ANIMATION_NAME = "mismatchShake";
5919
- const logger$r = createLogger("MaskedInputText");
5988
+ const logger$s = createLogger("MaskedInputText");
5920
5989
  const MaskedInputText = ({
5921
5990
  value,
5922
5991
  onInput,
@@ -5957,7 +6026,7 @@ const MaskedInputText = ({
5957
6026
  };
5958
6027
  useEffect(() => {
5959
6028
  if (!mask) {
5960
- logger$r.warn("`mask` is undefined. No masking of input will take place.");
6029
+ logger$s.warn("`mask` is undefined. No masking of input will take place.");
5961
6030
  }
5962
6031
  }, [mask]);
5963
6032
  const getMaskResult = useCallback((pureValue) => {
@@ -5982,7 +6051,7 @@ const MaskedInputText = ({
5982
6051
  return;
5983
6052
  }
5984
6053
  const fallback = displayValueToPure(maskResult.partialDisplayValue);
5985
- logger$r.warn(`Value received "${value}" does not match mask`, maskResult, `
6054
+ logger$s.warn(`Value received "${value}" does not match mask`, maskResult, `
5986
6055
  Falling back to partially valid value "${fallback}"`);
5987
6056
  onInput(fallback);
5988
6057
  }
@@ -6262,6 +6331,14 @@ const taxIdNumberOptions = {
6262
6331
  }, {
6263
6332
  id: "uen",
6264
6333
  name: "uen"
6334
+ }],
6335
+ [CountryCodes.Jersey]: [{
6336
+ id: "taxIdentificationNumber",
6337
+ name: "taxIdentificationNumber"
6338
+ }, {
6339
+ id: "socialSecurityNumber",
6340
+ name: "socialSecurityNumber",
6341
+ applicableOnlyFor: [CompanyTypesValue.SOLE_PROPRIETORSHIP]
6265
6342
  }]
6266
6343
  };
6267
6344
  const getTaxIdNumberOptions = (country2, companyType2) => {
@@ -7742,19 +7819,20 @@ const Accordion = ({
7742
7819
  };
7743
7820
  return jsxs("details", {
7744
7821
  onToggle: handleToggle,
7745
- className,
7822
+ className: cx(className, "adyen-kyc-accordion__details"),
7746
7823
  children: [jsxs("summary", {
7824
+ className: "adyen-kyc-accordion__summary",
7747
7825
  children: [expandOnLeft && jsx("img", {
7748
- className: "arrow",
7826
+ className: "adyen-kyc-accordion__arrow",
7749
7827
  src: ChevronDownIcon,
7750
7828
  alt: ""
7751
7829
  }), icon, title, !expandOnLeft && jsx("img", {
7752
- className: "arrow arrow-right",
7830
+ className: "adyen-kyc-accordion__arrow adyen-kyc-accordion__arrow--right",
7753
7831
  src: ChevronDownIcon,
7754
7832
  alt: ""
7755
7833
  })]
7756
7834
  }), jsx("section", {
7757
- className: "content",
7835
+ className: "adyen-kyc-accordion__content",
7758
7836
  children
7759
7837
  })]
7760
7838
  });
@@ -7919,6 +7997,54 @@ const stockISINFieldMetadata = {
7919
7997
  }
7920
7998
  }
7921
7999
  };
8000
+ const STOCK_TICKER_SYMBOL_FIELD = ["stockTickerSymbol"];
8001
+ function StockTickerSymbolField({
8002
+ data,
8003
+ valid,
8004
+ errors,
8005
+ labels: labels2,
8006
+ placeholders,
8007
+ readonly,
8008
+ mask,
8009
+ guidanceText,
8010
+ handleChangeFor
8011
+ }) {
8012
+ return jsx(MaskedInputText, {
8013
+ name: "stockTickerSymbol",
8014
+ label: labels2.stockTickerSymbol ?? "",
8015
+ formatGuidance: guidanceText == null ? void 0 : guidanceText.stockTickerSymbol,
8016
+ placeholder: placeholders == null ? void 0 : placeholders.stockTickerSymbol,
8017
+ ...mask,
8018
+ classNameModifiers: {
8019
+ field: ["stockTickerSymbol"],
8020
+ input: ["stockTickerSymbol"]
8021
+ },
8022
+ errorMessage: errors.stockTickerSymbol,
8023
+ isValid: valid.stockTickerSymbol ?? false,
8024
+ value: data.stockTickerSymbol ?? "",
8025
+ readonly,
8026
+ onInput: handleChangeFor("stockTickerSymbol", "input"),
8027
+ onBlur: handleChangeFor("stockTickerSymbol", "blur"),
8028
+ "aria-required": true,
8029
+ "aria-label": labels2.stockTickerSymbol,
8030
+ "aria-invalid": !valid.stockTickerSymbol
8031
+ });
8032
+ }
8033
+ const stockTickerSymbolFieldMetadata = {
8034
+ label: "stockTickerSymbol",
8035
+ validators: [validatePatternOnBlur(/^[A-Z\d]{1,5}$/)],
8036
+ mask: {
8037
+ mask: makeMask(...alphanumericInputs(1), ...alphanumericInputs(4)),
8038
+ transformOnType: uppercase
8039
+ },
8040
+ guidanceText: {
8041
+ key: "enterAMaximumOfNCharactersForExample",
8042
+ values: {
8043
+ maxChars: "5",
8044
+ example: "ADYEN"
8045
+ }
8046
+ }
8047
+ };
7922
8048
  const defaultFieldMetadata$7 = {
7923
8049
  label: "taxId"
7924
8050
  };
@@ -8022,6 +8148,136 @@ const defaultFieldConfig$7 = {
8022
8148
  }
8023
8149
  }
8024
8150
  },
8151
+ [CountryCodes.Guernsey]: ({
8152
+ companyType: companyType2
8153
+ }) => {
8154
+ switch (companyType2) {
8155
+ case CompanyTypesValue.SOLE_PROPRIETORSHIP:
8156
+ return {
8157
+ label: "nationalInsuranceNumber",
8158
+ validators: validatePatternOnBlur(/^GY\d{6}[A-D]$/),
8159
+ mask: {
8160
+ mask: makeMask(...nonInputs("GY", {
8161
+ includeInValue: true
8162
+ }), spacer, ...numericInputs(2), spacer, ...numericInputs(2), spacer, ...numericInputs(2), spacer, {
8163
+ type: "input",
8164
+ allow: /[A-D]/
8165
+ }),
8166
+ transformOnType: uppercase
8167
+ },
8168
+ guidanceText: {
8169
+ key: "enterTheRemainingNCharactersForExample",
8170
+ values: {
8171
+ numChars: "7",
8172
+ example: "GY 12 34 56 A"
8173
+ }
8174
+ }
8175
+ };
8176
+ default:
8177
+ return {
8178
+ label: "registrationNumber",
8179
+ mask: businessRegistrationNumberMasks[CountryCodes.Guernsey].default,
8180
+ validators: validatePatternOnBlur(businessRegistrationNumberPatterns[CountryCodes.Guernsey].default),
8181
+ guidanceText: {
8182
+ key: "enterAMaximumOfNDigitsForExample",
8183
+ values: {
8184
+ maxDigits: "9",
8185
+ example: "123456"
8186
+ }
8187
+ }
8188
+ };
8189
+ }
8190
+ },
8191
+ [CountryCodes.Jersey]: ({
8192
+ taxIdNumberType,
8193
+ companyType: companyType2
8194
+ }) => {
8195
+ switch (taxIdNumberType) {
8196
+ case "socialSecurityNumber":
8197
+ return {
8198
+ label: "socialSecurityNumber",
8199
+ validators: validatePatternOnBlur(/^[A-Z]{2}\d{6}[A-Z]$/),
8200
+ mask: {
8201
+ mask: makeMask(...alphaInputs(2), ...numericInputs(6), ...alphaInputs(1)),
8202
+ transformOnType: uppercase
8203
+ },
8204
+ guidanceText: {
8205
+ key: "enterNCharactersForExample",
8206
+ values: {
8207
+ numChars: "9",
8208
+ example: "JY000000A"
8209
+ }
8210
+ }
8211
+ };
8212
+ case "taxIdentificationNumber":
8213
+ default:
8214
+ switch (companyType2) {
8215
+ case CompanyTypesValue.SOLE_PROPRIETORSHIP:
8216
+ return {
8217
+ label: "taxIdentificationNumber",
8218
+ validators: validatePatternOnBlur(/^\d{10}$/),
8219
+ mask: {
8220
+ mask: makeMask(...numericInputs(3), ...nonInputs(" - "), ...numericInputs(3), ...nonInputs(" - "), ...numericInputs(4))
8221
+ },
8222
+ guidanceText: {
8223
+ key: "enterNDigitsForExample",
8224
+ values: {
8225
+ numDigits: "10",
8226
+ example: "100-100-1000"
8227
+ }
8228
+ }
8229
+ };
8230
+ default:
8231
+ return {
8232
+ label: "taxIdentificationNumber",
8233
+ validators: validatePatternOnBlur(/^[A-Z]{2}\d{5}$/),
8234
+ mask: {
8235
+ mask: makeMask(...alphaInputs(2), ...numericInputs(5)),
8236
+ transformOnType: uppercase
8237
+ },
8238
+ guidanceText: {
8239
+ key: "enterNCharactersForExample",
8240
+ values: {
8241
+ numChars: "7",
8242
+ example: "CC17261"
8243
+ }
8244
+ }
8245
+ };
8246
+ }
8247
+ }
8248
+ },
8249
+ [CountryCodes.IsleOfMan]: {
8250
+ label: "taxReferenceNumber",
8251
+ validators: validatePatternOnBlur(/^[HCX]\d{8}$/),
8252
+ mask: {
8253
+ mask: makeMask({
8254
+ type: "input",
8255
+ allow: /[HCX]/
8256
+ }, ...numericInputs(6), ...nonInputs(" - "), ...numericInputs(2)),
8257
+ transformOnType: uppercase
8258
+ },
8259
+ guidanceText: {
8260
+ key: "enterNCharactersForExample",
8261
+ values: {
8262
+ numChars: "9",
8263
+ example: "C155673-79"
8264
+ }
8265
+ }
8266
+ },
8267
+ [CountryCodes.Gibraltar]: {
8268
+ label: "taxpayerReferenceNumber",
8269
+ validators: validatePatternOnBlur(/^\d{1,7}$/),
8270
+ mask: {
8271
+ mask: makeMask(...numericInputs(1), ...numericInputs(6, true))
8272
+ },
8273
+ guidanceText: {
8274
+ key: "enterAMaximumOfNDigitsForExample",
8275
+ values: {
8276
+ maxDigits: "7",
8277
+ example: "123456"
8278
+ }
8279
+ }
8280
+ },
8025
8281
  /**
8026
8282
  * NOT YET SUPPORTED
8027
8283
  * These are brought over from the old pattern files. We have no idea if they are accurate or not.
@@ -8671,14 +8927,15 @@ const defaultFieldConfig$6 = {
8671
8927
  validators: validatePatternOnBlur(/^[JGVE]-\d{8}-?\d$/)
8672
8928
  }
8673
8929
  };
8674
- const inferTaxIdNumberType = (taxId2, country2) => {
8930
+ const inferTaxIdNumberType = (taxId2, country2, companyType2) => {
8675
8931
  const optionsForCountry = taxIdNumberOptions[country2];
8676
8932
  const metadataFn = defaultFieldConfig$6[country2] ?? defaultFieldConfig$7[country2];
8677
8933
  if (!optionsForCountry || !metadataFn || typeof metadataFn !== "function") return void 0;
8678
8934
  for (const option of optionsForCountry) {
8679
8935
  const fieldMetadata = metadataFn({
8680
8936
  taxIdNumberType: option.id,
8681
- vatNumberType: option.id
8937
+ vatNumberType: option.id,
8938
+ companyType: companyType2
8682
8939
  });
8683
8940
  if (!fieldMetadata.validators) continue;
8684
8941
  const validators = Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators];
@@ -8745,10 +9002,11 @@ function TaxId(props) {
8745
9002
  fieldConfig = defaultFieldConfig$7
8746
9003
  } = props;
8747
9004
  const existingTaxId = propData == null ? void 0 : propData.taxId;
8748
- const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_a = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _a[0].id;
9005
+ const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2, companyType2) : (_a = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _a[0].id;
8749
9006
  const [taxIdNumberType, setTaxIdNumberType] = useState(defaultTaxIdNumberType);
8750
9007
  const metadata = resolveFieldMetadata(fieldConfig[country2], {
8751
- taxIdNumberType
9008
+ taxIdNumberType,
9009
+ companyType: companyType2
8752
9010
  }, defaultFieldMetadata$7);
8753
9011
  const mergedProps = mergeFieldMetadataIntoProps("taxId", metadata, props);
8754
9012
  const {
@@ -8928,7 +9186,7 @@ function VatNumber(props) {
8928
9186
  name: VatAbsenceReason.CountryWithoutVatOrGstSystem
8929
9187
  }]);
8930
9188
  const existingTaxId = propData == null ? void 0 : propData.vatNumber;
8931
- const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_a = taxIdNumberOptions[country2]) == null ? void 0 : _a[0].id;
9189
+ const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2, void 0) : (_a = taxIdNumberOptions[country2]) == null ? void 0 : _a[0].id;
8932
9190
  const [taxIdNumberType, setTaxIdNumberType] = useState(defaultTaxIdNumberType);
8933
9191
  const metadata = resolveFieldMetadata(fieldConfig[country2], {
8934
9192
  vatNumberType: taxIdNumberType
@@ -9085,7 +9343,7 @@ const FLOWS_THAT_HIDE_REGISTRATION_NUMBER = [{
9085
9343
  companyType: [CompanyTypesValue.SOLE_PROPRIETORSHIP],
9086
9344
  country: CountryCodes.PuertoRico
9087
9345
  }];
9088
- const companyRegistrationDetailsFields = ["tradingName", "sameNameAsLegalName", ...businessRegistrationNumberFields, "stockExchangeMIC", "stockISIN", ...vatNumberFields, ...taxIdFields, "dateOfIncorporation"];
9346
+ const companyRegistrationDetailsFields = ["tradingName", "sameNameAsLegalName", ...businessRegistrationNumberFields, "stockExchangeMIC", "stockISIN", "stockTickerSymbol", ...vatNumberFields, ...taxIdFields, "dateOfIncorporation"];
9089
9347
  function CompanyRegistrationDetailsComponent(props) {
9090
9348
  var _a, _b;
9091
9349
  const {
@@ -9094,13 +9352,14 @@ function CompanyRegistrationDetailsComponent(props) {
9094
9352
  let mergedProps = props;
9095
9353
  mergedProps = mergeFieldMetadataIntoProps("stockExchangeMIC", stockExchangeMICFieldMetadata, mergedProps);
9096
9354
  mergedProps = mergeFieldMetadataIntoProps("stockISIN", stockISINFieldMetadata, mergedProps);
9355
+ mergedProps = mergeFieldMetadataIntoProps("stockTickerSymbol", stockTickerSymbolFieldMetadata, mergedProps);
9097
9356
  const hideOptionalRegistrationNumberField = FLOWS_THAT_HIDE_REGISTRATION_NUMBER.some((f) => f.country === mergedProps.country && f.companyType.includes(mergedProps.companyType));
9098
9357
  const stateRef = useRef({
9099
9358
  setState: null
9100
9359
  });
9101
9360
  const COMPANY_REGISTRATION_DETAILS = mergedProps.id;
9102
9361
  const requiredFields = mergedProps.requiredFields || companyRegistrationDetailsFields;
9103
- const directChildFields = requiredFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "dateOfIncorporation"].includes(field));
9362
+ const directChildFields = requiredFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "stockTickerSymbol", "dateOfIncorporation"].includes(field));
9104
9363
  const {
9105
9364
  getData
9106
9365
  } = useStateContext();
@@ -9270,6 +9529,16 @@ function CompanyRegistrationDetailsComponent(props) {
9270
9529
  guidanceText: formUtils.getFieldGuidanceText(STOCK_ISIN_FIELD),
9271
9530
  readonly: formUtils.isReadOnly("stockISIN"),
9272
9531
  handleChangeFor
9532
+ }), formUtils.isRequiredField("stockTickerSymbol") && jsx(StockTickerSymbolField, {
9533
+ data: formUtils.getFieldData(data, STOCK_TICKER_SYMBOL_FIELD),
9534
+ valid: formUtils.getFieldValid(valid, STOCK_TICKER_SYMBOL_FIELD),
9535
+ errors: formUtils.getFieldErrors(errors, fieldProblems, STOCK_TICKER_SYMBOL_FIELD),
9536
+ labels: formUtils.getFieldLabels(STOCK_TICKER_SYMBOL_FIELD),
9537
+ placeholders: formUtils.getFieldPlaceholders(STOCK_TICKER_SYMBOL_FIELD),
9538
+ mask: formUtils.getMask("stockTickerSymbol"),
9539
+ guidanceText: formUtils.getFieldGuidanceText(STOCK_TICKER_SYMBOL_FIELD),
9540
+ readonly: formUtils.isReadOnly("stockTickerSymbol"),
9541
+ handleChangeFor
9273
9542
  }), formUtils.isRequiredField("registrationNumber", !hideOptionalRegistrationNumberField) && jsx(BusinessRegistrationNumber, {
9274
9543
  ...registrationNumberProps,
9275
9544
  companyType: mergedProps.companyType,
@@ -9339,10 +9608,13 @@ const companyBase = {
9339
9608
  rule: "REQUIRED"
9340
9609
  },
9341
9610
  stockExchangeMIC: {
9342
- rule: "stockExchangeMICIfTypePublic"
9611
+ rule: "ifPubliclyTradedCompany"
9343
9612
  },
9344
9613
  stockISIN: {
9345
- rule: "stockISINIfTypePublic"
9614
+ rule: "ifPubliclyTradedCompany"
9615
+ },
9616
+ stockTickerSymbol: {
9617
+ rule: "ifPubliclyTradedCompany"
9346
9618
  },
9347
9619
  tradingName: {
9348
9620
  rule: "REQUIRED"
@@ -9392,10 +9664,13 @@ const companySearchBase = {
9392
9664
  rule: "countryRequiresStateOrProvince"
9393
9665
  },
9394
9666
  stockExchangeMIC: {
9395
- rule: "stockExchangeMICIfTypePublic"
9667
+ rule: "ifPubliclyTradedCompany"
9396
9668
  },
9397
9669
  stockISIN: {
9398
- rule: "stockISINIfTypePublic"
9670
+ rule: "ifPubliclyTradedCompany"
9671
+ },
9672
+ stockTickerSymbol: {
9673
+ rule: "ifPubliclyTradedCompany"
9399
9674
  },
9400
9675
  dateOfIncorporation: {
9401
9676
  rule: "countryRequiresDateOfIncorporationForCompanies"
@@ -9439,10 +9714,13 @@ const businessDetailsBase = {
9439
9714
  rule: "countryRequiresStateOrProvince"
9440
9715
  },
9441
9716
  stockExchangeMIC: {
9442
- rule: "stockExchangeMICIfTypePublic"
9717
+ rule: "ifPubliclyTradedCompany"
9443
9718
  },
9444
9719
  stockISIN: {
9445
- rule: "stockISINIfTypePublic"
9720
+ rule: "ifPubliclyTradedCompany"
9721
+ },
9722
+ stockTickerSymbol: {
9723
+ rule: "ifPubliclyTradedCompany"
9446
9724
  },
9447
9725
  dateOfIncorporation: {
9448
9726
  rule: "countryRequiresDateOfIncorporationForCompanies"
@@ -10036,12 +10314,6 @@ const EntityTypeSelectionRadioCardBody = ({
10036
10314
  })]
10037
10315
  });
10038
10316
  };
10039
- const CoreContext = createContext(void 0);
10040
- const useCoreContext = () => {
10041
- const context = useContext(CoreContext);
10042
- if (!context) throw Error("You need a <CoreProvider> to use core context");
10043
- return context;
10044
- };
10045
10317
  var TrustMemberTypes = /* @__PURE__ */ ((TrustMemberTypes2) => {
10046
10318
  TrustMemberTypes2["DEFINED_BENEFICIARY"] = "definedBeneficiary";
10047
10319
  TrustMemberTypes2["UNDEFINED_BENEFICIARY"] = "undefinedBeneficiary";
@@ -10237,7 +10509,7 @@ var VerificationStatus = /* @__PURE__ */ ((VerificationStatus2) => {
10237
10509
  VerificationStatus2["REJECTED"] = "rejected";
10238
10510
  return VerificationStatus2;
10239
10511
  })(VerificationStatus || {});
10240
- function getNestedPropertyKeys(obj, includeUndefined = false) {
10512
+ function getNestedPropertyKeys(obj, includeUndefined = false, includeFalsy = true) {
10241
10513
  const fieldNames = [];
10242
10514
  Object.entries(obj).forEach(([key, value]) => {
10243
10515
  if (typeof value === "object" && value !== null) {
@@ -10245,7 +10517,7 @@ function getNestedPropertyKeys(obj, includeUndefined = false) {
10245
10517
  fieldNames.push(...nested);
10246
10518
  return;
10247
10519
  }
10248
- if (value !== void 0 || includeUndefined) {
10520
+ if ((value !== void 0 || includeUndefined) && (value || !includeFalsy)) {
10249
10521
  fieldNames.push(key);
10250
10522
  }
10251
10523
  });
@@ -10286,8 +10558,10 @@ function isEmptyEntity(legalEntity) {
10286
10558
  const minimumFields = emptyFieldsByEntityType[type];
10287
10559
  const typeSpecificSection = legalEntity[type];
10288
10560
  if (!typeSpecificSection) return true;
10289
- const fieldsOnEntity = getNestedPropertyKeys(typeSpecificSection);
10290
- return !fieldsOnEntity.some((field) => !minimumFields.includes(field));
10561
+ const fieldsOnEntity = getNestedPropertyKeys(typeSpecificSection, false, false);
10562
+ const sortedMinimumFields = minimumFields.toSorted();
10563
+ const sortedFieldsOnEntity = fieldsOnEntity.toSorted();
10564
+ return sortedFieldsOnEntity.every((value, index) => value === sortedMinimumFields[index]);
10291
10565
  }
10292
10566
  const capabilitiesToPreventTypeChange = ["receivePayments", "issueCard", "useCard", "withdrawFromAtm", "withdrawFromAtmInRestrictedCountries", "receiveFromTransferInstrument", "useCardInRestrictedCountries", "useCardInRestrictedIndustries", "issueBankAccount", "sendToThirdParty", "receiveFromThirdParty", "getGrantOffers", "receiveGrants"];
10293
10567
  const entityTypeToCorrespondingAccountHolderOption = {
@@ -10439,7 +10713,7 @@ const accountHolderValidationRules = {
10439
10713
  }
10440
10714
  };
10441
10715
  const accountHolderFields = ["accountHolder"];
10442
- const logger$q = createLogger("AccountHolder");
10716
+ const logger$r = createLogger("AccountHolder");
10443
10717
  function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntityTypeAllowed, isTrustFlowEnabled, isSoleProprietorshipAllowed, isChangeToMyNameAllowed) {
10444
10718
  switch (legalEntityType) {
10445
10719
  case LegalEntityType.ORGANIZATION: {
@@ -10449,7 +10723,7 @@ function getAvailableAccountHolderOptions(legalEntityType, isChangeOfLegalEntity
10449
10723
  return [...isChangeToMyNameAllowed ? ["myName"] : [], ...isChangeOfLegalEntityTypeAllowed ? ["theCompanyIWorkFor"] : [], ...isTrustFlowEnabled ? ["aTrust"] : [], ...isSoleProprietorshipAllowed ? ["mySoleProprietorName"] : []];
10450
10724
  }
10451
10725
  default:
10452
- logger$q.error(`No available account holder options for legal entity type '${legalEntityType}'`);
10726
+ logger$r.error(`No available account holder options for legal entity type '${legalEntityType}'`);
10453
10727
  return [];
10454
10728
  }
10455
10729
  }
@@ -10465,9 +10739,6 @@ function AccountHolder(props) {
10465
10739
  dataStoreId,
10466
10740
  capabilities
10467
10741
  } = props;
10468
- const {
10469
- setAccountHolder
10470
- } = useCoreContext();
10471
10742
  const {
10472
10743
  isSettingEnabled
10473
10744
  } = useSettingsContext();
@@ -10516,9 +10787,6 @@ function AccountHolder(props) {
10516
10787
  dataStoreId
10517
10788
  }
10518
10789
  });
10519
- if (data == null ? void 0 : data.accountHolder) {
10520
- setAccountHolder(data.accountHolder);
10521
- }
10522
10790
  }, [data, errors, valid, dataStoreId]);
10523
10791
  const formUtils = formUtilities(props, i18n);
10524
10792
  const questionLabel = i18n.get("nameOfBankAccountHolder");
@@ -11009,7 +11277,7 @@ function Dropzone(props) {
11009
11277
  })]
11010
11278
  });
11011
11279
  }
11012
- const logger$p = createLogger("TextArea");
11280
+ const logger$q = createLogger("TextArea");
11013
11281
  function TextArea(props) {
11014
11282
  const {
11015
11283
  classNameModifiers,
@@ -11030,7 +11298,7 @@ function TextArea(props) {
11030
11298
  } = useI18nContext();
11031
11299
  const [value, setValue] = useState("");
11032
11300
  if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
11033
- logger$p.error("Error: Form fields that rely on InputBase may not have an onChange property");
11301
+ logger$q.error("Error: Form fields that rely on InputBase may not have an onChange property");
11034
11302
  }
11035
11303
  const handleInput = (e) => {
11036
11304
  var _a;
@@ -11473,7 +11741,7 @@ function useIsElementVisible(ref, fallback = true) {
11473
11741
  }, [ref]);
11474
11742
  return isOnScreen;
11475
11743
  }
11476
- const logger$o = createLogger("SearchAddress");
11744
+ const logger$p = createLogger("SearchAddress");
11477
11745
  const SearchAddress = ({
11478
11746
  data,
11479
11747
  legalEntityId,
@@ -11516,7 +11784,7 @@ const SearchAddress = ({
11516
11784
  const response = await handleFindAddress(selectedAddressId);
11517
11785
  autocompleteAddressForm(response);
11518
11786
  } catch (e) {
11519
- logger$o.error(e);
11787
+ logger$p.error(e);
11520
11788
  }
11521
11789
  };
11522
11790
  const onDrilldown = async (selectedAddress) => {
@@ -11528,7 +11796,7 @@ const SearchAddress = ({
11528
11796
  }, legalEntityId);
11529
11797
  setItems((response == null ? void 0 : response.results) || []);
11530
11798
  } catch (e) {
11531
- logger$o.error(e);
11799
+ logger$p.error(e);
11532
11800
  }
11533
11801
  };
11534
11802
  const onChange = (e) => {
@@ -11583,7 +11851,7 @@ const SearchAddress = ({
11583
11851
  setItems([]);
11584
11852
  }
11585
11853
  } catch (e) {
11586
- logger$o.error(e);
11854
+ logger$p.error(e);
11587
11855
  }
11588
11856
  setLoading(false);
11589
11857
  }
@@ -12143,6 +12411,7 @@ function Address(props) {
12143
12411
  maxlength: getMaxLengthByFieldAndCountry(countrySpecificFormatters, fieldName, data.country),
12144
12412
  hideField,
12145
12413
  "aria-label": formUtils.getLabel(fieldName, fieldName),
12414
+ readOnly: formUtils.isReadOnly(fieldName),
12146
12415
  trimOnBlur: true
12147
12416
  }, fieldName);
12148
12417
  };
@@ -12270,16 +12539,22 @@ function RegistrationAddressComponent(props) {
12270
12539
  } = useI18nContext();
12271
12540
  const {
12272
12541
  id: id2,
12273
- data,
12274
- country: country2,
12275
- validators,
12276
12542
  heading,
12277
12543
  description: description2,
12278
12544
  handleAddressSearch,
12279
12545
  handleFindAddress,
12280
- optionalFields,
12546
+ country: country2,
12547
+ data,
12548
+ validators,
12281
12549
  kompanyAddress
12282
12550
  } = props;
12551
+ const {
12552
+ requiredFields: registrationAddressRequiredFields,
12553
+ optionalFields: registrationAddressOptionalFields,
12554
+ readOnlyFields: registrationAddressReadOnlyFields,
12555
+ obscuredFields: registrationAddressObscuredFields,
12556
+ verifyFields: registrationAddressVerifyFields
12557
+ } = getFormProps(props, props.id);
12283
12558
  const {
12284
12559
  data: formData,
12285
12560
  valid: formValid,
@@ -12292,9 +12567,17 @@ function RegistrationAddressComponent(props) {
12292
12567
  defaultData: data,
12293
12568
  rules: validators || registrationAddressValidationRules,
12294
12569
  obscuredFields: [],
12295
- optionalFields
12570
+ optionalFields: registrationAddressOptionalFields
12296
12571
  });
12297
- const formUtils = formUtilities(props, i18n);
12572
+ const mergedProps = {
12573
+ ...props,
12574
+ requiredFields: registrationAddressRequiredFields,
12575
+ optionalFields: registrationAddressOptionalFields,
12576
+ readOnlyFields: registrationAddressReadOnlyFields,
12577
+ obscuredFields: registrationAddressObscuredFields,
12578
+ verifyFields: registrationAddressVerifyFields
12579
+ };
12580
+ const formUtils = formUtilities(mergedProps, i18n);
12298
12581
  const stateRef = useRef({
12299
12582
  setState: null
12300
12583
  });
@@ -12324,8 +12607,8 @@ function RegistrationAddressComponent(props) {
12324
12607
  heading,
12325
12608
  description: description2
12326
12609
  }), jsx(ErrorPanel, {
12327
- verificationErrors: id2 ? (_b = (_a = props == null ? void 0 : props.problems) == null ? void 0 : _a.verificationErrors) == null ? void 0 : _b[id2] : void 0,
12328
- validationErrors: id2 ? (_d = (_c = props == null ? void 0 : props.problems) == null ? void 0 : _c.validationErrors) == null ? void 0 : _d[id2] : void 0,
12610
+ verificationErrors: id2 ? (_b = (_a = props.problems) == null ? void 0 : _a.verificationErrors) == null ? void 0 : _b[id2] : void 0,
12611
+ validationErrors: id2 ? (_d = (_c = props.problems) == null ? void 0 : _c.validationErrors) == null ? void 0 : _d[id2] : void 0,
12329
12612
  formUtils,
12330
12613
  id: "ariaErrorField"
12331
12614
  }), jsx(ContextGuidance, {
@@ -12700,7 +12983,7 @@ function CompanyComponent(props) {
12700
12983
  const companyNameAndCountryFormProps = getFormProps(props, CompanyNameAndCountryFormID);
12701
12984
  const companyTypeFormProps = getFormProps(props, CompanyTypeFormID);
12702
12985
  const companyRegistrationDetailsFormProps = getFormProps(props, CompanyRegistrationDetailsFormID);
12703
- const companyRegistrationAddressFormProps = getFormProps(props, CompanyRegistrationAddressFormID);
12986
+ const companyRegistrationAddressFormProps = getNestedOuterFormPropsFromOuterFormProps(props, CompanyRegistrationAddressFormID);
12704
12987
  const companyRegistrationDocumentFormProps = getFormProps(props, CompanyRegistrationDocumentFormID);
12705
12988
  const companyTaxDocumentFormProps = getFormProps(props, CompanyTaxDocumentFormID);
12706
12989
  const handleStateChange = ({
@@ -12978,7 +13261,7 @@ const COUNTRIES_THAT_DONT_REQUIRE_SOLE_PROP_REGISTRATION = [CountryCodes.Austral
12978
13261
  const COUNTRIES_THAT_DONT_REQUIRE_COMPANY_REGISTRATION = [CountryCodes.PuertoRico, CountryCodes.UnitedStates];
12979
13262
  const COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS = [CountryCodes.Austria, CountryCodes.Canada, CountryCodes.Finland, CountryCodes.Germany, CountryCodes.Lithuania, CountryCodes.Luxembourg, CountryCodes.Poland, CountryCodes.Sweden, CountryCodes.Switzerland];
12980
13263
  const COUNTRIES_WITH_OPTIONAL_REGISTRATION_NUMBER = [CountryCodes.PuertoRico, CountryCodes.UnitedStates];
12981
- const COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT = [CountryCodes.Australia, CountryCodes.Canada, CountryCodes.Gibraltar, CountryCodes.HongKong, CountryCodes.NewZealand, CountryCodes.PuertoRico, CountryCodes.Singapore, CountryCodes.UnitedStates];
13264
+ const COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT = [CountryCodes.Australia, CountryCodes.Canada, CountryCodes.Gibraltar, CountryCodes.HongKong, CountryCodes.NewZealand, CountryCodes.PuertoRico, CountryCodes.Singapore, CountryCodes.UnitedStates, CountryCodes.Guernsey, CountryCodes.Jersey, CountryCodes.IsleOfMan];
12982
13265
  const COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP = [CountryCodes.NewZealand, CountryCodes.Singapore];
12983
13266
  const COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES = [
12984
13267
  // strictly a subset of countries which use tax ID
@@ -13004,16 +13287,7 @@ const rules$2 = ({
13004
13287
  return "REQUIRED";
13005
13288
  }
13006
13289
  },
13007
- stockExchangeMICIfTypePublic: () => {
13008
- var _a, _b;
13009
- if ("companyType" in data && ((_a = data.companyType) == null ? void 0 : _a.entityType) === CompanyTypesValue.PUBLIC_COMPANY) {
13010
- return "REQUIRED";
13011
- }
13012
- if ("companyStructure" in data && ((_b = data.companyStructure) == null ? void 0 : _b.entityType) === CompanyTypesValue.PUBLIC_COMPANY) {
13013
- return "REQUIRED";
13014
- }
13015
- },
13016
- stockISINIfTypePublic: () => {
13290
+ ifPubliclyTradedCompany: () => {
13017
13291
  var _a, _b;
13018
13292
  if ("companyType" in data && ((_a = data.companyType) == null ? void 0 : _a.entityType) === CompanyTypesValue.PUBLIC_COMPANY) {
13019
13293
  return "REQUIRED";
@@ -13200,7 +13474,8 @@ const mandatoryApiFields = {
13200
13474
  DECISION_MAKER_OWNER: ["personalDetails.firstName", "personalDetails.lastName", "personalDetails.residencyCountry", "personalDetails.role"],
13201
13475
  ORGANIZATION: ["companyNameAndCountry.legalCompanyName", "companyNameAndCountry.country"],
13202
13476
  SOLE_PROPRIETORSHIP: ["solePropNameAndCountry.legalCompanyName", "solePropNameAndCountry.country"],
13203
- TRUST: ["trustRegistrationDetails.legalName", "trustRegistrationDetails.country"]
13477
+ TRUST: ["trustRegistrationDetails.legalName", "trustRegistrationDetails.country"],
13478
+ HIGH_EXPOSURE: ["company.numberOfEmployees", "parentCompany.numberOfEmployees", "ultimateParentCompany.numberOfEmployees"]
13204
13479
  };
13205
13480
  const individualObscuredFields = ["personalDetails.idNumber", "personalDetails.idNumberExempt"];
13206
13481
  const individualBaseMapping = {
@@ -13263,6 +13538,7 @@ const businessDetailsBaseMapping = {
13263
13538
  "additionalInformation.isUen": "organization.isUen",
13264
13539
  "additionalInformation.stockExchangeMIC": "organization.stockData.marketIdentifier",
13265
13540
  "additionalInformation.stockISIN": "organization.stockData.stockNumber",
13541
+ "additionalInformation.stockTickerSymbol": "organization.stockData.tickerSymbol",
13266
13542
  "companyRegistrationAddress.registrationAddress.city": "organization.registeredAddress.city",
13267
13543
  "companyRegistrationAddress.registrationAddress.country": "organization.registeredAddress.country",
13268
13544
  "companyRegistrationAddress.registrationAddress.postalCode": "organization.registeredAddress.postalCode",
@@ -13289,6 +13565,7 @@ const companyBaseMapping = {
13289
13565
  "companyRegistrationDetails.isUen": "organization.isUen",
13290
13566
  "companyRegistrationDetails.stockExchangeMIC": "organization.stockData.marketIdentifier",
13291
13567
  "companyRegistrationDetails.stockISIN": "organization.stockData.stockNumber",
13568
+ "companyRegistrationDetails.stockTickerSymbol": "organization.stockData.tickerSymbol",
13292
13569
  "companyRegistrationAddress.registrationAddress.city": "organization.registeredAddress.city",
13293
13570
  "companyRegistrationAddress.registrationAddress.country": "organization.registeredAddress.country",
13294
13571
  "companyRegistrationAddress.registrationAddress.postalCode": "organization.registeredAddress.postalCode",
@@ -13328,7 +13605,8 @@ const companySearchBaseMapping = {
13328
13605
  "companyOtherDetails.dateOfIncorporation": "organization.dateOfIncorporation",
13329
13606
  "companyOtherDetails.isUen": "organization.isUen",
13330
13607
  "companyOtherDetails.stockExchangeMIC": "organization.stockData.marketIdentifier",
13331
- "companyOtherDetails.stockISIN": "organization.stockData.stockNumber"
13608
+ "companyOtherDetails.stockISIN": "organization.stockData.stockNumber",
13609
+ "companyOtherDetails.stockTickerSymbol": "organization.stockData.tickerSymbol"
13332
13610
  };
13333
13611
  const trustBaseMapping = {
13334
13612
  "trustRegistrationDetails.trustType": "trust.type",
@@ -13370,6 +13648,11 @@ const solePropBaseMapping = {
13370
13648
  "solePropRegistrationAddress.operationalAddress.address": "soleProprietorship.principalPlaceOfBusiness.street",
13371
13649
  "solePropRegistrationAddress.operationalAddress.otherAddressInformation": "soleProprietorship.principalPlaceOfBusiness.street2"
13372
13650
  };
13651
+ const highExposureBaseMapping = {
13652
+ "company.numberOfEmployees": "company.numberOfEmployees",
13653
+ "parentCompany.numberOfEmployees": "parentCompany.numberOfEmployees",
13654
+ "ultimateParentCompany.numberOfEmployees": "ultimateParentCompany.numberOfEmployees"
13655
+ };
13373
13656
  const businessDetailsComponentsKeyMapping = {
13374
13657
  "additionalInformation.exemptedFromVat": "organization.vatAbsenceReason",
13375
13658
  ...businessDetailsBaseMapping
@@ -13403,6 +13686,12 @@ const trustComponentsKeyMapping = {
13403
13686
  const trustApiKeyMapping = {
13404
13687
  ...reverseObject(trustBaseMapping)
13405
13688
  };
13689
+ const highExposureComponentsKeyMapping = {
13690
+ ...highExposureBaseMapping
13691
+ };
13692
+ const highExposureApiKeyMapping = {
13693
+ ...reverseObject(highExposureBaseMapping)
13694
+ };
13406
13695
  const solePropComponentsKeyMapping = {
13407
13696
  "solePropRegistrationDetails.exemptedFromVat": "soleProprietorship.vatAbsenceReason",
13408
13697
  ...solePropBaseMapping
@@ -13743,6 +14032,10 @@ const mapTrustToLegalEntity = (data) => {
13743
14032
  requestObj.type = LegalEntityType.TRUST;
13744
14033
  return requestObj;
13745
14034
  };
14035
+ const mapLegalEntityToHighExposure = (legalEntity) => formatObject(legalEntity, highExposureComponentsKeyMapping);
14036
+ const mapHighExposureToLegalEntity = (data) => ({
14037
+ ...formatObject(data, highExposureApiKeyMapping)
14038
+ });
13746
14039
  const mapLegalEntityToSoleProp = (legalEntity) => {
13747
14040
  var _a, _b, _c, _d, _e, _f, _g, _h;
13748
14041
  let solePropCompData;
@@ -14350,7 +14643,7 @@ const initOnfido = async ({
14350
14643
  language: getOnfidoLocaleConfig(i18n)
14351
14644
  });
14352
14645
  };
14353
- const logger$n = createLogger("IdVerificationComponent");
14646
+ const logger$o = createLogger("IdVerificationComponent");
14354
14647
  function IdVerificationComponent({
14355
14648
  userDetails,
14356
14649
  legalEntityId,
@@ -14382,7 +14675,7 @@ function IdVerificationComponent({
14382
14675
  onIdVerificationError,
14383
14676
  onIdVerificationComplete
14384
14677
  });
14385
- })().catch(logger$n.error);
14678
+ })().catch(logger$o.error);
14386
14679
  return () => {
14387
14680
  if (onfidoSdk.current) onfidoSdk.current.tearDown();
14388
14681
  };
@@ -14432,7 +14725,7 @@ function IdDocumentAlreadyUpload(props) {
14432
14725
  })]
14433
14726
  });
14434
14727
  }
14435
- const logger$m = createLogger("IdDocumentInstantVerificationComponent");
14728
+ const logger$n = createLogger("IdDocumentInstantVerificationComponent");
14436
14729
  const idVerificationSchema = ["instantIdVerificationData", "idDocumentType"];
14437
14730
  const documentTypeValidationRules = {
14438
14731
  instantIdVerificationData: {
@@ -14514,7 +14807,7 @@ function IdDocumentInstantVerificationComponent(props) {
14514
14807
  userDetails: props.userDetails,
14515
14808
  legalEntityId: props.legalEntityId,
14516
14809
  onIdVerificationComplete: handleIdVerificationComplete,
14517
- onIdVerificationError: logger$m.error
14810
+ onIdVerificationError: logger$n.error
14518
14811
  }), jsxs("div", {
14519
14812
  className: "adyen-kyc-document-upload__manual-upload",
14520
14813
  children: [i18n.get("canNotCompleteInstantVerification"), " ", jsx("button", {
@@ -17928,7 +18221,7 @@ class AdyenKycSdkError extends Error {
17928
18221
  }
17929
18222
  let sdkToken;
17930
18223
  let fetchSdkToken;
17931
- const logger$l = createLogger("Session");
18224
+ const logger$m = createLogger("Session");
17932
18225
  const setSdkToken = (token) => {
17933
18226
  sdkToken = token;
17934
18227
  };
@@ -17951,7 +18244,7 @@ const refreshSession = async () => {
17951
18244
  setSdkToken(token);
17952
18245
  isSessionRefreshed = true;
17953
18246
  } catch (e) {
17954
- logger$l.error("Failed to fetch sdk token", e);
18247
+ logger$m.error("Failed to fetch sdk token", e);
17955
18248
  }
17956
18249
  return isSessionRefreshed;
17957
18250
  };
@@ -17961,7 +18254,7 @@ const addAnimationStartListener = (element, listener) => {
17961
18254
  const removeAnimationStartListener = (element, listener) => {
17962
18255
  element.removeEventListener("animationstart", listener, false);
17963
18256
  };
17964
- const logger$k = createLogger("Fetch");
18257
+ const logger$l = createLogger("Fetch");
17965
18258
  const getRequestObject = (options, data) => {
17966
18259
  const {
17967
18260
  headers = [],
@@ -18008,10 +18301,10 @@ const logFetchError = (message, level) => {
18008
18301
  case "info":
18009
18302
  case "warn":
18010
18303
  case "error":
18011
- logger$k[level](message);
18304
+ logger$l[level](message);
18012
18305
  break;
18013
18306
  default:
18014
- logger$k.error(message);
18307
+ logger$l.error(message);
18015
18308
  }
18016
18309
  };
18017
18310
  const handleFetchResponse = async (response, responseType) => {
@@ -18102,7 +18395,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
18102
18395
  const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
18103
18396
  const MOUNT_TIMEOUT = 10 * 1e3;
18104
18397
  const TINK_VENDOR = "Tink";
18105
- const logger$j = createLogger("iframeWidget");
18398
+ const logger$k = createLogger("iframeWidget");
18106
18399
  const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
18107
18400
  const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
18108
18401
  const parseMessageJson = (message) => {
@@ -18120,7 +18413,7 @@ const callbackErrorHandler = async (response) => {
18120
18413
  try {
18121
18414
  await response;
18122
18415
  } catch (ex) {
18123
- logger$j.error(ex);
18416
+ logger$k.error(ex);
18124
18417
  }
18125
18418
  return {
18126
18419
  error: "UNKNOWN_ERROR",
@@ -18223,7 +18516,7 @@ class IFrameWidget {
18223
18516
  message = responseData.errorMessage;
18224
18517
  }
18225
18518
  } catch (ex) {
18226
- logger$j.error(ex);
18519
+ logger$k.error(ex);
18227
18520
  }
18228
18521
  throw new AdyenKycSdkError(reason, jsonData.error);
18229
18522
  }
@@ -18410,7 +18703,7 @@ function BankVerificationWidget({
18410
18703
  ref: widgetContainerRef
18411
18704
  });
18412
18705
  }
18413
- const logger$i = createLogger("BankVerification");
18706
+ const logger$j = createLogger("BankVerification");
18414
18707
  const accountVerificationFields = ["verifiedAccountHolder", "verifiedBankCountry", "verifiedBankName", "verifiedCurrencyCode", "verifiedBankAccountNumber"];
18415
18708
  const InstantVerificationErrorContext = createContext(null);
18416
18709
  const useInstantVerificationErrorNotification = (notificationVisibilityDuration) => {
@@ -18442,7 +18735,7 @@ const usePreferredVendorForCountry = (country2, getBankVerificationVendors) => {
18442
18735
  const vendor = vendors[0];
18443
18736
  setPreferredVendor(vendor.name ? vendor : void 0);
18444
18737
  };
18445
- getPreferredVendor().catch(logger$i.error);
18738
+ getPreferredVendor().catch(logger$j.error);
18446
18739
  }, [country2, getBankVerificationVendors]);
18447
18740
  return preferredVendor;
18448
18741
  };
@@ -18641,6 +18934,12 @@ function BankVerification(props) {
18641
18934
  });
18642
18935
  }
18643
18936
  const BankVerification$1 = memo(BankVerification);
18937
+ const CoreContext = createContext(void 0);
18938
+ const useCoreContext = () => {
18939
+ const context = useContext(CoreContext);
18940
+ if (!context) throw Error("You need a <CoreProvider> to use core context");
18941
+ return context;
18942
+ };
18644
18943
  const countriesWithMultipleCurrencies = /* @__PURE__ */ new Set([CountryCodes.Bulgaria, CountryCodes.Canada, CountryCodes.Croatia, CountryCodes.CzechRepublic, CountryCodes.Hungary, CountryCodes.Romania, CountryCodes.Switzerland]);
18645
18944
  const countriesWithLocalFormat = /* @__PURE__ */ new Set([CountryCodes.Denmark, CountryCodes.Norway, CountryCodes.Poland, CountryCodes.Sweden, CountryCodes.UnitedKingdom]);
18646
18945
  const payoutCurrencySupport = {
@@ -20323,7 +20622,7 @@ function SolePropComponent(props) {
20323
20622
  const [tradingName2, setTradingName] = useState();
20324
20623
  const solePropNameAndCountryFormProps = getFormProps(props, solePropNameAndCountryFormId);
20325
20624
  const solePropsRegistrationDetailsFormProps = getFormProps(props, solePropRegistrationDetailsFormId);
20326
- const solePropRegistrationAddressFormProps = getFormProps(props, solePropRegistrationAddressFormId);
20625
+ const solePropRegistrationAddressFormProps = getNestedOuterFormPropsFromOuterFormProps(props, solePropRegistrationAddressFormId);
20327
20626
  const solePropDocumentsFormProps = getFormProps(props, solePropDocumentFormId);
20328
20627
  const handleStateChange = ({
20329
20628
  currentState
@@ -20920,10 +21219,11 @@ function TrustComponent(props) {
20920
21219
  i18n
20921
21220
  } = useI18nContext();
20922
21221
  const trustRegistrationDetailsFormProps = getFormProps(props, trustRegistrationDetailsFormId);
20923
- const trustRegistrationAddressFormProps = getFormProps(props, trustRegistrationAddressFormId);
21222
+ const trustRegistrationAddressFormProps = getNestedOuterFormPropsFromOuterFormProps(props, trustRegistrationAddressFormId);
20924
21223
  const trustDocumentFormProps = getFormProps(props, trustConstitutionalDocumentFormId);
20925
21224
  const handleStateChange = () => {
20926
21225
  };
21226
+ console.log("trustRegistrationDetailsFormProps", trustRegistrationDetailsFormProps);
20927
21227
  const renderActiveForm = (activeForm) => jsxs("div", {
20928
21228
  className: "adyen-kyc-trust",
20929
21229
  children: [jsx(StateContextWatcher, {
@@ -21596,6 +21896,55 @@ function ErrorPanel({
21596
21896
  })]
21597
21897
  });
21598
21898
  }
21899
+ const headingTypes = {
21900
+ 1: ({
21901
+ children,
21902
+ className
21903
+ }) => jsx("h1", {
21904
+ className,
21905
+ children
21906
+ }),
21907
+ 2: ({
21908
+ children,
21909
+ className
21910
+ }) => jsx("h2", {
21911
+ className,
21912
+ children
21913
+ }),
21914
+ 3: ({
21915
+ children,
21916
+ className
21917
+ }) => jsx("h3", {
21918
+ className,
21919
+ children
21920
+ }),
21921
+ 4: ({
21922
+ children,
21923
+ className
21924
+ }) => jsx("h4", {
21925
+ className,
21926
+ children
21927
+ }),
21928
+ sub: ({
21929
+ children,
21930
+ className
21931
+ }) => jsx("div", {
21932
+ className,
21933
+ children
21934
+ })
21935
+ };
21936
+ function Heading({
21937
+ className,
21938
+ level,
21939
+ children
21940
+ }) {
21941
+ const HeadingElement = headingTypes[level] || headingTypes[1];
21942
+ const classNames = cx("adyen-kyc-heading", `adyen-kyc-heading--${level}`, className);
21943
+ return jsx(HeadingElement, {
21944
+ className: classNames,
21945
+ children
21946
+ });
21947
+ }
21599
21948
  const summaryStep = {
21600
21949
  formId: "summary",
21601
21950
  formName: "summary"
@@ -21622,59 +21971,56 @@ function Summary({
21622
21971
  gotoForm(formIndex);
21623
21972
  }
21624
21973
  };
21625
- const allValidationErrors = (problems == null ? void 0 : problems.validationErrors) && ((_a = Object.values(problems == null ? void 0 : problems.validationErrors)) == null ? void 0 : _a.reduce((acc, validError) => ({
21974
+ const allValidationErrors = (problems == null ? void 0 : problems.validationErrors) && ((_a = Object.values(problems.validationErrors)) == null ? void 0 : _a.reduce((acc, validError) => ({
21626
21975
  ...acc,
21627
21976
  ...validError
21628
21977
  }), {}));
21629
- const allVerificationErrors = (problems == null ? void 0 : problems.verificationErrors) && ((_b = Object.values(problems == null ? void 0 : problems.verificationErrors)) == null ? void 0 : _b.reduce((acc, verifError) => ({
21978
+ const allVerificationErrors = (problems == null ? void 0 : problems.verificationErrors) && ((_b = Object.values(problems.verificationErrors)) == null ? void 0 : _b.reduce((acc, verifError) => ({
21630
21979
  ...acc,
21631
21980
  ...verifError
21632
21981
  }), {}));
21633
21982
  const formUtils = formUtilities({
21634
21983
  labels: labels2
21635
21984
  }, i18n);
21636
- const summaryItemHeader = (formName, formId) => jsxs("ul", {
21637
- className: "adyen-kyc-summary__heading-section",
21638
- children: [jsx("li", {
21639
- children: jsx("span", {
21640
- className: "adyen-kyc-summary__form-heading",
21641
- children: formName
21642
- })
21643
- }), jsx("li", {
21644
- children: jsx(Button, {
21645
- className: "adyen-kyc-summary__edit-form-button",
21646
- ghost: true,
21647
- circle: true,
21648
- tertiary: true,
21649
- icon: "edit",
21650
- onClick: () => {
21651
- trackNavigation2({
21652
- fromForm: {
21653
- formName: "summary",
21654
- formId: "summary"
21655
- },
21656
- toForm: {
21657
- formId,
21658
- formName
21659
- },
21660
- component: "Pencil icon"
21661
- });
21662
- editForm(formId);
21663
- },
21664
- title: i18n.get("edit"),
21665
- label: i18n.get("edit"),
21666
- labelHoverBox: true
21667
- })
21985
+ const summarySectionHeader = (formName, formId) => jsxs("header", {
21986
+ className: "adyen-kyc-summary-section__header",
21987
+ children: [jsx(Heading, {
21988
+ level: 4,
21989
+ className: "adyen-kyc-summary-section__heading",
21990
+ children: formName
21991
+ }), jsx(Button, {
21992
+ className: "adyen-kyc-summary-section__edit-button",
21993
+ ghost: true,
21994
+ circle: true,
21995
+ tertiary: true,
21996
+ icon: "edit",
21997
+ onClick: () => {
21998
+ trackNavigation2({
21999
+ fromForm: {
22000
+ formName: "summary",
22001
+ formId: "summary"
22002
+ },
22003
+ toForm: {
22004
+ formId,
22005
+ formName
22006
+ },
22007
+ component: "Pencil icon"
22008
+ });
22009
+ editForm(formId);
22010
+ },
22011
+ title: i18n.get("edit"),
22012
+ label: i18n.get("edit"),
22013
+ labelHoverBox: true
21668
22014
  })]
21669
22015
  });
21670
- const renderSummaryItem = (fieldData, labelData, formName, formId) => jsxs("li", {
21671
- className: "adyen-kyc-summary__item",
21672
- children: [summaryItemHeader(formName, formId), jsx("ul", {
21673
- className: "adyen-kyc-summary__content-section",
21674
- children: renderFormData(fieldData, labelData)
22016
+ const renderSummarySection = (fieldData, labelData, formName, formId) => jsxs("section", {
22017
+ className: "adyen-kyc-summary-section",
22018
+ children: [summarySectionHeader(formName, formId), jsx("dl", {
22019
+ className: "adyen-kyc-summary-section__content",
22020
+ children: renderSummaryItems(fieldData, labelData)
21675
22021
  })]
21676
22022
  });
21677
- const renderSummary = (data2) => {
22023
+ const renderSummaryContent = (data2) => {
21678
22024
  const summaryList = [];
21679
22025
  forms2.forEach(({
21680
22026
  formId,
@@ -21682,53 +22028,44 @@ function Summary({
21682
22028
  }) => {
21683
22029
  const currentFormData = data2[formId];
21684
22030
  const isFormEmpty = !currentFormData || Object.values(currentFormData).every((value) => isEmpty(value));
21685
- if (isFormEmpty || formId === summaryStep.formId || omittedForms.includes(formId)) {
21686
- return;
21687
- }
21688
- const summaryItems = currentFormData.hasInnerForms ? renderInnerForms(labels2 == null ? void 0 : labels2[formId], formId, currentFormData) : currentFormData ? renderSummaryItem(currentFormData, labels2 == null ? void 0 : labels2[formId], i18n.get(formName), formId) : null;
22031
+ if (isFormEmpty || formId === summaryStep.formId || omittedForms.includes(formId)) return;
22032
+ const summaryItems = currentFormData.hasInnerForms ? renderInnerForms(labels2 == null ? void 0 : labels2[formId], formId, currentFormData) : renderSummarySection(currentFormData, labels2 == null ? void 0 : labels2[formId], i18n.get(formName), formId);
21689
22033
  summaryList.push(summaryItems);
21690
22034
  });
21691
22035
  return summaryList;
21692
22036
  };
21693
22037
  const renderInnerForms = (labelData, parentFormId, innerForms = {}) => {
22038
+ if (!innerForms) return [];
21694
22039
  const dataList = [];
21695
- if (innerForms) {
21696
- Object.entries(innerForms).forEach(([innerFormName, innerFormFieldData]) => {
21697
- const formName = i18n.get(labelData == null ? void 0 : labelData[innerFormName]) || i18n.get(innerFormName);
21698
- if (typeof innerFormFieldData === "object" && innerFormFieldData !== null) {
21699
- dataList.push(renderSummaryItem(innerFormFieldData, labelData, formName, parentFormId));
21700
- }
21701
- });
21702
- }
22040
+ Object.entries(innerForms).forEach(([innerFormName, innerFormFieldData]) => {
22041
+ const formName = i18n.get(labelData == null ? void 0 : labelData[innerFormName]) || i18n.get(innerFormName);
22042
+ if (typeof innerFormFieldData === "object" && innerFormFieldData !== null) {
22043
+ dataList.push(renderSummarySection(innerFormFieldData, labelData, formName, parentFormId));
22044
+ }
22045
+ });
21703
22046
  return dataList;
21704
22047
  };
21705
- const renderFormData = (formData = {}, labelData = {}) => {
22048
+ const renderSummaryItems = (formData = {}, labelData = {}) => {
22049
+ if (!formData) return [];
21706
22050
  const dataList = [];
21707
- if (formData) {
21708
- Object.entries(formData).forEach(([field, fieldData]) => {
21709
- const fieldName = i18n.get(labelData[field]) || i18n.get(field);
21710
- if (typeof fieldData === "object" && fieldData !== null && !(omittedKeys == null ? void 0 : omittedKeys.includes(field))) {
21711
- dataList.push(jsx("li", {
21712
- className: "adyen-kyc-summary__item-nested",
21713
- children: jsx("ul", {
21714
- className: "adyen-kyc-summary__content-section-nested",
21715
- children: renderFormData(fieldData, labelData)
21716
- })
21717
- }));
21718
- } else if (typeof fieldData === "string" && !(omittedKeys == null ? void 0 : omittedKeys.includes(field))) {
21719
- dataList.push(jsxs("li", {
21720
- className: "adyen-kyc-summary__data-item",
21721
- children: [jsx("span", {
21722
- className: "adyen-kyc-summary__field",
21723
- children: fieldName
21724
- }), jsx("span", {
21725
- className: "adyen-kyc-summary__data",
21726
- children: fieldData
21727
- })]
21728
- }));
21729
- }
21730
- });
21731
- }
22051
+ Object.entries(formData).forEach(([field, fieldData]) => {
22052
+ if ((omittedKeys == null ? void 0 : omittedKeys.includes(field)) || !fieldData) return;
22053
+ const fieldName = i18n.get(labelData[field]) || i18n.get(field);
22054
+ if (typeof fieldData === "object") {
22055
+ dataList.push(renderSummaryItems(fieldData, labelData));
22056
+ } else if (typeof fieldData === "string") {
22057
+ dataList.push(jsxs("div", {
22058
+ className: "adyen-kyc-summary-section__field",
22059
+ children: [jsx("dt", {
22060
+ className: "adyen-kyc-summary-section__label",
22061
+ children: fieldName
22062
+ }), jsx("dd", {
22063
+ className: "adyen-kyc-summary-section__data",
22064
+ children: fieldData
22065
+ })]
22066
+ }));
22067
+ }
22068
+ });
21732
22069
  return dataList;
21733
22070
  };
21734
22071
  return jsxs("div", {
@@ -21742,9 +22079,9 @@ function Summary({
21742
22079
  verificationErrors: allVerificationErrors,
21743
22080
  formUtils,
21744
22081
  id: "ariaErrorField"
21745
- }), jsx("ul", {
21746
- className: "adyen-kyc-summary",
21747
- children: renderSummary(data)
22082
+ }), jsx("div", {
22083
+ className: "adyen-kyc-summary__content",
22084
+ children: renderSummaryContent(data)
21748
22085
  }), showLegalCaption && jsx("span", {
21749
22086
  className: "adyen-kyc-summary__legal-caption",
21750
22087
  children: i18n.get("summaryLegalCaption")
@@ -21974,7 +22311,7 @@ const defaultPayoutAccountFormat = {
21974
22311
  [CountryCodes.Sweden]: "local",
21975
22312
  [CountryCodes.UnitedKingdom]: "local"
21976
22313
  };
21977
- const logger$h = createLogger("useScenarioConfiguration");
22314
+ const logger$i = createLogger("useScenarioConfiguration");
21978
22315
  const useScenarioConfiguration = ({
21979
22316
  getConfigurationData,
21980
22317
  getPayoutAccountFormatData,
@@ -21997,12 +22334,12 @@ const useScenarioConfiguration = ({
21997
22334
  const response = await getConfigurationData();
21998
22335
  setConfigurationResponse(response);
21999
22336
  } catch (err) {
22000
- logger$h.warn("WARNING: Configuration request failed - error:", err);
22337
+ logger$i.warn("WARNING: Configuration request failed - error:", err);
22001
22338
  } finally {
22002
22339
  setLoadingStatus("success");
22003
22340
  }
22004
22341
  };
22005
- makeConfigCallAndSave().catch(logger$h.error);
22342
+ makeConfigCallAndSave().catch(logger$i.error);
22006
22343
  }, [getConfigurationData, setLoadingStatus]);
22007
22344
  useEffect(() => {
22008
22345
  setLoadingStatus("loading");
@@ -22019,12 +22356,12 @@ const useScenarioConfiguration = ({
22019
22356
  const defaultAccountFormat = defaultPayoutAccountFormat[country2] ?? allowedBankAccountFormats[0];
22020
22357
  setAccountFormat(existingBankAccountFormat ?? defaultAccountFormat);
22021
22358
  } catch (err) {
22022
- logger$h.warn("WARNING: Payout format request failed - error:", err);
22359
+ logger$i.warn("WARNING: Payout format request failed - error:", err);
22023
22360
  } finally {
22024
22361
  setLoadingStatus("success");
22025
22362
  }
22026
22363
  };
22027
- makePayoutFormatCallAndSave().catch(logger$h.error);
22364
+ makePayoutFormatCallAndSave().catch(logger$i.error);
22028
22365
  }, [country2, setAccountFormat, getPayoutAccountFormatData, setLoadingStatus, existingBankAccountFormat]);
22029
22366
  const {
22030
22367
  fieldConfigurations,
@@ -22193,10 +22530,13 @@ const solePropBase = {
22193
22530
  rule: "REQUIRED"
22194
22531
  },
22195
22532
  stockExchangeMIC: {
22196
- rule: "stockExchangeMICIfTypePublic"
22533
+ rule: "ifPubliclyTradedCompany"
22197
22534
  },
22198
22535
  stockISIN: {
22199
- rule: "stockISINIfTypePublic"
22536
+ rule: "ifPubliclyTradedCompany"
22537
+ },
22538
+ stockTickerSymbol: {
22539
+ rule: "ifPubliclyTradedCompany"
22200
22540
  },
22201
22541
  tradingName: {
22202
22542
  rule: "REQUIRED"
@@ -22320,6 +22660,10 @@ function parseTrustScenarios(scenario, country2) {
22320
22660
  return fieldConfigurations;
22321
22661
  }
22322
22662
  }
22663
+ const parseHighExposureScenarios = (scenario) => scenario == null ? void 0 : scenario.reduce((scenarios, scenarioName) => ({
22664
+ ...scenarios,
22665
+ ...fieldsPerScenario$1[scenarioName]
22666
+ }), {});
22323
22667
  function parseSolePropScenarios(scenario, country2) {
22324
22668
  if (scenario) {
22325
22669
  let fieldConfigurations = scenario.reduce((scenarios, scenarioName) => ({
@@ -23122,7 +23466,7 @@ function VatNumberField({
23122
23466
  }
23123
23467
  const BUSINESS_NAME_FIELD = ["businessName"];
23124
23468
  const basicInformationFields = [...COUNTRY_FIELD, ...BUSINESS_NAME_FIELD, ...STATE_FIELD, ...TAX_INFORMATION_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD];
23125
- const additionalInformationFields = [...LEGAL_COMPANY_NAME_FIELD, ...TRADING_NAME_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD];
23469
+ const additionalInformationFields = [...LEGAL_COMPANY_NAME_FIELD, ...TRADING_NAME_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...STOCK_TICKER_SYMBOL_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD];
23126
23470
  const FIELDS_NEEDED_FOR_COMPANY_SEARCH = [...BUSINESS_NAME_FIELD, ...TAX_INFORMATION_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD];
23127
23471
  const getForms = (country2) => ({
23128
23472
  basicInformation: {
@@ -23600,7 +23944,7 @@ const useExpiryThreshold = (expiry) => {
23600
23944
  };
23601
23945
  };
23602
23946
  const ExpiryContext = createContext(false);
23603
- const logger$g = createLogger("ExpiryProvider");
23947
+ const logger$h = createLogger("ExpiryProvider");
23604
23948
  const ExpiryProvider = ({
23605
23949
  expiry: initialExpiry,
23606
23950
  eventEmitter,
@@ -23633,7 +23977,7 @@ const ExpiryProvider = ({
23633
23977
  refreshExpiry().then((newExpiry) => {
23634
23978
  setExpiry(newExpiry);
23635
23979
  setModalDismissed(false);
23636
- }).catch(logger$g.error);
23980
+ }).catch(logger$h.error);
23637
23981
  }
23638
23982
  }), children]
23639
23983
  });
@@ -23653,7 +23997,7 @@ const ExpiryProvider = ({
23653
23997
  });
23654
23998
  };
23655
23999
  const useHasExpired = () => useContext(ExpiryContext);
23656
- const logger$f = createLogger("FormRouterContextProvider");
24000
+ const logger$g = createLogger("FormRouterContextProvider");
23657
24001
  function FormRouterContextProvider({
23658
24002
  children,
23659
24003
  forms: forms2,
@@ -23673,7 +24017,7 @@ function FormRouterContextProvider({
23673
24017
  if (formIndex > -1) {
23674
24018
  setFormIndex(formIndex);
23675
24019
  } else {
23676
- logger$f.error("No form was found to have that field so form navigation failed.");
24020
+ logger$g.error("No form was found to have that field so form navigation failed.");
23677
24021
  }
23678
24022
  }
23679
24023
  }), [forms2, handleGetIdVerificationToken, setFormIndex]);
@@ -23838,7 +24182,7 @@ const FormWrapper = ({
23838
24182
  isExperimentEnabled
23839
24183
  } = useExperimentsContext();
23840
24184
  const showExtraTaxExemptionReasons = isExperimentEnabled(ExperimentNames.ShowExtraTaxExemptionReasons);
23841
- const showTaxExemptedLegalCaption = showExtraTaxExemptionReasons && ((_a = summaryData.companyRegistrationDetails) == null ? void 0 : _a.vatAbsenceReason);
24185
+ const showTaxExemptedLegalCaption = showExtraTaxExemptionReasons && ((_a = summaryData.companyRegistrationDetails) == null ? void 0 : _a.vatAbsenceReason) && ["companyDetails"].includes(taskName);
23842
24186
  const summaryContent = jsx("div", {
23843
24187
  className: "adyen-kyc-form-wrapper",
23844
24188
  children: jsx(Summary, {
@@ -23935,11 +24279,16 @@ const validateErrorCode = (error, errorCode) => error && "errorCode" in error &&
23935
24279
  const isValidationError = (error) => validateErrorCode(error, API_VALIDATION_ERROR_CODE);
23936
24280
  const isIdDocumentUploadError = (error) => validateErrorCode(error, ID_DOCUMENT_UPLOAD_ERROR_CODE);
23937
24281
  const isBankStatementUploadError = (error) => validateErrorCode(error, BANK_STATEMENT_UPLOAD_ERROR_CODE);
23938
- const processValidationErrors = (validationError, dropinTask) => {
24282
+ const processValidationErrors = (validationError, dropinTask, keyMappings) => {
23939
24283
  if ((validationError == null ? void 0 : validationError.invalidFields) && (validationError == null ? void 0 : validationError.invalidFields.length) > 0) {
23940
24284
  return validationError == null ? void 0 : validationError.invalidFields.reduce((acc, invalidField) => {
23941
24285
  if (invalidField == null ? void 0 : invalidField.name) {
23942
- const mappedFieldPath = mapField(invalidField == null ? void 0 : invalidField.name, dropinTask);
24286
+ let mappedFieldPath = mapField(invalidField == null ? void 0 : invalidField.name, dropinTask);
24287
+ if (keyMappings) {
24288
+ mappedFieldPath = {
24289
+ ...keyMappings
24290
+ };
24291
+ }
23943
24292
  if (mappedFieldPath) {
23944
24293
  assignToProp(mappedFieldPath, acc, true);
23945
24294
  }
@@ -24001,7 +24350,7 @@ const mapBusinessDetailsSchemaToLegalEntity = (data) => {
24001
24350
  return requestObj;
24002
24351
  };
24003
24352
  const MANDATORY_API_FIELDS = ["basicInformation.legalCompanyName", "basicInformation.country"];
24004
- const parseConfiguration$6 = ({
24353
+ const parseConfiguration$7 = ({
24005
24354
  country: country2,
24006
24355
  matchingScenario
24007
24356
  }) => parseBusinessDetailsScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION], country2);
@@ -24017,15 +24366,7 @@ const formatDataForSummary$1 = (data, forms2, labels2, i18n) => {
24017
24366
  if (!form) return summaryData;
24018
24367
  switch (form) {
24019
24368
  case "basicInformation":
24020
- return {
24021
- ...summaryData,
24022
- [form]: formData
24023
- };
24024
24369
  case "companyStructure":
24025
- return {
24026
- ...summaryData,
24027
- [form]: formData
24028
- };
24029
24370
  case "additionalInformation":
24030
24371
  return {
24031
24372
  ...summaryData,
@@ -24261,7 +24602,7 @@ function BusinessDetailsDropinComponent({
24261
24602
  const {
24262
24603
  fieldConfigurations
24263
24604
  } = useScenarioConfiguration({
24264
- parseConfiguration: parseConfiguration$6,
24605
+ parseConfiguration: parseConfiguration$7,
24265
24606
  getConfigurationData,
24266
24607
  setLoadingStatus,
24267
24608
  country: currentCountry
@@ -24548,7 +24889,7 @@ const getTargetLegalEntityType = (businessType, legalArrangement, trusteeType, c
24548
24889
  return currentLegalEntityType;
24549
24890
  };
24550
24891
  const isLegalArrangementOrganizationSubtype = (legalArrangementOption) => legalArrangementOption === "partnershipIncorporated" || legalArrangementOption === "associationIncorporated";
24551
- const parseConfiguration$5 = ({
24892
+ const parseConfiguration$6 = ({
24552
24893
  country: country2,
24553
24894
  matchingScenario
24554
24895
  }) => parseCompanyScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION], country2);
@@ -24597,10 +24938,13 @@ function CompanyDropinComponent({
24597
24938
  handleUpdateLegalEntity,
24598
24939
  handleHomeClick,
24599
24940
  onTypeSwitch,
24600
- onChange,
24601
- accountHolder: accountHolder2
24941
+ onChange
24602
24942
  }) {
24603
24943
  var _a, _b;
24944
+ const {
24945
+ accountHolder: accountHolder2,
24946
+ setAccountHolder
24947
+ } = useCoreContext();
24604
24948
  const {
24605
24949
  showToast,
24606
24950
  clearToasts
@@ -24645,7 +24989,7 @@ function CompanyDropinComponent({
24645
24989
  fieldConfigurations,
24646
24990
  requiredFields
24647
24991
  } = useScenarioConfiguration({
24648
- parseConfiguration: parseConfiguration$5,
24992
+ parseConfiguration: parseConfiguration$6,
24649
24993
  getConfigurationData,
24650
24994
  setLoadingStatus,
24651
24995
  country: country2
@@ -24732,7 +25076,8 @@ function CompanyDropinComponent({
24732
25076
  legalEntityName: dataSubmitted.companyNameAndCountry.legalCompanyName,
24733
25077
  usedAdditionalAddress: dataSubmitted.companyRegistrationAddress.operationalAddressIsSame === operationalAddressIsSameIds.OPERATIONAL_ADDRESS_IS_NOT_SAME
24734
25078
  };
24735
- legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, dataSubmitted.companyType.accountHolder);
25079
+ const newAccountHolder = dataSubmitted.companyType.accountHolder ?? accountHolder2;
25080
+ legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, newAccountHolder);
24736
25081
  if (!isCountryOfGoverningLawEnabled && ((_a2 = legalEntity.organization) == null ? void 0 : _a2.countryOfGoverningLaw)) {
24737
25082
  delete legalEntity.organization.countryOfGoverningLaw;
24738
25083
  }
@@ -24748,6 +25093,7 @@ function CompanyDropinComponent({
24748
25093
  } else {
24749
25094
  legalEntity = await handleUpdateLegalEntity(drop("type").from(legalEntity), legalEntityResponse.id);
24750
25095
  }
25096
+ setAccountHolder(newAccountHolder);
24751
25097
  userEvents.addEvent("Saved company details", {
24752
25098
  segmentation: {
24753
25099
  ...baseTrackingPayload,
@@ -24826,33 +25172,32 @@ function CompanyDropinComponent({
24826
25172
  }, []);
24827
25173
  const datasetUtils = datasetUtilities(i18n.locale);
24828
25174
  const formatDataForSummary2 = (data2, forms22) => {
24829
- var _a2, _b2, _c, _d, _e, _f, _g, _h;
25175
+ var _a2, _b2, _c, _d, _e, _f;
24830
25176
  let summaryData = cloneObject(data2);
24831
- if ((_a2 = summaryData == null ? void 0 : summaryData.companyNameAndCountry) == null ? void 0 : _a2.country) {
24832
- summaryData.companyNameAndCountry.countryRegionOfEstablishment = datasetUtils.getCountryName(summaryData.companyNameAndCountry.country);
25177
+ if (summaryData.companyNameAndCountry) {
25178
+ if (isCountryOfGoverningLawEnabled) {
25179
+ summaryData.companyNameAndCountry = getUpdatedCountryOfGoverningLaw(summaryData.companyNameAndCountry);
25180
+ } else {
25181
+ summaryData.companyNameAndCountry.country = datasetUtils.getCountryName(summaryData.companyNameAndCountry.country);
25182
+ }
25183
+ summaryData.companyNameAndCountry.countryRegionOfEstablishment = summaryData.companyNameAndCountry.country;
24833
25184
  delete summaryData.companyNameAndCountry.country;
24834
25185
  }
24835
- if (isCountryOfGoverningLawEnabled) {
24836
- summaryData.companyNameAndCountry = getUpdatedCountryOfGoverningLaw(summaryData.companyNameAndCountry);
24837
- }
24838
- if ((_b2 = summaryData == null ? void 0 : summaryData.companyType) == null ? void 0 : _b2.entityType) {
24839
- const companyType2 = (_c = companyTypes.find((companyType22) => {
24840
- var _a3;
24841
- return companyType22.id === ((_a3 = summaryData.companyType) == null ? void 0 : _a3.entityType);
24842
- })) == null ? void 0 : _c.name;
25186
+ if ((_a2 = summaryData.companyType) == null ? void 0 : _a2.entityType) {
25187
+ const companyType2 = (_b2 = companyTypes.find((type) => type.id === summaryData.companyType.entityType)) == null ? void 0 : _b2.name;
24843
25188
  summaryData.companyType.entityType = i18n.get(companyType2);
24844
25189
  }
24845
- if ((_d = summaryData == null ? void 0 : summaryData.companyType) == null ? void 0 : _d.accountHolder) {
24846
- summaryData.companyType.accountHolder = i18n.get((_e = summaryData == null ? void 0 : summaryData.companyType) == null ? void 0 : _e.accountHolder);
25190
+ if ((_c = summaryData.companyType) == null ? void 0 : _c.accountHolder) {
25191
+ summaryData.companyType.accountHolder = i18n.get(summaryData.companyType.accountHolder);
24847
25192
  }
24848
- if ((_f = summaryData == null ? void 0 : summaryData.companyRegistrationAddress) == null ? void 0 : _f.registrationAddress) {
25193
+ if ((_d = summaryData.companyRegistrationAddress) == null ? void 0 : _d.registrationAddress) {
24849
25194
  summaryData.companyRegistrationAddress.hasInnerForms = true;
24850
- summaryData.companyRegistrationAddress.registrationAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.companyRegistrationAddress.registrationAddress, datasetUtils);
25195
+ summaryData.companyRegistrationAddress.registrationAddress = mapAddressLabels(summaryData.companyRegistrationAddress.registrationAddress, datasetUtils);
24851
25196
  }
24852
- if ((_g = summaryData == null ? void 0 : summaryData.companyRegistrationAddress) == null ? void 0 : _g.operationalAddress) {
24853
- summaryData.companyRegistrationAddress.operationalAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.companyRegistrationAddress.operationalAddress, datasetUtils);
25197
+ if ((_e = summaryData.companyRegistrationAddress) == null ? void 0 : _e.operationalAddress) {
25198
+ summaryData.companyRegistrationAddress.operationalAddress = mapAddressLabels(summaryData.companyRegistrationAddress.operationalAddress, datasetUtils);
24854
25199
  }
24855
- if ((_h = summaryData.companyRegistrationDetails) == null ? void 0 : _h.vatAbsenceReason) {
25200
+ if ((_f = summaryData.companyRegistrationDetails) == null ? void 0 : _f.vatAbsenceReason) {
24856
25201
  const vatAbsenceReason2 = vatAbsenceReasons.find((absenceReason) => absenceReason === summaryData.companyRegistrationDetails.vatAbsenceReason);
24857
25202
  if (vatAbsenceReason2) {
24858
25203
  summaryData.companyRegistrationDetails.vatAbsenceReason = i18n.get(vatAbsenceReason2);
@@ -24934,7 +25279,7 @@ var CompanySearchEvents = /* @__PURE__ */ ((CompanySearchEvents2) => {
24934
25279
  CompanySearchEvents2["SELECTION_ERROR"] = "CompanySearch_CompanySelectionError";
24935
25280
  return CompanySearchEvents2;
24936
25281
  })(CompanySearchEvents || {});
24937
- const logger$e = createLogger("useCompanySearch");
25282
+ const logger$f = createLogger("useCompanySearch");
24938
25283
  const LOW_RISK_COMPANY_DATA_COMPLIANCE_WINDOW = 1577664e5;
24939
25284
  function useCompanySearch({
24940
25285
  defaultData,
@@ -25058,7 +25403,7 @@ function useCompanySearch({
25058
25403
  state: companyData.state ?? stateOrProvince2
25059
25404
  });
25060
25405
  } catch (e) {
25061
- logger$e.error(e);
25406
+ logger$f.error(e);
25062
25407
  setError(e);
25063
25408
  setStatus("error");
25064
25409
  } finally {
@@ -25091,7 +25436,7 @@ function useCompanySearch({
25091
25436
  indexSearch: handleCompanyIndexSearch,
25092
25437
  deepSearch: handleCompanyDeepSearch,
25093
25438
  resultsLimit: limit
25094
- })) == null ? void 0 : _a.catch((e) => logger$e.error(e));
25439
+ })) == null ? void 0 : _a.catch((e) => logger$f.error(e));
25095
25440
  }
25096
25441
  }, [legalCompanyName2, country2, stateOrProvince2, taxIdentificationNumber2, verifiedCompany, searchCompanies, handleCompanyIndexSearch, handleCompanyDeepSearch, limit, canVerify, baseTrackingPayload]);
25097
25442
  useEffect(() => {
@@ -25550,10 +25895,12 @@ const defaultFieldMetadata = defaultFieldMetadata$7;
25550
25895
  const defaultFieldConfig = entriesOf(defaultFieldConfig$7).reduce((fieldConfig, [country2, countryEntry]) => ({
25551
25896
  ...fieldConfig,
25552
25897
  [country2]: ({
25553
- taxIdNumberType
25898
+ taxIdNumberType,
25899
+ companyType: companyType2
25554
25900
  }) => {
25555
25901
  const fieldMetadata = resolveFieldMetadata(countryEntry, {
25556
- taxIdNumberType
25902
+ taxIdNumberType,
25903
+ companyType: companyType2
25557
25904
  }, defaultFieldMetadata$7);
25558
25905
  const taxIdValidators = fieldMetadata.validators ? Array.isArray(fieldMetadata.validators) ? fieldMetadata.validators : [fieldMetadata.validators] : [];
25559
25906
  const mappedValidators = taxIdValidators.map((validator) => ({
@@ -25620,7 +25967,7 @@ function CompanyBasics({
25620
25967
  const [loading2, setLoading] = useState$1(false);
25621
25968
  const allowedCountries = useAllowedCountries();
25622
25969
  const existingTaxId = (_b = (_a = data == null ? void 0 : data.taxInformation) == null ? void 0 : _a.find((taxId2) => taxId2.country === country2)) == null ? void 0 : _b.number;
25623
- const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_c = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _c[0].id;
25970
+ const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2, companyType2) : (_c = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _c[0].id;
25624
25971
  const [taxIdNumberType, setTaxIdNumberType] = useState$1(defaultTaxIdNumberType);
25625
25972
  const initialFormUtilsProps = useMemo$1(() => ({
25626
25973
  allFields,
@@ -25664,7 +26011,8 @@ function CompanyBasics({
25664
26011
  };
25665
26012
  case "taxInformation":
25666
26013
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
25667
- taxIdNumberType
26014
+ taxIdNumberType,
26015
+ companyType: companyType2
25668
26016
  }, defaultFieldMetadata), acc);
25669
26017
  default:
25670
26018
  return acc;
@@ -25811,7 +26159,7 @@ const TradingNameFieldValidation = () => ({
25811
26159
  }]
25812
26160
  });
25813
26161
  const COMPANY_OTHER_DETAILS_FORM_ID = "companyOtherDetails";
25814
- const companyOtherDetailsFields = [...TRADING_NAME_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD];
26162
+ const companyOtherDetailsFields = [...TRADING_NAME_FIELD, ...STOCK_EXCHANGE_MIC_FIELD, ...STOCK_ISIN_FIELD, ...STOCK_TICKER_SYMBOL_FIELD, ...DATE_OF_INCORPORATION_FIELD, ...BUSINESS_REGISTRATION_NUMBER_FIELD, ...TAX_INFORMATION_FIELD, ...VAT_NUMBER_FIELD];
25815
26163
  function CompanyOtherDetails({
25816
26164
  data,
25817
26165
  labels: labels2,
@@ -25842,12 +26190,12 @@ function CompanyOtherDetails({
25842
26190
  const registrationNumberOptions = useMemo$1(() => getCompanyRegistrationNumberOptions(country2, companyType2), [country2, companyType2]);
25843
26191
  const defaultRegistrationNumberType = (data == null ? void 0 : data.registrationNumber) ? inferCompanyRegistrationNumberType(data == null ? void 0 : data.registrationNumber, country2, companyType2) : registrationNumberOptions == null ? void 0 : registrationNumberOptions[0].id;
25844
26192
  const [registrationNumberType, setRegistrationNumberType] = useState$1(defaultRegistrationNumberType);
25845
- const defaultVatNumberType = (data == null ? void 0 : data.vatNumber) ? inferTaxIdNumberType(data == null ? void 0 : data.vatNumber, country2) : (_a = taxIdNumberOptions[country2]) == null ? void 0 : _a[0].id;
26193
+ const defaultVatNumberType = (data == null ? void 0 : data.vatNumber) ? inferTaxIdNumberType(data == null ? void 0 : data.vatNumber, country2, companyType2) : (_a = taxIdNumberOptions[country2]) == null ? void 0 : _a[0].id;
25846
26194
  const [vatNumberType, setVatNumberType] = useState$1(defaultVatNumberType);
25847
26195
  const existingTaxId = (_c = (_b = data == null ? void 0 : data.taxInformation) == null ? void 0 : _b.find((taxId2) => taxId2.country === country2)) == null ? void 0 : _c.number;
25848
- const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2) : (_d = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _d[0].id;
26196
+ const defaultTaxIdNumberType = existingTaxId ? inferTaxIdNumberType(existingTaxId, country2, companyType2) : (_d = getTaxIdNumberOptions(country2, companyType2)) == null ? void 0 : _d[0].id;
25849
26197
  const [taxIdNumberType, setTaxIdNumberType] = useState$1(defaultTaxIdNumberType);
25850
- const directChildFields = companyOtherDetailsFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "dateOfIncorporation"].includes(field));
26198
+ const directChildFields = companyOtherDetailsFields.filter((field) => ["tradingName", "sameNameAsLegalName", "stockExchangeMIC", "stockISIN", "stockTickerSymbol", "dateOfIncorporation"].includes(field));
25851
26199
  const initialFormUtilsProps = useMemo$1(() => ({
25852
26200
  allFields,
25853
26201
  labels: labels2,
@@ -25884,6 +26232,8 @@ function CompanyOtherDetails({
25884
26232
  return mergeFieldMetadataIntoProps("stockExchangeMIC", stockExchangeMICFieldMetadata, acc);
25885
26233
  case "stockISIN":
25886
26234
  return mergeFieldMetadataIntoProps("stockISIN", stockISINFieldMetadata, acc);
26235
+ case "stockTickerSymbol":
26236
+ return mergeFieldMetadataIntoProps("stockTickerSymbol", stockTickerSymbolFieldMetadata, acc);
25887
26237
  case "registrationNumber":
25888
26238
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$8[country2], {
25889
26239
  companyType: companyType2,
@@ -25891,7 +26241,8 @@ function CompanyOtherDetails({
25891
26241
  }, defaultFieldMetadata$8), acc);
25892
26242
  case "taxInformation":
25893
26243
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig[country2], {
25894
- taxIdNumberType
26244
+ taxIdNumberType,
26245
+ companyType: companyType2
25895
26246
  }, defaultFieldMetadata), acc);
25896
26247
  case "vatNumber":
25897
26248
  return mergeFieldMetadataIntoProps(field, resolveFieldMetadata(defaultFieldConfig$6[country2], {
@@ -26057,6 +26408,19 @@ function CompanyOtherDetails({
26057
26408
  readonly: formUtils.isReadOnly("stockISIN"),
26058
26409
  handleChangeFor
26059
26410
  })
26411
+ }), formUtils.isRequiredField("stockTickerSymbol") && jsx("div", {
26412
+ className: "adyen-kyc-field-wrapper",
26413
+ children: jsx(StockTickerSymbolField, {
26414
+ data: formUtils.getFieldData(formData, STOCK_TICKER_SYMBOL_FIELD),
26415
+ valid: formUtils.getFieldValid(formValid, STOCK_TICKER_SYMBOL_FIELD),
26416
+ errors: formUtils.getFieldErrors(formErrors, formFieldProblems, STOCK_TICKER_SYMBOL_FIELD),
26417
+ labels: formUtils.getFieldLabels(STOCK_TICKER_SYMBOL_FIELD),
26418
+ placeholders: formUtils.getFieldPlaceholders(STOCK_TICKER_SYMBOL_FIELD),
26419
+ mask: formUtils.getMask("stockTickerSymbol"),
26420
+ guidanceText: formUtils.getFieldGuidanceText(STOCK_TICKER_SYMBOL_FIELD),
26421
+ readonly: formUtils.isReadOnly("stockTickerSymbol"),
26422
+ handleChangeFor
26423
+ })
26060
26424
  })]
26061
26425
  })]
26062
26426
  });
@@ -26100,7 +26464,7 @@ const forms = {
26100
26464
  fields: ["taxDocument"]
26101
26465
  }
26102
26466
  };
26103
- const parseConfiguration$4 = ({
26467
+ const parseConfiguration$5 = ({
26104
26468
  country: country2,
26105
26469
  matchingScenario
26106
26470
  }) => parseCompanySearchScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION], country2);
@@ -26130,7 +26494,8 @@ const formatDataForSummary = (data, forms2, labels2, i18n) => {
26130
26494
  const datasetUtils = datasetUtilities(i18n.locale);
26131
26495
  const country2 = (_a = data.companyBasics) == null ? void 0 : _a.country;
26132
26496
  const taxIdLabel = resolveFieldMetadata(defaultFieldConfig[country2], {
26133
- taxIdNumberType: countryToTaxInfoTypeMap[country2]
26497
+ taxIdNumberType: countryToTaxInfoTypeMap[country2],
26498
+ companyType: void 0
26134
26499
  }, defaultFieldMetadata).label;
26135
26500
  return entriesOf(data).reduce((summaryData, [form, formData]) => {
26136
26501
  var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
@@ -26318,7 +26683,7 @@ const mapLegalEntityToCompanySearchSchema = (legalEntity, isChangingType, accoun
26318
26683
  }
26319
26684
  }, {});
26320
26685
  };
26321
- const logger$d = createLogger("useFormTaskSubmit");
26686
+ const logger$e = createLogger("useFormTaskSubmit");
26322
26687
  function useCompanySearchTaskSubmit({
26323
26688
  task,
26324
26689
  forms: forms2,
@@ -26361,7 +26726,7 @@ function useCompanySearchTaskSubmit({
26361
26726
  });
26362
26727
  }
26363
26728
  } catch (e) {
26364
- logger$d.error(e);
26729
+ logger$e.error(e);
26365
26730
  userEvents.addEvent(CompanySearchEvents.DOCUMENTS_ERROR, {
26366
26731
  segmentation: {
26367
26732
  ...baseTrackingPayload,
@@ -26413,7 +26778,7 @@ function useCompanySearchTaskSubmit({
26413
26778
  ...trackingPayload
26414
26779
  }
26415
26780
  });
26416
- logger$d.log(submittedLegalEntity);
26781
+ logger$e.log(submittedLegalEntity);
26417
26782
  clearToasts();
26418
26783
  onExternalSubmit == null ? void 0 : onExternalSubmit(data);
26419
26784
  } catch (e) {
@@ -26437,7 +26802,7 @@ function useCompanySearchTaskSubmit({
26437
26802
  type: ToastType.ERROR
26438
26803
  });
26439
26804
  }
26440
- logger$d.error(e);
26805
+ logger$e.error(e);
26441
26806
  userEvents.addEvent(CompanySearchEvents.TASK_ERROR, {
26442
26807
  segmentation: {
26443
26808
  ...baseTrackingPayload,
@@ -26503,7 +26868,7 @@ function CompanySearchComponent(props) {
26503
26868
  }), jsx("div", {
26504
26869
  className: formWrapperClasses(forms.companyRegistrationAddress.formId),
26505
26870
  children: jsx(RegistrationAddressComponent, {
26506
- ...getFormProps(props, forms.companyRegistrationAddress.formId),
26871
+ ...getNestedOuterFormPropsFromOuterFormProps(props, forms.companyRegistrationAddress.formId),
26507
26872
  id: forms.companyRegistrationAddress.formId,
26508
26873
  heading: i18n.get(forms.companyRegistrationAddress.formName),
26509
26874
  description: i18n.get(forms.companyRegistrationAddress.formDescription, {
@@ -26664,7 +27029,7 @@ function CompanySearchDropinComponent({
26664
27029
  const {
26665
27030
  fieldConfigurations
26666
27031
  } = useScenarioConfiguration({
26667
- parseConfiguration: parseConfiguration$4,
27032
+ parseConfiguration: parseConfiguration$5,
26668
27033
  getConfigurationData,
26669
27034
  setLoadingStatus,
26670
27035
  country: country2
@@ -26790,7 +27155,7 @@ function CompanySearchDropinComponent({
26790
27155
  })
26791
27156
  });
26792
27157
  }
26793
- const logger$c = createLogger("useLocalStorage");
27158
+ const logger$d = createLogger("useLocalStorage");
26794
27159
  const useLocalStorage = (key, defaultValue, options) => {
26795
27160
  const {
26796
27161
  serializer,
@@ -26810,7 +27175,7 @@ const useLocalStorage = (key, defaultValue, options) => {
26810
27175
  const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
26811
27176
  return res;
26812
27177
  } catch (err) {
26813
- logger$c.error(err);
27178
+ logger$d.error(err);
26814
27179
  return defaultValue;
26815
27180
  }
26816
27181
  });
@@ -26841,7 +27206,7 @@ const useLocalStorage = (key, defaultValue, options) => {
26841
27206
  try {
26842
27207
  updateLocalStorage();
26843
27208
  } catch (err) {
26844
- logger$c.error(err);
27209
+ logger$d.error(err);
26845
27210
  }
26846
27211
  }, [value]);
26847
27212
  useEffect(() => {
@@ -26854,7 +27219,7 @@ const useLocalStorage = (key, defaultValue, options) => {
26854
27219
  setValue(event.newValue ? parser(event.newValue) : void 0);
26855
27220
  }
26856
27221
  } catch (err) {
26857
- logger$c.error(err);
27222
+ logger$d.error(err);
26858
27223
  }
26859
27224
  };
26860
27225
  if (typeof window === "undefined") return;
@@ -26899,7 +27264,7 @@ const useIsEligibleForSingpass = ({
26899
27264
  }
26900
27265
  return legalEntity.type === LegalEntityType.ORGANIZATION;
26901
27266
  };
26902
- const logger$b = createLogger("useAssociatedLegalArrangement");
27267
+ const logger$c = createLogger("useAssociatedLegalArrangement");
26903
27268
  function useAssociatedLegalArrangement({
26904
27269
  rootLegalEntity,
26905
27270
  getLegalEntity: getLegalEntity2
@@ -26910,7 +27275,7 @@ function useAssociatedLegalArrangement({
26910
27275
  var _a;
26911
27276
  const foundEntity = (_a = rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations) == null ? void 0 : _a.find((entity) => entity.type === LegalEntityType.SOLE_PROPRIETORSHIP || entity.type === LegalEntityType.TRUST);
26912
27277
  if (foundEntity == null ? void 0 : foundEntity.legalEntityId) {
26913
- getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$b.error);
27278
+ getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$c.error);
26914
27279
  }
26915
27280
  }, [getAssociatedEntity, rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations]);
26916
27281
  useEffect(() => {
@@ -26924,7 +27289,15 @@ function useAssociatedLegalArrangement({
26924
27289
  refreshAssociatedLegalArrangement
26925
27290
  };
26926
27291
  }
26927
- const logger$a = createLogger("useExemptSettlor");
27292
+ const getCanSeeEntitySelectionStorageKey = (legalEntityId) => `ENTITY_SELECTION_SEEN-${legalEntityId}`;
27293
+ const useCanSeeEntitySelection = (legalEntityId) => {
27294
+ const [canSeeEntitySelectionFromLocalStorage, setCanSeeEntitySelectionIntoLocalStorage] = useLocalStorage(getCanSeeEntitySelectionStorageKey(legalEntityId), true);
27295
+ return {
27296
+ canSeeEntitySelection: canSeeEntitySelectionFromLocalStorage,
27297
+ setCanSeeEntitySelection: setCanSeeEntitySelectionIntoLocalStorage
27298
+ };
27299
+ };
27300
+ const logger$b = createLogger("useExemptSettlor");
26928
27301
  const useExemptSettlor = ({
26929
27302
  trust: trust2,
26930
27303
  handleGetLegalEntity
@@ -26937,7 +27310,7 @@ const useExemptSettlor = ({
26937
27310
  }, [handleGetLegalEntity]);
26938
27311
  useEffect(() => {
26939
27312
  if (!(trust2 == null ? void 0 : trust2.trust)) return;
26940
- updateExemptSettlor(trust2).catch(logger$a.error);
27313
+ updateExemptSettlor(trust2).catch(logger$b.error);
26941
27314
  }, [trust2, updateExemptSettlor]);
26942
27315
  return exemptSettlor;
26943
27316
  };
@@ -27297,55 +27670,6 @@ const useBusinessTypeExamples = (country2) => {
27297
27670
  }, [country2]);
27298
27671
  return examples;
27299
27672
  };
27300
- const headingTypes = {
27301
- 1: ({
27302
- children,
27303
- className
27304
- }) => jsx("h1", {
27305
- className,
27306
- children
27307
- }),
27308
- 2: ({
27309
- children,
27310
- className
27311
- }) => jsx("h2", {
27312
- className,
27313
- children
27314
- }),
27315
- 3: ({
27316
- children,
27317
- className
27318
- }) => jsx("h3", {
27319
- className,
27320
- children
27321
- }),
27322
- 4: ({
27323
- children,
27324
- className
27325
- }) => jsx("h4", {
27326
- className,
27327
- children
27328
- }),
27329
- sub: ({
27330
- children,
27331
- className
27332
- }) => jsx("div", {
27333
- className,
27334
- children
27335
- })
27336
- };
27337
- function Heading({
27338
- className,
27339
- level,
27340
- children
27341
- }) {
27342
- const HeadingElement = headingTypes[level] || headingTypes[1];
27343
- const classNames = cx("adyen-kyc-heading", `adyen-kyc-heading--${level}`, className);
27344
- return jsx(HeadingElement, {
27345
- className: classNames,
27346
- children
27347
- });
27348
- }
27349
27673
  const trusteeTypeItems = [{
27350
27674
  id: "individual",
27351
27675
  name: "individual"
@@ -29807,7 +30131,7 @@ const omitObscuredFieldsIfUnchanged = (obscuredFields, dataSubmitted, savedData)
29807
30131
  });
29808
30132
  return filtered;
29809
30133
  };
29810
- const parseConfiguration$3 = ({
30134
+ const parseConfiguration$4 = ({
29811
30135
  matchingScenario
29812
30136
  }) => parseIndividualScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.INDIVIDUAL]);
29813
30137
  function IndividualDropinComponent({
@@ -29839,6 +30163,10 @@ function IndividualDropinComponent({
29839
30163
  handleBackClick: externalBackClick
29840
30164
  }) {
29841
30165
  var _a, _b, _c, _d;
30166
+ const {
30167
+ accountHolder: accountHolder2,
30168
+ setAccountHolder
30169
+ } = useCoreContext();
29842
30170
  const {
29843
30171
  i18n
29844
30172
  } = useI18nContext();
@@ -29888,7 +30216,7 @@ function IndividualDropinComponent({
29888
30216
  const {
29889
30217
  fieldConfigurations
29890
30218
  } = useScenarioConfiguration({
29891
- parseConfiguration: parseConfiguration$3,
30219
+ parseConfiguration: parseConfiguration$4,
29892
30220
  getConfigurationData,
29893
30221
  setLoadingStatus,
29894
30222
  country: country2
@@ -30074,12 +30402,14 @@ function IndividualDropinComponent({
30074
30402
  idDocumentType: idDocumentType || null
30075
30403
  }
30076
30404
  });
30077
- legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, (_c2 = dataSubmitted.personalDetails) == null ? void 0 : _c2.accountHolder);
30405
+ const accountHolderToEvaluated = ((_c2 = dataSubmitted.personalDetails) == null ? void 0 : _c2.accountHolder) ?? accountHolder2;
30406
+ legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(taskType, legalEntityResponse, accountHolderToEvaluated ?? void 0);
30078
30407
  const createdLegalEntity = await submitLegalEntity({
30079
30408
  dataSubmitted,
30080
30409
  legalEntity,
30081
30410
  idDocumentType
30082
30411
  });
30412
+ setAccountHolder(accountHolderToEvaluated);
30083
30413
  await submitDocuments2({
30084
30414
  forms: forms2,
30085
30415
  legalEntity: createdLegalEntity,
@@ -30203,7 +30533,7 @@ function IndividualDropinComponent({
30203
30533
  ...formatFileSummaryData2(data)
30204
30534
  };
30205
30535
  }
30206
- if ((_c2 = summaryData == null ? void 0 : summaryData.personalDetails) == null ? void 0 : _c2.accountHolder) {
30536
+ if ((_c2 = summaryData.personalDetails) == null ? void 0 : _c2.accountHolder) {
30207
30537
  summaryData.personalDetails.accountHolder = i18n.get(summaryData.personalDetails.accountHolder);
30208
30538
  }
30209
30539
  return summaryData;
@@ -30271,7 +30601,8 @@ function IndividualDropinComponent({
30271
30601
  handleFindAddress,
30272
30602
  onTypeSwitch,
30273
30603
  onCountryChange: setCountry,
30274
- shouldValidate
30604
+ shouldValidate,
30605
+ accountHolder: accountHolder2
30275
30606
  })
30276
30607
  });
30277
30608
  }
@@ -30374,7 +30705,7 @@ const labels = () => ({
30374
30705
  verifiedCurrencyCode: () => "currencyCode",
30375
30706
  verifiedBankAccountNumber: () => "bankAccountNumber"
30376
30707
  });
30377
- const parseConfiguration$2 = ({
30708
+ const parseConfiguration$3 = ({
30378
30709
  requiredFields,
30379
30710
  country: country2,
30380
30711
  bankVerificationAvailable
@@ -30497,7 +30828,7 @@ function PayoutDetailsDropinComponent({
30497
30828
  requiredFields,
30498
30829
  bankVerificationVendors
30499
30830
  } = useScenarioConfiguration({
30500
- parseConfiguration: parseConfiguration$2,
30831
+ parseConfiguration: parseConfiguration$3,
30501
30832
  getConfigurationData,
30502
30833
  getPayoutAccountFormatData,
30503
30834
  instantVerificationEnabled,
@@ -31682,7 +32013,7 @@ const serviceAgreementValidationRules = {
31682
32013
  errorMessage: "fieldIsRequired"
31683
32014
  }
31684
32015
  };
31685
- const logger$9 = createLogger("useServiceAgreement");
32016
+ const logger$a = createLogger("useServiceAgreement");
31686
32017
  const FALLBACK_LANGUAGE_CODE = "en";
31687
32018
  const useServiceAgreement = ({
31688
32019
  handleGetServiceAgreement,
@@ -31715,7 +32046,7 @@ const useServiceAgreement = ({
31715
32046
  contract
31716
32047
  });
31717
32048
  };
31718
- requestAcceptedServiceAgreement().catch(logger$9.error).finally(() => setLoading("success"));
32049
+ requestAcceptedServiceAgreement().catch(logger$a.error).finally(() => setLoading("success"));
31719
32050
  }, [acceptanceId, handleViewAcceptedTermsOfServiceDocument]);
31720
32051
  useEffect(() => {
31721
32052
  const requestServiceAgreement = async () => {
@@ -31730,7 +32061,7 @@ const useServiceAgreement = ({
31730
32061
  language: agreementLanguage
31731
32062
  });
31732
32063
  if (!document2) {
31733
- logger$9.log('"document" field was missing in response');
32064
+ logger$a.log('"document" field was missing in response');
31734
32065
  return;
31735
32066
  }
31736
32067
  const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
@@ -31748,7 +32079,7 @@ const useServiceAgreement = ({
31748
32079
  throw err;
31749
32080
  }
31750
32081
  };
31751
- requestServiceAgreement().catch(logger$9.error);
32082
+ requestServiceAgreement().catch(logger$a.error);
31752
32083
  }, [handleGetServiceAgreement, handleServiceAgreementIsNotAvailableInThatLanguage, agreementLanguage, legalEntityId, serviceAgreementType]);
31753
32084
  return {
31754
32085
  loading: loading2,
@@ -32052,7 +32383,7 @@ function ServiceAgreementDropinComponent({
32052
32383
  })
32053
32384
  });
32054
32385
  }
32055
- const parseConfiguration$1 = ({
32386
+ const parseConfiguration$2 = ({
32056
32387
  matchingScenario,
32057
32388
  country: country2
32058
32389
  }) => parseSolePropScenarios(matchingScenario[LegalEntityType.SOLE_PROPRIETORSHIP], country2);
@@ -32154,7 +32485,7 @@ function SolePropDropinComponent({
32154
32485
  fieldConfigurations,
32155
32486
  requiredFields
32156
32487
  } = useScenarioConfiguration({
32157
- parseConfiguration: parseConfiguration$1,
32488
+ parseConfiguration: parseConfiguration$2,
32158
32489
  getConfigurationData,
32159
32490
  setLoadingStatus,
32160
32491
  country: country2
@@ -32291,18 +32622,18 @@ function SolePropDropinComponent({
32291
32622
  if (isCountryOfGoverningLawEnabled) {
32292
32623
  summaryData.solePropNameAndCountry = getUpdatedCountryOfGoverningLaw(summaryData.solePropNameAndCountry);
32293
32624
  }
32294
- const solePropCountry = ((_a2 = summaryData == null ? void 0 : summaryData.solePropNameAndCountry) == null ? void 0 : _a2.country) ? datasetUtils.getCountryName(summaryData.solePropNameAndCountry.country) : void 0;
32625
+ const solePropCountry = ((_a2 = summaryData.solePropNameAndCountry) == null ? void 0 : _a2.country) && datasetUtils.getCountryName(summaryData.solePropNameAndCountry.country);
32295
32626
  summaryData.solePropNameAndCountry = {
32296
32627
  legalNameOfSoleProprietor: (_b2 = data2.solePropNameAndCountry) == null ? void 0 : _b2.legalCompanyName,
32297
32628
  countryRegionOfEstablishment: solePropCountry,
32298
- countryOfGoverningLaw: ((_c = summaryData == null ? void 0 : summaryData.solePropNameAndCountry) == null ? void 0 : _c.countryOfGoverningLaw) ? datasetUtils.getCountryName(summaryData.solePropNameAndCountry.countryOfGoverningLaw) : void 0
32629
+ countryOfGoverningLaw: ((_c = summaryData.solePropNameAndCountry) == null ? void 0 : _c.countryOfGoverningLaw) && datasetUtils.getCountryName(summaryData.solePropNameAndCountry.countryOfGoverningLaw)
32299
32630
  };
32300
- if ((_d = summaryData == null ? void 0 : summaryData.solePropRegistrationAddress) == null ? void 0 : _d.registrationAddress) {
32631
+ if ((_d = summaryData.solePropRegistrationAddress) == null ? void 0 : _d.registrationAddress) {
32301
32632
  summaryData.solePropRegistrationAddress.hasInnerForms = true;
32302
- summaryData.solePropRegistrationAddress.registrationAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.solePropRegistrationAddress.registrationAddress, datasetUtils);
32633
+ summaryData.solePropRegistrationAddress.registrationAddress = mapAddressLabels(summaryData.solePropRegistrationAddress.registrationAddress, datasetUtils);
32303
32634
  }
32304
- if ((_e = summaryData == null ? void 0 : summaryData.solePropRegistrationAddress) == null ? void 0 : _e.operationalAddress) {
32305
- summaryData.solePropRegistrationAddress.operationalAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.solePropRegistrationAddress.operationalAddress, datasetUtils);
32635
+ if ((_e = summaryData.solePropRegistrationAddress) == null ? void 0 : _e.operationalAddress) {
32636
+ summaryData.solePropRegistrationAddress.operationalAddress = mapAddressLabels(summaryData.solePropRegistrationAddress.operationalAddress, datasetUtils);
32306
32637
  }
32307
32638
  if (isDocumentsRequired(forms22)) {
32308
32639
  delete summaryData[solePropDocumentFormId];
@@ -32385,7 +32716,7 @@ const rules = ({
32385
32716
  }
32386
32717
  }
32387
32718
  });
32388
- const parseConfiguration = ({
32719
+ const parseConfiguration$1 = ({
32389
32720
  matchingScenario,
32390
32721
  country: country2
32391
32722
  }) => parseTrustScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.TRUST], country2);
@@ -32439,7 +32770,7 @@ function TrustDropinComponent({
32439
32770
  fieldConfigurations,
32440
32771
  requiredFields
32441
32772
  } = useScenarioConfiguration({
32442
- parseConfiguration,
32773
+ parseConfiguration: parseConfiguration$1,
32443
32774
  getConfigurationData,
32444
32775
  setLoadingStatus,
32445
32776
  country: country2
@@ -32570,34 +32901,31 @@ function TrustDropinComponent({
32570
32901
  await handleUpdateLegalEntity(updatedParentLegalEntity, parentLegalEntity.id);
32571
32902
  };
32572
32903
  const formatDataForSummary2 = (data2, forms22) => {
32573
- var _a2, _b, _c, _d, _e, _f, _g, _h;
32904
+ var _a2, _b, _c;
32574
32905
  let summaryData = cloneObject(data2) || {};
32575
- if (summaryData == null ? void 0 : summaryData.trustRegistrationDetails) {
32576
- const trustCountry = ((_a2 = summaryData == null ? void 0 : summaryData.trustRegistrationDetails) == null ? void 0 : _a2.country) ? datasetUtils.getCountryName(summaryData.trustRegistrationDetails.country) : void 0;
32577
- const trustType2 = ((_b = summaryData == null ? void 0 : summaryData.trustRegistrationDetails) == null ? void 0 : _b.trustType) ? i18n.get((_c = trustTypeOptions.find((trustType22) => {
32578
- var _a3;
32579
- return trustType22.id === ((_a3 = summaryData.trustRegistrationDetails) == null ? void 0 : _a3.trustType);
32580
- })) == null ? void 0 : _c.name) : void 0;
32906
+ if (summaryData.trustRegistrationDetails) {
32907
+ const trustCountry = summaryData.trustRegistrationDetails.country && datasetUtils.getCountryName(summaryData.trustRegistrationDetails.country);
32908
+ const trustType2 = summaryData.trustRegistrationDetails.trustType && i18n.get((_a2 = trustTypeOptions.find((option) => option.id === summaryData.trustRegistrationDetails.trustType)) == null ? void 0 : _a2.name);
32581
32909
  summaryData.trustRegistrationDetails = {
32582
- nameOfTrustAgreement: (_d = summaryData == null ? void 0 : summaryData.trustRegistrationDetails) == null ? void 0 : _d.legalName,
32910
+ nameOfTrustAgreement: summaryData.trustRegistrationDetails.legalName,
32583
32911
  countryRegionOfEstablishment: trustCountry,
32584
32912
  typeOfTrustAgreement: trustType2,
32585
- objectOfTrust: (_e = summaryData == null ? void 0 : summaryData.trustRegistrationDetails) == null ? void 0 : _e.objectOfTrust,
32586
- taxId: (_f = summaryData == null ? void 0 : summaryData.trustRegistrationDetails) == null ? void 0 : _f.taxId
32913
+ objectOfTrust: summaryData.trustRegistrationDetails.objectOfTrust,
32914
+ taxId: summaryData.trustRegistrationDetails.taxId
32587
32915
  };
32588
32916
  }
32589
- if ((_g = summaryData == null ? void 0 : summaryData.trustRegistrationAddress) == null ? void 0 : _g.registrationAddress) {
32917
+ if ((_b = summaryData.trustRegistrationAddress) == null ? void 0 : _b.registrationAddress) {
32590
32918
  summaryData.trustRegistrationAddress.hasInnerForms = true;
32591
- summaryData.trustRegistrationAddress.registrationAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.trustRegistrationAddress.registrationAddress, datasetUtils);
32919
+ summaryData.trustRegistrationAddress.registrationAddress = mapAddressLabels(summaryData.trustRegistrationAddress.registrationAddress, datasetUtils);
32592
32920
  }
32593
- if ((_h = summaryData == null ? void 0 : summaryData.trustRegistrationAddress) == null ? void 0 : _h.operationalAddress) {
32594
- summaryData.trustRegistrationAddress.operationalAddress = mapAddressLabels(summaryData == null ? void 0 : summaryData.trustRegistrationAddress.operationalAddress, datasetUtils);
32921
+ if ((_c = summaryData.trustRegistrationAddress) == null ? void 0 : _c.operationalAddress) {
32922
+ summaryData.trustRegistrationAddress.operationalAddress = mapAddressLabels(summaryData.trustRegistrationAddress.operationalAddress, datasetUtils);
32595
32923
  }
32596
32924
  if (isDocumentsRequired2(forms22)) {
32597
32925
  delete summaryData[trustConstitutionalDocumentFormId];
32598
32926
  summaryData = {
32599
32927
  ...summaryData,
32600
- ...formatFileSummaryData2(summaryData == null ? void 0 : summaryData.trustConstitutionalDocument)
32928
+ ...formatFileSummaryData2(summaryData.trustConstitutionalDocument)
32601
32929
  };
32602
32930
  }
32603
32931
  return summaryData;
@@ -32703,6 +33031,9 @@ const useNavigation = ({
32703
33031
  const {
32704
33032
  accountHolder: accountHolder2
32705
33033
  } = useCoreContext();
33034
+ const {
33035
+ canSeeEntitySelection
33036
+ } = useCanSeeEntitySelection(legalEntity.id);
32706
33037
  const eligibleForSingpass = useIsEligibleForSingpass({
32707
33038
  legalEntity,
32708
33039
  accountHolder: accountHolder2,
@@ -32739,7 +33070,7 @@ const useNavigation = ({
32739
33070
  if (pushedTask === "default") {
32740
33071
  const defaultTask = getDefaultTask({
32741
33072
  legalEntity,
32742
- accountHolder: accountHolder2,
33073
+ canSeeEntitySelection,
32743
33074
  showIntroduction,
32744
33075
  isNewEntryFlowEnabled,
32745
33076
  shouldShowSingpassSelection
@@ -32756,13 +33087,13 @@ const useNavigation = ({
32756
33087
  };
32757
33088
  const getDefaultTask = ({
32758
33089
  legalEntity,
32759
- accountHolder: accountHolder2,
33090
+ canSeeEntitySelection,
32760
33091
  isNewEntryFlowEnabled,
32761
33092
  showIntroduction,
32762
33093
  shouldShowSingpassSelection
32763
33094
  }) => {
32764
33095
  const hasLegalEntityProgressedBeyondEntitySelection = hasProgressedBeyondEntitySelection(legalEntity);
32765
- if (isNewEntryFlowEnabled && !accountHolder2 && !hasLegalEntityProgressedBeyondEntitySelection) return TaskTypes.BUSINESS_TYPE_SELECTION;
33096
+ if (isNewEntryFlowEnabled && canSeeEntitySelection && !hasLegalEntityProgressedBeyondEntitySelection) return TaskTypes.BUSINESS_TYPE_SELECTION;
32766
33097
  if (showIntroduction) return TaskTypes.INTRODUCTION;
32767
33098
  if (shouldShowSingpassSelection) return TaskTypes.SINGPASS_SELECTION;
32768
33099
  return TaskTypes.TASKS_OVERVIEW;
@@ -32775,7 +33106,7 @@ const hasProgressedBeyondEntitySelection = (legalEntity) => {
32775
33106
  };
32776
33107
  const PAGES_WITH_POLLING = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
32777
33108
  const POLLING_INTERVAL = 3e3;
32778
- const logger$8 = createLogger("DropinComposerComponent");
33109
+ const logger$9 = createLogger("DropinComposerComponent");
32779
33110
  const isOrganizationSettlorWithExemptionReasonEnabled = (enabled, country2) => country2 === CountryCodes.Australia && enabled;
32780
33111
  function DropinComposerComponent({
32781
33112
  capabilities,
@@ -32792,6 +33123,9 @@ function DropinComposerComponent({
32792
33123
  accountHolder: accountHolder2,
32793
33124
  setAccountHolder
32794
33125
  } = useCoreContext();
33126
+ const {
33127
+ setCanSeeEntitySelection
33128
+ } = useCanSeeEntitySelection(legalEntityResponse.id);
32795
33129
  const {
32796
33130
  i18n
32797
33131
  } = useI18nContext();
@@ -32883,7 +33217,7 @@ function DropinComposerComponent({
32883
33217
  setPciStatus(response);
32884
33218
  return response;
32885
33219
  } catch (e) {
32886
- logger$8.warn(i18n.get("failedToGetPciStatus"));
33220
+ logger$9.warn(i18n.get("failedToGetPciStatus"));
32887
33221
  }
32888
33222
  }
32889
33223
  return void 0;
@@ -32911,7 +33245,7 @@ function DropinComposerComponent({
32911
33245
  }, [additionalSalesChannels, i18n, rootLegalEntity.id, args.handleGetPciTemplate]);
32912
33246
  useEffect(() => {
32913
33247
  if (!tasks.includes(TaskTypes.PCI_DSS)) return;
32914
- getPciTemplate().catch(logger$8.error);
33248
+ getPciTemplate().catch(logger$9.error);
32915
33249
  }, [getPciTemplate, tasks]);
32916
33250
  const addFetchedAcceptedByName = async (acceptanceInfo) => {
32917
33251
  try {
@@ -32921,7 +33255,7 @@ function DropinComposerComponent({
32921
33255
  acceptedByName: getLegalEntityNameBasedOnType(acceptedByEntity)
32922
33256
  };
32923
33257
  } catch (e) {
32924
- logger$8.warn(i18n.get("failedToFetchAcceptedByName"));
33258
+ logger$9.warn(i18n.get("failedToFetchAcceptedByName"));
32925
33259
  return {
32926
33260
  ...acceptanceInfo,
32927
33261
  acceptedByName: null
@@ -32935,7 +33269,7 @@ function DropinComposerComponent({
32935
33269
  const serviceAgreementAcceptanceInfosWithNames2 = await Promise.all(response.data.map(addFetchedAcceptedByName));
32936
33270
  setServiceAgreementAcceptanceInfosWithNames(serviceAgreementAcceptanceInfosWithNames2);
32937
33271
  } catch (e) {
32938
- logger$8.warn(i18n.get("failedToGetServiceAgreementStatus"));
33272
+ logger$9.warn(i18n.get("failedToGetServiceAgreementStatus"));
32939
33273
  }
32940
33274
  }
32941
33275
  };
@@ -32945,7 +33279,7 @@ function DropinComposerComponent({
32945
33279
  const response = await args.handleGetServiceAgreementStatus(rootLegalEntity.id);
32946
33280
  setServiceAgreementTypes(response.termsOfServiceTypes);
32947
33281
  } catch (e) {
32948
- logger$8.warn(i18n.get("failedToGetServiceAgreementStatus"));
33282
+ logger$9.warn(i18n.get("failedToGetServiceAgreementStatus"));
32949
33283
  }
32950
33284
  }
32951
33285
  };
@@ -32984,7 +33318,7 @@ function DropinComposerComponent({
32984
33318
  setCapabilityProblems(getCapabilityProblems(response, rootLegalEntityCountry, isExperimentEnabled));
32985
33319
  return response;
32986
33320
  } catch (e) {
32987
- logger$8.warn(i18n.get("failedToFetchLegalEntityDetails"));
33321
+ logger$9.warn(i18n.get("failedToFetchLegalEntityDetails"));
32988
33322
  }
32989
33323
  }
32990
33324
  return void 0;
@@ -33034,7 +33368,7 @@ function DropinComposerComponent({
33034
33368
  label: i18n.get("successFullyRemovedTrustMember")
33035
33369
  });
33036
33370
  } catch (err) {
33037
- logger$8.error(`Failed to delete trust member`, err);
33371
+ logger$9.error(`Failed to delete trust member`, err);
33038
33372
  showToast({
33039
33373
  type: ToastType.ERROR,
33040
33374
  label: i18n.get("failedToRemoveTrustMember")
@@ -33104,7 +33438,7 @@ function DropinComposerComponent({
33104
33438
  }
33105
33439
  break;
33106
33440
  default:
33107
- logger$8.warn(`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`);
33441
+ logger$9.warn(`Updating trust member type "${trustMember.trustMemberType}" is not implemented.`);
33108
33442
  }
33109
33443
  showToast({
33110
33444
  label: i18n.get("successfullyUpdatedDetails"),
@@ -33112,7 +33446,7 @@ function DropinComposerComponent({
33112
33446
  });
33113
33447
  await refreshLegalArrangementAndRunOnSubmit(associatedLegalArrangement, 1);
33114
33448
  } catch (err) {
33115
- logger$8.error(err);
33449
+ logger$9.error(err);
33116
33450
  showToast({
33117
33451
  label: i18n.get("failedToUpdateDetails"),
33118
33452
  type: ToastType.ERROR
@@ -33133,7 +33467,7 @@ function DropinComposerComponent({
33133
33467
  navigateTo(TaskTypes.TASKS_OVERVIEW);
33134
33468
  }
33135
33469
  } catch (e) {
33136
- logger$8.error(e);
33470
+ logger$9.error(e);
33137
33471
  showToast({
33138
33472
  label: i18n.get("failToLaunchSingpass"),
33139
33473
  type: ToastType.ERROR
@@ -33340,7 +33674,7 @@ function DropinComposerComponent({
33340
33674
  }
33341
33675
  };
33342
33676
  setIsLoadingConfiguration(true);
33343
- fetchConfiguration().catch(logger$8.error).finally(() => {
33677
+ fetchConfiguration().catch(logger$9.error).finally(() => {
33344
33678
  setIsLoadingConfiguration(false);
33345
33679
  onLoad();
33346
33680
  });
@@ -33358,12 +33692,16 @@ function DropinComposerComponent({
33358
33692
  return;
33359
33693
  }
33360
33694
  const timeoutId = setTimeout(() => {
33361
- refreshLegalEntity().catch(logger$8.error);
33695
+ refreshLegalEntity().catch(logger$9.error);
33362
33696
  }, POLLING_INTERVAL);
33363
33697
  return () => {
33364
33698
  clearInterval(timeoutId);
33365
33699
  };
33366
33700
  }, [refreshLegalEntity, rootLegalEntity]);
33701
+ useEffect(() => {
33702
+ const newAccountHolder = getDefaultAccountHolderType(rootLegalEntity, false, accountHolder2);
33703
+ if (newAccountHolder !== accountHolder2) setAccountHolder(newAccountHolder);
33704
+ }, [accountHolder2, rootLegalEntity]);
33367
33705
  if (isLoadingConfiguration) {
33368
33706
  return jsx(Shimmer, {});
33369
33707
  }
@@ -33377,6 +33715,7 @@ function DropinComposerComponent({
33377
33715
  accountHolder: accountHolder2,
33378
33716
  onComplete: async (newAccountHolder) => {
33379
33717
  setAccountHolder(newAccountHolder);
33718
+ setCanSeeEntitySelection(false);
33380
33719
  await refreshLegalEntity();
33381
33720
  navigateTo("default");
33382
33721
  },
@@ -33570,8 +33909,7 @@ function DropinComposerComponent({
33570
33909
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
33571
33910
  handleFindAddress: args == null ? void 0 : args.handleFindAddress,
33572
33911
  onTypeSwitch: navigateToTypeSwitcher,
33573
- isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION,
33574
- accountHolder: accountHolder2
33912
+ isTargetLegalEntityType: legalEntityType === LegalEntityType.ORGANIZATION
33575
33913
  });
33576
33914
  case TaskTypes.COMPANY_SEARCH:
33577
33915
  return jsx(CompanySearchDropinComponent, {
@@ -33664,8 +34002,7 @@ function DropinComposerComponent({
33664
34002
  homeButtonLabel: i18n.get("saveAndGoToOverview"),
33665
34003
  associationDetail: trustMember,
33666
34004
  handleAddressSearch: args == null ? void 0 : args.handleAddressSearch,
33667
- handleFindAddress: args == null ? void 0 : args.handleFindAddress,
33668
- accountHolder: accountHolder2
34005
+ handleFindAddress: args == null ? void 0 : args.handleFindAddress
33669
34006
  });
33670
34007
  case TaskTypes.PAYOUT:
33671
34008
  case TaskTypes.PAYIN:
@@ -33826,7 +34163,7 @@ const createLegalEntity = async (context, legalEntity) => {
33826
34163
  return httpPost({
33827
34164
  loadingContext,
33828
34165
  errorLevel: "warn",
33829
- errorMessage: `LegalEntity creation available`,
34166
+ errorMessage: "LegalEntity create failed",
33830
34167
  path: `${legalEntityId}`,
33831
34168
  authentication: "jwt",
33832
34169
  headers: {
@@ -34189,10 +34526,7 @@ const useComponentApi = (rootLegalEntityId) => {
34189
34526
  ...baseRequestContext,
34190
34527
  legalEntityId
34191
34528
  }, legalEntity),
34192
- createLegalEntity: async (legalEntity) => createLegalEntity({
34193
- ...baseRequestContext,
34194
- legalEntityId: rootLegalEntityId
34195
- }, legalEntity),
34529
+ createLegalEntity: async (legalEntity) => createLegalEntity(baseRequestContext, legalEntity),
34196
34530
  getTransferInstrument: async (transferInstrumentId) => getTransferInstrument(baseRequestContext, transferInstrumentId),
34197
34531
  getBankVerificationVendor: async (country2, openBankingPartnerConfigId) => getBankVerificationVendor(baseRequestContext, country2, openBankingPartnerConfigId),
34198
34532
  getDocument: async (documentId) => getDocument(baseRequestContext, documentId),
@@ -34211,7 +34545,7 @@ const useComponentApi = (rootLegalEntityId) => {
34211
34545
  };
34212
34546
  }, [base, rootLegalEntityId]);
34213
34547
  };
34214
- const logger$7 = createLogger("CreateIndividualComponent");
34548
+ const logger$8 = createLogger("CreateIndividualComponent");
34215
34549
  function CreateIndividualComponent({
34216
34550
  parentLegalEntityId,
34217
34551
  legalEntityId,
@@ -34247,13 +34581,13 @@ function CreateIndividualComponent({
34247
34581
  setParentLegalEntity(parentEntity);
34248
34582
  setLegalEntity(entity);
34249
34583
  } catch (error) {
34250
- logger$7.error(error);
34584
+ logger$8.error(error);
34251
34585
  } finally {
34252
34586
  setLoadingStatus("success");
34253
34587
  }
34254
34588
  }, [parentLegalEntityId, legalEntityId, getLegalEntity2]);
34255
34589
  useEffect(() => {
34256
- fetchLegalEntity().catch(logger$7.error);
34590
+ fetchLegalEntity().catch(logger$8.error);
34257
34591
  }, [fetchLegalEntity]);
34258
34592
  const country2 = ((_a = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _a.residentialAddress.country) ?? contextCountry;
34259
34593
  return loadingStatus === "loading" ? jsx(Loader, {
@@ -34277,7 +34611,7 @@ function CreateIndividualComponent({
34277
34611
  taskType
34278
34612
  });
34279
34613
  }
34280
- const logger$6 = createLogger("CreateTransferInstrumentComponent");
34614
+ const logger$7 = createLogger("CreateTransferInstrumentComponent");
34281
34615
  function CreateTransferInstrumentComponent({
34282
34616
  legalEntityId,
34283
34617
  transferInstrumentId,
@@ -34317,7 +34651,7 @@ function CreateTransferInstrumentComponent({
34317
34651
  const ti = await getTransferInstrument2(transferInstrumentId);
34318
34652
  setTransferInstrument(ti);
34319
34653
  }
34320
- })().catch(logger$6.error);
34654
+ })().catch(logger$7.error);
34321
34655
  }, [transferInstrumentId, fetchLegalEntity]);
34322
34656
  return legalEntity ? jsx(PayoutDetailsDropinComponent, {
34323
34657
  transferInstrument,
@@ -34338,6 +34672,446 @@ function CreateTransferInstrumentComponent({
34338
34672
  taskType: TaskTypes.PAYOUT
34339
34673
  }) : null;
34340
34674
  }
34675
+ const highExposureCompanyDetailsValidations = {
34676
+ country: {
34677
+ modes: ["blur"],
34678
+ validate: (country2) => !isEmpty(country2),
34679
+ errorMessage: "fieldIsRequired"
34680
+ },
34681
+ numberOfEmployees: {
34682
+ modes: ["blur"],
34683
+ validate: (numberOfEmployees2) => !isEmpty(numberOfEmployees2),
34684
+ errorMessage: "fieldIsRequired"
34685
+ }
34686
+ };
34687
+ const highExposureCompanyDetailsFields = ["numberOfEmployees"];
34688
+ function AdditionalFieldsForHighExposureCompany({
34689
+ requiredFields,
34690
+ ...props
34691
+ }) {
34692
+ const {
34693
+ i18n
34694
+ } = useI18nContext();
34695
+ const {
34696
+ handleChangeFor,
34697
+ data,
34698
+ valid,
34699
+ errors,
34700
+ fieldProblems
34701
+ } = useForm({
34702
+ ...props,
34703
+ schema: ["numberOfEmployees"],
34704
+ defaultData: {
34705
+ ...props.data
34706
+ },
34707
+ rules: props.validators || highExposureCompanyDetailsValidations,
34708
+ fieldProblems: props == null ? void 0 : props.fieldValidationErrors
34709
+ });
34710
+ const formUtils = formUtilities(props, i18n);
34711
+ const {
34712
+ updateStateSlice
34713
+ } = useGlobalDataSlice("company");
34714
+ useEffect(() => {
34715
+ updateStateSlice({
34716
+ data,
34717
+ valid,
34718
+ errors,
34719
+ fieldProblems
34720
+ });
34721
+ }, [data, valid, errors, fieldProblems]);
34722
+ return jsxs("form", {
34723
+ className: "adyen-kyc__registration-details",
34724
+ children: [jsx(FormHeader, {
34725
+ heading: props.heading
34726
+ }), jsx(ErrorPanel, {
34727
+ verificationErrors: props.formVerificationErrors,
34728
+ validationErrors: props == null ? void 0 : props.fieldValidationErrors,
34729
+ formUtils,
34730
+ id: "ariaErrorField"
34731
+ }), formUtils.isRequiredField("numberOfEmployees") && jsx(Field, {
34732
+ name: "numberOfEmployees",
34733
+ label: formUtils.getLabel("numberOfEmployees", "numberOfEmployees"),
34734
+ classNameModifiers: ["legalName"],
34735
+ errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors, fieldProblems),
34736
+ isValid: valid.numberOfEmployees,
34737
+ children: (childProps) => jsx(InputText, {
34738
+ ...childProps,
34739
+ name: "numberOfEmployees",
34740
+ value: data.numberOfEmployees,
34741
+ readonly: formUtils.isReadOnly("numberOfEmployees"),
34742
+ classNameModifiers: ["legalName"],
34743
+ onInput: handleChangeFor("numberOfEmployees", "input"),
34744
+ onBlur: handleChangeFor("numberOfEmployees", "blur"),
34745
+ "aria-required": true,
34746
+ "aria-label": formUtils.getLabel("numberOfEmployees"),
34747
+ "aria-invalid": !valid.numberOfEmployees
34748
+ })
34749
+ })]
34750
+ });
34751
+ }
34752
+ const highExposureParentCompanyDetailsFields = ["numberOfEmployees"];
34753
+ function AdditionalFieldsForHighExposureParentCompany({
34754
+ requiredFields,
34755
+ ...props
34756
+ }) {
34757
+ const {
34758
+ i18n
34759
+ } = useI18nContext();
34760
+ const {
34761
+ handleChangeFor,
34762
+ data,
34763
+ valid,
34764
+ errors,
34765
+ fieldProblems
34766
+ } = useForm({
34767
+ ...props,
34768
+ schema: ["numberOfEmployees"],
34769
+ defaultData: {
34770
+ ...props.data
34771
+ },
34772
+ rules: props.validators || highExposureCompanyDetailsValidations,
34773
+ fieldProblems: props == null ? void 0 : props.fieldValidationErrors
34774
+ });
34775
+ const formUtils = formUtilities(props, i18n);
34776
+ const {
34777
+ updateStateSlice
34778
+ } = useGlobalDataSlice("parentCompany");
34779
+ useEffect(() => {
34780
+ updateStateSlice({
34781
+ data,
34782
+ valid,
34783
+ errors,
34784
+ fieldProblems
34785
+ });
34786
+ }, [data, valid, errors, fieldProblems]);
34787
+ return jsxs("form", {
34788
+ className: "adyen-kyc__registration-details",
34789
+ children: [jsx(FormHeader, {
34790
+ heading: props.heading
34791
+ }), jsx(ErrorPanel, {
34792
+ verificationErrors: props.formVerificationErrors,
34793
+ validationErrors: props == null ? void 0 : props.fieldValidationErrors,
34794
+ formUtils,
34795
+ id: "ariaErrorField"
34796
+ }), formUtils.isRequiredField("numberOfEmployees") && jsx(Field, {
34797
+ name: "numberOfEmployees",
34798
+ label: formUtils.getLabel("numberOfEmployees", "numberOfEmployees"),
34799
+ classNameModifiers: ["legalName"],
34800
+ errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors, fieldProblems),
34801
+ isValid: valid.numberOfEmployees,
34802
+ children: (childProps) => jsx(InputText, {
34803
+ ...childProps,
34804
+ name: "numberOfEmployees",
34805
+ value: data.numberOfEmployees,
34806
+ readonly: formUtils.isReadOnly("numberOfEmployees"),
34807
+ classNameModifiers: ["legalName"],
34808
+ onInput: handleChangeFor("numberOfEmployees", "input"),
34809
+ onBlur: handleChangeFor("numberOfEmployees", "blur"),
34810
+ "aria-required": true,
34811
+ "aria-label": formUtils.getLabel("numberOfEmployees"),
34812
+ "aria-invalid": !valid.numberOfEmployees
34813
+ })
34814
+ })]
34815
+ });
34816
+ }
34817
+ function AdditionalFieldsForHighExposureUltimateParentCompany({
34818
+ requiredFields,
34819
+ ...props
34820
+ }) {
34821
+ const {
34822
+ i18n
34823
+ } = useI18nContext();
34824
+ const {
34825
+ handleChangeFor,
34826
+ data,
34827
+ valid,
34828
+ errors,
34829
+ fieldProblems
34830
+ } = useForm({
34831
+ ...props,
34832
+ schema: ["numberOfEmployees"],
34833
+ defaultData: {
34834
+ ...props.data
34835
+ },
34836
+ rules: props.validators || highExposureCompanyDetailsValidations,
34837
+ fieldProblems: props == null ? void 0 : props.fieldValidationErrors
34838
+ });
34839
+ const formUtils = formUtilities(props, i18n);
34840
+ const {
34841
+ updateStateSlice
34842
+ } = useGlobalDataSlice("ultimateParentCompany");
34843
+ useEffect(() => {
34844
+ updateStateSlice({
34845
+ data,
34846
+ valid,
34847
+ errors,
34848
+ fieldProblems
34849
+ });
34850
+ }, [data, valid, errors, fieldProblems]);
34851
+ return jsxs("form", {
34852
+ className: "adyen-kyc__registration-details",
34853
+ children: [jsx(FormHeader, {
34854
+ heading: props.heading
34855
+ }), jsx(ErrorPanel, {
34856
+ verificationErrors: props.formVerificationErrors,
34857
+ validationErrors: props == null ? void 0 : props.fieldValidationErrors,
34858
+ formUtils,
34859
+ id: "ariaErrorField"
34860
+ }), formUtils.isRequiredField("numberOfEmployees") && jsx(Field, {
34861
+ name: "numberOfEmployees",
34862
+ label: formUtils.getLabel("numberOfEmployees", "numberOfEmployees"),
34863
+ classNameModifiers: ["legalName"],
34864
+ errorMessage: formUtils.getErrorMessage("numberOfEmployees", errors, fieldProblems),
34865
+ isValid: valid.numberOfEmployees,
34866
+ children: (childProps) => jsx(InputText, {
34867
+ ...childProps,
34868
+ name: "numberOfEmployees",
34869
+ value: data.numberOfEmployees,
34870
+ readonly: formUtils.isReadOnly("numberOfEmployees"),
34871
+ classNameModifiers: ["legalName"],
34872
+ onInput: handleChangeFor("numberOfEmployees", "input"),
34873
+ onBlur: handleChangeFor("numberOfEmployees", "blur"),
34874
+ "aria-required": true,
34875
+ "aria-label": formUtils.getLabel("numberOfEmployees"),
34876
+ "aria-invalid": !valid.numberOfEmployees
34877
+ })
34878
+ })]
34879
+ });
34880
+ }
34881
+ const highExposureForms = {
34882
+ company: {
34883
+ formId: "company",
34884
+ formName: "company",
34885
+ fields: [...highExposureCompanyDetailsFields]
34886
+ },
34887
+ parentCompany: {
34888
+ formId: "parentCompany",
34889
+ formName: "parentCompany",
34890
+ fields: [...highExposureParentCompanyDetailsFields]
34891
+ },
34892
+ ultimateParentCompany: {
34893
+ formId: "ultimateParentCompany",
34894
+ formName: "ultimateParentCompany",
34895
+ fields: [...highExposureCompanyDetailsFields]
34896
+ }
34897
+ };
34898
+ const parentCompanyFormId = highExposureForms.parentCompany.formId;
34899
+ const companyFormId = highExposureForms.company.formId;
34900
+ const ultimateParentCompanyFormId = highExposureForms.ultimateParentCompany.formId;
34901
+ function HighExposureDropinComponent(props) {
34902
+ const {
34903
+ i18n
34904
+ } = useI18nContext();
34905
+ const highExposureCompanyDetailsFormProps = getFormProps(props, companyFormId);
34906
+ const highExposureParentCompanyDetailsFormProps = getFormProps(props, companyFormId);
34907
+ const highExposureUltimateParentCompanyDetailsFormProps = getFormProps(props, companyFormId);
34908
+ const renderActiveForm = (activeForm) => jsxs("div", {
34909
+ className: "adyen-kyc",
34910
+ children: [jsx(ContextGuidance, {
34911
+ page: "High exposure company details page",
34912
+ titleId: "whyDoINeedToFillInThisInformation",
34913
+ contentId: "euFinancialRegulationsRequireUs",
34914
+ title: i18n.get("whyDoINeedToFillInThisInformation"),
34915
+ content: i18n.get("euFinancialRegulationsRequireUs")
34916
+ }), jsxs("div", {
34917
+ className: "adyen-kyc-form-wrapper",
34918
+ children: [activeForm.formId === companyFormId && jsx(AdditionalFieldsForHighExposureCompany, {
34919
+ ...highExposureCompanyDetailsFormProps,
34920
+ heading: i18n.get("detailsForCapital"),
34921
+ id: companyFormId,
34922
+ country: props.country
34923
+ }), activeForm.formId === parentCompanyFormId && jsx(AdditionalFieldsForHighExposureParentCompany, {
34924
+ ...highExposureParentCompanyDetailsFormProps,
34925
+ heading: i18n.get("parentCompanyDetails"),
34926
+ id: companyFormId,
34927
+ country: props.country
34928
+ }), activeForm.formId === ultimateParentCompanyFormId && jsx(AdditionalFieldsForHighExposureUltimateParentCompany, {
34929
+ ...highExposureUltimateParentCompanyDetailsFormProps,
34930
+ heading: i18n.get("ultimateParentCompanyDetails"),
34931
+ id: companyFormId,
34932
+ country: props.country
34933
+ })]
34934
+ })]
34935
+ });
34936
+ return jsx("div", {
34937
+ className: "adyen-kyc",
34938
+ children: renderActiveForm(props.activeForm || highExposureForms.company)
34939
+ });
34940
+ }
34941
+ const parseConfiguration = ({
34942
+ matchingScenario
34943
+ }) => parseHighExposureScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION]);
34944
+ const logger$6 = createLogger("UpdateLegalEntityForHighExposure");
34945
+ function UpdateLegalEntityForHighExposure({
34946
+ parentLegalEntity,
34947
+ capabilities,
34948
+ country: country2,
34949
+ trackingConfig,
34950
+ problems: problemsProp,
34951
+ onSubmit: externalOnSubmit,
34952
+ onChange,
34953
+ hideDropinLayout,
34954
+ handleHomeClick,
34955
+ homeButtonLabel,
34956
+ legalEntityId
34957
+ }) {
34958
+ var _a;
34959
+ const {
34960
+ getLegalEntity: getLegalEntity2
34961
+ } = useComponentApi(legalEntityId);
34962
+ const {
34963
+ i18n
34964
+ } = useI18nContext();
34965
+ const [legalEntity, setLegalEntity] = useState();
34966
+ const fetchLegalEntity = useCallback(async () => {
34967
+ const legalEntityResponse = await getLegalEntity2(legalEntityId);
34968
+ setLegalEntity(legalEntityResponse);
34969
+ if (legalEntityResponse) {
34970
+ setData(mapLegalEntityToHighExposure(legalEntityResponse));
34971
+ }
34972
+ return legalEntityResponse;
34973
+ }, [getLegalEntity2, legalEntityId]);
34974
+ useEffect(() => {
34975
+ (async () => {
34976
+ await fetchLegalEntity();
34977
+ })().catch(logger$6.error);
34978
+ }, [fetchLegalEntity]);
34979
+ const dataFromResponse = legalEntity ? mapLegalEntityToHighExposure(legalEntity) : {};
34980
+ const [data, setData] = useState(dataFromResponse);
34981
+ const [problems, setProblems] = useState(problemsProp ?? {});
34982
+ const {
34983
+ getConfiguration: getConfiguration2
34984
+ } = useConfigurationApi();
34985
+ const {
34986
+ showToast
34987
+ } = useToastContext();
34988
+ const [loadingStatus, setLoadingStatus] = useState("success");
34989
+ const formRef = useRef(null);
34990
+ const getConfigurationData = useCallback(() => getConfiguration2({
34991
+ legalEntityType: LegalEntityType.ORGANIZATION,
34992
+ capabilities,
34993
+ country: country2
34994
+ }), [country2, capabilities]);
34995
+ const {
34996
+ fieldConfigurations
34997
+ } = useScenarioConfiguration({
34998
+ parseConfiguration,
34999
+ getConfigurationData,
35000
+ setLoadingStatus,
35001
+ country: country2
35002
+ });
35003
+ const derivedProps = useMemo(() => getPropsFromConfigurations(fieldConfigurations, highExposureForms, (problems == null ? void 0 : problems.remediationActions) ? Object.values(problems == null ? void 0 : problems.remediationActions) : [], (problems == null ? void 0 : problems.missingData) ?? [], legalEntity ? getFieldsWithExistingData(legalEntity) : []), [fieldConfigurations, problems == null ? void 0 : problems.remediationActions]);
35004
+ const {
35005
+ state: {
35006
+ currentState
35007
+ }
35008
+ } = useStateContext();
35009
+ const formValidity = currentState.validityByForm;
35010
+ useEffect(() => {
35011
+ setData({
35012
+ ...currentState.data
35013
+ });
35014
+ onChange == null ? void 0 : onChange(currentState);
35015
+ }, [currentState]);
35016
+ const forms2 = useMemo(() => {
35017
+ const requiredForms = getRequiredForms(highExposureForms, derivedProps == null ? void 0 : derivedProps.requiredFields, derivedProps == null ? void 0 : derivedProps.optionalFields);
35018
+ return addValidityToForms(requiredForms, formValidity, problems);
35019
+ }, [derivedProps, formValidity, problems]);
35020
+ const onSubmit = async () => {
35021
+ setLoadingStatus("loading");
35022
+ const exposureDetails = mapHighExposureToLegalEntity(data);
35023
+ try {
35024
+ console.log({
35025
+ exposureDetails
35026
+ });
35027
+ setLoadingStatus("success");
35028
+ showToast({
35029
+ label: i18n.get("successfullyUpdatedDetails"),
35030
+ type: ToastType.SUCCESS
35031
+ });
35032
+ externalOnSubmit == null ? void 0 : externalOnSubmit(data);
35033
+ } catch (e) {
35034
+ showToast({
35035
+ label: i18n.get("failedToUpdateDetails"),
35036
+ type: ToastType.ERROR
35037
+ });
35038
+ if (isValidationError(e)) {
35039
+ const validationErrors = processValidationErrors(e, void 0, highExposureApiKeyMapping);
35040
+ setProblems({
35041
+ ...problems,
35042
+ validationErrors
35043
+ });
35044
+ } else if (isMaintenanceModeError(e)) {
35045
+ showToast({
35046
+ label: i18n.get("failedToUpdateDetails"),
35047
+ subLabel: i18n.get("maintenanceModeMessage"),
35048
+ type: ToastType.ERROR,
35049
+ duration: "indefinite"
35050
+ });
35051
+ }
35052
+ setLoadingStatus("success");
35053
+ }
35054
+ };
35055
+ const formatDataForSummary2 = (data2) => {
35056
+ const summaryData = cloneObject(data2) || {};
35057
+ return summaryData;
35058
+ };
35059
+ const canSubmit2 = (data2) => mandatoryApiFields.HIGH_EXPOSURE.every((detail) => {
35060
+ const value = getProp(data2, detail);
35061
+ return !isEmpty(value);
35062
+ });
35063
+ const baseTrackingPayload = getBaseTrackingPayload({
35064
+ trackingConfig,
35065
+ parentLegalEntity,
35066
+ legalEntity
35067
+ });
35068
+ const {
35069
+ handleNextClick,
35070
+ handleBackClick,
35071
+ activeForm,
35072
+ shouldValidate,
35073
+ setShouldValidate,
35074
+ gotoFormByFormIndex,
35075
+ nextButtonLabel
35076
+ } = useFormComposer({
35077
+ problems,
35078
+ baseTrackingPayload,
35079
+ forms: forms2,
35080
+ formRef,
35081
+ onSubmit
35082
+ });
35083
+ return jsx(FormWrapper, {
35084
+ taskName: "detailsForCapital",
35085
+ handleNextClick,
35086
+ handleBackClick,
35087
+ gotoFormByFormIndex,
35088
+ nextButtonLabel,
35089
+ loadingStatus,
35090
+ forms: forms2,
35091
+ activeForm,
35092
+ baseTrackingPayload,
35093
+ onSubmit,
35094
+ hideDropinLayout,
35095
+ handleHomeClick,
35096
+ homeButtonLabel,
35097
+ validateForm: () => setShouldValidate(true),
35098
+ canSubmit: canSubmit2(data) && hasDataChanged(dataFromResponse, data),
35099
+ problems,
35100
+ summary: {
35101
+ data: formatDataForSummary2(data)
35102
+ },
35103
+ children: jsx(HighExposureDropinComponent, {
35104
+ ...derivedProps,
35105
+ activeForm,
35106
+ capabilities,
35107
+ data: dataFromResponse,
35108
+ country: ((_a = data == null ? void 0 : data.company) == null ? void 0 : _a.country) ?? country2,
35109
+ problems,
35110
+ shouldValidate,
35111
+ ref: formRef
35112
+ })
35113
+ });
35114
+ }
34341
35115
  var OnboardingUrlTarget = /* @__PURE__ */ ((OnboardingUrlTarget2) => {
34342
35116
  OnboardingUrlTarget2["BLANK"] = "_blank";
34343
35117
  OnboardingUrlTarget2["SELF"] = "_self";
@@ -34541,7 +35315,8 @@ const componentsMap = {
34541
35315
  pci: PciDropinComponent,
34542
35316
  createTransferInstrumentComponent: CreateTransferInstrumentComponent,
34543
35317
  createIndividualComponent: CreateIndividualComponent,
34544
- viewVerificationStatusComponent: ViewVerificationStatusComponent
35318
+ viewVerificationStatusComponent: ViewVerificationStatusComponent,
35319
+ updateLegalEntityForHighExposureComponent: UpdateLegalEntityForHighExposure
34545
35320
  };
34546
35321
  const AuthProvider = ({
34547
35322
  children,
@@ -34593,14 +35368,13 @@ const pushEvents = async (loadingContext, sessionId, event) => httpPost({
34593
35368
  }, event);
34594
35369
  const convertToEmbeddedEvent = (eventQueueItem) => {
34595
35370
  const [eventType, event] = eventQueueItem;
34596
- const hasEventData = typeof event === "object";
34597
- const eventName = hasEventData ? event.key : event;
35371
+ const isObject = typeof event === "object";
35372
+ const eventName = isObject ? event.key : event;
35373
+ const eventData = isObject ? event.segmentation : {};
34598
35374
  return {
34599
35375
  eventType,
34600
35376
  eventName,
34601
- ...hasEventData && {
34602
- eventData: event.segmentation
34603
- }
35377
+ eventData: eventData ?? {}
34604
35378
  };
34605
35379
  };
34606
35380
  const useAnalytics = async ({
@@ -34609,6 +35383,9 @@ const useAnalytics = async ({
34609
35383
  sdkVersion,
34610
35384
  componentName
34611
35385
  }) => {
35386
+ const {
35387
+ i18n
35388
+ } = useI18nContext();
34612
35389
  const {
34613
35390
  isEmbeddedDropin,
34614
35391
  loadingContext: base
@@ -34627,6 +35404,9 @@ const useAnalytics = async ({
34627
35404
  }
34628
35405
  userEvents.subscribe((data) => {
34629
35406
  const eventItem = convertToEmbeddedEvent(data);
35407
+ if (eventItem.eventData) {
35408
+ eventItem.eventData.locale = i18n.locale;
35409
+ }
34630
35410
  pushEvents(loadingContext, sessionResponse.id, eventItem);
34631
35411
  });
34632
35412
  } catch (e) {
@@ -34932,7 +35712,7 @@ const ConfigurationApiProvider = ({
34932
35712
  isEmbeddedDropin,
34933
35713
  loadingContext
34934
35714
  } = authContext;
34935
- const sdkVersion = "2.44.1";
35715
+ const sdkVersion = "2.45.1";
34936
35716
  useAnalytics({
34937
35717
  onUserEvent,
34938
35718
  legalEntityId: rootLegalEntityId,
@@ -36247,6 +37027,15 @@ const viewVerificationStatusComponentSchema = {
36247
37027
  type: "string"
36248
37028
  }
36249
37029
  };
37030
+ const updateLegalEntityForHighExposureComponentSchema = {
37031
+ country: {
37032
+ type: "string"
37033
+ },
37034
+ legalEntityId: {
37035
+ type: "string",
37036
+ required: true
37037
+ }
37038
+ };
36250
37039
  const componentsSchemaMap = {
36251
37040
  payoutAccount: payoutAccountSchema,
36252
37041
  soleProprietorDropin: solePropDropinSchema,
@@ -36259,7 +37048,8 @@ const componentsSchemaMap = {
36259
37048
  taskList: taskListSchema,
36260
37049
  createIndividualComponent: createIndividualComponentSchema,
36261
37050
  createTransferInstrumentComponent: createTransferInstrumentComponentSchema,
36262
- viewVerificationStatusComponent: viewVerificationStatusComponentSchema
37051
+ viewVerificationStatusComponent: viewVerificationStatusComponentSchema,
37052
+ updateLegalEntityForHighExposureComponent: updateLegalEntityForHighExposureComponentSchema
36263
37053
  };
36264
37054
  const validateComponentName = (componentName) => {
36265
37055
  if (!componentName) {