@adyen/kyc-components 3.34.0 → 3.35.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.
Files changed (114) hide show
  1. package/dist/es/adyen-kyc-components.es.js +1303 -1040
  2. package/dist/es/hide-CWI5yHxd.js +9 -0
  3. package/dist/es/show-Cm_JGm0K.js +8 -0
  4. package/dist/style.css +46 -28
  5. package/dist/types/components/AdditionalInformation/types.d.ts +1 -1
  6. package/dist/types/components/BankDocument/types.d.ts +1 -1
  7. package/dist/types/components/BankVerification/types.d.ts +1 -9
  8. package/dist/types/components/BankVerification/verification/widget/component/BankVerificationWidget.d.ts +7 -19
  9. package/dist/types/components/BasicInformation/types.d.ts +1 -1
  10. package/dist/types/components/BusinessDetails/types.d.ts +1 -1
  11. package/dist/types/components/Company/types.d.ts +1 -1
  12. package/dist/types/components/CompanyNameAndCountry/types.d.ts +1 -1
  13. package/dist/types/components/CompanyRegistrationDetails/types.d.ts +1 -1
  14. package/dist/types/components/CompanyStructure/types.d.ts +1 -1
  15. package/dist/types/components/CompanyType/types.d.ts +1 -1
  16. package/dist/types/components/ContactDetails/types.d.ts +1 -1
  17. package/dist/types/components/DocumentUpload/types.d.ts +1 -1
  18. package/dist/types/components/Dropins/BusinessDetailsDropin/utils.d.ts +1 -1
  19. package/dist/types/components/Dropins/HighExposureDropin/types.d.ts +1 -1
  20. package/dist/types/components/Dropins/RoleAndTypeDropin/components/formatRoleAndEntityTypeSummary.d.ts +5 -0
  21. package/dist/types/components/Dropins/types.d.ts +2 -1
  22. package/dist/types/components/FinancialInformation/formatFinancialInformationSummary.d.ts +4 -0
  23. package/dist/types/components/FinancialInformation/types.d.ts +2 -1
  24. package/dist/types/components/IdDocumentUpload/types.d.ts +3 -3
  25. package/dist/types/components/IdVerification/types.d.ts +3 -3
  26. package/dist/types/components/IdVerificationMethod/types.d.ts +3 -3
  27. package/dist/types/components/IdentityNumber/type.d.ts +1 -1
  28. package/dist/types/components/Individual/component/IndividualComponent.d.ts +1 -2
  29. package/dist/types/components/Individual/types.d.ts +1 -1
  30. package/dist/types/components/PayoutAccount/types.d.ts +4 -3
  31. package/dist/types/components/PayoutDetails/component/PayoutDetailsComponent.d.ts +1 -4
  32. package/dist/types/components/PayoutDetails/rules.d.ts +1 -0
  33. package/dist/types/components/PayoutDetails/types.d.ts +1 -1
  34. package/dist/types/components/PayoutVerificationMethod/component/PayoutVerificationMethod.d.ts +2 -1
  35. package/dist/types/components/PayoutVerificationMethod/component/PreferInstantVerificationMethod/PreferInstantVerificationMethod.d.ts +16 -3
  36. package/dist/types/components/PayoutVerificationMethod/types.d.ts +13 -4
  37. package/dist/types/components/PersonalDetails/component/IdentityComponent/types.d.ts +1 -1
  38. package/dist/types/components/PersonalDetails/types.d.ts +3 -4
  39. package/dist/types/components/RegistrationAddress/types.d.ts +1 -1
  40. package/dist/types/components/SingpassSelection/types.d.ts +1 -1
  41. package/dist/types/components/SoleProp/component/SolePropComponent.d.ts +8 -0
  42. package/dist/types/components/SoleProp/types.d.ts +3 -1
  43. package/dist/types/components/Trust/types.d.ts +1 -1
  44. package/dist/types/components/TrustRegistrationDetails/types.d.ts +1 -1
  45. package/dist/types/components/TrustRoleAndEntityType/types.d.ts +1 -1
  46. package/dist/types/components/embedded-ui/EmbeddedStatus/EmbeddedStatus.d.ts +4 -4
  47. package/dist/types/components/internal/Address/types.d.ts +1 -1
  48. package/dist/types/components/internal/Alert/components/VerificationErrorAlert.d.ts +0 -1
  49. package/dist/types/components/internal/BankAccountNumber/types.d.ts +1 -1
  50. package/dist/types/components/internal/BankCity/types.d.ts +1 -1
  51. package/dist/types/components/internal/BankCode/types.d.ts +1 -1
  52. package/dist/types/components/internal/BankName/types.d.ts +1 -1
  53. package/dist/types/components/internal/BranchCode/types.d.ts +1 -1
  54. package/dist/types/components/internal/BusinessNameField/types.d.ts +1 -1
  55. package/dist/types/components/internal/BusinessRegistrationNumber/types.d.ts +1 -1
  56. package/dist/types/components/internal/CountryField/types.d.ts +1 -5
  57. package/dist/types/components/internal/CountryOfGoverningLawField/types.d.ts +1 -1
  58. package/dist/types/components/internal/Currency/types.d.ts +1 -1
  59. package/dist/types/components/internal/DBANameField/types.d.ts +1 -1
  60. package/dist/types/components/internal/DecisionMakerRole/types.d.ts +1 -1
  61. package/dist/types/components/internal/FinancialReportingDate/types.d.ts +1 -1
  62. package/dist/types/components/internal/FormFields/InputDate/utils.d.ts +4 -5
  63. package/dist/types/components/internal/FormFields/MaskedInputText/MaskedInputText.d.ts +1 -1
  64. package/dist/types/components/internal/FormFields/Select/types.d.ts +0 -1
  65. package/dist/types/components/internal/FormFields/utils.d.ts +1 -2
  66. package/dist/types/components/internal/Iban/types.d.ts +1 -1
  67. package/dist/types/components/internal/LegalFormField/LegalFormField.d.ts +1 -2
  68. package/dist/types/components/internal/LegalFormField/types.d.ts +3 -2
  69. package/dist/types/components/internal/NaceCodeField/NaceCodeField.d.ts +1 -2
  70. package/dist/types/components/internal/NaceCodeField/types.d.ts +3 -2
  71. package/dist/types/components/internal/Name/types.d.ts +1 -1
  72. package/dist/types/components/internal/NumberOfEmployees/types.d.ts +1 -1
  73. package/dist/types/components/internal/PhoneInput/types.d.ts +1 -1
  74. package/dist/types/components/internal/StateField/types.d.ts +1 -1
  75. package/dist/types/components/internal/StockTickerSymbol/types.d.ts +1 -1
  76. package/dist/types/components/internal/Summary/Summary.d.ts +1 -2
  77. package/dist/types/components/internal/Summary/summaryItem.d.ts +11 -0
  78. package/dist/types/components/internal/Summary/types.d.ts +5 -2
  79. package/dist/types/components/internal/Svg/svgs.d.ts +2 -0
  80. package/dist/types/components/internal/SwiftCode/types.d.ts +1 -1
  81. package/dist/types/components/internal/TaxId/types.d.ts +1 -1
  82. package/dist/types/core/Context/ExperimentContext/types.d.ts +3 -1
  83. package/dist/types/core/Services/componentApi/get-bankVerification-vendor.d.ts +2 -1
  84. package/dist/types/core/hooks/useBusinessData/constants.d.ts +0 -2
  85. package/dist/types/core/models/api/legal-arrangement.d.ts +2 -1
  86. package/dist/types/core/models/company.d.ts +0 -3
  87. package/dist/types/core/models/country-config.d.ts +1 -1
  88. package/dist/types/core/models/errors/error-message.d.ts +0 -5
  89. package/dist/types/core/models/errors/maintenance-mode-error.d.ts +0 -6
  90. package/dist/types/core/models/identity.d.ts +6 -0
  91. package/dist/types/core/models/province-code.d.ts +2 -1
  92. package/dist/types/core/process-field-configurations.d.ts +1 -1
  93. package/dist/types/utils/entity-association-util.d.ts +1 -8
  94. package/dist/types/utils/formUtils.d.ts +1 -1
  95. package/dist/types/utils/get-props.d.ts +1 -1
  96. package/dist/types/utils/isEmpty.d.ts +1 -1
  97. package/dist/types/utils/logger.d.ts +0 -1
  98. package/dist/types/utils/perState.d.ts +0 -3
  99. package/dist/types/utils/validation/ValidationResult.d.ts +0 -2
  100. package/dist/types/utils/validation/types.d.ts +2 -16
  101. package/package.json +1 -1
  102. package/dist/types/components/internal/BankAccountNumber/index.d.ts +0 -1
  103. package/dist/types/components/internal/BankCity/index.d.ts +0 -1
  104. package/dist/types/components/internal/BankCode/index.d.ts +0 -1
  105. package/dist/types/components/internal/BankName/index.d.ts +0 -1
  106. package/dist/types/components/internal/BranchCode/index.d.ts +0 -1
  107. package/dist/types/components/internal/BusinessRegistrationNumber/index.d.ts +0 -1
  108. package/dist/types/components/internal/Iban/index.d.ts +0 -1
  109. package/dist/types/components/internal/Name/index.d.ts +0 -1
  110. package/dist/types/components/internal/SwiftCode/index.d.ts +0 -1
  111. package/dist/types/core/Services/componentApi/index.d.ts +0 -19
  112. package/dist/types/core/Services/kycExternalApi/index.d.ts +0 -6
  113. package/dist/types/core/hooks/useForm/index.d.ts +0 -3
  114. package/dist/types/utils/regex/index.d.ts +0 -7
