@adyen/kyc-components 3.37.0 → 3.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -355,6 +355,7 @@ const defaultTrans = {
355
355
  doNotHaveYTunnus: "I do not have a Y-TUNNUS",
356
356
  doNotHaveAbn: "I do not have an ABN",
357
357
  doNotHaveAcn: "I do not have an ACN",
358
+ doNotHaveNZBN: "I do not have a NZBN",
358
359
  documentAddressedToName: "The document has to be addressed to %{name}",
359
360
  documentCannotBeDamaged: "The document cannot be damaged",
360
361
  documentIssuedByGovernmentAuthority: "The document has to be issued by a government authority. It's usually given when a business is created at the local commercial register",
@@ -2975,27 +2976,6 @@ function useResetGlobalData(caller) {
2975
2976
  [dispatch, caller]
2976
2977
  );
2977
2978
  }
2978
- const useSetting = (settingName) => {
2979
- const context = useContext(SettingsContext);
2980
- if (context === void 0) {
2981
- throw new Error("useSetting must be used within a SettingsProvider");
2982
- }
2983
- const { getSetting } = context;
2984
- return getSetting(settingName);
2985
- };
2986
- const logger$I = createLogger("useAllowedCountries");
2987
- const useAllowedCountries = () => {
2988
- const acceptedCountries = useSetting("acceptedCountries");
2989
- const { getAllowedCountries: getAllowedCountries2 } = useConfigurationApi();
2990
- const [allowedCountries, setAllowedCountries] = useState(
2991
- acceptedCountries
2992
- );
2993
- useEffect(() => {
2994
- if (acceptedCountries !== void 0) return;
2995
- getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$I.error);
2996
- }, [acceptedCountries]);
2997
- return allowedCountries;
2998
- };
2999
2979
  class ValidationResult {
3000
2980
  constructor(results) {
3001
2981
  this.validationResults = results;
@@ -3013,7 +2993,7 @@ class ValidationResult {
3013
2993
  return this.validationResults.find((result) => result.hasError);
3014
2994
  }
3015
2995
  }
3016
- const logger$H = createLogger("useAsyncValidator");
2996
+ const logger$I = createLogger("useAsyncValidator");
3017
2997
  const useAsyncValidator = (asyncRules) => {
3018
2998
  const [asyncValidationResults, setAsyncValidationResults] = useState({});
3019
2999
  const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
@@ -3033,7 +3013,7 @@ const useAsyncValidator = (asyncRules) => {
3033
3013
  }
3034
3014
  ])
3035
3015
  });
3036
- }).catch(logger$H.error);
3016
+ }).catch(logger$I.error);
3037
3017
  },
3038
3018
  [asyncRules, clearAsyncValidationResults]
3039
3019
  );