@@ -85,9 +85,6 @@ const defaultTrans = {
85
85
  accountCantBeSetUp: "Your account can't be set up as your information couldn't be verified. To find out more, reach out to customer support.",
86
86
  accountDetailsDescription: "Provide a few details about you to start accepting live payments.",
87
87
  accountHolder: "Account holder",
88
- accountHolderDescriptionCompany: "The bank account holder has to have the same name as your company.",
89
- accountHolderDescriptionIndividual: "This should be you, since the bank account has to be in your name",
90
- accountHolderDescriptionSoleProp: " The bank account holder has to have the same name as your sole proprietorship",
91
88
  accountHolderTerms: "Account Holder Terms",
92
89
  accountName: "Account name",
93
90
  accountNumber: "Account number",
@@ -1749,7 +1746,7 @@ const useCoreContext = () => {
1749
1746
  if (!context) throw Error("You need a <CoreProvider> to use core context");
1750
1747
  return context;
1751
1748
  };
1752
- let suppressed = false;
1749
+ const suppressed = false;
1753
1750
  const consoleMethodsPrefixable = Object.freeze([
1754
1751
  "debug",
1755
1752
  "info",
@@ -1853,7 +1850,7 @@ const KNOWN_DISALLOWED_INDEX_DATASET_STATES = [
1853
1850
  StateCodesUS.California,
1854
1851
  StateCodesUS.Texas
1855
1852
  ];
1856
- const logger$K = createLogger("useBusinessData");
1853
+ const logger$L = createLogger("useBusinessData");
1857
1854
  function useBusinessData({
1858
1855
  handleCompanyIndexSearch,
1859
1856
  handleCompanyDeepSearch,
@@ -1891,7 +1888,7 @@ function useBusinessData({
1891
1888
  try {
1892
1889
  setSearching("loading");
1893
1890
  if (!handleCompanyDeepSearch || !handleCompanyIndexSearch) {
1894
- logger$K.error("Missing handlers for searchForBusiness");
1891
+ logger$L.error("Missing handlers for searchForBusiness");
1895
1892
  setSearchResults([]);
1896
1893
  return [];
1897
1894
  }
@@ -1914,7 +1911,7 @@ function useBusinessData({
1914
1911
  return response == null ? void 0 : response.results;
1915
1912
  } catch (e) {
1916
1913
  setSearching("error");
1917
- logger$K.error(e);
1914
+ logger$L.error(e);
1918
1915
  } finally {
1919
1916
  setCachedSearch(data);
1920
1917
  setSearching((prevState) => prevState !== "error" ? "loaded" : prevState);
@@ -1925,7 +1922,7 @@ function useBusinessData({
1925
1922
  const fetchBusinessData = useCallback(
1926
1923
  async (company, state) => {
1927
1924
  if (!handleGetCompanyDataset || !handleRefreshCompanyDataset) {
1928
- logger$K.error("Missing handlers for fetchBusinessData");
1925
+ logger$L.error("Missing handlers for fetchBusinessData");
1929
1926
  return;
1930
1927
  }
1931
1928
  const date = (/* @__PURE__ */ new Date()).toDateString();
@@ -1935,7 +1932,7 @@ function useBusinessData({
1935
1932
  setVerifying("idle");
1936
1933
  setInvalidTin(false);
1937
1934
  if (state) {
1938
- const businessData2 = isDataCompliant && !KNOWN_DISALLOWED_INDEX_DATASET_STATES.includes(state) ? await handleGetCompanyDataset({
1935
+ return isDataCompliant && !KNOWN_DISALLOWED_INDEX_DATASET_STATES.includes(state) ? await handleGetCompanyDataset({
1939
1936
  companyId: company.id,
1940
1937
  country: "US",
1941
1938
  state
@@ -1944,19 +1941,17 @@ function useBusinessData({
1944
1941
  country: "US",
1945
1942
  state
1946
1943
  });
1947
- return businessData2;
1948
1944
  }
1949
- const businessData = isDataCompliant ? await handleGetCompanyDataset({
1945
+ return isDataCompliant ? await handleGetCompanyDataset({
1950
1946
  companyId: company.id,
1951
1947
  country: "US"
1952
1948
  }) : await handleRefreshCompanyDataset({
1953
1949
  companyId: company.id,
1954
1950
  country: "US"
1955
1951
  });
1956
- return businessData;
1957
1952
  } catch (e) {
1958
1953
  setFetching("error");
1959
- logger$K.error(e);
1954
+ logger$L.error(e);
1960
1955
  } finally {
1961
1956
  setFetching((prevState) => prevState !== "error" ? "loaded" : prevState);
1962
1957
  }
@@ -1966,7 +1961,7 @@ function useBusinessData({
1966
1961
  const verifyBusinessData = useCallback(
1967
1962
  async (data, tin) => {
1968
1963
  if (!handleVerifyTin) {
1969
- logger$K.log("Missing handlers for verifyBusinessData");
1964
+ logger$L.log("Missing handlers for verifyBusinessData");
1970
1965
  return;
1971
1966
  }
1972
1967
  try {
@@ -1982,7 +1977,7 @@ function useBusinessData({
1982
1977
  return matched;
1983
1978
  } catch (e) {
1984
1979
  setVerifying("error");
1985
- logger$K.error(e);
1980
+ logger$L.error(e);
1986
1981
  } finally {
1987
1982
  setVerifying((prevState) => prevState !== "error" ? "loaded" : prevState);
1988
1983
  }
@@ -1995,7 +1990,7 @@ function useBusinessData({
1995
1990
  await (handleClearCompanyData == null ? void 0 : handleClearCompanyData());
1996
1991
  } catch (e) {
1997
1992
  setResettingTrustedData("error");
1998
- logger$K.error(e);
1993
+ logger$L.error(e);
1999
1994
  } finally {
2000
1995
  setResettingTrustedData((prevState) => prevState !== "error" ? "loaded" : prevState);
2001
1996
  }
@@ -2265,6 +2260,7 @@ const svgs = {
2265
2260
  "field-error": lazy(
2266
2261
  () => import("./warning-circle-fill-FaaY90uz.js")
2267
2262
  ),
2263
+ hide: lazy(() => import("./hide-CWI5yHxd.js")),
2268
2264
  "info-circle": lazy(() => import("./info-B_8Cr-vS.js")),
2269
2265
  image: lazy(() => import("./image-Ol9hzDvF.js")),
2270
2266
  "light-bulb": lazy(() => import("./idea-CtaTpGVP.js")),
@@ -2280,6 +2276,7 @@ const svgs = {
2280
2276
  remove: lazy(() => import("./cross-circle-fill-small-ChSvrRGZ.js")),
2281
2277
  save: lazy(() => import("./save-BueTh8B0.js")),
2282
2278
  search: lazy(() => import("./search-BvJVZbOV.js")),
2279
+ show: lazy(() => import("./show-Cm_JGm0K.js")),
2283
2280
  store: lazy(() => import("./store-BLl8m644.js")),
2284
2281
  trust: lazy(() => import("./partner-B9xMZpSw.js")),
2285
2282
  user: lazy(() => import("./person-lPJ07vyF.js")),
@@ -2398,12 +2395,12 @@ const unscalableIconNames = [
2398
2395
  "upload",
2399
2396
  "warning"
2400
2397
  ];
2401
- const logger$J = createLogger("Icon");
2398
+ const logger$K = createLogger("Icon");
2402
2399
  const Svg = ({ className, name, testId, alt, type }) => {
2403
2400
  const LazyLoadedSvg = svgs[name];
2404
2401
  const viewBox = unscalableIconNames.includes(name) ? "0 0 16 16" : void 0;
2405
2402
  if (!LazyLoadedSvg) {
2406
- logger$J.error(`No such svg: "${name}"`);
2403
+ logger$K.error(`No such svg: "${name}"`);
2407
2404
  return null;
2408
2405
  }
2409
2406
  return /* @__PURE__ */ jsx("span", { className: cx(`adyen-kyc-${type}`, className), "data-testid": testId, children: /* @__PURE__ */ jsx(Suspense, { fallback: null, children: viewBox ? /* @__PURE__ */ jsx(LazyLoadedSvg, { alt, "aria-hidden": type === "icon", viewBox }) : /* @__PURE__ */ jsx(LazyLoadedSvg, { alt, "aria-hidden": type === "icon" }) }) });
@@ -2641,10 +2638,10 @@ function useFormRouterContext() {
2641
2638
  }
2642
2639
  return context;
2643
2640
  }
2644
- const logger$I = createLogger("Link");
2641
+ const logger$J = createLogger("Link");
2645
2642
  const isValidLink = (href) => {
2646
2643
  if (href === "#") {
2647
- logger$I.error(
2644
+ logger$J.error(
2648
2645
  'Links must include a valid href. If your href is "#", consider using a Button instead'
2649
2646
  );
2650
2647
  return false;
@@ -2912,7 +2909,9 @@ var ExperimentNames = /* @__PURE__ */ ((ExperimentNames2) => {
2912
2909
  ExperimentNames2["EnableMinimalRegistrationNumberValidationForAuIncorporatedAssociation"] = "EnableMinimalRegistrationNumberValidationForAuIncorporatedAssociation";
2913
2910
  ExperimentNames2["EnableFinancialInformationComponentV4"] = "EnableFinancialInformationComponentV4";
2914
2911
  ExperimentNames2["EnablePreferInstantVerificationFlow"] = "EnablePreferInstantVerificationFlow";
2912
+ ExperimentNames2["EnablePhoneFieldScenario"] = "EnablePhoneFieldScenario";
2915
2913
  ExperimentNames2["EnableAUIncorporatedPartnershipSkipRegistrationNumber"] = "EnableAUIncorporatedPartnershipSkipRegistrationNumber";
2914
+ ExperimentNames2["EnableCompanyTrusteeSkipABN"] = "EnableCompanyTrusteeSkipABN";
2916
2915
  return ExperimentNames2;
2917
2916
  })(ExperimentNames || {});
2918
2917
  const debounce = (func, delay) => {
@@ -2980,7 +2979,7 @@ const useSetting = (settingName) => {
2980
2979
  const { getSetting } = context;
2981
2980
  return getSetting(settingName);
2982
2981
  };
2983
- const logger$H = createLogger("useAllowedCountries");
2982
+ const logger$I = createLogger("useAllowedCountries");
2984
2983
  const useAllowedCountries = () => {
2985
2984
  const acceptedCountries = useSetting("acceptedCountries");
2986
2985
  const { getAllowedCountries: getAllowedCountries2 } = useConfigurationApi();
@@ -2989,7 +2988,7 @@ const useAllowedCountries = () => {
2989
2988
  );
2990
2989
  useEffect(() => {
2991
2990
  if (acceptedCountries !== void 0) return;
2992
- getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$H.error);
2991
+ getAllowedCountries2().then((response) => setAllowedCountries(response.countries)).catch(logger$I.error);
2993
2992
  }, [acceptedCountries]);
2994
2993
  return allowedCountries;
2995
2994
  };
@@ -3009,11 +3008,72 @@ class ValidationResult {
3009
3008
  getError() {
3010
3009
  return this.validationResults.find((result) => result.hasError);
3011
3010
  }
3012
- /** Returns all validation results that returned an error */
3013
- getAllErrors() {
3014
- return this.validationResults.filter((result) => result.hasError);
3015
- }
3016
3011
  }
3012
+ const logger$H = createLogger("useAsyncValidator");
3013
+ const useAsyncValidator = (asyncRules) => {
3014
+ const [asyncValidationResults, setAsyncValidationResults] = useState({});
3015
+ const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
3016
+ const triggerAsyncValidation = useCallback(
3017
+ (field, formState, mode) => {
3018
+ if (!asyncRules) return clearAsyncValidationResults();
3019
+ const rule = asyncRules[field];
3020
+ if (!rule || !rule.modes.includes(mode)) return clearAsyncValidationResults();
3021
+ const value = formState.data[field];
3022
+ return rule.asyncValidate(formState.data[field], { state: formState }).then((isValid) => {
3023
+ setAsyncValidationResults({
3024
+ [field]: new ValidationResult([
3025
+ {
3026
+ isValid,
3027
+ errorMessage: typeof rule.errorMessage === "function" ? rule.errorMessage(value, { state: formState }) : rule.errorMessage,
3028
+ hasError: !isValid
3029
+ }
3030
+ ])
3031
+ });
3032
+ }).catch(logger$H.error);
3033
+ },
3034
+ [asyncRules, clearAsyncValidationResults]
3035
+ );
3036
+ return {
3037
+ asyncValidationResults,
3038
+ triggerAsyncValidation,
3039
+ clearAsyncValidationResults
3040
+ };
3041
+ };
3042
+ const useStaticValidator = (rules2) => {
3043
+ const getRulesForField = useCallback(
3044
+ (field) => {
3045
+ const fallbackRule = {
3046
+ validate: () => true,
3047
+ modes: ["blur", "input"]
3048
+ };
3049
+ const fieldRules = (rules2 == null ? void 0 : rules2[field]) ?? [fallbackRule];
3050
+ return Array.isArray(fieldRules) ? fieldRules : [fieldRules];
3051
+ },
3052
+ [rules2]
3053
+ );
3054
+ const triggerStaticValidation = useCallback(
3055
+ ({ key, value, mode = "blur" }, context) => {
3056
+ var _a, _b;
3057
+ const fieldRules = getRulesForField(key);
3058
+ const isFieldOptional = !!((_a = context == null ? void 0 : context.state.optionalFields) == null ? void 0 : _a.includes(key));
3059
+ const isFieldObscured = !!((_b = context == null ? void 0 : context.state.obscuredFields) == null ? void 0 : _b.includes(key));
3060
+ const validationRulesResult = fieldRules.map((rule) => {
3061
+ const shouldValidate = rule.modes.includes(mode) && !isFieldObscured;
3062
+ const isValid = isFieldOptional && isEmpty$1(value) ? true : rule.validate(value, context);
3063
+ return {
3064
+ isValid,
3065
+ errorMessage: typeof rule.errorMessage === "function" ? rule.errorMessage(value, context) : rule.errorMessage,
3066
+ hasError: shouldValidate && !isValid
3067
+ };
3068
+ });
3069
+ return new ValidationResult(validationRulesResult);
3070
+ },
3071
+ [getRulesForField]
3072
+ );
3073
+ return {
3074
+ triggerStaticValidation
3075
+ };
3076
+ };
3017
3077
  const processField = ({
3018
3078
  key,
3019
3079
  value = null,
@@ -3329,71 +3389,6 @@ function reducer({
3329
3389
  }
3330
3390
  };
3331
3391
  }
3332
- const logger$G = createLogger("useAsyncValidator");
3333
- const useAsyncValidator = (asyncRules) => {
3334
- const [asyncValidationResults, setAsyncValidationResults] = useState({});
3335
- const clearAsyncValidationResults = useCallback(() => setAsyncValidationResults({}), []);
3336
- const triggerAsyncValidation = useCallback(
3337
- (field, formState, mode) => {
3338
- if (!asyncRules) return clearAsyncValidationResults();
3339
- const rule = asyncRules[field];
3340
- if (!rule || !rule.modes.includes(mode)) return clearAsyncValidationResults();
3341
- const value = formState.data[field];
3342
- return rule.asyncValidate(formState.data[field], { state: formState }).then((isValid) => {
3343
- setAsyncValidationResults({
3344
- [field]: new ValidationResult([
3345
- {
3346
- isValid,
3347
- errorMessage: typeof rule.errorMessage === "function" ? rule.errorMessage(value, { state: formState }) : rule.errorMessage,
3348
- hasError: !isValid
3349
- }
3350
- ])
3351
- });
3352
- }).catch(logger$G.error);
3353
- },
3354
- [asyncRules, clearAsyncValidationResults]
3355
- );
3356
- return {
3357
- asyncValidationResults,
3358
- triggerAsyncValidation,
3359
- clearAsyncValidationResults
3360
- };
3361
- };
3362
- const useStaticValidator = (rules2) => {
3363
- const getRulesForField = useCallback(
3364
- (field) => {
3365
- const fallbackRule = {
3366
- validate: () => true,
3367
- modes: ["blur", "input"]
3368
- };
3369
- const fieldRules = (rules2 == null ? void 0 : rules2[field]) ?? [fallbackRule];
3370
- return Array.isArray(fieldRules) ? fieldRules : [fieldRules];
3371
- },
3372
- [rules2]
3373
- );
3374
- const triggerStaticValidation = useCallback(
3375
- ({ key, value, mode = "blur" }, context) => {
3376
- var _a, _b;
3377
- const fieldRules = getRulesForField(key);
3378
- const isFieldOptional = !!((_a = context == null ? void 0 : context.state.optionalFields) == null ? void 0 : _a.includes(key));
3379
- const isFieldObscured = !!((_b = context == null ? void 0 : context.state.obscuredFields) == null ? void 0 : _b.includes(key));
3380
- const validationRulesResult = fieldRules.map((rule) => {
3381
- const shouldValidate = rule.modes.includes(mode) && !isFieldObscured;
3382
- const isValid = isFieldOptional && isEmpty$1(value) ? true : rule.validate(value, context);
3383
- return {
3384
- isValid,
3385
- errorMessage: typeof rule.errorMessage === "function" ? rule.errorMessage(value, context) : rule.errorMessage,
3386
- hasError: shouldValidate && !isValid
3387
- };
3388
- });
3389
- return new ValidationResult(validationRulesResult);
3390
- },
3391
- [getRulesForField]
3392
- );
3393
- return {
3394
- triggerStaticValidation
3395
- };
3396
- };
3397
3392
  const mergeStaticAndAsyncErrorsState = (staticValidationErrors, asyncValidationErrors, schema, optionalFields) => {
3398
3393
  const fields = optionalFields ? [...schema, ...optionalFields] : schema;
3399
3394
  if (!fields.length) return staticValidationErrors;
@@ -5258,11 +5253,15 @@ var CompanyTypesValue = /* @__PURE__ */ ((CompanyTypesValue2) => {
5258
5253
  CompanyTypesValue2["SOLE_PROPRIETORSHIP"] = "soleProprietorship";
5259
5254
  return CompanyTypesValue2;
5260
5255
  })(CompanyTypesValue || {});
5261
- const isEmpty = (obj) => {
5262
- if ((obj == null ? void 0 : obj.length) || (obj == null ? void 0 : obj.size)) return false;
5263
- if (typeof obj !== "object") return true;
5264
- for (const key in obj) if (Object.hasOwn(obj, key)) return false;
5265
- return true;
5256
+ const isEmpty = (obj, ignoreEmptyProperties = true) => {
5257
+ if (obj === null || obj === void 0) return true;
5258
+ if (Array.isArray(obj)) return obj.length === 0;
5259
+ if (typeof obj !== "object") return false;
5260
+ return keysOf(obj).every(
5261
+ (key) => !Object.hasOwn(obj, key) || // if it's an inherited property, we don't care
5262
+ ignoreEmptyProperties && isEmpty(obj[key], true)
5263
+ // or if the property is itself empty
5264
+ );
5266
5265
  };
5267
5266
  const makeArrayOfRepeatedObjects = (length, obj) => {
5268
5267
  const array = [];
@@ -6311,8 +6310,6 @@ const stateFormatGuidanceText = {
6311
6310
  }
6312
6311
  }
6313
6312
  };
6314
- const emailPattern = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
6315
- const bankStatementDescriptionPattern = /^[\s+$\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BD\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6a-zA-Z0-9-."_,:;'*!@#%()+?¿/&「」]*$/;
6316
6313
  const businessRegistrationNumberPatterns = {
6317
6314
  [CountryCodes.Australia]: { default: /^\d{9}$/, associationIncorporated: /^[a-zA-Z0-9]{3,20}$/ },
6318
6315
  [CountryCodes.Austria]: {
@@ -6426,43 +6423,6 @@ const businessRegistrationNumberPatterns = {
6426
6423
  default: /^\d{9}$/
6427
6424
  }
6428
6425
  };
6429
- const CountryIdNumberPatterns = {
6430
- [CountryCodes.Brazil]: /^\d{11}$/,
6431
- [CountryCodes.Canada]: /^\d{9}$/,
6432
- [CountryCodes.Croatia]: /^\d{11}$/,
6433
- [CountryCodes.Denmark]: /^\d{10}$/,
6434
- [CountryCodes.Italy]: /^[A-Z]{6}[0-9]{2}[ABCDEHLMPRST][0-9]{2}[A-Z][0-9]{3}[A-Z]$/,
6435
- [CountryCodes.Poland]: /^\d{11}$/,
6436
- [CountryCodes.Romania]: /^\d{13}$/,
6437
- [CountryCodes.Singapore]: /^[A-Z][0-9]{7}[A-Z]$/,
6438
- [CountryCodes.Spain]: {
6439
- dni: /(^[KL]?\d{8}[A-Z]$)/,
6440
- nie: /(^[MXYZ]\d{7,8}[A-Z]$)/
6441
- },
6442
- [CountryCodes.Sweden]: /^\d{10}$|^\d{12}$/,
6443
- [CountryCodes.UnitedStates]: {
6444
- // used by CountryCodes.PuertoRico
6445
- ssn: /^\d{9}$/,
6446
- ssnLastFour: /^\d{4}$/
6447
- }
6448
- };
6449
- const DriversLicenseCardNumberPatterns = {
6450
- [CountryCodes.NewZealand]: /^[\d]{3}$/,
6451
- [CountryCodes.Australia]: /^[A-Z0-9]{5,11}$/
6452
- };
6453
- const DriversLicenseNumberPatterns = {
6454
- [CountryCodes.Australia]: /^[A-Za-z0-9]{5,11}$/,
6455
- [CountryCodes.HongKong]: /^[A-Z0-9]{8}$/,
6456
- [CountryCodes.NewZealand]: /^[A-Z]{2}[0-9]{6}$/
6457
- };
6458
- const PassportNumberPatterns = {
6459
- [CountryCodes.Australia]: /^[A-Z]{1,2}\d{7}$/,
6460
- [CountryCodes.HongKong]: /^[A-Z]{1,2}\d{6}[A-Z0-9]{1,2}$/,
6461
- [CountryCodes.NewZealand]: /[A-Z]{2}[0-9]{6,7}/
6462
- };
6463
- const ProofOfIdentityCardPatterns = {
6464
- [CountryCodes.HongKong]: /^[A-Z]{1,2}[0-9]{6}[0-9A]$/
6465
- };
6466
6426
  const defaultFieldMetadata$9 = {
6467
6427
  label: "registrationNumber"
6468
6428
  };
@@ -7400,7 +7360,7 @@ const deriveInputState = (isValid, isFocused, isDisabled, isOptional, hasNullish
7400
7360
  };
7401
7361
  };
7402
7362
  const MISMATCH_ANIMATION_NAME = "mismatchShake";
7403
- const logger$F = createLogger("MaskedInputText");
7363
+ const logger$G = createLogger("MaskedInputText");
7404
7364
  const MaskedInputText = ({
7405
7365
  value,
7406
7366
  onInput,
@@ -7445,7 +7405,7 @@ const MaskedInputText = ({
7445
7405
  };
7446
7406
  useEffect(() => {
7447
7407
  if (!mask) {
7448
- logger$F.warn("`mask` is undefined. No masking of input will take place.");
7408
+ logger$G.warn("`mask` is undefined. No masking of input will take place.");
7449
7409
  }
7450
7410
  }, [mask]);
7451
7411
  const getMaskResult = useCallback(
@@ -7489,7 +7449,7 @@ const MaskedInputText = ({
7489
7449
  return;
7490
7450
  }
7491
7451
  if (preserveMismatchingInitialValue) {
7492
- logger$F.warn(
7452
+ logger$G.warn(
7493
7453
  `Value received "${value}" does not match mask`,
7494
7454
  maskResult,
7495
7455
  `
@@ -7499,7 +7459,7 @@ Preserving mismatched initial value until user input.`
7499
7459
  return;
7500
7460
  }
7501
7461
  const fallback = displayValueToPure(maskResult.partialDisplayValue);
7502
- logger$F.warn(
7462
+ logger$G.warn(
7503
7463
  `Value received "${value}" does not match mask`,
7504
7464
  maskResult,
7505
7465
  `
@@ -10339,8 +10299,7 @@ const companyBase = {
10339
10299
  dateOfIncorporation: { rule: "countryRequiresDateOfIncorporationForCompanies" },
10340
10300
  exemptedFromRegistrationNumber: { rule: "companyRegistrationNumberExemptionAllowed" },
10341
10301
  registrationNumber: { rule: "countryRequiresRegistrationNumberForCompanies" },
10342
- countryOfGoverningLaw: { rule: "countryOfGoverningLawRequired" },
10343
- numberOfEmployees: { rule: "countryRequiringFinancialInformation" }
10302
+ countryOfGoverningLaw: { rule: "countryOfGoverningLawRequired" }
10344
10303
  };
10345
10304
  const businessDetailsBase = {
10346
10305
  /* Base required fields */
@@ -10370,6 +10329,10 @@ const taxInformationBase$1 = {
10370
10329
  exemptedFromTax: { rule: "countryHasTaxExemptionsForSomeCompanies" },
10371
10330
  isUen: { rule: "countryUsesUenOrGst" }
10372
10331
  };
10332
+ const financialInformationBase$1 = {
10333
+ numberOfEmployees: { rule: "countryRequiringFinancialInformation" },
10334
+ financialReportingDate: { rule: "countryRequiringFinancialInformation" }
10335
+ };
10373
10336
  const companyTypes = [
10374
10337
  {
10375
10338
  id: CompanyTypesValue.PRIVATE_COMPANY,
@@ -10406,12 +10369,14 @@ const fieldsPerScenario$3 = {
10406
10369
  L0: {
10407
10370
  country: { rule: "REQUIRED" },
10408
10371
  legalCompanyName: { rule: "REQUIRED" },
10409
- stateOrProvince: { rule: "countryRequiresStateOrProvince" }
10372
+ stateOrProvince: { rule: "countryRequiresStateOrProvince" },
10373
+ ...financialInformationBase$1
10410
10374
  },
10411
- L1: { ...companyBase },
10375
+ L1: { ...companyBase, ...financialInformationBase$1 },
10412
10376
  L: {
10413
10377
  ...companyBase,
10414
- ...taxInformationBase$1
10378
+ ...taxInformationBase$1,
10379
+ ...financialInformationBase$1
10415
10380
  },
10416
10381
  L_PROOFOFADDRESS: {
10417
10382
  proofOfAddressDocument: { rule: "REQUIRED" }
@@ -11137,7 +11102,7 @@ function Dropzone(props) {
11137
11102
  isRequired && /* @__PURE__ */ jsx("div", { className: "adyen-kyc-error-text", children: i18n.get("fieldIsRequired") })
11138
11103
  ] });
11139
11104
  }
11140
- const logger$E = createLogger("TextArea");
11105
+ const logger$F = createLogger("TextArea");
11141
11106
  function TextArea(props) {
11142
11107
  const { classNameModifiers, uniqueId, ...passedProps } = props;
11143
11108
  const {
@@ -11152,7 +11117,7 @@ function TextArea(props) {
11152
11117
  const { i18n } = useI18nContext();
11153
11118
  const [value, setValue] = useState("");
11154
11119
  if (Object.prototype.hasOwnProperty.call(props, "onChange")) {
11155
- logger$E.error("Error: Form fields that rely on InputBase may not have an onChange property");
11120
+ logger$F.error("Error: Form fields that rely on InputBase may not have an onChange property");
11156
11121
  }
11157
11122
  const handleInput = (e) => {
11158
11123
  var _a;
@@ -11567,11 +11532,11 @@ const financialInfoValidationRules = {
11567
11532
  }
11568
11533
  };
11569
11534
  const financialInformationReportedValueOptions = "adyen-kyc-financial-information-reported-value-options";
11570
- const styles$7 = {
11535
+ const styles$8 = {
11571
11536
  "financial-information-reported-value-options": "adyen-kyc-financial-information-reported-value-options",
11572
11537
  financialInformationReportedValueOptions
11573
11538
  };
11574
- const logger$D = createLogger("InputCurrency");
11539
+ const logger$E = createLogger("InputCurrency");
11575
11540
  const determineDecimalSeparator = (formatter) => formatter.formatToParts(0.1).find((part) => part.type === "decimal").value;
11576
11541
  const determineCurrencySymbol = (formatter) => formatter.formatToParts(0).find((part) => part.type === "currency").value;
11577
11542
  const getNumberFromFormattedCurrency = (formatted, decimalSeparator) => {
@@ -11602,7 +11567,7 @@ const InputCurrency = ({
11602
11567
  const rawValue = e.target.value;
11603
11568
  const value = getNumberFromFormattedCurrency(rawValue, decimalSeparator);
11604
11569
  if (Number.isNaN(value)) {
11605
- logger$D.warn(`Unable to get number from formatted currency: "${rawValue}"`);
11570
+ logger$E.warn(`Unable to get number from formatted currency: "${rawValue}"`);
11606
11571
  setText(isUndefinedOrNull(amount) ? currencySymbol : formatter.format(amount));
11607
11572
  return;
11608
11573
  }
@@ -11615,7 +11580,7 @@ const InputCurrency = ({
11615
11580
  };
11616
11581
  const reportedValue = "adyen-kyc-reported-value";
11617
11582
  const reportedValueInput = "adyen-kyc-reported-value-input";
11618
- const styles$6 = {
11583
+ const styles$7 = {
11619
11584
  "reported-value": "adyen-kyc-reported-value",
11620
11585
  reportedValue,
11621
11586
  "reported-value-input": "adyen-kyc-reported-value-input",
@@ -11631,7 +11596,7 @@ const ReportedValue = ({
11631
11596
  isValid
11632
11597
  }) => {
11633
11598
  const { i18n } = useI18nContext();
11634
- return /* @__PURE__ */ jsx("div", { className: styles$6.reportedValue, children: /* @__PURE__ */ jsx(Field, { name: fieldName, errorMessage, isValid, helper, children: (childProps) => /* @__PURE__ */ jsx(
11599
+ return /* @__PURE__ */ jsx("div", { className: styles$7.reportedValue, children: /* @__PURE__ */ jsx(Field, { name: fieldName, errorMessage, isValid, helper, children: (childProps) => /* @__PURE__ */ jsx(
11635
11600
  InputCurrency,
11636
11601
  {
11637
11602
  ...childProps,
@@ -11639,7 +11604,7 @@ const ReportedValue = ({
11639
11604
  currency,
11640
11605
  amount,
11641
11606
  onAmountChanged,
11642
- className: styles$6.reportedValueInput
11607
+ className: styles$7.reportedValueInput
11643
11608
  }
11644
11609
  ) }) });
11645
11610
  };
@@ -11656,6 +11621,7 @@ const getSchema = (data) => [
11656
11621
  function FinancialInformation(props) {
11657
11622
  var _a;
11658
11623
  const { i18n } = useI18nContext();
11624
+ const { id } = props;
11659
11625
  const defaultCurrency = ((_a = currencyByCountry[props.country]) == null ? void 0 : _a[0]) ?? "EUR";
11660
11626
  const { handleChangeFor, data, valid, errors, fieldProblems, schema } = useForm({
11661
11627
  ...props,
@@ -11665,7 +11631,7 @@ function FinancialInformation(props) {
11665
11631
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors
11666
11632
  });
11667
11633
  const { updateStateSlice } = useGlobalDataSlice(
11668
- "companyFinancialInformation"
11634
+ id
11669
11635
  );
11670
11636
  useEffect(() => {
11671
11637
  updateStateSlice({
@@ -11772,7 +11738,7 @@ function FinancialInformation(props) {
11772
11738
  ],
11773
11739
  onChange: updateReportedValueOption,
11774
11740
  showContentOnlyOnSelected: true,
11775
- className: styles$7.financialInformationReportedValueOptions
11741
+ className: styles$8.financialInformationReportedValueOptions
11776
11742
  }
11777
11743
  )
11778
11744
  }
@@ -12088,7 +12054,7 @@ function useIsElementVisible(ref, fallback = true) {
12088
12054
  }, [ref]);
12089
12055
  return isOnScreen;
12090
12056
  }
12091
- const logger$C = createLogger("SearchAddress");
12057
+ const logger$D = createLogger("SearchAddress");
12092
12058
  const SearchAddress = ({
12093
12059
  data,
12094
12060
  legalEntityId,
@@ -12130,7 +12096,7 @@ const SearchAddress = ({
12130
12096
  const response = await handleFindAddress(selectedAddressId);
12131
12097
  autocompleteAddressForm(response);
12132
12098
  } catch (e) {
12133
- logger$C.error(e);
12099
+ logger$D.error(e);
12134
12100
  }
12135
12101
  };
12136
12102
  const onDrilldown = async (selectedAddress) => {
@@ -12141,7 +12107,7 @@ const SearchAddress = ({
12141
12107
  );
12142
12108
  setItems((response == null ? void 0 : response.results) || []);
12143
12109
  } catch (e) {
12144
- logger$C.error(e);
12110
+ logger$D.error(e);
12145
12111
  }
12146
12112
  };
12147
12113
  const onChange = (e) => {
@@ -12193,7 +12159,7 @@ const SearchAddress = ({
12193
12159
  setItems([]);
12194
12160
  }
12195
12161
  } catch (e) {
12196
- logger$C.error(e);
12162
+ logger$D.error(e);
12197
12163
  }
12198
12164
  setLoading(false);
12199
12165
  }
@@ -12860,7 +12826,7 @@ Address.defaultProps = {
12860
12826
  requiredFields: ADDRESS_SCHEMA,
12861
12827
  countryCode: null
12862
12828
  };
12863
- const logger$B = createLogger("AddressFieldContainer");
12829
+ const logger$C = createLogger("AddressFieldContainer");
12864
12830
  const formatAddressItem = (item) => {
12865
12831
  if (item.description.includes("Addresses")) {
12866
12832
  const splittedDescription = item.description.split(" - ");
@@ -12998,7 +12964,7 @@ function FieldContainerComponent({
12998
12964
  setItems([]);
12999
12965
  }
13000
12966
  } catch (e) {
13001
- logger$B.error(e);
12967
+ logger$C.error(e);
13002
12968
  }
13003
12969
  setLoading(false);
13004
12970
  };
@@ -13032,7 +12998,7 @@ function FieldContainerComponent({
13032
12998
  });
13033
12999
  }
13034
13000
  } catch (e) {
13035
- logger$B.error(e);
13001
+ logger$C.error(e);
13036
13002
  }
13037
13003
  };
13038
13004
  const onDrilldown = async (address) => {
@@ -13044,7 +13010,7 @@ function FieldContainerComponent({
13044
13010
  ));
13045
13011
  setItems((response == null ? void 0 : response.results) || []);
13046
13012
  } catch (e) {
13047
- logger$B.error(e);
13013
+ logger$C.error(e);
13048
13014
  }
13049
13015
  };
13050
13016
  const handleOnChange = (e) => {
@@ -14238,12 +14204,36 @@ const COUNTRIES_USING_COMPANY_SEARCH = [
14238
14204
  const COUNTRIES_REQUIRING_FINANCIAL_INFORMATION = [
14239
14205
  CountryCodes.UnitedKingdom
14240
14206
  ];
14207
+ const EFP_CAPABILITIES = [
14208
+ // Issuing
14209
+ "useCardInRestrictedCountriesCommercial",
14210
+ "useCardInRestrictedCountriesConsumer",
14211
+ "useCardInRestrictedIndustriesCommercial",
14212
+ "useCardInRestrictedIndustriesConsumer",
14213
+ "withdrawFromAtmCommercial",
14214
+ "withdrawFromAtmConsumer",
14215
+ "withdrawFromAtmInRestrictedCountriesCommercial",
14216
+ "withdrawFromAtmInRestrictedCountriesConsumer",
14217
+ "issueCardCommercial",
14218
+ "issueCardConsumer",
14219
+ "useCardConsumer",
14220
+ "useCardCommercial",
14221
+ "authorisedPaymentInstrumentUser",
14222
+ // Banking
14223
+ "issueBankAccount",
14224
+ "sendToThirdParty",
14225
+ "receiveFromThirdParty",
14226
+ // Capital
14227
+ "getGrantOffers",
14228
+ "receiveGrants"
14229
+ ];
14241
14230
  const rules$3 = ({
14242
14231
  data,
14243
14232
  country,
14244
14233
  taskType,
14245
14234
  isExperimentEnabled = () => false,
14246
- accountHolder
14235
+ accountHolder,
14236
+ rootLegalEntity
14247
14237
  }) => ({
14248
14238
  countryRequiresStateOrProvince: () => {
14249
14239
  if (COUNTRIES_WITH_STATES_DATASET.includes(country)) {
@@ -14346,7 +14336,7 @@ const rules$3 = ({
14346
14336
  }
14347
14337
  },
14348
14338
  countryHasTaxExemptionsForSomeCompanies: () => {
14349
- if (taskType === TaskTypes.COMPANY && country === CountryCodes.Australia && accountHolder === "aTrust") {
14339
+ if (taskType === TaskTypes.COMPANY && country === CountryCodes.Australia && accountHolder === "aTrust" && isExperimentEnabled("EnableCompanyTrusteeSkipABN")) {
14350
14340
  return "REQUIRED";
14351
14341
  }
14352
14342
  if (COUNTRIES_WITH_POSSIBLE_TAX_EXEMPTION_FOR_COMPANIES.includes(country)) {
@@ -14367,9 +14357,16 @@ const rules$3 = ({
14367
14357
  if (isExperimentEnabled("EnableFinancialInformationComponentV4") && COUNTRIES_REQUIRING_FINANCIAL_INFORMATION.includes(country)) {
14368
14358
  return "REQUIRED";
14369
14359
  }
14360
+ },
14361
+ countryRequiresFinancialInformationForSoleProps: () => {
14362
+ if (isExperimentEnabled("EnableFinancialInformationComponentV4") && COUNTRIES_REQUIRING_FINANCIAL_INFORMATION.includes(country) && country === CountryCodes.UnitedKingdom && keysOf((rootLegalEntity == null ? void 0 : rootLegalEntity.capabilities) ?? {}).some(
14363
+ (capability) => EFP_CAPABILITIES.includes(capability)
14364
+ )) {
14365
+ return "REQUIRED";
14366
+ }
14370
14367
  }
14371
14368
  });
14372
- const logger$A = createLogger("mapPayoutAccountSchemaToApiBankAccount");
14369
+ const logger$B = createLogger("mapPayoutAccountSchemaToApiBankAccount");
14373
14370
  const getAccountIdentificationFromPayoutAccountSchema = (payoutAccount, bankCountry) => {
14374
14371
  var _a;
14375
14372
  if ("iban" in payoutAccount && payoutAccount.iban)
@@ -14449,7 +14446,7 @@ const getAccountIdentificationFromPayoutAccountSchema = (payoutAccount, bankCoun
14449
14446
  routingNumber: payoutAccount.branchCode
14450
14447
  };
14451
14448
  default:
14452
- logger$A.log(`${bankCountry.toLowerCase()}Local is not a configured region`);
14449
+ logger$B.log(`${bankCountry.toLowerCase()}Local is not a configured region`);
14453
14450
  return {
14454
14451
  type: `${bankCountry.toLowerCase()}Local`,
14455
14452
  accountNumber: payoutAccount.bankAccountNumber
@@ -15030,7 +15027,7 @@ const mapCompanyToLegalEntity = (data) => {
15030
15027
  data.companyNameAndCountry,
15031
15028
  requestObj.organization
15032
15029
  );
15033
- if (data.companyFinancialInformation) {
15030
+ if (!isEmpty(data.companyFinancialInformation)) {
15034
15031
  requestObj.organization.financialReports = [
15035
15032
  formatObject(
15036
15033
  data.companyFinancialInformation,
@@ -15098,7 +15095,7 @@ const mapHighExposureToLegalEntity = (data) => ({
15098
15095
  ...formatObject(data, highExposureApiKeyMapping)
15099
15096
  });
15100
15097
  const mapLegalEntityToSoleProp = (legalEntity) => {
15101
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
15098
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
15102
15099
  let solePropCompData;
15103
15100
  if (legalEntity == null ? void 0 : legalEntity.soleProprietorship) {
15104
15101
  solePropCompData = formatObject(legalEntity, solePropComponentsKeyMapping);
@@ -15131,6 +15128,11 @@ const mapLegalEntityToSoleProp = (legalEntity) => {
15131
15128
  ...mapApiDocumentToSolePropDocuments(legalEntity == null ? void 0 : legalEntity.id)
15132
15129
  };
15133
15130
  }
15131
+ if ((_k = legalEntity == null ? void 0 : legalEntity.soleProprietorship) == null ? void 0 : _k.financialReports) {
15132
+ solePropCompData.solePropFinancialInformation = mapFinancialReportsToFinancialInformation(
15133
+ legalEntity.soleProprietorship.financialReports
15134
+ );
15135
+ }
15134
15136
  }
15135
15137
  return solePropCompData;
15136
15138
  };
@@ -15156,6 +15158,14 @@ const mapSolePropToLegalEntity = (data) => {
15156
15158
  delete requestObj.soleProprietorship.vatNumber;
15157
15159
  delete requestObj.soleProprietorship.registrationNumber;
15158
15160
  }
15161
+ if (data.solePropFinancialInformation) {
15162
+ requestObj.soleProprietorship.financialReports = [
15163
+ formatObject(
15164
+ data.solePropFinancialInformation,
15165
+ financialInformationApiKeyMapping
15166
+ )
15167
+ ];
15168
+ }
15159
15169
  requestObj.type = LegalEntityType.SOLE_PROPRIETORSHIP;
15160
15170
  return requestObj;
15161
15171
  };
@@ -15314,7 +15324,7 @@ const mapPayoutDocumentsToApiDocuments = async (data, entityId) => {
15314
15324
  const { bankStatementDocument, description } = payoutAccountDocuments;
15315
15325
  const entityType = TransferInstrumentType.BANK_ACCOUNT;
15316
15326
  const existingDocument = getDocument$1(entityId, DocumentType.BANK_STATEMENT);
15317
- const document2 = await createDocumentRequest({
15327
+ return createDocumentRequest({
15318
15328
  entityId,
15319
15329
  entityType,
15320
15330
  documentType: DocumentType.BANK_STATEMENT,
@@ -15322,7 +15332,6 @@ const mapPayoutDocumentsToApiDocuments = async (data, entityId) => {
15322
15332
  description,
15323
15333
  existingDocument
15324
15334
  });
15325
- return document2;
15326
15335
  };
15327
15336
  const mapApiDocumentToPayoutDocuments = (entityId) => {
15328
15337
  const bankStatement = getDocument$1(entityId, DocumentType.BANK_STATEMENT) || null;
@@ -15531,10 +15540,9 @@ const useIdVerificationToken = ({
15531
15540
  const [sdkToken2, setSdkToken2] = useState();
15532
15541
  const [providerId, setProviderId] = useState();
15533
15542
  const [loadingStatus, setLoadingStatus] = useState();
15534
- const hasAllUserDetails = userDetails && Object.values(userDetails).every(Boolean);
15535
15543
  useEffect(() => {
15536
15544
  (async () => {
15537
- if (!hasAllUserDetails) return;
15545
+ if (!firstName || !lastName || !residencyCountry) return;
15538
15546
  try {
15539
15547
  setLoadingStatus("loading");
15540
15548
  const data = {
@@ -15559,7 +15567,7 @@ const useIdVerificationToken = ({
15559
15567
  setLoadingStatus("success");
15560
15568
  }
15561
15569
  })().catch(console.error);
15562
- }, [firstName, lastName, residencyCountry, hasAllUserDetails]);
15570
+ }, [firstName, lastName, residencyCountry]);
15563
15571
  return {
15564
15572
  providerId,
15565
15573
  sdkToken: sdkToken2,
@@ -15568,7 +15576,7 @@ const useIdVerificationToken = ({
15568
15576
  };
15569
15577
  const loaderWrapperLoader = "adyen-kyc-loader-wrapper-loader";
15570
15578
  const loaderWrapperLoaderActive = "adyen-kyc-loader-wrapper-loader-active";
15571
- const styles$5 = {
15579
+ const styles$6 = {
15572
15580
  "loader-wrapper-loader": "adyen-kyc-loader-wrapper-loader",
15573
15581
  loaderWrapperLoader,
15574
15582
  "loader-wrapper-loader-active": "adyen-kyc-loader-wrapper-loader-active",
@@ -15585,13 +15593,13 @@ const LoaderWrapper = ({
15585
15593
  const opacitySyle = status === "loading" ? {
15586
15594
  opacity: formOpacityWhenLoading
15587
15595
  } : { opacity: 1 };
15588
- const loaderWrapperClass = cx(styles$5.loaderWrapperLoader, {
15589
- [styles$5.loaderWrapperLoaderActive]: status === "loading" && showSpinner
15596
+ const loaderWrapperClass = cx(styles$6.loaderWrapperLoader, {
15597
+ [styles$6.loaderWrapperLoaderActive]: status === "loading" && showSpinner
15590
15598
  });
15591
- const overlayClass = cx(styles$5.loaderWrapper, className);
15599
+ const overlayClass = cx(styles$6.loaderWrapper, className);
15592
15600
  return /* @__PURE__ */ jsxs("div", { className: overlayClass, style: { position: "relative" }, children: [
15593
15601
  /* @__PURE__ */ jsx("div", { className: loaderWrapperClass, children: /* @__PURE__ */ jsx(Loader, { size: loaderSize }) }),
15594
- /* @__PURE__ */ jsx("div", { className: styles$5.loaderWrapperForm, style: opacitySyle, children })
15602
+ /* @__PURE__ */ jsx("div", { className: styles$6.loaderWrapperForm, style: opacitySyle, children })
15595
15603
  ] });
15596
15604
  };
15597
15605
  const containerId = "adyen-kyc-id-verification";
@@ -15644,7 +15652,7 @@ const initOnfido = async ({
15644
15652
  language: getOnfidoLocaleConfig(i18n)
15645
15653
  });
15646
15654
  };
15647
- const logger$z = createLogger("IdVerificationComponent");
15655
+ const logger$A = createLogger("IdVerificationComponent");
15648
15656
  function IdVerificationComponent({
15649
15657
  userDetails,
15650
15658
  legalEntityId,
@@ -15673,7 +15681,7 @@ function IdVerificationComponent({
15673
15681
  onIdVerificationError,
15674
15682
  onIdVerificationComplete
15675
15683
  });
15676
- })().catch(logger$z.error);
15684
+ })().catch(logger$A.error);
15677
15685
  return () => {
15678
15686
  if (onfidoSdk.current) onfidoSdk.current.tearDown();
15679
15687
  };
@@ -15717,7 +15725,7 @@ function IdDocumentAlreadyUpload(props) {
15717
15725
  ] })
15718
15726
  ] });
15719
15727
  }
15720
- const logger$y = createLogger("IdDocumentInstantVerificationComponent");
15728
+ const logger$z = createLogger("IdDocumentInstantVerificationComponent");
15721
15729
  const idVerificationSchema = [
15722
15730
  "instantIdVerificationData",
15723
15731
  "idDocumentType"
@@ -15789,7 +15797,7 @@ function IdDocumentInstantVerificationComponent(props) {
15789
15797
  userDetails: props.userDetails,
15790
15798
  legalEntityId: props.legalEntityId,
15791
15799
  onIdVerificationComplete: handleIdVerificationComplete,
15792
- onIdVerificationError: logger$y.error
15800
+ onIdVerificationError: logger$z.error
15793
15801
  }
15794
15802
  ),
15795
15803
  /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-document-upload__manual-upload", children: [
@@ -16137,8 +16145,7 @@ function useVerification(fieldsToVerify, country) {
16137
16145
  if (!isDirty) return false;
16138
16146
  if (typeof field !== "string") return false;
16139
16147
  const hasVerification = FIELDS_WITH_EXTERNAL_VERIFICATION.includes(field);
16140
- if (hasVerification) return true;
16141
- return false;
16148
+ return hasVerification;
16142
16149
  }).map(async (field) => {
16143
16150
  switch (field) {
16144
16151
  case "idNumber":
@@ -16210,7 +16217,7 @@ const phoneFormatters = {
16210
16217
  };
16211
16218
  const phoneFields = ["phoneNumber"];
16212
16219
  const DEFAULT_PHONE_PREFIX = "+1";
16213
- const logger$x = createLogger("PhoneInput");
16220
+ const logger$y = createLogger("PhoneInput");
16214
16221
  const usePhonePrefixes = () => {
16215
16222
  const [phonePrefixes, setPhonePrefixes] = useState();
16216
16223
  useEffect(() => {
@@ -16218,7 +16225,7 @@ const usePhonePrefixes = () => {
16218
16225
  const loaded = (await import("./phonePrefixes-zV4hciyK.js")).default;
16219
16226
  setPhonePrefixes(loaded);
16220
16227
  };
16221
- loadPhonePrefixes().catch(logger$x.error);
16228
+ loadPhonePrefixes().catch(logger$y.error);
16222
16229
  }, []);
16223
16230
  return phonePrefixes;
16224
16231
  };
@@ -16302,6 +16309,8 @@ const PhoneInput = memo(
16302
16309
  PhoneInputComponent,
16303
16310
  (prevProps, nextProps) => prevProps.country === nextProps.country && prevProps.shouldValidate === nextProps.shouldValidate
16304
16311
  );
16312
+ const emailPattern = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
16313
+ const bankStatementDescriptionPattern = /^[\s+$\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20BD\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6a-zA-Z0-9-."_,:;'*!@#%()+?¿/&「」]*$/;
16305
16314
  const contactDetailsValidationRules = {
16306
16315
  email: {
16307
16316
  modes: ["blur"],
@@ -16369,6 +16378,43 @@ const ContactDetailsComp = memo(
16369
16378
  ContactDetailsComponent.defaultProps = {
16370
16379
  data: {}
16371
16380
  };
16381
+ const CountryIdNumberPatterns = {
16382
+ [CountryCodes.Brazil]: /^\d{11}$/,
16383
+ [CountryCodes.Canada]: /^\d{9}$/,
16384
+ [CountryCodes.Croatia]: /^\d{11}$/,
16385
+ [CountryCodes.Denmark]: /^\d{10}$/,
16386
+ [CountryCodes.Italy]: /^[A-Z]{6}[0-9]{2}[ABCDEHLMPRST][0-9]{2}[A-Z][0-9]{3}[A-Z]$/,
16387
+ [CountryCodes.Poland]: /^\d{11}$/,
16388
+ [CountryCodes.Romania]: /^\d{13}$/,
16389
+ [CountryCodes.Singapore]: /^[A-Z][0-9]{7}[A-Z]$/,
16390
+ [CountryCodes.Spain]: {
16391
+ dni: /(^[KL]?\d{8}[A-Z]$)/,
16392
+ nie: /(^[MXYZ]\d{7,8}[A-Z]$)/
16393
+ },
16394
+ [CountryCodes.Sweden]: /^\d{10}$|^\d{12}$/,
16395
+ [CountryCodes.UnitedStates]: {
16396
+ // used by CountryCodes.PuertoRico
16397
+ ssn: /^\d{9}$/,
16398
+ ssnLastFour: /^\d{4}$/
16399
+ }
16400
+ };
16401
+ const DriversLicenseCardNumberPatterns = {
16402
+ [CountryCodes.NewZealand]: /^[\d]{3}$/,
16403
+ [CountryCodes.Australia]: /^[A-Z0-9]{5,11}$/
16404
+ };
16405
+ const DriversLicenseNumberPatterns = {
16406
+ [CountryCodes.Australia]: /^[A-Za-z0-9]{5,11}$/,
16407
+ [CountryCodes.HongKong]: /^[A-Z0-9]{8}$/,
16408
+ [CountryCodes.NewZealand]: /^[A-Z]{2}[0-9]{6}$/
16409
+ };
16410
+ const PassportNumberPatterns = {
16411
+ [CountryCodes.Australia]: /^[A-Z]{1,2}\d{7}$/,
16412
+ [CountryCodes.HongKong]: /^[A-Z]{1,2}\d{6}[A-Z0-9]{1,2}$/,
16413
+ [CountryCodes.NewZealand]: /[A-Z]{2}[0-9]{6,7}/
16414
+ };
16415
+ const ProofOfIdentityCardPatterns = {
16416
+ [CountryCodes.HongKong]: /^[A-Z]{1,2}[0-9]{6}[0-9A]$/
16417
+ };
16372
16418
  const defaultFieldMetadata$5 = {
16373
16419
  label: "idNumber"
16374
16420
  };
@@ -17155,7 +17201,7 @@ const roleMetadata = {
17155
17201
  name: TrustMemberGuidanceLabel.TRUSTEE
17156
17202
  }
17157
17203
  };
17158
- const getRoleTagVariant = (role) => {
17204
+ const getRoleTagVariant$1 = (role) => {
17159
17205
  var _a;
17160
17206
  return ((_a = roleMetadata[role]) == null ? void 0 : _a.variant) ?? "blue";
17161
17207
  };
@@ -18737,21 +18783,47 @@ const individualDocumentForms = [
18737
18783
  proofOfRelationshipFormID
18738
18784
  ];
18739
18785
  function IndividualComponent(props) {
18740
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
18786
+ var _a, _b, _c, _d, _e, _f, _g, _h;
18741
18787
  const { i18n } = useI18nContext();
18742
- const [data, setData] = useState(props.data);
18788
+ const {
18789
+ activeForm: propActiveForm,
18790
+ allowedRoles,
18791
+ capabilities,
18792
+ country,
18793
+ data: propData,
18794
+ forms,
18795
+ handleGetIdVerificationToken,
18796
+ onCountryChange,
18797
+ onBack,
18798
+ onNext,
18799
+ parentLegalEntity,
18800
+ setHideFooter,
18801
+ taskType,
18802
+ trustedFields,
18803
+ trustedFieldsProvider,
18804
+ trustedRoles,
18805
+ legalEntityId,
18806
+ handleAddressSearch,
18807
+ handleFindAddress
18808
+ } = props;
18809
+ const [data, setData] = useState(propData);
18743
18810
  const [idVerificationMethodSelected, setIdVerificationMethodSelected] = useState("instantVerification");
18744
18811
  const stateRef = useRef({ setState: null });
18745
18812
  useEffect(() => {
18746
- const forms = Object.values(props.forms).reduce(
18813
+ var _a2, _b2;
18814
+ if (!forms) {
18815
+ return;
18816
+ }
18817
+ const activeFormsWithoutSummary = Object.values(forms).reduce(
18747
18818
  (acc, item) => [...acc, ...item.formId !== "summary" ? [item.formId] : []],
18748
18819
  []
18749
18820
  );
18750
- stateRef.current.setActiveForms(forms);
18751
- }, [props.forms.toString()]);
18821
+ (_b2 = (_a2 = stateRef.current).setActiveForms) == null ? void 0 : _b2.call(_a2, activeFormsWithoutSummary);
18822
+ }, [forms == null ? void 0 : forms.toString()]);
18752
18823
  useEffect(
18753
18824
  () => () => {
18754
- stateRef.current.setState({ type: "resetState" });
18825
+ var _a2, _b2;
18826
+ (_b2 = (_a2 = stateRef.current).setState) == null ? void 0 : _b2.call(_a2, { type: "resetState" });
18755
18827
  },
18756
18828
  []
18757
18829
  );
@@ -18775,18 +18847,18 @@ function IndividualComponent(props) {
18775
18847
  lastName: (_d = data == null ? void 0 : data.personalDetails) == null ? void 0 : _d.lastName,
18776
18848
  residencyCountry: (_e = data == null ? void 0 : data.personalDetails) == null ? void 0 : _e.residencyCountry
18777
18849
  };
18778
- const isLegalRepresentativeDetailsTask = props.taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS;
18850
+ const isLegalRepresentativeDetailsTask = taskType === TaskTypes.LEGAL_REPRESENTATIVE_DETAILS;
18779
18851
  const handleStateChange = ({
18780
18852
  currentState,
18781
18853
  prevState
18782
18854
  }) => {
18783
18855
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
18784
- const residencyCountryPrev = (_b2 = (_a2 = prevState.data) == null ? void 0 : _a2.personalDetails) == null ? void 0 : _b2.residencyCountry;
18856
+ const residencyCountryPrev = (_b2 = (_a2 = prevState == null ? void 0 : prevState.data) == null ? void 0 : _a2.personalDetails) == null ? void 0 : _b2.residencyCountry;
18785
18857
  const residencyCountry = (_d2 = (_c2 = currentState.data) == null ? void 0 : _c2.personalDetails) == null ? void 0 : _d2.residencyCountry;
18786
18858
  if (residencyCountry != null && residencyCountry !== residencyCountryPrev) {
18787
- props.onCountryChange(residencyCountry);
18859
+ onCountryChange == null ? void 0 : onCountryChange(residencyCountry);
18788
18860
  }
18789
- const idVerificationMethodPrev = (_f2 = (_e2 = prevState.data) == null ? void 0 : _e2.idVerificationMethod) == null ? void 0 : _f2.idVerificationMethod;
18861
+ const idVerificationMethodPrev = (_f2 = (_e2 = prevState == null ? void 0 : prevState.data) == null ? void 0 : _e2.idVerificationMethod) == null ? void 0 : _f2.idVerificationMethod;
18790
18862
  const idVerificationMethod = (_h2 = (_g2 = currentState.data) == null ? void 0 : _g2.idVerificationMethod) == null ? void 0 : _h2.idVerificationMethod;
18791
18863
  if (idVerificationMethod != null && idVerificationMethod !== idVerificationMethodPrev) {
18792
18864
  setIdVerificationMethodSelected(idVerificationMethod);
@@ -18799,31 +18871,31 @@ function IndividualComponent(props) {
18799
18871
  });
18800
18872
  };
18801
18873
  useEffect(() => {
18802
- var _a2, _b2, _c2;
18803
- const isIdDocumentFormActive = props.activeForm.formId === idDocumentFormID;
18804
- const isInstantIdVerificationEnabled = idVerificationMethodSelected === "instantVerification" && !!props.handleGetIdVerificationToken;
18805
- const isIdAlreadyUploaded = ((_a2 = data == null ? void 0 : data.idDocument) == null ? void 0 : _a2.instantIdVerificationData) || ((_c2 = (_b2 = props.data) == null ? void 0 : _b2.idDocument) == null ? void 0 : _c2.idDocumentType);
18806
- props.setHideFooter(
18874
+ var _a2, _b2;
18875
+ const isIdDocumentFormActive = (propActiveForm == null ? void 0 : propActiveForm.formId) === idDocumentFormID;
18876
+ const isInstantIdVerificationEnabled = idVerificationMethodSelected === "instantVerification" && !!handleGetIdVerificationToken;
18877
+ const isIdAlreadyUploaded = ((_a2 = data == null ? void 0 : data.idDocument) == null ? void 0 : _a2.instantIdVerificationData) || ((_b2 = propData == null ? void 0 : propData.idDocument) == null ? void 0 : _b2.idDocumentType);
18878
+ setHideFooter == null ? void 0 : setHideFooter(
18807
18879
  isIdDocumentFormActive && !isIdAlreadyUploaded && isInstantIdVerificationEnabled
18808
18880
  );
18809
18881
  }, [
18810
- props.activeForm,
18882
+ propActiveForm,
18811
18883
  idVerificationMethodSelected,
18812
- props.handleGetIdVerificationToken,
18884
+ handleGetIdVerificationToken,
18813
18885
  (_f = data == null ? void 0 : data.idDocument) == null ? void 0 : _f.instantIdVerificationData,
18814
- (_h = (_g = props.data) == null ? void 0 : _g.idDocument) == null ? void 0 : _h.idDocumentType
18886
+ (_g = propData == null ? void 0 : propData.idDocument) == null ? void 0 : _g.idDocumentType
18815
18887
  ]);
18816
- const addressSchema = getAddressSchemaForCountry((_i = data == null ? void 0 : data.personalDetails) == null ? void 0 : _i.residencyCountry).filter(
18888
+ const addressSchema = getAddressSchemaForCountry((_h = data == null ? void 0 : data.personalDetails) == null ? void 0 : _h.residencyCountry).filter(
18817
18889
  (field) => {
18818
18890
  var _a2;
18819
- return !COUNTRIES_WITH_STATES_DATASET.includes((_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry) ? field !== "stateOrProvince" : true;
18891
+ return !!((_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry) && !COUNTRIES_WITH_STATES_DATASET.includes(data.personalDetails.residencyCountry) ? field !== "stateOrProvince" : true;
18820
18892
  }
18821
18893
  );
18822
18894
  const { updateStateSlice } = useGlobalDataSlice(
18823
18895
  "address"
18824
18896
  );
18825
18897
  const renderActiveForm = (activeForm) => {
18826
- var _a2, _b2, _c2;
18898
+ var _a2, _b2;
18827
18899
  return /* @__PURE__ */ jsxs(Fragment, { children: [
18828
18900
  /* @__PURE__ */ jsx(StateContextWatcher, { owner: "IndividualComponent", onChange: handleStateChange }),
18829
18901
  /* @__PURE__ */ jsx(StateContextSetter, { owner: "IndividualComponent", stateRef }),
@@ -18837,17 +18909,17 @@ function IndividualComponent(props) {
18837
18909
  ...personalFormProps,
18838
18910
  data: {
18839
18911
  ...personalFormProps == null ? void 0 : personalFormProps.data,
18840
- residencyCountry: props.country
18912
+ residencyCountry: country
18841
18913
  },
18842
18914
  ref: formsRef[personalDetailsFormID],
18843
18915
  heading: isLegalRepresentativeDetailsTask ? i18n.get("legalRepresentativeDetails") : i18n.get("personalDetails"),
18844
- taskType: props.taskType,
18916
+ taskType,
18845
18917
  id: personalDetailsFormID,
18846
- allowedRoles: props == null ? void 0 : props.allowedRoles,
18847
- capabilities: props.capabilities,
18848
- parentLegalEntity: props.parentLegalEntity,
18849
- trustedFieldsProvider: props.trustedFieldsProvider,
18850
- trustedRoles: props.trustedRoles
18918
+ allowedRoles,
18919
+ capabilities,
18920
+ parentLegalEntity,
18921
+ trustedFieldsProvider,
18922
+ trustedRoles
18851
18923
  }
18852
18924
  )
18853
18925
  }
@@ -18873,13 +18945,13 @@ function IndividualComponent(props) {
18873
18945
  {
18874
18946
  ...addressFormProps,
18875
18947
  id: addressFormID,
18876
- data: { ...data.address, country: (_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry },
18948
+ data: { ...addressFormProps == null ? void 0 : addressFormProps.data, country: (_a2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _a2.residencyCountry },
18877
18949
  requiredFields: addressSchema,
18878
18950
  optionalFields: ["otherAddressInformation"],
18879
- trustedFields: (_b2 = props.trustedFields) == null ? void 0 : _b2.address,
18880
- legalEntityId: props.legalEntityId,
18881
- handleAddressSearch: props.handleAddressSearch,
18882
- handleFindAddress: props.handleFindAddress,
18951
+ trustedFields: trustedFields == null ? void 0 : trustedFields.address,
18952
+ legalEntityId,
18953
+ handleAddressSearch,
18954
+ handleFindAddress,
18883
18955
  onChange: handleAddressChange,
18884
18956
  hideCountry: true
18885
18957
  }
@@ -18887,7 +18959,7 @@ function IndividualComponent(props) {
18887
18959
  ] })
18888
18960
  }
18889
18961
  ),
18890
- !!props.handleGetIdVerificationToken && /* @__PURE__ */ jsx(
18962
+ !!handleGetIdVerificationToken && /* @__PURE__ */ jsx(
18891
18963
  "div",
18892
18964
  {
18893
18965
  className: activeForm.formId !== idVerificationMethodFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
@@ -18897,7 +18969,7 @@ function IndividualComponent(props) {
18897
18969
  ...idVerificationMethodFormProps,
18898
18970
  name: fullName,
18899
18971
  id: idVerificationMethodFormID,
18900
- countryOfResidence: (_c2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _c2.residencyCountry
18972
+ countryOfResidence: (_b2 = data == null ? void 0 : data.personalDetails) == null ? void 0 : _b2.residencyCountry
18901
18973
  }
18902
18974
  )
18903
18975
  }
@@ -18913,10 +18985,10 @@ function IndividualComponent(props) {
18913
18985
  name: fullName,
18914
18986
  userDetails: activeForm.formId === idDocumentFormID ? userDetails : void 0,
18915
18987
  id: idDocumentFormID,
18916
- legalEntityId: props.legalEntityId,
18917
- handleGetIdVerificationToken: props.handleGetIdVerificationToken,
18918
- handleOnBack: props.onBack,
18919
- handleOnNext: props.onNext,
18988
+ legalEntityId,
18989
+ handleGetIdVerificationToken,
18990
+ handleOnBack: onBack,
18991
+ handleOnNext: onNext,
18920
18992
  idVerificationMethodSelected
18921
18993
  }
18922
18994
  )
@@ -18968,7 +19040,7 @@ function IndividualComponent(props) {
18968
19040
  )
18969
19041
  ] });
18970
19042
  };
18971
- return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-individual", children: renderActiveForm(props.activeForm) });
19043
+ return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-individual", children: renderActiveForm(propActiveForm) });
18972
19044
  }
18973
19045
  const useAsyncAccountDetailsValidationRules = (payload, hasEmptyFields2, isAccountNumberMasked) => {
18974
19046
  const [timeoutId, setTimeoutId] = useState(null);
@@ -19652,7 +19724,7 @@ class AdyenKycSdkError extends Error {
19652
19724
  }
19653
19725
  let sdkToken;
19654
19726
  let fetchSdkToken;
19655
- const logger$w = createLogger("Session");
19727
+ const logger$x = createLogger("Session");
19656
19728
  const setSdkToken = (token) => {
19657
19729
  sdkToken = token;
19658
19730
  };
@@ -19677,7 +19749,7 @@ const refreshSession = async () => {
19677
19749
  setSdkToken(token);
19678
19750
  isSessionRefreshed = true;
19679
19751
  } catch (e) {
19680
- logger$w.error("Failed to fetch sdk token", e);
19752
+ logger$x.error("Failed to fetch sdk token", e);
19681
19753
  }
19682
19754
  return isSessionRefreshed;
19683
19755
  };
@@ -19687,7 +19759,7 @@ const addAnimationStartListener = (element, listener) => {
19687
19759
  const removeAnimationStartListener = (element, listener) => {
19688
19760
  element.removeEventListener("animationstart", listener, false);
19689
19761
  };
19690
- const logger$v = createLogger("Fetch");
19762
+ const logger$w = createLogger("Fetch");
19691
19763
  const getRequestObject = (options, data) => {
19692
19764
  const { headers = [], method = "GET", authentication } = options;
19693
19765
  let authHeaders;
@@ -19728,10 +19800,10 @@ const logFetchError = (message, level) => {
19728
19800
  case "info":
19729
19801
  case "warn":
19730
19802
  case "error":
19731
- logger$v[level](message);
19803
+ logger$w[level](message);
19732
19804
  break;
19733
19805
  default:
19734
- logger$v.error(message);
19806
+ logger$w.error(message);
19735
19807
  }
19736
19808
  };
19737
19809
  const handleFetchResponse = async (response, responseType) => {
@@ -19815,7 +19887,7 @@ const RELEVANT_MESSAGE_TYPES = ["account_verification_report_id", "error"];
19815
19887
  const TERMINAL_DATA_PROPS = ["accounts", "error", "reference"];
19816
19888
  const MOUNT_TIMEOUT = 10 * 1e3;
19817
19889
  const TINK_VENDOR = "Tink";
19818
- const logger$u = createLogger("iframeWidget");
19890
+ const logger$v = createLogger("iframeWidget");
19819
19891
  const isObjectData = (data) => typeof data === "object" && !Array.isArray(data) && data !== null;
19820
19892
  const isTerminalMessageData = (data) => isObjectData(data) && Object.entries(data).some(([prop]) => TERMINAL_DATA_PROPS.includes(prop));
19821
19893
  const parseMessageJson = (message) => {
@@ -19833,7 +19905,7 @@ const callbackErrorHandler = async (response) => {
19833
19905
  try {
19834
19906
  await response;
19835
19907
  } catch (ex) {
19836
- logger$u.error(ex);
19908
+ logger$v.error(ex);
19837
19909
  }
19838
19910
  return {
19839
19911
  error: "UNKNOWN_ERROR",
@@ -19929,7 +20001,7 @@ class IFrameWidget {
19929
20001
  message = responseData.errorMessage;
19930
20002
  }
19931
20003
  } catch (ex) {
19932
- logger$u.error(ex);
20004
+ logger$v.error(ex);
19933
20005
  }
19934
20006
  throw new AdyenKycSdkError(reason, jsonData.error);
19935
20007
  }
@@ -20008,14 +20080,67 @@ const DEFAULT_ERROR = {
20008
20080
  function BankVerificationWidget({
20009
20081
  url,
20010
20082
  vendor,
20011
- widgetCallback,
20083
+ setBankVerificationError,
20084
+ setVerificationComplete,
20085
+ onBack,
20086
+ retrieveBankAccountInfo,
20012
20087
  createTrustedTransferInstrument: createTrustedTransferInstrument2,
20013
20088
  handleBankVerificationError: handleBankVerificationError2
20014
20089
  }) {
20090
+ const { i18n } = useI18nContext();
20015
20091
  const widgetContainerRef = useRef(null);
20016
20092
  const context = useAuthContext();
20017
20093
  const { isEmbeddedDropin } = context;
20018
20094
  const sdkToken2 = isEmbeddedDropin ? getSdkToken() : void 0;
20095
+ setBankVerificationError(null);
20096
+ const widgetCallback = useCallback(
20097
+ (payload) => {
20098
+ setVerificationComplete(true);
20099
+ const errorContent = i18n.get("tryAgainOrManualAccountDetails");
20100
+ switch (payload.action) {
20101
+ case "handle_exception": {
20102
+ let errorTitle = i18n.get("sorryAnErrorOccurred");
20103
+ const { err } = payload;
20104
+ switch (!(err instanceof Error) && (err == null ? void 0 : err.error)) {
20105
+ case "USER_CANCELLED":
20106
+ errorTitle = "";
20107
+ break;
20108
+ case "CONNECTION_ERROR":
20109
+ errorTitle = i18n.get("couldNotEstablishBankConnection");
20110
+ break;
20111
+ case "GENERIC_ERROR":
20112
+ errorTitle = i18n.get("ranIntoTechnicalError");
20113
+ break;
20114
+ case "UNKNOWN_ERROR":
20115
+ default: {
20116
+ errorTitle = i18n.get("couldNotCompleteAccountCheck");
20117
+ break;
20118
+ }
20119
+ }
20120
+ if (errorTitle) {
20121
+ setBankVerificationError({
20122
+ title: errorTitle,
20123
+ content: errorContent
20124
+ });
20125
+ }
20126
+ onBack == null ? void 0 : onBack();
20127
+ break;
20128
+ }
20129
+ case "retry_verification":
20130
+ setBankVerificationError({
20131
+ title: i18n.get("failedInitializeInstantVerification"),
20132
+ content: errorContent
20133
+ });
20134
+ onBack == null ? void 0 : onBack();
20135
+ break;
20136
+ default: {
20137
+ const { accounts } = payload.result;
20138
+ retrieveBankAccountInfo(accounts[0]);
20139
+ }
20140
+ }
20141
+ },
20142
+ [i18n, retrieveBankAccountInfo, onBack, setBankVerificationError, setVerificationComplete]
20143
+ );
20019
20144
  useEffect(
20020
20145
  () => {
20021
20146
  const container = widgetContainerRef.current;
@@ -20033,16 +20158,16 @@ function BankVerificationWidget({
20033
20158
  divElement: container,
20034
20159
  link: url,
20035
20160
  successHandler: (code, state) => {
20036
- createTrustedTransferInstrument2(code, state).then((accounts) => {
20037
- if (accounts) {
20161
+ createTrustedTransferInstrument2(code, state).then((res) => {
20162
+ if (res) {
20038
20163
  widgetCallback({
20039
20164
  action: "verification_success",
20040
- result: accounts
20165
+ result: res
20041
20166
  });
20042
20167
  }
20043
20168
  }).catch(
20044
20169
  () => widgetCallback({
20045
- action: "handle_verification_exception",
20170
+ action: "handle_exception",
20046
20171
  err: DEFAULT_ERROR
20047
20172
  })
20048
20173
  );
@@ -20050,12 +20175,12 @@ function BankVerificationWidget({
20050
20175
  errorHandler: (errorCode, errorMessage, state, metadata) => {
20051
20176
  handleBankVerificationError2 == null ? void 0 : handleBankVerificationError2(errorCode, errorMessage, state, metadata).then(
20052
20177
  (error) => widgetCallback({
20053
- action: "handle_verification_exception",
20178
+ action: "handle_exception",
20054
20179
  err: error
20055
20180
  })
20056
20181
  ).catch(
20057
20182
  () => widgetCallback({
20058
- action: "handle_verification_exception",
20183
+ action: "handle_exception",
20059
20184
  err: DEFAULT_ERROR
20060
20185
  })
20061
20186
  );
@@ -20073,30 +20198,40 @@ function BankVerificationWidget({
20073
20198
  try {
20074
20199
  iFrameWidget = new IFrameWidget(iFrame, url, vendor, sdkToken2);
20075
20200
  const result = await iFrameWidget.mountAndWaitForResponse();
20076
- widgetCallback({ action: "verification_success", result });
20201
+ widgetCallback({
20202
+ action: "verification_success",
20203
+ result
20204
+ });
20077
20205
  } catch (err) {
20078
20206
  if (err instanceof AdyenKycSdkError) {
20079
20207
  switch (err.message) {
20080
20208
  case "WIDGET_ACCOUNT_COMMIT_FAILURE":
20081
20209
  return widgetCallback({
20082
- action: "handle_verification_exception",
20210
+ action: "handle_exception",
20083
20211
  err: err.sourceError
20084
20212
  });
20085
20213
  case "WIDGET_LAUNCH_FAILED":
20086
20214
  case "WIDGET_URL_MALFORMED":
20087
20215
  case "WIDGET_TIMEOUT":
20088
- return widgetCallback({ action: "retry_verification" });
20216
+ return widgetCallback({
20217
+ action: "retry_verification"
20218
+ /* RETRY_VERIFICATION */
20219
+ });
20089
20220
  default:
20090
20221
  return widgetCallback({
20091
- action: "handle_verification_exception",
20222
+ action: "handle_exception",
20092
20223
  err: {
20093
- error: (err == null ? void 0 : err.name) ?? "handle_verification_exception",
20094
- message: ((_a = err.sourceError) == null ? void 0 : _a.message) ?? "handle_verification_exception"
20224
+ error: (err == null ? void 0 : err.name) ?? "handle_exception",
20225
+ message: ((_a = err.sourceError) == null ? void 0 : _a.message) ?? "handle_exception"
20226
+ /* HANDLE_EXCEPTION */
20095
20227
  }
20096
20228
  });
20097
20229
  }
20098
20230
  }
20099
- return widgetCallback({ action: "handle_verification_exception", err });
20231
+ return widgetCallback({
20232
+ action: "handle_exception",
20233
+ err
20234
+ });
20100
20235
  }
20101
20236
  });
20102
20237
  }
@@ -20147,79 +20282,6 @@ const useInstantVerificationErrorNotification = (notificationVisibilityDuration)
20147
20282
  }, [errorNotification, clearNotificationTimeout, notificationVisibilityDuration]);
20148
20283
  return [errorNotification, setErrorNotification];
20149
20284
  };
20150
- function InstantBankVerification({
20151
- provider,
20152
- retrieveBankAccountInfo,
20153
- setBankVerificationError,
20154
- onBack,
20155
- createTrustedTransferInstrument: createTrustedTransferInstrument2,
20156
- handleBankVerificationError: handleBankVerificationError2
20157
- }) {
20158
- const { i18n } = useI18nContext();
20159
- const [verificationComplete, setVerificationComplete] = useState(false);
20160
- const widgetCallback = useCallback(
20161
- (payload) => {
20162
- setVerificationComplete(true);
20163
- const errorContent = i18n.get("tryAgainOrManualAccountDetails");
20164
- switch (payload.action) {
20165
- case "handle_verification_exception": {
20166
- let errorTitle = i18n.get("sorryAnErrorOccurred");
20167
- const { err } = payload;
20168
- switch (!(err instanceof Error) && (err == null ? void 0 : err.error)) {
20169
- case "USER_CANCELLED":
20170
- errorTitle = "";
20171
- break;
20172
- case "CONNECTION_ERROR":
20173
- errorTitle = i18n.get("couldNotEstablishBankConnection");
20174
- break;
20175
- case "GENERIC_ERROR":
20176
- errorTitle = i18n.get("ranIntoTechnicalError");
20177
- break;
20178
- case "UNKNOWN_ERROR":
20179
- default: {
20180
- errorTitle = i18n.get("couldNotCompleteAccountCheck");
20181
- break;
20182
- }
20183
- }
20184
- if (errorTitle) {
20185
- setBankVerificationError({
20186
- title: errorTitle,
20187
- content: errorContent
20188
- });
20189
- }
20190
- if (onBack) onBack();
20191
- break;
20192
- }
20193
- case "retry_verification":
20194
- setBankVerificationError({
20195
- title: i18n.get("failedInitializeInstantVerification"),
20196
- content: errorContent
20197
- });
20198
- if (onBack) onBack();
20199
- break;
20200
- default: {
20201
- const { accounts } = payload.result;
20202
- retrieveBankAccountInfo(accounts[0]);
20203
- }
20204
- }
20205
- },
20206
- [i18n, retrieveBankAccountInfo, onBack, setBankVerificationError]
20207
- );
20208
- setBankVerificationError(null);
20209
- return /* @__PURE__ */ jsx("form", { className: "adyen-kyc-bank-verification", children: !verificationComplete ? /* @__PURE__ */ jsxs(Fragment, { children: [
20210
- /* @__PURE__ */ jsx(
20211
- BankVerificationWidget,
20212
- {
20213
- widgetCallback,
20214
- url: provider.redirectUrl,
20215
- vendor: provider.name,
20216
- createTrustedTransferInstrument: createTrustedTransferInstrument2,
20217
- handleBankVerificationError: handleBankVerificationError2
20218
- }
20219
- ),
20220
- /* @__PURE__ */ jsx(ActionBar, { onBack: () => onBack == null ? void 0 : onBack(), backButtonLabel: i18n.get("goBack") })
20221
- ] }) : void 0 });
20222
- }
20223
20285
  function BankVerification(props) {
20224
20286
  const {
20225
20287
  heading,
@@ -20242,7 +20304,7 @@ function BankVerification(props) {
20242
20304
  const ACCOUNT_VERIFICATION = props.id;
20243
20305
  const schema = accountVerificationFields;
20244
20306
  const stateRef = useRef({ setState: null });
20245
- const requiredFieldsByFlow = accountVerificationFields;
20307
+ const [verificationComplete, setVerificationComplete] = useState(false);
20246
20308
  const { handleChangeFor, data, valid, errors, isValid, triggerValidation, fieldProblems } = useForm({
20247
20309
  ...props,
20248
20310
  schema,
@@ -20280,7 +20342,7 @@ function BankVerification(props) {
20280
20342
  fieldProblems,
20281
20343
  caller: ACCOUNT_VERIFICATION,
20282
20344
  dataStoreId: ACCOUNT_VERIFICATION,
20283
- schema: requiredFieldsByFlow
20345
+ schema
20284
20346
  }
20285
20347
  });
20286
20348
  }, [data, valid, errors, isValid]);
@@ -20292,13 +20354,7 @@ function BankVerification(props) {
20292
20354
  /* @__PURE__ */ jsx(StateContextSetter, { owner: ACCOUNT_VERIFICATION, stateRef }),
20293
20355
  bankInfoValidated && /* @__PURE__ */ jsxs(Fragment, { children: [
20294
20356
  /* @__PURE__ */ jsx(FormHeader, { heading }),
20295
- /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-bank-verification-success", children: [
20296
- /* @__PURE__ */ jsx(Icon, { name: "check", className: "adyen-kyc-u-margin-x-24" }),
20297
- /* @__PURE__ */ jsxs("span", { children: [
20298
- " ",
20299
- i18n.get("youSuccessfullyVerifiedAccount")
20300
- ] })
20301
- ] })
20357
+ /* @__PURE__ */ jsx(Alert, { title: i18n.get("youSuccessfullyVerifiedAccount"), variant: "success" })
20302
20358
  ] }),
20303
20359
  (provider == null ? void 0 : provider.redirectUrl) && (provider == null ? void 0 : provider.name) && formIsActive && !bankInfoValidated && /* @__PURE__ */ jsx(
20304
20360
  "div",
@@ -20306,17 +20362,22 @@ function BankVerification(props) {
20306
20362
  className: cx("adyen-kyc-bank-verification-container", {
20307
20363
  "adyen-kyc-bank-verification-container__fixed": !isEmbeddedDropin
20308
20364
  }),
20309
- children: /* @__PURE__ */ jsx(
20310
- InstantBankVerification,
20311
- {
20312
- provider,
20313
- retrieveBankAccountInfo,
20314
- setBankVerificationError,
20315
- onBack,
20316
- createTrustedTransferInstrument: createTrustedTransferInstrument2,
20317
- handleBankVerificationError: handleBankVerificationError2
20318
- }
20319
- )
20365
+ children: /* @__PURE__ */ jsx("form", { className: "adyen-kyc-bank-verification", children: !verificationComplete ? /* @__PURE__ */ jsxs(Fragment, { children: [
20366
+ /* @__PURE__ */ jsx(
20367
+ BankVerificationWidget,
20368
+ {
20369
+ url: provider.redirectUrl,
20370
+ vendor: provider.name,
20371
+ setBankVerificationError,
20372
+ setVerificationComplete,
20373
+ onBack,
20374
+ retrieveBankAccountInfo,
20375
+ createTrustedTransferInstrument: createTrustedTransferInstrument2,
20376
+ handleBankVerificationError: handleBankVerificationError2
20377
+ }
20378
+ ),
20379
+ /* @__PURE__ */ jsx(ActionBar, { onBack: () => onBack == null ? void 0 : onBack(), backButtonLabel: i18n.get("goBack") })
20380
+ ] }) : void 0 })
20320
20381
  }
20321
20382
  )
20322
20383
  ] });
@@ -21228,6 +21289,77 @@ function SwiftCode(props) {
21228
21289
  }
21229
21290
  );
21230
21291
  }
21292
+ const AccountHolderDescriptionFragment = ({
21293
+ legalEntityResponse
21294
+ }) => {
21295
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
21296
+ const { i18n } = useI18nContext();
21297
+ const hasSolePropEntityAssociations = hasOwnEntityAssociationOfType(
21298
+ LegalEntityType.SOLE_PROPRIETORSHIP,
21299
+ legalEntityResponse.entityAssociations,
21300
+ legalEntityResponse.id
21301
+ );
21302
+ const { accountHolder } = useCoreContext();
21303
+ if (accountHolder === "mySoleProprietorName" || hasSolePropEntityAssociations) {
21304
+ const soleProp = (_a = legalEntityResponse.entityAssociations) == null ? void 0 : _a.find(
21305
+ (ea) => ea.entityType === "soleProprietorship"
21306
+ );
21307
+ const { individual: individual2 } = legalEntityResponse;
21308
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
21309
+ `${i18n.get("bankAccountHasToBeInYourName")} `,
21310
+ /* @__PURE__ */ jsx("b", { children: `${individual2 == null ? void 0 : individual2.name.firstName} ${individual2 == null ? void 0 : individual2.name.lastName}` }),
21311
+ ` ${i18n.get("orSoleProprietorshipName")} `,
21312
+ " ",
21313
+ /* @__PURE__ */ jsx("b", { children: `${(soleProp == null ? void 0 : soleProp.name) ?? ""}` })
21314
+ ] });
21315
+ }
21316
+ const hasTrustsEntityAssociations = hasOwnEntityAssociationOfType(
21317
+ LegalEntityType.TRUST,
21318
+ legalEntityResponse.entityAssociations,
21319
+ legalEntityResponse.id
21320
+ );
21321
+ if (accountHolder === "aTrust" || hasTrustsEntityAssociations) {
21322
+ const trust = (_b = legalEntityResponse.entityAssociations) == null ? void 0 : _b.find((ea) => ea.entityType === "trust");
21323
+ if (legalEntityResponse.type === LegalEntityType.INDIVIDUAL) {
21324
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
21325
+ `${i18n.get("bankAccountToHaveSameNameAsTrust")} `,
21326
+ /* @__PURE__ */ jsx("b", { children: i18n.get("trusteeAsTrusteeForTrust", {
21327
+ values: {
21328
+ trusteeName: `${(_c = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _c.name.firstName} ${(_d = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _d.name.lastName}`,
21329
+ trustName: (trust == null ? void 0 : trust.name) ?? ""
21330
+ }
21331
+ }) })
21332
+ ] });
21333
+ }
21334
+ const companyTrusteeBankAccountName = ((_e = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _e.legalName) !== ((_f = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _f.doingBusinessAs) ? i18n.get("trusteeAsTrusteeForTrustDoingBusinessAs", {
21335
+ values: {
21336
+ trusteeName: ((_g = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _g.legalName) ?? "",
21337
+ trustName: (trust == null ? void 0 : trust.name) ?? "",
21338
+ tradingName: (_h = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _h.doingBusinessAs
21339
+ }
21340
+ }) : i18n.get("trusteeAsTrusteeForTrust", {
21341
+ values: {
21342
+ trusteeName: ((_i = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _i.legalName) ?? "",
21343
+ trustName: (trust == null ? void 0 : trust.name) ?? ""
21344
+ }
21345
+ });
21346
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
21347
+ /* @__PURE__ */ jsx("div", { children: `${i18n.get("bankAccountToHaveSameNameAsTrust")} ` }),
21348
+ /* @__PURE__ */ jsx("b", { children: companyTrusteeBankAccountName })
21349
+ ] });
21350
+ }
21351
+ if (legalEntityResponse.type === LegalEntityType.ORGANIZATION) {
21352
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
21353
+ `${i18n.get("bankAccountHasToBeInYourCompanyName")} `,
21354
+ /* @__PURE__ */ jsx("b", { children: (_j = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _j.legalName })
21355
+ ] });
21356
+ }
21357
+ const { individual } = legalEntityResponse;
21358
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
21359
+ `${i18n.get("bankAccountHasToBeInYourName")} `,
21360
+ /* @__PURE__ */ jsx("b", { children: `${individual == null ? void 0 : individual.name.firstName} ${individual == null ? void 0 : individual.name.lastName}` })
21361
+ ] });
21362
+ };
21231
21363
  const CheckGuidance = ({ annotated }) => /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-check-guidance", children: [
21232
21364
  /* @__PURE__ */ jsx(
21233
21365
  Svg,
@@ -21269,7 +21401,7 @@ const payoutAccountFields = [
21269
21401
  ...bankCodeFields
21270
21402
  ];
21271
21403
  function PayoutAccountComponent(props) {
21272
- const { accountHolder, accountFormat, setAccountFormat } = useCoreContext();
21404
+ const { accountFormat, setAccountFormat } = useCoreContext();
21273
21405
  const { i18n } = useI18nContext();
21274
21406
  const [checkAnnotation, setCheckAnnotation] = useState();
21275
21407
  const { isSettingEnabled } = useSettingsContext();
@@ -21286,7 +21418,7 @@ function PayoutAccountComponent(props) {
21286
21418
  invalidFieldNames
21287
21419
  } = props;
21288
21420
  const showCheckGuidance = shouldShowCheckGuidance(country);
21289
- const { data, valid, errors, handleChangeFor, schema } = useForm({
21421
+ const { data, valid, errors, schema } = useForm({
21290
21422
  ...props,
21291
21423
  defaultData: props.data,
21292
21424
  schema: requiredFields,
@@ -21310,19 +21442,14 @@ function PayoutAccountComponent(props) {
21310
21442
  const bankNameProps = getFieldProps(props, bankNameFields);
21311
21443
  const bankCodeProps = getFieldProps(props, bankCodeFields);
21312
21444
  const bankCityProps = getFieldProps(props, bankCityFields);
21313
- const hasSoleProprietorship = accountHolder === "mySoleProprietorName" || hasOwnEntityAssociationOfType(
21314
- LegalEntityType.SOLE_PROPRIETORSHIP,
21315
- legalEntityResponse.entityAssociations,
21316
- legalEntityResponse.id
21317
- );
21318
- const hasTrusts = accountHolder === "aTrust" || hasOwnEntityAssociationOfType(
21319
- LegalEntityType.TRUST,
21320
- legalEntityResponse.entityAssociations,
21321
- legalEntityResponse.id
21322
- );
21323
- const accountHolderDescriptionKey = hasSoleProprietorship ? "accountHolderDescriptionSoleProp" : hasTrusts ? "bankAccountToHaveSameNameAsTrust" : legalEntityResponse.type === LegalEntityType.ORGANIZATION ? "accountHolderDescriptionCompany" : "accountHolderDescriptionIndividual";
21324
21445
  return /* @__PURE__ */ jsxs("form", { className: "adyen-kyc-individual__payout-account", "aria-describedby": "ariaErrorField", children: [
21325
- /* @__PURE__ */ jsx(FormHeader, { heading }),
21446
+ /* @__PURE__ */ jsx(
21447
+ FormHeader,
21448
+ {
21449
+ heading,
21450
+ descriptionComponent: /* @__PURE__ */ jsx(AccountHolderDescriptionFragment, { legalEntityResponse })
21451
+ }
21452
+ ),
21326
21453
  /* @__PURE__ */ jsx(
21327
21454
  ErrorPanel,
21328
21455
  {
@@ -21333,31 +21460,6 @@ function PayoutAccountComponent(props) {
21333
21460
  }
21334
21461
  ),
21335
21462
  showCheckGuidance ? /* @__PURE__ */ jsx(CheckGuidance, { annotated: checkAnnotation }) : void 0,
21336
- formUtils.isRequiredField("accountHolder") && /* @__PURE__ */ jsx(
21337
- Field,
21338
- {
21339
- name: "accountHolder",
21340
- label: formUtils.getLabel("accountHolder"),
21341
- helper: i18n.get(accountHolderDescriptionKey),
21342
- classNameModifiers: ["accountHolder"],
21343
- isValid: valid.accountHolder,
21344
- children: (childProps) => /* @__PURE__ */ jsx(
21345
- InputText,
21346
- {
21347
- ...childProps,
21348
- name: "accountHolder",
21349
- value: data.accountHolder,
21350
- placeholder: formUtils.getPlaceholder("accountHolder"),
21351
- readonly: true,
21352
- onInput: handleChangeFor("accountHolder", "input"),
21353
- onBlur: handleChangeFor("accountHolder", "blur"),
21354
- "aria-required": true,
21355
- "aria-label": formUtils.getLabel("accountHolder"),
21356
- "aria-invalid": !valid.accountHolder
21357
- }
21358
- )
21359
- }
21360
- ),
21361
21463
  bankAccountFormatSelectionAllowed && shouldShowPayoutAccountFormatSelector(country) && accountFormat && /* @__PURE__ */ jsx(
21362
21464
  BankAccountFormat,
21363
21465
  {
@@ -21365,6 +21467,16 @@ function PayoutAccountComponent(props) {
21365
21467
  handleAccountFormatChange: setAccountFormat
21366
21468
  }
21367
21469
  ),
21470
+ formUtils.isRequiredField("branchCode") && /* @__PURE__ */ jsx(
21471
+ BranchCode,
21472
+ {
21473
+ ...branchCodeProps,
21474
+ country,
21475
+ dataStoreId: id,
21476
+ onFocus: showCheckGuidance ? () => setCheckAnnotation("routing") : void 0,
21477
+ onBlur: showCheckGuidance ? () => setCheckAnnotation(void 0) : void 0
21478
+ }
21479
+ ),
21368
21480
  formUtils.isRequiredField("bankAccountNumber") && /* @__PURE__ */ jsx(
21369
21481
  BankAccountNumber,
21370
21482
  {
@@ -21379,16 +21491,6 @@ function PayoutAccountComponent(props) {
21379
21491
  formUtils.isRequiredField("swiftCode") && /* @__PURE__ */ jsx(SwiftCode, { ...swiftCodeProps, dataStoreId: id }),
21380
21492
  formUtils.isRequiredField("bankName") && /* @__PURE__ */ jsx(BankName, { ...bankNameProps, dataStoreId: id }),
21381
21493
  formUtils.isRequiredField("bankCode") && /* @__PURE__ */ jsx(BankCode, { ...bankCodeProps, country, dataStoreId: id }),
21382
- formUtils.isRequiredField("branchCode") && /* @__PURE__ */ jsx(
21383
- BranchCode,
21384
- {
21385
- ...branchCodeProps,
21386
- country,
21387
- dataStoreId: id,
21388
- onFocus: showCheckGuidance ? () => setCheckAnnotation("routing") : void 0,
21389
- onBlur: showCheckGuidance ? () => setCheckAnnotation(void 0) : void 0
21390
- }
21391
- ),
21392
21494
  formUtils.isRequiredField("bankCity") && /* @__PURE__ */ jsx(BankCity, { ...bankCityProps, dataStoreId: id }),
21393
21495
  shouldShowPayoutAlert(country) && /* @__PURE__ */ jsx(
21394
21496
  Alert,
@@ -21480,77 +21582,6 @@ const makePayoutVerificationMethodsMetadata = (instantVerificationProvider) => {
21480
21582
  };
21481
21583
  };
21482
21584
  const payoutVerificationMethods = ["instantVerification", "manualVerification"];
21483
- const AccountHolderDescriptionFragment = ({
21484
- legalEntityResponse
21485
- }) => {
21486
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
21487
- const { i18n } = useI18nContext();
21488
- const hasSolePropEntityAssociations = hasOwnEntityAssociationOfType(
21489
- LegalEntityType.SOLE_PROPRIETORSHIP,
21490
- legalEntityResponse.entityAssociations,
21491
- legalEntityResponse.id
21492
- );
21493
- const { accountHolder } = useCoreContext();
21494
- if (accountHolder === "mySoleProprietorName" || hasSolePropEntityAssociations) {
21495
- const soleProp = (_a = legalEntityResponse.entityAssociations) == null ? void 0 : _a.find(
21496
- (ea) => ea.entityType === "soleProprietorship"
21497
- );
21498
- const { individual: individual2 } = legalEntityResponse;
21499
- return /* @__PURE__ */ jsxs(Fragment, { children: [
21500
- `${i18n.get("bankAccountHasToBeInYourName")} `,
21501
- /* @__PURE__ */ jsx("b", { children: `${individual2 == null ? void 0 : individual2.name.firstName} ${individual2 == null ? void 0 : individual2.name.lastName}` }),
21502
- ` ${i18n.get("orSoleProprietorshipName")} `,
21503
- " ",
21504
- /* @__PURE__ */ jsx("b", { children: `${(soleProp == null ? void 0 : soleProp.name) ?? ""}` })
21505
- ] });
21506
- }
21507
- const hasTrustsEntityAssociations = hasOwnEntityAssociationOfType(
21508
- LegalEntityType.TRUST,
21509
- legalEntityResponse.entityAssociations,
21510
- legalEntityResponse.id
21511
- );
21512
- if (accountHolder === "aTrust" || hasTrustsEntityAssociations) {
21513
- const trust = (_b = legalEntityResponse.entityAssociations) == null ? void 0 : _b.find((ea) => ea.entityType === "trust");
21514
- if (legalEntityResponse.type === LegalEntityType.INDIVIDUAL) {
21515
- return /* @__PURE__ */ jsxs(Fragment, { children: [
21516
- `${i18n.get("bankAccountToHaveSameNameAsTrust")} `,
21517
- /* @__PURE__ */ jsx("b", { children: i18n.get("trusteeAsTrusteeForTrust", {
21518
- values: {
21519
- trusteeName: `${(_c = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _c.name.firstName} ${(_d = legalEntityResponse == null ? void 0 : legalEntityResponse.individual) == null ? void 0 : _d.name.lastName}`,
21520
- trustName: (trust == null ? void 0 : trust.name) ?? ""
21521
- }
21522
- }) })
21523
- ] });
21524
- }
21525
- const companyTrusteeBankAccountName = ((_e = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _e.legalName) !== ((_f = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _f.doingBusinessAs) ? i18n.get("trusteeAsTrusteeForTrustDoingBusinessAs", {
21526
- values: {
21527
- trusteeName: ((_g = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _g.legalName) ?? "",
21528
- trustName: (trust == null ? void 0 : trust.name) ?? "",
21529
- tradingName: (_h = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _h.doingBusinessAs
21530
- }
21531
- }) : i18n.get("trusteeAsTrusteeForTrust", {
21532
- values: {
21533
- trusteeName: ((_i = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _i.legalName) ?? "",
21534
- trustName: (trust == null ? void 0 : trust.name) ?? ""
21535
- }
21536
- });
21537
- return /* @__PURE__ */ jsxs(Fragment, { children: [
21538
- /* @__PURE__ */ jsx("div", { children: `${i18n.get("bankAccountToHaveSameNameAsTrust")} ` }),
21539
- /* @__PURE__ */ jsx("b", { children: companyTrusteeBankAccountName })
21540
- ] });
21541
- }
21542
- if (legalEntityResponse.type === LegalEntityType.ORGANIZATION) {
21543
- return /* @__PURE__ */ jsxs(Fragment, { children: [
21544
- `${i18n.get("bankAccountHasToBeInYourCompanyName")} `,
21545
- /* @__PURE__ */ jsx("b", { children: (_j = legalEntityResponse == null ? void 0 : legalEntityResponse.organization) == null ? void 0 : _j.legalName })
21546
- ] });
21547
- }
21548
- const { individual } = legalEntityResponse;
21549
- return /* @__PURE__ */ jsxs(Fragment, { children: [
21550
- `${i18n.get("bankAccountHasToBeInYourName")} `,
21551
- /* @__PURE__ */ jsx("b", { children: `${individual == null ? void 0 : individual.name.firstName} ${individual == null ? void 0 : individual.name.lastName}` })
21552
- ] });
21553
- };
21554
21585
  function Card({
21555
21586
  className,
21556
21587
  children,
@@ -21615,7 +21646,7 @@ function Card({
21615
21646
  const skeleton = "adyen-kyc-skeleton";
21616
21647
  const skeletonCircle = "adyen-kyc-skeleton-circle";
21617
21648
  const skeletonText = "adyen-kyc-skeleton-text";
21618
- const styles$4 = {
21649
+ const styles$5 = {
21619
21650
  skeleton,
21620
21651
  "skeleton-circle": "adyen-kyc-skeleton-circle",
21621
21652
  skeletonCircle,
@@ -21628,19 +21659,61 @@ const Skeleton = ({
21628
21659
  height = "1em",
21629
21660
  width
21630
21661
  }) => {
21631
- const classNames = cx(styles$4.skeleton, {
21632
- [styles$4.skeletonCircle]: circle,
21633
- [styles$4.skeletonText]: text
21662
+ const classNames = cx(styles$5.skeleton, {
21663
+ [styles$5.skeletonCircle]: circle,
21664
+ [styles$5.skeletonText]: text
21634
21665
  });
21635
21666
  return /* @__PURE__ */ jsx("div", { className: classNames, style: { height, width } });
21636
21667
  };
21668
+ const isInstantVerificationAvailable = ({
21669
+ verificationVendorsCallback,
21670
+ provider
21671
+ }) => Boolean(verificationVendorsCallback && (provider == null ? void 0 : provider.redirectUrl));
21672
+ const isProviderPlaidEmbedded = (redirectUrl) => !!(redirectUrl == null ? void 0 : redirectUrl.includes("/plaid/embedded-search/sdk?"));
21673
+ const rules$2 = ({ data, requiredFields }) => ({
21674
+ whenUsingManualVerification: () => {
21675
+ var _a;
21676
+ if (!data.payoutVerificationMethod) return;
21677
+ if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
21678
+ return "REQUIRED";
21679
+ }
21680
+ },
21681
+ whenUsingInstantVerification: () => {
21682
+ var _a;
21683
+ if (!data.payoutVerificationMethod) {
21684
+ return "REQUIRED";
21685
+ }
21686
+ if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
21687
+ return "REQUIRED";
21688
+ }
21689
+ },
21690
+ verifiedBankAccountNumber: () => {
21691
+ var _a;
21692
+ if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
21693
+ return "REQUIRED";
21694
+ }
21695
+ },
21696
+ bankStatementRequirement: () => {
21697
+ var _a;
21698
+ if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
21699
+ return requiredFields == null ? void 0 : requiredFields.bankStatementRequirement;
21700
+ }
21701
+ },
21702
+ // "bankStatement description" field is always "optional" and it's coupled with bank statement document.
21703
+ bankStatementDescription: () => {
21704
+ var _a;
21705
+ if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification" && !!(requiredFields == null ? void 0 : requiredFields.bankStatementRequirement)) {
21706
+ return "OPTIONAL";
21707
+ }
21708
+ }
21709
+ });
21637
21710
  const preferInstantVerificationMethod = "adyen-kyc-prefer-instant-verification-method";
21638
21711
  const preferInstantVerificationMethodCard = "adyen-kyc-prefer-instant-verification-method-card";
21639
21712
  const preferInstantVerificationMethodImage = "adyen-kyc-prefer-instant-verification-method-image";
21640
21713
  const preferInstantVerificationMethodInstantButton = "adyen-kyc-prefer-instant-verification-method-instant-button";
21641
- const preferInstantVerificationMethodManualButton = "adyen-kyc-prefer-instant-verification-method-manual-button";
21642
- const preferInstantVerificationMethodManualButtonDark = "adyen-kyc-prefer-instant-verification-method-manual-button-dark";
21643
- const styles$3 = {
21714
+ const preferInstantVerificationMethodActions = "adyen-kyc-prefer-instant-verification-method-actions";
21715
+ const preferInstantVerificationMethodManualButtonDarker = "adyen-kyc-prefer-instant-verification-method-manual-button-darker";
21716
+ const styles$4 = {
21644
21717
  "prefer-instant-verification-method": "adyen-kyc-prefer-instant-verification-method",
21645
21718
  preferInstantVerificationMethod,
21646
21719
  "prefer-instant-verification-method-card": "adyen-kyc-prefer-instant-verification-method-card",
@@ -21649,10 +21722,10 @@ const styles$3 = {
21649
21722
  preferInstantVerificationMethodImage,
21650
21723
  "prefer-instant-verification-method-instant-button": "adyen-kyc-prefer-instant-verification-method-instant-button",
21651
21724
  preferInstantVerificationMethodInstantButton,
21652
- "prefer-instant-verification-method-manual-button": "adyen-kyc-prefer-instant-verification-method-manual-button",
21653
- preferInstantVerificationMethodManualButton,
21654
- "prefer-instant-verification-method-manual-button-dark": "adyen-kyc-prefer-instant-verification-method-manual-button-dark",
21655
- preferInstantVerificationMethodManualButtonDark
21725
+ "prefer-instant-verification-method-actions": "adyen-kyc-prefer-instant-verification-method-actions",
21726
+ preferInstantVerificationMethodActions,
21727
+ "prefer-instant-verification-method-manual-button-darker": "adyen-kyc-prefer-instant-verification-method-manual-button-darker",
21728
+ preferInstantVerificationMethodManualButtonDarker
21656
21729
  };
21657
21730
  const getProviderIconName = (providerName) => {
21658
21731
  switch (providerName) {
@@ -21668,52 +21741,87 @@ const getProviderIconName = (providerName) => {
21668
21741
  };
21669
21742
  const PreferInstantVerificationMethod = ({
21670
21743
  loadingStatus,
21671
- providerName,
21744
+ provider,
21672
21745
  bankInfoValidated,
21673
21746
  instantVerificationAvailable,
21674
- selectVerificationMethod
21747
+ selectVerificationMethod,
21748
+ createTrustedTransferInstrument: createTrustedTransferInstrument2,
21749
+ setBankInfoValidated,
21750
+ handleBankVerificationError: handleBankVerificationError2,
21751
+ setBankVerificationError,
21752
+ refreshLegalEntity,
21753
+ handleChangeFor,
21754
+ triggerValidation
21675
21755
  }) => {
21756
+ var _a;
21676
21757
  const { i18n } = useI18nContext();
21677
- const iconName = getProviderIconName(providerName == null ? void 0 : providerName.toLocaleLowerCase());
21678
- return /* @__PURE__ */ jsxs("div", { className: styles$3.preferInstantVerificationMethod, children: [
21679
- loadingStatus === "loading" ? /* @__PURE__ */ jsx(Skeleton, { height: "21rem" }) : instantVerificationAvailable && /* @__PURE__ */ jsx(Card, { background: "secondary", children: /* @__PURE__ */ jsxs("div", { className: styles$3.preferInstantVerificationMethodCard, children: [
21680
- /* @__PURE__ */ jsx(
21681
- Svg,
21682
- {
21683
- type: "image",
21684
- name: "instant-verification-method",
21685
- className: styles$3.preferInstantVerificationMethodImage
21686
- }
21687
- ),
21688
- /* @__PURE__ */ jsx(Typography, { el: "p", variant: "body-stronger", children: i18n.get("instantlyConnectAndVerifyYourBankAccount") }),
21689
- /* @__PURE__ */ jsx(
21690
- Button,
21691
- {
21692
- type: "button",
21693
- label: i18n.get("connectWith", {
21694
- values: { providerName: iconName ? "" : providerName }
21695
- }),
21696
- className: styles$3.preferInstantVerificationMethodInstantButton,
21697
- onClick: () => selectVerificationMethod("instantVerification"),
21698
- disabled: bankInfoValidated,
21699
- icon: iconName,
21700
- iconPosition: "right"
21701
- }
21702
- )
21703
- ] }) }),
21758
+ const iconName = getProviderIconName((_a = provider == null ? void 0 : provider.name) == null ? void 0 : _a.toLocaleLowerCase());
21759
+ const showVerificationWidget = isProviderPlaidEmbedded(provider == null ? void 0 : provider.redirectUrl);
21760
+ const [verificationComplete, setVerificationComplete] = useState(false);
21761
+ const retrieveBankAccountInfo = async ({
21762
+ realLastFour,
21763
+ number,
21764
+ bankName
21765
+ }) => {
21766
+ handleChangeFor("payoutVerificationMethod")("instantVerification");
21767
+ handleChangeFor("verifiedBankAccountNumber")(realLastFour ? `*******${realLastFour}` : number);
21768
+ handleChangeFor("verifiedBankName")(bankName);
21769
+ setBankInfoValidated == null ? void 0 : setBankInfoValidated(true);
21770
+ triggerValidation();
21771
+ await (refreshLegalEntity == null ? void 0 : refreshLegalEntity());
21772
+ };
21773
+ const bankVerificationWidget = verificationComplete ? bankInfoValidated && /* @__PURE__ */ jsx(Alert, { title: i18n.get("youSuccessfullyVerifiedAccount"), variant: "success" }) : provider && /* @__PURE__ */ jsx(
21774
+ BankVerificationWidget,
21775
+ {
21776
+ url: provider.redirectUrl,
21777
+ vendor: provider.name,
21778
+ createTrustedTransferInstrument: createTrustedTransferInstrument2,
21779
+ handleBankVerificationError: handleBankVerificationError2,
21780
+ setBankVerificationError,
21781
+ setVerificationComplete,
21782
+ retrieveBankAccountInfo
21783
+ }
21784
+ );
21785
+ const providerBanner = provider && /* @__PURE__ */ jsx(Card, { background: "secondary", children: /* @__PURE__ */ jsxs("div", { className: styles$4.preferInstantVerificationMethodCard, children: [
21786
+ /* @__PURE__ */ jsx(
21787
+ Svg,
21788
+ {
21789
+ type: "image",
21790
+ name: "instant-verification-method",
21791
+ className: styles$4.preferInstantVerificationMethodImage
21792
+ }
21793
+ ),
21794
+ /* @__PURE__ */ jsx(Typography, { el: "p", variant: "body-stronger", children: i18n.get("instantlyConnectAndVerifyYourBankAccount") }),
21704
21795
  /* @__PURE__ */ jsx(
21796
+ Button,
21797
+ {
21798
+ type: "button",
21799
+ label: i18n.get("connectWith", {
21800
+ values: { providerName: iconName ? "" : provider.name }
21801
+ }),
21802
+ className: styles$4.preferInstantVerificationMethodInstantButton,
21803
+ onClick: () => selectVerificationMethod("instantVerification"),
21804
+ disabled: bankInfoValidated,
21805
+ icon: iconName,
21806
+ iconPosition: "right"
21807
+ }
21808
+ )
21809
+ ] }) });
21810
+ return /* @__PURE__ */ jsxs("div", { className: styles$4.preferInstantVerificationMethod, children: [
21811
+ loadingStatus === "loading" ? /* @__PURE__ */ jsx(Skeleton, { height: "21rem" }) : instantVerificationAvailable && (showVerificationWidget ? bankVerificationWidget : providerBanner),
21812
+ /* @__PURE__ */ jsx("div", { className: styles$4.preferInstantVerificationMethodActions, children: /* @__PURE__ */ jsx(
21705
21813
  Button,
21706
21814
  {
21707
21815
  type: "button",
21708
21816
  label: i18n.get("addAccountManually"),
21709
21817
  tertiary: instantVerificationAvailable,
21710
- className: cx(styles$3.preferInstantVerificationMethodManualButton, {
21711
- [styles$3.preferInstantVerificationMethodManualButtonDark]: instantVerificationAvailable
21818
+ className: cx({
21819
+ [styles$4.preferInstantVerificationMethodManualButtonDarker]: instantVerificationAvailable
21712
21820
  }),
21713
21821
  onClick: () => selectVerificationMethod("manualVerification"),
21714
21822
  disabled: bankInfoValidated
21715
21823
  }
21716
- )
21824
+ ) })
21717
21825
  ] });
21718
21826
  };
21719
21827
  const PayoutVerificationMethodOptionIcon = ({
@@ -21742,10 +21850,7 @@ const PayoutVerificationMethodOptionFooter = ({
21742
21850
  )
21743
21851
  ] }) : null;
21744
21852
  };
21745
- const payoutVerificationMethodFields = [
21746
- "payoutVerificationMethod",
21747
- "bankCountry"
21748
- ];
21853
+ const payoutVerificationMethodFields = ["payoutVerificationMethod", "bankCountry", ...accountVerificationFields];
21749
21854
  const getMustHaveSameAccountHolderNameText = (legalEntityType, accountHolderName, i18n) => {
21750
21855
  switch (legalEntityType) {
21751
21856
  case LegalEntityType.INDIVIDUAL:
@@ -21761,20 +21866,26 @@ const getMustHaveSameAccountHolderNameText = (legalEntityType, accountHolderName
21761
21866
  }
21762
21867
  };
21763
21868
  function PayoutVerificationMethod(props) {
21764
- var _a;
21869
+ var _a, _b;
21765
21870
  const {
21871
+ heading,
21872
+ country,
21766
21873
  accountHolder,
21767
- legalEntityResponse,
21768
21874
  provider,
21769
- heading,
21875
+ bankVendorsLoadingStatus,
21876
+ instantVerificationAllowed,
21877
+ legalEntityResponse,
21770
21878
  forms,
21771
- country,
21772
21879
  validators: validators2,
21880
+ isActiveForm,
21773
21881
  bankInfoValidated,
21774
- instantVerificationAllowed,
21775
- bankVendorsLoadingStatus,
21882
+ setBankInfoValidated,
21776
21883
  handleNextClick,
21777
- isActiveForm
21884
+ createTrustedTransferInstrument: createTrustedTransferInstrument2,
21885
+ refreshLegalEntity,
21886
+ handleBankVerificationError: handleBankVerificationError2,
21887
+ setBankVerificationError,
21888
+ setHideFooter
21778
21889
  } = props;
21779
21890
  const { type: legalEntityType } = legalEntityResponse;
21780
21891
  const { i18n } = useI18nContext();
@@ -21789,10 +21900,15 @@ function PayoutVerificationMethod(props) {
21789
21900
  SettingNames.AllowIntraRegionCrossBorderPayout
21790
21901
  );
21791
21902
  const [hasSelectedMethod, setHasSelectedMethod] = useState(false);
21792
- const { handleChangeFor, data, valid, errors, fieldProblems } = useForm({
21903
+ const { handleChangeFor, data, valid, errors, fieldProblems, triggerValidation } = useForm({
21793
21904
  ...props,
21794
21905
  schema: payoutVerificationMethodFields,
21795
- defaultData: { bankCountry: country, ...props.data },
21906
+ defaultData: {
21907
+ verifiedAccountHolder: accountHolder,
21908
+ verifiedCurrencyCode: (_a = currencyByCountry[country]) == null ? void 0 : _a[0],
21909
+ bankCountry: country,
21910
+ ...props.data
21911
+ },
21796
21912
  rules: validators2,
21797
21913
  fieldProblems: props == null ? void 0 : props.fieldValidationErrors
21798
21914
  });
@@ -21802,6 +21918,12 @@ function PayoutVerificationMethod(props) {
21802
21918
  () => updateStateSlice({ data: { ...sliceData, ...data }, errors, valid, fieldProblems }),
21803
21919
  [data, errors, fieldProblems, valid]
21804
21920
  );
21921
+ useEffect(() => {
21922
+ if (!enablePreferInstantVerificationMethodFlow) return;
21923
+ setHideFooter == null ? void 0 : setHideFooter(
21924
+ enablePreferInstantVerificationMethodFlow && isActiveForm && !bankInfoValidated
21925
+ );
21926
+ }, [enablePreferInstantVerificationMethodFlow, isActiveForm, bankInfoValidated, setHideFooter]);
21805
21927
  const instantVerificationAvailable = useMemo(
21806
21928
  () => Boolean(instantVerificationAllowed && (provider == null ? void 0 : provider.redirectUrl)),
21807
21929
  [instantVerificationAllowed, provider]
@@ -21851,7 +21973,7 @@ function PayoutVerificationMethod(props) {
21851
21973
  }
21852
21974
  }, [provider, bankVendorsLoadingStatus, enablePreferInstantVerificationMethodFlow]);
21853
21975
  const { dataset: countries } = useDataset(datasetIdentifier.country);
21854
- const bankCountryName = ((_a = countries.find((country2) => country2.id === data.bankCountry)) == null ? void 0 : _a.name) ?? data.bankCountry;
21976
+ const bankCountryName = ((_b = countries.find((country2) => country2.id === data.bankCountry)) == null ? void 0 : _b.name) ?? data.bankCountry;
21855
21977
  const allowedBankCountries = getAllowedBankCountries(country);
21856
21978
  const countryField = /* @__PURE__ */ jsx(
21857
21979
  CountryField,
@@ -21899,10 +22021,17 @@ function PayoutVerificationMethod(props) {
21899
22021
  PreferInstantVerificationMethod,
21900
22022
  {
21901
22023
  loadingStatus: bankVendorsLoadingStatus,
21902
- providerName: provider == null ? void 0 : provider.name,
22024
+ provider,
21903
22025
  instantVerificationAvailable,
21904
22026
  bankInfoValidated,
21905
- selectVerificationMethod
22027
+ selectVerificationMethod,
22028
+ handleChangeFor,
22029
+ setBankInfoValidated,
22030
+ createTrustedTransferInstrument: createTrustedTransferInstrument2,
22031
+ handleBankVerificationError: handleBankVerificationError2,
22032
+ setBankVerificationError,
22033
+ triggerValidation,
22034
+ refreshLegalEntity
21906
22035
  }
21907
22036
  ) : /* @__PURE__ */ jsx(
21908
22037
  Field,
@@ -22016,17 +22145,6 @@ const payoutSteps = {
22016
22145
  const PayoutVerificationMethodFormID = payoutSteps.payoutVerificationMethod.formId;
22017
22146
  const PayoutAccountDocumentsFormID = payoutSteps.payoutAccountDocuments.formId;
22018
22147
  const PayoutAccountVerificationFormID = payoutSteps.payoutAccountVerification.formId;
22019
- const getAppropriatePayoutDetailsSteps = (isEditing, instantVerificationAvailable, canChangeCountry) => {
22020
- const dependentSteps = {
22021
- payoutAccountDetails: payoutSteps.payoutAccountDetails,
22022
- payoutAccountDocuments: payoutSteps.payoutAccountDocuments,
22023
- payoutAccountVerification: payoutSteps.payoutAccountVerification
22024
- };
22025
- return !isEditing && (instantVerificationAvailable || canChangeCountry) ? {
22026
- payoutVerificationMethod: payoutSteps.payoutVerificationMethod,
22027
- ...dependentSteps
22028
- } : dependentSteps;
22029
- };
22030
22148
  function PayoutDetailsComponent(props) {
22031
22149
  var _a, _b;
22032
22150
  const { i18n } = useI18nContext();
@@ -22041,6 +22159,7 @@ function PayoutDetailsComponent(props) {
22041
22159
  setHideDropinLayout,
22042
22160
  setHideOnHomeButton,
22043
22161
  setSkipSubmit,
22162
+ setHideFooter,
22044
22163
  setSubmitButtonLabel,
22045
22164
  createTrustedTransferInstrument: createTrustedTransferInstrument2,
22046
22165
  handleBankVerificationError: handleBankVerificationError2,
@@ -22066,7 +22185,9 @@ function PayoutDetailsComponent(props) {
22066
22185
  const globalData = useGlobalData();
22067
22186
  const data = isEmpty$1(globalData) ? propData : globalData;
22068
22187
  const resetData = useResetGlobalData();
22188
+ const { isExperimentEnabled } = useExperimentsContext();
22069
22189
  const verifyInstantly = ((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification";
22190
+ const showBankVerification = !(isProviderPlaidEmbedded(provider == null ? void 0 : provider.redirectUrl) && isExperimentEnabled("EnablePreferInstantVerificationFlow"));
22070
22191
  const bankCountry = ((_b = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _b.bankCountry) ?? country;
22071
22192
  useEffect(() => resetData(), [resetData]);
22072
22193
  useEffect(() => {
@@ -22111,8 +22232,8 @@ function PayoutDetailsComponent(props) {
22111
22232
  PayoutVerificationMethod,
22112
22233
  {
22113
22234
  ...verificationMethodFormProps,
22114
- heading: taskHeading,
22115
22235
  id: PayoutVerificationMethodFormID,
22236
+ heading: taskHeading,
22116
22237
  country,
22117
22238
  forms,
22118
22239
  isActiveForm: (activeForm == null ? void 0 : activeForm.formId) === PayoutVerificationMethodFormID,
@@ -22121,15 +22242,21 @@ function PayoutDetailsComponent(props) {
22121
22242
  provider,
22122
22243
  bankVendorsLoadingStatus,
22123
22244
  bankInfoValidated,
22245
+ setBankInfoValidated,
22124
22246
  handleNextClick,
22125
22247
  instantVerificationAllowed: Boolean(
22126
22248
  instantVerificationEnabled && handleGetBankVerificationVendors
22127
- )
22249
+ ),
22250
+ createTrustedTransferInstrument: createTrustedTransferInstrument2,
22251
+ handleBankVerificationError: handleBankVerificationError2,
22252
+ setBankVerificationError: setInstantVerificationError,
22253
+ refreshLegalEntity: props.refreshLegalEntity,
22254
+ setHideFooter
22128
22255
  }
22129
22256
  ) })
22130
22257
  }
22131
22258
  ),
22132
- verifyInstantly ? /* @__PURE__ */ jsx(
22259
+ verifyInstantly ? showBankVerification && /* @__PURE__ */ jsx(
22133
22260
  "div",
22134
22261
  {
22135
22262
  className: (activeForm == null ? void 0 : activeForm.formId) !== PayoutAccountVerificationFormID ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
@@ -22303,12 +22430,20 @@ const solePropForms = {
22303
22430
  formId: "solePropConstitutionalDocument",
22304
22431
  formName: "constitutionalDocument",
22305
22432
  fields: ["constitutionalDocument"]
22433
+ },
22434
+ solePropFinancialInformation: {
22435
+ formId: "solePropFinancialInformation",
22436
+ formName: "financialInformation",
22437
+ formHeading: "companyFinancialInformationFormHeading",
22438
+ formDescription: "companyFinancialInformationFormDescription",
22439
+ fields: financialInformationFields
22306
22440
  }
22307
22441
  };
22308
22442
  const solePropNameAndCountryFormId = solePropForms.solePropNameAndCountry.formId;
22309
22443
  const solePropRegistrationAddressFormId = solePropForms.solePropRegistrationAddress.formId;
22310
22444
  const solePropRegistrationDetailsFormId = solePropForms.solePropRegistrationDetails.formId;
22311
22445
  const solePropDocumentFormId = solePropForms.solePropConstitutionalDocument.formId;
22446
+ const solePropFinancialInformationFormId = solePropForms.solePropFinancialInformation.formId;
22312
22447
  function SolePropComponent(props) {
22313
22448
  const { i18n } = useI18nContext();
22314
22449
  const [currentCountry, setCurrentCountry] = useState(props.country);
@@ -22317,6 +22452,7 @@ function SolePropComponent(props) {
22317
22452
  const solePropsRegistrationDetailsFormProps = getFormProps(props, solePropRegistrationDetailsFormId);
22318
22453
  const solePropRegistrationAddressFormProps = getNestedOuterFormPropsFromOuterFormProps(props, solePropRegistrationAddressFormId);
22319
22454
  const solePropDocumentsFormProps = getFormProps(props, solePropDocumentFormId);
22455
+ const solePropFinancialInformationFormProps = getFormProps(props, solePropFinancialInformationFormId);
22320
22456
  const handleStateChange = ({
22321
22457
  currentState,
22322
22458
  prevState
@@ -22409,6 +22545,21 @@ function SolePropComponent(props) {
22409
22545
  }
22410
22546
  )
22411
22547
  }
22548
+ ),
22549
+ /* @__PURE__ */ jsx(
22550
+ "div",
22551
+ {
22552
+ className: activeForm.formId !== solePropFinancialInformationFormId ? "adyen-kyc-form-wrapper adyen-kyc-form-wrapper--hidden" : "adyen-kyc-form-wrapper",
22553
+ children: /* @__PURE__ */ jsx(
22554
+ FinancialInformation,
22555
+ {
22556
+ ...solePropFinancialInformationFormProps,
22557
+ heading: i18n.get("financialInformation"),
22558
+ id: solePropFinancialInformationFormId,
22559
+ country: props.country
22560
+ }
22561
+ )
22562
+ }
22412
22563
  )
22413
22564
  ] });
22414
22565
  };
@@ -22667,8 +22818,7 @@ const getAllowedDecisionMakerRoles = (rootLegalEntity, taskType) => {
22667
22818
  }
22668
22819
  return acc;
22669
22820
  }, []);
22670
- const uniqueAllowedRoles = [...new Set(allowedRoles)];
22671
- return uniqueAllowedRoles;
22821
+ return [...new Set(allowedRoles)];
22672
22822
  };
22673
22823
  const hasMinRequiredDecisionMakerCount = (rootLegalEntity) => {
22674
22824
  var _a, _b;
@@ -23958,6 +24108,11 @@ function ErrorPanel({
23958
24108
  isValidationError2 && /* @__PURE__ */ jsx(ServerValidationErrors, { formUtils, validationErrors })
23959
24109
  ] });
23960
24110
  }
24111
+ const isSummaryItem = (val) => typeof val === "object" && val !== null && "summaryLabel" in val && "summaryValue" in val;
24112
+ const summaryItem = (summaryLabel, summaryValue) => ({
24113
+ summaryLabel,
24114
+ summaryValue
24115
+ });
23961
24116
  const summaryStep = {
23962
24117
  formId: "summary",
23963
24118
  formName: "summary"
@@ -24053,7 +24208,14 @@ function Summary({
24053
24208
  Object.entries(formData).forEach(([field, fieldData]) => {
24054
24209
  if ((omittedKeys == null ? void 0 : omittedKeys.includes(field)) || !fieldData) return;
24055
24210
  const fieldName = i18n.get(labelData[field]) || i18n.get(field);
24056
- if (typeof fieldData === "object") {
24211
+ if (isSummaryItem(fieldData)) {
24212
+ dataList.push(
24213
+ /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-summary-section__field", children: [
24214
+ /* @__PURE__ */ jsx("dt", { className: "adyen-kyc-summary-section__label", children: i18n.get(fieldData.summaryLabel) }),
24215
+ /* @__PURE__ */ jsx("dd", { className: "adyen-kyc-summary-section__data", children: fieldData.summaryValue })
24216
+ ] })
24217
+ );
24218
+ } else if (typeof fieldData === "object") {
24057
24219
  dataList.push(renderSummaryItems(fieldData, labelData));
24058
24220
  } else if (["string", "number"].includes(typeof fieldData)) {
24059
24221
  dataList.push(
@@ -24299,7 +24461,7 @@ const useUnifyLoadingStatus = (setParentLoadingStatus, ...childLoadingStatuses)
24299
24461
  setParentLoadingStatus(loadingStatus);
24300
24462
  }, [...childLoadingStatuses]);
24301
24463
  };
24302
- const logger$t = createLogger("useScenarioConfiguration");
24464
+ const logger$u = createLogger("useScenarioConfiguration");
24303
24465
  const useScenarioConfiguration = ({
24304
24466
  getConfigurationData,
24305
24467
  getPayoutAccountFormatData,
@@ -24322,12 +24484,12 @@ const useScenarioConfiguration = ({
24322
24484
  const response = await getConfigurationData();
24323
24485
  setConfigurationResponse(response);
24324
24486
  } catch (err) {
24325
- logger$t.warn("WARNING: Configuration request failed - error:", err);
24487
+ logger$u.warn("WARNING: Configuration request failed - error:", err);
24326
24488
  } finally {
24327
24489
  setConfigurationLoadingStatus("success");
24328
24490
  }
24329
24491
  };
24330
- makeConfigCallAndSave().catch(logger$t.error);
24492
+ makeConfigCallAndSave().catch(logger$u.error);
24331
24493
  }, [getConfigurationData, setConfigurationLoadingStatus]);
24332
24494
  useEffect(() => {
24333
24495
  if (!getPayoutAccountFormatData) return;
@@ -24346,12 +24508,12 @@ const useScenarioConfiguration = ({
24346
24508
  const defaultAccountFormat = defaultPayoutAccountFormat[country] ?? allowedBankAccountFormats[0];
24347
24509
  setAccountFormat(existingBankAccountFormat ?? defaultAccountFormat);
24348
24510
  } catch (err) {
24349
- logger$t.warn("WARNING: Payout format request failed - error:", err);
24511
+ logger$u.warn("WARNING: Payout format request failed - error:", err);
24350
24512
  } finally {
24351
24513
  setpayoutFormatLoadingStatus("success");
24352
24514
  }
24353
24515
  };
24354
- makePayoutFormatCallAndSave().catch(logger$t.error);
24516
+ makePayoutFormatCallAndSave().catch(logger$u.error);
24355
24517
  }, [
24356
24518
  country,
24357
24519
  setAccountFormat,
@@ -24441,7 +24603,7 @@ const identityBase = {
24441
24603
  rule: "REQUIRED"
24442
24604
  },
24443
24605
  phoneNumber: {
24444
- rule: "contactsIfRequiredForRole"
24606
+ rules: ["requiredIfPhoneScenarioDisabled", "contactsIfRequiredForRole"]
24445
24607
  },
24446
24608
  email: {
24447
24609
  rule: "contactsIfRequiredForRole"
@@ -24514,6 +24676,11 @@ const nationality = {
24514
24676
  rule: "REQUIRED"
24515
24677
  }
24516
24678
  };
24679
+ const phoneNumberBase = {
24680
+ phoneNumber: {
24681
+ rule: "contactsIfRequiredForRole"
24682
+ }
24683
+ };
24517
24684
  const fieldsPerScenario$1 = {
24518
24685
  L0: drop("address", "birthDate").from(identityBase),
24519
24686
  L1: identityBase,
@@ -24534,7 +24701,8 @@ const fieldsPerScenario$1 = {
24534
24701
  ...additionalIdentityInfo,
24535
24702
  ...nationality
24536
24703
  },
24537
- L1_IDDOC: idDocument
24704
+ L1_IDDOC: idDocument,
24705
+ L_PH: phoneNumberBase
24538
24706
  };
24539
24707
  const solePropBase = {
24540
24708
  companyCountry: { rule: "REQUIRED" },
@@ -24556,16 +24724,22 @@ const taxInformationBase = {
24556
24724
  taxInformation: { rule: "countryUsesTaxId" },
24557
24725
  exemptedFromTax: { rule: "countryHasTaxExemptionsForSomeSoleProps" }
24558
24726
  };
24727
+ const financialInformationBase = {
24728
+ numberOfEmployees: { rule: "countryRequiresFinancialInformationForSoleProps" },
24729
+ financialReportingDate: { rule: "countryRequiresFinancialInformationForSoleProps" }
24730
+ };
24559
24731
  const fieldsPerScenario = {
24560
24732
  L0: {
24561
24733
  legalCompanyName: { rule: "REQUIRED" },
24562
- companyCountry: { rule: "REQUIRED" }
24734
+ companyCountry: { rule: "REQUIRED" },
24735
+ ...financialInformationBase
24563
24736
  },
24564
- L1: { ...solePropBase },
24565
- L2: { ...solePropBase },
24737
+ L1: { ...solePropBase, ...financialInformationBase },
24738
+ L2: { ...solePropBase, ...financialInformationBase },
24566
24739
  L: {
24567
24740
  ...solePropBase,
24568
- ...taxInformationBase
24741
+ ...taxInformationBase,
24742
+ ...financialInformationBase
24569
24743
  },
24570
24744
  L_ConstDoc: {
24571
24745
  constitutionalDocument: { rule: "REQUIRED" }
@@ -25099,7 +25273,7 @@ const structuredListListItem = "adyen-kyc-structured-list-list-item";
25099
25273
  const adyenLayoutMd = "adyen-layout-md";
25100
25274
  const structuredListLabel = "adyen-kyc-structured-list-label";
25101
25275
  const structuredListValue = "adyen-kyc-structured-list-value";
25102
- const styles$2 = {
25276
+ const styles$3 = {
25103
25277
  "structured-list": "adyen-kyc-structured-list",
25104
25278
  structuredList,
25105
25279
  "structured-list-list-item": "adyen-kyc-structured-list-list-item",
@@ -25113,9 +25287,9 @@ const styles$2 = {
25113
25287
  };
25114
25288
  const StructuredList = ({ items }) => {
25115
25289
  const { i18n } = useI18nContext();
25116
- return /* @__PURE__ */ jsx("dl", { className: styles$2.structuredList, children: items.map((item) => /* @__PURE__ */ jsxs("div", { className: styles$2.structuredListListItem, children: [
25117
- /* @__PURE__ */ jsx("dt", { className: styles$2.structuredListLabel, children: i18n.get(item.labelKey) }),
25118
- /* @__PURE__ */ jsx("dd", { className: styles$2.structuredListValue, children: item.value })
25290
+ return /* @__PURE__ */ jsx("dl", { className: styles$3.structuredList, children: items.map((item) => /* @__PURE__ */ jsxs("div", { className: styles$3.structuredListListItem, children: [
25291
+ /* @__PURE__ */ jsx("dt", { className: styles$3.structuredListLabel, children: i18n.get(item.labelKey) }),
25292
+ /* @__PURE__ */ jsx("dd", { className: styles$3.structuredListValue, children: item.value })
25119
25293
  ] }, item.labelKey)) });
25120
25294
  };
25121
25295
  function VerifiedBusinessCard({
@@ -25947,7 +26121,7 @@ function BusinessInformationCard({
25947
26121
  }
25948
26122
  );
25949
26123
  }
25950
- const logger$s = createLogger("BusinessSelection");
26124
+ const logger$t = createLogger("BusinessSelection");
25951
26125
  function BusinessSelectionComponent({
25952
26126
  showCompanyStructure,
25953
26127
  searching,
@@ -25999,7 +26173,7 @@ function BusinessSelectionComponent({
25999
26173
  setCurrentBusinessSelection(businessData);
26000
26174
  }
26001
26175
  } catch (e) {
26002
- logger$s.error(e);
26176
+ logger$t.error(e);
26003
26177
  }
26004
26178
  },
26005
26179
  [basicInformation == null ? void 0 : basicInformation.stateOrProvince, fetchBusinessData, fetching, selectedBusinessId]
@@ -26013,7 +26187,7 @@ function BusinessSelectionComponent({
26013
26187
  handleNextClick == null ? void 0 : handleNextClick();
26014
26188
  }
26015
26189
  } catch (e) {
26016
- logger$s.error(e);
26190
+ logger$t.error(e);
26017
26191
  }
26018
26192
  },
26019
26193
  [currentTin, handleNextClick, handleBusinessVerification]
@@ -27123,7 +27297,7 @@ const DECISION_MAKER_TYPES_WITH_JOBTITLE = [
27123
27297
  DecisionMakerType.SIGNATORY,
27124
27298
  DecisionMakerType.CONTROLLING_PERSON
27125
27299
  ];
27126
- const rules$2 = ({
27300
+ const rules$1 = ({
27127
27301
  data,
27128
27302
  country,
27129
27303
  taskType,
@@ -27182,6 +27356,7 @@ const rules$2 = ({
27182
27356
  return REQUIRED;
27183
27357
  }
27184
27358
  },
27359
+ requiredIfPhoneScenarioDisabled: () => !isExperimentEnabled("EnablePhoneFieldScenario") ? REQUIRED : void 0,
27185
27360
  jobTitleIfRequiredForRole: () => {
27186
27361
  var _a, _b;
27187
27362
  if (taskType === TaskTypes.DECISION_MAKER) {
@@ -27597,7 +27772,7 @@ const useExpiryThreshold = (expiry) => {
27597
27772
  return { expiryStatus: "notYetCloseToExpiry", secondsUntilExpiry: void 0 };
27598
27773
  };
27599
27774
  const ExpiryContext = createContext(false);
27600
- const logger$r = createLogger("ExpiryProvider");
27775
+ const logger$s = createLogger("ExpiryProvider");
27601
27776
  const ExpiryProvider = ({
27602
27777
  expiry: initialExpiry,
27603
27778
  eventEmitter,
@@ -27626,7 +27801,7 @@ const ExpiryProvider = ({
27626
27801
  refreshExpiry().then((newExpiry) => {
27627
27802
  setExpiry(newExpiry);
27628
27803
  setModalDismissed(false);
27629
- }).catch(logger$r.error);
27804
+ }).catch(logger$s.error);
27630
27805
  }
27631
27806
  }
27632
27807
  ),
@@ -27648,7 +27823,7 @@ const ExpiryProvider = ({
27648
27823
  return /* @__PURE__ */ jsx(ExpiryContext.Provider, { value: expiryStatus === "expired", children });
27649
27824
  };
27650
27825
  const useHasExpired = () => useContext(ExpiryContext);
27651
- const logger$q = createLogger("FormRouterContextProvider");
27826
+ const logger$r = createLogger("FormRouterContextProvider");
27652
27827
  function FormRouterContextProvider({
27653
27828
  children,
27654
27829
  forms,
@@ -27671,7 +27846,7 @@ function FormRouterContextProvider({
27671
27846
  if (formIndex > -1) {
27672
27847
  setFormIndex(formIndex);
27673
27848
  } else {
27674
- logger$q.error("No form was found to have that field so form navigation failed.");
27849
+ logger$r.error("No form was found to have that field so form navigation failed.");
27675
27850
  }
27676
27851
  }
27677
27852
  }),
@@ -28921,6 +29096,24 @@ const formatCurrency = (amount, currency, locale) => {
28921
29096
  );
28922
29097
  return format(amount);
28923
29098
  };
29099
+ const formatFinancialInformationSummary = (data, i18n) => {
29100
+ if (!data) return {};
29101
+ const summary2 = {
29102
+ numberOfEmployees: `${data.numberOfEmployees}`,
29103
+ currency: data.currency,
29104
+ financialReportingDate: data.financialReportingDate
29105
+ };
29106
+ if (data.netAssets) {
29107
+ summary2.netAssets = summaryItem(
29108
+ "totalAssets",
29109
+ formatCurrency(data.netAssets, data.currency, i18n.locale)
29110
+ );
29111
+ }
29112
+ if (data.annualTurnover) {
29113
+ summary2.annualTurnover = formatCurrency(data.annualTurnover, data.currency, i18n.locale);
29114
+ }
29115
+ return summary2;
29116
+ };
28924
29117
  const parseConfiguration$5 = ({ country, matchingScenario }) => parseCompanyScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION], country);
28925
29118
  const canSubmit$1 = (data) => mandatoryApiFields.ORGANIZATION.every((detail) => {
28926
29119
  const value = getProp(data, detail);
@@ -29269,25 +29462,10 @@ function CompanyDropinComponent({
29269
29462
  }
29270
29463
  delete summaryData.companyRegistrationDetails.taxInformation;
29271
29464
  }
29272
- const financialInfoSummary = summaryData.companyFinancialInformation;
29273
- if (financialInfoSummary) {
29274
- delete financialInfoSummary.reportedValueOption;
29275
- if (financialInfoSummary.netAssets) {
29276
- financialInfoSummary.totalAssets = formatCurrency(
29277
- financialInfoSummary.netAssets,
29278
- financialInfoSummary.currency,
29279
- i18n.locale
29280
- );
29281
- delete financialInfoSummary.netAssets;
29282
- }
29283
- if (financialInfoSummary.annualTurnover) {
29284
- financialInfoSummary.annualTurnover = formatCurrency(
29285
- financialInfoSummary.annualTurnover,
29286
- financialInfoSummary.currency,
29287
- i18n.locale
29288
- );
29289
- }
29290
- }
29465
+ summaryData.companyFinancialInformation = formatFinancialInformationSummary(
29466
+ summaryData.companyFinancialInformation,
29467
+ i18n
29468
+ );
29291
29469
  if (isDocumentsRequired$1(forms2)) {
29292
29470
  companyDocumentForms.forEach((formId) => delete summaryData[formId]);
29293
29471
  summaryData = {
@@ -29363,7 +29541,7 @@ function CompanyDropinComponent({
29363
29541
  }
29364
29542
  const IgnoreLocalStorageContext = createContext(false);
29365
29543
  const useIgnoreLocalStorage = () => useContext(IgnoreLocalStorageContext);
29366
- const logger$p = createLogger("useLocalStorage");
29544
+ const logger$q = createLogger("useLocalStorage");
29367
29545
  const useLocalStorage = (key, defaultValue, options) => {
29368
29546
  const { serializer, parser, syncData } = useMemo(
29369
29547
  () => ({
@@ -29383,7 +29561,7 @@ const useLocalStorage = (key, defaultValue, options) => {
29383
29561
  const res = rawValueRef.current ? parser(rawValueRef.current) : defaultValue;
29384
29562
  return res;
29385
29563
  } catch (err) {
29386
- logger$p.error(err);
29564
+ logger$q.error(err);
29387
29565
  return defaultValue;
29388
29566
  }
29389
29567
  });
@@ -29418,7 +29596,7 @@ const useLocalStorage = (key, defaultValue, options) => {
29418
29596
  try {
29419
29597
  updateLocalStorage();
29420
29598
  } catch (err) {
29421
- logger$p.error(err);
29599
+ logger$q.error(err);
29422
29600
  }
29423
29601
  }, [value, ignoreLocalStorage]);
29424
29602
  useEffect(() => {
@@ -29431,7 +29609,7 @@ const useLocalStorage = (key, defaultValue, options) => {
29431
29609
  setValue(event.newValue ? parser(event.newValue) : void 0);
29432
29610
  }
29433
29611
  } catch (err) {
29434
- logger$p.error(err);
29612
+ logger$q.error(err);
29435
29613
  }
29436
29614
  };
29437
29615
  if (ignoreLocalStorage) return;
@@ -29615,7 +29793,7 @@ const useSingpassMyInfoLogin = ({
29615
29793
  trustedEntityAssociations
29616
29794
  };
29617
29795
  };
29618
- const logger$o = createLogger("useAssociatedLegalArrangement");
29796
+ const logger$p = createLogger("useAssociatedLegalArrangement");
29619
29797
  function useAssociatedLegalArrangement({
29620
29798
  rootLegalEntity,
29621
29799
  getLegalEntity: getLegalEntity2
@@ -29631,7 +29809,7 @@ function useAssociatedLegalArrangement({
29631
29809
  (entity) => entity.type === LegalEntityType.SOLE_PROPRIETORSHIP || entity.type === LegalEntityType.TRUST
29632
29810
  );
29633
29811
  if (foundEntity == null ? void 0 : foundEntity.legalEntityId) {
29634
- getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$o.error);
29812
+ getAssociatedEntity(foundEntity == null ? void 0 : foundEntity.legalEntityId).then((res) => setAssociatedLegalArrangement(res)).catch(logger$p.error);
29635
29813
  }
29636
29814
  }, [getAssociatedEntity, rootLegalEntity == null ? void 0 : rootLegalEntity.entityAssociations]);
29637
29815
  useEffect(() => {
@@ -29681,7 +29859,7 @@ const useCanSeeEntitySelection = (legalEntityId) => {
29681
29859
  setCanSeeEntitySelection: setCanSeeEntitySelectionIntoLocalStorage
29682
29860
  };
29683
29861
  };
29684
- const logger$n = createLogger("useExemptSettlor");
29862
+ const logger$o = createLogger("useExemptSettlor");
29685
29863
  const useExemptSettlor = ({
29686
29864
  trust,
29687
29865
  handleGetLegalEntity
@@ -29699,7 +29877,7 @@ const useExemptSettlor = ({
29699
29877
  );
29700
29878
  useEffect(() => {
29701
29879
  if (!(trust == null ? void 0 : trust.trust)) return;
29702
- updateExemptSettlor(trust).catch(logger$n.error);
29880
+ updateExemptSettlor(trust).catch(logger$o.error);
29703
29881
  }, [trust, updateExemptSettlor]);
29704
29882
  return exemptSettlor;
29705
29883
  };
@@ -30853,7 +31031,7 @@ const EntityAssociation = ({
30853
31031
  Tag,
30854
31032
  {
30855
31033
  className: "adyen-kyc-entity-association__tag",
30856
- variant: getRoleTagVariant(type),
31034
+ variant: getRoleTagVariant$1(type),
30857
31035
  children: i18n.get(getRoleName(type))
30858
31036
  },
30859
31037
  type
@@ -30914,7 +31092,7 @@ const EntityGuidanceStatus = ({
30914
31092
  Tag,
30915
31093
  {
30916
31094
  className: "adyen-kyc-entity-status__tag",
30917
- variant: getRoleTagVariant(entityLabel),
31095
+ variant: getRoleTagVariant$1(entityLabel),
30918
31096
  children: i18n.get(getRoleName(entityLabel))
30919
31097
  },
30920
31098
  entityLabel
@@ -32797,7 +32975,7 @@ function IndividualDropinComponent({
32797
32975
  country
32798
32976
  });
32799
32977
  const fieldsFromCustomRules = useMemo(
32800
- () => rules$2({
32978
+ () => rules$1({
32801
32979
  data,
32802
32980
  country,
32803
32981
  taskType,
@@ -33042,12 +33220,11 @@ function IndividualDropinComponent({
33042
33220
  idDocumentType: idDocumentType || null
33043
33221
  }
33044
33222
  });
33045
- const filteredEntityAssociation = filterOutUnwantedAssociationsIfRootLE(
33223
+ legalEntity.entityAssociations = filterOutUnwantedAssociationsIfRootLE(
33046
33224
  taskType,
33047
33225
  legalEntityResponse,
33048
33226
  accountHolder || void 0
33049
33227
  );
33050
- legalEntity.entityAssociations = filteredEntityAssociation;
33051
33228
  const createdLegalEntity = await submitLegalEntity({
33052
33229
  dataSubmitted,
33053
33230
  legalEntity,
@@ -33263,7 +33440,7 @@ function IndividualDropinComponent({
33263
33440
  }
33264
33441
  );
33265
33442
  }
33266
- const logger$m = createLogger("useBankConfigurationHandler");
33443
+ const logger$n = createLogger("useBankConfigurationHandler");
33267
33444
  const useBankConfigurationHandlers = ({
33268
33445
  handleGetBankVerificationVendors,
33269
33446
  bankAccountCountry,
@@ -33281,7 +33458,7 @@ const useBankConfigurationHandlers = ({
33281
33458
  const bankVerificationVendorsResponse = handleGetBankVerificationVendors ? await handleGetBankVerificationVendors(bankAccountCountry) : [];
33282
33459
  setProvider(bankVerificationVendorsResponse == null ? void 0 : bankVerificationVendorsResponse[0]);
33283
33460
  })().catch(() => {
33284
- logger$m.error();
33461
+ logger$n.error();
33285
33462
  setProvider(void 0);
33286
33463
  }).finally(() => {
33287
33464
  setLoadingStatus("success");
@@ -33318,47 +33495,6 @@ const getAccountFormatsForCountry = async (country) => {
33318
33495
  }
33319
33496
  return (await importForCountry()).default;
33320
33497
  };
33321
- const isInstantVerificationAvailable = ({
33322
- verificationVendorsCallback,
33323
- provider
33324
- }) => Boolean(verificationVendorsCallback && (provider == null ? void 0 : provider.redirectUrl));
33325
- const rules$1 = ({ data, requiredFields }) => ({
33326
- whenUsingManualVerification: () => {
33327
- var _a;
33328
- if (!data.payoutVerificationMethod) return;
33329
- if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
33330
- return "REQUIRED";
33331
- }
33332
- },
33333
- whenUsingInstantVerification: () => {
33334
- var _a;
33335
- if (!data.payoutVerificationMethod) {
33336
- return "REQUIRED";
33337
- }
33338
- if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
33339
- return "REQUIRED";
33340
- }
33341
- },
33342
- verifiedBankAccountNumber: () => {
33343
- var _a;
33344
- if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "instantVerification") {
33345
- return "REQUIRED";
33346
- }
33347
- },
33348
- bankStatementRequirement: () => {
33349
- var _a;
33350
- if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification") {
33351
- return requiredFields == null ? void 0 : requiredFields.bankStatementRequirement;
33352
- }
33353
- },
33354
- // "bankStatement description" field is always "optional" and it's coupled with bank statement document.
33355
- bankStatementDescription: () => {
33356
- var _a;
33357
- if (((_a = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _a.payoutVerificationMethod) === "manualVerification" && !!(requiredFields == null ? void 0 : requiredFields.bankStatementRequirement)) {
33358
- return "OPTIONAL";
33359
- }
33360
- }
33361
- });
33362
33498
  const labels = () => ({
33363
33499
  verifiedAccountHolder: () => "accountHolder",
33364
33500
  verifiedBankCountry: () => "bankCountry",
@@ -33375,6 +33511,27 @@ const parseConfiguration$3 = ({
33375
33511
  country,
33376
33512
  bankVerificationAvailable
33377
33513
  });
33514
+ const getAppropriatePayoutDetailsSteps = (isEditing, instantVerificationAvailable, canChangeCountry, showWidgetInVerificationMethodStep) => {
33515
+ const dependentSteps = {
33516
+ payoutAccountDetails: payoutSteps.payoutAccountDetails,
33517
+ payoutAccountDocuments: payoutSteps.payoutAccountDocuments,
33518
+ payoutAccountVerification: payoutSteps.payoutAccountVerification
33519
+ };
33520
+ if (!isEditing) {
33521
+ if (showWidgetInVerificationMethodStep)
33522
+ return {
33523
+ payoutVerificationMethod: payoutSteps.payoutVerificationMethod,
33524
+ payoutAccountDetails: payoutSteps.payoutAccountDetails,
33525
+ payoutAccountDocuments: payoutSteps.payoutAccountDocuments
33526
+ };
33527
+ if (instantVerificationAvailable || canChangeCountry)
33528
+ return {
33529
+ payoutVerificationMethod: payoutSteps.payoutVerificationMethod,
33530
+ ...dependentSteps
33531
+ };
33532
+ }
33533
+ return dependentSteps;
33534
+ };
33378
33535
  function PayoutDetailsDropinComponent({
33379
33536
  transferInstrument,
33380
33537
  setTransferInstrument,
@@ -33403,7 +33560,7 @@ function PayoutDetailsDropinComponent({
33403
33560
  handleBankVerificationError: handleBankVerificationError2,
33404
33561
  handleBackClick: externalBackClick
33405
33562
  }) {
33406
- var _a, _b, _c, _d, _e, _f;
33563
+ var _a, _b, _c, _d, _e, _f, _g;
33407
33564
  const { isEmbeddedDropin } = useAuthContext();
33408
33565
  const { i18n } = useI18nContext();
33409
33566
  const { showToast, clearToasts } = useToastContext();
@@ -33449,12 +33606,13 @@ function PayoutDetailsDropinComponent({
33449
33606
  const formValidity = currentState.validityByForm;
33450
33607
  const bankAccountCountry = ((_c = (_b = currentState == null ? void 0 : currentState.data) == null ? void 0 : _b.payoutVerificationMethod) == null ? void 0 : _c.bankCountry) ?? defaultPayoutCountry;
33451
33608
  const [hideDropinLayout, setHideDropinLayout] = useState(false);
33609
+ const [hideFooter, setHideFooter] = useState(false);
33452
33610
  const [submitButtonLabel, setSubmitButtonLabel] = useState("submit");
33453
33611
  const [skipSubmit, setSkipSubmit] = useState(false);
33454
33612
  const [hideOnHomeButton, setHideHomeButton] = useState(false);
33455
- const [loadingStatus, setLoadingStatus] = useState("success");
33456
- const [configurationLoadingStatus, setConfigurationLoadingStatus] = useState("success");
33457
- const [bankVendorsLoadingStatus, setBankVendorsLoadingStatus] = useState("success");
33613
+ const [loadingStatus, setLoadingStatus] = useState("loading");
33614
+ const [bankVendorsLoadingStatus, setBankVendorsLoadingStatus] = useState("loading");
33615
+ const [configurationLoadingStatus, setConfigurationLoadingStatus] = useState("loading");
33458
33616
  const [data, setData] = useState(prefilledData);
33459
33617
  const [problems, setProblems] = useState(
33460
33618
  propProblems || ((transferInstrument == null ? void 0 : transferInstrument.id) ? (_e = (_d = getCapabilityProblems(legalEntityResponse, bankAccountCountry)) == null ? void 0 : _d.BankAccount) == null ? void 0 : _e[transferInstrument.id] : void 0)
@@ -33502,7 +33660,7 @@ function PayoutDetailsDropinComponent({
33502
33660
  getConfiguration: getConfiguration2,
33503
33661
  legalEntityType: legalEntityResponse.type,
33504
33662
  capabilities,
33505
- setLoadingStatus: setConfigurationLoadingStatus,
33663
+ setLoadingStatus: setBankVendorsLoadingStatus,
33506
33664
  useFreshProviderRedirectUrl,
33507
33665
  setUseFreshProviderRedirectUrl
33508
33666
  });
@@ -33515,12 +33673,12 @@ function PayoutDetailsDropinComponent({
33515
33673
  getConfigurationData,
33516
33674
  getPayoutAccountFormatData,
33517
33675
  instantVerificationEnabled,
33518
- setLoadingStatus: setBankVendorsLoadingStatus,
33676
+ setLoadingStatus: setConfigurationLoadingStatus,
33519
33677
  country: bankAccountCountry,
33520
33678
  existingBankAccountFormat
33521
33679
  });
33522
33680
  const fieldsFromCustomRules = useMemo(
33523
- () => rules$1({
33681
+ () => rules$2({
33524
33682
  data,
33525
33683
  country: bankAccountCountry,
33526
33684
  taskType,
@@ -33528,10 +33686,11 @@ function PayoutDetailsDropinComponent({
33528
33686
  }),
33529
33687
  [bankAccountCountry, data, taskType]
33530
33688
  );
33531
- const fieldsFormCustomLabels = useMemo(
33689
+ const fieldsFromCustomLabels = useMemo(
33532
33690
  () => labels ? labels() : {},
33533
33691
  [data, bankAccountCountry]
33534
33692
  );
33693
+ const showWidgetInVerificationMethodStep = isExperimentEnabled("EnablePreferInstantVerificationFlow") && isProviderPlaidEmbedded(provider == null ? void 0 : provider.redirectUrl);
33535
33694
  const payoutDetailsSteps = useMemo(
33536
33695
  () => {
33537
33696
  var _a2;
@@ -33541,7 +33700,8 @@ function PayoutDetailsDropinComponent({
33541
33700
  provider,
33542
33701
  verificationVendorsCallback: handleGetBankVerificationVendors
33543
33702
  }),
33544
- isSettingEnabled(SettingNames.AllowIntraRegionCrossBorderPayout)
33703
+ isSettingEnabled(SettingNames.AllowIntraRegionCrossBorderPayout),
33704
+ showWidgetInVerificationMethodStep
33545
33705
  );
33546
33706
  },
33547
33707
  [provider]
@@ -33554,7 +33714,7 @@ function PayoutDetailsDropinComponent({
33554
33714
  (problems == null ? void 0 : problems.missingData) ?? [],
33555
33715
  [],
33556
33716
  fieldsFromCustomRules,
33557
- fieldsFormCustomLabels,
33717
+ fieldsFromCustomLabels,
33558
33718
  {},
33559
33719
  legalEntityResponse.type
33560
33720
  ),
@@ -33762,12 +33922,12 @@ function PayoutDetailsDropinComponent({
33762
33922
  navigateBackToTaskList == null ? void 0 : navigateBackToTaskList();
33763
33923
  } : onSubmit
33764
33924
  });
33765
- const hideFooter = isExperimentEnabled("EnablePreferInstantVerificationFlow") && activeForm.formId === payoutSteps.payoutVerificationMethod.formId;
33766
33925
  const currentStep = useMemo(
33767
33926
  () => Object.values(forms).findIndex((step) => step.formId === activeForm.formId),
33768
33927
  [forms, activeForm.formId]
33769
33928
  );
33770
33929
  const totalSteps = useMemo(() => Object.keys(forms).length, [forms]);
33930
+ const omittedForms = showWidgetInVerificationMethodStep && ((_g = data == null ? void 0 : data.payoutVerificationMethod) == null ? void 0 : _g.payoutVerificationMethod) === "instantVerification" ? [] : [payoutSteps.payoutVerificationMethod.formId];
33771
33931
  return /* @__PURE__ */ jsx(
33772
33932
  FormWrapper,
33773
33933
  {
@@ -33775,8 +33935,8 @@ function PayoutDetailsDropinComponent({
33775
33935
  activeForm,
33776
33936
  summary: {
33777
33937
  data: formatDataForSummary2(),
33778
- omittedKeys: ["transferInstrumentId"],
33779
- omittedForms: [payoutSteps.payoutVerificationMethod.formId],
33938
+ omittedKeys: ["transferInstrumentId", "payoutVerificationMethod"],
33939
+ omittedForms,
33780
33940
  labels: derivedProps == null ? void 0 : derivedProps.labels
33781
33941
  },
33782
33942
  handleBackClick,
@@ -33815,6 +33975,7 @@ function PayoutDetailsDropinComponent({
33815
33975
  setSubmitButtonLabel,
33816
33976
  setHideOnHomeButton: setHideHomeButton,
33817
33977
  setSkipSubmit,
33978
+ setHideFooter,
33818
33979
  onChange,
33819
33980
  legalEntityResponse,
33820
33981
  associatedLegalArrangement,
@@ -33834,11 +33995,11 @@ function PayoutDetailsDropinComponent({
33834
33995
  );
33835
33996
  }
33836
33997
  const outlinedIcon = "adyen-kyc-outlined-icon";
33837
- const styles$1 = {
33998
+ const styles$2 = {
33838
33999
  "outlined-icon": "adyen-kyc-outlined-icon",
33839
34000
  outlinedIcon
33840
34001
  };
33841
- const OutlinedIcon = ({ name }) => /* @__PURE__ */ jsx("div", { className: styles$1.outlinedIcon, children: /* @__PURE__ */ jsx(Icon, { name }) });
34002
+ const OutlinedIcon = ({ name }) => /* @__PURE__ */ jsx("div", { className: styles$2.outlinedIcon, children: /* @__PURE__ */ jsx(Icon, { name }) });
33842
34003
  const Splashscreen = ({ title, subtitle, icon, buttonText, onClick }) => {
33843
34004
  const { i18n } = useI18nContext();
33844
34005
  return /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-splashscreen", children: [
@@ -34534,6 +34695,42 @@ const TrustRoleAndEntityType = (props) => {
34534
34695
  ] }) : void 0
34535
34696
  ] });
34536
34697
  };
34698
+ const settlorExemptionReasonsList = "adyen-kyc-settlor-exemption-reasons-list";
34699
+ const styles$1 = {
34700
+ "settlor-exemption-reasons-list": "adyen-kyc-settlor-exemption-reasons-list",
34701
+ settlorExemptionReasonsList
34702
+ };
34703
+ const formatRolesForSummary = (roles, i18n) => roles.map((role) => i18n.get(getRoleName(role))).join(", ");
34704
+ const formatSettlorExemptionReasonsForSummary = (reasons, i18n) => /* @__PURE__ */ jsx("ul", { className: styles$1.settlorExemptionReasonsList, children: reasons.map((reason) => /* @__PURE__ */ jsx("li", { children: i18n.get(reason) }, reason)) });
34705
+ const formatRoleAndEntityTypeSummary = (data, i18n, isOrganizationSettlorWithExemptionEnabled) => {
34706
+ var _a, _b;
34707
+ const { trustMemberType, roles } = data;
34708
+ const role = formatRolesForSummary(roles, i18n);
34709
+ switch (trustMemberType) {
34710
+ case "undefinedBeneficiary":
34711
+ return {
34712
+ role,
34713
+ descriptionUndefinedBeneficiary: data.description
34714
+ };
34715
+ case "exemptSettlor":
34716
+ return {
34717
+ role,
34718
+ entityType: i18n.get(data.legalEntityType),
34719
+ firstName: (_a = data.exemptSettlorName) == null ? void 0 : _a.firstName,
34720
+ lastName: (_b = data.exemptSettlorName) == null ? void 0 : _b.lastName,
34721
+ country: isOrganizationSettlorWithExemptionEnabled ? data.country : void 0,
34722
+ legalCompanyName: isOrganizationSettlorWithExemptionEnabled ? data.name : void 0,
34723
+ settlorExemptionReason: summaryItem(
34724
+ "otherInformation",
34725
+ formatSettlorExemptionReasonsForSummary(data.settlorExemptionReason ?? [], i18n)
34726
+ )
34727
+ };
34728
+ case "company":
34729
+ case "rootTrustee":
34730
+ case "regular":
34731
+ return {};
34732
+ }
34733
+ };
34537
34734
  const summary = {
34538
34735
  formId: "summary",
34539
34736
  formName: "summary"
@@ -34656,7 +34853,6 @@ function RoleAndTypeDropinComponent({
34656
34853
  isOrganizationSettlorWithExemptionEnabled,
34657
34854
  country
34658
34855
  }) {
34659
- var _a, _b;
34660
34856
  const { i18n } = useI18nContext();
34661
34857
  const [trustMember, setTrustMember] = useState(
34662
34858
  existingTrustMember ?? "incomplete"
@@ -34669,19 +34865,12 @@ function RoleAndTypeDropinComponent({
34669
34865
  });
34670
34866
  const [activeForm, setActiveForm] = useState(regularForms.roleAndEntityType);
34671
34867
  const isSummaryStep = activeForm.formId === summaryStep.formId;
34672
- const formatRolesForSummary = (roles) => roles.map((role) => i18n.get(getRoleName(role))).join(", ");
34673
- const formatSettlorExemptionReasonsForSummary = (reasons) => reasons.map((reason) => i18n.get(reason)).join(", ");
34674
34868
  const summaryData = trustMember === "incomplete" ? {} : {
34675
- roleAndEntityType: {
34676
- role: formatRolesForSummary(trustMember.roles),
34677
- entityType: trustMember.trustMemberType !== "undefinedBeneficiary" ? i18n.get(trustMember.legalEntityType) : void 0,
34678
- descriptionUndefinedBeneficiary: trustMember.trustMemberType === "undefinedBeneficiary" ? trustMember.description : void 0,
34679
- otherInformation: trustMember.trustMemberType === "exemptSettlor" ? formatSettlorExemptionReasonsForSummary(trustMember.settlorExemptionReason ?? []) : void 0,
34680
- firstName: trustMember.trustMemberType === "exemptSettlor" ? (_a = trustMember.exemptSettlorName) == null ? void 0 : _a.firstName : void 0,
34681
- lastName: trustMember.trustMemberType === "exemptSettlor" ? (_b = trustMember.exemptSettlorName) == null ? void 0 : _b.lastName : void 0,
34682
- country: isOrganizationSettlorWithExemptionEnabled && trustMember.trustMemberType === "exemptSettlor" ? trustMember.country : void 0,
34683
- legalCompanyName: isOrganizationSettlorWithExemptionEnabled && trustMember.trustMemberType === "exemptSettlor" ? trustMember.name : void 0
34684
- }
34869
+ roleAndEntityType: formatRoleAndEntityTypeSummary(
34870
+ trustMember,
34871
+ i18n,
34872
+ isOrganizationSettlorWithExemptionEnabled
34873
+ )
34685
34874
  };
34686
34875
  const onNavigateToNextStep = () => {
34687
34876
  if (isSummaryStep && trustMember !== "incomplete") {
@@ -34792,7 +34981,7 @@ const serviceAgreementValidationRules = {
34792
34981
  errorMessage: "fieldIsRequired"
34793
34982
  }
34794
34983
  };
34795
- const logger$l = createLogger("useServiceAgreement");
34984
+ const logger$m = createLogger("useServiceAgreement");
34796
34985
  const FALLBACK_LANGUAGE_CODE$1 = "en";
34797
34986
  const useServiceAgreement = ({
34798
34987
  handleGetServiceAgreement,
@@ -34822,7 +35011,7 @@ const useServiceAgreement = ({
34822
35011
  const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
34823
35012
  setServiceAgreement({ id, contract });
34824
35013
  };
34825
- requestAcceptedServiceAgreement().catch(logger$l.error).finally(() => setLoading("success"));
35014
+ requestAcceptedServiceAgreement().catch(logger$m.error).finally(() => setLoading("success"));
34826
35015
  }, [acceptanceId, handleViewAcceptedTermsOfServiceDocument]);
34827
35016
  useEffect(() => {
34828
35017
  const requestServiceAgreement = async () => {
@@ -34837,7 +35026,7 @@ const useServiceAgreement = ({
34837
35026
  }
34838
35027
  );
34839
35028
  if (!document2) {
34840
- logger$l.log('"document" field was missing in response');
35029
+ logger$m.log('"document" field was missing in response');
34841
35030
  return;
34842
35031
  }
34843
35032
  const contract = JSON.parse(decodeURIComponent(escape(window.atob(document2))));
@@ -34852,7 +35041,7 @@ const useServiceAgreement = ({
34852
35041
  throw err;
34853
35042
  }
34854
35043
  };
34855
- requestServiceAgreement().catch(logger$l.error);
35044
+ requestServiceAgreement().catch(logger$m.error);
34856
35045
  }, [
34857
35046
  handleGetServiceAgreement,
34858
35047
  handleServiceAgreementIsNotAvailableInThatLanguage,
@@ -34876,7 +35065,7 @@ const serviceAgreementTypesTranslationMapping = {
34876
35065
  adyenPccr: "pccr",
34877
35066
  adyenChargeCard: "chargeCardUserAgreement"
34878
35067
  };
34879
- const logger$k = createLogger("ServiceAgreementDropinComponent");
35068
+ const logger$l = createLogger("ServiceAgreementDropinComponent");
34880
35069
  const FALLBACK_LANGUAGE_CODE = "en";
34881
35070
  function ServiceAgreementDropinComponent({
34882
35071
  legalEntityResponse,
@@ -35060,7 +35249,7 @@ function ServiceAgreementDropinComponent({
35060
35249
  await requestAndDownload(i18n.languageCode);
35061
35250
  } catch (e) {
35062
35251
  if (i18n.languageCode !== FALLBACK_LANGUAGE_CODE) {
35063
- await requestAndDownload(FALLBACK_LANGUAGE_CODE).catch(logger$k.error);
35252
+ await requestAndDownload(FALLBACK_LANGUAGE_CODE).catch(logger$l.error);
35064
35253
  return;
35065
35254
  }
35066
35255
  showToast({
@@ -35392,9 +35581,11 @@ function SolePropDropinComponent({
35392
35581
  country,
35393
35582
  taskType,
35394
35583
  requiredFields,
35395
- isSettingEnabled
35584
+ isSettingEnabled,
35585
+ isExperimentEnabled,
35586
+ rootLegalEntity: parentLegalEntity ?? legalEntityResponse
35396
35587
  }),
35397
- [country, data, taskType, requiredFields, isSettingEnabled]
35588
+ [country, data, taskType, requiredFields, isSettingEnabled, isExperimentEnabled]
35398
35589
  );
35399
35590
  const derivedProps = useMemo(
35400
35591
  () => getPropsFromConfigurations(
@@ -35472,11 +35663,10 @@ function SolePropDropinComponent({
35472
35663
  setNewSoleProp(createdLegalEntity);
35473
35664
  return createdLegalEntity;
35474
35665
  }
35475
- const updatedLegalEntity = await handleUpdateLegalEntity(
35666
+ return handleUpdateLegalEntity(
35476
35667
  drop("type").from(mappedLegalEntity),
35477
35668
  (legalEntityResponse == null ? void 0 : legalEntityResponse.id) || (newSoleProp == null ? void 0 : newSoleProp.id)
35478
35669
  );
35479
- return updatedLegalEntity;
35480
35670
  };
35481
35671
  const handleOnSubmit = async () => {
35482
35672
  const dataSubmitted = data;
@@ -35546,6 +35736,10 @@ function SolePropDropinComponent({
35546
35736
  datasetUtils
35547
35737
  );
35548
35738
  }
35739
+ summaryData.solePropFinancialInformation = formatFinancialInformationSummary(
35740
+ summaryData.solePropFinancialInformation,
35741
+ i18n
35742
+ );
35549
35743
  if (isDocumentsRequired(forms2)) {
35550
35744
  delete summaryData[solePropDocumentFormId];
35551
35745
  summaryData = {
@@ -36054,7 +36248,7 @@ const hasProgressedBeyondEntitySelection = (legalEntity) => {
36054
36248
  return hasOwnEntityAssocation || !!hasOrganizationType;
36055
36249
  };
36056
36250
  const PAGES_WITH_POLLING = [TaskTypes.DECISION_MAKER_OVERVIEW, TaskTypes.TASKS_OVERVIEW];
36057
- const logger$j = createLogger("DropinComposerComponent");
36251
+ const logger$k = createLogger("DropinComposerComponent");
36058
36252
  const isOrganizationSettlorWithExemptionReasonEnabled = (enabled, country) => country === CountryCodes.Australia && enabled;
36059
36253
  function DropinComposerComponent({
36060
36254
  capabilities,
@@ -36161,7 +36355,7 @@ function DropinComposerComponent({
36161
36355
  setPciStatus(response);
36162
36356
  return response;
36163
36357
  } catch (e) {
36164
- logger$j.warn(i18n.get("failedToGetPciStatus"));
36358
+ logger$k.warn(i18n.get("failedToGetPciStatus"));
36165
36359
  }
36166
36360
  }
36167
36361
  return void 0;
@@ -36189,7 +36383,7 @@ function DropinComposerComponent({
36189
36383
  }, [additionalSalesChannels, i18n, rootLegalEntity.id, args.handleGetPciTemplate]);
36190
36384
  useEffect(() => {
36191
36385
  if (!tasks.includes(TaskTypes.PCI_DSS)) return;
36192
- getPciTemplate2().catch(logger$j.error);
36386
+ getPciTemplate2().catch(logger$k.error);
36193
36387
  }, [getPciTemplate2, tasks]);
36194
36388
  const addFetchedAcceptedByName = async (acceptanceInfo) => {
36195
36389
  try {
@@ -36199,7 +36393,7 @@ function DropinComposerComponent({
36199
36393
  acceptedByName: getLegalEntityNameBasedOnType(acceptedByEntity)
36200
36394
  };
36201
36395
  } catch (e) {
36202
- logger$j.warn(i18n.get("failedToFetchAcceptedByName"));
36396
+ logger$k.warn(i18n.get("failedToFetchAcceptedByName"));
36203
36397
  return {
36204
36398
  ...acceptanceInfo,
36205
36399
  acceptedByName: null
@@ -36213,7 +36407,7 @@ function DropinComposerComponent({
36213
36407
  const serviceAgreementAcceptanceInfosWithNames2 = await Promise.all(response.data.map(addFetchedAcceptedByName));
36214
36408
  setServiceAgreementAcceptanceInfosWithNames(serviceAgreementAcceptanceInfosWithNames2);
36215
36409
  } catch (e) {
36216
- logger$j.warn(i18n.get("failedToGetServiceAgreementStatus"));
36410
+ logger$k.warn(i18n.get("failedToGetServiceAgreementStatus"));
36217
36411
  }
36218
36412
  }
36219
36413
  };
@@ -36223,7 +36417,7 @@ function DropinComposerComponent({
36223
36417
  const response = await args.handleGetServiceAgreementStatus(rootLegalEntity.id);
36224
36418
  setServiceAgreementTypes(response.termsOfServiceTypes);
36225
36419
  } catch (e) {
36226
- logger$j.warn(i18n.get("failedToGetServiceAgreementStatus"));
36420
+ logger$k.warn(i18n.get("failedToGetServiceAgreementStatus"));
36227
36421
  }
36228
36422
  }
36229
36423
  };
@@ -36253,7 +36447,7 @@ function DropinComposerComponent({
36253
36447
  try {
36254
36448
  return await args.handleGetLegalEntity(rootLegalEntity.id);
36255
36449
  } catch (e) {
36256
- logger$j.warn("Failed to fetch legal entity details", e);
36450
+ logger$k.warn("Failed to fetch legal entity details", e);
36257
36451
  }
36258
36452
  }
36259
36453
  return void 0;
@@ -36309,7 +36503,7 @@ function DropinComposerComponent({
36309
36503
  await refreshAssociatedLegalArrangement();
36310
36504
  showToast({ type: "success", label: i18n.get("successFullyRemovedTrustMember") });
36311
36505
  } catch (err) {
36312
- logger$j.error(`Failed to delete trust member`, err);
36506
+ logger$k.error(`Failed to delete trust member`, err);
36313
36507
  showToast({ type: "error", label: i18n.get("failedToRemoveTrustMember") });
36314
36508
  }
36315
36509
  };
@@ -36376,14 +36570,14 @@ function DropinComposerComponent({
36376
36570
  }
36377
36571
  break;
36378
36572
  default:
36379
- logger$j.warn(
36573
+ logger$k.warn(
36380
36574
  `Updating trust member type "${trustMember.trustMemberType}" is not implemented.`
36381
36575
  );
36382
36576
  }
36383
36577
  showToast({ label: i18n.get("successfullyUpdatedDetails"), type: "success" });
36384
36578
  await refreshLegalArrangementAndRunOnSubmit(associatedLegalArrangement, 1);
36385
36579
  } catch (err) {
36386
- logger$j.error(err);
36580
+ logger$k.error(err);
36387
36581
  showToast({ label: i18n.get("failedToUpdateDetails"), type: "error" });
36388
36582
  }
36389
36583
  };
@@ -36395,7 +36589,7 @@ function DropinComposerComponent({
36395
36589
  singpassTabRef.current = window.open(authUrl, "_blank");
36396
36590
  singpassTabRef.current.focus();
36397
36591
  } catch (e) {
36398
- logger$j.error(e);
36592
+ logger$k.error(e);
36399
36593
  handleSingpassMyInfoLoginFailure(e);
36400
36594
  }
36401
36595
  }
@@ -36586,7 +36780,7 @@ function DropinComposerComponent({
36586
36780
  }
36587
36781
  };
36588
36782
  setIsLoadingConfiguration(true);
36589
- fetchConfiguration().catch(logger$j.error).finally(() => {
36783
+ fetchConfiguration().catch(logger$k.error).finally(() => {
36590
36784
  setIsLoadingConfiguration(false);
36591
36785
  onLoad();
36592
36786
  });
@@ -36623,7 +36817,7 @@ function DropinComposerComponent({
36623
36817
  singpassTabRef.current = window.open(authUrl);
36624
36818
  singpassTabRef.current.focus();
36625
36819
  } catch (e) {
36626
- logger$j.error(e);
36820
+ logger$k.error(e);
36627
36821
  handleSingpassMyInfoLoginFailure(e);
36628
36822
  }
36629
36823
  },
@@ -37151,6 +37345,26 @@ function DropinComposerComponent({
37151
37345
  return null;
37152
37346
  }
37153
37347
  }
37348
+ const acceptServiceAgreement = async (context, termsOfServiceDocumentId, data) => {
37349
+ const { loadingContext, legalEntityId } = context;
37350
+ return httpPost(
37351
+ {
37352
+ loadingContext,
37353
+ errorLevel: "warn",
37354
+ errorMessage: `Failed to get service agreement status`,
37355
+ path: `${legalEntityId}/termsOfService/accept`,
37356
+ authentication: "jwt",
37357
+ headers: {
37358
+ "Content-Type": "application/json"
37359
+ }
37360
+ },
37361
+ {
37362
+ ...data,
37363
+ legalEntityReference: legalEntityId,
37364
+ termsOfServiceDocumentId
37365
+ }
37366
+ );
37367
+ };
37154
37368
  const clearCompanyData = async (context) => {
37155
37369
  const { loadingContext, legalEntityId } = context;
37156
37370
  return httpPost({
@@ -37196,6 +37410,19 @@ const companyIndexSearch = async (context, data) => {
37196
37410
  data
37197
37411
  );
37198
37412
  };
37413
+ const confirmDataReview = async (context) => {
37414
+ const { loadingContext, legalEntityId } = context;
37415
+ return httpPost({
37416
+ loadingContext,
37417
+ errorLevel: "warn",
37418
+ errorMessage: `Failed to confirm data review`,
37419
+ path: `${legalEntityId}/confirmDataReview`,
37420
+ authentication: "jwt",
37421
+ headers: {
37422
+ "Content-Type": "application/json"
37423
+ }
37424
+ });
37425
+ };
37199
37426
  const createDocument = async (context, document2, ownerId) => {
37200
37427
  const { loadingContext, legalEntityId } = context;
37201
37428
  return httpPost(
@@ -37244,240 +37471,6 @@ const createTransferInstrument = async (context, transferInstrument) => {
37244
37471
  transferInstrument
37245
37472
  );
37246
37473
  };
37247
- const getBankVerificationVendor = async (context, country, openBankingPartnerConfigId) => {
37248
- const { loadingContext, legalEntityId } = context;
37249
- const providerParams = new URLSearchParams({
37250
- country,
37251
- ...openBankingPartnerConfigId && { configId: openBankingPartnerConfigId }
37252
- });
37253
- return httpGet({
37254
- loadingContext,
37255
- errorLevel: "warn",
37256
- errorMessage: `Bank verification vendor not available`,
37257
- path: `${legalEntityId}/transferInstruments/trusted/providers?${providerParams}`,
37258
- authentication: "jwt",
37259
- headers: {
37260
- "Content-Type": "application/json"
37261
- }
37262
- });
37263
- };
37264
- const getCompanyDataset = async (context, data) => {
37265
- const { loadingContext, legalEntityId } = context;
37266
- return httpPost(
37267
- {
37268
- loadingContext,
37269
- errorLevel: "warn",
37270
- errorMessage: `Failed to get company dataset`,
37271
- path: `${legalEntityId}/companyDataset`,
37272
- authentication: "jwt",
37273
- headers: {
37274
- "Content-Type": "application/json"
37275
- }
37276
- },
37277
- data
37278
- );
37279
- };
37280
- const getDocument = async (context, documentId) => {
37281
- const { loadingContext, legalEntityId } = context;
37282
- return httpGet({
37283
- loadingContext,
37284
- errorLevel: "warn",
37285
- errorMessage: `Failed to fetch document`,
37286
- path: `${legalEntityId}/documents/${documentId}`,
37287
- authentication: "jwt",
37288
- headers: {
37289
- "Content-Type": "application/json"
37290
- }
37291
- });
37292
- };
37293
- const getLegalEntity = async (context, legalEntityId) => {
37294
- const { loadingContext, legalEntityId: rootLegalEntityId } = context;
37295
- const path = legalEntityId !== rootLegalEntityId ? `${rootLegalEntityId}/child/${legalEntityId}` : `${rootLegalEntityId}`;
37296
- return httpGet({
37297
- loadingContext,
37298
- errorLevel: "warn",
37299
- errorMessage: `LegalEntity not available`,
37300
- path,
37301
- authentication: "jwt",
37302
- headers: {
37303
- "Content-Type": "application/json"
37304
- }
37305
- });
37306
- };
37307
- const getScenarios = async (request, context) => {
37308
- const { loadingContext, legalEntityId } = context;
37309
- const { country: countryCode, legalEntityType } = request;
37310
- const scenarioParams = new URLSearchParams({
37311
- ...countryCode && { countryCode },
37312
- ...legalEntityType && { legalEntityType }
37313
- });
37314
- return httpGet({
37315
- loadingContext,
37316
- errorLevel: "warn",
37317
- errorMessage: `Scenarios not available`,
37318
- path: `${legalEntityId}/configurations/scenarios?${scenarioParams}`,
37319
- authentication: "jwt",
37320
- headers: {
37321
- "Content-Type": "application/json"
37322
- }
37323
- });
37324
- };
37325
- const getTasks = async (context) => {
37326
- const { loadingContext, legalEntityId } = context;
37327
- return httpGet({
37328
- loadingContext,
37329
- errorLevel: "warn",
37330
- errorMessage: `Tasks not available`,
37331
- path: `${legalEntityId}/configurations/tasks`,
37332
- authentication: "jwt",
37333
- headers: {
37334
- "Content-Type": "application/json"
37335
- }
37336
- });
37337
- };
37338
- const getTransferInstrument = async (context, transferInstrumentId) => {
37339
- const { loadingContext, legalEntityId } = context;
37340
- return httpGet({
37341
- loadingContext,
37342
- errorLevel: "warn",
37343
- errorMessage: `TransferInstrument not available`,
37344
- path: `${legalEntityId}/transferInstruments/${transferInstrumentId}`,
37345
- authentication: "jwt",
37346
- headers: {
37347
- "Content-Type": "application/json"
37348
- }
37349
- });
37350
- };
37351
- const getTransferInstruments = async (context) => {
37352
- const { loadingContext, legalEntityId } = context;
37353
- return httpGet({
37354
- loadingContext,
37355
- errorLevel: "warn",
37356
- errorMessage: `TransferInstrument not available`,
37357
- path: `${legalEntityId}/transferInstruments`,
37358
- authentication: "jwt",
37359
- headers: {
37360
- "Content-Type": "application/json"
37361
- }
37362
- });
37363
- };
37364
- const refreshCompanyDataset = async (context, data) => {
37365
- const { loadingContext, legalEntityId } = context;
37366
- return httpPost(
37367
- {
37368
- loadingContext,
37369
- errorLevel: "warn",
37370
- errorMessage: `Failed to refresh company dataset`,
37371
- path: `${legalEntityId}/companyDataset/refreshed`,
37372
- authentication: "jwt",
37373
- headers: {
37374
- "Content-Type": "application/json"
37375
- }
37376
- },
37377
- data
37378
- );
37379
- };
37380
- const updateDocument = async (context, document2, documentId, ownerId) => {
37381
- const { loadingContext, legalEntityId } = context;
37382
- return httpPost(
37383
- {
37384
- loadingContext,
37385
- errorLevel: "warn",
37386
- errorMessage: `Failed to update document`,
37387
- path: `${legalEntityId}/documents/${documentId}/${ownerId}`,
37388
- authentication: "jwt",
37389
- headers: {
37390
- "Content-Type": "application/json"
37391
- }
37392
- },
37393
- document2
37394
- );
37395
- };
37396
- const updateLegalEntity = async (context, legalEntity, legalEntityId) => {
37397
- const { loadingContext, legalEntityId: rootLegalEntityId } = context;
37398
- const patchLegalEntity = {
37399
- ...legalEntity,
37400
- id: legalEntityId
37401
- };
37402
- return httpPost(
37403
- {
37404
- loadingContext,
37405
- errorLevel: "warn",
37406
- errorMessage: `LegalEntity update failed`,
37407
- path: `${rootLegalEntityId}`,
37408
- authentication: "jwt",
37409
- headers: {
37410
- "Content-Type": "application/json"
37411
- }
37412
- },
37413
- patchLegalEntity
37414
- );
37415
- };
37416
- const updateTransferInstrument = async (context, transferInstrument, transferInstrumentId) => {
37417
- const { loadingContext, legalEntityId } = context;
37418
- return httpPost(
37419
- {
37420
- loadingContext,
37421
- errorLevel: "warn",
37422
- errorMessage: `Failed to update transferInstrument`,
37423
- path: `${legalEntityId}/transferInstruments/${transferInstrumentId}`,
37424
- authentication: "jwt",
37425
- headers: {
37426
- "Content-Type": "application/json"
37427
- }
37428
- },
37429
- transferInstrument
37430
- );
37431
- };
37432
- const verifyTin = async (context, data) => {
37433
- const { loadingContext, legalEntityId } = context;
37434
- return httpPost(
37435
- {
37436
- loadingContext,
37437
- errorLevel: "warn",
37438
- errorMessage: `Failed to verify tin`,
37439
- path: `${legalEntityId}/verifyTin`,
37440
- authentication: "jwt",
37441
- headers: {
37442
- "Content-Type": "application/json"
37443
- }
37444
- },
37445
- data
37446
- );
37447
- };
37448
- const acceptServiceAgreement = async (context, termsOfServiceDocumentId, data) => {
37449
- const { loadingContext, legalEntityId } = context;
37450
- return httpPost(
37451
- {
37452
- loadingContext,
37453
- errorLevel: "warn",
37454
- errorMessage: `Failed to get service agreement status`,
37455
- path: `${legalEntityId}/termsOfService/accept`,
37456
- authentication: "jwt",
37457
- headers: {
37458
- "Content-Type": "application/json"
37459
- }
37460
- },
37461
- {
37462
- ...data,
37463
- legalEntityReference: legalEntityId,
37464
- termsOfServiceDocumentId
37465
- }
37466
- );
37467
- };
37468
- const confirmDataReview = async (context) => {
37469
- const { loadingContext, legalEntityId } = context;
37470
- return httpPost({
37471
- loadingContext,
37472
- errorLevel: "warn",
37473
- errorMessage: `Failed to confirm data review`,
37474
- path: `${legalEntityId}/confirmDataReview`,
37475
- authentication: "jwt",
37476
- headers: {
37477
- "Content-Type": "application/json"
37478
- }
37479
- });
37480
- };
37481
37474
  const createTrustedTransferInstrument = async (context, code, state) => {
37482
37475
  const { loadingContext, legalEntityId } = context;
37483
37476
  const path = `${legalEntityId}/transferInstruments/trusted`;
@@ -37563,6 +37556,53 @@ const getAddress = async (context, addressId) => {
37563
37556
  }
37564
37557
  });
37565
37558
  };
37559
+ const getBankVerificationVendor = async (context, country, openBankingPartnerConfigId, locale) => {
37560
+ const { loadingContext, legalEntityId } = context;
37561
+ const providerParams = new URLSearchParams({
37562
+ country,
37563
+ ...openBankingPartnerConfigId && { configId: openBankingPartnerConfigId },
37564
+ locale
37565
+ });
37566
+ return httpGet({
37567
+ loadingContext,
37568
+ errorLevel: "warn",
37569
+ errorMessage: `Bank verification vendor not available`,
37570
+ path: `${legalEntityId}/transferInstruments/trusted/providers?${providerParams}`,
37571
+ authentication: "jwt",
37572
+ headers: {
37573
+ "Content-Type": "application/json"
37574
+ }
37575
+ });
37576
+ };
37577
+ const getCompanyDataset = async (context, data) => {
37578
+ const { loadingContext, legalEntityId } = context;
37579
+ return httpPost(
37580
+ {
37581
+ loadingContext,
37582
+ errorLevel: "warn",
37583
+ errorMessage: `Failed to get company dataset`,
37584
+ path: `${legalEntityId}/companyDataset`,
37585
+ authentication: "jwt",
37586
+ headers: {
37587
+ "Content-Type": "application/json"
37588
+ }
37589
+ },
37590
+ data
37591
+ );
37592
+ };
37593
+ const getDocument = async (context, documentId) => {
37594
+ const { loadingContext, legalEntityId } = context;
37595
+ return httpGet({
37596
+ loadingContext,
37597
+ errorLevel: "warn",
37598
+ errorMessage: `Failed to fetch document`,
37599
+ path: `${legalEntityId}/documents/${documentId}`,
37600
+ authentication: "jwt",
37601
+ headers: {
37602
+ "Content-Type": "application/json"
37603
+ }
37604
+ });
37605
+ };
37566
37606
  const getIdverificationToken = async (context, request) => {
37567
37607
  const { loadingContext, legalEntityId } = context;
37568
37608
  return httpPost(
@@ -37579,6 +37619,20 @@ const getIdverificationToken = async (context, request) => {
37579
37619
  request
37580
37620
  );
37581
37621
  };
37622
+ const getLegalEntity = async (context, legalEntityId) => {
37623
+ const { loadingContext, legalEntityId: rootLegalEntityId } = context;
37624
+ const path = legalEntityId !== rootLegalEntityId ? `${rootLegalEntityId}/child/${legalEntityId}` : `${rootLegalEntityId}`;
37625
+ return httpGet({
37626
+ loadingContext,
37627
+ errorLevel: "warn",
37628
+ errorMessage: `LegalEntity not available`,
37629
+ path,
37630
+ authentication: "jwt",
37631
+ headers: {
37632
+ "Content-Type": "application/json"
37633
+ }
37634
+ });
37635
+ };
37582
37636
  const getOnboardingStatus = async (context) => {
37583
37637
  const { loadingContext, legalEntityId } = context;
37584
37638
  return httpGet({
@@ -37695,6 +37749,32 @@ const getServiceAgreementStatus = async (context) => {
37695
37749
  }
37696
37750
  });
37697
37751
  };
37752
+ const getTransferInstrument = async (context, transferInstrumentId) => {
37753
+ const { loadingContext, legalEntityId } = context;
37754
+ return httpGet({
37755
+ loadingContext,
37756
+ errorLevel: "warn",
37757
+ errorMessage: `TransferInstrument not available`,
37758
+ path: `${legalEntityId}/transferInstruments/${transferInstrumentId}`,
37759
+ authentication: "jwt",
37760
+ headers: {
37761
+ "Content-Type": "application/json"
37762
+ }
37763
+ });
37764
+ };
37765
+ const getTransferInstruments = async (context) => {
37766
+ const { loadingContext, legalEntityId } = context;
37767
+ return httpGet({
37768
+ loadingContext,
37769
+ errorLevel: "warn",
37770
+ errorMessage: `TransferInstrument not available`,
37771
+ path: `${legalEntityId}/transferInstruments`,
37772
+ authentication: "jwt",
37773
+ headers: {
37774
+ "Content-Type": "application/json"
37775
+ }
37776
+ });
37777
+ };
37698
37778
  const handleBankVerificationError = async (context, errorCode, errorMessage, state, metadata) => {
37699
37779
  const { loadingContext, legalEntityId } = context;
37700
37780
  const path = `${legalEntityId}/transferInstruments/trusted/error`;
@@ -37733,6 +37813,22 @@ const idVerificationStartcheck = async (context, request) => {
37733
37813
  request
37734
37814
  );
37735
37815
  };
37816
+ const refreshCompanyDataset = async (context, data) => {
37817
+ const { loadingContext, legalEntityId } = context;
37818
+ return httpPost(
37819
+ {
37820
+ loadingContext,
37821
+ errorLevel: "warn",
37822
+ errorMessage: `Failed to refresh company dataset`,
37823
+ path: `${legalEntityId}/companyDataset/refreshed`,
37824
+ authentication: "jwt",
37825
+ headers: {
37826
+ "Content-Type": "application/json"
37827
+ }
37828
+ },
37829
+ data
37830
+ );
37831
+ };
37736
37832
  const searchAddress = async (context, address) => {
37737
37833
  const { loadingContext, legalEntityId } = context;
37738
37834
  return httpPost(
@@ -37765,6 +37861,74 @@ const signPci = async (context, data) => {
37765
37861
  data
37766
37862
  );
37767
37863
  };
37864
+ const updateDocument = async (context, document2, documentId, ownerId) => {
37865
+ const { loadingContext, legalEntityId } = context;
37866
+ return httpPost(
37867
+ {
37868
+ loadingContext,
37869
+ errorLevel: "warn",
37870
+ errorMessage: `Failed to update document`,
37871
+ path: `${legalEntityId}/documents/${documentId}/${ownerId}`,
37872
+ authentication: "jwt",
37873
+ headers: {
37874
+ "Content-Type": "application/json"
37875
+ }
37876
+ },
37877
+ document2
37878
+ );
37879
+ };
37880
+ const updateLegalEntity = async (context, legalEntity, legalEntityId) => {
37881
+ const { loadingContext, legalEntityId: rootLegalEntityId } = context;
37882
+ const patchLegalEntity = {
37883
+ ...legalEntity,
37884
+ id: legalEntityId
37885
+ };
37886
+ return httpPost(
37887
+ {
37888
+ loadingContext,
37889
+ errorLevel: "warn",
37890
+ errorMessage: `LegalEntity update failed`,
37891
+ path: `${rootLegalEntityId}`,
37892
+ authentication: "jwt",
37893
+ headers: {
37894
+ "Content-Type": "application/json"
37895
+ }
37896
+ },
37897
+ patchLegalEntity
37898
+ );
37899
+ };
37900
+ const updateTransferInstrument = async (context, transferInstrument, transferInstrumentId) => {
37901
+ const { loadingContext, legalEntityId } = context;
37902
+ return httpPost(
37903
+ {
37904
+ loadingContext,
37905
+ errorLevel: "warn",
37906
+ errorMessage: `Failed to update transferInstrument`,
37907
+ path: `${legalEntityId}/transferInstruments/${transferInstrumentId}`,
37908
+ authentication: "jwt",
37909
+ headers: {
37910
+ "Content-Type": "application/json"
37911
+ }
37912
+ },
37913
+ transferInstrument
37914
+ );
37915
+ };
37916
+ const verifyTin = async (context, data) => {
37917
+ const { loadingContext, legalEntityId } = context;
37918
+ return httpPost(
37919
+ {
37920
+ loadingContext,
37921
+ errorLevel: "warn",
37922
+ errorMessage: `Failed to verify tin`,
37923
+ path: `${legalEntityId}/verifyTin`,
37924
+ authentication: "jwt",
37925
+ headers: {
37926
+ "Content-Type": "application/json"
37927
+ }
37928
+ },
37929
+ data
37930
+ );
37931
+ };
37768
37932
  const COMPONENTS_API_VERSION = "v1";
37769
37933
  const useComponentApi = (rootLegalEntityId) => {
37770
37934
  const authContext = useAuthContext();
@@ -37784,7 +37948,7 @@ const useComponentApi = (rootLegalEntityId) => {
37784
37948
  updateLegalEntity: async (legalEntity, legalEntityId) => updateLegalEntity(baseRequestContext, legalEntity, legalEntityId),
37785
37949
  createLegalEntity: async (legalEntity) => createLegalEntity(baseRequestContext, legalEntity),
37786
37950
  getTransferInstrument: async (transferInstrumentId) => getTransferInstrument(baseRequestContext, transferInstrumentId),
37787
- getBankVerificationVendor: async (country, openBankingPartnerConfigId) => getBankVerificationVendor(baseRequestContext, country, openBankingPartnerConfigId),
37951
+ getBankVerificationVendor: async (country, openBankingPartnerConfigId, locale) => getBankVerificationVendor(baseRequestContext, country, openBankingPartnerConfigId, locale),
37788
37952
  getDocument: async (documentId) => getDocument(baseRequestContext, documentId),
37789
37953
  createDocument: async (document2, ownerId) => createDocument(baseRequestContext, document2, ownerId),
37790
37954
  updateDocument: async (document2, documentId, ownerId) => updateDocument(baseRequestContext, document2, documentId, ownerId),
@@ -37835,7 +37999,7 @@ const useComponentApi = (rootLegalEntityId) => {
37835
37999
  };
37836
38000
  }, [base, rootLegalEntityId]);
37837
38001
  };
37838
- const logger$i = createLogger("AcceptTermsOfService");
38002
+ const logger$j = createLogger("AcceptTermsOfService");
37839
38003
  function AcceptTermsOfServiceComponent({
37840
38004
  legalEntityId,
37841
38005
  modalView,
@@ -37877,13 +38041,13 @@ function AcceptTermsOfServiceComponent({
37877
38041
  onClose == null ? void 0 : onClose();
37878
38042
  };
37879
38043
  const fetchLegalEntity = useCallback(async () => {
37880
- await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$i.error);
38044
+ await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$j.error);
37881
38045
  }, [getLegalEntity2, legalEntityId]);
37882
38046
  const fetchUnsigned = useCallback(async () => {
37883
- await getServiceAgreementStatus2(legalEntityId).then(({ termsOfServiceTypes }) => setServiceAgreementTypes(termsOfServiceTypes)).catch(logger$i.error);
38047
+ await getServiceAgreementStatus2(legalEntityId).then(({ termsOfServiceTypes }) => setServiceAgreementTypes(termsOfServiceTypes)).catch(logger$j.error);
37884
38048
  }, [getServiceAgreementStatus2, legalEntityId]);
37885
38049
  const fetchSigned = useCallback(async () => {
37886
- await getServiceAgreementAcceptanceInfos2(legalEntityId).then(({ data }) => setServiceAgreementAcceptanceInfos(data)).catch(logger$i.error);
38050
+ await getServiceAgreementAcceptanceInfos2(legalEntityId).then(({ data }) => setServiceAgreementAcceptanceInfos(data)).catch(logger$j.error);
37887
38051
  }, [getServiceAgreementAcceptanceInfos2, legalEntityId]);
37888
38052
  const handleSign = useCallback(
37889
38053
  // @ts-ignore-error:next-line ts does not infer type correctly
@@ -37917,7 +38081,7 @@ function AcceptTermsOfServiceComponent({
37917
38081
  (async () => {
37918
38082
  setIsLoading(true);
37919
38083
  await Promise.all([fetchLegalEntity(), fetchUnsigned(), fetchSigned()]);
37920
- })().catch(logger$i.error).finally(() => {
38084
+ })().catch(logger$j.error).finally(() => {
37921
38085
  setIsLoading(false);
37922
38086
  });
37923
38087
  }, [fetchLegalEntity, fetchSigned, fetchUnsigned]);
@@ -37944,7 +38108,7 @@ function AcceptTermsOfServiceComponent({
37944
38108
  }
37945
38109
  );
37946
38110
  }
37947
- const logger$h = createLogger("CreateIndividualComponent");
38111
+ const logger$i = createLogger("CreateIndividualComponent");
37948
38112
  function CreateIndividualComponent({
37949
38113
  parentLegalEntityId,
37950
38114
  legalEntityId,
@@ -37994,11 +38158,11 @@ function CreateIndividualComponent({
37994
38158
  setParentLegalEntity(parentEntity);
37995
38159
  setLegalEntity(entity);
37996
38160
  } catch (error) {
37997
- logger$h.error(error);
38161
+ logger$i.error(error);
37998
38162
  }
37999
38163
  }, [parentLegalEntityId, legalEntityId, getLegalEntity2]);
38000
38164
  useEffect(() => {
38001
- fetchLegalEntity().catch(logger$h.error);
38165
+ fetchLegalEntity().catch(logger$i.error);
38002
38166
  }, [fetchLegalEntity]);
38003
38167
  const country = ((_a = legalEntity == null ? void 0 : legalEntity.individual) == null ? void 0 : _a.residentialAddress.country) ?? contextCountry;
38004
38168
  const onSubmit = (d) => {
@@ -38016,7 +38180,7 @@ function CreateIndividualComponent({
38016
38180
  setIsAddressEnabled(res.statuses.address.enabled);
38017
38181
  }, [country, getProviderStatus2]);
38018
38182
  useEffect(() => {
38019
- fetchProviderStatus().catch(logger$h.error);
38183
+ fetchProviderStatus().catch(logger$i.error);
38020
38184
  }, [fetchProviderStatus]);
38021
38185
  return /* @__PURE__ */ jsx(
38022
38186
  IndividualDropinComponent,
@@ -38041,7 +38205,7 @@ function CreateIndividualComponent({
38041
38205
  }
38042
38206
  );
38043
38207
  }
38044
- const logger$g = createLogger("CreateTransferInstrumentComponent");
38208
+ const logger$h = createLogger("CreateTransferInstrumentComponent");
38045
38209
  function CreateTransferInstrumentComponent({
38046
38210
  legalEntityId,
38047
38211
  transferInstrumentId,
@@ -38068,6 +38232,7 @@ function CreateTransferInstrumentComponent({
38068
38232
  rootLegalEntity: legalEntity,
38069
38233
  getLegalEntity: getLegalEntity2
38070
38234
  });
38235
+ const { i18n } = useI18nContext();
38071
38236
  const fetchLegalEntity = useCallback(async () => {
38072
38237
  const le = await getLegalEntity2(legalEntityId);
38073
38238
  setLegalEntity(le);
@@ -38081,7 +38246,7 @@ function CreateTransferInstrumentComponent({
38081
38246
  const ti = await getTransferInstrument2(transferInstrumentId);
38082
38247
  setTransferInstrument(ti);
38083
38248
  }
38084
- })().catch(logger$g.error).finally(() => {
38249
+ })().catch(logger$h.error).finally(() => {
38085
38250
  setLoadingStatus("success");
38086
38251
  });
38087
38252
  }, [transferInstrumentId, fetchLegalEntity, getTransferInstrument2]);
@@ -38092,7 +38257,7 @@ function CreateTransferInstrumentComponent({
38092
38257
  setTransferInstrument,
38093
38258
  legalEntityResponse: legalEntity,
38094
38259
  associatedLegalArrangement,
38095
- handleGetBankVerificationVendors: (country) => getBankVerificationVendor2(country, openBankingPartnerConfigId),
38260
+ handleGetBankVerificationVendors: (country) => getBankVerificationVendor2(country, openBankingPartnerConfigId, i18n.locale),
38096
38261
  handleGetDocument: getDocument2,
38097
38262
  handleCreateDocument: createDocument2,
38098
38263
  handleUpdateDocument: updateDocument2,
@@ -38120,6 +38285,7 @@ const embeddedStatus = "adyen-kyc-embedded-status";
38120
38285
  const embeddedStatusLoading = "adyen-kyc-embedded-status-loading";
38121
38286
  const embeddedStatusAvatar = "adyen-kyc-embedded-status-avatar";
38122
38287
  const embeddedStatusLight = "adyen-kyc-embedded-status-light";
38288
+ const embeddedStatusActionIndicator = "adyen-kyc-embedded-status-action-indicator";
38123
38289
  const embeddedStatusInfo = "adyen-kyc-embedded-status-info";
38124
38290
  const styles = {
38125
38291
  "embedded-status": "adyen-kyc-embedded-status",
@@ -38130,6 +38296,8 @@ const styles = {
38130
38296
  embeddedStatusAvatar,
38131
38297
  "embedded-status-light": "adyen-kyc-embedded-status-light",
38132
38298
  embeddedStatusLight,
38299
+ "embedded-status-action-indicator": "adyen-kyc-embedded-status-action-indicator",
38300
+ embeddedStatusActionIndicator,
38133
38301
  "embedded-status-info": "adyen-kyc-embedded-status-info",
38134
38302
  embeddedStatusInfo
38135
38303
  };
@@ -38166,7 +38334,7 @@ const EmbeddedStatus = ({
38166
38334
  onClick,
38167
38335
  light,
38168
38336
  className,
38169
- actionButton,
38337
+ actionIndicator,
38170
38338
  ...props
38171
38339
  }) => {
38172
38340
  const { i18n } = useI18nContext();
@@ -38190,18 +38358,7 @@ const EmbeddedStatus = ({
38190
38358
  /* @__PURE__ */ jsx(Typography, { variant: "body-stronger", children: title }),
38191
38359
  /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "secondary", children: subtitle })
38192
38360
  ] }) }),
38193
- actionButton ? /* @__PURE__ */ jsx("section", { className: styles.embeddedStatusButton, children: loading ? /* @__PURE__ */ jsx(Skeleton, { width: "5em", height: "2em" }) : /* @__PURE__ */ jsx(
38194
- Button,
38195
- {
38196
- label: i18n.get(actionButton.labelKey),
38197
- onClick: (e) => {
38198
- e.stopPropagation();
38199
- actionButton.onClick();
38200
- },
38201
- secondary: true,
38202
- small: true
38203
- }
38204
- ) }) : (statusTag == null ? void 0 : statusTag.translationKey) && /* @__PURE__ */ jsx("section", { className: styles.embeddedStatusTag, children: loading ? /* @__PURE__ */ jsx(Skeleton, { width: "8ch", height: "1em" }) : /* @__PURE__ */ jsx(Tag, { variant: statusTag.variant, children: i18n.get(statusTag.translationKey) }) })
38361
+ actionIndicator ? /* @__PURE__ */ jsx("section", { className: styles.embeddedStatusButton, children: loading ? /* @__PURE__ */ jsx(Skeleton, { width: "5em", height: "2em" }) : /* @__PURE__ */ jsx(Typography, { variant: "body-stronger", className: styles.embeddedStatusActionIndicator, children: i18n.get(actionIndicator.labelKey) }) }) : (statusTag == null ? void 0 : statusTag.translationKey) && /* @__PURE__ */ jsx("section", { className: styles.embeddedStatusTag, children: loading ? /* @__PURE__ */ jsx(Skeleton, { width: "8ch", height: "1em" }) : /* @__PURE__ */ jsx(Tag, { variant: statusTag.variant, children: i18n.get(statusTag.translationKey) }) })
38205
38362
  ]
38206
38363
  }
38207
38364
  );
@@ -38274,9 +38431,6 @@ function PCIStatus({ legalEntityId, onClick, title, subtitle = "" }) {
38274
38431
  }).catch(() => {
38275
38432
  });
38276
38433
  }, [fetchStatus]);
38277
- const handleClick = () => {
38278
- onClick == null ? void 0 : onClick();
38279
- };
38280
38434
  return hasSigned ? /* @__PURE__ */ jsx(
38281
38435
  EmbeddedStatus,
38282
38436
  {
@@ -38290,7 +38444,7 @@ function PCIStatus({ legalEntityId, onClick, title, subtitle = "" }) {
38290
38444
  EmbeddedStatus,
38291
38445
  {
38292
38446
  onClick,
38293
- actionButton: { labelKey: "sign", onClick: handleClick },
38447
+ actionIndicator: { labelKey: "sign" },
38294
38448
  title,
38295
38449
  subtitle,
38296
38450
  loading: isLoading
@@ -38325,22 +38479,19 @@ function TermsOfServiceStatus({
38325
38479
  async () => getServiceAgreementAcceptanceInfos2(legalEntityId),
38326
38480
  [getServiceAgreementAcceptanceInfos2, legalEntityId]
38327
38481
  );
38328
- const getStatus = useCallback(async () => {
38482
+ const getStatus2 = useCallback(async () => {
38329
38483
  const [signedRes, unsignedRes] = await Promise.all([getSigned(), getUnsigned()]);
38330
38484
  const signed = signedRes.data.map((d) => d.type);
38331
38485
  const unsigned = unsignedRes.termsOfServiceTypes;
38332
38486
  return signed.length !== 0 && unsigned.length === 0;
38333
38487
  }, [getUnsigned, getSigned]);
38334
38488
  useEffect(() => {
38335
- getStatus().then((allSigned) => {
38489
+ getStatus2().then((allSigned) => {
38336
38490
  setIsLoading(false);
38337
38491
  setHasSignedAll(allSigned);
38338
38492
  }).catch(() => {
38339
38493
  });
38340
38494
  });
38341
- const handleClick = () => {
38342
- onClick == null ? void 0 : onClick();
38343
- };
38344
38495
  return hasSignedAll ? /* @__PURE__ */ jsx(
38345
38496
  EmbeddedStatus,
38346
38497
  {
@@ -38354,7 +38505,7 @@ function TermsOfServiceStatus({
38354
38505
  EmbeddedStatus,
38355
38506
  {
38356
38507
  onClick,
38357
- actionButton: { labelKey: "accept", onClick: handleClick },
38508
+ actionIndicator: { labelKey: "accept" },
38358
38509
  title,
38359
38510
  subtitle,
38360
38511
  loading: isLoading
@@ -38603,14 +38754,13 @@ function ManageTransferInstrumentOverviewItem({
38603
38754
  const [modalOpen, setModalOpen] = useState(false);
38604
38755
  const isDetailsRequired = transferInstrumentReference.status === "DETAILS_REQUIRED";
38605
38756
  const onClick = (transferInstrumentId) => {
38606
- if (isDetailsRequired) return;
38757
+ if (isDetailsRequired) {
38758
+ onEdit(transferInstrumentReference.transferInstrument.id);
38759
+ return;
38760
+ }
38607
38761
  onOpen(transferInstrumentId);
38608
38762
  setModalOpen(true);
38609
38763
  };
38610
- const actionButton = {
38611
- labelKey: "continue",
38612
- onClick: () => onEdit(transferInstrumentReference.transferInstrument.id)
38613
- };
38614
38764
  return /* @__PURE__ */ jsxs(Fragment, { children: [
38615
38765
  /* @__PURE__ */ jsx(
38616
38766
  EmbeddedStatus,
@@ -38624,7 +38774,7 @@ function ManageTransferInstrumentOverviewItem({
38624
38774
  ),
38625
38775
  subtitle: i18n.get("bankAccount"),
38626
38776
  onClick: () => onClick(transferInstrumentReference.transferInstrument.id),
38627
- actionButton: isDetailsRequired ? actionButton : void 0,
38777
+ actionIndicator: isDetailsRequired ? { labelKey: "continue" } : void 0,
38628
38778
  "aria-label": i18n.get("bankAccount")
38629
38779
  },
38630
38780
  transferInstrumentReference.transferInstrument.id
@@ -38642,7 +38792,7 @@ function ManageTransferInstrumentOverviewItem({
38642
38792
  )
38643
38793
  ] });
38644
38794
  }
38645
- const logger$f = createLogger("ManageTransferInstrumentOverview");
38795
+ const logger$g = createLogger("ManageTransferInstrumentOverview");
38646
38796
  function ManageTransferInstrumentOverview({
38647
38797
  transferInstrumentReferences,
38648
38798
  legalEntityId,
@@ -38661,7 +38811,7 @@ function ManageTransferInstrumentOverview({
38661
38811
  const ti = await getTransferInstrument2(transferInstrumentId);
38662
38812
  setTransferInstrumentsMap({ [transferInstrumentId]: ti, ...transferInstrumentsMap });
38663
38813
  } catch (e) {
38664
- logger$f.error(e);
38814
+ logger$g.error(e);
38665
38815
  }
38666
38816
  };
38667
38817
  const onRemoveTransferInstrument = async (transferInstrumentId) => {
@@ -38670,7 +38820,7 @@ function ManageTransferInstrumentOverview({
38670
38820
  onRemove(transferInstrumentId);
38671
38821
  } catch (e) {
38672
38822
  showToast({ label: i18n.get("thereWasAnErrorTryAgain"), type: "error" });
38673
- logger$f.error(e);
38823
+ logger$g.error(e);
38674
38824
  }
38675
38825
  };
38676
38826
  const transferInstrumentListEle = transferInstrumentReferences.map((transferInstrumentRef) => /* @__PURE__ */ jsx(
@@ -38699,7 +38849,7 @@ function ManageTransferInstrumentOverview({
38699
38849
  )
38700
38850
  ] });
38701
38851
  }
38702
- const logger$e = createLogger("ManageTransferInstrumentComponent");
38852
+ const logger$f = createLogger("ManageTransferInstrumentComponent");
38703
38853
  function ManageTransferInstrumentComponent({
38704
38854
  legalEntityId,
38705
38855
  onAdd,
@@ -38727,7 +38877,7 @@ function ManageTransferInstrumentComponent({
38727
38877
  }, [getTransferInstruments2]);
38728
38878
  useEffect(() => {
38729
38879
  eventEmitter == null ? void 0 : eventEmitter.on("updateLocale", (locale) => setLocale(locale));
38730
- init2().catch(logger$e.error).finally(() => {
38880
+ init2().catch(logger$f.error).finally(() => {
38731
38881
  setLoadingStatus("success");
38732
38882
  });
38733
38883
  }, [init2, setLocale, eventEmitter]);
@@ -38737,7 +38887,7 @@ function ManageTransferInstrumentComponent({
38737
38887
  }
38738
38888
  }, [hasOnlyVerifiedTransferInstruments, timeoutId, transferInstruments]);
38739
38889
  const onRemove = (transferInstrumentId) => {
38740
- refreshTransferInstruments().catch(logger$e.error);
38890
+ refreshTransferInstruments().catch(logger$f.error);
38741
38891
  onRemoveSuccess == null ? void 0 : onRemoveSuccess(transferInstrumentId, legalEntityId);
38742
38892
  };
38743
38893
  const render2 = () => {
@@ -38764,7 +38914,7 @@ function ManageTransferInstrumentComponent({
38764
38914
  };
38765
38915
  return /* @__PURE__ */ jsx("div", { className: "adyen-kyc-manage-transfer-instrument", children: render2() });
38766
38916
  }
38767
- const logger$d = createLogger("OnboardingDropinComponent");
38917
+ const logger$e = createLogger("OnboardingDropinComponent");
38768
38918
  function OnboardingDropinComponent({
38769
38919
  legalEntityId,
38770
38920
  openBankingPartnerConfigId
@@ -38824,13 +38974,13 @@ function OnboardingDropinComponent({
38824
38974
  setLegalEntity(le);
38825
38975
  setProviderStatus(providerStatuses);
38826
38976
  } catch (error) {
38827
- logger$d.error(error);
38977
+ logger$e.error(error);
38828
38978
  } finally {
38829
38979
  setLoadingStatus("success");
38830
38980
  }
38831
38981
  }, [legalEntityId, getLegalEntity2, getProviderStatus2]);
38832
38982
  useEffect(() => {
38833
- init2().catch(logger$d.error);
38983
+ init2().catch(logger$e.error);
38834
38984
  }, [init2]);
38835
38985
  return loadingStatus === "loading" || !legalEntity ? /* @__PURE__ */ jsx(Loader, { size: "medium" }) : /* @__PURE__ */ jsx(
38836
38986
  DropinComposerComponent,
@@ -38874,7 +39024,7 @@ function OnboardingDropinComponent({
38874
39024
  }
38875
39025
  );
38876
39026
  }
38877
- const logger$c = createLogger("SignPCIComponent");
39027
+ const logger$d = createLogger("SignPCIComponent");
38878
39028
  function SignPCIComponent({
38879
39029
  legalEntityId,
38880
39030
  modalView,
@@ -38904,7 +39054,7 @@ function SignPCIComponent({
38904
39054
  onClose == null ? void 0 : onClose();
38905
39055
  };
38906
39056
  const fetchLegalEntity = useCallback(async () => {
38907
- await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$c.error);
39057
+ await getLegalEntity2(legalEntityId).then((res) => setLegalEntity(res)).catch(logger$d.error);
38908
39058
  }, [getLegalEntity2, legalEntityId]);
38909
39059
  const fetchStatus = useCallback(async () => {
38910
39060
  await getPciStatus2(legalEntityId, { additionalSalesChannels }).then(({ signingRequired }) => {
@@ -38915,7 +39065,7 @@ function SignPCIComponent({
38915
39065
  await getPciTemplate2(legalEntityId, {
38916
39066
  additionalSalesChannels,
38917
39067
  language: i18n.locale.substring(0, 2) ?? "en"
38918
- }).then((res) => setPciTemplate(res)).catch(logger$c.error);
39068
+ }).then((res) => setPciTemplate(res)).catch(logger$d.error);
38919
39069
  }, [additionalSalesChannels, getPciTemplate2, i18n.locale, legalEntityId]);
38920
39070
  useEffect(() => {
38921
39071
  (async () => {
@@ -39434,7 +39584,7 @@ const highExposureParentCompaniesDetailsValidations = {
39434
39584
  }
39435
39585
  ]
39436
39586
  };
39437
- const logger$b = createLogger("LegalFormField");
39587
+ const logger$c = createLogger("LegalFormField");
39438
39588
  function LegalFormField({
39439
39589
  name = "legalForm",
39440
39590
  data,
@@ -39472,7 +39622,7 @@ function LegalFormField({
39472
39622
  }));
39473
39623
  setLegalForms(legalFormsResponse);
39474
39624
  }
39475
- }).catch(() => logger$b.error);
39625
+ }).catch(() => logger$c.error);
39476
39626
  }, [countryCode]);
39477
39627
  return /* @__PURE__ */ jsx(
39478
39628
  Field,
@@ -39498,7 +39648,7 @@ function LegalFormField({
39498
39648
  }
39499
39649
  );
39500
39650
  }
39501
- const logger$a = createLogger("NaceCodeField");
39651
+ const logger$b = createLogger("NaceCodeField");
39502
39652
  function NaceCodeField({
39503
39653
  name = "naceCode",
39504
39654
  data,
@@ -39518,7 +39668,7 @@ function NaceCodeField({
39518
39668
  if (response) {
39519
39669
  setNaceCodes(response);
39520
39670
  }
39521
- }).catch(() => logger$a.error);
39671
+ }).catch(() => logger$b.error);
39522
39672
  }, []);
39523
39673
  const handleChangeForNaceCode = (e) => {
39524
39674
  var _a;
@@ -40521,7 +40671,7 @@ const FormEndState = ({
40521
40671
  );
40522
40672
  };
40523
40673
  const parseConfiguration = ({ matchingScenario }) => parseHighExposureScenarios(matchingScenario == null ? void 0 : matchingScenario[LegalEntityType.ORGANIZATION]);
40524
- const logger$9 = createLogger("UpdateLegalEntityForHighExposure");
40674
+ const logger$a = createLogger("UpdateLegalEntityForHighExposure");
40525
40675
  const customLabels = {
40526
40676
  company: {
40527
40677
  legalForm: "businessStructure",
@@ -40642,7 +40792,7 @@ function UpdateLegalEntityForHighExposure({
40642
40792
  useEffect(() => {
40643
40793
  (async () => {
40644
40794
  await fetchLegalEntities();
40645
- })().catch(logger$9.error);
40795
+ })().catch(logger$a.error);
40646
40796
  }, [fetchLegalEntities]);
40647
40797
  const [data, setData] = useState(dataFromResponse);
40648
40798
  const [problems, setProblems] = useState(problemsProp ?? {});
@@ -41042,7 +41192,7 @@ function getContentByStatus(status) {
41042
41192
  return contentMap[status];
41043
41193
  }
41044
41194
  const FINAL_STATUSES = [OnboardingStatus.VERIFIED, OnboardingStatus.REJECTED];
41045
- const logger$8 = createLogger("ViewVerificationStatusComponent");
41195
+ const logger$9 = createLogger("ViewVerificationStatusComponent");
41046
41196
  function ViewVerificationStatusComponent({
41047
41197
  legalEntityId,
41048
41198
  hideExplanation = false,
@@ -41061,12 +41211,12 @@ function ViewVerificationStatusComponent({
41061
41211
  if (!onboardingStatus) return;
41062
41212
  const statusContent = getContentByStatus(onboardingStatus);
41063
41213
  if (statusContent) return statusContent;
41064
- logger$8.error(`there is no content for status "${onboardingStatus}"`);
41214
+ logger$9.error(`there is no content for status "${onboardingStatus}"`);
41065
41215
  }, [onboardingStatus]);
41066
41216
  const handleError = useCallback(
41067
41217
  (rawError, userMessage) => {
41068
41218
  const error = coerceError(rawError);
41069
- logger$8.error(error);
41219
+ logger$9.error(error);
41070
41220
  setAlertContent(userMessage);
41071
41221
  onError == null ? void 0 : onError({
41072
41222
  error,
@@ -41100,7 +41250,7 @@ function ViewVerificationStatusComponent({
41100
41250
  });
41101
41251
  useEffect(() => {
41102
41252
  setAlertContent(void 0);
41103
- fetchOnboardingStatus().then(updateOnboardingStatus).catch(logger$8.error);
41253
+ fetchOnboardingStatus().then(updateOnboardingStatus).catch(logger$9.error);
41104
41254
  }, [fetchOnboardingStatus, updateOnboardingStatus]);
41105
41255
  const [loadingLinkStatus, setLinkLoadingStatus] = useState("success");
41106
41256
  const redirectToAdyen = async () => {
@@ -41295,7 +41445,7 @@ const getVersionConfiguration = async (context) => {
41295
41445
  }
41296
41446
  });
41297
41447
  };
41298
- const logger$7 = createLogger("UseVersionConfiguration");
41448
+ const logger$8 = createLogger("UseVersionConfiguration");
41299
41449
  const useVersionConfiguration = async (legalEntityId) => {
41300
41450
  var _a, _b;
41301
41451
  const { isEmbeddedDropin, loadingContext: base } = useAuthContext();
@@ -41310,25 +41460,25 @@ const useVersionConfiguration = async (legalEntityId) => {
41310
41460
  enableVersionExperiment(feature);
41311
41461
  });
41312
41462
  } catch (e) {
41313
- logger$7.error("Failed to set version configuration", e);
41463
+ logger$8.error("Failed to set version configuration", e);
41314
41464
  }
41315
41465
  };
41316
- const logger$6 = createLogger("loadCountries");
41466
+ const logger$7 = createLogger("loadCountries");
41317
41467
  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") });
41318
41468
  const loadCountriesDataset = async (locale) => {
41319
41469
  const importForLocale = countriesImports[`./${locale}.json`];
41320
41470
  if (!importForLocale) {
41321
- logger$6.warn(`No countries dataset for ${locale}, falling back to en-US`);
41471
+ logger$7.warn(`No countries dataset for ${locale}, falling back to en-US`);
41322
41472
  return (await import("./en-US-CkdCbOCX.js")).default;
41323
41473
  }
41324
41474
  return (await importForLocale()).default;
41325
41475
  };
41326
- const logger$5 = createLogger("loadStates");
41476
+ const logger$6 = createLogger("loadStates");
41327
41477
  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") });
41328
41478
  const loadStatesDataset = async (country, locale) => {
41329
41479
  const importForLocale = statesImports[`./${country}/${locale}.json`];
41330
41480
  if (!importForLocale) {
41331
- logger$5.warn(`No ${country} states dataset for ${locale}, falling back to en-US`);
41481
+ logger$6.warn(`No ${country} states dataset for ${locale}, falling back to en-US`);
41332
41482
  const fallbackImport = statesImports[`./${country}/en-US.json`];
41333
41483
  return (await fallbackImport()).default;
41334
41484
  }
@@ -41390,6 +41540,24 @@ const getNaceCodes = async (base) => httpGet({
41390
41540
  "Content-Type": "application/json"
41391
41541
  }
41392
41542
  });
41543
+ const getScenarios = async (request, context) => {
41544
+ const { loadingContext, legalEntityId } = context;
41545
+ const { country: countryCode, legalEntityType } = request;
41546
+ const scenarioParams = new URLSearchParams({
41547
+ ...countryCode && { countryCode },
41548
+ ...legalEntityType && { legalEntityType }
41549
+ });
41550
+ return httpGet({
41551
+ loadingContext,
41552
+ errorLevel: "warn",
41553
+ errorMessage: `Scenarios not available`,
41554
+ path: `${legalEntityId}/configurations/scenarios?${scenarioParams}`,
41555
+ authentication: "jwt",
41556
+ headers: {
41557
+ "Content-Type": "application/json"
41558
+ }
41559
+ });
41560
+ };
41393
41561
  const getSupportedCountries = async (context) => {
41394
41562
  const { loadingContext, legalEntityId } = context;
41395
41563
  return httpGet({
@@ -41403,6 +41571,19 @@ const getSupportedCountries = async (context) => {
41403
41571
  }
41404
41572
  });
41405
41573
  };
41574
+ const getTasks = async (context) => {
41575
+ const { loadingContext, legalEntityId } = context;
41576
+ return httpGet({
41577
+ loadingContext,
41578
+ errorLevel: "warn",
41579
+ errorMessage: `Tasks not available`,
41580
+ path: `${legalEntityId}/configurations/tasks`,
41581
+ authentication: "jwt",
41582
+ headers: {
41583
+ "Content-Type": "application/json"
41584
+ }
41585
+ });
41586
+ };
41406
41587
  const validateAccountIdentification$1 = async (context, payoutAccountDetails) => {
41407
41588
  const { loadingContext } = context;
41408
41589
  return httpPost(
@@ -41433,7 +41614,7 @@ const validatePhoneNumber$1 = async (context, phoneNumber) => {
41433
41614
  { number: phoneNumber }
41434
41615
  );
41435
41616
  };
41436
- const logger$4 = createLogger("verify-id-number");
41617
+ const logger$5 = createLogger("verify-id-number");
41437
41618
  const verifyIdNumber$1 = async (context, request) => {
41438
41619
  const { loadingContext, legalEntityId } = context;
41439
41620
  try {
@@ -41456,13 +41637,13 @@ const verifyIdNumber$1 = async (context, request) => {
41456
41637
  if (responseData.status === 500) {
41457
41638
  return { status: 500, message: "Service did not respond, do not block verification" };
41458
41639
  }
41459
- return logger$4.warn(`Unexpected response status ${responseData.status}`);
41640
+ return logger$5.warn(`Unexpected response status ${responseData.status}`);
41460
41641
  }
41461
41642
  },
41462
41643
  request
41463
41644
  );
41464
41645
  } catch (e) {
41465
- logger$4.warn("WARNING: idNumber verification failed - error:", e);
41646
+ logger$5.warn("WARNING: idNumber verification failed - error:", e);
41466
41647
  }
41467
41648
  };
41468
41649
  const getEmbeddedApi = ({
@@ -41561,7 +41742,7 @@ const validatePhoneNumber = async (context, phoneNumber) => {
41561
41742
  { number: phoneNumber }
41562
41743
  );
41563
41744
  };
41564
- const logger$3 = createLogger("verify-id-number");
41745
+ const logger$4 = createLogger("verify-id-number");
41565
41746
  const verifyIdNumber = async (context, request) => {
41566
41747
  const { loadingContext, clientKey } = context;
41567
41748
  try {
@@ -41579,7 +41760,7 @@ const verifyIdNumber = async (context, request) => {
41579
41760
  if (responseData.status === 500) {
41580
41761
  return { status: 500, message: "Service did not respond, do not block verification" };
41581
41762
  }
41582
- return logger$3.warn(`Unexpected response status ${responseData.status}`);
41763
+ return logger$4.warn(`Unexpected response status ${responseData.status}`);
41583
41764
  },
41584
41765
  path: "v1/verification/idNumber",
41585
41766
  clientKey
@@ -41587,7 +41768,7 @@ const verifyIdNumber = async (context, request) => {
41587
41768
  request
41588
41769
  );
41589
41770
  } catch (e) {
41590
- logger$3.warn("WARNING: idNumber verification failed - error:", e);
41771
+ logger$4.warn("WARNING: idNumber verification failed - error:", e);
41591
41772
  }
41592
41773
  };
41593
41774
  const getKycExternalApi = ({
@@ -41616,7 +41797,7 @@ const ConfigurationApiProvider = ({
41616
41797
  }) => {
41617
41798
  const authContext = useAuthContext();
41618
41799
  const { isEmbeddedDropin, loadingContext } = authContext;
41619
- const sdkVersion = "3.34.0";
41800
+ const sdkVersion = "3.35.0";
41620
41801
  useAnalytics({
41621
41802
  onUserEvent,
41622
41803
  legalEntityId: rootLegalEntityId,
@@ -41647,7 +41828,7 @@ const useAccountHolder = (legalEntityId) => {
41647
41828
  setAccountHolder: setAccountHolderIntoLocalStorage
41648
41829
  };
41649
41830
  };
41650
- const logger$2 = createLogger("CoreProvider");
41831
+ const logger$3 = createLogger("CoreProvider");
41651
41832
  const CoreProvider = ({
41652
41833
  contextCountry: initialContextCountry,
41653
41834
  rootLegalEntityId,
@@ -41662,7 +41843,7 @@ const CoreProvider = ({
41662
41843
  const isCountryAllowed = (allowedCountries == null ? void 0 : allowedCountries.includes(contextCountry)) ?? true;
41663
41844
  useEffect(() => {
41664
41845
  if (allowedCountries && !isCountryAllowed) {
41665
- logger$2.warn(`
41846
+ logger$3.warn(`
41666
41847
 
41667
41848
  "${contextCountry}" isn't a supported country. Please use one of the following:
41668
41849
  - ${listify(
@@ -41704,12 +41885,12 @@ function ExperimentsContextProvider({
41704
41885
  );
41705
41886
  return /* @__PURE__ */ jsx(ExperimentsContext.Provider, { value: contextValue, children });
41706
41887
  }
41707
- const logger$1 = createLogger("useAllowedLocales");
41888
+ const logger$2 = createLogger("useAllowedLocales");
41708
41889
  const useAllowedLocales = () => {
41709
41890
  const { getAllowedLocales: getAllowedLocales2 } = useConfigurationApi();
41710
41891
  const [allowedLocales, setAllowedLocales] = useState();
41711
41892
  useEffect(() => {
41712
- getAllowedLocales2().then((response) => setAllowedLocales(response.locales)).catch(logger$1.error);
41893
+ getAllowedLocales2().then((response) => setAllowedLocales(response.locales)).catch(logger$2.error);
41713
41894
  }, []);
41714
41895
  return allowedLocales;
41715
41896
  };
@@ -41721,7 +41902,7 @@ const loadLocale = async (locale) => {
41721
41902
  }
41722
41903
  return (await importForLocale()).default;
41723
41904
  };
41724
- const logger = createLogger("useTranslations");
41905
+ const logger$1 = createLogger("useTranslations");
41725
41906
  const useTranslations = ({
41726
41907
  locale,
41727
41908
  allowedLocales
@@ -41736,7 +41917,7 @@ const useTranslations = ({
41736
41917
  const localeToUse = isLocaleAllowed ? locale : FALLBACK_LOCALE;
41737
41918
  if (loaded.locale === localeToUse) return;
41738
41919
  if (!isLocaleAllowed) {
41739
- logger.error(
41920
+ logger$1.error(
41740
41921
  `
41741
41922
  "${locale}" isn't a supported locale. Please use one of the following:
41742
41923
  - ${listify(
@@ -41756,7 +41937,7 @@ const useTranslations = ({
41756
41937
  translations: dataset,
41757
41938
  locale: localeToUse
41758
41939
  });
41759
- }).catch((err) => logger.error("Error while loading translations", err));
41940
+ }).catch((err) => logger$1.error("Error while loading translations", err));
41760
41941
  }, [locale, allowedLocales, loaded.locale]);
41761
41942
  return loaded;
41762
41943
  };
@@ -42216,25 +42397,57 @@ class BaseElement {
42216
42397
  }
42217
42398
  }
42218
42399
  }
42400
+ const logger = createLogger("DebugModal");
42401
+ const getRoleTagVariant = (value) => {
42402
+ switch (value) {
42403
+ case void 0:
42404
+ return "orange";
42405
+ case true:
42406
+ return "green";
42407
+ case false:
42408
+ return "red";
42409
+ default:
42410
+ return "blue";
42411
+ }
42412
+ };
42413
+ const getStatus = (value) => {
42414
+ switch (value) {
42415
+ case void 0:
42416
+ return "undefined";
42417
+ case true:
42418
+ return "Enabled";
42419
+ case false:
42420
+ return "Disabled";
42421
+ default:
42422
+ return String(value);
42423
+ }
42424
+ };
42219
42425
  const DebugTable = ({
42220
42426
  data,
42221
42427
  keyHeading,
42222
- valueHeading
42223
- }) => /* @__PURE__ */ jsxs("table", { children: [
42224
- /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
42225
- /* @__PURE__ */ jsx("th", { children: keyHeading }),
42226
- /* @__PURE__ */ jsx("th", { children: valueHeading })
42227
- ] }) }),
42228
- /* @__PURE__ */ jsx("tbody", { children: data.map(([experimentName, value]) => /* @__PURE__ */ jsxs("tr", { children: [
42229
- /* @__PURE__ */ jsx("td", { children: experimentName }),
42230
- /* @__PURE__ */ jsx("td", { children: value === void 0 ? "undefined" : JSON.stringify(value) })
42231
- ] }, experimentName)) })
42232
- ] });
42428
+ searchTerm
42429
+ }) => {
42430
+ const filteredData = data.filter(([key]) => key.toLowerCase().includes(searchTerm.toLowerCase()));
42431
+ const sortedData = [...filteredData].sort(([keyA], [keyB]) => keyA.localeCompare(keyB));
42432
+ return /* @__PURE__ */ jsxs("div", { children: [
42433
+ /* @__PURE__ */ jsx("h2", { children: keyHeading }),
42434
+ sortedData.length === 0 ? /* @__PURE__ */ jsxs("p", { children: [
42435
+ "No results found for ",
42436
+ /* @__PURE__ */ jsx("strong", { children: searchTerm })
42437
+ ] }) : null,
42438
+ /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsx("tbody", { children: sortedData.map(([experimentName, value]) => /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
42439
+ /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: experimentName }),
42440
+ /* @__PURE__ */ jsx(Tag, { variant: getRoleTagVariant(value), className: "adyen-kyc-tag--large", children: getStatus(value) })
42441
+ ] }) }, experimentName)) }) })
42442
+ ] });
42443
+ };
42233
42444
  const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
42234
42445
  const { isExperimentEnabled } = useExperimentsContext();
42235
42446
  const { getSetting } = useSettingsContext();
42236
42447
  const [rootLeData, setRootLeData] = useState();
42237
42448
  const [debugInfoCopied, setDebugInfoCopied] = useState(false);
42449
+ const [isRootLeDataEnabled, setIsRootLeDataEnabled] = useState(false);
42450
+ const [searchTerm, setSearchTerm] = useState("");
42238
42451
  const allExperimentsWithValues = valuesOf(ExperimentNames).map(
42239
42452
  (experimentName) => [experimentName, isExperimentEnabled(experimentName)]
42240
42453
  );
@@ -42243,11 +42456,19 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
42243
42456
  );
42244
42457
  const fetchRootLeData = () => {
42245
42458
  if (!getRootLegalEntity) return;
42246
- getRootLegalEntity().then(setRootLeData).catch(console.error);
42459
+ getRootLegalEntity().then(setRootLeData).catch(logger.error);
42460
+ };
42461
+ const handleToggleRootLeData = () => {
42462
+ if (!isRootLeDataEnabled) {
42463
+ fetchRootLeData();
42464
+ } else {
42465
+ setRootLeData(void 0);
42466
+ }
42467
+ setIsRootLeDataEnabled(!isRootLeDataEnabled);
42247
42468
  };
42248
42469
  const copyToClipboard = async () => {
42249
42470
  const toCopy = {
42250
- sdkVersion: "3.34.0",
42471
+ sdkVersion: "3.35.0",
42251
42472
  experiments: Object.fromEntries(allExperimentsWithValues),
42252
42473
  settings: Object.fromEntries(allSettingsWithValues)
42253
42474
  };
@@ -42261,37 +42482,79 @@ const DebugModal = ({ rootLegalEntityId, onExit, getRootLegalEntity }) => {
42261
42482
  }, 5e3);
42262
42483
  };
42263
42484
  const header = /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-debug-modal__header", children: [
42264
- "Debug ",
42265
- /* @__PURE__ */ jsx(Button, { label: "Copy debug info", icon: "document", onClick: copyToClipboard }),
42266
- debugInfoCopied ? /* @__PURE__ */ jsxs("span", { children: [
42267
- /* @__PURE__ */ jsx(Icon, { name: "check" }),
42268
- " Copied!"
42269
- ] }) : void 0
42485
+ /* @__PURE__ */ jsx("h1", { children: "Debug" }),
42486
+ /* @__PURE__ */ jsx(
42487
+ InputText,
42488
+ {
42489
+ name: "search",
42490
+ value: searchTerm,
42491
+ classNameModifiers: ["search"],
42492
+ onInput: (e) => setSearchTerm(e.target.value),
42493
+ placeholder: "Search for Experiments/Settings 🔎",
42494
+ trimOnBlur: true,
42495
+ spellCheck: false,
42496
+ "aria-label": "Search experiments or settings",
42497
+ "aria-invalid": false
42498
+ }
42499
+ )
42270
42500
  ] });
42271
- const footer = /* @__PURE__ */ jsx(Button, { label: "Get LE data", onClick: () => fetchRootLeData(), disabled: !getRootLegalEntity });
42272
- return /* @__PURE__ */ jsx(Modal, { size: "large", header, footer, onClose: onExit, children: /* @__PURE__ */ jsxs(Fragment, { children: [
42273
- /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-debug-modal__meta", children: [
42274
- /* @__PURE__ */ jsxs("span", { children: [
42275
- "SDK version: ",
42276
- "3.34.0"
42277
- ] }),
42278
- /* @__PURE__ */ jsxs("span", { children: [
42279
- "rootLegalEntityId: ",
42280
- rootLegalEntityId
42281
- ] })
42501
+ const footer = /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-debug-modal__footer", children: [
42502
+ /* @__PURE__ */ jsxs("div", { children: [
42503
+ /* @__PURE__ */ jsx(
42504
+ Button,
42505
+ {
42506
+ label: "Copy debug info",
42507
+ "aria-label": "Copy debug info",
42508
+ icon: "document",
42509
+ onClick: () => {
42510
+ copyToClipboard().catch((error) => {
42511
+ logger.error("Error copying to clipboard:", error);
42512
+ });
42513
+ }
42514
+ }
42515
+ ),
42516
+ debugInfoCopied ? /* @__PURE__ */ jsxs("span", { className: "adyen-kyc-debug-modal__footer--copy-status", children: [
42517
+ /* @__PURE__ */ jsx(Icon, { name: "check" }),
42518
+ " Copied!"
42519
+ ] }) : void 0
42282
42520
  ] }),
42521
+ /* @__PURE__ */ jsx(
42522
+ Button,
42523
+ {
42524
+ icon: isRootLeDataEnabled ? "show" : "hide",
42525
+ iconPosition: "left",
42526
+ "aria-label": isRootLeDataEnabled ? "Hide LegalEntity Data" : "Show LegalEntity Data",
42527
+ label: isRootLeDataEnabled ? "Hide LegalEntity Data" : "Show LegalEntity Data",
42528
+ onClick: handleToggleRootLeData
42529
+ }
42530
+ )
42531
+ ] });
42532
+ return /* @__PURE__ */ jsx(Modal, { size: "fullscreen", header, footer, onClose: onExit, children: /* @__PURE__ */ jsxs(Fragment, { children: [
42533
+ /* @__PURE__ */ jsx("div", { className: "adyen-kyc-debug-modal__meta", children: /* @__PURE__ */ jsx("table", { children: /* @__PURE__ */ jsxs("tbody", { children: [
42534
+ /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
42535
+ /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "SDK version" }),
42536
+ /* @__PURE__ */ jsx(Tag, { variant: "green", className: "adyen-kyc-tag--large", children: "3.35.0" })
42537
+ ] }) }),
42538
+ /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsxs("td", { children: [
42539
+ /* @__PURE__ */ jsx("span", { className: "adyen-kyc-debug-modal__table-key", children: "rootLegalEntityId" }),
42540
+ /* @__PURE__ */ jsx(Tag, { variant: "blue", className: "adyen-kyc-tag--large", children: rootLegalEntityId })
42541
+ ] }) })
42542
+ ] }) }) }),
42283
42543
  /* @__PURE__ */ jsxs("div", { className: "adyen-kyc-debug-modal__content", children: [
42544
+ rootLeData ? /* @__PURE__ */ jsxs(Fragment, { children: [
42545
+ /* @__PURE__ */ jsx("h2", { children: "Legal Entity Data" }),
42546
+ /* @__PURE__ */ jsx("pre", { children: JSON.stringify(rootLeData, null, 2) })
42547
+ ] }) : void 0,
42284
42548
  /* @__PURE__ */ jsx(
42285
42549
  DebugTable,
42286
42550
  {
42287
42551
  data: allExperimentsWithValues,
42288
- keyHeading: "Experiment",
42289
- valueHeading: "Value"
42552
+ keyHeading: "Experiments",
42553
+ searchTerm
42290
42554
  }
42291
42555
  ),
42292
- /* @__PURE__ */ jsx(DebugTable, { data: allSettingsWithValues, keyHeading: "Setting", valueHeading: "Value" })
42293
- ] }),
42294
- rootLeData ? /* @__PURE__ */ jsx("pre", { children: JSON.stringify(rootLeData, null, 2) }) : void 0
42556
+ /* @__PURE__ */ jsx(DebugTable, { data: allSettingsWithValues, keyHeading: "Settings", searchTerm })
42557
+ ] })
42295
42558
  ] }) });
42296
42559
  };
42297
42560
  const DebugWrapper = ({