@@ -5120,7 +5100,7 @@ const companyNameAndCountryFields = [
5120
5100
  function CompanyNameAndCountry(props) {
5121
5101
  const { i18n } = useI18nContext();
5122
5102
  const { isSettingEnabled } = useSettingsContext();
5123
- const allowedCountries = useAllowedCountries();
5103
+ const { allowedCountries } = useCoreContext();
5124
5104
  const { isExperimentEnabled } = useExperimentsContext();
5125
5105
  const isStrictNameAndAddressValidationEnabled = isExperimentEnabled(
5126
5106
  ExperimentNames.StrictNameAndAddressValidationV4
@@ -7364,7 +7344,7 @@ const deriveInputState = (isValid, isFocused, isDisabled, isOptional, hasNullish
7364
7344
  };
7365
7345
  };
7366
7346
  const MISMATCH_ANIMATION_NAME = "mismatchShake";
7367
- const logger$G = createLogger("MaskedInputText");
7347
+ const logger$H = createLogger("MaskedInputText");
7368
7348
  const MaskedInputText = ({
7369
7349
  value,
7370
7350
  onInput,
@@ -7409,7 +7389,7 @@ const MaskedInputText = ({
7409
7389
  };
7410
7390
  useEffect(() => {
7411
7391
  if (!mask) {
7412
- logger$G.warn("`mask` is undefined. No masking of input will take place.");
7392
+ logger$H.warn("`mask` is undefined. No masking of input will take place.");
7413
7393
  }
7414
7394
  }, [mask]);
7415
7395
  const getMaskResult = useCallback(
@@ -7453,7 +7433,7 @@ const MaskedInputText = ({
7453
7433
  return;
7454
7434
  }
7455
7435
  if (preserveMismatchingInitialValue) {
7456
- logger$G.warn(
7436
+ logger$H.warn(
7457
7437
  `Value received "${value}" does not match mask`,
7458
7438
  maskResult,
7459
7439
  `
@@ -7463,7 +7443,7 @@ Preserving mismatched initial value until user input.`
7463
7443
  return;
7464
7444
  }
7465
7445
  const fallback = displayValueToPure(maskResult.partialDisplayValue);
7466
- logger$G.warn(
7446
+ logger$H.warn(
7467
7447
  `Value received "${value}" does not match mask`,
7468
7448
  maskResult,
7469
7449
  `
@@ -8244,7 +8224,7 @@ function DBANameField({
8244
8224
  const isNo = selectedValue === "no";
8245
8225
  handleChangeFor("hasDba")(isYes);
8246
8226
  if (isDoingBusinessAsNameV4Enabled) {
8247
- handleChangeFor("doingBusinessAbsent")(isNo);
8227
+ handleChangeFor("doingBusinessAsAbsent")(isNo);
8248
8228
  if (isNo) {
8249
8229
  handleChangeFor("dbaName")(legalCompanyName);
8250
8230
  }
@@ -11232,7 +11212,7 @@ function Dropzone(props) {
11232
11212
  isRequired && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-error-text", children: i18n.get("fieldIsRequired") })
11233
11213
  ] });
11234
11214
  }
11235
- const logger$F = createLogger("TextArea");
11215
+ const logger$G = createLogger("TextArea");
11236
11216
  function TextArea(props) {
11237
11217
  const { classNameModifiers, uniqueId, ...passedProps } = props;
11238
11218
  const {
@@ -11247,7 +11227,7 @@ function TextArea(props) {
11247
11227
  const { i18n } = useI18nContext();
11248
11228
  const [value, setValue] = useState("");
11249
11229
  if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
11250
- logger$F.error("Error: Form fields that rely on InputBase may not have an onChange property");
11230
+ logger$G.error("Error: Form fields that rely on InputBase may not have an onChange property");
11251
11231
  }
11252
11232
  const handleInput = (e) => {
11253
11233
  var _a;
@@ -11666,7 +11646,7 @@ const styles$8 = {
11666
11646
  "financial-information-reported-value-options": "adyen-kyc-financial-information-reported-value-options",
11667
11647
  financialInformationReportedValueOptions
11668
11648
  };
11669
- const logger$E = createLogger("InputCurrency");
11649
+ const logger$F = createLogger("InputCurrency");
11670
11650
  const determineDecimalSeparator = (formatter) => formatter.formatToParts(0.1).find((part) => part.type === "decimal").value;
11671
11651
  const determineCurrencySymbol = (formatter) => formatter.formatToParts(0).find((part) => part.type === "currency").value;
11672
11652
  const getNumberFromFormattedCurrency = (formatted, decimalSeparator) => {
@@ -11697,7 +11677,7 @@ const InputCurrency = ({
11697
11677
  const rawValue = e.target.value;
11698
11678
  const value = getNumberFromFormattedCurrency(rawValue, decimalSeparator);
11699
11679
  if (Number.isNaN(value)) {
11700
- logger$E.warn(`Unable to get number from formatted currency: "${rawValue}"`);
11680
+ logger$F.warn(`Unable to get number from formatted currency: "${rawValue}"`);
11701
11681
  setText(isUndefinedOrNull(amount) ? currencySymbol : formatter.format(amount));
11702
11682
  return;
11703
11683
  }
@@ -12163,7 +12143,7 @@ function FieldContainer(props) {
12163
12143
  }
12164
12144
  return renderField(fieldName);
12165
12145
  }
12166
- const logger$D = createLogger("SearchAddress");
12146
+ const logger$E = createLogger("SearchAddress");
12167
12147
  const SearchAddress = ({
12168
12148
  data,
12169
12149
  legalEntityId,
@@ -12196,7 +12176,7 @@ const SearchAddress = ({
12196
12176
  const response = await handleFindAddress(selectedAddressId);
12197
12177
  autocompleteAddressForm(response);
12198
12178
  } catch (e) {
12199
- logger$D.error(e);
12179
+ logger$E.error(e);
12200
12180
  }
12201
12181
  };
12202
12182
  const onDrilldown = async (selectedAddress) => {
@@ -12207,7 +12187,7 @@ const SearchAddress = ({
12207
12187
  );
12208
12188
  setItems((response == null ? void 0 : response.results) || []);
12209
12189
  } catch (e) {
12210
- logger$D.error(e);
12190
+ logger$E.error(e);
12211
12191
  }
12212
12192
  };
12213
12193
  const onChange = (e) => {
@@ -12259,7 +12239,7 @@ const SearchAddress = ({
12259
12239
  setItems([]);
12260
12240
  }
12261
12241
  } catch (e) {
12262
- logger$D.error(e);
12242
+ logger$E.error(e);
12263
12243
  }
12264
12244
  setLoading(false);
12265
12245
  }
@@ -12902,7 +12882,7 @@ Address.defaultProps = {
12902
12882
  requiredFields: ADDRESS_SCHEMA,
12903
12883
  countryCode: null
12904
12884
  };
12905
- const logger$C = createLogger("AddressFieldContainer");
12885
+ const logger$D = createLogger("AddressFieldContainer");
12906
12886
  const formatAddressItem = (item) => {
12907
12887
  if (item.description.includes("Addresses")) {
12908
12888
  const splittedDescription = item.description.split(" - ");
@@ -13040,7 +13020,7 @@ function FieldContainerComponent({
13040
13020
  setItems([]);
13041
13021
  }
13042
13022
  } catch (e) {
13043
- logger$C.error(e);
13023
+ logger$D.error(e);
13044
13024
  }
13045
13025
  setLoading(false);
13046
13026
  };
@@ -13074,7 +13054,7 @@ function FieldContainerComponent({
13074
13054
  });
13075
13055
  }
13076
13056
  } catch (e) {
13077
- logger$C.error(e);
13057
+ logger$D.error(e);
13078
13058
  }
13079
13059
  };
13080
13060
  const onDrilldown = async (address) => {
@@ -13086,7 +13066,7 @@ function FieldContainerComponent({
13086
13066
  ));
13087
13067
  setItems((response == null ? void 0 : response.results) || []);
13088
13068
  } catch (e) {
13089
- logger$C.error(e);
13069
+ logger$D.error(e);
13090
13070
  }
13091
13071
  };
13092
13072
  const handleOnChange = (e) => {
@@ -14231,6 +14211,7 @@ const COUNTRIES_WITH_POSSIBLE_REGISTRATION_EXEMPTIONS_FOR_SOLE_PROPS = [
14231
14211
  CountryCodes.Germany,
14232
14212
  CountryCodes.Lithuania,
14233
14213
  CountryCodes.Luxembourg,
14214
+ CountryCodes.NewZealand,
14234
14215
  CountryCodes.Poland,
14235
14216
  CountryCodes.Sweden,
14236
14217
  CountryCodes.Switzerland
@@ -14256,7 +14237,6 @@ const COUNTRIES_THAT_USE_TAX_ID_INSTEAD_OF_VAT = [
14256
14237
  CountryCodes.IsleOfMan
14257
14238
  ];
14258
14239
  const COUNTRIES_THAT_DO_NOT_USE_TAX_ID_FOR_SOLE_PROP = [
14259
- CountryCodes.NewZealand,
14260
14240
  CountryCodes.Singapore
14261
14241
  ];
14262
14242
  const COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES = [
@@ -14452,7 +14432,7 @@ const rules$3 = ({
14452
14432
  }
14453
14433
  }
14454
14434
  });
14455
- const logger$B = createLogger("mapPayoutAccountSchemaToApiBankAccount");
14435
+ const logger$C = createLogger("mapPayoutAccountSchemaToApiBankAccount");
14456
14436
  const getAccountIdentificationFromPayoutAccountSchema = (payoutAccount, bankCountry) => {
14457
14437
  var _a;
14458
14438
  if ("iban" in payoutAccount && payoutAccount.iban)
@@ -14532,7 +14512,7 @@ const getAccountIdentificationFromPayoutAccountSchema = (payoutAccount, bankCoun
14532
14512
  routingNumber: payoutAccount.branchCode
14533
14513
  };
14534
14514
  default:
14535
- logger$B.log(`${bankCountry.toLowerCase()}Local is not a configured region`);
14515
+ logger$C.log(`${bankCountry.toLowerCase()}Local is not a configured region`);
14536
14516
  return {
14537
14517
  type: `${bankCountry.toLowerCase()}Local`,
14538
14518
  accountNumber: payoutAccount.bankAccountNumber
@@ -14658,7 +14638,7 @@ const businessDetailsBaseMapping = {
14658
14638
  "additionalInformation.legalCompanyName": "organization.legalName",
14659
14639
  "additionalInformation.legalFormDescription": "organization.legalFormDescription",
14660
14640
  "additionalInformation.dbaName": "organization.doingBusinessAs",
14661
- "additionalInformation.doingBusinessAbsent": "organization.doingBusinessAbsent",
14641
+ "additionalInformation.doingBusinessAsAbsent": "organization.doingBusinessAsAbsent",
14662
14642
  "additionalInformation.registrationNumber": "organization.registrationNumber",
14663
14643
  "additionalInformation.taxInformation": "organization.taxInformation",
14664
14644
  "additionalInformation.vatNumber": "organization.vatNumber",
@@ -14687,7 +14667,7 @@ const companyBaseMapping = {
14687
14667
  "companyType.entityType": "organization.type",
14688
14668
  "companyRegistrationDetails.tradingName": "organization.doingBusinessAs",
14689
14669
  "companyRegistrationDetails.dbaName": "organization.doingBusinessAs",
14690
- "companyRegistrationDetails.doingBusinessAbsent": "organization.doingBusinessAbsent",
14670
+ "companyRegistrationDetails.doingBusinessAsAbsent": "organization.doingBusinessAsAbsent",
14691
14671
  "companyRegistrationDetails.registrationNumber": "organization.registrationNumber",
14692
14672
  "companyRegistrationDetails.taxInformation": "organization.taxInformation",
14693
14673
  "companyRegistrationDetails.vatNumber": "organization.vatNumber",
@@ -14713,7 +14693,7 @@ const trustBaseMapping = {
14713
14693
  "trustRegistrationDetails.trustType": "trust.type",
14714
14694
  "trustRegistrationDetails.legalName": "trust.name",
14715
14695
  "trustRegistrationDetails.dbaName": "trust.doingBusinessAs",
14716
- "trustRegistrationDetails.doingBusinessAbsent": "trust.doingBusinessAbsent",
14696
+ "trustRegistrationDetails.doingBusinessAsAbsent": "trust.doingBusinessAsAbsent",
14717
14697
  "trustRegistrationDetails.country": "trust.countryOfGoverningLaw",
14718
14698
  "trustRegistrationDetails.registrationNumber": "trust.registrationNumber",
14719
14699
  "trustRegistrationAddress.registrationAddress.city": "trust.registeredAddress.city",
@@ -14734,7 +14714,7 @@ const solePropBaseMapping = {
14734
14714
  "solePropNameAndCountry.legalCompanyName": "soleProprietorship.name",
14735
14715
  "solePropRegistrationDetails.tradingName": "soleProprietorship.doingBusinessAs",
14736
14716
  "solePropRegistrationDetails.dbaName": "soleProprietorship.doingBusinessAs",
14737
- "solePropRegistrationDetails.doingBusinessAbsent": "soleProprietorship.doingBusinessAbsent",
14717
+ "solePropRegistrationDetails.doingBusinessAsAbsent": "soleProprietorship.doingBusinessAsAbsent",
14738
14718
  "solePropRegistrationDetails.vatNumber": "soleProprietorship.vatNumber",
14739
14719
  "solePropRegistrationDetails.vatAbsenceReason": "soleProprietorship.vatAbsenceReason",
14740
14720
  "solePropRegistrationDetails.exemptedFromTax": "soleProprietorship.taxAbsent",
@@ -15745,7 +15725,7 @@ const initOnfido = async ({
15745
15725
  language: getOnfidoLocaleConfig(i18n)
15746
15726
  });
15747
15727
  };
15748
- const logger$A = createLogger("IdVerificationComponent");
15728
+ const logger$B = createLogger("IdVerificationComponent");
15749
15729
  function IdVerificationComponent({
15750
15730
  userDetails,
15751
15731
  legalEntityId,
@@ -15774,7 +15754,7 @@ function IdVerificationComponent({
15774
15754
  onIdVerificationError,
15775
15755
  onIdVerificationComplete
15776
15756
  });
15777
- })().catch(logger$A.error);
15757
+ })().catch(logger$B.error);
15778
15758
  return () => {
15779
15759
  if (onfidoSdk.current) onfidoSdk.current.tearDown();
15780
15760
  };
@@ -15818,7 +15798,7 @@ function IdDocumentAlreadyUpload(props) {
15818
15798
  ] })
15819
15799
  ] });
15820
15800
  }
15821
- const logger$z = createLogger("IdDocumentInstantVerificationComponent");
15801
+ const logger$A = createLogger("IdDocumentInstantVerificationComponent");
15822
15802
  const idVerificationSchema = [
15823
15803
  "instantIdVerificationData",
15824
15804
  "idDocumentType"
@@ -15890,7 +15870,7 @@ function IdDocumentInstantVerificationComponent(props) {
15890
15870
  userDetails: props.userDetails,
15891
15871
  legalEntityId: props.legalEntityId,
15892
15872
  onIdVerificationComplete: handleIdVerificationComplete,
15893
- onIdVerificationError: logger$z.error
15873
+ onIdVerificationError: logger$A.error
15894
15874
  }
15895
15875
  ),
15896
15876
  /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-document-upload__manual-upload", children: [
@@ -16310,7 +16290,7 @@ const phoneFormatters = {
16310
16290
  };
16311
16291
  const phoneFields = ["phoneNumber"];
16312
16292
  const DEFAULT_PHONE_PREFIX = "+1";
16313
- const logger$y = createLogger("PhoneInput");
16293
+ const logger$z = createLogger("PhoneInput");
16314
16294
  const usePhonePrefixes = () => {
16315
16295
  const [phonePrefixes, setPhonePrefixes] = useState();
16316
16296
  useEffect(() => {
@@ -16318,7 +16298,7 @@ const usePhonePrefixes = () => {
16318
16298
  const loaded = (await import("./phonePrefixes-zV4hciyK.js")).default;
16319
16299
  setPhonePrefixes(loaded);
16320
16300
  };
16321
- loadPhonePrefixes().catch(logger$y.error);
16301
+ loadPhonePrefixes().catch(logger$z.error);
16322
16302
  }, []);
16323
16303
  return phonePrefixes;
16324
16304
  };
@@ -18357,10 +18337,11 @@ function PersonalDetailsComponent(props) {
18357
18337
  var _a, _b, _c, _d;
18358
18338
  const { i18n } = useI18nContext();
18359
18339
  const { isSettingEnabled } = useSettingsContext();
18360
- const allowedCountries = useAllowedCountries();
18340
+ const { allowedCountries } = useCoreContext();
18361
18341
  const canChangeEntityType = isSettingEnabled(SettingNames.AllowLegalEntityTypeChange);
18362
18342
  const { isExperimentEnabled } = useExperimentsContext();
18363
18343
  const isAgeVerificationEnabled = isExperimentEnabled("EnableAgeVerification");
18344
+ const isLegalAgeEnforced = isSettingEnabled(SettingNames.EnforceLegalAge);
18364
18345
  const {
18365
18346
  id: PERSONAL_DETAILS,
18366
18347
  trustedRoles,
@@ -18476,7 +18457,7 @@ function PersonalDetailsComponent(props) {
18476
18457
  data,
18477
18458
  taskType: props.taskType
18478
18459
  });
18479
- if (translatableWarningMessage) {
18460
+ if (!isLegalAgeEnforced && translatableWarningMessage) {
18480
18461
  return {
18481
18462
  title: i18n.get(translatableWarningMessage.title),
18482
18463
  variant: "warning",
@@ -19819,7 +19800,7 @@ class AdyenKycSdkError extends Error {
19819
19800
  }
19820
19801
  let sdkToken;
19821
19802
  let fetchSdkToken;
19822
- const logger$x = createLogger("Session");
19803
+ const logger$y = createLogger("Session");
19823
19804
  const setSdkToken = (token) => {
19824
19805
  sdkToken = token;
19825
19806
  };
@@ -19844,7 +19825,7 @@ const refreshSession = async () => {
19844
19825
  setSdkToken(token);
19845
19826
  isSessionRefreshed = true;
19846
19827
  } catch (e) {
19847
- logger$x.error("Failed to fetch sdk token", e);
19828
+ logger$y.error("Failed to fetch sdk token", e);
19848
19829
  }
19849
19830
  return isSessionRefreshed;
19850
19831
  };
@@ -19854,7 +19835,7 @@ const addAnimationStartListener = (element, listener) => {
19854
19835
  const removeAnimationStartListener = (element, listener) => {
19855
19836
  element.removeEventListener("animationstart", listener, false);
19856
19837
  };
19857
- const logger$w = createLogger("Fetch");
19838
+ const logger$x = createLogger("Fetch");
19858
19839
  const getRequestObject = (options, data) => {
19859
19840
  const { headers = [], method = "GET", authentication } = options;
19860
19841
  let authHeaders;
@@ -19895,10 +19876,10 @@ const logFetchError = (message, level) => {
19895
19876
  case "info":
19896
19877
  case "warn":
19897
19878
  case "error":
19898
- logger$w[level](message);
19879
+ logger$x[level](message);
19899
19880
  break;
19900
19881
  default:
19901
- logger$w.error(message);
19882
+ logger$x.error(message);
19902
19883
  }
19903
19884
  };
19904
19885
  const handleFetchResponse = async (response, responseType) => {
@@ -19982,7 +19963,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
19982
19963
  const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
19983
19964
  const MOUNT_TIMEOUT = 10 * 1e3;
19984
19965
  const TINK_VENDOR = "Tink";
19985
- const logger$v = createLogger("iframeWidget");
19966
+ const logger$w = createLogger("iframeWidget");
19986
19967
  const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
19987
19968
  const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
19988
19969
  const parseMessageJson = (message) => {
@@ -20000,7 +19981,7 @@ const callbackErrorHandler = async (response) => {
20000
19981
  try {
20001
19982
  await response;
20002
19983
  } catch (ex) {
20003
- logger$v.error(ex);
19984
+ logger$w.error(ex);
20004
19985
  }
20005
19986
  return {
20006
19987
  error: "UNKNOWN_ERROR",
@@ -20096,7 +20077,7 @@ class IFrameWidget {
20096
20077
  message = responseData.errorMessage;
20097
20078
  }
20098
20079
  } catch (ex) {
20099
- logger$v.error(ex);
20080
+ logger$w.error(ex);
20100
20081
  }
20101
20082
  throw new AdyenKycSdkError(reason, jsonData.error);
20102
20083
  }
@@ -21769,48 +21750,7 @@ const Skeleton = ({
21769
21750
  });
21770
21751
  return /* @__PURE__ */ jsx("div", { className: classNames, style: { height, width } });
21771
21752
  };
21772
- const isInstantVerificationAvailable = ({
21773
- verificationVendorsCallback,
21774
- provider
21775
- }) => Boolean(verificationVendorsCallback && (provider == null ? void 0 : provider.redirectUrl));
21776
21753
  const isProviderPlaidEmbedded = (redirectUrl) => !!(redirectUrl == null ? void 0 : redirectUrl.includes("/plaid/embedded-search/sdk?"));
21777
- const rules$2 = ({ data, requiredFields }) => ({
21778
- whenUsingManualVerification: () => {
21779
- var _a;
21780
- if (!data.payoutVerificationMethod) return;
21781
- if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
21782
- return "REQUIRED";
21783
- }
21784
- },
21785
- whenUsingInstantVerification: () => {
21786
- var _a;
21787
- if (!data.payoutVerificationMethod) {
21788
- return "REQUIRED";
21789
- }
21790
- if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
21791
- return "REQUIRED";
21792
- }
21793
- },
21794
- verifiedBankAccountNumber: () => {
21795
- var _a;
21796
- if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
21797
- return "REQUIRED";
21798
- }
21799
- },
21800
- bankStatementRequirement: () => {
21801
- var _a;
21802
- if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
21803
- return requiredFields == null ? void 0 : requiredFields.bankStatementRequirement;
21804
- }
21805
- },
21806
- // "bankStatement description" field is always "optional" and it's coupled with bank statement document.
21807
- bankStatementDescription: () => {
21808
- var _a;
21809
- if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification" && !!(requiredFields == null ? void 0 : requiredFields.bankStatementRequirement)) {
21810
- return "OPTIONAL";
21811
- }
21812
- }
21813
- });
21814
21754
  const preferInstantVerificationMethod = "adyen-kyc-prefer-instant-verification-method";
21815
21755
  const preferInstantVerificationMethodCard = "adyen-kyc-prefer-instant-verification-method-card";
21816
21756
  const preferInstantVerificationMethodImage = "adyen-kyc-prefer-instant-verification-method-image";
@@ -21964,7 +21904,7 @@ function PayoutVerificationMethod(props) {
21964
21904
  accountHolder,
21965
21905
  provider,
21966
21906
  bankVendorsLoadingStatus,
21967
- instantVerificationAllowed,
21907
+ instantVerificationAvailable,
21968
21908
  legalEntityResponse,
21969
21909
  forms,
21970
21910
  validators: validators2,
@@ -22012,14 +21952,8 @@ function PayoutVerificationMethod(props) {
22012
21952
  );
22013
21953
  useEffect(() => {
22014
21954
  if (!enablePreferInstantVerificationMethodFlow) return;
22015
- setHideFooter == null ? void 0 : setHideFooter(
22016
- enablePreferInstantVerificationMethodFlow && isActiveForm && !bankInfoValidated
22017
- );
21955
+ setHideFooter == null ? void 0 : setHideFooter(isActiveForm && !bankInfoValidated);
22018
21956
  }, [enablePreferInstantVerificationMethodFlow, isActiveForm, bankInfoValidated, setHideFooter]);
22019
- const instantVerificationAvailable = useMemo(
22020
- () => Boolean(instantVerificationAllowed && (provider == null ? void 0 : provider.redirectUrl)),
22021
- [instantVerificationAllowed, provider]
22022
- );
22023
21957
  const methodsMetadata = makePayoutVerificationMethodsMetadata(provider == null ? void 0 : provider.name);
22024
21958
  const selectVerificationMethod = (method) => {
22025
21959
  setHasSelectedMethod(true);
@@ -22246,8 +22180,7 @@ function PayoutDetailsComponent(props) {
22246
22180
  associatedLegalArrangement,
22247
22181
  provider,
22248
22182
  bankVendorsLoadingStatus,
22249
- instantVerificationEnabled,
22250
- handleGetBankVerificationVendors,
22183
+ instantVerificationAvailable,
22251
22184
  setHideDropinLayout,
22252
22185
  setHideOnHomeButton,
22253
22186
  setSkipSubmit,
@@ -22336,9 +22269,7 @@ function PayoutDetailsComponent(props) {
22336
22269
  bankInfoValidated,
22337
22270
  setBankInfoValidated,
22338
22271
  handleNextClick,
22339
- instantVerificationAllowed: Boolean(
22340
- instantVerificationEnabled && handleGetBankVerificationVendors
22341
- ),
22272
+ instantVerificationAvailable,
22342
22273
  createTrustedTransferInstrument: createTrustedTransferInstrument2,
22343
22274
  handleBankVerificationError: handleBankVerificationError2,
22344
22275
  setBankVerificationError: setInstantVerificationError,
@@ -24415,11 +24346,6 @@ const trackNavigation = ({
24415
24346
  }
24416
24347
  });
24417
24348
  };
24418
- const useHideButton = (condition, setHideState) => {
24419
- useEffect(() => {
24420
- setHideState == null ? void 0 : setHideState(condition);
24421
- }, [condition, setHideState]);
24422
- };
24423
24349
  const getOpeningStep = (forms, remediationActions) => {
24424
24350
  var _a;
24425
24351
  if (remediationActions && Object.keys(remediationActions).length > 0) {
@@ -24457,10 +24383,6 @@ const useFormComposer = ({
24457
24383
  const totalSteps = forms.length;
24458
24384
  const isFinalStep = currentStep === totalSteps - 1;
24459
24385
  const isFirstStep = currentStep === 0;
24460
- const [hideHomeButton, setHideHomeButton] = useState(false);
24461
- const [hideBackButton, setHideBackButton] = useState(false);
24462
- useHideButton(isFirstStep, setHideBackButton);
24463
- useHideButton(isFinalStep, setHideHomeButton);
24464
24386
  useEffect(() => {
24465
24387
  setActiveForm(
24466
24388
  (activeForm2) => forms.find(({ formId }) => formId === activeForm2.formId) ?? activeForm2
@@ -24538,8 +24460,8 @@ const useFormComposer = ({
24538
24460
  return {
24539
24461
  handleBackClick: backClickHandler,
24540
24462
  handleNextClick,
24541
- hideHomeButton,
24542
- hideBackButton,
24463
+ hideHomeButton: isFirstStep,
24464
+ hideBackButton: isFinalStep,
24543
24465
  nextButtonLabel,
24544
24466
  gotoFormByFormIndex,
24545
24467
  activeForm,
@@ -24607,13 +24529,13 @@ const useUnifyLoadingStatus = (setParentLoadingStatus, ...childLoadingStatuses)
24607
24529
  setParentLoadingStatus(loadingStatus);
24608
24530
  }, [...childLoadingStatuses]);
24609
24531
  };
24610
- const logger$u = createLogger("useScenarioConfiguration");
24532
+ const logger$v = createLogger("useScenarioConfiguration");
24611
24533
  const useScenarioConfiguration = ({
24612
24534
  getConfigurationData,
24613
24535
  getPayoutAccountFormatData,
24614
24536
  parseConfiguration: parseConfiguration2,
24615
24537
  country,
24616
- instantVerificationEnabled,
24538
+ instantVerificationAvailable,
24617
24539
  setLoadingStatus,
24618
24540
  existingBankAccountFormat
24619
24541
  }) => {
@@ -24630,12 +24552,12 @@ const useScenarioConfiguration = ({
24630
24552
  const response = await getConfigurationData();
24631
24553
  setConfigurationResponse(response);
24632
24554
  } catch (err) {
24633
- logger$u.warn("WARNING: Configuration request failed - error:", err);
24555
+ logger$v.warn("WARNING: Configuration request failed - error:", err);
24634
24556
  } finally {
24635
24557
  setConfigurationLoadingStatus("success");
24636
24558
  }
24637
24559
  };
24638
- makeConfigCallAndSave().catch(logger$u.error);
24560
+ makeConfigCallAndSave().catch(logger$v.error);
24639
24561
  }, [getConfigurationData, setConfigurationLoadingStatus]);
24640
24562
  useEffect(() => {
24641
24563
  if (!getPayoutAccountFormatData) return;
@@ -24654,12 +24576,12 @@ const useScenarioConfiguration = ({
24654
24576
  const defaultAccountFormat = defaultPayoutAccountFormat[country] ?? allowedBankAccountFormats[0];
24655
24577
  setAccountFormat(existingBankAccountFormat ?? defaultAccountFormat);
24656
24578
  } catch (err) {
24657
- logger$u.warn("WARNING: Payout format request failed - error:", err);
24579
+ logger$v.warn("WARNING: Payout format request failed - error:", err);
24658
24580
  } finally {
24659
24581
  setpayoutFormatLoadingStatus("success");
24660
24582
  }
24661
24583
  };
24662
- makePayoutFormatCallAndSave().catch(logger$u.error);
24584
+ makePayoutFormatCallAndSave().catch(logger$v.error);
24663
24585
  }, [
24664
24586
  country,
24665
24587
  setAccountFormat,
@@ -24669,14 +24591,14 @@ const useScenarioConfiguration = ({
24669
24591
  ]);
24670
24592
  const { fieldConfigurations, requiredFields } = useMemo(() => {
24671
24593
  if (!configurationResponse) return {};
24672
- const { matchingScenario, provider } = configurationResponse;
24594
+ const { matchingScenario } = configurationResponse;
24673
24595
  const payoutRequiredFields = accountFormatResponse && accountFormat ? accountFormatResponse[accountFormat] : void 0;
24674
24596
  const scenarioConfig = parseConfiguration2(
24675
24597
  payoutRequiredFields ? {
24676
24598
  matchingScenario,
24677
24599
  country,
24678
24600
  requiredFields: payoutRequiredFields,
24679
- bankVerificationAvailable: instantVerificationEnabled && !!(provider == null ? void 0 : provider.redirectUrl)
24601
+ bankVerificationAvailable: instantVerificationAvailable
24680
24602
  } : {
24681
24603
  matchingScenario,
24682
24604
  country,
@@ -24694,7 +24616,7 @@ const useScenarioConfiguration = ({
24694
24616
  configurationResponse,
24695
24617
  country,
24696
24618
  parseConfiguration2,
24697
- instantVerificationEnabled
24619
+ instantVerificationAvailable
24698
24620
  ]);
24699
24621
  return {
24700
24622
  requiredFields,
@@ -24897,7 +24819,8 @@ const countryConfig = {
24897
24819
  ...countryConfig$3,
24898
24820
  [CountryCodes.NewZealand]: {
24899
24821
  ...countryConfig$3[CountryCodes.NewZealand],
24900
- registrationNumber: { label: "NZBN" }
24822
+ registrationNumber: { label: "NZBN" },
24823
+ exemptedFromRegistrationNumber: { label: "doNotHaveNZBN" }
24901
24824
  },
24902
24825
  [CountryCodes.Croatia]: {
24903
24826
  ...countryConfig$3[CountryCodes.Croatia],
@@ -25320,7 +25243,7 @@ const mapAddressData = (verifiedBusiness) => ({
25320
25243
  address: verifiedBusiness.street ?? "",
25321
25244
  otherAddressInformation: verifiedBusiness.street2 ?? "",
25322
25245
  city: verifiedBusiness.city ?? "",
25323
- postalCode: verifiedBusiness.zipcode ?? "",
25246
+ postalCode: verifiedBusiness.zipCode ?? "",
25324
25247
  stateOrProvince: verifiedBusiness.state ?? ""
25325
25248
  });
25326
25249
  const applyVerifiedBusinessData = (verifiedBusiness, handleChangeFor) => {
@@ -25466,6 +25389,7 @@ function AdditionalInformationComponent({
25466
25389
  const { basicInformation } = useGlobalData();
25467
25390
  const { updateStateSlice } = useGlobalDataSlice(ADDITIONAL_INFORMATION_FORM_ID);
25468
25391
  const { i18n } = useI18nContext();
25392
+ const { isExperimentEnabled } = useExperimentsContext();
25469
25393
  const showVerified = !!verifiedBusiness;
25470
25394
  const showStockData = companyType === CompanyTypesValue.PUBLIC_COMPANY;
25471
25395
  const addressSchema = getAddressSchemaForCountry(country).filter(
@@ -25573,7 +25497,8 @@ function AdditionalInformationComponent({
25573
25497
  defaultFieldConfig$9[country],
25574
25498
  {
25575
25499
  companyType,
25576
- registrationNumberType
25500
+ registrationNumberType,
25501
+ isExperimentEnabled
25577
25502
  },
25578
25503
  defaultFieldMetadata$9
25579
25504
  ),
@@ -25645,7 +25570,7 @@ function AdditionalInformationComponent({
25645
25570
  registrationAddress: {
25646
25571
  address: verifiedBusiness.street,
25647
25572
  city: verifiedBusiness.city,
25648
- postalCode: verifiedBusiness.zipcode,
25573
+ postalCode: verifiedBusiness.zipCode,
25649
25574
  stateOrProvince: verifiedBusiness.state,
25650
25575
  country: verifiedBusiness.country
25651
25576
  }
@@ -26193,7 +26118,7 @@ function BusinessInformationCard({
26193
26118
  }
26194
26119
  );
26195
26120
  }
26196
- const logger$t = createLogger("BusinessSelection");
26121
+ const logger$u = createLogger("BusinessSelection");
26197
26122
  function BusinessSelectionComponent({
26198
26123
  showCompanyStructure,
26199
26124
  searching,
@@ -26245,7 +26170,7 @@ function BusinessSelectionComponent({
26245
26170
  setCurrentBusinessSelection(businessData);
26246
26171
  }
26247
26172
  } catch (e) {
26248
- logger$t.error(e);
26173
+ logger$u.error(e);
26249
26174
  }
26250
26175
  },
26251
26176
  [basicInformation == null ? void 0 : basicInformation.stateOrProvince, fetchBusinessData, fetching, selectedBusinessId]
@@ -26259,7 +26184,7 @@ function BusinessSelectionComponent({
26259
26184
  handleNextClick == null ? void 0 : handleNextClick();
26260
26185
  }
26261
26186
  } catch (e) {
26262
- logger$t.error(e);
26187
+ logger$u.error(e);
26263
26188
  }
26264
26189
  },
26265
26190
  [currentTin, handleNextClick, handleBusinessVerification]
@@ -26446,7 +26371,7 @@ function BasicInformationComponent({
26446
26371
  const { i18n } = useI18nContext();
26447
26372
  const { isSettingEnabled } = useSettingsContext();
26448
26373
  const { isExperimentEnabled } = useExperimentsContext();
26449
- const allowedCountries = useAllowedCountries();
26374
+ const { allowedCountries } = useCoreContext();
26450
26375
  const isAllowedEditPrefilledCountry = isSettingEnabled(SettingNames.AllowPrefilledCountryEdit);
26451
26376
  const formDescription = /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-form-header__description", children: [
26452
26377
  description,
@@ -27369,7 +27294,7 @@ const DECISION_MAKER_TYPES_WITH_JOBTITLE = [
27369
27294
  DecisionMakerType.SIGNATORY,
27370
27295
  DecisionMakerType.CONTROLLING_PERSON
27371
27296
  ];
27372
- const rules$1 = ({
27297
+ const rules$2 = ({
27373
27298
  data,
27374
27299
  country,
27375
27300
  taskType,
@@ -27844,7 +27769,7 @@ const useExpiryThreshold = (expiry) => {
27844
27769
  return { expiryStatus: "notYetCloseToExpiry", secondsUntilExpiry: void 0 };
27845
27770
  };
27846
27771
  const ExpiryContext = createContext(false);
27847
- const logger$s = createLogger("ExpiryProvider");
27772
+ const logger$t = createLogger("ExpiryProvider");
27848
27773
  const ExpiryProvider = ({
27849
27774
  expiry: initialExpiry,
27850
27775
  eventEmitter,
@@ -27873,7 +27798,7 @@ const ExpiryProvider = ({
27873
27798
  refreshExpiry().then((newExpiry) => {
27874
27799
  setExpiry(newExpiry);
27875
27800
  setModalDismissed(false);
27876
- }).catch(logger$s.error);
27801
+ }).catch(logger$t.error);
27877
27802
  }
27878
27803
  }
27879
27804
  ),
@@ -27895,7 +27820,7 @@ const ExpiryProvider = ({
27895
27820
  return /* @__PURE__ */ jsx(ExpiryContext.Provider, { value: expiryStatus === "expired", children });
27896
27821
  };
27897
27822
  const useHasExpired = () => useContext(ExpiryContext);
27898
- const logger$r = createLogger("FormRouterContextProvider");
27823
+ const logger$s = createLogger("FormRouterContextProvider");
27899
27824
  function FormRouterContextProvider({
27900
27825
  children,
27901
27826
  forms,
@@ -27918,7 +27843,7 @@ function FormRouterContextProvider({
27918
27843
  if (formIndex > -1) {
27919
27844
  setFormIndex(formIndex);
27920
27845
  } else {
27921
- logger$r.error("No form was found to have that field so form navigation failed.");
27846
+ logger$s.error("No form was found to have that field so form navigation failed.");
27922
27847
  }
27923
27848
  }
27924
27849
  }),
@@ -29616,7 +29541,7 @@ function CompanyDropinComponent({
29616
29541
  }
29617
29542
  const IgnoreLocalStorageContext = createContext(false);
29618
29543
  const useIgnoreLocalStorage = () => useContext(IgnoreLocalStorageContext);
29619
- const logger$q = createLogger("useLocalStorage");
29544
+ const logger$r = createLogger("useLocalStorage");
29620
29545
  const useLocalStorage = (key, defaultValue, options) => {
29621
29546
  const { serializer, parser, syncData } = useMemo(
29622
29547
  () => ({
@@ -29636,7 +29561,7 @@ const useLocalStorage = (key, defaultValue, options) => {
29636
29561
  const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
29637
29562
  return res;
29638
29563
  } catch (err) {
29639
- logger$q.error(err);
29564
+ logger$r.error(err);
29640
29565
  return defaultValue;
29641
29566
  }
29642
29567
  });
@@ -29671,7 +29596,7 @@ const useLocalStorage = (key, defaultValue, options) => {
29671
29596
  try {
29672
29597
  updateLocalStorage();
29673
29598
  } catch (err) {
29674
- logger$q.error(err);
29599
+ logger$r.error(err);
29675
29600
  }
29676
29601
  }, [value, ignoreLocalStorage]);
29677
29602
  useEffect(() => {
@@ -29684,7 +29609,7 @@ const useLocalStorage = (key, defaultValue, options) => {
29684
29609
  setValue(event.newValue ? parser(event.newValue) : void 0);
29685
29610
  }
29686
29611
  } catch (err) {
29687
- logger$q.error(err);
29612
+ logger$r.error(err);
29688
29613
  }
29689
29614
  };
29690
29615
  if (ignoreLocalStorage) return;
@@ -29868,7 +29793,7 @@ const useSingpassMyInfoLogin = ({
29868
29793
  trustedEntityAssociations
29869
29794
  };
29870
29795
  };
29871
- const logger$p = createLogger("useAssociatedLegalArrangement");
29796
+ const logger$q = createLogger("useAssociatedLegalArrangement");
29872
29797
  function useAssociatedLegalArrangement({
29873
29798
  rootLegalEntity,
29874
29799
  getLegalEntity: getLegalEntity2
@@ -29884,7 +29809,7 @@ function useAssociatedLegalArrangement({
29884
29809
  (entity) => entity.type === LegalEntityType.SOLE_PROPRIETORSHIP || entity.type === LegalEntityType.TRUST
29885
29810
  );
29886
29811
  if (foundEntity == null ? void 0 : foundEntity.legalEntityId) {
29887
- getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$p.error);
29812
+ getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$q.error);
29888
29813
  }
29889
29814
  }, [getAssociatedEntity, rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations]);
29890
29815
  useEffect(() => {
@@ -29934,7 +29859,7 @@ const useCanSeeEntitySelection = (legalEntityId) => {
29934
29859
  setCanSeeEntitySelection: setCanSeeEntitySelectionIntoLocalStorage
29935
29860
  };
29936
29861
  };
29937
- const logger$o = createLogger("useExemptSettlor");
29862
+ const logger$p = createLogger("useExemptSettlor");
29938
29863
  const useExemptSettlor = ({
29939
29864
  trust,
29940
29865
  handleGetLegalEntity
@@ -29952,7 +29877,7 @@ const useExemptSettlor = ({
29952
29877
  );
29953
29878
  useEffect(() => {
29954
29879
  if (!(trust == null ? void 0 : trust.trust)) return;
29955
- updateExemptSettlor(trust).catch(logger$o.error);
29880
+ updateExemptSettlor(trust).catch(logger$p.error);
29956
29881
  }, [trust, updateExemptSettlor]);
29957
29882
  return exemptSettlor;
29958
29883
  };
@@ -32009,6 +31934,14 @@ const SingpassSelection = (props) => {
32009
31934
  )
32010
31935
  ] }) });
32011
31936
  };
31937
+ const useSetting = (settingName) => {
31938
+ const context = useContext(SettingsContext);
31939
+ if (context === void 0) {
31940
+ throw new Error("useSetting must be used within a SettingsProvider");
31941
+ }
31942
+ const { getSetting } = context;
31943
+ return getSetting(settingName);
31944
+ };
32012
31945
  const businessTypeMapping = {
32013
31946
  myName: {
32014
31947
  [LegalEntityType.INDIVIDUAL]: "individual"
@@ -33051,7 +32984,7 @@ function IndividualDropinComponent({
33051
32984
  country
33052
32985
  });
33053
32986
  const fieldsFromCustomRules = useMemo(
33054
- () => rules$1({
32987
+ () => rules$2({
33055
32988
  data,
33056
32989
  country,
33057
32990
  taskType,
@@ -33516,7 +33449,7 @@ function IndividualDropinComponent({
33516
33449
  }
33517
33450
  );
33518
33451
  }
33519
- const logger$n = createLogger("useBankConfigurationHandler");
33452
+ const logger$o = createLogger("useBankConfigurationHandler");
33520
33453
  const useBankConfigurationHandlers = ({
33521
33454
  handleGetBankVerificationVendors,
33522
33455
  bankAccountCountry,
@@ -33534,7 +33467,7 @@ const useBankConfigurationHandlers = ({
33534
33467
  const bankVerificationVendorsResponse = handleGetBankVerificationVendors ? await handleGetBankVerificationVendors(bankAccountCountry) : [];
33535
33468
  setProvider(bankVerificationVendorsResponse == null ? void 0 : bankVerificationVendorsResponse[0]);
33536
33469
  })().catch(() => {
33537
- logger$n.error();
33470
+ logger$o.error();
33538
33471
  setProvider(void 0);
33539
33472
  }).finally(() => {
33540
33473
  setLoadingStatus("success");
@@ -33547,17 +33480,14 @@ const useBankConfigurationHandlers = ({
33547
33480
  handleGetBankVerificationVendors,
33548
33481
  bankAccountCountry
33549
33482
  ]);
33550
- const getConfigurationData = useCallback(async () => {
33551
- const configuration = await getConfiguration2({
33483
+ const getConfigurationData = useCallback(
33484
+ () => getConfiguration2({
33552
33485
  legalEntityType,
33553
33486
  capabilities,
33554
33487
  country: bankAccountCountry
33555
- });
33556
- return {
33557
- ...configuration,
33558
- provider
33559
- };
33560
- }, [getConfiguration2, legalEntityType, bankAccountCountry, capabilities, provider]);
33488
+ }),
33489
+ [getConfiguration2, legalEntityType, bankAccountCountry, capabilities]
33490
+ );
33561
33491
  return {
33562
33492
  getConfigurationData,
33563
33493
  provider
@@ -33571,6 +33501,43 @@ const getAccountFormatsForCountry = async (country) => {
33571
33501
  }
33572
33502
  return (await importForCountry()).default;
33573
33503
  };
33504
+ const rules$1 = ({ data, requiredFields }) => ({
33505
+ whenUsingManualVerification: () => {
33506
+ var _a;
33507
+ if (!data.payoutVerificationMethod) return;
33508
+ if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
33509
+ return "REQUIRED";
33510
+ }
33511
+ },
33512
+ whenUsingInstantVerification: () => {
33513
+ var _a;
33514
+ if (!data.payoutVerificationMethod) {
33515
+ return "REQUIRED";
33516
+ }
33517
+ if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
33518
+ return "REQUIRED";
33519
+ }
33520
+ },
33521
+ verifiedBankAccountNumber: () => {
33522
+ var _a;
33523
+ if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
33524
+ return "REQUIRED";
33525
+ }
33526
+ },
33527
+ bankStatementRequirement: () => {
33528
+ var _a;
33529
+ if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
33530
+ return requiredFields == null ? void 0 : requiredFields.bankStatementRequirement;
33531
+ }
33532
+ },
33533
+ // "bankStatement description" field is always "optional" and it's coupled with bank statement document.
33534
+ bankStatementDescription: () => {
33535
+ var _a;
33536
+ if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification" && !!(requiredFields == null ? void 0 : requiredFields.bankStatementRequirement)) {
33537
+ return "OPTIONAL";
33538
+ }
33539
+ }
33540
+ });
33574
33541
  const labels = () => ({
33575
33542
  verifiedAccountHolder: () => "accountHolder",
33576
33543
  verifiedBankCountry: () => "bankCountry",
@@ -33718,17 +33685,6 @@ function PayoutDetailsDropinComponent({
33718
33685
  });
33719
33686
  onChange == null ? void 0 : onChange(currentState);
33720
33687
  }, [bankAccountCountry, currentState, onChange]);
33721
- useEffect(() => {
33722
- var _a2, _b2;
33723
- setData({
33724
- ...currentState.data,
33725
- payoutAccountDetails: {
33726
- ...(_a2 = currentState.data) == null ? void 0 : _a2.payoutAccountDetails,
33727
- currency: (_b2 = currencyByCountry[bankAccountCountry]) == null ? void 0 : _b2[0]
33728
- }
33729
- });
33730
- onChange == null ? void 0 : onChange(currentState);
33731
- }, [bankAccountCountry, currentState, onChange]);
33732
33688
  const { getConfigurationData, provider } = useBankConfigurationHandlers({
33733
33689
  isEmbeddedDropin,
33734
33690
  handleGetBankVerificationVendors,
@@ -33740,6 +33696,10 @@ function PayoutDetailsDropinComponent({
33740
33696
  useFreshProviderRedirectUrl,
33741
33697
  setUseFreshProviderRedirectUrl
33742
33698
  });
33699
+ const instantVerificationAvailable = useMemo(
33700
+ () => Boolean(instantVerificationEnabled && (provider == null ? void 0 : provider.redirectUrl)),
33701
+ [instantVerificationEnabled, provider == null ? void 0 : provider.redirectUrl]
33702
+ );
33743
33703
  const getPayoutAccountFormatData = useCallback(
33744
33704
  async () => getAccountFormatsForCountry(bankAccountCountry),
33745
33705
  [bankAccountCountry]
@@ -33748,13 +33708,13 @@ function PayoutDetailsDropinComponent({
33748
33708
  parseConfiguration: parseConfiguration$3,
33749
33709
  getConfigurationData,
33750
33710
  getPayoutAccountFormatData,
33751
- instantVerificationEnabled,
33711
+ instantVerificationAvailable,
33752
33712
  setLoadingStatus: setConfigurationLoadingStatus,
33753
33713
  country: bankAccountCountry,
33754
33714
  existingBankAccountFormat
33755
33715
  });
33756
33716
  const fieldsFromCustomRules = useMemo(
33757
- () => rules$2({
33717
+ () => rules$1({
33758
33718
  data,
33759
33719
  country: bankAccountCountry,
33760
33720
  taskType,
@@ -33772,10 +33732,7 @@ function PayoutDetailsDropinComponent({
33772
33732
  var _a2;
33773
33733
  return getAppropriatePayoutDetailsSteps(
33774
33734
  Boolean((_a2 = prefilledData == null ? void 0 : prefilledData.payoutAccountDetails) == null ? void 0 : _a2.transferInstrumentId),
33775
- !transferInstrument && isInstantVerificationAvailable({
33776
- provider,
33777
- verificationVendorsCallback: handleGetBankVerificationVendors
33778
- }),
33735
+ instantVerificationAvailable,
33779
33736
  isSettingEnabled(SettingNames.AllowIntraRegionCrossBorderPayout),
33780
33737
  showWidgetInVerificationMethodStep
33781
33738
  );
@@ -34057,8 +34014,7 @@ function PayoutDetailsDropinComponent({
34057
34014
  associatedLegalArrangement,
34058
34015
  provider,
34059
34016
  bankVendorsLoadingStatus,
34060
- handleGetBankVerificationVendors,
34061
- instantVerificationEnabled,
34017
+ instantVerificationAvailable,
34062
34018
  refreshLegalEntity,
34063
34019
  shouldValidate,
34064
34020
  createTrustedTransferInstrument: createTrustedTransferInstrumentHandler,
@@ -35057,7 +35013,7 @@ const serviceAgreementValidationRules = {
35057
35013
  errorMessage: "fieldIsRequired"
35058
35014
  }
35059
35015
  };
35060
- const logger$m = createLogger("useServiceAgreement");
35016
+ const logger$n = createLogger("useServiceAgreement");
35061
35017
  const FALLBACK_LANGUAGE_CODE$1 = "en";
35062
35018
  const useServiceAgreement = ({
35063
35019
  handleGetServiceAgreement,
@@ -35087,7 +35043,7 @@ const useServiceAgreement = ({
35087
35043
  const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
35088
35044
  setServiceAgreement({ id, contract });
35089
35045
  };
35090
- requestAcceptedServiceAgreement().catch(logger$m.error).finally(() => setLoading("success"));
35046
+ requestAcceptedServiceAgreement().catch(logger$n.error).finally(() => setLoading("success"));
35091
35047
  }, [acceptanceId, handleViewAcceptedTermsOfServiceDocument]);
35092
35048
  useEffect(() => {
35093
35049
  const requestServiceAgreement = async () => {
@@ -35102,7 +35058,7 @@ const useServiceAgreement = ({
35102
35058
  }
35103
35059
  );
35104
35060
  if (!document2) {
35105
- logger$m.log('"document" field was missing in response');
35061
+ logger$n.log('"document" field was missing in response');
35106
35062
  return;
35107
35063
  }
35108
35064
  const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
@@ -35117,7 +35073,7 @@ const useServiceAgreement = ({
35117
35073
  throw err;
35118
35074
  }
35119
35075
  };
35120
- requestServiceAgreement().catch(logger$m.error);
35076
+ requestServiceAgreement().catch(logger$n.error);
35121
35077
  }, [
35122
35078
  handleGetServiceAgreement,
35123
35079
  handleServiceAgreementIsNotAvailableInThatLanguage,
@@ -35141,7 +35097,7 @@ const serviceAgreementTypesTranslationMapping = {
35141
35097
  adyenPccr: "pccr",
35142
35098
  adyenChargeCard: "chargeCardUserAgreement"
35143
35099
  };
35144
- const logger$l = createLogger("ServiceAgreementDropinComponent");
35100
+ const logger$m = createLogger("ServiceAgreementDropinComponent");
35145
35101
  const FALLBACK_LANGUAGE_CODE = "en";
35146
35102
  function ServiceAgreementDropinComponent({
35147
35103
  legalEntityResponse,
@@ -35325,7 +35281,7 @@ function ServiceAgreementDropinComponent({
35325
35281
  await requestAndDownload(i18n.languageCode);
35326
35282
  } catch (e) {
35327
35283
  if (i18n.languageCode !== FALLBACK_LANGUAGE_CODE) {
35328
- await requestAndDownload(FALLBACK_LANGUAGE_CODE).catch(logger$l.error);
35284
+ await requestAndDownload(FALLBACK_LANGUAGE_CODE).catch(logger$m.error);
35329
35285
  return;
35330
35286
  }
35331
35287
  showToast({
@@ -36340,7 +36296,7 @@ const hasProgressedBeyondEntitySelection = (legalEntity) => {
36340
36296
  return hasOwnEntityAssocation || !!hasOrganizationType;
36341
36297
  };
36342
36298
  const PAGES_WITH_POLLING = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
36343
- const logger$k = createLogger("DropinComposerComponent");
36299
+ const logger$l = createLogger("DropinComposerComponent");
36344
36300
  const isOrganizationSettlorWithExemptionReasonEnabled = (enabled, country) => country === CountryCodes.Australia && enabled;
36345
36301
  function DropinComposerComponent({
36346
36302
  capabilities,
@@ -36447,7 +36403,7 @@ function DropinComposerComponent({
36447
36403
  setPciStatus(response);
36448
36404
  return response;
36449
36405
  } catch (e) {
36450
- logger$k.warn(i18n.get("failedToGetPciStatus"));
36406
+ logger$l.warn(i18n.get("failedToGetPciStatus"));
36451
36407
  }
36452
36408
  }
36453
36409
  return void 0;
@@ -36475,7 +36431,7 @@ function DropinComposerComponent({
36475
36431
  }, [additionalSalesChannels, i18n, rootLegalEntity.id, args.handleGetPciTemplate]);
36476
36432
  useEffect(() => {
36477
36433
  if (!tasks.includes(TaskTypes.PCI_DSS)) return;
36478
- getPciTemplate2().catch(logger$k.error);
36434
+ getPciTemplate2().catch(logger$l.error);
36479
36435
  }, [getPciTemplate2, tasks]);
36480
36436
  const addFetchedAcceptedByName = async (acceptanceInfo) => {
36481
36437
  try {
@@ -36485,7 +36441,7 @@ function DropinComposerComponent({
36485
36441
  acceptedByName: getLegalEntityNameBasedOnType(acceptedByEntity)
36486
36442
  };
36487
36443
  } catch (e) {
36488
- logger$k.warn(i18n.get("failedToFetchAcceptedByName"));
36444
+ logger$l.warn(i18n.get("failedToFetchAcceptedByName"));
36489
36445
  return {
36490
36446
  ...acceptanceInfo,
36491
36447
  acceptedByName: null
@@ -36499,7 +36455,7 @@ function DropinComposerComponent({
36499
36455
  const serviceAgreementAcceptanceInfosWithNames2 = await Promise.all(response.data.map(addFetchedAcceptedByName));
36500
36456
  setServiceAgreementAcceptanceInfosWithNames(serviceAgreementAcceptanceInfosWithNames2);
36501
36457
  } catch (e) {
36502
- logger$k.warn(i18n.get("failedToGetServiceAgreementStatus"));
36458
+ logger$l.warn(i18n.get("failedToGetServiceAgreementStatus"));
36503
36459
  }
36504
36460
  }
36505
36461
  };
@@ -36509,7 +36465,7 @@ function DropinComposerComponent({
36509
36465
  const response = await args.handleGetServiceAgreementStatus(rootLegalEntity.id);
36510
36466
  setServiceAgreementTypes(response.termsOfServiceTypes);
36511
36467
  } catch (e) {
36512
- logger$k.warn(i18n.get("failedToGetServiceAgreementStatus"));
36468
+ logger$l.warn(i18n.get("failedToGetServiceAgreementStatus"));
36513
36469
  }
36514
36470
  }
36515
36471
  };
@@ -36539,7 +36495,7 @@ function DropinComposerComponent({
36539
36495
  try {
36540
36496
  return await args.handleGetLegalEntity(rootLegalEntity.id);
36541
36497
  } catch (e) {
36542
- logger$k.warn("Failed to fetch legal entity details", e);
36498
+ logger$l.warn("Failed to fetch legal entity details", e);
36543
36499
  }
36544
36500
  }
36545
36501
  return void 0;
@@ -36595,7 +36551,7 @@ function DropinComposerComponent({
36595
36551
  await refreshAssociatedLegalArrangement();
36596
36552
  showToast({ type: "success", label: i18n.get("successFullyRemovedTrustMember") });
36597
36553
  } catch (err) {
36598
- logger$k.error(`Failed to delete trust member`, err);
36554
+ logger$l.error(`Failed to delete trust member`, err);
36599
36555
  showToast({ type: "error", label: i18n.get("failedToRemoveTrustMember") });
36600
36556
  }
36601
36557
  };
@@ -36662,14 +36618,14 @@ function DropinComposerComponent({
36662
36618
  }
36663
36619
  break;
36664
36620
  default:
36665
- logger$k.warn(
36621
+ logger$l.warn(
36666
36622
  `Updating trust member type "${trustMember.trustMemberType}" is not implemented.`
36667
36623
  );
36668
36624
  }
36669
36625
  showToast({ label: i18n.get("successfullyUpdatedDetails"), type: "success" });
36670
36626
  await refreshLegalArrangementAndRunOnSubmit(associatedLegalArrangement, 1);
36671
36627
  } catch (err) {
36672
- logger$k.error(err);
36628
+ logger$l.error(err);
36673
36629
  showToast({ label: i18n.get("failedToUpdateDetails"), type: "error" });
36674
36630
  }
36675
36631
  };
@@ -36681,7 +36637,7 @@ function DropinComposerComponent({
36681
36637
  singpassTabRef.current = window.open(authUrl, "_blank");
36682
36638
  singpassTabRef.current.focus();
36683
36639
  } catch (e) {
36684
- logger$k.error(e);
36640
+ logger$l.error(e);
36685
36641
  handleSingpassMyInfoLoginFailure(e);
36686
36642
  }
36687
36643
  }
@@ -36872,7 +36828,7 @@ function DropinComposerComponent({
36872
36828
  }
36873
36829
  };
36874
36830
  setIsLoadingConfiguration(true);
36875
- fetchConfiguration().catch(logger$k.error).finally(() => {
36831
+ fetchConfiguration().catch(logger$l.error).finally(() => {
36876
36832
  setIsLoadingConfiguration(false);
36877
36833
  onLoad();
36878
36834
  });
@@ -36909,7 +36865,7 @@ function DropinComposerComponent({
36909
36865
  singpassTabRef.current = window.open(authUrl);
36910
36866
  singpassTabRef.current.focus();
36911
36867
  } catch (e) {
36912
- logger$k.error(e);
36868
+ logger$l.error(e);
36913
36869
  handleSingpassMyInfoLoginFailure(e);
36914
36870
  }
36915
36871
  },
@@ -38091,7 +38047,7 @@ const useComponentApi = (rootLegalEntityId) => {
38091
38047
  };
38092
38048
  }, [base, rootLegalEntityId]);
38093
38049
  };
38094
- const logger$j = createLogger("AcceptTermsOfService");
38050
+ const logger$k = createLogger("AcceptTermsOfService");
38095
38051
  function AcceptTermsOfServiceComponent({
38096
38052
  legalEntityId,
38097
38053
  modalView,
@@ -38133,13 +38089,13 @@ function AcceptTermsOfServiceComponent({
38133
38089
  onClose == null ? void 0 : onClose();
38134
38090
  };
38135
38091
  const fetchLegalEntity = useCallback(async () => {
38136
- await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$j.error);
38092
+ await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$k.error);
38137
38093
  }, [getLegalEntity2, legalEntityId]);
38138
38094
  const fetchUnsigned = useCallback(async () => {
38139
- await getServiceAgreementStatus2(legalEntityId).then(({ termsOfServiceTypes }) => setServiceAgreementTypes(termsOfServiceTypes)).catch(logger$j.error);
38095
+ await getServiceAgreementStatus2(legalEntityId).then(({ termsOfServiceTypes }) => setServiceAgreementTypes(termsOfServiceTypes)).catch(logger$k.error);
38140
38096
  }, [getServiceAgreementStatus2, legalEntityId]);
38141
38097
  const fetchSigned = useCallback(async () => {
38142
- await getServiceAgreementAcceptanceInfos2(legalEntityId).then(({ data }) => setServiceAgreementAcceptanceInfos(data)).catch(logger$j.error);
38098
+ await getServiceAgreementAcceptanceInfos2(legalEntityId).then(({ data }) => setServiceAgreementAcceptanceInfos(data)).catch(logger$k.error);
38143
38099
  }, [getServiceAgreementAcceptanceInfos2, legalEntityId]);
38144
38100
  const handleSign = useCallback(
38145
38101
  // @ts-ignore-error:next-line ts does not infer type correctly
@@ -38173,7 +38129,7 @@ function AcceptTermsOfServiceComponent({
38173
38129
  (async () => {
38174
38130
  setIsLoading(true);
38175
38131
  await Promise.all([fetchLegalEntity(), fetchUnsigned(), fetchSigned()]);
38176
- })().catch(logger$j.error).finally(() => {
38132
+ })().catch(logger$k.error).finally(() => {
38177
38133
  setIsLoading(false);
38178
38134
  });
38179
38135
  }, [fetchLegalEntity, fetchSigned, fetchUnsigned]);
@@ -38200,7 +38156,7 @@ function AcceptTermsOfServiceComponent({
38200
38156
  }
38201
38157
  );
38202
38158
  }
38203
- const logger$i = createLogger("CreateIndividualComponent");
38159
+ const logger$j = createLogger("CreateIndividualComponent");
38204
38160
  function CreateIndividualComponent({
38205
38161
  parentLegalEntityId,
38206
38162
  legalEntityId,
@@ -38251,11 +38207,11 @@ function CreateIndividualComponent({
38251
38207
  setParentLegalEntity(parentEntity);
38252
38208
  setLegalEntity(entity);
38253
38209
  } catch (error) {
38254
- logger$i.error(error);
38210
+ logger$j.error(error);
38255
38211
  }
38256
38212
  }, [parentLegalEntityId, legalEntityId, getLegalEntity2]);
38257
38213
  useEffect(() => {
38258
- fetchLegalEntity().catch(logger$i.error).finally(() => {
38214
+ fetchLegalEntity().catch(logger$j.error).finally(() => {
38259
38215
  setIsLoading(false);
38260
38216
  });
38261
38217
  }, [fetchLegalEntity]);
@@ -38275,7 +38231,7 @@ function CreateIndividualComponent({
38275
38231
  setIsAddressEnabled(res.statuses.address.enabled);
38276
38232
  }, [country, getProviderStatus2]);
38277
38233
  useEffect(() => {
38278
- fetchProviderStatus().catch(logger$i.error);
38234
+ fetchProviderStatus().catch(logger$j.error);
38279
38235
  }, [fetchProviderStatus]);
38280
38236
  return isLoading || !legalEntity ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : /* @__PURE__ */ jsx(
38281
38237
  IndividualDropinComponent,
@@ -38300,7 +38256,7 @@ function CreateIndividualComponent({
38300
38256
  }
38301
38257
  );
38302
38258
  }
38303
- const logger$h = createLogger("CreateTransferInstrumentComponent");
38259
+ const logger$i = createLogger("CreateTransferInstrumentComponent");
38304
38260
  function CreateTransferInstrumentComponent({
38305
38261
  legalEntityId,
38306
38262
  transferInstrumentId,
@@ -38341,7 +38297,7 @@ function CreateTransferInstrumentComponent({
38341
38297
  const ti = await getTransferInstrument2(transferInstrumentId);
38342
38298
  setTransferInstrument(ti);
38343
38299
  }
38344
- })().catch(logger$h.error).finally(() => {
38300
+ })().catch(logger$i.error).finally(() => {
38345
38301
  setLoadingStatus("success");
38346
38302
  });
38347
38303
  }, [transferInstrumentId, fetchLegalEntity, getTransferInstrument2]);
@@ -38891,7 +38847,7 @@ function ManageTransferInstrumentOverviewItem({
38891
38847
  )
38892
38848
  ] });
38893
38849
  }
38894
- const logger$g = createLogger("ManageTransferInstrumentOverview");
38850
+ const logger$h = createLogger("ManageTransferInstrumentOverview");
38895
38851
  function ManageTransferInstrumentOverview({
38896
38852
  transferInstrumentReferences,
38897
38853
  legalEntityId,
@@ -38910,7 +38866,7 @@ function ManageTransferInstrumentOverview({
38910
38866
  const ti = await getTransferInstrument2(transferInstrumentId);
38911
38867
  setTransferInstrumentsMap({ [transferInstrumentId]: ti, ...transferInstrumentsMap });
38912
38868
  } catch (e) {
38913
- logger$g.error(e);
38869
+ logger$h.error(e);
38914
38870
  }
38915
38871
  };
38916
38872
  const onRemoveTransferInstrument = async (transferInstrumentId) => {
@@ -38919,7 +38875,7 @@ function ManageTransferInstrumentOverview({
38919
38875
  onRemove(transferInstrumentId);
38920
38876
  } catch (e) {
38921
38877
  showToast({ label: i18n.get("thereWasAnErrorTryAgain"), type: "error" });
38922
- logger$g.error(e);
38878
+ logger$h.error(e);
38923
38879
  }
38924
38880
  };
38925
38881
  const transferInstrumentListEle = transferInstrumentReferences.map((transferInstrumentRef) => /* @__PURE__ */ jsx(
@@ -38948,7 +38904,7 @@ function ManageTransferInstrumentOverview({
38948
38904
  )
38949
38905
  ] });
38950
38906
  }
38951
- const logger$f = createLogger("ManageTransferInstrumentComponent");
38907
+ const logger$g = createLogger("ManageTransferInstrumentComponent");
38952
38908
  function ManageTransferInstrumentComponent({
38953
38909
  legalEntityId,
38954
38910
  onAdd,
@@ -38976,7 +38932,7 @@ function ManageTransferInstrumentComponent({
38976
38932
  }, [getTransferInstruments2]);
38977
38933
  useEffect(() => {
38978
38934
  eventEmitter == null ? void 0 : eventEmitter.on("updateLocale", (locale) => setLocale(locale));
38979
- init2().catch(logger$f.error).finally(() => {
38935
+ init2().catch(logger$g.error).finally(() => {
38980
38936
  setLoadingStatus("success");
38981
38937
  });
38982
38938
  }, [init2, setLocale, eventEmitter]);
@@ -38986,7 +38942,7 @@ function ManageTransferInstrumentComponent({
38986
38942
  }
38987
38943
  }, [hasOnlyVerifiedTransferInstruments, timeoutId, transferInstruments]);
38988
38944
  const onRemove = (transferInstrumentId) => {
38989
- refreshTransferInstruments().catch(logger$f.error);
38945
+ refreshTransferInstruments().catch(logger$g.error);
38990
38946
  onRemoveSuccess == null ? void 0 : onRemoveSuccess(transferInstrumentId, legalEntityId);
38991
38947
  };
38992
38948
  const render2 = () => {
@@ -39013,7 +38969,7 @@ function ManageTransferInstrumentComponent({
39013
38969
  };
39014
38970
  return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-manage-transfer-instrument", children: render2() });
39015
38971
  }
39016
- const logger$e = createLogger("OnboardingDropinComponent");
38972
+ const logger$f = createLogger("OnboardingDropinComponent");
39017
38973
  function OnboardingDropinComponent({
39018
38974
  legalEntityId,
39019
38975
  openBankingPartnerConfigId
@@ -39074,13 +39030,13 @@ function OnboardingDropinComponent({
39074
39030
  setLegalEntity(le);
39075
39031
  setProviderStatus(providerStatuses);
39076
39032
  } catch (error) {
39077
- logger$e.error(error);
39033
+ logger$f.error(error);
39078
39034
  } finally {
39079
39035
  setLoadingStatus("success");
39080
39036
  }
39081
39037
  }, [legalEntityId, getLegalEntity2, getProviderStatus2]);
39082
39038
  useEffect(() => {
39083
- init2().catch(logger$e.error);
39039
+ init2().catch(logger$f.error);
39084
39040
  }, [init2]);
39085
39041
  return loadingStatus === "loading" || !legalEntity ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : /* @__PURE__ */ jsx(
39086
39042
  DropinComposerComponent,
@@ -39124,7 +39080,7 @@ function OnboardingDropinComponent({
39124
39080
  }
39125
39081
  );
39126
39082
  }
39127
- const logger$d = createLogger("SignPCIComponent");
39083
+ const logger$e = createLogger("SignPCIComponent");
39128
39084
  function SignPCIComponent({
39129
39085
  legalEntityId,
39130
39086
  modalView,
@@ -39154,7 +39110,7 @@ function SignPCIComponent({
39154
39110
  onClose == null ? void 0 : onClose();
39155
39111
  };
39156
39112
  const fetchLegalEntity = useCallback(async () => {
39157
- await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$d.error);
39113
+ await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$e.error);
39158
39114
  }, [getLegalEntity2, legalEntityId]);
39159
39115
  const fetchStatus = useCallback(async () => {
39160
39116
  await getPciStatus2(legalEntityId, { additionalSalesChannels }).then(({ signingRequired }) => {
@@ -39165,7 +39121,7 @@ function SignPCIComponent({
39165
39121
  await getPciTemplate2(legalEntityId, {
39166
39122
  additionalSalesChannels,
39167
39123
  language: i18n.locale.substring(0, 2) ?? "en"
39168
- }).then((res) => setPciTemplate(res)).catch(logger$d.error);
39124
+ }).then((res) => setPciTemplate(res)).catch(logger$e.error);
39169
39125
  }, [additionalSalesChannels, getPciTemplate2, i18n.locale, legalEntityId]);
39170
39126
  useEffect(() => {
39171
39127
  (async () => {
@@ -39329,7 +39285,7 @@ const entityHasUltimateParentCompany = (data) => {
39329
39285
  return ((_a = data.company) == null ? void 0 : _a.isParentOwnedByAnotherCompany) && ((_b = data.company) == null ? void 0 : _b.isParentOwnedByAnotherCompany) === "Yes";
39330
39286
  };
39331
39287
  const prepareExposureSubmitData = (exposureIndex, data, rootLegalEntity) => {
39332
- var _a;
39288
+ var _a, _b, _c;
39333
39289
  const exposureData = data[exposureIndex];
39334
39290
  if (!exposureData) return null;
39335
39291
  if (exposureIndex === HighExposureIndex.PARENT_COMPANY && !entityHasParentCompany(data)) {
@@ -39340,7 +39296,7 @@ const prepareExposureSubmitData = (exposureIndex, data, rootLegalEntity) => {
39340
39296
  }
39341
39297
  const exposureDetails = mapHighExposureToLegalEntity(exposureData);
39342
39298
  if (!exposureDetails.organization) return null;
39343
- const exposureCountry = (_a = exposureDetails.organization.registeredAddress) == null ? void 0 : _a.country;
39299
+ const exposureCountry = ((_a = exposureDetails.organization.registeredAddress) == null ? void 0 : _a.country) || ((_c = (_b = rootLegalEntity == null ? void 0 : rootLegalEntity.organization) == null ? void 0 : _b.registeredAddress) == null ? void 0 : _c.country);
39344
39300
  if (exposureDetails.organization.financialReports && isEeaCountry(exposureCountry)) {
39345
39301
  const exposureFinancialReports = {
39346
39302
  employeeCount: exposureData.numberOfEmployees,
@@ -39432,6 +39388,9 @@ const getCompanySchemaKeys = (country, currentData, schemaKeys) => {
39432
39388
  "numberOfEmployees"
39433
39389
  );
39434
39390
  }
39391
+ if (!euCountries.includes(country)) {
39392
+ fieldsToRemove.push("legalForm");
39393
+ }
39435
39394
  if (currentData.isCompanyOwnedByAnotherCompany !== "Yes") {
39436
39395
  fieldsToRemove.push("isParentOwnedByAnotherCompany");
39437
39396
  }
@@ -39446,7 +39405,8 @@ const getCompanySchemaKeys = (country, currentData, schemaKeys) => {
39446
39405
  const getParentCompanySchemaKeys = (currentData, schemaKeys) => {
39447
39406
  var _a;
39448
39407
  const fieldsToRemove = [];
39449
- if (!isEeaCountry((_a = currentData == null ? void 0 : currentData.registrationAddress) == null ? void 0 : _a.country)) {
39408
+ const companyCountry = (_a = currentData == null ? void 0 : currentData.registrationAddress) == null ? void 0 : _a.country;
39409
+ if (!isEeaCountry(companyCountry)) {
39450
39410
  fieldsToRemove.push(
39451
39411
  "financialReportingDate",
39452
39412
  "netAssets",
@@ -39455,6 +39415,9 @@ const getParentCompanySchemaKeys = (currentData, schemaKeys) => {
39455
39415
  "numberOfEmployees"
39456
39416
  );
39457
39417
  }
39418
+ if (!companyCountry || !euCountries.includes(companyCountry)) {
39419
+ fieldsToRemove.push("legalForm");
39420
+ }
39458
39421
  if (currentData.doesYourCompanyHaveLEI !== "Yes") {
39459
39422
  fieldsToRemove.push("legalEntityIdentifier");
39460
39423
  }
@@ -39476,6 +39439,11 @@ const validateDateNotInTheFuture = (selectedDate) => {
39476
39439
  return new Date(selectedDate) <= /* @__PURE__ */ new Date();
39477
39440
  };
39478
39441
  const highExposureCompanyDetailsValidations = {
39442
+ legalForm: {
39443
+ modes: ["blur"],
39444
+ validate: (legalName) => !isEmpty$1(legalName),
39445
+ errorMessage: "fieldIsRequired"
39446
+ },
39479
39447
  numberOfEmployees: [
39480
39448
  {
39481
39449
  modes: ["blur"],
@@ -39580,7 +39548,11 @@ const highExposureCompanyDetailsValidations = {
39580
39548
  ]
39581
39549
  };
39582
39550
  const highExposureParentCompaniesDetailsValidations = {
39583
- // console.log('highExposureParentCompaniesDetailsValidations')
39551
+ legalForm: {
39552
+ modes: ["blur"],
39553
+ validate: (legalName) => !isEmpty$1(legalName),
39554
+ errorMessage: "fieldIsRequired"
39555
+ },
39584
39556
  legalName: {
39585
39557
  modes: ["blur"],
39586
39558
  validate: (legalName) => !isEmpty$1(legalName),
@@ -39684,7 +39656,7 @@ const highExposureParentCompaniesDetailsValidations = {
39684
39656
  }
39685
39657
  ]
39686
39658
  };
39687
- const logger$c = createLogger("LegalFormField");
39659
+ const logger$d = createLogger("LegalFormField");
39688
39660
  function LegalFormField({
39689
39661
  name = "legalForm",
39690
39662
  data,
@@ -39722,7 +39694,7 @@ function LegalFormField({
39722
39694
  }));
39723
39695
  setLegalForms(legalFormsResponse);
39724
39696
  }
39725
- }).catch(() => logger$c.error);
39697
+ }).catch(() => logger$d.error);
39726
39698
  }, [countryCode]);
39727
39699
  return /* @__PURE__ */ jsx(
39728
39700
  Field,
@@ -39748,7 +39720,7 @@ function LegalFormField({
39748
39720
  }
39749
39721
  );
39750
39722
  }
39751
- const logger$b = createLogger("NaceCodeField");
39723
+ const logger$c = createLogger("NaceCodeField");
39752
39724
  function NaceCodeField({
39753
39725
  name = "naceCode",
39754
39726
  data,
@@ -39768,7 +39740,7 @@ function NaceCodeField({
39768
39740
  if (response) {
39769
39741
  setNaceCodes(response);
39770
39742
  }
39771
- }).catch(() => logger$b.error);
39743
+ }).catch(() => logger$c.error);
39772
39744
  }, []);
39773
39745
  const handleChangeForNaceCode = (e) => {
39774
39746
  var _a;
@@ -40035,6 +40007,7 @@ function HighExposureFinancialInformation({
40035
40007
  name: "netAssets",
40036
40008
  label: formUtils.getLabel("netAssets", "totalAssets"),
40037
40009
  helper: i18n.get("totalAssetsHelper"),
40010
+ errorMessage: formUtils.getErrorMessage("netAssets", errors, fieldProblems),
40038
40011
  children: (childProps) => /* @__PURE__ */ jsx(
40039
40012
  InputCurrency,
40040
40013
  {
@@ -40053,6 +40026,7 @@ function HighExposureFinancialInformation({
40053
40026
  name: "annualTurnover",
40054
40027
  label: formUtils.getLabel("annualTurnover", "annualTurnover"),
40055
40028
  helper: i18n.get("annualTurnoverHelper"),
40029
+ errorMessage: formUtils.getErrorMessage("annualTurnover", errors, fieldProblems),
40056
40030
  children: (childProps) => /* @__PURE__ */ jsx(
40057
40031
  InputCurrency,
40058
40032
  {
@@ -40776,7 +40750,7 @@ const FormEndState = ({
40776
40750
  );
40777
40751
  };
40778
40752
  const parseConfiguration = ({ matchingScenario }) => parseHighExposureScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION]);
40779
- const logger$a = createLogger("UpdateLegalEntityForHighExposure");
40753
+ const logger$b = createLogger("UpdateLegalEntityForHighExposure");
40780
40754
  const customLabels = {
40781
40755
  company: {
40782
40756
  legalForm: "businessStructure",
@@ -40897,7 +40871,7 @@ function UpdateLegalEntityForHighExposure({
40897
40871
  useEffect(() => {
40898
40872
  (async () => {
40899
40873
  await fetchLegalEntities();
40900
- })().catch(logger$a.error);
40874
+ })().catch(logger$b.error);
40901
40875
  }, [fetchLegalEntities]);
40902
40876
  const [data, setData] = useState(dataFromResponse);
40903
40877
  const [problems, setProblems] = useState(problemsProp ?? {});
@@ -41297,7 +41271,7 @@ function getContentByStatus(status) {
41297
41271
  return contentMap[status];
41298
41272
  }
41299
41273
  const FINAL_STATUSES = [OnboardingStatus.VERIFIED, OnboardingStatus.REJECTED];
41300
- const logger$9 = createLogger("ViewVerificationStatusComponent");
41274
+ const logger$a = createLogger("ViewVerificationStatusComponent");
41301
41275
  function ViewVerificationStatusComponent({
41302
41276
  legalEntityId,
41303
41277
  hideExplanation = false,
@@ -41316,12 +41290,12 @@ function ViewVerificationStatusComponent({
41316
41290
  if (!onboardingStatus) return;
41317
41291
  const statusContent = getContentByStatus(onboardingStatus);
41318
41292
  if (statusContent) return statusContent;
41319
- logger$9.error(`there is no content for status "${onboardingStatus}"`);
41293
+ logger$a.error(`there is no content for status "${onboardingStatus}"`);
41320
41294
  }, [onboardingStatus]);
41321
41295
  const handleError = useCallback(
41322
41296
  (rawError, userMessage) => {
41323
41297
  const error = coerceError(rawError);
41324
- logger$9.error(error);
41298
+ logger$a.error(error);
41325
41299
  setAlertContent(userMessage);
41326
41300
  onError == null ? void 0 : onError({
41327
41301
  error,
@@ -41355,7 +41329,7 @@ function ViewVerificationStatusComponent({
41355
41329
  });
41356
41330
  useEffect(() => {
41357
41331
  setAlertContent(void 0);
41358
- fetchOnboardingStatus().then(updateOnboardingStatus).catch(logger$9.error);
41332
+ fetchOnboardingStatus().then(updateOnboardingStatus).catch(logger$a.error);
41359
41333
  }, [fetchOnboardingStatus, updateOnboardingStatus]);
41360
41334
  const [loadingLinkStatus, setLinkLoadingStatus] = useState("success");
41361
41335
  const redirectToAdyen = async () => {
@@ -41550,40 +41524,43 @@ const getVersionConfiguration = async (context) => {
41550
41524
  }
41551
41525
  });
41552
41526
  };
41553
- const logger$8 = createLogger("UseVersionConfiguration");
41554
- const useVersionConfiguration = async (legalEntityId) => {
41555
- var _a, _b;
41527
+ const logger$9 = createLogger("UseVersionConfiguration");
41528
+ const useVersionConfiguration = (legalEntityId) => {
41556
41529
  const { isEmbeddedDropin, loadingContext: base } = useAuthContext();
41557
41530
  const { enableVersionExperiment } = useExperimentsContext();
41558
- const loadingContext = `${base}api/${COMPONENTS_API_VERSION}/`;
41559
- if (!isEmbeddedDropin) {
41560
- return;
41561
- }
41562
- try {
41563
- const versionConfiguration = await getVersionConfiguration({ loadingContext, legalEntityId });
41564
- (_b = (_a = versionConfiguration == null ? void 0 : versionConfiguration.features) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(_a, (feature) => {
41565
- enableVersionExperiment(feature);
41566
- });
41567
- } catch (e) {
41568
- logger$8.error("Failed to set version configuration", e);
41569
- }
41531
+ const loadingContext = `${base}api/${COMPONENTS_API_VERSION}/legalEntities/`;
41532
+ useEffect(() => {
41533
+ if (!isEmbeddedDropin) return;
41534
+ (async () => {
41535
+ var _a, _b;
41536
+ try {
41537
+ const versionConfiguration = await getVersionConfiguration({
41538
+ loadingContext,
41539
+ legalEntityId
41540
+ });
41541
+ (_b = (_a = versionConfiguration == null ? void 0 : versionConfiguration.features) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(_a, (feature) => enableVersionExperiment(feature));
41542
+ } catch (e) {
41543
+ logger$9.error("Failed to set version configuration", e);
41544
+ }
41545
+ })();
41546
+ }, [enableVersionExperiment, isEmbeddedDropin, legalEntityId, loadingContext]);
41570
41547
  };
41571
- const logger$7 = createLogger("loadCountries");
41548
+ const logger$8 = createLogger("loadCountries");
41572
41549
  const countriesImports = /* @__PURE__ */ Object.assign({ "./de-DE.json": () => import("./de-DE-Cx8Uim1K.js"), "./el-GR.json": () => import("./el-GR-B7_JR3z5.js"), "./en-US.json": () => import("./en-US-CkdCbOCX.js"), "./es-ES.json": () => import("./es-ES-NBv3HHhn.js"), "./fr-FR.json": () => import("./fr-FR-DdSVMVsp.js"), "./it-IT.json": () => import("./it-IT-Bwdk3zuj.js"), "./ja-JP.json": () => import("./ja-JP-Bsvzm8zu.js"), "./nl-NL.json": () => import("./nl-NL-DofKaNkk.js"), "./pt-PT.json": () => import("./pt-PT-DFEvMD1M.js"), "./ru-RU.json": () => import("./ru-RU-PiM0ZI5h.js"), "./sv-SE.json": () => import("./sv-SE-C0GoLwTg.js"), "./zh-CN.json": () => import("./zh-CN-DJs6Hct-.js"), "./zh-TW.json": () => import("./zh-TW-BWhLbns8.js") });
41573
41550
  const loadCountriesDataset = async (locale) => {
41574
41551
  const importForLocale = countriesImports[`./${locale}.json`];
41575
41552
  if (!importForLocale) {
41576
- logger$7.warn(`No countries dataset for ${locale}, falling back to en-US`);
41553
+ logger$8.warn(`No countries dataset for ${locale}, falling back to en-US`);
41577
41554
  return (await import("./en-US-CkdCbOCX.js")).default;
41578
41555
  }
41579
41556
  return (await importForLocale()).default;
41580
41557
  };
41581
- const logger$6 = createLogger("loadStates");
41558
+ const logger$7 = createLogger("loadStates");
41582
41559
  const statesImports = /* @__PURE__ */ Object.assign({ "./AU/en-US.json": () => import("./en-US-CQv3D6--.js"), "./BR/en-US.json": () => import("./en-US-eaysbh-g.js"), "./BR/pt-BR.json": () => import("./pt-BR-CNtbeGFJ.js"), "./CA/en-US.json": () => import("./en-US-gM26UC0X.js"), "./NZ/en-US.json": () => import("./en-US-CLmaFLwu.js"), "./US/en-US.json": () => import("./en-US-7uBFgKyC.js") });
41583
41560
  const loadStatesDataset = async (country, locale) => {
41584
41561
  const importForLocale = statesImports[`./${country}/${locale}.json`];
41585
41562
  if (!importForLocale) {
41586
- logger$6.warn(`No ${country} states dataset for ${locale}, falling back to en-US`);
41563
+ logger$7.warn(`No ${country} states dataset for ${locale}, falling back to en-US`);
41587
41564
  const fallbackImport = statesImports[`./${country}/en-US.json`];
41588
41565
  return (await fallbackImport()).default;
41589
41566
  }
@@ -41719,7 +41696,7 @@ const validatePhoneNumber$1 = async (context, phoneNumber) => {
41719
41696
  { number: phoneNumber }
41720
41697
  );
41721
41698
  };
41722
- const logger$5 = createLogger("verify-id-number");
41699
+ const logger$6 = createLogger("verify-id-number");
41723
41700
  const verifyIdNumber$1 = async (context, request) => {
41724
41701
  const { loadingContext, legalEntityId } = context;
41725
41702
  try {
@@ -41742,13 +41719,13 @@ const verifyIdNumber$1 = async (context, request) => {
41742
41719
  if (responseData.status === 500) {
41743
41720
  return { status: 500, message: "Service did not respond, do not block verification" };
41744
41721
  }
41745
- return logger$5.warn(`Unexpected response status ${responseData.status}`);
41722
+ return logger$6.warn(`Unexpected response status ${responseData.status}`);
41746
41723
  }
41747
41724
  },
41748
41725
  request
41749
41726
  );
41750
41727
  } catch (e) {
41751
- logger$5.warn("WARNING: idNumber verification failed - error:", e);
41728
+ logger$6.warn("WARNING: idNumber verification failed - error:", e);
41752
41729
  }
41753
41730
  };
41754
41731
  const getEmbeddedApi = ({
@@ -41847,7 +41824,7 @@ const validatePhoneNumber = async (context, phoneNumber) => {
41847
41824
  { number: phoneNumber }
41848
41825
  );
41849
41826
  };
41850
- const logger$4 = createLogger("verify-id-number");
41827
+ const logger$5 = createLogger("verify-id-number");
41851
41828
  const verifyIdNumber = async (context, request) => {
41852
41829
  const { loadingContext, clientKey } = context;
41853
41830
  try {
@@ -41865,7 +41842,7 @@ const verifyIdNumber = async (context, request) => {
41865
41842
  if (responseData.status === 500) {
41866
41843
  return { status: 500, message: "Service did not respond, do not block verification" };
41867
41844
  }
41868
- return logger$4.warn(`Unexpected response status ${responseData.status}`);
41845
+ return logger$5.warn(`Unexpected response status ${responseData.status}`);
41869
41846
  },
41870
41847
  path: "v1/verification/idNumber",
41871
41848
  clientKey
@@ -41873,7 +41850,7 @@ const verifyIdNumber = async (context, request) => {
41873
41850
  request
41874
41851
  );
41875
41852
  } catch (e) {
41876
- logger$4.warn("WARNING: idNumber verification failed - error:", e);
41853
+ logger$5.warn("WARNING: idNumber verification failed - error:", e);
41877
41854
  }
41878
41855
  };
41879
41856
  const getKycExternalApi = ({
@@ -41902,7 +41879,7 @@ const ConfigurationApiProvider = ({
41902
41879
  }) => {
41903
41880
  const authContext = useAuthContext();
41904
41881
  const { isEmbeddedDropin, loadingContext } = authContext;
41905
- const sdkVersion = "3.37.0";
41882
+ const sdkVersion = "3.38.0";
41906
41883
  useAnalytics({
41907
41884
  onUserEvent,
41908
41885
  legalEntityId: rootLegalEntityId,
@@ -41933,6 +41910,19 @@ const useAccountHolder = (legalEntityId) => {
41933
41910
  setAccountHolder: setAccountHolderIntoLocalStorage
41934
41911
  };
41935
41912
  };
41913
+ const logger$4 = createLogger("useAllowedCountries");
41914
+ const useAllowedCountries = () => {
41915
+ const acceptedCountries = useSetting("acceptedCountries");
41916
+ const { getAllowedCountries: getAllowedCountries2 } = useConfigurationApi();
41917
+ const [allowedCountries, setAllowedCountries] = useState(
41918
+ acceptedCountries
41919
+ );
41920
+ useEffect(() => {
41921
+ if (acceptedCountries !== void 0) return;
41922
+ getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$4.error);
41923
+ }, [acceptedCountries]);
41924
+ return allowedCountries;
41925
+ };
41936
41926
  const logger$3 = createLogger("CoreProvider");
41937
41927
  const CoreProvider = ({
41938
41928
  contextCountry: initialContextCountry,
@@ -41968,9 +41958,18 @@ const CoreProvider = ({
41968
41958
  idVerificationProviderId,
41969
41959
  setIdVerificationProviderId,
41970
41960
  setIsModalView,
41971
- isModalView
41961
+ isModalView,
41962
+ allowedCountries
41972
41963
  }),
41973
- [contextCountry, accountHolder, accountFormat, idVerificationProviderId, isModalView]
41964
+ [
41965
+ contextCountry,
41966
+ accountHolder,
41967
+ setAccountHolder,
41968
+ accountFormat,
41969
+ idVerificationProviderId,
41970
+ isModalView,
41971
+ allowedCountries
41972
+ ]
41974
41973
  );
41975
41974
  return /* @__PURE__ */ jsx(CoreContext.Provider, { value: contextValue, children });
41976
41975
  };
@@ -42573,7 +42572,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
42573
42572
  };
42574
42573
  const copyToClipboard = async () => {
42575
42574
  const toCopy = {
42576
- sdkVersion: "3.37.0",
42575
+ sdkVersion: "3.38.0",
42577
42576
  experiments: Object.fromEntries(allExperimentsWithValues),
42578
42577
  settings: Object.fromEntries(allSettingsWithValues)
42579
42578
  };
@@ -42638,7 +42637,7 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
42638
42637
  /* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__meta", children: /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsxs("tbody", { children: [
42639
42638
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
42640
42639
  /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "SDK version" }),
42641
- /* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "3.37.0" })
42640
+ /* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "3.38.0" })
42642
42641
  ] }) }),
42643
42642
  /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
42644
42643
  /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "rootLegalEntityId" }),